From 08831b2a0dc30d94800d11c194589de4fe9f2d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Eri=C5=9Fen?= Date: Wed, 28 Sep 2022 15:17:49 -0700 Subject: [PATCH 1/4] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 514a169..4227d5f 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ const appSettings = { }, authRoutes: { redirect: "/redirect", // redirect path or the full URI configured on Azure AD - unauthorized: "/unauthorized" // unauthorized access attempts will be redirected to this route + unauthorized: "/unauthorized", // unauthorized access attempts will be redirected to this route frontChannelLogout: "/sso_logout" // front-channel logout path or the full URI configured on Azure AD }, protectedResources: { From bbff4289f1b4081527581fee611cd94988c877cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Eri=C5=9Fen?= Date: Mon, 10 Oct 2022 10:20:12 -0700 Subject: [PATCH 2/4] Bump azure dependencies --- ...rosoft-identity-express.cjs.development.js | 2 +- ...ft-identity-express.cjs.development.js.map | 2 +- ...oft-identity-express.cjs.production.min.js | 2 +- ...identity-express.cjs.production.min.js.map | 2 +- dist/microsoft-identity-express.esm.js | 4 +- dist/microsoft-identity-express.esm.js.map | 2 +- docs/classes/AppServiceWebAppAuthClient.html | 12 +- docs/classes/ConfigHelper.html | 10 +- docs/classes/FetchManager.html | 6 +- docs/classes/KeyVaultManager.html | 6 +- docs/classes/MsalConfiguration.html | 2 +- docs/classes/MsalWebAppAuthClient.html | 20 +- docs/classes/WebAppAuthClientBuilder.html | 2 +- docs/index.html | 8 +- docs/modules.html | 2 +- package-lock.json | 5150 +++++++++++++---- package.json | 15 +- src/client/webapp/MsalWebAppAuthClient.ts | 5 +- 18 files changed, 4106 insertions(+), 1146 deletions(-) diff --git a/dist/microsoft-identity-express.cjs.development.js b/dist/microsoft-identity-express.cjs.development.js index 8fae91e..50d440f 100644 --- a/dist/microsoft-identity-express.cjs.development.js +++ b/dist/microsoft-identity-express.cjs.development.js @@ -1833,7 +1833,7 @@ var MsalWebAppAuthClient = /*#__PURE__*/function (_BaseAuthClient) { _context3.prev = 17; _context3.t0 = _context3["catch"](6); - if (!(_context3.t0 instanceof msalCommon.InteractionRequiredAuthError || _context3.t0 instanceof msalCommon.ClientAuthError)) { + if (!(_context3.t0 instanceof msalCommon.InteractionRequiredAuthError)) { _context3.next = 26; break; } diff --git a/dist/microsoft-identity-express.cjs.development.js.map b/dist/microsoft-identity-express.cjs.development.js.map index 6eb1e41..6228be1 100644 --- a/dist/microsoft-identity-express.cjs.development.js.map +++ b/dist/microsoft-identity-express.cjs.development.js.map @@ -1 +1 @@ -{"version":3,"file":"microsoft-identity-express.cjs.development.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/utils/Constants.ts","../src/config/AppSettings.ts","../src/config/ConfigHelper.ts","../src/client/BaseAuthClientBuilder.ts","../src/utils/CryptoUtils.ts","../src/packageMetadata.ts","../src/client/BaseAuthClient.ts","../src/network/FetchManager.ts","../src/utils/UrlUtils.ts","../src/client/webapp/MsalWebAppAuthClient.ts","../src/client/webapp/AppServiceWebAppAuthClient.ts","../src/network/KeyVaultManager.ts","../src/config/MsalConfiguration.ts","../src/utils/EnvironmentUtils.ts","../src/client/webapp/WebAppAuthClientBuilder.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions, LogLevel } from '@azure/msal-common';\r\n\r\n/**\r\n * Basic authentication stages used to determine\r\n * appropriate action after redirect occurs\r\n */\r\nexport enum AppStages {\r\n SIGN_IN = 'sign_in',\r\n SIGN_OUT = 'sign_out',\r\n ACQUIRE_TOKEN = 'acquire_token',\r\n}\r\n\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nexport const AADAuthorityConstants = {\r\n COMMON: 'common',\r\n ORGANIZATIONS: 'organizations',\r\n CONSUMERS: 'consumers',\r\n};\r\n\r\n/**\r\n * String constants related credential type\r\n */\r\nexport enum KeyVaultCredentialTypes {\r\n SECRET = 'clientSecret',\r\n CERTIFICATE = 'clientCertificate',\r\n}\r\n\r\nexport const OIDC_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\r\n\r\n/**\r\n * Request headers used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationHeaders = {\r\n APP_SERVICE_AUTHENTICATION_HEADER: 'X-MSAL-APP-SERVICE-AUTHENTICATION',\r\n APP_SERVICE_ACCESS_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ACCESS-TOKEN',\r\n APP_SERVICE_ID_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ID-TOKEN',\r\n APP_SERVICE_REFRESH_TOKEN_HEADER: 'X-MS-TOKEN-AAD-REFRESH-TOKEN',\r\n APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER: 'X-MS-TOKEN-AAD-EXPIRES-ON',\r\n APP_SERVICE_USER_OID_HEADER: 'X-MS-CLIENT-PRINCIPAL-ID',\r\n APP_SERVICE_USER_UPN_HEADER: 'X-MS-CLIENT-PRINCIPAL-NAME',\r\n APP_SERVICE_IDP_X_HEADER: 'X-MS-CLIENT-PRINCIPAL-IDP',\r\n};\r\n\r\n/**\r\n * Endpoints used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationEndpoints = {\r\n ID_TOKEN_ENDPOINT: '/.auth/me',\r\n POST_LOGOUT_DEFAULT_ENDPOINT: '/.auth/logout/done',\r\n POST_LOGIN_DEFAULT_ENDPOINT: '/.auth/login/done',\r\n AAD_SIGN_IN_ENDPOINT: '/.auth/login/aad',\r\n AAD_SIGN_OUT_ENDPOINT: '/.auth/logout',\r\n TOKEN_REFRESH_ENDPOINT: '/.auth/refresh',\r\n AAD_REDIRECT_ENDPOINT: '/.auth/login/aad/callback',\r\n};\r\n\r\n/**\r\n * Query parameters used by App Service authentication endpoints\r\n */\r\nexport const AppServiceAuthenticationQueryParameters = {\r\n POST_LOGIN_REDIRECT_QUERY_PARAM: '?post_login_redirect_url=',\r\n POST_LOGOUT_REDIRECT_QUERY_PARAM: '?post_logout_redirect_uri=',\r\n};\r\n\r\n/**\r\n * Environment variables used by App Service authentication\r\n */\r\nexport const AppServiceEnvironmentVariables = {\r\n WEBSITE_AUTH_ENABLED: 'WEBSITE_AUTH_ENABLED',\r\n WEBSITE_AUTH_ALLOWED_AUDIENCES: 'WEBSITE_AUTH_ALLOWED_AUDIENCES',\r\n WEBSITE_AUTH_DEFAULT_PROVIDER: 'WEBSITE_AUTH_DEFAULT_PROVIDER',\r\n WEBSITE_AUTH_TOKEN_STORE: 'WEBSITE_AUTH_TOKEN_STORE',\r\n WEBSITE_AUTH_LOGIN_PARAMS: 'WEBSITE_AUTH_LOGIN_PARAMS',\r\n WEBSITE_AUTH_PRESERVE_URL_FRAGMENT: 'WEBSITE_AUTH_PRESERVE_URL_FRAGMENT',\r\n WEBSITE_AUTH_OPENID_ISSUER: 'WEBSITE_AUTH_OPENID_ISSUER',\r\n WEBSITE_AUTH_CLIENT_ID: 'WEBSITE_AUTH_CLIENT_ID',\r\n WEBSITE_HOSTNAME: 'WEBSITE_HOSTNAME',\r\n WEBSITE_SITE_NAME: 'WEBSITE_SITE_NAME',\r\n WEBSITE_AUTH_REQUIRE_HTTPS: 'WEBSITE_AUTH_REQUIRE_HTTPS',\r\n WEBSITE_AUTH_UNAUTHENTICATED_ACTION: 'WEBSITE_AUTH_UNAUTHENTICATED_ACTION',\r\n WEBSITE_AUTH_API_PREFIX: 'WEBSITE_AUTH_API_PREFIX',\r\n MICROSOFT_PROVIDER_AUTHENTICATION_SECRET: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET',\r\n};\r\n\r\n/**\r\n * Constants used in access control scenarios\r\n */\r\nexport const AccessControlConstants = {\r\n GROUPS: 'groups',\r\n ROLES: 'roles',\r\n CLAIM_NAMES: '_claim_name',\r\n CLAIM_SOURCES: '_claim_sources',\r\n PAGINATION_LINK: '@odata.nextLink',\r\n GRAPH_MEMBERS_ENDPOINT: 'https://graph.microsoft.com/v1.0/me/memberOf',\r\n GRAPH_MEMBER_SCOPES: 'User.Read GroupMember.Read.All',\r\n};\r\n\r\n/**\r\n * Various information constants\r\n */\r\nexport const InfoMessages = {\r\n APP_SERVICE_AUTH_DETECTED: 'App Service Authentication detected',\r\n REQUEST_FOR_RESOURCE: 'Request made to web API',\r\n OVERAGE_OCCURRED: 'User has too many groups. Groups overage claim occurred',\r\n};\r\n\r\n/**\r\n * Various error constants\r\n */\r\nexport const ErrorMessages = {\r\n NOT_PERMITTED: 'Not permitted',\r\n INVALID_TOKEN: 'Invalid token',\r\n CANNOT_DETERMINE_APP_STAGE: 'Cannot determine application stage',\r\n CANNOT_VALIDATE_TOKEN: 'Cannot validate token',\r\n CSRF_TOKEN_MISMATCH: 'CSRF token in response does not match to original request',\r\n INTERACTION_REQUIRED: 'interaction_required',\r\n TOKEN_ACQUISITION_FAILED: 'Token acquisition failed',\r\n TOKEN_RESPONSE_NULL: 'Token response is null',\r\n AUTH_CODE_URL_NOT_OBTAINED: 'Authorization code url cannot be obtained',\r\n TOKEN_NOT_FOUND: 'No token found',\r\n TOKEN_NOT_DECODED: 'Token cannot be decoded',\r\n TOKEN_NOT_VERIFIED: 'Token cannot be verified',\r\n KEYS_NOT_OBTAINED: 'Signing keys cannot be obtained',\r\n STATE_NOT_FOUND: 'State not found',\r\n USER_HAS_NO_ROLE: 'User does not have any roles',\r\n USER_NOT_IN_ROLE: 'User does not have this role',\r\n USER_HAS_NO_GROUP: 'User does not have any groups',\r\n USER_NOT_IN_GROUP: 'User does not have this group',\r\n METHOD_NOT_ALLOWED: 'Method not allowed for this route',\r\n RULE_NOT_FOUND: 'No rule found for this route',\r\n SESSION_NOT_FOUND: 'No session found for this request',\r\n KEY_VAULT_CONFIG_NOT_FOUND: 'No coordinates found for Key Vault',\r\n CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT: 'Cannot obtain credentials from Key Vault',\r\n SESSION_KEY_NOT_FOUND: 'No session key found in session. Cannot encrypt state data',\r\n AUTH_CODE_REQUEST_OBJECT_NOT_FOUND: 'No auth code request object found in session',\r\n ID_TOKEN_CLAIMS_NOT_FOUND: 'No id token claims found in session',\r\n};\r\n\r\n/**\r\n * Various configuration error constants\r\n */\r\nexport const ConfigurationErrorMessages = {\r\n AUTH_ROUTES_NOT_CONFIGURED:\r\n 'Authentication routes are not defined. Ensure that the application settings are configured properly.',\r\n NO_PROTECTED_RESOURCE_CONFIGURED:\r\n 'No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.',\r\n NO_ACCESS_MATRIX_CONFIGURED:\r\n 'No access matrix is configured to control access for. Ensure that the application settings are configured properly.',\r\n NO_CLIENT_ID: 'No clientId provided!',\r\n INVALID_CLIENT_ID: 'Invalid clientId!',\r\n NO_TENANT_INFO: 'No tenant info provided!',\r\n INVALID_TENANT_INFO: 'Invalid tenant info!',\r\n NO_CLIENT_CREDENTIAL: 'No client credential provided!',\r\n NO_REDIRECT_URI: 'No redirect URI provided!',\r\n NO_UNAUTHORIZED_ROUTE: 'No unauthorized route provided!',\r\n};\r\n\r\n/**\r\n * For more information, visit: https://login.microsoftonline.com/error\r\n */\r\nexport const ErrorCodes = {\r\n 65001: 'AADSTS65001', // consent required\r\n 50076: 'AADSTS50076', // mfa required\r\n 50079: 'AADSTS50079', // mfa enrollment required\r\n 50001: 'AADSTS50001', // invalid resource uri\r\n 65004: 'AADSTS65004', // user declined consent\r\n 70011: 'AADSTS70011', // invalid scope\r\n 700022: 'AADSTS700022', // multiple resources\r\n 700020: 'AADSTS700020', // interaction required\r\n 90118: 'AADB2C90118', // password forgotten (B2C)\r\n};\r\n\r\nexport const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\r\n loggerCallback: (logLevel, message, containsPii) => {\r\n if (containsPii) {\r\n return;\r\n }\r\n console.info(message);\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions } from '@azure/msal-common';\r\n\r\nexport type AppSettings = {\r\n appCredentials: AppCredentials;\r\n loggerOptions?: LoggerOptions;\r\n b2cPolicies?: Record;\r\n accessMatrix?: Record;\r\n};\r\n\r\nexport type WebAppSettings = AppSettings & {\r\n authRoutes: AuthRoutes;\r\n protectedResources?: Record\r\n};\r\n\r\nexport type AppCredentials = {\r\n instance?: string;\r\n clientId: string;\r\n tenantId: string;\r\n clientSecret?: string;\r\n clientCertificate?: ClientCertificate;\r\n};\r\n\r\nexport type ClientCertificate = {\r\n thumbprint: string;\r\n privateKey: string;\r\n x5c?: string;\r\n};\r\n\r\nexport type KeyVaultCredential = {\r\n credentialType: string;\r\n credentialName: string;\r\n keyVaultUrl: string;\r\n};\r\n\r\nexport type AuthRoutes = {\r\n redirect: string;\r\n unauthorized: string;\r\n frontChannelLogout?: string;\r\n};\r\n\r\nexport type Policy = {\r\n authority: string;\r\n};\r\n\r\nexport type Resource = {\r\n endpoint: string;\r\n scopes: string[];\r\n accessToken?: string;\r\n};\r\n\r\nexport type AccessRule = {\r\n path: string;\r\n methods: string[];\r\n roles?: string[];\r\n groups?: string[];\r\n};\r\n\r\nexport enum AppType {\r\n WebApp\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AADAuthorityConstants, ConfigurationErrorMessages, OIDC_SCOPES } from '../utils/Constants';\r\nimport { AppSettings, AppType, Resource, WebAppSettings } from './AppSettings';\r\n\r\nexport class ConfigHelper {\r\n /**\r\n * Validates the fields in the configuration file\r\n * @param {AppSettings} appSettings: configuration object\r\n * @returns {void}\r\n */\r\n static validateAppSettings(appSettings: AppSettings, appType: AppType): void {\r\n if (StringUtils.isEmpty(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_CLIENT_ID);\r\n } else if (!ConfigHelper.isGuid(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_CLIENT_ID);\r\n }\r\n\r\n if (StringUtils.isEmpty(appSettings.appCredentials.tenantId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_TENANT_INFO);\r\n } else if (\r\n !ConfigHelper.isGuid(appSettings.appCredentials.tenantId) &&\r\n !Object.values(AADAuthorityConstants).includes(appSettings.appCredentials.tenantId)\r\n ) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_TENANT_INFO);\r\n }\r\n\r\n switch (appType) {\r\n case AppType.WebApp:\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.redirect)) {\r\n throw new Error(ConfigurationErrorMessages.NO_REDIRECT_URI);\r\n }\r\n\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.unauthorized)) {\r\n throw new Error(ConfigurationErrorMessages.NO_UNAUTHORIZED_ROUTE);\r\n }\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Verifies if a string is GUID\r\n * @param {string} guid\r\n * @returns {boolean}\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Util method to get the resource name for a given scope(s)\r\n * @param {Array} scopes: an array of scopes that the resource is associated with\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string {\r\n const index = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).findIndex((resource: Resource) =>\r\n JSON.stringify(resource.scopes.sort()) === JSON.stringify(scopes.sort())\r\n );\r\n\r\n const resourceName = Object.keys({\r\n ...webAppSettings.protectedResources,\r\n })[index];\r\n\r\n return resourceName;\r\n }\r\n\r\n /**\r\n * Util method to get the scopes for a given resource name\r\n * @param {string} resourceEndpoint: the resource name\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[] {\r\n const scopes = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).find((resource: Resource) => resource.endpoint === resourceEndpoint)?.scopes;\r\n\r\n return scopes ? scopes : [];\r\n }\r\n\r\n /**\r\n * Util method to strip the default OIDC scopes from the scopes array\r\n * @param {Array} scopesList full list of scopes for this resource\r\n * @returns\r\n */\r\n static getEffectiveScopes(scopesList: string[]): string[] {\r\n const effectiveScopesList = scopesList.filter(scope => !OIDC_SCOPES.includes(scope));\r\n return effectiveScopesList;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICachePlugin } from '@azure/msal-node';\r\n\r\nimport { ConfigHelper } from '../config/ConfigHelper';\r\nimport { AppSettings, AppType, KeyVaultCredential } from '../config/AppSettings';\r\n\r\nexport abstract class BaseAuthClientBuilder {\r\n appSettings: AppSettings;\r\n protected keyVaultCredential: KeyVaultCredential | undefined;\r\n protected customCachePlugin: ICachePlugin | undefined;\r\n\r\n protected constructor(appSettings: AppSettings, appType: AppType) {\r\n ConfigHelper.validateAppSettings(appSettings, appType);\r\n this.appSettings = appSettings;\r\n }\r\n\r\n withKeyVaultCredentials(keyVaultCredential: KeyVaultCredential): BaseAuthClientBuilder {\r\n this.keyVaultCredential = keyVaultCredential;\r\n return this;\r\n }\r\n\r\n withCustomCachePlugin(cachePlugin: ICachePlugin): BaseAuthClientBuilder {\r\n this.customCachePlugin = cachePlugin;\r\n return this;\r\n }\r\n\r\n abstract build(): any;\r\n\r\n abstract buildAsync(): Promise;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport * as crypto from 'crypto';\r\n\r\nexport class CryptoUtils {\r\n private algorithm: string;\r\n\r\n constructor(algorithm: string = 'aes-192-cbc') {\r\n this.algorithm = algorithm;\r\n }\r\n\r\n generateSalt(): string {\r\n return crypto.randomBytes(20).toString('hex');\r\n }\r\n\r\n createKey(password: string, salt: string): Buffer {\r\n return crypto.scryptSync(password, salt, 24);\r\n }\r\n\r\n encryptData(stringifiedData: string, key: Buffer): string {\r\n const iv = crypto.randomBytes(16);\r\n const cipher = crypto.createCipheriv(this.algorithm, key, iv);\r\n const encryptedData = cipher.update(stringifiedData, 'utf8', 'hex');\r\n\r\n return [iv.toString('hex'), encryptedData + cipher.final('hex')].join('.');\r\n }\r\n\r\n decryptData(encryptedData: string, key: Buffer): string {\r\n const [iv, encrypted] = encryptedData.split('.');\r\n const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(iv, 'hex'));\r\n return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const packageName = '@azure-samples/microsoft-identity-express';\r\nexport const packageVersion = 'beta';\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from '@azure/msal-common';\r\nimport { ConfidentialClientApplication, Configuration, CryptoProvider } from '@azure/msal-node';\r\n\r\nimport { AppSettings } from '../config/AppSettings';\r\nimport { CryptoUtils } from '../utils/CryptoUtils';\r\nimport { packageName, packageVersion } from '../packageMetadata';\r\n\r\nexport abstract class BaseAuthClient {\r\n appSettings: AppSettings;\r\n\r\n protected msalConfig: Configuration;\r\n protected msalClient: ConfidentialClientApplication;\r\n protected cryptoProvider: CryptoProvider;\r\n protected cryptoUtils: CryptoUtils;\r\n protected logger: Logger;\r\n\r\n protected constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n this.appSettings = appSettings;\r\n this.msalConfig = msalConfig;\r\n this.cryptoProvider = new CryptoProvider();\r\n this.cryptoUtils = new CryptoUtils();\r\n\r\n this.logger = new Logger(this.msalConfig.system?.loggerOptions!, packageName, packageVersion);\r\n\r\n this.msalClient = new ConfidentialClientApplication(this.msalConfig);\r\n }\r\n\r\n getMsalClient(): ConfidentialClientApplication {\r\n return this.msalClient;\r\n }\r\n\r\n getMsalConfig(): Configuration {\r\n return this.msalConfig;\r\n }\r\n\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport axios, { AxiosResponse, AxiosRequestConfig } from 'axios';\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AccessControlConstants, ErrorMessages } from '../utils/Constants';\r\n\r\nexport class FetchManager {\r\n /**\r\n * Calls a resource endpoint\r\n * @param {string} endpoint\r\n * @returns {Promise}\r\n */\r\n static callApiEndpoint = async (endpoint: string): Promise => {\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Calls a resource endpoint with a raw access token\r\n * using the authorization bearer token scheme\r\n * @param {string} endpoint\r\n * @param {string} accessToken\r\n * @returns {Promise}\r\n */\r\n static callApiEndpointWithToken = async (endpoint: string, accessToken: string): Promise> => {\r\n if (StringUtils.isEmpty(accessToken)) {\r\n throw new Error(ErrorMessages.TOKEN_NOT_FOUND);\r\n }\r\n\r\n const options: AxiosRequestConfig = {\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint, options);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Handles queries against Microsoft Graph that return multiple pages of data\r\n * @param {string} accessToken: access token required by endpoint\r\n * @param {string} nextPage: next page link\r\n * @param {Array} data: stores data from each page\r\n * @returns {Promise}\r\n */\r\n static handlePagination = async (accessToken: string, nextPage: string, data: string[] = []): Promise => {\r\n try {\r\n const graphResponse = await (await FetchManager.callApiEndpointWithToken(nextPage, accessToken)).data;\r\n graphResponse['value'].map((v: any) => data.push(v.id));\r\n\r\n if (graphResponse[AccessControlConstants.PAGINATION_LINK]) {\r\n return await FetchManager.handlePagination(\r\n accessToken,\r\n graphResponse[AccessControlConstants.PAGINATION_LINK],\r\n data\r\n );\r\n } else {\r\n return data;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Request } from 'express';\r\nimport { IUri, UrlString } from '@azure/msal-common';\r\n\r\nexport class UrlUtils {\r\n /**\r\n * Gets the absolute URL from a given request and path string\r\n * @param {Request} req: express request object\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static ensureAbsoluteUrl = (req: Request, url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n\r\n if (!urlComponents.Protocol) {\r\n if (!urlComponents.HostNameAndPort && !url.startsWith('www')) {\r\n if (!url.startsWith('/')) {\r\n return req.protocol + '://' + req.get('host') + '/' + url;\r\n }\r\n return req.protocol + '://' + req.get('host') + url;\r\n }\r\n return req.protocol + '://' + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n /**\r\n * Gets the path segment from a given URL\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static getPathFromUrl = (url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n return `/${urlComponents.PathSegments.join('/')}`;\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { RequestHandler, Request, Response, NextFunction, Router } from 'express';\r\nimport { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, ClientAuthError, StringUtils, ResponseMode } from '@azure/msal-common';\r\nimport { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node';\r\nimport { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings';\r\nimport { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions';\r\nimport { AppStages, ErrorMessages, AccessControlConstants, ConfigurationErrorMessages } from '../../utils/Constants';\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { FetchManager } from '../../network/FetchManager';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { AppState } from '../../utils/Types';\r\n\r\n/**\r\n * A simple wrapper around MSAL Node ConfidentialClientApplication object.\r\n * It offers a collection of middleware and utility methods that automate\r\n * basic authentication and authorization tasks in Express web apps\r\n */\r\nexport class MsalWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction) => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n next();\r\n });\r\n\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n if (this.webAppSettings.authRoutes.frontChannelLogout) {\r\n /**\r\n * Expose front-channel logout route. For more information, visit:\r\n * https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#single-sign-out\r\n */\r\n appRouter.get(this.webAppSettings.authRoutes.frontChannelLogout, (req: Request, res: Response) => {\r\n req.session.destroy(() => {\r\n res.sendStatus(200);\r\n });\r\n });\r\n }\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): Promise => {\r\n const appState = {\r\n appStage: AppStages.SIGN_IN,\r\n redirectTo: options.postLoginRedirect,\r\n csrfToken: req.session.csrfToken,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationCodeRequest;\r\n\r\n // get url to sign user in\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return async (req: Request, res: Response): Promise => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n\r\n /**\r\n * Construct a logout URI and redirect the user to end the\r\n * session with Azure AD/B2C. For more information, visit:\r\n * (AAD) https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#send-a-sign-out-request\r\n * (B2C) https://docs.microsoft.com/azure/active-directory-b2c/openid-connect#send-a-sign-out-request\r\n */\r\n const logoutUri = `${this.msalConfig.auth.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${postLogoutRedirectUri}`;\r\n\r\n const tokenCache = this.msalClient.getTokenCache();\r\n\r\n const account = req.session.account?.homeAccountId\r\n ?\r\n await tokenCache.getAccountByHomeId(req.session.account.homeAccountId)\r\n :\r\n await tokenCache.getAccountByLocalId(req.session.account?.localAccountId!);\r\n\r\n if (account) {\r\n await tokenCache.removeAccount(account);\r\n }\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!req.session.key) {\r\n this.logger.error(ErrorMessages.SESSION_KEY_NOT_FOUND);\r\n return next(new Error(ErrorMessages.SESSION_KEY_NOT_FOUND));\r\n }\r\n\r\n if (!req.session.authorizationCodeRequest) {\r\n this.logger.error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND);\r\n return next(new Error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND));\r\n }\r\n\r\n if (req.body.state) {\r\n const state: AppState = JSON.parse(\r\n this.cryptoUtils.decryptData(\r\n this.cryptoProvider.base64Decode(req.body.state as string),\r\n Buffer.from(req.session.key, 'hex')\r\n )\r\n );\r\n\r\n // check if csrfToken matches\r\n if (state.csrfToken === req.session.csrfToken) {\r\n switch (state.appStage) {\r\n case AppStages.SIGN_IN: {\r\n // token request should have auth code\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n // exchange auth code for tokens\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.isAuthenticated = true;\r\n req.session.account = tokenResponse.account!; // this won't be null in any web app scenario\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n case AppStages.ACQUIRE_TOKEN: {\r\n // get the name of the resource associated with scope\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(\r\n req.session.authorizationCodeRequest.scopes,\r\n this.webAppSettings\r\n );\r\n\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n accessToken: tokenResponse.accessToken,\r\n } as Resource,\r\n };\r\n\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n next(new Error(ErrorMessages.CANNOT_DETERMINE_APP_STAGE));\r\n break;\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens via acquireToken*\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const scopes = options.resource.scopes;\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n try {\r\n const silentRequest = {\r\n account: req.session.account,\r\n scopes: scopes,\r\n } as SilentFlowRequest;\r\n\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse || StringUtils.isEmpty(tokenResponse.accessToken)) {\r\n // In B2C scenarios, sometimes an access token is returned empty.\r\n // In that case, we will acquire token interactively instead.\r\n\r\n throw new InteractionRequiredAuthError(ErrorMessages.INTERACTION_REQUIRED);\r\n }\r\n\r\n req.session.protectedResources[resourceName].accessToken = tokenResponse.accessToken;\r\n next();\r\n } catch (error) {\r\n // in case there are no cached tokens, initiate an interactive call\r\n // FIXME: ClientAuthError used for temporary workaround regarding issue: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/4878\r\n if (error instanceof InteractionRequiredAuthError || error instanceof ClientAuthError) {\r\n const appState = {\r\n appStage: AppStages.ACQUIRE_TOKEN,\r\n redirectTo: req.originalUrl,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: scopes,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: scopes,\r\n } as AuthorizationCodeRequest;\r\n\r\n // initiate the first leg of auth code grant to get token\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n } else {\r\n next(error);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Checks if the user has access for this route, defined in access matrix\r\n * @param {GuardOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n hasAccess(options: GuardOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.accessMatrix) {\r\n this.logger.error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED));\r\n }\r\n\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const checkFor = options.accessRule.hasOwnProperty(AccessControlConstants.GROUPS)\r\n ? AccessControlConstants.GROUPS\r\n : AccessControlConstants.ROLES;\r\n\r\n switch (checkFor) {\r\n case AccessControlConstants.GROUPS:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.GROUPS]) {\r\n if (\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_NAMES] ||\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_SOURCES]\r\n ) {\r\n return await this.handleOverage(req, res, next, options.accessRule);\r\n } else {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n const groups = req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, groups, AccessControlConstants.GROUPS)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.ROLES]) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n const roles = req.session.account.idTokenClaims[AccessControlConstants.ROLES] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, roles, AccessControlConstants.ROLES)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n };\r\n }\r\n\r\n // ============== UTILS ===============\r\n\r\n /**\r\n * This method is used to generate an auth code url request\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AuthCodeParams} params: modifies auth code url request\r\n * @returns {Promise}\r\n */\r\n private async redirectToAuthCodeUrl(\r\n req: Request,\r\n res: Response,\r\n next: NextFunction,\r\n authUrlParams: AuthorizationUrlRequest,\r\n authCodeParams: AuthorizationCodeRequest,\r\n appState: AppState\r\n ): Promise {\r\n // add session csrfToken for crsf\r\n req.session.csrfToken = this.cryptoProvider.createNewGuid();\r\n\r\n const key = this.cryptoUtils.createKey(req.session.csrfToken, this.cryptoUtils.generateSalt());\r\n req.session.key = key.toString('hex');\r\n\r\n const state = JSON.stringify({\r\n ...appState,\r\n csrfToken: req.session.csrfToken,\r\n });\r\n\r\n // prepare the request\r\n req.session.authorizationUrlRequest = {\r\n ...authUrlParams,\r\n state: this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(state, key)),\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n responseMode: ResponseMode.FORM_POST\r\n };\r\n\r\n req.session.authorizationCodeRequest = {\r\n ...authCodeParams,\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n code: ''\r\n };\r\n\r\n // request an authorization code to exchange for tokens\r\n try {\r\n const response = await this.msalClient.getAuthCodeUrl(req.session.authorizationUrlRequest);\r\n res.redirect(response);\r\n } catch (error) {\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles group overage claims by querying MS Graph /memberOf endpoint\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AccessRule} rule: a given access rule\r\n * @returns {Promise}\r\n */\r\n private async handleOverage(req: Request, res: Response, next: NextFunction, rule: AccessRule): Promise {\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const { _claim_names, _claim_sources, ...newIdTokenClaims } = req.session.account.idTokenClaims;\r\n\r\n const silentRequest: SilentFlowRequest = {\r\n account: req.session.account,\r\n scopes: AccessControlConstants.GRAPH_MEMBER_SCOPES.split(' '),\r\n };\r\n\r\n try {\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n try {\r\n const graphResponse = await FetchManager.callApiEndpointWithToken(\r\n AccessControlConstants.GRAPH_MEMBERS_ENDPOINT,\r\n tokenResponse.accessToken\r\n );\r\n\r\n /**\r\n * Some queries against Microsoft Graph return multiple pages of data either due to server-side paging\r\n * or due to the use of the $top query parameter to specifically limit the page size in a request.\r\n * When a result set spans multiple pages, Microsoft Graph returns an @odata.nextLink property in\r\n * the response that contains a URL to the next page of results. Learn more at https://docs.microsoft.com/graph/paging\r\n */\r\n if (graphResponse.data[AccessControlConstants.PAGINATION_LINK]) {\r\n try {\r\n const userGroups = await FetchManager.handlePagination(\r\n tokenResponse.accessToken,\r\n graphResponse.data[AccessControlConstants.PAGINATION_LINK]\r\n );\r\n\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: userGroups,\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } else {\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: graphResponse.data['value'].map((v: any) => v.id),\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } catch (error) {\r\n // TODO: handle silent token acquisition error\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the request passes a given access rule\r\n * @param {string} method: HTTP method for this route\r\n * @param {AccessRule} rule: access rule for this route\r\n * @param {Array} creds: user's credentials i.e. roles or groups\r\n * @param {string} credType: roles or groups\r\n * @returns {boolean}\r\n */\r\n private checkAccessRule(method: string, rule: AccessRule, creds: string[], credType: string): boolean {\r\n if (rule.methods.includes(method)) {\r\n switch (credType) {\r\n case AccessControlConstants.GROUPS:\r\n if (!rule.groups || rule.groups.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!rule.roles || rule.roles!.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { Router, RequestHandler, Request, Response, NextFunction } from 'express';\r\nimport { AccountInfo, AuthToken } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { AccessTokenClaims, IdTokenClaims } from '../../utils/Types';\r\nimport { AppSettings, Resource, WebAppSettings } from '../../config/AppSettings';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { SignInOptions, SignOutOptions, TokenRequestOptions } from '../MiddlewareOptions';\r\nimport {\r\n AppServiceAuthenticationHeaders,\r\n AppServiceEnvironmentVariables,\r\n AppServiceAuthenticationEndpoints,\r\n AppServiceAuthenticationQueryParameters,\r\n ErrorMessages,\r\n ConfigurationErrorMessages,\r\n} from '../../utils/Constants';\r\n\r\nexport class AppServiceWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @param {InitializationOptions} options\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n // handle redirect\r\n appRouter.get(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n if (!req.session.isAuthenticated) {\r\n // check headers for id token\r\n const rawIdToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawIdToken) {\r\n // parse the id token\r\n const idTokenClaims: IdTokenClaims = AuthToken.extractTokenClaims(rawIdToken, this.cryptoProvider);\r\n\r\n req.session.isAuthenticated = true;\r\n\r\n req.session.account = {\r\n tenantId: idTokenClaims.tid,\r\n homeAccountId: idTokenClaims.oid + '.' + idTokenClaims.tid,\r\n localAccountId: idTokenClaims.oid,\r\n environment: idTokenClaims.iss?.split('://')[1].split('/')[0],\r\n username: idTokenClaims.preferred_username,\r\n name: idTokenClaims.name,\r\n idTokenClaims: idTokenClaims,\r\n } as AccountInfo;\r\n }\r\n }\r\n\r\n next();\r\n });\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n let loginUri;\r\n const postLoginRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLoginRedirect);\r\n loginUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_IN_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGIN_REDIRECT_QUERY_PARAM +\r\n postLoginRedirectUri;\r\n res.redirect(loginUri);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n const logoutUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_OUT_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGOUT_REDIRECT_QUERY_PARAM +\r\n postLogoutRedirectUri;\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(options.resource.scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n const rawAccessToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawAccessToken) {\r\n const accessTokenClaims = AuthToken.extractTokenClaims(\r\n rawAccessToken,\r\n this.cryptoProvider\r\n ) as AccessTokenClaims;\r\n\r\n // get the name of the resource associated with scope\r\n const scopes = accessTokenClaims?.scp.split(' ');\r\n const effectiveScopes = ConfigHelper.getEffectiveScopes(scopes);\r\n\r\n if (options.resource.scopes.every(elem => effectiveScopes.includes(elem))) {\r\n req.session.protectedResources[resourceName].accessToken = rawAccessToken;\r\n return next();\r\n } else {\r\n return next(new Error('No tokens found for given scopes'));\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DefaultAzureCredential } from '@azure/identity';\r\nimport { CertificateClient, KeyVaultCertificate } from '@azure/keyvault-certificates';\r\nimport { KeyVaultSecret, SecretClient } from '@azure/keyvault-secrets';\r\n\r\nimport { KeyVaultCredential, ClientCertificate } from '../config/AppSettings';\r\nimport { KeyVaultCredentialTypes } from '../utils/Constants';\r\n\r\nexport type KeyVaultCredentialResponse = {\r\n type: KeyVaultCredentialTypes.SECRET | KeyVaultCredentialTypes.CERTIFICATE;\r\n value: string & ClientCertificate;\r\n};\r\n\r\nexport class KeyVaultManager {\r\n /**\r\n * Fetches credentials from Key Vault and updates appSettings\r\n * @param {AppSettings} appSettings\r\n * @returns {Promise}\r\n */\r\n async getCredentialFromKeyVault(keyVaultCredential: KeyVaultCredential): Promise {\r\n const credential = new DefaultAzureCredential();\r\n let response: KeyVaultCredentialResponse = {} as KeyVaultCredentialResponse;\r\n\r\n switch (keyVaultCredential.credentialType) {\r\n case KeyVaultCredentialTypes.SECRET: {\r\n try {\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.SECRET,\r\n value: secretResponse.value,\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n case KeyVaultCredentialTypes.CERTIFICATE: {\r\n try {\r\n const certificateResponse = await this.getCertificateCredential(keyVaultCredential, credential);\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.CERTIFICATE,\r\n value: {\r\n thumbprint: certificateResponse?.properties?.x509Thumbprint?.toString(),\r\n privateKey: secretResponse?.value?.split('-----BEGIN CERTIFICATE-----\\n')[0],\r\n },\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Gets a certificate credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getCertificateCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new CertificateClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultCertificate = await secretClient.getCertificate(keyVaultCredential.credentialName);\r\n return keyVaultCertificate;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a secret credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getSecretCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new SecretClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultSecret = await secretClient.getSecret(keyVaultCredential.credentialName);\r\n return keyVaultSecret;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { UrlString, Constants } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { DEFAULT_LOGGER_OPTIONS } from '../utils/Constants';\r\nimport { AppSettings } from './AppSettings';\r\n\r\nexport class MsalConfiguration {\r\n /**\r\n * Maps the custom configuration object to configuration\r\n * object expected by MSAL Node ConfidentialClientApplication class\r\n * @param {AppSettings} appSettings: configuration object\r\n * @param {ICachePlugin} cachePlugin: custom cache plugin\r\n * @param {IDistributedPersistence} distributedPersistence: distributed persistence client\r\n * @returns {Configuration}\r\n */\r\n static getMsalConfiguration(appSettings: AppSettings): Configuration {\r\n return {\r\n auth: {\r\n clientId: appSettings.appCredentials.clientId,\r\n authority: appSettings.b2cPolicies\r\n ? Object.entries(appSettings.b2cPolicies)[0][1]['authority'] // the first policy/user-flow is the default authority\r\n : appSettings.appCredentials.instance\r\n ? `https://${appSettings.appCredentials.instance}/${appSettings.appCredentials.tenantId}`\r\n : `https://${Constants.DEFAULT_AUTHORITY_HOST}/${appSettings.appCredentials.tenantId}`,\r\n ...(appSettings.appCredentials.hasOwnProperty('clientSecret') && {\r\n clientSecret: appSettings.appCredentials.clientSecret,\r\n }),\r\n ...(appSettings.appCredentials.hasOwnProperty('clientCertificate') && {\r\n clientCertificate: appSettings.appCredentials.clientCertificate,\r\n }),\r\n knownAuthorities: appSettings.b2cPolicies\r\n ? [UrlString.getDomainFromUrl(Object.entries(appSettings.b2cPolicies)[0][1]['authority'])] // in B2C scenarios\r\n : [],\r\n },\r\n system: {\r\n loggerOptions: appSettings.loggerOptions ? appSettings.loggerOptions : DEFAULT_LOGGER_OPTIONS,\r\n },\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AppServiceEnvironmentVariables } from './Constants';\r\n\r\nexport class EnvironmentUtils {\r\n static isProduction(): boolean {\r\n return process.env.NODE_ENV === 'production';\r\n }\r\n\r\n static isDevelopment(): boolean {\r\n return process.env.NODE_ENV === 'development';\r\n }\r\n\r\n static isAppServiceAuthEnabled(): boolean {\r\n return process.env[AppServiceEnvironmentVariables.WEBSITE_AUTH_ENABLED] === 'True';\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClientBuilder } from '../BaseAuthClientBuilder';\r\nimport { MsalWebAppAuthClient } from './MsalWebAppAuthClient';\r\nimport { AppServiceWebAppAuthClient } from './AppServiceWebAppAuthClient';\r\nimport { KeyVaultManager } from '../../network/KeyVaultManager';\r\nimport { MsalConfiguration } from '../../config/MsalConfiguration';\r\nimport { AppSettings, AppType } from '../../config/AppSettings';\r\nimport { EnvironmentUtils } from '../../utils/EnvironmentUtils';\r\nimport { ErrorMessages } from '../../utils/Constants';\r\n\r\nexport class WebAppAuthClientBuilder extends BaseAuthClientBuilder {\r\n appSettings!: AppSettings;\r\n private msalConfig!: Configuration;\r\n\r\n constructor(appSettings: AppSettings) {\r\n super(appSettings, AppType.WebApp);\r\n }\r\n\r\n build(): MsalWebAppAuthClient | AppServiceWebAppAuthClient {\r\n // TODO: throw error if key vault credential is being built\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n }\r\n\r\n async buildAsync(): Promise {\r\n try {\r\n if (this.keyVaultCredential) {\r\n const keyVaultManager = new KeyVaultManager();\r\n const credential = await keyVaultManager.getCredentialFromKeyVault(this.keyVaultCredential);\r\n this.appSettings.appCredentials[credential.type] = credential.value;\r\n }\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n } catch (error) {\r\n throw new Error(ErrorMessages.CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT);\r\n }\r\n }\r\n}\r\n"],"names":["undefined","AppStages","AADAuthorityConstants","COMMON","ORGANIZATIONS","CONSUMERS","KeyVaultCredentialTypes","OIDC_SCOPES","AppServiceAuthenticationHeaders","APP_SERVICE_AUTHENTICATION_HEADER","APP_SERVICE_ACCESS_TOKEN_HEADER","APP_SERVICE_ID_TOKEN_HEADER","APP_SERVICE_REFRESH_TOKEN_HEADER","APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER","APP_SERVICE_USER_OID_HEADER","APP_SERVICE_USER_UPN_HEADER","APP_SERVICE_IDP_X_HEADER","AppServiceAuthenticationEndpoints","ID_TOKEN_ENDPOINT","POST_LOGOUT_DEFAULT_ENDPOINT","POST_LOGIN_DEFAULT_ENDPOINT","AAD_SIGN_IN_ENDPOINT","AAD_SIGN_OUT_ENDPOINT","TOKEN_REFRESH_ENDPOINT","AAD_REDIRECT_ENDPOINT","AppServiceAuthenticationQueryParameters","POST_LOGIN_REDIRECT_QUERY_PARAM","POST_LOGOUT_REDIRECT_QUERY_PARAM","AppServiceEnvironmentVariables","WEBSITE_AUTH_ENABLED","WEBSITE_AUTH_ALLOWED_AUDIENCES","WEBSITE_AUTH_DEFAULT_PROVIDER","WEBSITE_AUTH_TOKEN_STORE","WEBSITE_AUTH_LOGIN_PARAMS","WEBSITE_AUTH_PRESERVE_URL_FRAGMENT","WEBSITE_AUTH_OPENID_ISSUER","WEBSITE_AUTH_CLIENT_ID","WEBSITE_HOSTNAME","WEBSITE_SITE_NAME","WEBSITE_AUTH_REQUIRE_HTTPS","WEBSITE_AUTH_UNAUTHENTICATED_ACTION","WEBSITE_AUTH_API_PREFIX","MICROSOFT_PROVIDER_AUTHENTICATION_SECRET","AccessControlConstants","GROUPS","ROLES","CLAIM_NAMES","CLAIM_SOURCES","PAGINATION_LINK","GRAPH_MEMBERS_ENDPOINT","GRAPH_MEMBER_SCOPES","ErrorMessages","NOT_PERMITTED","INVALID_TOKEN","CANNOT_DETERMINE_APP_STAGE","CANNOT_VALIDATE_TOKEN","CSRF_TOKEN_MISMATCH","INTERACTION_REQUIRED","TOKEN_ACQUISITION_FAILED","TOKEN_RESPONSE_NULL","AUTH_CODE_URL_NOT_OBTAINED","TOKEN_NOT_FOUND","TOKEN_NOT_DECODED","TOKEN_NOT_VERIFIED","KEYS_NOT_OBTAINED","STATE_NOT_FOUND","USER_HAS_NO_ROLE","USER_NOT_IN_ROLE","USER_HAS_NO_GROUP","USER_NOT_IN_GROUP","METHOD_NOT_ALLOWED","RULE_NOT_FOUND","SESSION_NOT_FOUND","KEY_VAULT_CONFIG_NOT_FOUND","CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT","SESSION_KEY_NOT_FOUND","AUTH_CODE_REQUEST_OBJECT_NOT_FOUND","ID_TOKEN_CLAIMS_NOT_FOUND","ConfigurationErrorMessages","AUTH_ROUTES_NOT_CONFIGURED","NO_PROTECTED_RESOURCE_CONFIGURED","NO_ACCESS_MATRIX_CONFIGURED","NO_CLIENT_ID","INVALID_CLIENT_ID","NO_TENANT_INFO","INVALID_TENANT_INFO","NO_CLIENT_CREDENTIAL","NO_REDIRECT_URI","NO_UNAUTHORIZED_ROUTE","DEFAULT_LOGGER_OPTIONS","loggerCallback","logLevel","message","containsPii","console","info","piiLoggingEnabled","LogLevel","Info","AppType","ConfigHelper","validateAppSettings","appSettings","appType","StringUtils","isEmpty","appCredentials","clientId","Error","isGuid","tenantId","Object","values","includes","WebApp","authRoutes","redirect","unauthorized","guid","regexGuid","test","getResourceNameFromScopes","scopes","webAppSettings","index","protectedResources","findIndex","resource","JSON","stringify","sort","resourceName","keys","getScopesFromResourceEndpoint","resourceEndpoint","find","endpoint","getEffectiveScopes","scopesList","effectiveScopesList","filter","scope","BaseAuthClientBuilder","withKeyVaultCredentials","keyVaultCredential","withCustomCachePlugin","cachePlugin","customCachePlugin","CryptoUtils","algorithm","generateSalt","crypto","toString","createKey","password","salt","encryptData","stringifiedData","key","iv","cipher","encryptedData","update","join","decryptData","split","encrypted","decipher","Buffer","from","packageName","packageVersion","BaseAuthClient","msalConfig","cryptoProvider","CryptoProvider","cryptoUtils","logger","Logger","system","loggerOptions","msalClient","ConfidentialClientApplication","getMsalClient","getMsalConfig","getLogger","FetchManager","axios","get","response","data","accessToken","options","headers","Authorization","nextPage","callApiEndpointWithToken","graphResponse","map","v","push","id","handlePagination","UrlUtils","req","url","urlComponents","UrlString","getUrlComponents","Protocol","HostNameAndPort","startsWith","protocol","PathSegments","MsalWebAppAuthClient","initialize","appRouter","express","Router","use","res","next","session","error","post","getPathFromUrl","handleRedirect","frontChannelLogout","destroy","sendStatus","signIn","postLoginRedirect","failureRedirect","appState","appStage","SIGN_IN","redirectTo","csrfToken","authUrlParams","OIDC_DEFAULT_SCOPES","authCodeParams","redirectToAuthCodeUrl","signOut","postLogoutRedirect","postLogoutRedirectUri","ensureAbsoluteUrl","logoutUri","auth","authority","tokenCache","getTokenCache","account","homeAccountId","getAccountByHomeId","getAccountByLocalId","localAccountId","removeAccount","authorizationCodeRequest","body","state","parse","base64Decode","ACQUIRE_TOKEN","code","acquireTokenByCode","tokenResponse","isAuthenticated","getToken","silentRequest","acquireTokenSilent","InteractionRequiredAuthError","ClientAuthError","originalUrl","hasAccess","accessMatrix","idTokenClaims","checkFor","accessRule","hasOwnProperty","handleOverage","groups","checkAccessRule","method","roles","createNewGuid","authorizationUrlRequest","base64Encode","redirectUri","responseMode","ResponseMode","FORM_POST","getAuthCodeUrl","rule","_claim_names","newIdTokenClaims","userGroups","creds","credType","methods","elem","length","AppServiceWebAppAuthClient","rawIdToken","toLowerCase","AuthToken","extractTokenClaims","tid","oid","environment","iss","username","preferred_username","name","loginUri","postLoginRedirectUri","process","env","rawAccessToken","accessTokenClaims","scp","effectiveScopes","every","KeyVaultManager","getCredentialFromKeyVault","credential","DefaultAzureCredential","credentialType","SECRET","CERTIFICATE","getSecretCredential","secretResponse","type","value","getCertificateCredential","certificateResponse","thumbprint","properties","x509Thumbprint","privateKey","secretClient","CertificateClient","keyVaultUrl","getCertificate","credentialName","keyVaultCertificate","SecretClient","getSecret","keyVaultSecret","MsalConfiguration","getMsalConfiguration","b2cPolicies","entries","instance","Constants","DEFAULT_AUTHORITY_HOST","clientSecret","clientCertificate","knownAuthorities","getDomainFromUrl","EnvironmentUtils","isProduction","isDevelopment","isAppServiceAuthEnabled","WebAppAuthClientBuilder","build","buildAsync","keyVaultManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAAA;AAAA;AAAA;;AAAA,+CAWmB,IAAI7D,0BAAJ,CAA+B,KAAKvM,WAApC,EAAiD,KAAKuE,UAAtD,CAXnB;;AAAA;AAAA,+CAamB,IAAIyC,oBAAJ,CAAyB,KAAKhH,WAA9B,EAA2C,KAAKuE,UAAhD,CAbnB;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA,oBAgBc,IAAIjE,KAAJ,CAAUzD,aAAa,CAACuB,wCAAxB,CAhBd;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KApBJ;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA,EAA6CoE,qBAA7C;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"microsoft-identity-express.cjs.development.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/utils/Constants.ts","../src/config/AppSettings.ts","../src/config/ConfigHelper.ts","../src/client/BaseAuthClientBuilder.ts","../src/utils/CryptoUtils.ts","../src/packageMetadata.ts","../src/client/BaseAuthClient.ts","../src/network/FetchManager.ts","../src/utils/UrlUtils.ts","../src/client/webapp/MsalWebAppAuthClient.ts","../src/client/webapp/AppServiceWebAppAuthClient.ts","../src/network/KeyVaultManager.ts","../src/config/MsalConfiguration.ts","../src/utils/EnvironmentUtils.ts","../src/client/webapp/WebAppAuthClientBuilder.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions, LogLevel } from '@azure/msal-common';\r\n\r\n/**\r\n * Basic authentication stages used to determine\r\n * appropriate action after redirect occurs\r\n */\r\nexport enum AppStages {\r\n SIGN_IN = 'sign_in',\r\n SIGN_OUT = 'sign_out',\r\n ACQUIRE_TOKEN = 'acquire_token',\r\n}\r\n\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nexport const AADAuthorityConstants = {\r\n COMMON: 'common',\r\n ORGANIZATIONS: 'organizations',\r\n CONSUMERS: 'consumers',\r\n};\r\n\r\n/**\r\n * String constants related credential type\r\n */\r\nexport enum KeyVaultCredentialTypes {\r\n SECRET = 'clientSecret',\r\n CERTIFICATE = 'clientCertificate',\r\n}\r\n\r\nexport const OIDC_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\r\n\r\n/**\r\n * Request headers used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationHeaders = {\r\n APP_SERVICE_AUTHENTICATION_HEADER: 'X-MSAL-APP-SERVICE-AUTHENTICATION',\r\n APP_SERVICE_ACCESS_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ACCESS-TOKEN',\r\n APP_SERVICE_ID_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ID-TOKEN',\r\n APP_SERVICE_REFRESH_TOKEN_HEADER: 'X-MS-TOKEN-AAD-REFRESH-TOKEN',\r\n APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER: 'X-MS-TOKEN-AAD-EXPIRES-ON',\r\n APP_SERVICE_USER_OID_HEADER: 'X-MS-CLIENT-PRINCIPAL-ID',\r\n APP_SERVICE_USER_UPN_HEADER: 'X-MS-CLIENT-PRINCIPAL-NAME',\r\n APP_SERVICE_IDP_X_HEADER: 'X-MS-CLIENT-PRINCIPAL-IDP',\r\n};\r\n\r\n/**\r\n * Endpoints used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationEndpoints = {\r\n ID_TOKEN_ENDPOINT: '/.auth/me',\r\n POST_LOGOUT_DEFAULT_ENDPOINT: '/.auth/logout/done',\r\n POST_LOGIN_DEFAULT_ENDPOINT: '/.auth/login/done',\r\n AAD_SIGN_IN_ENDPOINT: '/.auth/login/aad',\r\n AAD_SIGN_OUT_ENDPOINT: '/.auth/logout',\r\n TOKEN_REFRESH_ENDPOINT: '/.auth/refresh',\r\n AAD_REDIRECT_ENDPOINT: '/.auth/login/aad/callback',\r\n};\r\n\r\n/**\r\n * Query parameters used by App Service authentication endpoints\r\n */\r\nexport const AppServiceAuthenticationQueryParameters = {\r\n POST_LOGIN_REDIRECT_QUERY_PARAM: '?post_login_redirect_url=',\r\n POST_LOGOUT_REDIRECT_QUERY_PARAM: '?post_logout_redirect_uri=',\r\n};\r\n\r\n/**\r\n * Environment variables used by App Service authentication\r\n */\r\nexport const AppServiceEnvironmentVariables = {\r\n WEBSITE_AUTH_ENABLED: 'WEBSITE_AUTH_ENABLED',\r\n WEBSITE_AUTH_ALLOWED_AUDIENCES: 'WEBSITE_AUTH_ALLOWED_AUDIENCES',\r\n WEBSITE_AUTH_DEFAULT_PROVIDER: 'WEBSITE_AUTH_DEFAULT_PROVIDER',\r\n WEBSITE_AUTH_TOKEN_STORE: 'WEBSITE_AUTH_TOKEN_STORE',\r\n WEBSITE_AUTH_LOGIN_PARAMS: 'WEBSITE_AUTH_LOGIN_PARAMS',\r\n WEBSITE_AUTH_PRESERVE_URL_FRAGMENT: 'WEBSITE_AUTH_PRESERVE_URL_FRAGMENT',\r\n WEBSITE_AUTH_OPENID_ISSUER: 'WEBSITE_AUTH_OPENID_ISSUER',\r\n WEBSITE_AUTH_CLIENT_ID: 'WEBSITE_AUTH_CLIENT_ID',\r\n WEBSITE_HOSTNAME: 'WEBSITE_HOSTNAME',\r\n WEBSITE_SITE_NAME: 'WEBSITE_SITE_NAME',\r\n WEBSITE_AUTH_REQUIRE_HTTPS: 'WEBSITE_AUTH_REQUIRE_HTTPS',\r\n WEBSITE_AUTH_UNAUTHENTICATED_ACTION: 'WEBSITE_AUTH_UNAUTHENTICATED_ACTION',\r\n WEBSITE_AUTH_API_PREFIX: 'WEBSITE_AUTH_API_PREFIX',\r\n MICROSOFT_PROVIDER_AUTHENTICATION_SECRET: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET',\r\n};\r\n\r\n/**\r\n * Constants used in access control scenarios\r\n */\r\nexport const AccessControlConstants = {\r\n GROUPS: 'groups',\r\n ROLES: 'roles',\r\n CLAIM_NAMES: '_claim_name',\r\n CLAIM_SOURCES: '_claim_sources',\r\n PAGINATION_LINK: '@odata.nextLink',\r\n GRAPH_MEMBERS_ENDPOINT: 'https://graph.microsoft.com/v1.0/me/memberOf',\r\n GRAPH_MEMBER_SCOPES: 'User.Read GroupMember.Read.All',\r\n};\r\n\r\n/**\r\n * Various information constants\r\n */\r\nexport const InfoMessages = {\r\n APP_SERVICE_AUTH_DETECTED: 'App Service Authentication detected',\r\n REQUEST_FOR_RESOURCE: 'Request made to web API',\r\n OVERAGE_OCCURRED: 'User has too many groups. Groups overage claim occurred',\r\n};\r\n\r\n/**\r\n * Various error constants\r\n */\r\nexport const ErrorMessages = {\r\n NOT_PERMITTED: 'Not permitted',\r\n INVALID_TOKEN: 'Invalid token',\r\n CANNOT_DETERMINE_APP_STAGE: 'Cannot determine application stage',\r\n CANNOT_VALIDATE_TOKEN: 'Cannot validate token',\r\n CSRF_TOKEN_MISMATCH: 'CSRF token in response does not match to original request',\r\n INTERACTION_REQUIRED: 'interaction_required',\r\n TOKEN_ACQUISITION_FAILED: 'Token acquisition failed',\r\n TOKEN_RESPONSE_NULL: 'Token response is null',\r\n AUTH_CODE_URL_NOT_OBTAINED: 'Authorization code url cannot be obtained',\r\n TOKEN_NOT_FOUND: 'No token found',\r\n TOKEN_NOT_DECODED: 'Token cannot be decoded',\r\n TOKEN_NOT_VERIFIED: 'Token cannot be verified',\r\n KEYS_NOT_OBTAINED: 'Signing keys cannot be obtained',\r\n STATE_NOT_FOUND: 'State not found',\r\n USER_HAS_NO_ROLE: 'User does not have any roles',\r\n USER_NOT_IN_ROLE: 'User does not have this role',\r\n USER_HAS_NO_GROUP: 'User does not have any groups',\r\n USER_NOT_IN_GROUP: 'User does not have this group',\r\n METHOD_NOT_ALLOWED: 'Method not allowed for this route',\r\n RULE_NOT_FOUND: 'No rule found for this route',\r\n SESSION_NOT_FOUND: 'No session found for this request',\r\n KEY_VAULT_CONFIG_NOT_FOUND: 'No coordinates found for Key Vault',\r\n CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT: 'Cannot obtain credentials from Key Vault',\r\n SESSION_KEY_NOT_FOUND: 'No session key found in session. Cannot encrypt state data',\r\n AUTH_CODE_REQUEST_OBJECT_NOT_FOUND: 'No auth code request object found in session',\r\n ID_TOKEN_CLAIMS_NOT_FOUND: 'No id token claims found in session',\r\n};\r\n\r\n/**\r\n * Various configuration error constants\r\n */\r\nexport const ConfigurationErrorMessages = {\r\n AUTH_ROUTES_NOT_CONFIGURED:\r\n 'Authentication routes are not defined. Ensure that the application settings are configured properly.',\r\n NO_PROTECTED_RESOURCE_CONFIGURED:\r\n 'No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.',\r\n NO_ACCESS_MATRIX_CONFIGURED:\r\n 'No access matrix is configured to control access for. Ensure that the application settings are configured properly.',\r\n NO_CLIENT_ID: 'No clientId provided!',\r\n INVALID_CLIENT_ID: 'Invalid clientId!',\r\n NO_TENANT_INFO: 'No tenant info provided!',\r\n INVALID_TENANT_INFO: 'Invalid tenant info!',\r\n NO_CLIENT_CREDENTIAL: 'No client credential provided!',\r\n NO_REDIRECT_URI: 'No redirect URI provided!',\r\n NO_UNAUTHORIZED_ROUTE: 'No unauthorized route provided!',\r\n};\r\n\r\n/**\r\n * For more information, visit: https://login.microsoftonline.com/error\r\n */\r\nexport const ErrorCodes = {\r\n 65001: 'AADSTS65001', // consent required\r\n 50076: 'AADSTS50076', // mfa required\r\n 50079: 'AADSTS50079', // mfa enrollment required\r\n 50001: 'AADSTS50001', // invalid resource uri\r\n 65004: 'AADSTS65004', // user declined consent\r\n 70011: 'AADSTS70011', // invalid scope\r\n 700022: 'AADSTS700022', // multiple resources\r\n 700020: 'AADSTS700020', // interaction required\r\n 90118: 'AADB2C90118', // password forgotten (B2C)\r\n};\r\n\r\nexport const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\r\n loggerCallback: (logLevel, message, containsPii) => {\r\n if (containsPii) {\r\n return;\r\n }\r\n console.info(message);\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions } from '@azure/msal-common';\r\n\r\nexport type AppSettings = {\r\n appCredentials: AppCredentials;\r\n loggerOptions?: LoggerOptions;\r\n b2cPolicies?: Record;\r\n accessMatrix?: Record;\r\n};\r\n\r\nexport type WebAppSettings = AppSettings & {\r\n authRoutes: AuthRoutes;\r\n protectedResources?: Record\r\n};\r\n\r\nexport type AppCredentials = {\r\n instance?: string;\r\n clientId: string;\r\n tenantId: string;\r\n clientSecret?: string;\r\n clientCertificate?: ClientCertificate;\r\n};\r\n\r\nexport type ClientCertificate = {\r\n thumbprint: string;\r\n privateKey: string;\r\n x5c?: string;\r\n};\r\n\r\nexport type KeyVaultCredential = {\r\n credentialType: string;\r\n credentialName: string;\r\n keyVaultUrl: string;\r\n};\r\n\r\nexport type AuthRoutes = {\r\n redirect: string;\r\n unauthorized: string;\r\n frontChannelLogout?: string;\r\n};\r\n\r\nexport type Policy = {\r\n authority: string;\r\n};\r\n\r\nexport type Resource = {\r\n endpoint: string;\r\n scopes: string[];\r\n accessToken?: string;\r\n};\r\n\r\nexport type AccessRule = {\r\n path: string;\r\n methods: string[];\r\n roles?: string[];\r\n groups?: string[];\r\n};\r\n\r\nexport enum AppType {\r\n WebApp\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AADAuthorityConstants, ConfigurationErrorMessages, OIDC_SCOPES } from '../utils/Constants';\r\nimport { AppSettings, AppType, Resource, WebAppSettings } from './AppSettings';\r\n\r\nexport class ConfigHelper {\r\n /**\r\n * Validates the fields in the configuration file\r\n * @param {AppSettings} appSettings: configuration object\r\n * @returns {void}\r\n */\r\n static validateAppSettings(appSettings: AppSettings, appType: AppType): void {\r\n if (StringUtils.isEmpty(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_CLIENT_ID);\r\n } else if (!ConfigHelper.isGuid(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_CLIENT_ID);\r\n }\r\n\r\n if (StringUtils.isEmpty(appSettings.appCredentials.tenantId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_TENANT_INFO);\r\n } else if (\r\n !ConfigHelper.isGuid(appSettings.appCredentials.tenantId) &&\r\n !Object.values(AADAuthorityConstants).includes(appSettings.appCredentials.tenantId)\r\n ) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_TENANT_INFO);\r\n }\r\n\r\n switch (appType) {\r\n case AppType.WebApp:\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.redirect)) {\r\n throw new Error(ConfigurationErrorMessages.NO_REDIRECT_URI);\r\n }\r\n\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.unauthorized)) {\r\n throw new Error(ConfigurationErrorMessages.NO_UNAUTHORIZED_ROUTE);\r\n }\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Verifies if a string is GUID\r\n * @param {string} guid\r\n * @returns {boolean}\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Util method to get the resource name for a given scope(s)\r\n * @param {Array} scopes: an array of scopes that the resource is associated with\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string {\r\n const index = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).findIndex((resource: Resource) =>\r\n JSON.stringify(resource.scopes.sort()) === JSON.stringify(scopes.sort())\r\n );\r\n\r\n const resourceName = Object.keys({\r\n ...webAppSettings.protectedResources,\r\n })[index];\r\n\r\n return resourceName;\r\n }\r\n\r\n /**\r\n * Util method to get the scopes for a given resource name\r\n * @param {string} resourceEndpoint: the resource name\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[] {\r\n const scopes = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).find((resource: Resource) => resource.endpoint === resourceEndpoint)?.scopes;\r\n\r\n return scopes ? scopes : [];\r\n }\r\n\r\n /**\r\n * Util method to strip the default OIDC scopes from the scopes array\r\n * @param {Array} scopesList full list of scopes for this resource\r\n * @returns\r\n */\r\n static getEffectiveScopes(scopesList: string[]): string[] {\r\n const effectiveScopesList = scopesList.filter(scope => !OIDC_SCOPES.includes(scope));\r\n return effectiveScopesList;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICachePlugin } from '@azure/msal-node';\r\n\r\nimport { ConfigHelper } from '../config/ConfigHelper';\r\nimport { AppSettings, AppType, KeyVaultCredential } from '../config/AppSettings';\r\n\r\nexport abstract class BaseAuthClientBuilder {\r\n appSettings: AppSettings;\r\n protected keyVaultCredential: KeyVaultCredential | undefined;\r\n protected customCachePlugin: ICachePlugin | undefined;\r\n\r\n protected constructor(appSettings: AppSettings, appType: AppType) {\r\n ConfigHelper.validateAppSettings(appSettings, appType);\r\n this.appSettings = appSettings;\r\n }\r\n\r\n withKeyVaultCredentials(keyVaultCredential: KeyVaultCredential): BaseAuthClientBuilder {\r\n this.keyVaultCredential = keyVaultCredential;\r\n return this;\r\n }\r\n\r\n withCustomCachePlugin(cachePlugin: ICachePlugin): BaseAuthClientBuilder {\r\n this.customCachePlugin = cachePlugin;\r\n return this;\r\n }\r\n\r\n abstract build(): any;\r\n\r\n abstract buildAsync(): Promise;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport * as crypto from 'crypto';\r\n\r\nexport class CryptoUtils {\r\n private algorithm: string;\r\n\r\n constructor(algorithm: string = 'aes-192-cbc') {\r\n this.algorithm = algorithm;\r\n }\r\n\r\n generateSalt(): string {\r\n return crypto.randomBytes(20).toString('hex');\r\n }\r\n\r\n createKey(password: string, salt: string): Buffer {\r\n return crypto.scryptSync(password, salt, 24);\r\n }\r\n\r\n encryptData(stringifiedData: string, key: Buffer): string {\r\n const iv = crypto.randomBytes(16);\r\n const cipher = crypto.createCipheriv(this.algorithm, key, iv);\r\n const encryptedData = cipher.update(stringifiedData, 'utf8', 'hex');\r\n\r\n return [iv.toString('hex'), encryptedData + cipher.final('hex')].join('.');\r\n }\r\n\r\n decryptData(encryptedData: string, key: Buffer): string {\r\n const [iv, encrypted] = encryptedData.split('.');\r\n const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(iv, 'hex'));\r\n return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const packageName = '@azure-samples/microsoft-identity-express';\r\nexport const packageVersion = 'beta';\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from '@azure/msal-common';\r\nimport { ConfidentialClientApplication, Configuration, CryptoProvider } from '@azure/msal-node';\r\n\r\nimport { AppSettings } from '../config/AppSettings';\r\nimport { CryptoUtils } from '../utils/CryptoUtils';\r\nimport { packageName, packageVersion } from '../packageMetadata';\r\n\r\nexport abstract class BaseAuthClient {\r\n appSettings: AppSettings;\r\n\r\n protected msalConfig: Configuration;\r\n protected msalClient: ConfidentialClientApplication;\r\n protected cryptoProvider: CryptoProvider;\r\n protected cryptoUtils: CryptoUtils;\r\n protected logger: Logger;\r\n\r\n protected constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n this.appSettings = appSettings;\r\n this.msalConfig = msalConfig;\r\n this.cryptoProvider = new CryptoProvider();\r\n this.cryptoUtils = new CryptoUtils();\r\n\r\n this.logger = new Logger(this.msalConfig.system?.loggerOptions!, packageName, packageVersion);\r\n\r\n this.msalClient = new ConfidentialClientApplication(this.msalConfig);\r\n }\r\n\r\n getMsalClient(): ConfidentialClientApplication {\r\n return this.msalClient;\r\n }\r\n\r\n getMsalConfig(): Configuration {\r\n return this.msalConfig;\r\n }\r\n\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport axios, { AxiosResponse, AxiosRequestConfig } from 'axios';\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AccessControlConstants, ErrorMessages } from '../utils/Constants';\r\n\r\nexport class FetchManager {\r\n /**\r\n * Calls a resource endpoint\r\n * @param {string} endpoint\r\n * @returns {Promise}\r\n */\r\n static callApiEndpoint = async (endpoint: string): Promise => {\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Calls a resource endpoint with a raw access token\r\n * using the authorization bearer token scheme\r\n * @param {string} endpoint\r\n * @param {string} accessToken\r\n * @returns {Promise}\r\n */\r\n static callApiEndpointWithToken = async (endpoint: string, accessToken: string): Promise> => {\r\n if (StringUtils.isEmpty(accessToken)) {\r\n throw new Error(ErrorMessages.TOKEN_NOT_FOUND);\r\n }\r\n\r\n const options: AxiosRequestConfig = {\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint, options);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Handles queries against Microsoft Graph that return multiple pages of data\r\n * @param {string} accessToken: access token required by endpoint\r\n * @param {string} nextPage: next page link\r\n * @param {Array} data: stores data from each page\r\n * @returns {Promise}\r\n */\r\n static handlePagination = async (accessToken: string, nextPage: string, data: string[] = []): Promise => {\r\n try {\r\n const graphResponse = await (await FetchManager.callApiEndpointWithToken(nextPage, accessToken)).data;\r\n graphResponse['value'].map((v: any) => data.push(v.id));\r\n\r\n if (graphResponse[AccessControlConstants.PAGINATION_LINK]) {\r\n return await FetchManager.handlePagination(\r\n accessToken,\r\n graphResponse[AccessControlConstants.PAGINATION_LINK],\r\n data\r\n );\r\n } else {\r\n return data;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Request } from 'express';\r\nimport { IUri, UrlString } from '@azure/msal-common';\r\n\r\nexport class UrlUtils {\r\n /**\r\n * Gets the absolute URL from a given request and path string\r\n * @param {Request} req: express request object\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static ensureAbsoluteUrl = (req: Request, url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n\r\n if (!urlComponents.Protocol) {\r\n if (!urlComponents.HostNameAndPort && !url.startsWith('www')) {\r\n if (!url.startsWith('/')) {\r\n return req.protocol + '://' + req.get('host') + '/' + url;\r\n }\r\n return req.protocol + '://' + req.get('host') + url;\r\n }\r\n return req.protocol + '://' + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n /**\r\n * Gets the path segment from a given URL\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static getPathFromUrl = (url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n return `/${urlComponents.PathSegments.join('/')}`;\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { RequestHandler, Request, Response, NextFunction, Router } from 'express';\r\nimport { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, StringUtils, ResponseMode } from '@azure/msal-common';\r\nimport { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node';\r\nimport { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings';\r\nimport { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions';\r\nimport { AppStages, ErrorMessages, AccessControlConstants, ConfigurationErrorMessages } from '../../utils/Constants';\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { FetchManager } from '../../network/FetchManager';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { AppState } from '../../utils/Types';\r\n\r\n/**\r\n * A simple wrapper around MSAL Node ConfidentialClientApplication object.\r\n * It offers a collection of middleware and utility methods that automate\r\n * basic authentication and authorization tasks in Express web apps\r\n */\r\nexport class MsalWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction) => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n next();\r\n });\r\n\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n if (this.webAppSettings.authRoutes.frontChannelLogout) {\r\n /**\r\n * Expose front-channel logout route. For more information, visit:\r\n * https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#single-sign-out\r\n */\r\n appRouter.get(this.webAppSettings.authRoutes.frontChannelLogout, (req: Request, res: Response) => {\r\n req.session.destroy(() => {\r\n res.sendStatus(200);\r\n });\r\n });\r\n }\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): Promise => {\r\n const appState = {\r\n appStage: AppStages.SIGN_IN,\r\n redirectTo: options.postLoginRedirect,\r\n csrfToken: req.session.csrfToken,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationCodeRequest;\r\n\r\n // get url to sign user in\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return async (req: Request, res: Response): Promise => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n\r\n /**\r\n * Construct a logout URI and redirect the user to end the\r\n * session with Azure AD/B2C. For more information, visit:\r\n * (AAD) https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#send-a-sign-out-request\r\n * (B2C) https://docs.microsoft.com/azure/active-directory-b2c/openid-connect#send-a-sign-out-request\r\n */\r\n const logoutUri = `${this.msalConfig.auth.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${postLogoutRedirectUri}`;\r\n\r\n const tokenCache = this.msalClient.getTokenCache();\r\n\r\n const account = req.session.account?.homeAccountId\r\n ?\r\n await tokenCache.getAccountByHomeId(req.session.account.homeAccountId)\r\n :\r\n await tokenCache.getAccountByLocalId(req.session.account?.localAccountId!);\r\n\r\n if (account) {\r\n await tokenCache.removeAccount(account);\r\n }\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!req.session.key) {\r\n this.logger.error(ErrorMessages.SESSION_KEY_NOT_FOUND);\r\n return next(new Error(ErrorMessages.SESSION_KEY_NOT_FOUND));\r\n }\r\n\r\n if (!req.session.authorizationCodeRequest) {\r\n this.logger.error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND);\r\n return next(new Error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND));\r\n }\r\n\r\n if (req.body.state) {\r\n const state: AppState = JSON.parse(\r\n this.cryptoUtils.decryptData(\r\n this.cryptoProvider.base64Decode(req.body.state as string),\r\n Buffer.from(req.session.key, 'hex')\r\n )\r\n );\r\n\r\n // check if csrfToken matches\r\n if (state.csrfToken === req.session.csrfToken) {\r\n switch (state.appStage) {\r\n case AppStages.SIGN_IN: {\r\n // token request should have auth code\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n // exchange auth code for tokens\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.isAuthenticated = true;\r\n req.session.account = tokenResponse.account!; // this won't be null in any web app scenario\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n case AppStages.ACQUIRE_TOKEN: {\r\n // get the name of the resource associated with scope\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(\r\n req.session.authorizationCodeRequest.scopes,\r\n this.webAppSettings\r\n );\r\n\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n accessToken: tokenResponse.accessToken,\r\n } as Resource,\r\n };\r\n\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n next(new Error(ErrorMessages.CANNOT_DETERMINE_APP_STAGE));\r\n break;\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens via acquireToken*\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const scopes = options.resource.scopes;\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n try {\r\n const silentRequest = {\r\n account: req.session.account,\r\n scopes: scopes,\r\n } as SilentFlowRequest;\r\n\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse || StringUtils.isEmpty(tokenResponse.accessToken)) {\r\n // In B2C scenarios, sometimes an access token is returned empty.\r\n // In that case, we will acquire token interactively instead.\r\n\r\n throw new InteractionRequiredAuthError(ErrorMessages.INTERACTION_REQUIRED);\r\n }\r\n\r\n req.session.protectedResources[resourceName].accessToken = tokenResponse.accessToken;\r\n next();\r\n } catch (error) {\r\n // in case there are no cached tokens, initiate an interactive call\r\n if (error instanceof InteractionRequiredAuthError) {\r\n const appState = {\r\n appStage: AppStages.ACQUIRE_TOKEN,\r\n redirectTo: req.originalUrl,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: scopes,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: scopes,\r\n } as AuthorizationCodeRequest;\r\n\r\n // initiate the first leg of auth code grant to get token\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n } else {\r\n next(error);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Checks if the user has access for this route, defined in access matrix\r\n * @param {GuardOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n hasAccess(options: GuardOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.accessMatrix) {\r\n this.logger.error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED));\r\n }\r\n\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const checkFor = options.accessRule.hasOwnProperty(AccessControlConstants.GROUPS)\r\n ? AccessControlConstants.GROUPS\r\n : AccessControlConstants.ROLES;\r\n\r\n switch (checkFor) {\r\n case AccessControlConstants.GROUPS:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.GROUPS]) {\r\n if (\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_NAMES] ||\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_SOURCES]\r\n ) {\r\n return await this.handleOverage(req, res, next, options.accessRule);\r\n } else {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n const groups = req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, groups, AccessControlConstants.GROUPS)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.ROLES]) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n const roles = req.session.account.idTokenClaims[AccessControlConstants.ROLES] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, roles, AccessControlConstants.ROLES)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n };\r\n }\r\n\r\n // ============== UTILS ===============\r\n\r\n /**\r\n * This method is used to generate an auth code url request\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AuthCodeParams} params: modifies auth code url request\r\n * @returns {Promise}\r\n */\r\n private async redirectToAuthCodeUrl(\r\n req: Request,\r\n res: Response,\r\n next: NextFunction,\r\n authUrlParams: AuthorizationUrlRequest,\r\n authCodeParams: AuthorizationCodeRequest,\r\n appState: AppState\r\n ): Promise {\r\n // add session csrfToken for crsf\r\n req.session.csrfToken = this.cryptoProvider.createNewGuid();\r\n\r\n const key = this.cryptoUtils.createKey(req.session.csrfToken, this.cryptoUtils.generateSalt());\r\n req.session.key = key.toString('hex');\r\n\r\n const state = JSON.stringify({\r\n ...appState,\r\n csrfToken: req.session.csrfToken,\r\n });\r\n\r\n // prepare the request\r\n req.session.authorizationUrlRequest = {\r\n ...authUrlParams,\r\n state: this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(state, key)),\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n responseMode: ResponseMode.FORM_POST\r\n };\r\n\r\n req.session.authorizationCodeRequest = {\r\n ...authCodeParams,\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n code: ''\r\n };\r\n\r\n // request an authorization code to exchange for tokens\r\n try {\r\n const response = await this.msalClient.getAuthCodeUrl(req.session.authorizationUrlRequest);\r\n res.redirect(response);\r\n } catch (error) {\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles group overage claims by querying MS Graph /memberOf endpoint\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AccessRule} rule: a given access rule\r\n * @returns {Promise}\r\n */\r\n private async handleOverage(req: Request, res: Response, next: NextFunction, rule: AccessRule): Promise {\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const { _claim_names, _claim_sources, ...newIdTokenClaims } = req.session.account.idTokenClaims;\r\n\r\n const silentRequest: SilentFlowRequest = {\r\n account: req.session.account,\r\n scopes: AccessControlConstants.GRAPH_MEMBER_SCOPES.split(' '),\r\n };\r\n\r\n try {\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n try {\r\n const graphResponse = await FetchManager.callApiEndpointWithToken(\r\n AccessControlConstants.GRAPH_MEMBERS_ENDPOINT,\r\n tokenResponse.accessToken\r\n );\r\n\r\n /**\r\n * Some queries against Microsoft Graph return multiple pages of data either due to server-side paging\r\n * or due to the use of the $top query parameter to specifically limit the page size in a request.\r\n * When a result set spans multiple pages, Microsoft Graph returns an @odata.nextLink property in\r\n * the response that contains a URL to the next page of results. Learn more at https://docs.microsoft.com/graph/paging\r\n */\r\n if (graphResponse.data[AccessControlConstants.PAGINATION_LINK]) {\r\n try {\r\n const userGroups = await FetchManager.handlePagination(\r\n tokenResponse.accessToken,\r\n graphResponse.data[AccessControlConstants.PAGINATION_LINK]\r\n );\r\n\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: userGroups,\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } else {\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: graphResponse.data['value'].map((v: any) => v.id),\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } catch (error) {\r\n // TODO: handle silent token acquisition error\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the request passes a given access rule\r\n * @param {string} method: HTTP method for this route\r\n * @param {AccessRule} rule: access rule for this route\r\n * @param {Array} creds: user's credentials i.e. roles or groups\r\n * @param {string} credType: roles or groups\r\n * @returns {boolean}\r\n */\r\n private checkAccessRule(method: string, rule: AccessRule, creds: string[], credType: string): boolean {\r\n if (rule.methods.includes(method)) {\r\n switch (credType) {\r\n case AccessControlConstants.GROUPS:\r\n if (!rule.groups || rule.groups.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!rule.roles || rule.roles!.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { Router, RequestHandler, Request, Response, NextFunction } from 'express';\r\nimport { AccountInfo, AuthToken } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { AccessTokenClaims, IdTokenClaims } from '../../utils/Types';\r\nimport { AppSettings, Resource, WebAppSettings } from '../../config/AppSettings';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { SignInOptions, SignOutOptions, TokenRequestOptions } from '../MiddlewareOptions';\r\nimport {\r\n AppServiceAuthenticationHeaders,\r\n AppServiceEnvironmentVariables,\r\n AppServiceAuthenticationEndpoints,\r\n AppServiceAuthenticationQueryParameters,\r\n ErrorMessages,\r\n ConfigurationErrorMessages,\r\n} from '../../utils/Constants';\r\n\r\nexport class AppServiceWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @param {InitializationOptions} options\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n // handle redirect\r\n appRouter.get(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n if (!req.session.isAuthenticated) {\r\n // check headers for id token\r\n const rawIdToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawIdToken) {\r\n // parse the id token\r\n const idTokenClaims: IdTokenClaims = AuthToken.extractTokenClaims(rawIdToken, this.cryptoProvider);\r\n\r\n req.session.isAuthenticated = true;\r\n\r\n req.session.account = {\r\n tenantId: idTokenClaims.tid,\r\n homeAccountId: idTokenClaims.oid + '.' + idTokenClaims.tid,\r\n localAccountId: idTokenClaims.oid,\r\n environment: idTokenClaims.iss?.split('://')[1].split('/')[0],\r\n username: idTokenClaims.preferred_username,\r\n name: idTokenClaims.name,\r\n idTokenClaims: idTokenClaims,\r\n } as AccountInfo;\r\n }\r\n }\r\n\r\n next();\r\n });\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n let loginUri;\r\n const postLoginRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLoginRedirect);\r\n loginUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_IN_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGIN_REDIRECT_QUERY_PARAM +\r\n postLoginRedirectUri;\r\n res.redirect(loginUri);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n const logoutUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_OUT_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGOUT_REDIRECT_QUERY_PARAM +\r\n postLogoutRedirectUri;\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(options.resource.scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n const rawAccessToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawAccessToken) {\r\n const accessTokenClaims = AuthToken.extractTokenClaims(\r\n rawAccessToken,\r\n this.cryptoProvider\r\n ) as AccessTokenClaims;\r\n\r\n // get the name of the resource associated with scope\r\n const scopes = accessTokenClaims?.scp.split(' ');\r\n const effectiveScopes = ConfigHelper.getEffectiveScopes(scopes);\r\n\r\n if (options.resource.scopes.every(elem => effectiveScopes.includes(elem))) {\r\n req.session.protectedResources[resourceName].accessToken = rawAccessToken;\r\n return next();\r\n } else {\r\n return next(new Error('No tokens found for given scopes'));\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DefaultAzureCredential } from '@azure/identity';\r\nimport { CertificateClient, KeyVaultCertificate } from '@azure/keyvault-certificates';\r\nimport { KeyVaultSecret, SecretClient } from '@azure/keyvault-secrets';\r\n\r\nimport { KeyVaultCredential, ClientCertificate } from '../config/AppSettings';\r\nimport { KeyVaultCredentialTypes } from '../utils/Constants';\r\n\r\nexport type KeyVaultCredentialResponse = {\r\n type: KeyVaultCredentialTypes.SECRET | KeyVaultCredentialTypes.CERTIFICATE;\r\n value: string & ClientCertificate;\r\n};\r\n\r\nexport class KeyVaultManager {\r\n /**\r\n * Fetches credentials from Key Vault and updates appSettings\r\n * @param {AppSettings} appSettings\r\n * @returns {Promise}\r\n */\r\n async getCredentialFromKeyVault(keyVaultCredential: KeyVaultCredential): Promise {\r\n const credential = new DefaultAzureCredential();\r\n let response: KeyVaultCredentialResponse = {} as KeyVaultCredentialResponse;\r\n\r\n switch (keyVaultCredential.credentialType) {\r\n case KeyVaultCredentialTypes.SECRET: {\r\n try {\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.SECRET,\r\n value: secretResponse.value,\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n case KeyVaultCredentialTypes.CERTIFICATE: {\r\n try {\r\n const certificateResponse = await this.getCertificateCredential(keyVaultCredential, credential);\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.CERTIFICATE,\r\n value: {\r\n thumbprint: certificateResponse?.properties?.x509Thumbprint?.toString(),\r\n privateKey: secretResponse?.value?.split('-----BEGIN CERTIFICATE-----\\n')[0],\r\n },\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Gets a certificate credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getCertificateCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new CertificateClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultCertificate = await secretClient.getCertificate(keyVaultCredential.credentialName);\r\n return keyVaultCertificate;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a secret credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getSecretCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new SecretClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultSecret = await secretClient.getSecret(keyVaultCredential.credentialName);\r\n return keyVaultSecret;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { UrlString, Constants } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { DEFAULT_LOGGER_OPTIONS } from '../utils/Constants';\r\nimport { AppSettings } from './AppSettings';\r\n\r\nexport class MsalConfiguration {\r\n /**\r\n * Maps the custom configuration object to configuration\r\n * object expected by MSAL Node ConfidentialClientApplication class\r\n * @param {AppSettings} appSettings: configuration object\r\n * @param {ICachePlugin} cachePlugin: custom cache plugin\r\n * @param {IDistributedPersistence} distributedPersistence: distributed persistence client\r\n * @returns {Configuration}\r\n */\r\n static getMsalConfiguration(appSettings: AppSettings): Configuration {\r\n return {\r\n auth: {\r\n clientId: appSettings.appCredentials.clientId,\r\n authority: appSettings.b2cPolicies\r\n ? Object.entries(appSettings.b2cPolicies)[0][1]['authority'] // the first policy/user-flow is the default authority\r\n : appSettings.appCredentials.instance\r\n ? `https://${appSettings.appCredentials.instance}/${appSettings.appCredentials.tenantId}`\r\n : `https://${Constants.DEFAULT_AUTHORITY_HOST}/${appSettings.appCredentials.tenantId}`,\r\n ...(appSettings.appCredentials.hasOwnProperty('clientSecret') && {\r\n clientSecret: appSettings.appCredentials.clientSecret,\r\n }),\r\n ...(appSettings.appCredentials.hasOwnProperty('clientCertificate') && {\r\n clientCertificate: appSettings.appCredentials.clientCertificate,\r\n }),\r\n knownAuthorities: appSettings.b2cPolicies\r\n ? [UrlString.getDomainFromUrl(Object.entries(appSettings.b2cPolicies)[0][1]['authority'])] // in B2C scenarios\r\n : [],\r\n },\r\n system: {\r\n loggerOptions: appSettings.loggerOptions ? appSettings.loggerOptions : DEFAULT_LOGGER_OPTIONS,\r\n },\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AppServiceEnvironmentVariables } from './Constants';\r\n\r\nexport class EnvironmentUtils {\r\n static isProduction(): boolean {\r\n return process.env.NODE_ENV === 'production';\r\n }\r\n\r\n static isDevelopment(): boolean {\r\n return process.env.NODE_ENV === 'development';\r\n }\r\n\r\n static isAppServiceAuthEnabled(): boolean {\r\n return process.env[AppServiceEnvironmentVariables.WEBSITE_AUTH_ENABLED] === 'True';\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClientBuilder } from '../BaseAuthClientBuilder';\r\nimport { MsalWebAppAuthClient } from './MsalWebAppAuthClient';\r\nimport { AppServiceWebAppAuthClient } from './AppServiceWebAppAuthClient';\r\nimport { KeyVaultManager } from '../../network/KeyVaultManager';\r\nimport { MsalConfiguration } from '../../config/MsalConfiguration';\r\nimport { AppSettings, AppType } from '../../config/AppSettings';\r\nimport { EnvironmentUtils } from '../../utils/EnvironmentUtils';\r\nimport { ErrorMessages } from '../../utils/Constants';\r\n\r\nexport class WebAppAuthClientBuilder extends BaseAuthClientBuilder {\r\n appSettings!: AppSettings;\r\n private msalConfig!: Configuration;\r\n\r\n constructor(appSettings: AppSettings) {\r\n super(appSettings, AppType.WebApp);\r\n }\r\n\r\n build(): MsalWebAppAuthClient | AppServiceWebAppAuthClient {\r\n // TODO: throw error if key vault credential is being built\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n }\r\n\r\n async buildAsync(): Promise {\r\n try {\r\n if (this.keyVaultCredential) {\r\n const keyVaultManager = new KeyVaultManager();\r\n const credential = await keyVaultManager.getCredentialFromKeyVault(this.keyVaultCredential);\r\n this.appSettings.appCredentials[credential.type] = credential.value;\r\n }\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n } catch (error) {\r\n throw new Error(ErrorMessages.CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT);\r\n }\r\n }\r\n}\r\n"],"names":["undefined","AppStages","AADAuthorityConstants","COMMON","ORGANIZATIONS","CONSUMERS","KeyVaultCredentialTypes","OIDC_SCOPES","AppServiceAuthenticationHeaders","APP_SERVICE_AUTHENTICATION_HEADER","APP_SERVICE_ACCESS_TOKEN_HEADER","APP_SERVICE_ID_TOKEN_HEADER","APP_SERVICE_REFRESH_TOKEN_HEADER","APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER","APP_SERVICE_USER_OID_HEADER","APP_SERVICE_USER_UPN_HEADER","APP_SERVICE_IDP_X_HEADER","AppServiceAuthenticationEndpoints","ID_TOKEN_ENDPOINT","POST_LOGOUT_DEFAULT_ENDPOINT","POST_LOGIN_DEFAULT_ENDPOINT","AAD_SIGN_IN_ENDPOINT","AAD_SIGN_OUT_ENDPOINT","TOKEN_REFRESH_ENDPOINT","AAD_REDIRECT_ENDPOINT","AppServiceAuthenticationQueryParameters","POST_LOGIN_REDIRECT_QUERY_PARAM","POST_LOGOUT_REDIRECT_QUERY_PARAM","AppServiceEnvironmentVariables","WEBSITE_AUTH_ENABLED","WEBSITE_AUTH_ALLOWED_AUDIENCES","WEBSITE_AUTH_DEFAULT_PROVIDER","WEBSITE_AUTH_TOKEN_STORE","WEBSITE_AUTH_LOGIN_PARAMS","WEBSITE_AUTH_PRESERVE_URL_FRAGMENT","WEBSITE_AUTH_OPENID_ISSUER","WEBSITE_AUTH_CLIENT_ID","WEBSITE_HOSTNAME","WEBSITE_SITE_NAME","WEBSITE_AUTH_REQUIRE_HTTPS","WEBSITE_AUTH_UNAUTHENTICATED_ACTION","WEBSITE_AUTH_API_PREFIX","MICROSOFT_PROVIDER_AUTHENTICATION_SECRET","AccessControlConstants","GROUPS","ROLES","CLAIM_NAMES","CLAIM_SOURCES","PAGINATION_LINK","GRAPH_MEMBERS_ENDPOINT","GRAPH_MEMBER_SCOPES","ErrorMessages","NOT_PERMITTED","INVALID_TOKEN","CANNOT_DETERMINE_APP_STAGE","CANNOT_VALIDATE_TOKEN","CSRF_TOKEN_MISMATCH","INTERACTION_REQUIRED","TOKEN_ACQUISITION_FAILED","TOKEN_RESPONSE_NULL","AUTH_CODE_URL_NOT_OBTAINED","TOKEN_NOT_FOUND","TOKEN_NOT_DECODED","TOKEN_NOT_VERIFIED","KEYS_NOT_OBTAINED","STATE_NOT_FOUND","USER_HAS_NO_ROLE","USER_NOT_IN_ROLE","USER_HAS_NO_GROUP","USER_NOT_IN_GROUP","METHOD_NOT_ALLOWED","RULE_NOT_FOUND","SESSION_NOT_FOUND","KEY_VAULT_CONFIG_NOT_FOUND","CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT","SESSION_KEY_NOT_FOUND","AUTH_CODE_REQUEST_OBJECT_NOT_FOUND","ID_TOKEN_CLAIMS_NOT_FOUND","ConfigurationErrorMessages","AUTH_ROUTES_NOT_CONFIGURED","NO_PROTECTED_RESOURCE_CONFIGURED","NO_ACCESS_MATRIX_CONFIGURED","NO_CLIENT_ID","INVALID_CLIENT_ID","NO_TENANT_INFO","INVALID_TENANT_INFO","NO_CLIENT_CREDENTIAL","NO_REDIRECT_URI","NO_UNAUTHORIZED_ROUTE","DEFAULT_LOGGER_OPTIONS","loggerCallback","logLevel","message","containsPii","console","info","piiLoggingEnabled","LogLevel","Info","AppType","ConfigHelper","validateAppSettings","appSettings","appType","StringUtils","isEmpty","appCredentials","clientId","Error","isGuid","tenantId","Object","values","includes","WebApp","authRoutes","redirect","unauthorized","guid","regexGuid","test","getResourceNameFromScopes","scopes","webAppSettings","index","protectedResources","findIndex","resource","JSON","stringify","sort","resourceName","keys","getScopesFromResourceEndpoint","resourceEndpoint","find","endpoint","getEffectiveScopes","scopesList","effectiveScopesList","filter","scope","BaseAuthClientBuilder","withKeyVaultCredentials","keyVaultCredential","withCustomCachePlugin","cachePlugin","customCachePlugin","CryptoUtils","algorithm","generateSalt","crypto","toString","createKey","password","salt","encryptData","stringifiedData","key","iv","cipher","encryptedData","update","join","decryptData","split","encrypted","decipher","Buffer","from","packageName","packageVersion","BaseAuthClient","msalConfig","cryptoProvider","CryptoProvider","cryptoUtils","logger","Logger","system","loggerOptions","msalClient","ConfidentialClientApplication","getMsalClient","getMsalConfig","getLogger","FetchManager","axios","get","response","data","accessToken","options","headers","Authorization","nextPage","callApiEndpointWithToken","graphResponse","map","v","push","id","handlePagination","UrlUtils","req","url","urlComponents","UrlString","getUrlComponents","Protocol","HostNameAndPort","startsWith","protocol","PathSegments","MsalWebAppAuthClient","initialize","appRouter","express","Router","use","res","next","session","error","post","getPathFromUrl","handleRedirect","frontChannelLogout","destroy","sendStatus","signIn","postLoginRedirect","failureRedirect","appState","appStage","SIGN_IN","redirectTo","csrfToken","authUrlParams","OIDC_DEFAULT_SCOPES","authCodeParams","redirectToAuthCodeUrl","signOut","postLogoutRedirect","postLogoutRedirectUri","ensureAbsoluteUrl","logoutUri","auth","authority","tokenCache","getTokenCache","account","homeAccountId","getAccountByHomeId","getAccountByLocalId","localAccountId","removeAccount","authorizationCodeRequest","body","state","parse","base64Decode","ACQUIRE_TOKEN","code","acquireTokenByCode","tokenResponse","isAuthenticated","getToken","silentRequest","acquireTokenSilent","InteractionRequiredAuthError","originalUrl","hasAccess","accessMatrix","idTokenClaims","checkFor","accessRule","hasOwnProperty","handleOverage","groups","checkAccessRule","method","roles","createNewGuid","authorizationUrlRequest","base64Encode","redirectUri","responseMode","ResponseMode","FORM_POST","getAuthCodeUrl","rule","_claim_names","newIdTokenClaims","userGroups","creds","credType","methods","elem","length","AppServiceWebAppAuthClient","rawIdToken","toLowerCase","AuthToken","extractTokenClaims","tid","oid","environment","iss","username","preferred_username","name","loginUri","postLoginRedirectUri","process","env","rawAccessToken","accessTokenClaims","scp","effectiveScopes","every","KeyVaultManager","getCredentialFromKeyVault","credential","DefaultAzureCredential","credentialType","SECRET","CERTIFICATE","getSecretCredential","secretResponse","type","value","getCertificateCredential","certificateResponse","thumbprint","properties","x509Thumbprint","privateKey","secretClient","CertificateClient","keyVaultUrl","getCertificate","credentialName","keyVaultCertificate","SecretClient","getSecret","keyVaultSecret","MsalConfiguration","getMsalConfiguration","b2cPolicies","entries","instance","Constants","DEFAULT_AUTHORITY_HOST","clientSecret","clientCertificate","knownAuthorities","getDomainFromUrl","EnvironmentUtils","isProduction","isDevelopment","isAppServiceAuthEnabled","WebAppAuthClientBuilder","build","buildAsync","keyVaultManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA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amB,IAAIyC,oBAAJ,CAAyB,KAAKhH,WAA9B,EAA2C,KAAKuE,UAAhD,CAbnB;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA,oBAgBc,IAAIjE,KAAJ,CAAUzD,aAAa,CAACuB,wCAAxB,CAhBd;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KApBJ;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA,EAA6CoE,qBAA7C;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/microsoft-identity-express.cjs.production.min.js b/dist/microsoft-identity-express.cjs.production.min.js index b990c6a..58e2b03 100644 --- a/dist/microsoft-identity-express.cjs.production.min.js +++ b/dist/microsoft-identity-express.cjs.production.min.js @@ -1,2 +1,2 @@ -"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@azure/msal-common"),r=e(require("express")),n=require("@azure/msal-node"),o=require("crypto"),i=e(require("axios")),s=require("@azure/identity"),a=require("@azure/keyvault-certificates"),c=require("@azure/keyvault-secrets");function u(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){u(i,n,o,s,a,"next",e)}function a(e){u(i,n,o,s,a,"throw",e)}s(void 0)}))}}function l(){return(l=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}var d,g,v=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=Object.create((t&&t.prototype instanceof l?t:l).prototype),i=new w(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=m(s,r);if(a){if(a===p)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function l(){}function f(){}function h(){}var d={};a(d,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(C([])));v&&v!==t&&r.call(v,o)&&(d=v);var b=h.prototype=l.prototype=Object.create(d);function y(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){var n;this._invoke=function(o,i){function s(){return new t((function(n,s){!function n(o,i,s,a){var c=u(e[o],e,i);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(l).then((function(e){p.value=e,s(p)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function m(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,m(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(g={exports:{}}),g.exports);!function(e){e.SIGN_IN="sign_in",e.SIGN_OUT="sign_out",e.ACQUIRE_TOKEN="acquire_token"}(d||(d={}));var b,y={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"};!function(e){e.SECRET="clientSecret",e.CERTIFICATE="clientCertificate"}(b||(b={}));var E,m=["openid","profile","email","offline_access"],S={APP_SERVICE_AUTHENTICATION_HEADER:"X-MSAL-APP-SERVICE-AUTHENTICATION",APP_SERVICE_ACCESS_TOKEN_HEADER:"X-MS-TOKEN-AAD-ACCESS-TOKEN",APP_SERVICE_ID_TOKEN_HEADER:"X-MS-TOKEN-AAD-ID-TOKEN",APP_SERVICE_REFRESH_TOKEN_HEADER:"X-MS-TOKEN-AAD-REFRESH-TOKEN",APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER:"X-MS-TOKEN-AAD-EXPIRES-ON",APP_SERVICE_USER_OID_HEADER:"X-MS-CLIENT-PRINCIPAL-ID",APP_SERVICE_USER_UPN_HEADER:"X-MS-CLIENT-PRINCIPAL-NAME",APP_SERVICE_IDP_X_HEADER:"X-MS-CLIENT-PRINCIPAL-IDP"},A={GROUPS:"groups",ROLES:"roles",CLAIM_NAMES:"_claim_name",CLAIM_SOURCES:"_claim_sources",PAGINATION_LINK:"@odata.nextLink",GRAPH_MEMBERS_ENDPOINT:"https://graph.microsoft.com/v1.0/me/memberOf",GRAPH_MEMBER_SCOPES:"User.Read GroupMember.Read.All"},w="No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.",C={loggerCallback:function(e,t,r){r||console.info(t)},piiLoggingEnabled:!1,logLevel:t.LogLevel.Info};!function(e){e[e.WebApp=0]="WebApp"}(E||(E={}));var R=function(){function e(){}return e.validateAppSettings=function(r,n){var o,i;if(t.StringUtils.isEmpty(r.appCredentials.clientId))throw new Error("No clientId provided!");if(!e.isGuid(r.appCredentials.clientId))throw new Error("Invalid clientId!");if(t.StringUtils.isEmpty(r.appCredentials.tenantId))throw new Error("No tenant info provided!");if(!e.isGuid(r.appCredentials.tenantId)&&!Object.values(y).includes(r.appCredentials.tenantId))throw new Error("Invalid tenant info!");switch(n){case E.WebApp:if(t.StringUtils.isEmpty(null==(o=r.authRoutes)?void 0:o.redirect))throw new Error("No redirect URI provided!");if(t.StringUtils.isEmpty(null==(i=r.authRoutes)?void 0:i.unauthorized))throw new Error("No unauthorized route provided!")}},e.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e.getResourceNameFromScopes=function(e,t){var r=Object.values(l({},t.protectedResources)).findIndex((function(t){return JSON.stringify(t.scopes.sort())===JSON.stringify(e.sort())}));return Object.keys(l({},t.protectedResources))[r]},e.getScopesFromResourceEndpoint=function(e,t){var r;return(null==(r=Object.values(l({},t.protectedResources)).find((function(t){return t.endpoint===e})))?void 0:r.scopes)||[]},e.getEffectiveScopes=function(e){return e.filter((function(e){return!m.includes(e)}))},e}(),k=function(){function e(e,t){R.validateAppSettings(e,t),this.appSettings=e}var t=e.prototype;return t.withKeyVaultCredentials=function(e){return this.keyVaultCredential=e,this},t.withCustomCachePlugin=function(e){return this.customCachePlugin=e,this},e}(),x=function(){function e(e){void 0===e&&(e="aes-192-cbc"),this.algorithm=e}var t=e.prototype;return t.generateSalt=function(){return o.randomBytes(20).toString("hex")},t.createKey=function(e,t){return o.scryptSync(e,t,24)},t.encryptData=function(e,t){var r=o.randomBytes(16),n=o.createCipheriv(this.algorithm,t,r),i=n.update(e,"utf8","hex");return[r.toString("hex"),i+n.final("hex")].join(".")},t.decryptData=function(e,t){var r=e.split("."),n=r[1],i=o.createDecipheriv(this.algorithm,t,Buffer.from(r[0],"hex"));return i.update(n,"hex","utf8")+i.final("utf8")},e}(),T=function(){function e(e,r){var o;this.appSettings=e,this.msalConfig=r,this.cryptoProvider=new n.CryptoProvider,this.cryptoUtils=new x,this.logger=new t.Logger(null==(o=this.msalConfig.system)?void 0:o.loggerOptions,"@azure-samples/microsoft-identity-express","beta"),this.msalClient=new n.ConfidentialClientApplication(this.msalConfig)}var r=e.prototype;return r.getMsalClient=function(){return this.msalClient},r.getMsalConfig=function(){return this.msalConfig},r.getLogger=function(){return this.logger},e}(),_=function(){};_.callApiEndpoint=function(){var e=p(v.mark((function e(t){return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.get(t);case 3:return e.abrupt("return",e.sent.data);case 7:throw e.prev=7,e.t0=e.catch(0),e.t0;case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),_.callApiEndpointWithToken=function(){var e=p(v.mark((function e(r,n){var o;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.StringUtils.isEmpty(n)){e.next=2;break}throw new Error("No token found");case 2:return o={headers:{Authorization:"Bearer "+n}},e.prev=3,e.next=6,i.get(r,o);case 6:return e.abrupt("return",e.sent.data);case 10:throw e.prev=10,e.t0=e.catch(3),e.t0;case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(t,r){return e.apply(this,arguments)}}(),_.handlePagination=function(){var e=p(v.mark((function e(t,r,n){var o;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n=[]),e.prev=1,e.next=4,_.callApiEndpointWithToken(r,t);case 4:return e.next=6,e.sent.data;case 6:if((o=e.sent).value.map((function(e){return n.push(e.id)})),!o[A.PAGINATION_LINK]){e.next=14;break}return e.next=11,_.handlePagination(t,o[A.PAGINATION_LINK],n);case 11:return e.abrupt("return",e.sent);case 14:return e.abrupt("return",n);case 15:e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,r,n){return e.apply(this,arguments)}}();var I=function(){};I.ensureAbsoluteUrl=function(e,r){var n=new t.UrlString(r).getUrlComponents();return n.Protocol?r:n.HostNameAndPort||r.startsWith("www")?e.protocol+"://"+r:r.startsWith("/")?e.protocol+"://"+e.get("host")+r:e.protocol+"://"+e.get("host")+"/"+r},I.getPathFromUrl=function(e){return"/"+new t.UrlString(e).getUrlComponents().PathSegments.join("/")};var O=["_claim_names","_claim_sources"],N=function(e){function n(t,r){var n;return(n=e.call(this,t,r)||this).webAppSettings=t,n}f(n,e);var o=n.prototype;return o.initialize=function(){var e=this,t=r.Router();return t.use((function(t,r,n){if(!t.session)throw e.logger.error("No session found for this request"),new Error("No session found for this request");n()})),t.post(I.getPathFromUrl(this.webAppSettings.authRoutes.redirect),this.handleRedirect()),this.webAppSettings.authRoutes.frontChannelLogout&&t.get(this.webAppSettings.authRoutes.frontChannelLogout,(function(e,t){e.session.destroy((function(){t.sendStatus(200)}))})),t},o.signIn=function(e){var r=this;return void 0===e&&(e={postLoginRedirect:"/",failureRedirect:"/"}),function(n,o,i){return r.redirectToAuthCodeUrl(n,o,i,{scopes:t.OIDC_DEFAULT_SCOPES},{scopes:t.OIDC_DEFAULT_SCOPES},{appStage:d.SIGN_IN,redirectTo:e.postLoginRedirect,csrfToken:n.session.csrfToken})}},o.signOut=function(e){var t=this;return void 0===e&&(e={postLogoutRedirect:"/"}),function(){var r=p(v.mark((function r(n,o){var i,s,a,c,u,p;return v.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=I.ensureAbsoluteUrl(n,e.postLogoutRedirect),c=t.msalConfig.auth.authority+"/oauth2/v2.0/logout?post_logout_redirect_uri="+a,u=t.msalClient.getTokenCache(),null==(i=n.session.account)||!i.homeAccountId){r.next=9;break}return r.next=6,u.getAccountByHomeId(n.session.account.homeAccountId);case 6:r.t0=r.sent,r.next=12;break;case 9:return r.next=11,u.getAccountByLocalId(null==(s=n.session.account)?void 0:s.localAccountId);case 11:r.t0=r.sent;case 12:if(!(p=r.t0)){r.next=16;break}return r.next=16,u.removeAccount(p);case 16:n.session.destroy((function(){o.redirect(c)}));case 17:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}()},o.handleRedirect=function(){var e=this;return function(){var t=p(v.mark((function t(r,n,o){var i,s,a,c,u;return v.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.session.key){t.next=3;break}return e.logger.error("No session key found in session. Cannot encrypt state data"),t.abrupt("return",o(new Error("No session key found in session. Cannot encrypt state data")));case 3:if(r.session.authorizationCodeRequest){t.next=6;break}return e.logger.error("No auth code request object found in session"),t.abrupt("return",o(new Error("No auth code request object found in session")));case 6:if(!r.body.state){t.next=51;break}if((i=JSON.parse(e.cryptoUtils.decryptData(e.cryptoProvider.base64Decode(r.body.state),Buffer.from(r.session.key,"hex")))).csrfToken!==r.session.csrfToken){t.next=48;break}t.t0=i.appStage,t.next=t.t0===d.SIGN_IN?12:t.t0===d.ACQUIRE_TOKEN?28:44;break;case 12:return r.session.authorizationCodeRequest.code=r.body.code,t.prev=13,t.next=16,e.msalClient.acquireTokenByCode(r.session.authorizationCodeRequest);case 16:if(s=t.sent){t.next=19;break}return t.abrupt("return",n.redirect(e.webAppSettings.authRoutes.unauthorized));case 19:r.session.isAuthenticated=!0,r.session.account=s.account,n.redirect(i.redirectTo),t.next=27;break;case 24:t.prev=24,t.t1=t.catch(13),o(t.t1);case 27:return t.abrupt("break",46);case 28:return a=R.getResourceNameFromScopes(r.session.authorizationCodeRequest.scopes,e.webAppSettings),r.session.authorizationCodeRequest.code=r.body.code,t.prev=30,t.next=33,e.msalClient.acquireTokenByCode(r.session.authorizationCodeRequest);case 33:if(u=t.sent){t.next=36;break}return t.abrupt("return",n.redirect(e.webAppSettings.authRoutes.unauthorized));case 36:r.session.protectedResources=((c={})[a]={accessToken:u.accessToken},c),n.redirect(i.redirectTo),t.next=43;break;case 40:t.prev=40,t.t2=t.catch(30),o(t.t2);case 43:return t.abrupt("break",46);case 44:return o(new Error("Cannot determine application stage")),t.abrupt("break",46);case 46:t.next=49;break;case 48:n.redirect(e.webAppSettings.authRoutes.unauthorized);case 49:t.next=52;break;case 51:n.redirect(e.webAppSettings.authRoutes.unauthorized);case 52:case"end":return t.stop()}}),t,null,[[13,24],[30,40]])})));return function(e,r,n){return t.apply(this,arguments)}}()},o.getToken=function(e){var r=this;return function(){var n=p(v.mark((function n(o,i,s){var a,c,u,p,f;return v.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r.webAppSettings.protectedResources){n.next=3;break}return r.logger.error(w),n.abrupt("return",s(new Error(w)));case 3:return u=R.getResourceNameFromScopes(c=e.resource.scopes,r.webAppSettings),o.session.protectedResources=((a={})[u]=l({},r.webAppSettings.protectedResources[u],{accessToken:void 0}),a),n.prev=6,p={account:o.session.account,scopes:c},n.next=10,r.msalClient.acquireTokenSilent(p);case 10:if((f=n.sent)&&!t.StringUtils.isEmpty(f.accessToken)){n.next=13;break}throw new t.InteractionRequiredAuthError("interaction_required");case 13:o.session.protectedResources[u].accessToken=f.accessToken,s(),n.next=27;break;case 17:if(n.prev=17,n.t0=n.catch(6),!(n.t0 instanceof t.InteractionRequiredAuthError||n.t0 instanceof t.ClientAuthError)){n.next=26;break}return n.abrupt("return",r.redirectToAuthCodeUrl(o,i,s,{scopes:c},{scopes:c},{appStage:d.ACQUIRE_TOKEN,redirectTo:o.originalUrl}));case 26:s(n.t0);case 27:case"end":return n.stop()}}),n,null,[[6,17]])})));return function(e,t,r){return n.apply(this,arguments)}}()},o.isAuthenticated=function(){var e=this;return function(t,r,n){if(!t.session.isAuthenticated)return r.redirect(e.webAppSettings.authRoutes.unauthorized);n()}},o.hasAccess=function(e){var t=this;return function(){var r=p(v.mark((function r(n,o,i){var s,a;return v.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.webAppSettings.accessMatrix){r.next=3;break}return t.logger.error("No access matrix is configured to control access for. Ensure that the application settings are configured properly."),r.abrupt("return",i(new Error("No access matrix is configured to control access for. Ensure that the application settings are configured properly.")));case 3:if(null!=(s=n.session.account)&&s.idTokenClaims){r.next=6;break}return t.logger.error("No id token claims found in session"),r.abrupt("return",i(new Error("No id token claims found in session")));case 6:a=e.accessRule.hasOwnProperty(A.GROUPS)?A.GROUPS:A.ROLES,r.t0=a,r.next=r.t0===A.GROUPS?10:r.t0===A.ROLES?25:34;break;case 10:if(n.session.account.idTokenClaims[A.GROUPS]){r.next=20;break}if(!n.session.account.idTokenClaims[A.CLAIM_NAMES]&&!n.session.account.idTokenClaims[A.CLAIM_SOURCES]){r.next=17;break}return r.next=14,t.handleOverage(n,o,i,e.accessRule);case 14:return r.abrupt("return",r.sent);case 17:return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 18:r.next=23;break;case 20:if(t.checkAccessRule(n.method,e.accessRule,n.session.account.idTokenClaims[A.GROUPS],A.GROUPS)){r.next=23;break}return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 23:return i(),r.abrupt("break",35);case 25:if(n.session.account.idTokenClaims[A.ROLES]){r.next=29;break}return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 29:if(t.checkAccessRule(n.method,e.accessRule,n.session.account.idTokenClaims[A.ROLES],A.ROLES)){r.next=32;break}return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 32:return i(),r.abrupt("break",35);case 34:return r.abrupt("break",35);case 35:case"end":return r.stop()}}),r)})));return function(e,t,n){return r.apply(this,arguments)}}()},o.redirectToAuthCodeUrl=function(){var e=p(v.mark((function e(r,n,o,i,s,a){var c,u;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.session.csrfToken=this.cryptoProvider.createNewGuid(),c=this.cryptoUtils.createKey(r.session.csrfToken,this.cryptoUtils.generateSalt()),r.session.key=c.toString("hex"),u=JSON.stringify(l({},a,{csrfToken:r.session.csrfToken})),r.session.authorizationUrlRequest=l({},i,{state:this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(u,c)),redirectUri:I.ensureAbsoluteUrl(r,this.webAppSettings.authRoutes.redirect),responseMode:t.ResponseMode.FORM_POST}),r.session.authorizationCodeRequest=l({},s,{redirectUri:I.ensureAbsoluteUrl(r,this.webAppSettings.authRoutes.redirect),code:""}),e.prev=6,e.next=9,this.msalClient.getAuthCodeUrl(r.session.authorizationUrlRequest);case 9:n.redirect(e.sent),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),o(e.t0);case 16:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t,r,n,o,i,s){return e.apply(this,arguments)}}(),o.handleOverage=function(){var e=p(v.mark((function e(t,r,n,o){var i,s,a,c,u;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(i=t.session.account)&&i.idTokenClaims){e.next=3;break}return this.logger.error("No id token claims found in session"),e.abrupt("return",n(new Error("No id token claims found in session")));case 3:return s=h(t.session.account.idTokenClaims,O),a={account:t.session.account,scopes:A.GRAPH_MEMBER_SCOPES.split(" ")},e.prev=5,e.next=8,this.msalClient.acquireTokenSilent(a);case 8:if(c=e.sent){e.next=11;break}return e.abrupt("return",r.redirect(this.webAppSettings.authRoutes.unauthorized));case 11:return e.prev=11,e.next=14,_.callApiEndpointWithToken(A.GRAPH_MEMBERS_ENDPOINT,c.accessToken);case 14:if(!(u=e.sent).data[A.PAGINATION_LINK]){e.next=33;break}return e.prev=16,e.next=19,_.handlePagination(c.accessToken,u.data[A.PAGINATION_LINK]);case 19:if(t.session.account.idTokenClaims=l({},s,{groups:e.sent}),this.checkAccessRule(t.method,o,t.session.account.idTokenClaims[A.GROUPS],A.GROUPS)){e.next=25;break}return e.abrupt("return",r.redirect(this.webAppSettings.authRoutes.unauthorized));case 25:return e.abrupt("return",n());case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(16),n(e.t0);case 31:e.next=39;break;case 33:if(t.session.account.idTokenClaims=l({},s,{groups:u.data.value.map((function(e){return e.id}))}),this.checkAccessRule(t.method,o,t.session.account.idTokenClaims[A.GROUPS],A.GROUPS)){e.next=38;break}return e.abrupt("return",r.redirect(this.webAppSettings.authRoutes.unauthorized));case 38:return e.abrupt("return",n());case 39:e.next=44;break;case 41:e.prev=41,e.t1=e.catch(11),n(e.t1);case 44:e.next=49;break;case 46:e.prev=46,e.t2=e.catch(5),n(e.t2);case 49:case"end":return e.stop()}}),e,this,[[5,46],[11,41],[16,28]])})));return function(t,r,n,o){return e.apply(this,arguments)}}(),o.checkAccessRule=function(e,t,r,n){if(!t.methods.includes(e))return!1;switch(n){case A.GROUPS:if(!t.groups||t.groups.filter((function(e){return r.includes(e)})).length<1)return!1;break;case A.ROLES:if(!t.roles||t.roles.filter((function(e){return r.includes(e)})).length<1)return!1}return!0},n}(T),P=function(e){function n(t,r){var n;return(n=e.call(this,t,r)||this).webAppSettings=t,n}f(n,e);var o=n.prototype;return o.initialize=function(){var e=this,n=r.Router();return n.get(I.getPathFromUrl(this.webAppSettings.authRoutes.redirect),this.handleRedirect()),n.post(I.getPathFromUrl(this.webAppSettings.authRoutes.redirect),this.handleRedirect()),n.use((function(r,n,o){if(!r.session)throw e.logger.error("No session found for this request"),new Error("No session found for this request");if(!r.session.isAuthenticated){var i=r.headers[S.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()];if(i){var s,a=t.AuthToken.extractTokenClaims(i,e.cryptoProvider);r.session.isAuthenticated=!0,r.session.account={tenantId:a.tid,homeAccountId:a.oid+"."+a.tid,localAccountId:a.oid,environment:null==(s=a.iss)?void 0:s.split("://")[1].split("/")[0],username:a.preferred_username,name:a.name,idTokenClaims:a}}}o()})),n},o.signIn=function(e){return void 0===e&&(e={postLoginRedirect:"/",failureRedirect:"/"}),function(t,r,n){var o,i=I.ensureAbsoluteUrl(t,e.postLoginRedirect);o="https://"+process.env.WEBSITE_HOSTNAME+"/.auth/login/aad?post_login_redirect_url="+i,r.redirect(o)}},o.signOut=function(e){return void 0===e&&(e={postLogoutRedirect:"/"}),function(t,r,n){var o=I.ensureAbsoluteUrl(t,e.postLogoutRedirect),i="https://"+process.env.WEBSITE_HOSTNAME+"/.auth/logout?post_logout_redirect_uri="+o;t.session.destroy((function(){r.redirect(i)}))}},o.handleRedirect=function(){return function(e,t,r){r()}},o.getToken=function(e){var r=this;return function(){var n=p(v.mark((function n(o,i,s){var a,c,u,p,f,h;return v.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r.webAppSettings.protectedResources){n.next=3;break}return r.logger.error(w),n.abrupt("return",s(new Error(w)));case 3:if(c=R.getResourceNameFromScopes(e.resource.scopes,r.webAppSettings),o.session.protectedResources=((a={})[c]=l({},r.webAppSettings.protectedResources[c],{accessToken:void 0}),a),!(u=o.headers[S.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()])){n.next=16;break}if(p=t.AuthToken.extractTokenClaims(u,r.cryptoProvider),f=null==p?void 0:p.scp.split(" "),h=R.getEffectiveScopes(f),!e.resource.scopes.every((function(e){return h.includes(e)}))){n.next=15;break}return o.session.protectedResources[c].accessToken=u,n.abrupt("return",s());case 15:return n.abrupt("return",s(new Error("No tokens found for given scopes")));case 16:case"end":return n.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()},o.isAuthenticated=function(){var e=this;return function(t,r,n){if(!t.session.isAuthenticated)return r.redirect(e.webAppSettings.authRoutes.unauthorized);n()}},n}(T),L=function(){function e(){}var t=e.prototype;return t.getCredentialFromKeyVault=function(){var e=p(v.mark((function e(t){var r,n,o,i,a,c,u;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new s.DefaultAzureCredential,n={},e.t0=t.credentialType,e.next=e.t0===b.SECRET?5:e.t0===b.CERTIFICATE?16:30;break;case 5:return e.prev=5,e.next=8,this.getSecretCredential(t,r);case 8:n={type:b.SECRET,value:e.sent.value},e.next=15;break;case 12:throw e.prev=12,e.t1=e.catch(5),e.t1;case 15:return e.abrupt("break",31);case 16:return e.prev=16,e.next=19,this.getCertificateCredential(t,r);case 19:return c=e.sent,e.next=22,this.getSecretCredential(t,r);case 22:u=e.sent,n={type:b.CERTIFICATE,value:{thumbprint:null==c||null==(o=c.properties)||null==(i=o.x509Thumbprint)?void 0:i.toString(),privateKey:null==u||null==(a=u.value)?void 0:a.split("-----BEGIN CERTIFICATE-----\n")[0]}},e.next=29;break;case 26:throw e.prev=26,e.t2=e.catch(16),e.t2;case 29:case 30:return e.abrupt("break",31);case 31:return e.abrupt("return",n);case 32:case"end":return e.stop()}}),e,this,[[5,12],[16,26]])})));return function(t){return e.apply(this,arguments)}}(),t.getCertificateCredential=function(){var e=p(v.mark((function e(t,r){var n;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new a.CertificateClient(t.keyVaultUrl,r),e.prev=1,e.next=4,n.getCertificate(t.credentialName);case 4:return e.abrupt("return",e.sent);case 8:throw e.prev=8,e.t0=e.catch(1),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),t.getSecretCredential=function(){var e=p(v.mark((function e(t,r){var n;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new c.SecretClient(t.keyVaultUrl,r),e.prev=1,e.next=4,n.getSecret(t.credentialName);case 4:return e.abrupt("return",e.sent);case 8:throw e.prev=8,e.t0=e.catch(1),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),e}(),U=function(){function e(){}return e.getMsalConfiguration=function(e){return{auth:l({clientId:e.appCredentials.clientId,authority:e.b2cPolicies?Object.entries(e.b2cPolicies)[0][1].authority:e.appCredentials.instance?"https://"+e.appCredentials.instance+"/"+e.appCredentials.tenantId:"https://"+t.Constants.DEFAULT_AUTHORITY_HOST+"/"+e.appCredentials.tenantId},e.appCredentials.hasOwnProperty("clientSecret")&&{clientSecret:e.appCredentials.clientSecret},e.appCredentials.hasOwnProperty("clientCertificate")&&{clientCertificate:e.appCredentials.clientCertificate},{knownAuthorities:e.b2cPolicies?[t.UrlString.getDomainFromUrl(Object.entries(e.b2cPolicies)[0][1].authority)]:[]}),system:{loggerOptions:e.loggerOptions?e.loggerOptions:C}}},e}(),M=function(){function e(){}return e.isProduction=function(){return!0},e.isDevelopment=function(){return!1},e.isAppServiceAuthEnabled=function(){return"True"===process.env.WEBSITE_AUTH_ENABLED},e}(),G=function(e){function t(t){return e.call(this,t,E.WebApp)||this}f(t,e);var r=t.prototype;return r.build=function(){return this.msalConfig=U.getMsalConfiguration(this.appSettings),M.isAppServiceAuthEnabled()?new P(this.appSettings,this.msalConfig):new N(this.appSettings,this.msalConfig)},r.buildAsync=function(){var e=p(v.mark((function e(){var t,r;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.keyVaultCredential){e.next=7;break}return t=new L,e.next=5,t.getCredentialFromKeyVault(this.keyVaultCredential);case 5:this.appSettings.appCredentials[(r=e.sent).type]=r.value;case 7:if(this.msalConfig=U.getMsalConfiguration(this.appSettings),!M.isAppServiceAuthEnabled()){e.next=12;break}return e.abrupt("return",new P(this.appSettings,this.msalConfig));case 12:return e.abrupt("return",new N(this.appSettings,this.msalConfig));case 13:e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(0),new Error("Cannot obtain credentials from Key Vault");case 18:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(){return e.apply(this,arguments)}}(),t}(k);exports.AppServiceWebAppAuthClient=P,exports.ConfigHelper=R,exports.FetchManager=_,exports.KeyVaultManager=L,exports.MsalConfiguration=U,exports.MsalWebAppAuthClient=N,exports.WebAppAuthClientBuilder=G,exports.packageVersion="beta"; +"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@azure/msal-common"),r=e(require("express")),n=require("@azure/msal-node"),o=require("crypto"),i=e(require("axios")),s=require("@azure/identity"),a=require("@azure/keyvault-certificates"),c=require("@azure/keyvault-secrets");function u(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){u(i,n,o,s,a,"next",e)}function a(e){u(i,n,o,s,a,"throw",e)}s(void 0)}))}}function l(){return(l=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}var d,g,v=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=Object.create((t&&t.prototype instanceof l?t:l).prototype),i=new w(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=m(s,r);if(a){if(a===p)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function l(){}function f(){}function h(){}var d={};a(d,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(C([])));v&&v!==t&&r.call(v,o)&&(d=v);var b=h.prototype=l.prototype=Object.create(d);function y(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){var n;this._invoke=function(o,i){function s(){return new t((function(n,s){!function n(o,i,s,a){var c=u(e[o],e,i);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(l).then((function(e){p.value=e,s(p)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function m(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,m(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(g={exports:{}}),g.exports);!function(e){e.SIGN_IN="sign_in",e.SIGN_OUT="sign_out",e.ACQUIRE_TOKEN="acquire_token"}(d||(d={}));var b,y={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"};!function(e){e.SECRET="clientSecret",e.CERTIFICATE="clientCertificate"}(b||(b={}));var E,m=["openid","profile","email","offline_access"],S={APP_SERVICE_AUTHENTICATION_HEADER:"X-MSAL-APP-SERVICE-AUTHENTICATION",APP_SERVICE_ACCESS_TOKEN_HEADER:"X-MS-TOKEN-AAD-ACCESS-TOKEN",APP_SERVICE_ID_TOKEN_HEADER:"X-MS-TOKEN-AAD-ID-TOKEN",APP_SERVICE_REFRESH_TOKEN_HEADER:"X-MS-TOKEN-AAD-REFRESH-TOKEN",APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER:"X-MS-TOKEN-AAD-EXPIRES-ON",APP_SERVICE_USER_OID_HEADER:"X-MS-CLIENT-PRINCIPAL-ID",APP_SERVICE_USER_UPN_HEADER:"X-MS-CLIENT-PRINCIPAL-NAME",APP_SERVICE_IDP_X_HEADER:"X-MS-CLIENT-PRINCIPAL-IDP"},A={GROUPS:"groups",ROLES:"roles",CLAIM_NAMES:"_claim_name",CLAIM_SOURCES:"_claim_sources",PAGINATION_LINK:"@odata.nextLink",GRAPH_MEMBERS_ENDPOINT:"https://graph.microsoft.com/v1.0/me/memberOf",GRAPH_MEMBER_SCOPES:"User.Read GroupMember.Read.All"},w="No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.",C={loggerCallback:function(e,t,r){r||console.info(t)},piiLoggingEnabled:!1,logLevel:t.LogLevel.Info};!function(e){e[e.WebApp=0]="WebApp"}(E||(E={}));var R=function(){function e(){}return e.validateAppSettings=function(r,n){var o,i;if(t.StringUtils.isEmpty(r.appCredentials.clientId))throw new Error("No clientId provided!");if(!e.isGuid(r.appCredentials.clientId))throw new Error("Invalid clientId!");if(t.StringUtils.isEmpty(r.appCredentials.tenantId))throw new Error("No tenant info provided!");if(!e.isGuid(r.appCredentials.tenantId)&&!Object.values(y).includes(r.appCredentials.tenantId))throw new Error("Invalid tenant info!");switch(n){case E.WebApp:if(t.StringUtils.isEmpty(null==(o=r.authRoutes)?void 0:o.redirect))throw new Error("No redirect URI provided!");if(t.StringUtils.isEmpty(null==(i=r.authRoutes)?void 0:i.unauthorized))throw new Error("No unauthorized route provided!")}},e.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e.getResourceNameFromScopes=function(e,t){var r=Object.values(l({},t.protectedResources)).findIndex((function(t){return JSON.stringify(t.scopes.sort())===JSON.stringify(e.sort())}));return Object.keys(l({},t.protectedResources))[r]},e.getScopesFromResourceEndpoint=function(e,t){var r;return(null==(r=Object.values(l({},t.protectedResources)).find((function(t){return t.endpoint===e})))?void 0:r.scopes)||[]},e.getEffectiveScopes=function(e){return e.filter((function(e){return!m.includes(e)}))},e}(),k=function(){function e(e,t){R.validateAppSettings(e,t),this.appSettings=e}var t=e.prototype;return t.withKeyVaultCredentials=function(e){return this.keyVaultCredential=e,this},t.withCustomCachePlugin=function(e){return this.customCachePlugin=e,this},e}(),x=function(){function e(e){void 0===e&&(e="aes-192-cbc"),this.algorithm=e}var t=e.prototype;return t.generateSalt=function(){return o.randomBytes(20).toString("hex")},t.createKey=function(e,t){return o.scryptSync(e,t,24)},t.encryptData=function(e,t){var r=o.randomBytes(16),n=o.createCipheriv(this.algorithm,t,r),i=n.update(e,"utf8","hex");return[r.toString("hex"),i+n.final("hex")].join(".")},t.decryptData=function(e,t){var r=e.split("."),n=r[1],i=o.createDecipheriv(this.algorithm,t,Buffer.from(r[0],"hex"));return i.update(n,"hex","utf8")+i.final("utf8")},e}(),T=function(){function e(e,r){var o;this.appSettings=e,this.msalConfig=r,this.cryptoProvider=new n.CryptoProvider,this.cryptoUtils=new x,this.logger=new t.Logger(null==(o=this.msalConfig.system)?void 0:o.loggerOptions,"@azure-samples/microsoft-identity-express","beta"),this.msalClient=new n.ConfidentialClientApplication(this.msalConfig)}var r=e.prototype;return r.getMsalClient=function(){return this.msalClient},r.getMsalConfig=function(){return this.msalConfig},r.getLogger=function(){return this.logger},e}(),_=function(){};_.callApiEndpoint=function(){var e=p(v.mark((function e(t){return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.get(t);case 3:return e.abrupt("return",e.sent.data);case 7:throw e.prev=7,e.t0=e.catch(0),e.t0;case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),_.callApiEndpointWithToken=function(){var e=p(v.mark((function e(r,n){var o;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.StringUtils.isEmpty(n)){e.next=2;break}throw new Error("No token found");case 2:return o={headers:{Authorization:"Bearer "+n}},e.prev=3,e.next=6,i.get(r,o);case 6:return e.abrupt("return",e.sent.data);case 10:throw e.prev=10,e.t0=e.catch(3),e.t0;case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(t,r){return e.apply(this,arguments)}}(),_.handlePagination=function(){var e=p(v.mark((function e(t,r,n){var o;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n=[]),e.prev=1,e.next=4,_.callApiEndpointWithToken(r,t);case 4:return e.next=6,e.sent.data;case 6:if((o=e.sent).value.map((function(e){return n.push(e.id)})),!o[A.PAGINATION_LINK]){e.next=14;break}return e.next=11,_.handlePagination(t,o[A.PAGINATION_LINK],n);case 11:return e.abrupt("return",e.sent);case 14:return e.abrupt("return",n);case 15:e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,r,n){return e.apply(this,arguments)}}();var I=function(){};I.ensureAbsoluteUrl=function(e,r){var n=new t.UrlString(r).getUrlComponents();return n.Protocol?r:n.HostNameAndPort||r.startsWith("www")?e.protocol+"://"+r:r.startsWith("/")?e.protocol+"://"+e.get("host")+r:e.protocol+"://"+e.get("host")+"/"+r},I.getPathFromUrl=function(e){return"/"+new t.UrlString(e).getUrlComponents().PathSegments.join("/")};var O=["_claim_names","_claim_sources"],N=function(e){function n(t,r){var n;return(n=e.call(this,t,r)||this).webAppSettings=t,n}f(n,e);var o=n.prototype;return o.initialize=function(){var e=this,t=r.Router();return t.use((function(t,r,n){if(!t.session)throw e.logger.error("No session found for this request"),new Error("No session found for this request");n()})),t.post(I.getPathFromUrl(this.webAppSettings.authRoutes.redirect),this.handleRedirect()),this.webAppSettings.authRoutes.frontChannelLogout&&t.get(this.webAppSettings.authRoutes.frontChannelLogout,(function(e,t){e.session.destroy((function(){t.sendStatus(200)}))})),t},o.signIn=function(e){var r=this;return void 0===e&&(e={postLoginRedirect:"/",failureRedirect:"/"}),function(n,o,i){return r.redirectToAuthCodeUrl(n,o,i,{scopes:t.OIDC_DEFAULT_SCOPES},{scopes:t.OIDC_DEFAULT_SCOPES},{appStage:d.SIGN_IN,redirectTo:e.postLoginRedirect,csrfToken:n.session.csrfToken})}},o.signOut=function(e){var t=this;return void 0===e&&(e={postLogoutRedirect:"/"}),function(){var r=p(v.mark((function r(n,o){var i,s,a,c,u,p;return v.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=I.ensureAbsoluteUrl(n,e.postLogoutRedirect),c=t.msalConfig.auth.authority+"/oauth2/v2.0/logout?post_logout_redirect_uri="+a,u=t.msalClient.getTokenCache(),null==(i=n.session.account)||!i.homeAccountId){r.next=9;break}return r.next=6,u.getAccountByHomeId(n.session.account.homeAccountId);case 6:r.t0=r.sent,r.next=12;break;case 9:return r.next=11,u.getAccountByLocalId(null==(s=n.session.account)?void 0:s.localAccountId);case 11:r.t0=r.sent;case 12:if(!(p=r.t0)){r.next=16;break}return r.next=16,u.removeAccount(p);case 16:n.session.destroy((function(){o.redirect(c)}));case 17:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}()},o.handleRedirect=function(){var e=this;return function(){var t=p(v.mark((function t(r,n,o){var i,s,a,c,u;return v.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.session.key){t.next=3;break}return e.logger.error("No session key found in session. Cannot encrypt state data"),t.abrupt("return",o(new Error("No session key found in session. Cannot encrypt state data")));case 3:if(r.session.authorizationCodeRequest){t.next=6;break}return e.logger.error("No auth code request object found in session"),t.abrupt("return",o(new Error("No auth code request object found in session")));case 6:if(!r.body.state){t.next=51;break}if((i=JSON.parse(e.cryptoUtils.decryptData(e.cryptoProvider.base64Decode(r.body.state),Buffer.from(r.session.key,"hex")))).csrfToken!==r.session.csrfToken){t.next=48;break}t.t0=i.appStage,t.next=t.t0===d.SIGN_IN?12:t.t0===d.ACQUIRE_TOKEN?28:44;break;case 12:return r.session.authorizationCodeRequest.code=r.body.code,t.prev=13,t.next=16,e.msalClient.acquireTokenByCode(r.session.authorizationCodeRequest);case 16:if(s=t.sent){t.next=19;break}return t.abrupt("return",n.redirect(e.webAppSettings.authRoutes.unauthorized));case 19:r.session.isAuthenticated=!0,r.session.account=s.account,n.redirect(i.redirectTo),t.next=27;break;case 24:t.prev=24,t.t1=t.catch(13),o(t.t1);case 27:return t.abrupt("break",46);case 28:return a=R.getResourceNameFromScopes(r.session.authorizationCodeRequest.scopes,e.webAppSettings),r.session.authorizationCodeRequest.code=r.body.code,t.prev=30,t.next=33,e.msalClient.acquireTokenByCode(r.session.authorizationCodeRequest);case 33:if(u=t.sent){t.next=36;break}return t.abrupt("return",n.redirect(e.webAppSettings.authRoutes.unauthorized));case 36:r.session.protectedResources=((c={})[a]={accessToken:u.accessToken},c),n.redirect(i.redirectTo),t.next=43;break;case 40:t.prev=40,t.t2=t.catch(30),o(t.t2);case 43:return t.abrupt("break",46);case 44:return o(new Error("Cannot determine application stage")),t.abrupt("break",46);case 46:t.next=49;break;case 48:n.redirect(e.webAppSettings.authRoutes.unauthorized);case 49:t.next=52;break;case 51:n.redirect(e.webAppSettings.authRoutes.unauthorized);case 52:case"end":return t.stop()}}),t,null,[[13,24],[30,40]])})));return function(e,r,n){return t.apply(this,arguments)}}()},o.getToken=function(e){var r=this;return function(){var n=p(v.mark((function n(o,i,s){var a,c,u,p,f;return v.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r.webAppSettings.protectedResources){n.next=3;break}return r.logger.error(w),n.abrupt("return",s(new Error(w)));case 3:return u=R.getResourceNameFromScopes(c=e.resource.scopes,r.webAppSettings),o.session.protectedResources=((a={})[u]=l({},r.webAppSettings.protectedResources[u],{accessToken:void 0}),a),n.prev=6,p={account:o.session.account,scopes:c},n.next=10,r.msalClient.acquireTokenSilent(p);case 10:if((f=n.sent)&&!t.StringUtils.isEmpty(f.accessToken)){n.next=13;break}throw new t.InteractionRequiredAuthError("interaction_required");case 13:o.session.protectedResources[u].accessToken=f.accessToken,s(),n.next=27;break;case 17:if(n.prev=17,n.t0=n.catch(6),!(n.t0 instanceof t.InteractionRequiredAuthError)){n.next=26;break}return n.abrupt("return",r.redirectToAuthCodeUrl(o,i,s,{scopes:c},{scopes:c},{appStage:d.ACQUIRE_TOKEN,redirectTo:o.originalUrl}));case 26:s(n.t0);case 27:case"end":return n.stop()}}),n,null,[[6,17]])})));return function(e,t,r){return n.apply(this,arguments)}}()},o.isAuthenticated=function(){var e=this;return function(t,r,n){if(!t.session.isAuthenticated)return r.redirect(e.webAppSettings.authRoutes.unauthorized);n()}},o.hasAccess=function(e){var t=this;return function(){var r=p(v.mark((function r(n,o,i){var s,a;return v.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.webAppSettings.accessMatrix){r.next=3;break}return t.logger.error("No access matrix is configured to control access for. Ensure that the application settings are configured properly."),r.abrupt("return",i(new Error("No access matrix is configured to control access for. Ensure that the application settings are configured properly.")));case 3:if(null!=(s=n.session.account)&&s.idTokenClaims){r.next=6;break}return t.logger.error("No id token claims found in session"),r.abrupt("return",i(new Error("No id token claims found in session")));case 6:a=e.accessRule.hasOwnProperty(A.GROUPS)?A.GROUPS:A.ROLES,r.t0=a,r.next=r.t0===A.GROUPS?10:r.t0===A.ROLES?25:34;break;case 10:if(n.session.account.idTokenClaims[A.GROUPS]){r.next=20;break}if(!n.session.account.idTokenClaims[A.CLAIM_NAMES]&&!n.session.account.idTokenClaims[A.CLAIM_SOURCES]){r.next=17;break}return r.next=14,t.handleOverage(n,o,i,e.accessRule);case 14:return r.abrupt("return",r.sent);case 17:return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 18:r.next=23;break;case 20:if(t.checkAccessRule(n.method,e.accessRule,n.session.account.idTokenClaims[A.GROUPS],A.GROUPS)){r.next=23;break}return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 23:return i(),r.abrupt("break",35);case 25:if(n.session.account.idTokenClaims[A.ROLES]){r.next=29;break}return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 29:if(t.checkAccessRule(n.method,e.accessRule,n.session.account.idTokenClaims[A.ROLES],A.ROLES)){r.next=32;break}return r.abrupt("return",o.redirect(t.webAppSettings.authRoutes.unauthorized));case 32:return i(),r.abrupt("break",35);case 34:return r.abrupt("break",35);case 35:case"end":return r.stop()}}),r)})));return function(e,t,n){return r.apply(this,arguments)}}()},o.redirectToAuthCodeUrl=function(){var e=p(v.mark((function e(r,n,o,i,s,a){var c,u;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.session.csrfToken=this.cryptoProvider.createNewGuid(),c=this.cryptoUtils.createKey(r.session.csrfToken,this.cryptoUtils.generateSalt()),r.session.key=c.toString("hex"),u=JSON.stringify(l({},a,{csrfToken:r.session.csrfToken})),r.session.authorizationUrlRequest=l({},i,{state:this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(u,c)),redirectUri:I.ensureAbsoluteUrl(r,this.webAppSettings.authRoutes.redirect),responseMode:t.ResponseMode.FORM_POST}),r.session.authorizationCodeRequest=l({},s,{redirectUri:I.ensureAbsoluteUrl(r,this.webAppSettings.authRoutes.redirect),code:""}),e.prev=6,e.next=9,this.msalClient.getAuthCodeUrl(r.session.authorizationUrlRequest);case 9:n.redirect(e.sent),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),o(e.t0);case 16:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t,r,n,o,i,s){return e.apply(this,arguments)}}(),o.handleOverage=function(){var e=p(v.mark((function e(t,r,n,o){var i,s,a,c,u;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(i=t.session.account)&&i.idTokenClaims){e.next=3;break}return this.logger.error("No id token claims found in session"),e.abrupt("return",n(new Error("No id token claims found in session")));case 3:return s=h(t.session.account.idTokenClaims,O),a={account:t.session.account,scopes:A.GRAPH_MEMBER_SCOPES.split(" ")},e.prev=5,e.next=8,this.msalClient.acquireTokenSilent(a);case 8:if(c=e.sent){e.next=11;break}return e.abrupt("return",r.redirect(this.webAppSettings.authRoutes.unauthorized));case 11:return e.prev=11,e.next=14,_.callApiEndpointWithToken(A.GRAPH_MEMBERS_ENDPOINT,c.accessToken);case 14:if(!(u=e.sent).data[A.PAGINATION_LINK]){e.next=33;break}return e.prev=16,e.next=19,_.handlePagination(c.accessToken,u.data[A.PAGINATION_LINK]);case 19:if(t.session.account.idTokenClaims=l({},s,{groups:e.sent}),this.checkAccessRule(t.method,o,t.session.account.idTokenClaims[A.GROUPS],A.GROUPS)){e.next=25;break}return e.abrupt("return",r.redirect(this.webAppSettings.authRoutes.unauthorized));case 25:return e.abrupt("return",n());case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(16),n(e.t0);case 31:e.next=39;break;case 33:if(t.session.account.idTokenClaims=l({},s,{groups:u.data.value.map((function(e){return e.id}))}),this.checkAccessRule(t.method,o,t.session.account.idTokenClaims[A.GROUPS],A.GROUPS)){e.next=38;break}return e.abrupt("return",r.redirect(this.webAppSettings.authRoutes.unauthorized));case 38:return e.abrupt("return",n());case 39:e.next=44;break;case 41:e.prev=41,e.t1=e.catch(11),n(e.t1);case 44:e.next=49;break;case 46:e.prev=46,e.t2=e.catch(5),n(e.t2);case 49:case"end":return e.stop()}}),e,this,[[5,46],[11,41],[16,28]])})));return function(t,r,n,o){return e.apply(this,arguments)}}(),o.checkAccessRule=function(e,t,r,n){if(!t.methods.includes(e))return!1;switch(n){case A.GROUPS:if(!t.groups||t.groups.filter((function(e){return r.includes(e)})).length<1)return!1;break;case A.ROLES:if(!t.roles||t.roles.filter((function(e){return r.includes(e)})).length<1)return!1}return!0},n}(T),P=function(e){function n(t,r){var n;return(n=e.call(this,t,r)||this).webAppSettings=t,n}f(n,e);var o=n.prototype;return o.initialize=function(){var e=this,n=r.Router();return n.get(I.getPathFromUrl(this.webAppSettings.authRoutes.redirect),this.handleRedirect()),n.post(I.getPathFromUrl(this.webAppSettings.authRoutes.redirect),this.handleRedirect()),n.use((function(r,n,o){if(!r.session)throw e.logger.error("No session found for this request"),new Error("No session found for this request");if(!r.session.isAuthenticated){var i=r.headers[S.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()];if(i){var s,a=t.AuthToken.extractTokenClaims(i,e.cryptoProvider);r.session.isAuthenticated=!0,r.session.account={tenantId:a.tid,homeAccountId:a.oid+"."+a.tid,localAccountId:a.oid,environment:null==(s=a.iss)?void 0:s.split("://")[1].split("/")[0],username:a.preferred_username,name:a.name,idTokenClaims:a}}}o()})),n},o.signIn=function(e){return void 0===e&&(e={postLoginRedirect:"/",failureRedirect:"/"}),function(t,r,n){var o,i=I.ensureAbsoluteUrl(t,e.postLoginRedirect);o="https://"+process.env.WEBSITE_HOSTNAME+"/.auth/login/aad?post_login_redirect_url="+i,r.redirect(o)}},o.signOut=function(e){return void 0===e&&(e={postLogoutRedirect:"/"}),function(t,r,n){var o=I.ensureAbsoluteUrl(t,e.postLogoutRedirect),i="https://"+process.env.WEBSITE_HOSTNAME+"/.auth/logout?post_logout_redirect_uri="+o;t.session.destroy((function(){r.redirect(i)}))}},o.handleRedirect=function(){return function(e,t,r){r()}},o.getToken=function(e){var r=this;return function(){var n=p(v.mark((function n(o,i,s){var a,c,u,p,f,h;return v.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r.webAppSettings.protectedResources){n.next=3;break}return r.logger.error(w),n.abrupt("return",s(new Error(w)));case 3:if(c=R.getResourceNameFromScopes(e.resource.scopes,r.webAppSettings),o.session.protectedResources=((a={})[c]=l({},r.webAppSettings.protectedResources[c],{accessToken:void 0}),a),!(u=o.headers[S.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()])){n.next=16;break}if(p=t.AuthToken.extractTokenClaims(u,r.cryptoProvider),f=null==p?void 0:p.scp.split(" "),h=R.getEffectiveScopes(f),!e.resource.scopes.every((function(e){return h.includes(e)}))){n.next=15;break}return o.session.protectedResources[c].accessToken=u,n.abrupt("return",s());case 15:return n.abrupt("return",s(new Error("No tokens found for given scopes")));case 16:case"end":return n.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()},o.isAuthenticated=function(){var e=this;return function(t,r,n){if(!t.session.isAuthenticated)return r.redirect(e.webAppSettings.authRoutes.unauthorized);n()}},n}(T),L=function(){function e(){}var t=e.prototype;return t.getCredentialFromKeyVault=function(){var e=p(v.mark((function e(t){var r,n,o,i,a,c,u;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new s.DefaultAzureCredential,n={},e.t0=t.credentialType,e.next=e.t0===b.SECRET?5:e.t0===b.CERTIFICATE?16:30;break;case 5:return e.prev=5,e.next=8,this.getSecretCredential(t,r);case 8:n={type:b.SECRET,value:e.sent.value},e.next=15;break;case 12:throw e.prev=12,e.t1=e.catch(5),e.t1;case 15:return e.abrupt("break",31);case 16:return e.prev=16,e.next=19,this.getCertificateCredential(t,r);case 19:return c=e.sent,e.next=22,this.getSecretCredential(t,r);case 22:u=e.sent,n={type:b.CERTIFICATE,value:{thumbprint:null==c||null==(o=c.properties)||null==(i=o.x509Thumbprint)?void 0:i.toString(),privateKey:null==u||null==(a=u.value)?void 0:a.split("-----BEGIN CERTIFICATE-----\n")[0]}},e.next=29;break;case 26:throw e.prev=26,e.t2=e.catch(16),e.t2;case 29:case 30:return e.abrupt("break",31);case 31:return e.abrupt("return",n);case 32:case"end":return e.stop()}}),e,this,[[5,12],[16,26]])})));return function(t){return e.apply(this,arguments)}}(),t.getCertificateCredential=function(){var e=p(v.mark((function e(t,r){var n;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new a.CertificateClient(t.keyVaultUrl,r),e.prev=1,e.next=4,n.getCertificate(t.credentialName);case 4:return e.abrupt("return",e.sent);case 8:throw e.prev=8,e.t0=e.catch(1),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),t.getSecretCredential=function(){var e=p(v.mark((function e(t,r){var n;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new c.SecretClient(t.keyVaultUrl,r),e.prev=1,e.next=4,n.getSecret(t.credentialName);case 4:return e.abrupt("return",e.sent);case 8:throw e.prev=8,e.t0=e.catch(1),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),e}(),U=function(){function e(){}return e.getMsalConfiguration=function(e){return{auth:l({clientId:e.appCredentials.clientId,authority:e.b2cPolicies?Object.entries(e.b2cPolicies)[0][1].authority:e.appCredentials.instance?"https://"+e.appCredentials.instance+"/"+e.appCredentials.tenantId:"https://"+t.Constants.DEFAULT_AUTHORITY_HOST+"/"+e.appCredentials.tenantId},e.appCredentials.hasOwnProperty("clientSecret")&&{clientSecret:e.appCredentials.clientSecret},e.appCredentials.hasOwnProperty("clientCertificate")&&{clientCertificate:e.appCredentials.clientCertificate},{knownAuthorities:e.b2cPolicies?[t.UrlString.getDomainFromUrl(Object.entries(e.b2cPolicies)[0][1].authority)]:[]}),system:{loggerOptions:e.loggerOptions?e.loggerOptions:C}}},e}(),M=function(){function e(){}return e.isProduction=function(){return!0},e.isDevelopment=function(){return!1},e.isAppServiceAuthEnabled=function(){return"True"===process.env.WEBSITE_AUTH_ENABLED},e}(),G=function(e){function t(t){return e.call(this,t,E.WebApp)||this}f(t,e);var r=t.prototype;return r.build=function(){return this.msalConfig=U.getMsalConfiguration(this.appSettings),M.isAppServiceAuthEnabled()?new P(this.appSettings,this.msalConfig):new N(this.appSettings,this.msalConfig)},r.buildAsync=function(){var e=p(v.mark((function e(){var t,r;return v.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.keyVaultCredential){e.next=7;break}return t=new L,e.next=5,t.getCredentialFromKeyVault(this.keyVaultCredential);case 5:this.appSettings.appCredentials[(r=e.sent).type]=r.value;case 7:if(this.msalConfig=U.getMsalConfiguration(this.appSettings),!M.isAppServiceAuthEnabled()){e.next=12;break}return e.abrupt("return",new P(this.appSettings,this.msalConfig));case 12:return e.abrupt("return",new N(this.appSettings,this.msalConfig));case 13:e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(0),new Error("Cannot obtain credentials from Key Vault");case 18:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(){return e.apply(this,arguments)}}(),t}(k);exports.AppServiceWebAppAuthClient=P,exports.ConfigHelper=R,exports.FetchManager=_,exports.KeyVaultManager=L,exports.MsalConfiguration=U,exports.MsalWebAppAuthClient=N,exports.WebAppAuthClientBuilder=G,exports.packageVersion="beta"; //# sourceMappingURL=microsoft-identity-express.cjs.production.min.js.map diff --git a/dist/microsoft-identity-express.cjs.production.min.js.map b/dist/microsoft-identity-express.cjs.production.min.js.map index 76020e9..0a907b8 100644 --- a/dist/microsoft-identity-express.cjs.production.min.js.map +++ b/dist/microsoft-identity-express.cjs.production.min.js.map @@ -1 +1 @@ -{"version":3,"file":"microsoft-identity-express.cjs.production.min.js","sources":["../src/utils/Constants.ts","../node_modules/regenerator-runtime/runtime.js","../src/config/AppSettings.ts","../src/config/ConfigHelper.ts","../src/client/BaseAuthClientBuilder.ts","../src/utils/CryptoUtils.ts","../src/client/BaseAuthClient.ts","../src/packageMetadata.ts","../src/network/FetchManager.ts","../src/utils/UrlUtils.ts","../src/client/webapp/MsalWebAppAuthClient.ts","../src/client/webapp/AppServiceWebAppAuthClient.ts","../src/network/KeyVaultManager.ts","../src/config/MsalConfiguration.ts","../src/utils/EnvironmentUtils.ts","../src/client/webapp/WebAppAuthClientBuilder.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions, LogLevel } from '@azure/msal-common';\r\n\r\n/**\r\n * Basic authentication stages used to determine\r\n * appropriate action after redirect occurs\r\n */\r\nexport enum AppStages {\r\n SIGN_IN = 'sign_in',\r\n SIGN_OUT = 'sign_out',\r\n ACQUIRE_TOKEN = 'acquire_token',\r\n}\r\n\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nexport const AADAuthorityConstants = {\r\n COMMON: 'common',\r\n ORGANIZATIONS: 'organizations',\r\n CONSUMERS: 'consumers',\r\n};\r\n\r\n/**\r\n * String constants related credential type\r\n */\r\nexport enum KeyVaultCredentialTypes {\r\n SECRET = 'clientSecret',\r\n CERTIFICATE = 'clientCertificate',\r\n}\r\n\r\nexport const OIDC_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\r\n\r\n/**\r\n * Request headers used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationHeaders = {\r\n APP_SERVICE_AUTHENTICATION_HEADER: 'X-MSAL-APP-SERVICE-AUTHENTICATION',\r\n APP_SERVICE_ACCESS_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ACCESS-TOKEN',\r\n APP_SERVICE_ID_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ID-TOKEN',\r\n APP_SERVICE_REFRESH_TOKEN_HEADER: 'X-MS-TOKEN-AAD-REFRESH-TOKEN',\r\n APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER: 'X-MS-TOKEN-AAD-EXPIRES-ON',\r\n APP_SERVICE_USER_OID_HEADER: 'X-MS-CLIENT-PRINCIPAL-ID',\r\n APP_SERVICE_USER_UPN_HEADER: 'X-MS-CLIENT-PRINCIPAL-NAME',\r\n APP_SERVICE_IDP_X_HEADER: 'X-MS-CLIENT-PRINCIPAL-IDP',\r\n};\r\n\r\n/**\r\n * Endpoints used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationEndpoints = {\r\n ID_TOKEN_ENDPOINT: '/.auth/me',\r\n POST_LOGOUT_DEFAULT_ENDPOINT: '/.auth/logout/done',\r\n POST_LOGIN_DEFAULT_ENDPOINT: '/.auth/login/done',\r\n AAD_SIGN_IN_ENDPOINT: '/.auth/login/aad',\r\n AAD_SIGN_OUT_ENDPOINT: '/.auth/logout',\r\n TOKEN_REFRESH_ENDPOINT: '/.auth/refresh',\r\n AAD_REDIRECT_ENDPOINT: '/.auth/login/aad/callback',\r\n};\r\n\r\n/**\r\n * Query parameters used by App Service authentication endpoints\r\n */\r\nexport const AppServiceAuthenticationQueryParameters = {\r\n POST_LOGIN_REDIRECT_QUERY_PARAM: '?post_login_redirect_url=',\r\n POST_LOGOUT_REDIRECT_QUERY_PARAM: '?post_logout_redirect_uri=',\r\n};\r\n\r\n/**\r\n * Environment variables used by App Service authentication\r\n */\r\nexport const AppServiceEnvironmentVariables = {\r\n WEBSITE_AUTH_ENABLED: 'WEBSITE_AUTH_ENABLED',\r\n WEBSITE_AUTH_ALLOWED_AUDIENCES: 'WEBSITE_AUTH_ALLOWED_AUDIENCES',\r\n WEBSITE_AUTH_DEFAULT_PROVIDER: 'WEBSITE_AUTH_DEFAULT_PROVIDER',\r\n WEBSITE_AUTH_TOKEN_STORE: 'WEBSITE_AUTH_TOKEN_STORE',\r\n WEBSITE_AUTH_LOGIN_PARAMS: 'WEBSITE_AUTH_LOGIN_PARAMS',\r\n WEBSITE_AUTH_PRESERVE_URL_FRAGMENT: 'WEBSITE_AUTH_PRESERVE_URL_FRAGMENT',\r\n WEBSITE_AUTH_OPENID_ISSUER: 'WEBSITE_AUTH_OPENID_ISSUER',\r\n WEBSITE_AUTH_CLIENT_ID: 'WEBSITE_AUTH_CLIENT_ID',\r\n WEBSITE_HOSTNAME: 'WEBSITE_HOSTNAME',\r\n WEBSITE_SITE_NAME: 'WEBSITE_SITE_NAME',\r\n WEBSITE_AUTH_REQUIRE_HTTPS: 'WEBSITE_AUTH_REQUIRE_HTTPS',\r\n WEBSITE_AUTH_UNAUTHENTICATED_ACTION: 'WEBSITE_AUTH_UNAUTHENTICATED_ACTION',\r\n WEBSITE_AUTH_API_PREFIX: 'WEBSITE_AUTH_API_PREFIX',\r\n MICROSOFT_PROVIDER_AUTHENTICATION_SECRET: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET',\r\n};\r\n\r\n/**\r\n * Constants used in access control scenarios\r\n */\r\nexport const AccessControlConstants = {\r\n GROUPS: 'groups',\r\n ROLES: 'roles',\r\n CLAIM_NAMES: '_claim_name',\r\n CLAIM_SOURCES: '_claim_sources',\r\n PAGINATION_LINK: '@odata.nextLink',\r\n GRAPH_MEMBERS_ENDPOINT: 'https://graph.microsoft.com/v1.0/me/memberOf',\r\n GRAPH_MEMBER_SCOPES: 'User.Read GroupMember.Read.All',\r\n};\r\n\r\n/**\r\n * Various information constants\r\n */\r\nexport const InfoMessages = {\r\n APP_SERVICE_AUTH_DETECTED: 'App Service Authentication detected',\r\n REQUEST_FOR_RESOURCE: 'Request made to web API',\r\n OVERAGE_OCCURRED: 'User has too many groups. Groups overage claim occurred',\r\n};\r\n\r\n/**\r\n * Various error constants\r\n */\r\nexport const ErrorMessages = {\r\n NOT_PERMITTED: 'Not permitted',\r\n INVALID_TOKEN: 'Invalid token',\r\n CANNOT_DETERMINE_APP_STAGE: 'Cannot determine application stage',\r\n CANNOT_VALIDATE_TOKEN: 'Cannot validate token',\r\n CSRF_TOKEN_MISMATCH: 'CSRF token in response does not match to original request',\r\n INTERACTION_REQUIRED: 'interaction_required',\r\n TOKEN_ACQUISITION_FAILED: 'Token acquisition failed',\r\n TOKEN_RESPONSE_NULL: 'Token response is null',\r\n AUTH_CODE_URL_NOT_OBTAINED: 'Authorization code url cannot be obtained',\r\n TOKEN_NOT_FOUND: 'No token found',\r\n TOKEN_NOT_DECODED: 'Token cannot be decoded',\r\n TOKEN_NOT_VERIFIED: 'Token cannot be verified',\r\n KEYS_NOT_OBTAINED: 'Signing keys cannot be obtained',\r\n STATE_NOT_FOUND: 'State not found',\r\n USER_HAS_NO_ROLE: 'User does not have any roles',\r\n USER_NOT_IN_ROLE: 'User does not have this role',\r\n USER_HAS_NO_GROUP: 'User does not have any groups',\r\n USER_NOT_IN_GROUP: 'User does not have this group',\r\n METHOD_NOT_ALLOWED: 'Method not allowed for this route',\r\n RULE_NOT_FOUND: 'No rule found for this route',\r\n SESSION_NOT_FOUND: 'No session found for this request',\r\n KEY_VAULT_CONFIG_NOT_FOUND: 'No coordinates found for Key Vault',\r\n CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT: 'Cannot obtain credentials from Key Vault',\r\n SESSION_KEY_NOT_FOUND: 'No session key found in session. Cannot encrypt state data',\r\n AUTH_CODE_REQUEST_OBJECT_NOT_FOUND: 'No auth code request object found in session',\r\n ID_TOKEN_CLAIMS_NOT_FOUND: 'No id token claims found in session',\r\n};\r\n\r\n/**\r\n * Various configuration error constants\r\n */\r\nexport const ConfigurationErrorMessages = {\r\n AUTH_ROUTES_NOT_CONFIGURED:\r\n 'Authentication routes are not defined. Ensure that the application settings are configured properly.',\r\n NO_PROTECTED_RESOURCE_CONFIGURED:\r\n 'No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.',\r\n NO_ACCESS_MATRIX_CONFIGURED:\r\n 'No access matrix is configured to control access for. Ensure that the application settings are configured properly.',\r\n NO_CLIENT_ID: 'No clientId provided!',\r\n INVALID_CLIENT_ID: 'Invalid clientId!',\r\n NO_TENANT_INFO: 'No tenant info provided!',\r\n INVALID_TENANT_INFO: 'Invalid tenant info!',\r\n NO_CLIENT_CREDENTIAL: 'No client credential provided!',\r\n NO_REDIRECT_URI: 'No redirect URI provided!',\r\n NO_UNAUTHORIZED_ROUTE: 'No unauthorized route provided!',\r\n};\r\n\r\n/**\r\n * For more information, visit: https://login.microsoftonline.com/error\r\n */\r\nexport const ErrorCodes = {\r\n 65001: 'AADSTS65001', // consent required\r\n 50076: 'AADSTS50076', // mfa required\r\n 50079: 'AADSTS50079', // mfa enrollment required\r\n 50001: 'AADSTS50001', // invalid resource uri\r\n 65004: 'AADSTS65004', // user declined consent\r\n 70011: 'AADSTS70011', // invalid scope\r\n 700022: 'AADSTS700022', // multiple resources\r\n 700020: 'AADSTS700020', // interaction required\r\n 90118: 'AADB2C90118', // password forgotten (B2C)\r\n};\r\n\r\nexport const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\r\n loggerCallback: (logLevel, message, containsPii) => {\r\n if (containsPii) {\r\n return;\r\n }\r\n console.info(message);\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n};\r\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions } from '@azure/msal-common';\r\n\r\nexport type AppSettings = {\r\n appCredentials: AppCredentials;\r\n loggerOptions?: LoggerOptions;\r\n b2cPolicies?: Record;\r\n accessMatrix?: Record;\r\n};\r\n\r\nexport type WebAppSettings = AppSettings & {\r\n authRoutes: AuthRoutes;\r\n protectedResources?: Record\r\n};\r\n\r\nexport type AppCredentials = {\r\n instance?: string;\r\n clientId: string;\r\n tenantId: string;\r\n clientSecret?: string;\r\n clientCertificate?: ClientCertificate;\r\n};\r\n\r\nexport type ClientCertificate = {\r\n thumbprint: string;\r\n privateKey: string;\r\n x5c?: string;\r\n};\r\n\r\nexport type KeyVaultCredential = {\r\n credentialType: string;\r\n credentialName: string;\r\n keyVaultUrl: string;\r\n};\r\n\r\nexport type AuthRoutes = {\r\n redirect: string;\r\n unauthorized: string;\r\n frontChannelLogout?: string;\r\n};\r\n\r\nexport type Policy = {\r\n authority: string;\r\n};\r\n\r\nexport type Resource = {\r\n endpoint: string;\r\n scopes: string[];\r\n accessToken?: string;\r\n};\r\n\r\nexport type AccessRule = {\r\n path: string;\r\n methods: string[];\r\n roles?: string[];\r\n groups?: string[];\r\n};\r\n\r\nexport enum AppType {\r\n WebApp\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AADAuthorityConstants, ConfigurationErrorMessages, OIDC_SCOPES } from '../utils/Constants';\r\nimport { AppSettings, AppType, Resource, WebAppSettings } from './AppSettings';\r\n\r\nexport class ConfigHelper {\r\n /**\r\n * Validates the fields in the configuration file\r\n * @param {AppSettings} appSettings: configuration object\r\n * @returns {void}\r\n */\r\n static validateAppSettings(appSettings: AppSettings, appType: AppType): void {\r\n if (StringUtils.isEmpty(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_CLIENT_ID);\r\n } else if (!ConfigHelper.isGuid(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_CLIENT_ID);\r\n }\r\n\r\n if (StringUtils.isEmpty(appSettings.appCredentials.tenantId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_TENANT_INFO);\r\n } else if (\r\n !ConfigHelper.isGuid(appSettings.appCredentials.tenantId) &&\r\n !Object.values(AADAuthorityConstants).includes(appSettings.appCredentials.tenantId)\r\n ) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_TENANT_INFO);\r\n }\r\n\r\n switch (appType) {\r\n case AppType.WebApp:\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.redirect)) {\r\n throw new Error(ConfigurationErrorMessages.NO_REDIRECT_URI);\r\n }\r\n\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.unauthorized)) {\r\n throw new Error(ConfigurationErrorMessages.NO_UNAUTHORIZED_ROUTE);\r\n }\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Verifies if a string is GUID\r\n * @param {string} guid\r\n * @returns {boolean}\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Util method to get the resource name for a given scope(s)\r\n * @param {Array} scopes: an array of scopes that the resource is associated with\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string {\r\n const index = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).findIndex((resource: Resource) =>\r\n JSON.stringify(resource.scopes.sort()) === JSON.stringify(scopes.sort())\r\n );\r\n\r\n const resourceName = Object.keys({\r\n ...webAppSettings.protectedResources,\r\n })[index];\r\n\r\n return resourceName;\r\n }\r\n\r\n /**\r\n * Util method to get the scopes for a given resource name\r\n * @param {string} resourceEndpoint: the resource name\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[] {\r\n const scopes = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).find((resource: Resource) => resource.endpoint === resourceEndpoint)?.scopes;\r\n\r\n return scopes ? scopes : [];\r\n }\r\n\r\n /**\r\n * Util method to strip the default OIDC scopes from the scopes array\r\n * @param {Array} scopesList full list of scopes for this resource\r\n * @returns\r\n */\r\n static getEffectiveScopes(scopesList: string[]): string[] {\r\n const effectiveScopesList = scopesList.filter(scope => !OIDC_SCOPES.includes(scope));\r\n return effectiveScopesList;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICachePlugin } from '@azure/msal-node';\r\n\r\nimport { ConfigHelper } from '../config/ConfigHelper';\r\nimport { AppSettings, AppType, KeyVaultCredential } from '../config/AppSettings';\r\n\r\nexport abstract class BaseAuthClientBuilder {\r\n appSettings: AppSettings;\r\n protected keyVaultCredential: KeyVaultCredential | undefined;\r\n protected customCachePlugin: ICachePlugin | undefined;\r\n\r\n protected constructor(appSettings: AppSettings, appType: AppType) {\r\n ConfigHelper.validateAppSettings(appSettings, appType);\r\n this.appSettings = appSettings;\r\n }\r\n\r\n withKeyVaultCredentials(keyVaultCredential: KeyVaultCredential): BaseAuthClientBuilder {\r\n this.keyVaultCredential = keyVaultCredential;\r\n return this;\r\n }\r\n\r\n withCustomCachePlugin(cachePlugin: ICachePlugin): BaseAuthClientBuilder {\r\n this.customCachePlugin = cachePlugin;\r\n return this;\r\n }\r\n\r\n abstract build(): any;\r\n\r\n abstract buildAsync(): Promise;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport * as crypto from 'crypto';\r\n\r\nexport class CryptoUtils {\r\n private algorithm: string;\r\n\r\n constructor(algorithm: string = 'aes-192-cbc') {\r\n this.algorithm = algorithm;\r\n }\r\n\r\n generateSalt(): string {\r\n return crypto.randomBytes(20).toString('hex');\r\n }\r\n\r\n createKey(password: string, salt: string): Buffer {\r\n return crypto.scryptSync(password, salt, 24);\r\n }\r\n\r\n encryptData(stringifiedData: string, key: Buffer): string {\r\n const iv = crypto.randomBytes(16);\r\n const cipher = crypto.createCipheriv(this.algorithm, key, iv);\r\n const encryptedData = cipher.update(stringifiedData, 'utf8', 'hex');\r\n\r\n return [iv.toString('hex'), encryptedData + cipher.final('hex')].join('.');\r\n }\r\n\r\n decryptData(encryptedData: string, key: Buffer): string {\r\n const [iv, encrypted] = encryptedData.split('.');\r\n const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(iv, 'hex'));\r\n return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from '@azure/msal-common';\r\nimport { ConfidentialClientApplication, Configuration, CryptoProvider } from '@azure/msal-node';\r\n\r\nimport { AppSettings } from '../config/AppSettings';\r\nimport { CryptoUtils } from '../utils/CryptoUtils';\r\nimport { packageName, packageVersion } from '../packageMetadata';\r\n\r\nexport abstract class BaseAuthClient {\r\n appSettings: AppSettings;\r\n\r\n protected msalConfig: Configuration;\r\n protected msalClient: ConfidentialClientApplication;\r\n protected cryptoProvider: CryptoProvider;\r\n protected cryptoUtils: CryptoUtils;\r\n protected logger: Logger;\r\n\r\n protected constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n this.appSettings = appSettings;\r\n this.msalConfig = msalConfig;\r\n this.cryptoProvider = new CryptoProvider();\r\n this.cryptoUtils = new CryptoUtils();\r\n\r\n this.logger = new Logger(this.msalConfig.system?.loggerOptions!, packageName, packageVersion);\r\n\r\n this.msalClient = new ConfidentialClientApplication(this.msalConfig);\r\n }\r\n\r\n getMsalClient(): ConfidentialClientApplication {\r\n return this.msalClient;\r\n }\r\n\r\n getMsalConfig(): Configuration {\r\n return this.msalConfig;\r\n }\r\n\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const packageName = '@azure-samples/microsoft-identity-express';\r\nexport const packageVersion = 'beta';\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport axios, { AxiosResponse, AxiosRequestConfig } from 'axios';\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AccessControlConstants, ErrorMessages } from '../utils/Constants';\r\n\r\nexport class FetchManager {\r\n /**\r\n * Calls a resource endpoint\r\n * @param {string} endpoint\r\n * @returns {Promise}\r\n */\r\n static callApiEndpoint = async (endpoint: string): Promise => {\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Calls a resource endpoint with a raw access token\r\n * using the authorization bearer token scheme\r\n * @param {string} endpoint\r\n * @param {string} accessToken\r\n * @returns {Promise}\r\n */\r\n static callApiEndpointWithToken = async (endpoint: string, accessToken: string): Promise> => {\r\n if (StringUtils.isEmpty(accessToken)) {\r\n throw new Error(ErrorMessages.TOKEN_NOT_FOUND);\r\n }\r\n\r\n const options: AxiosRequestConfig = {\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint, options);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Handles queries against Microsoft Graph that return multiple pages of data\r\n * @param {string} accessToken: access token required by endpoint\r\n * @param {string} nextPage: next page link\r\n * @param {Array} data: stores data from each page\r\n * @returns {Promise}\r\n */\r\n static handlePagination = async (accessToken: string, nextPage: string, data: string[] = []): Promise => {\r\n try {\r\n const graphResponse = await (await FetchManager.callApiEndpointWithToken(nextPage, accessToken)).data;\r\n graphResponse['value'].map((v: any) => data.push(v.id));\r\n\r\n if (graphResponse[AccessControlConstants.PAGINATION_LINK]) {\r\n return await FetchManager.handlePagination(\r\n accessToken,\r\n graphResponse[AccessControlConstants.PAGINATION_LINK],\r\n data\r\n );\r\n } else {\r\n return data;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Request } from 'express';\r\nimport { IUri, UrlString } from '@azure/msal-common';\r\n\r\nexport class UrlUtils {\r\n /**\r\n * Gets the absolute URL from a given request and path string\r\n * @param {Request} req: express request object\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static ensureAbsoluteUrl = (req: Request, url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n\r\n if (!urlComponents.Protocol) {\r\n if (!urlComponents.HostNameAndPort && !url.startsWith('www')) {\r\n if (!url.startsWith('/')) {\r\n return req.protocol + '://' + req.get('host') + '/' + url;\r\n }\r\n return req.protocol + '://' + req.get('host') + url;\r\n }\r\n return req.protocol + '://' + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n /**\r\n * Gets the path segment from a given URL\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static getPathFromUrl = (url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n return `/${urlComponents.PathSegments.join('/')}`;\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { RequestHandler, Request, Response, NextFunction, Router } from 'express';\r\nimport { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, ClientAuthError, StringUtils, ResponseMode } from '@azure/msal-common';\r\nimport { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node';\r\nimport { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings';\r\nimport { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions';\r\nimport { AppStages, ErrorMessages, AccessControlConstants, ConfigurationErrorMessages } from '../../utils/Constants';\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { FetchManager } from '../../network/FetchManager';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { AppState } from '../../utils/Types';\r\n\r\n/**\r\n * A simple wrapper around MSAL Node ConfidentialClientApplication object.\r\n * It offers a collection of middleware and utility methods that automate\r\n * basic authentication and authorization tasks in Express web apps\r\n */\r\nexport class MsalWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction) => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n next();\r\n });\r\n\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n if (this.webAppSettings.authRoutes.frontChannelLogout) {\r\n /**\r\n * Expose front-channel logout route. For more information, visit:\r\n * https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#single-sign-out\r\n */\r\n appRouter.get(this.webAppSettings.authRoutes.frontChannelLogout, (req: Request, res: Response) => {\r\n req.session.destroy(() => {\r\n res.sendStatus(200);\r\n });\r\n });\r\n }\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): Promise => {\r\n const appState = {\r\n appStage: AppStages.SIGN_IN,\r\n redirectTo: options.postLoginRedirect,\r\n csrfToken: req.session.csrfToken,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationCodeRequest;\r\n\r\n // get url to sign user in\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return async (req: Request, res: Response): Promise => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n\r\n /**\r\n * Construct a logout URI and redirect the user to end the\r\n * session with Azure AD/B2C. For more information, visit:\r\n * (AAD) https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#send-a-sign-out-request\r\n * (B2C) https://docs.microsoft.com/azure/active-directory-b2c/openid-connect#send-a-sign-out-request\r\n */\r\n const logoutUri = `${this.msalConfig.auth.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${postLogoutRedirectUri}`;\r\n\r\n const tokenCache = this.msalClient.getTokenCache();\r\n\r\n const account = req.session.account?.homeAccountId\r\n ?\r\n await tokenCache.getAccountByHomeId(req.session.account.homeAccountId)\r\n :\r\n await tokenCache.getAccountByLocalId(req.session.account?.localAccountId!);\r\n\r\n if (account) {\r\n await tokenCache.removeAccount(account);\r\n }\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!req.session.key) {\r\n this.logger.error(ErrorMessages.SESSION_KEY_NOT_FOUND);\r\n return next(new Error(ErrorMessages.SESSION_KEY_NOT_FOUND));\r\n }\r\n\r\n if (!req.session.authorizationCodeRequest) {\r\n this.logger.error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND);\r\n return next(new Error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND));\r\n }\r\n\r\n if (req.body.state) {\r\n const state: AppState = JSON.parse(\r\n this.cryptoUtils.decryptData(\r\n this.cryptoProvider.base64Decode(req.body.state as string),\r\n Buffer.from(req.session.key, 'hex')\r\n )\r\n );\r\n\r\n // check if csrfToken matches\r\n if (state.csrfToken === req.session.csrfToken) {\r\n switch (state.appStage) {\r\n case AppStages.SIGN_IN: {\r\n // token request should have auth code\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n // exchange auth code for tokens\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.isAuthenticated = true;\r\n req.session.account = tokenResponse.account!; // this won't be null in any web app scenario\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n case AppStages.ACQUIRE_TOKEN: {\r\n // get the name of the resource associated with scope\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(\r\n req.session.authorizationCodeRequest.scopes,\r\n this.webAppSettings\r\n );\r\n\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n accessToken: tokenResponse.accessToken,\r\n } as Resource,\r\n };\r\n\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n next(new Error(ErrorMessages.CANNOT_DETERMINE_APP_STAGE));\r\n break;\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens via acquireToken*\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const scopes = options.resource.scopes;\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n try {\r\n const silentRequest = {\r\n account: req.session.account,\r\n scopes: scopes,\r\n } as SilentFlowRequest;\r\n\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse || StringUtils.isEmpty(tokenResponse.accessToken)) {\r\n // In B2C scenarios, sometimes an access token is returned empty.\r\n // In that case, we will acquire token interactively instead.\r\n\r\n throw new InteractionRequiredAuthError(ErrorMessages.INTERACTION_REQUIRED);\r\n }\r\n\r\n req.session.protectedResources[resourceName].accessToken = tokenResponse.accessToken;\r\n next();\r\n } catch (error) {\r\n // in case there are no cached tokens, initiate an interactive call\r\n // FIXME: ClientAuthError used for temporary workaround regarding issue: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/4878\r\n if (error instanceof InteractionRequiredAuthError || error instanceof ClientAuthError) {\r\n const appState = {\r\n appStage: AppStages.ACQUIRE_TOKEN,\r\n redirectTo: req.originalUrl,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: scopes,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: scopes,\r\n } as AuthorizationCodeRequest;\r\n\r\n // initiate the first leg of auth code grant to get token\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n } else {\r\n next(error);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Checks if the user has access for this route, defined in access matrix\r\n * @param {GuardOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n hasAccess(options: GuardOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.accessMatrix) {\r\n this.logger.error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED));\r\n }\r\n\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const checkFor = options.accessRule.hasOwnProperty(AccessControlConstants.GROUPS)\r\n ? AccessControlConstants.GROUPS\r\n : AccessControlConstants.ROLES;\r\n\r\n switch (checkFor) {\r\n case AccessControlConstants.GROUPS:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.GROUPS]) {\r\n if (\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_NAMES] ||\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_SOURCES]\r\n ) {\r\n return await this.handleOverage(req, res, next, options.accessRule);\r\n } else {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n const groups = req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, groups, AccessControlConstants.GROUPS)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.ROLES]) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n const roles = req.session.account.idTokenClaims[AccessControlConstants.ROLES] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, roles, AccessControlConstants.ROLES)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n };\r\n }\r\n\r\n // ============== UTILS ===============\r\n\r\n /**\r\n * This method is used to generate an auth code url request\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AuthCodeParams} params: modifies auth code url request\r\n * @returns {Promise}\r\n */\r\n private async redirectToAuthCodeUrl(\r\n req: Request,\r\n res: Response,\r\n next: NextFunction,\r\n authUrlParams: AuthorizationUrlRequest,\r\n authCodeParams: AuthorizationCodeRequest,\r\n appState: AppState\r\n ): Promise {\r\n // add session csrfToken for crsf\r\n req.session.csrfToken = this.cryptoProvider.createNewGuid();\r\n\r\n const key = this.cryptoUtils.createKey(req.session.csrfToken, this.cryptoUtils.generateSalt());\r\n req.session.key = key.toString('hex');\r\n\r\n const state = JSON.stringify({\r\n ...appState,\r\n csrfToken: req.session.csrfToken,\r\n });\r\n\r\n // prepare the request\r\n req.session.authorizationUrlRequest = {\r\n ...authUrlParams,\r\n state: this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(state, key)),\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n responseMode: ResponseMode.FORM_POST\r\n };\r\n\r\n req.session.authorizationCodeRequest = {\r\n ...authCodeParams,\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n code: ''\r\n };\r\n\r\n // request an authorization code to exchange for tokens\r\n try {\r\n const response = await this.msalClient.getAuthCodeUrl(req.session.authorizationUrlRequest);\r\n res.redirect(response);\r\n } catch (error) {\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles group overage claims by querying MS Graph /memberOf endpoint\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AccessRule} rule: a given access rule\r\n * @returns {Promise}\r\n */\r\n private async handleOverage(req: Request, res: Response, next: NextFunction, rule: AccessRule): Promise {\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const { _claim_names, _claim_sources, ...newIdTokenClaims } = req.session.account.idTokenClaims;\r\n\r\n const silentRequest: SilentFlowRequest = {\r\n account: req.session.account,\r\n scopes: AccessControlConstants.GRAPH_MEMBER_SCOPES.split(' '),\r\n };\r\n\r\n try {\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n try {\r\n const graphResponse = await FetchManager.callApiEndpointWithToken(\r\n AccessControlConstants.GRAPH_MEMBERS_ENDPOINT,\r\n tokenResponse.accessToken\r\n );\r\n\r\n /**\r\n * Some queries against Microsoft Graph return multiple pages of data either due to server-side paging\r\n * or due to the use of the $top query parameter to specifically limit the page size in a request.\r\n * When a result set spans multiple pages, Microsoft Graph returns an @odata.nextLink property in\r\n * the response that contains a URL to the next page of results. Learn more at https://docs.microsoft.com/graph/paging\r\n */\r\n if (graphResponse.data[AccessControlConstants.PAGINATION_LINK]) {\r\n try {\r\n const userGroups = await FetchManager.handlePagination(\r\n tokenResponse.accessToken,\r\n graphResponse.data[AccessControlConstants.PAGINATION_LINK]\r\n );\r\n\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: userGroups,\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } else {\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: graphResponse.data['value'].map((v: any) => v.id),\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } catch (error) {\r\n // TODO: handle silent token acquisition error\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the request passes a given access rule\r\n * @param {string} method: HTTP method for this route\r\n * @param {AccessRule} rule: access rule for this route\r\n * @param {Array} creds: user's credentials i.e. roles or groups\r\n * @param {string} credType: roles or groups\r\n * @returns {boolean}\r\n */\r\n private checkAccessRule(method: string, rule: AccessRule, creds: string[], credType: string): boolean {\r\n if (rule.methods.includes(method)) {\r\n switch (credType) {\r\n case AccessControlConstants.GROUPS:\r\n if (!rule.groups || rule.groups.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!rule.roles || rule.roles!.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { Router, RequestHandler, Request, Response, NextFunction } from 'express';\r\nimport { AccountInfo, AuthToken } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { AccessTokenClaims, IdTokenClaims } from '../../utils/Types';\r\nimport { AppSettings, Resource, WebAppSettings } from '../../config/AppSettings';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { SignInOptions, SignOutOptions, TokenRequestOptions } from '../MiddlewareOptions';\r\nimport {\r\n AppServiceAuthenticationHeaders,\r\n AppServiceEnvironmentVariables,\r\n AppServiceAuthenticationEndpoints,\r\n AppServiceAuthenticationQueryParameters,\r\n ErrorMessages,\r\n ConfigurationErrorMessages,\r\n} from '../../utils/Constants';\r\n\r\nexport class AppServiceWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @param {InitializationOptions} options\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n // handle redirect\r\n appRouter.get(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n if (!req.session.isAuthenticated) {\r\n // check headers for id token\r\n const rawIdToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawIdToken) {\r\n // parse the id token\r\n const idTokenClaims: IdTokenClaims = AuthToken.extractTokenClaims(rawIdToken, this.cryptoProvider);\r\n\r\n req.session.isAuthenticated = true;\r\n\r\n req.session.account = {\r\n tenantId: idTokenClaims.tid,\r\n homeAccountId: idTokenClaims.oid + '.' + idTokenClaims.tid,\r\n localAccountId: idTokenClaims.oid,\r\n environment: idTokenClaims.iss?.split('://')[1].split('/')[0],\r\n username: idTokenClaims.preferred_username,\r\n name: idTokenClaims.name,\r\n idTokenClaims: idTokenClaims,\r\n } as AccountInfo;\r\n }\r\n }\r\n\r\n next();\r\n });\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n let loginUri;\r\n const postLoginRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLoginRedirect);\r\n loginUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_IN_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGIN_REDIRECT_QUERY_PARAM +\r\n postLoginRedirectUri;\r\n res.redirect(loginUri);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n const logoutUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_OUT_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGOUT_REDIRECT_QUERY_PARAM +\r\n postLogoutRedirectUri;\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(options.resource.scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n const rawAccessToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawAccessToken) {\r\n const accessTokenClaims = AuthToken.extractTokenClaims(\r\n rawAccessToken,\r\n this.cryptoProvider\r\n ) as AccessTokenClaims;\r\n\r\n // get the name of the resource associated with scope\r\n const scopes = accessTokenClaims?.scp.split(' ');\r\n const effectiveScopes = ConfigHelper.getEffectiveScopes(scopes);\r\n\r\n if (options.resource.scopes.every(elem => effectiveScopes.includes(elem))) {\r\n req.session.protectedResources[resourceName].accessToken = rawAccessToken;\r\n return next();\r\n } else {\r\n return next(new Error('No tokens found for given scopes'));\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DefaultAzureCredential } from '@azure/identity';\r\nimport { CertificateClient, KeyVaultCertificate } from '@azure/keyvault-certificates';\r\nimport { KeyVaultSecret, SecretClient } from '@azure/keyvault-secrets';\r\n\r\nimport { KeyVaultCredential, ClientCertificate } from '../config/AppSettings';\r\nimport { KeyVaultCredentialTypes } from '../utils/Constants';\r\n\r\nexport type KeyVaultCredentialResponse = {\r\n type: KeyVaultCredentialTypes.SECRET | KeyVaultCredentialTypes.CERTIFICATE;\r\n value: string & ClientCertificate;\r\n};\r\n\r\nexport class KeyVaultManager {\r\n /**\r\n * Fetches credentials from Key Vault and updates appSettings\r\n * @param {AppSettings} appSettings\r\n * @returns {Promise}\r\n */\r\n async getCredentialFromKeyVault(keyVaultCredential: KeyVaultCredential): Promise {\r\n const credential = new DefaultAzureCredential();\r\n let response: KeyVaultCredentialResponse = {} as KeyVaultCredentialResponse;\r\n\r\n switch (keyVaultCredential.credentialType) {\r\n case KeyVaultCredentialTypes.SECRET: {\r\n try {\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.SECRET,\r\n value: secretResponse.value,\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n case KeyVaultCredentialTypes.CERTIFICATE: {\r\n try {\r\n const certificateResponse = await this.getCertificateCredential(keyVaultCredential, credential);\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.CERTIFICATE,\r\n value: {\r\n thumbprint: certificateResponse?.properties?.x509Thumbprint?.toString(),\r\n privateKey: secretResponse?.value?.split('-----BEGIN CERTIFICATE-----\\n')[0],\r\n },\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Gets a certificate credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getCertificateCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new CertificateClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultCertificate = await secretClient.getCertificate(keyVaultCredential.credentialName);\r\n return keyVaultCertificate;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a secret credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getSecretCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new SecretClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultSecret = await secretClient.getSecret(keyVaultCredential.credentialName);\r\n return keyVaultSecret;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { UrlString, Constants } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { DEFAULT_LOGGER_OPTIONS } from '../utils/Constants';\r\nimport { AppSettings } from './AppSettings';\r\n\r\nexport class MsalConfiguration {\r\n /**\r\n * Maps the custom configuration object to configuration\r\n * object expected by MSAL Node ConfidentialClientApplication class\r\n * @param {AppSettings} appSettings: configuration object\r\n * @param {ICachePlugin} cachePlugin: custom cache plugin\r\n * @param {IDistributedPersistence} distributedPersistence: distributed persistence client\r\n * @returns {Configuration}\r\n */\r\n static getMsalConfiguration(appSettings: AppSettings): Configuration {\r\n return {\r\n auth: {\r\n clientId: appSettings.appCredentials.clientId,\r\n authority: appSettings.b2cPolicies\r\n ? Object.entries(appSettings.b2cPolicies)[0][1]['authority'] // the first policy/user-flow is the default authority\r\n : appSettings.appCredentials.instance\r\n ? `https://${appSettings.appCredentials.instance}/${appSettings.appCredentials.tenantId}`\r\n : `https://${Constants.DEFAULT_AUTHORITY_HOST}/${appSettings.appCredentials.tenantId}`,\r\n ...(appSettings.appCredentials.hasOwnProperty('clientSecret') && {\r\n clientSecret: appSettings.appCredentials.clientSecret,\r\n }),\r\n ...(appSettings.appCredentials.hasOwnProperty('clientCertificate') && {\r\n clientCertificate: appSettings.appCredentials.clientCertificate,\r\n }),\r\n knownAuthorities: appSettings.b2cPolicies\r\n ? [UrlString.getDomainFromUrl(Object.entries(appSettings.b2cPolicies)[0][1]['authority'])] // in B2C scenarios\r\n : [],\r\n },\r\n system: {\r\n loggerOptions: appSettings.loggerOptions ? appSettings.loggerOptions : DEFAULT_LOGGER_OPTIONS,\r\n },\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AppServiceEnvironmentVariables } from './Constants';\r\n\r\nexport class EnvironmentUtils {\r\n static isProduction(): boolean {\r\n return process.env.NODE_ENV === 'production';\r\n }\r\n\r\n static isDevelopment(): boolean {\r\n return process.env.NODE_ENV === 'development';\r\n }\r\n\r\n static isAppServiceAuthEnabled(): boolean {\r\n return process.env[AppServiceEnvironmentVariables.WEBSITE_AUTH_ENABLED] === 'True';\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClientBuilder } from '../BaseAuthClientBuilder';\r\nimport { MsalWebAppAuthClient } from './MsalWebAppAuthClient';\r\nimport { AppServiceWebAppAuthClient } from './AppServiceWebAppAuthClient';\r\nimport { KeyVaultManager } from '../../network/KeyVaultManager';\r\nimport { MsalConfiguration } from '../../config/MsalConfiguration';\r\nimport { AppSettings, AppType } from '../../config/AppSettings';\r\nimport { EnvironmentUtils } from '../../utils/EnvironmentUtils';\r\nimport { ErrorMessages } from '../../utils/Constants';\r\n\r\nexport class WebAppAuthClientBuilder extends BaseAuthClientBuilder {\r\n appSettings!: AppSettings;\r\n private msalConfig!: Configuration;\r\n\r\n constructor(appSettings: AppSettings) {\r\n super(appSettings, AppType.WebApp);\r\n }\r\n\r\n build(): MsalWebAppAuthClient | AppServiceWebAppAuthClient {\r\n // TODO: throw error if key vault credential is being built\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n }\r\n\r\n async buildAsync(): Promise {\r\n try {\r\n if (this.keyVaultCredential) {\r\n const keyVaultManager = new KeyVaultManager();\r\n const credential = await keyVaultManager.getCredentialFromKeyVault(this.keyVaultCredential);\r\n this.appSettings.appCredentials[credential.type] = credential.value;\r\n }\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n } catch (error) {\r\n throw new Error(ErrorMessages.CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT);\r\n }\r\n }\r\n}\r\n"],"names":["AppStages","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","KeyVaultCredentialTypes","AADAuthorityConstants","COMMON","ORGANIZATIONS","CONSUMERS","AppType","OIDC_SCOPES","AppServiceAuthenticationHeaders","APP_SERVICE_AUTHENTICATION_HEADER","APP_SERVICE_ACCESS_TOKEN_HEADER","APP_SERVICE_ID_TOKEN_HEADER","APP_SERVICE_REFRESH_TOKEN_HEADER","APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER","APP_SERVICE_USER_OID_HEADER","APP_SERVICE_USER_UPN_HEADER","APP_SERVICE_IDP_X_HEADER","AccessControlConstants","GROUPS","ROLES","CLAIM_NAMES","CLAIM_SOURCES","PAGINATION_LINK","GRAPH_MEMBERS_ENDPOINT","GRAPH_MEMBER_SCOPES","ConfigurationErrorMessages","DEFAULT_LOGGER_OPTIONS","loggerCallback","logLevel","message","containsPii","console","piiLoggingEnabled","LogLevel","Info","ConfigHelper","validateAppSettings","appSettings","appType","StringUtils","isEmpty","appCredentials","clientId","isGuid","tenantId","includes","WebApp","authRoutes","_appSettings$authRout","redirect","_appSettings$authRout2","unauthorized","guid","test","getResourceNameFromScopes","scopes","webAppSettings","index","protectedResources","findIndex","resource","JSON","stringify","sort","getScopesFromResourceEndpoint","resourceEndpoint","find","endpoint","_Object$values$find","getEffectiveScopes","scopesList","filter","scope","BaseAuthClientBuilder","withKeyVaultCredentials","keyVaultCredential","withCustomCachePlugin","cachePlugin","customCachePlugin","CryptoUtils","algorithm","generateSalt","crypto","toString","createKey","password","salt","encryptData","stringifiedData","iv","cipher","encryptedData","update","join","decryptData","split","encrypted","decipher","Buffer","from","BaseAuthClient","msalConfig","cryptoProvider","CryptoProvider","cryptoUtils","logger","Logger","system","_this$msalConfig$syst","loggerOptions","msalClient","ConfidentialClientApplication","getMsalClient","getMsalConfig","getLogger","FetchManager","axios","get","data","accessToken","options","headers","Authorization","nextPage","callApiEndpointWithToken","graphResponse","map","v","id","handlePagination","UrlUtils","req","url","urlComponents","UrlString","getUrlComponents","Protocol","HostNameAndPort","startsWith","protocol","PathSegments","MsalWebAppAuthClient","initialize","appRouter","express","Router","use","res","session","_this2","post","getPathFromUrl","handleRedirect","frontChannelLogout","destroy","sendStatus","signIn","postLoginRedirect","failureRedirect","_this3","redirectToAuthCodeUrl","OIDC_DEFAULT_SCOPES","appStage","SIGN_IN","redirectTo","csrfToken","signOut","postLogoutRedirect","postLogoutRedirectUri","ensureAbsoluteUrl","logoutUri","_this4","auth","authority","tokenCache","getTokenCache","account","_req$session$account","homeAccountId","getAccountByHomeId","getAccountByLocalId","_req$session$account2","localAccountId","removeAccount","_this5","authorizationCodeRequest","body","parse","base64Decode","ACQUIRE_TOKEN","code","acquireTokenByCode","tokenResponse","isAuthenticated","resourceName","getToken","_this6","silentRequest","acquireTokenSilent","InteractionRequiredAuthError","_context3","ClientAuthError","originalUrl","_this7","hasAccess","_this8","accessMatrix","_req$session$account3","idTokenClaims","checkFor","accessRule","handleOverage","checkAccessRule","authUrlParams","authCodeParams","appState","createNewGuid","authorizationUrlRequest","base64Encode","redirectUri","responseMode","ResponseMode","FORM_POST","getAuthCodeUrl","rule","_req$session$account4","_claim_names","newIdTokenClaims","groups","creds","credType","methods","elem","roles","AppServiceWebAppAuthClient","rawIdToken","toLowerCase","AuthToken","extractTokenClaims","tid","oid","environment","iss","_idTokenClaims$iss","username","preferred_username","loginUri","postLoginRedirectUri","process","env","rawAccessToken","accessTokenClaims","scp","effectiveScopes","every","KeyVaultManager","getCredentialFromKeyVault","credential","DefaultAzureCredential","response","credentialType","SECRET","CERTIFICATE","getSecretCredential","getCertificateCredential","certificateResponse","secretResponse","thumbprint","properties","_certificateResponse$","x509Thumbprint","_certificateResponse$2","privateKey","_secretResponse$value","secretClient","CertificateClient","keyVaultUrl","getCertificate","credentialName","SecretClient","getSecret","MsalConfiguration","getMsalConfiguration","b2cPolicies","entries","instance","Constants","DEFAULT_AUTHORITY_HOST","clientSecret","clientCertificate","knownAuthorities","getDomainFromUrl","EnvironmentUtils","isProduction","isDevelopment","isAppServiceAuthEnabled","WebAppAuthClientBuilder","_BaseAuthClientBuilde","build","buildAsync","keyVaultManager"],"mappings":"kqCAWYA,mBCJZ,IAAIC,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF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AYwE,cAAgBnF,UCjC1E0Q,oCACFC,aAAP,kBACW7C,KAGJ8C,cAAP,kBACW9C,KAGJ+C,wBAAP,iBACgF,SAArE/C,QAAQC,IAAR,2BCDF+C,yBAIGnQ,UACRoQ,YAAMpQ,EAAa/B,EAAQwC,gDAG/B4P,MAAA,uBAGSrM,WAAaoL,EAAkBC,qBAAqB7W,KAAKwH,aAE1D+P,EAAiBG,0BACV,IAAI7D,EAA2B7T,KAAKwH,YAAaxH,KAAKwL,YAEtD,IAAIwC,EAAqBhO,KAAKwH,YAAaxH,KAAKwL,eAIzDsM,sCAAN,iGAEY9X,KAAK8J,0CACCiO,EAAkB,IAAI7C,WACH6C,EAAgB5C,0BAA0BnV,KAAK8J,gCACnEtC,YAAYI,gBADXwN,UACqC3V,MAAQ2V,EAAW5X,qBAG7DgO,WAAaoL,EAAkBC,qBAAqB7W,KAAKwH,cAE1D+P,EAAiBG,oEACV,IAAI7D,EAA2B7T,KAAKwH,YAAaxH,KAAKwL,8CAEtD,IAAIwC,EAAqBhO,KAAKwH,YAAaxH,KAAKwL,6EAGrD,IAAI5M,MfuFwB,8Je3HDgL,oORVf"} \ No newline at end of file +{"version":3,"file":"microsoft-identity-express.cjs.production.min.js","sources":["../src/utils/Constants.ts","../node_modules/regenerator-runtime/runtime.js","../src/config/AppSettings.ts","../src/config/ConfigHelper.ts","../src/client/BaseAuthClientBuilder.ts","../src/utils/CryptoUtils.ts","../src/client/BaseAuthClient.ts","../src/packageMetadata.ts","../src/network/FetchManager.ts","../src/utils/UrlUtils.ts","../src/client/webapp/MsalWebAppAuthClient.ts","../src/client/webapp/AppServiceWebAppAuthClient.ts","../src/network/KeyVaultManager.ts","../src/config/MsalConfiguration.ts","../src/utils/EnvironmentUtils.ts","../src/client/webapp/WebAppAuthClientBuilder.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions, LogLevel } from '@azure/msal-common';\r\n\r\n/**\r\n * Basic authentication stages used to determine\r\n * appropriate action after redirect occurs\r\n */\r\nexport enum AppStages {\r\n SIGN_IN = 'sign_in',\r\n SIGN_OUT = 'sign_out',\r\n ACQUIRE_TOKEN = 'acquire_token',\r\n}\r\n\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nexport const AADAuthorityConstants = {\r\n COMMON: 'common',\r\n ORGANIZATIONS: 'organizations',\r\n CONSUMERS: 'consumers',\r\n};\r\n\r\n/**\r\n * String constants related credential type\r\n */\r\nexport enum KeyVaultCredentialTypes {\r\n SECRET = 'clientSecret',\r\n CERTIFICATE = 'clientCertificate',\r\n}\r\n\r\nexport const OIDC_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\r\n\r\n/**\r\n * Request headers used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationHeaders = {\r\n APP_SERVICE_AUTHENTICATION_HEADER: 'X-MSAL-APP-SERVICE-AUTHENTICATION',\r\n APP_SERVICE_ACCESS_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ACCESS-TOKEN',\r\n APP_SERVICE_ID_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ID-TOKEN',\r\n APP_SERVICE_REFRESH_TOKEN_HEADER: 'X-MS-TOKEN-AAD-REFRESH-TOKEN',\r\n APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER: 'X-MS-TOKEN-AAD-EXPIRES-ON',\r\n APP_SERVICE_USER_OID_HEADER: 'X-MS-CLIENT-PRINCIPAL-ID',\r\n APP_SERVICE_USER_UPN_HEADER: 'X-MS-CLIENT-PRINCIPAL-NAME',\r\n APP_SERVICE_IDP_X_HEADER: 'X-MS-CLIENT-PRINCIPAL-IDP',\r\n};\r\n\r\n/**\r\n * Endpoints used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationEndpoints = {\r\n ID_TOKEN_ENDPOINT: '/.auth/me',\r\n POST_LOGOUT_DEFAULT_ENDPOINT: '/.auth/logout/done',\r\n POST_LOGIN_DEFAULT_ENDPOINT: '/.auth/login/done',\r\n AAD_SIGN_IN_ENDPOINT: '/.auth/login/aad',\r\n AAD_SIGN_OUT_ENDPOINT: '/.auth/logout',\r\n TOKEN_REFRESH_ENDPOINT: '/.auth/refresh',\r\n AAD_REDIRECT_ENDPOINT: '/.auth/login/aad/callback',\r\n};\r\n\r\n/**\r\n * Query parameters used by App Service authentication endpoints\r\n */\r\nexport const AppServiceAuthenticationQueryParameters = {\r\n POST_LOGIN_REDIRECT_QUERY_PARAM: '?post_login_redirect_url=',\r\n POST_LOGOUT_REDIRECT_QUERY_PARAM: '?post_logout_redirect_uri=',\r\n};\r\n\r\n/**\r\n * Environment variables used by App Service authentication\r\n */\r\nexport const AppServiceEnvironmentVariables = {\r\n WEBSITE_AUTH_ENABLED: 'WEBSITE_AUTH_ENABLED',\r\n WEBSITE_AUTH_ALLOWED_AUDIENCES: 'WEBSITE_AUTH_ALLOWED_AUDIENCES',\r\n WEBSITE_AUTH_DEFAULT_PROVIDER: 'WEBSITE_AUTH_DEFAULT_PROVIDER',\r\n WEBSITE_AUTH_TOKEN_STORE: 'WEBSITE_AUTH_TOKEN_STORE',\r\n WEBSITE_AUTH_LOGIN_PARAMS: 'WEBSITE_AUTH_LOGIN_PARAMS',\r\n WEBSITE_AUTH_PRESERVE_URL_FRAGMENT: 'WEBSITE_AUTH_PRESERVE_URL_FRAGMENT',\r\n WEBSITE_AUTH_OPENID_ISSUER: 'WEBSITE_AUTH_OPENID_ISSUER',\r\n WEBSITE_AUTH_CLIENT_ID: 'WEBSITE_AUTH_CLIENT_ID',\r\n WEBSITE_HOSTNAME: 'WEBSITE_HOSTNAME',\r\n WEBSITE_SITE_NAME: 'WEBSITE_SITE_NAME',\r\n WEBSITE_AUTH_REQUIRE_HTTPS: 'WEBSITE_AUTH_REQUIRE_HTTPS',\r\n WEBSITE_AUTH_UNAUTHENTICATED_ACTION: 'WEBSITE_AUTH_UNAUTHENTICATED_ACTION',\r\n WEBSITE_AUTH_API_PREFIX: 'WEBSITE_AUTH_API_PREFIX',\r\n MICROSOFT_PROVIDER_AUTHENTICATION_SECRET: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET',\r\n};\r\n\r\n/**\r\n * Constants used in access control scenarios\r\n */\r\nexport const AccessControlConstants = {\r\n GROUPS: 'groups',\r\n ROLES: 'roles',\r\n CLAIM_NAMES: '_claim_name',\r\n CLAIM_SOURCES: '_claim_sources',\r\n PAGINATION_LINK: '@odata.nextLink',\r\n GRAPH_MEMBERS_ENDPOINT: 'https://graph.microsoft.com/v1.0/me/memberOf',\r\n GRAPH_MEMBER_SCOPES: 'User.Read GroupMember.Read.All',\r\n};\r\n\r\n/**\r\n * Various information constants\r\n */\r\nexport const InfoMessages = {\r\n APP_SERVICE_AUTH_DETECTED: 'App Service Authentication detected',\r\n REQUEST_FOR_RESOURCE: 'Request made to web API',\r\n OVERAGE_OCCURRED: 'User has too many groups. Groups overage claim occurred',\r\n};\r\n\r\n/**\r\n * Various error constants\r\n */\r\nexport const ErrorMessages = {\r\n NOT_PERMITTED: 'Not permitted',\r\n INVALID_TOKEN: 'Invalid token',\r\n CANNOT_DETERMINE_APP_STAGE: 'Cannot determine application stage',\r\n CANNOT_VALIDATE_TOKEN: 'Cannot validate token',\r\n CSRF_TOKEN_MISMATCH: 'CSRF token in response does not match to original request',\r\n INTERACTION_REQUIRED: 'interaction_required',\r\n TOKEN_ACQUISITION_FAILED: 'Token acquisition failed',\r\n TOKEN_RESPONSE_NULL: 'Token response is null',\r\n AUTH_CODE_URL_NOT_OBTAINED: 'Authorization code url cannot be obtained',\r\n TOKEN_NOT_FOUND: 'No token found',\r\n TOKEN_NOT_DECODED: 'Token cannot be decoded',\r\n TOKEN_NOT_VERIFIED: 'Token cannot be verified',\r\n KEYS_NOT_OBTAINED: 'Signing keys cannot be obtained',\r\n STATE_NOT_FOUND: 'State not found',\r\n USER_HAS_NO_ROLE: 'User does not have any roles',\r\n USER_NOT_IN_ROLE: 'User does not have this role',\r\n USER_HAS_NO_GROUP: 'User does not have any groups',\r\n USER_NOT_IN_GROUP: 'User does not have this group',\r\n METHOD_NOT_ALLOWED: 'Method not allowed for this route',\r\n RULE_NOT_FOUND: 'No rule found for this route',\r\n SESSION_NOT_FOUND: 'No session found for this request',\r\n KEY_VAULT_CONFIG_NOT_FOUND: 'No coordinates found for Key Vault',\r\n CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT: 'Cannot obtain credentials from Key Vault',\r\n SESSION_KEY_NOT_FOUND: 'No session key found in session. Cannot encrypt state data',\r\n AUTH_CODE_REQUEST_OBJECT_NOT_FOUND: 'No auth code request object found in session',\r\n ID_TOKEN_CLAIMS_NOT_FOUND: 'No id token claims found in session',\r\n};\r\n\r\n/**\r\n * Various configuration error constants\r\n */\r\nexport const ConfigurationErrorMessages = {\r\n AUTH_ROUTES_NOT_CONFIGURED:\r\n 'Authentication routes are not defined. Ensure that the application settings are configured properly.',\r\n NO_PROTECTED_RESOURCE_CONFIGURED:\r\n 'No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.',\r\n NO_ACCESS_MATRIX_CONFIGURED:\r\n 'No access matrix is configured to control access for. Ensure that the application settings are configured properly.',\r\n NO_CLIENT_ID: 'No clientId provided!',\r\n INVALID_CLIENT_ID: 'Invalid clientId!',\r\n NO_TENANT_INFO: 'No tenant info provided!',\r\n INVALID_TENANT_INFO: 'Invalid tenant info!',\r\n NO_CLIENT_CREDENTIAL: 'No client credential provided!',\r\n NO_REDIRECT_URI: 'No redirect URI provided!',\r\n NO_UNAUTHORIZED_ROUTE: 'No unauthorized route provided!',\r\n};\r\n\r\n/**\r\n * For more information, visit: https://login.microsoftonline.com/error\r\n */\r\nexport const ErrorCodes = {\r\n 65001: 'AADSTS65001', // consent required\r\n 50076: 'AADSTS50076', // mfa required\r\n 50079: 'AADSTS50079', // mfa enrollment required\r\n 50001: 'AADSTS50001', // invalid resource uri\r\n 65004: 'AADSTS65004', // user declined consent\r\n 70011: 'AADSTS70011', // invalid scope\r\n 700022: 'AADSTS700022', // multiple resources\r\n 700020: 'AADSTS700020', // interaction required\r\n 90118: 'AADB2C90118', // password forgotten (B2C)\r\n};\r\n\r\nexport const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\r\n loggerCallback: (logLevel, message, containsPii) => {\r\n if (containsPii) {\r\n return;\r\n }\r\n console.info(message);\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n};\r\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions } from '@azure/msal-common';\r\n\r\nexport type AppSettings = {\r\n appCredentials: AppCredentials;\r\n loggerOptions?: LoggerOptions;\r\n b2cPolicies?: Record;\r\n accessMatrix?: Record;\r\n};\r\n\r\nexport type WebAppSettings = AppSettings & {\r\n authRoutes: AuthRoutes;\r\n protectedResources?: Record\r\n};\r\n\r\nexport type AppCredentials = {\r\n instance?: string;\r\n clientId: string;\r\n tenantId: string;\r\n clientSecret?: string;\r\n clientCertificate?: ClientCertificate;\r\n};\r\n\r\nexport type ClientCertificate = {\r\n thumbprint: string;\r\n privateKey: string;\r\n x5c?: string;\r\n};\r\n\r\nexport type KeyVaultCredential = {\r\n credentialType: string;\r\n credentialName: string;\r\n keyVaultUrl: string;\r\n};\r\n\r\nexport type AuthRoutes = {\r\n redirect: string;\r\n unauthorized: string;\r\n frontChannelLogout?: string;\r\n};\r\n\r\nexport type Policy = {\r\n authority: string;\r\n};\r\n\r\nexport type Resource = {\r\n endpoint: string;\r\n scopes: string[];\r\n accessToken?: string;\r\n};\r\n\r\nexport type AccessRule = {\r\n path: string;\r\n methods: string[];\r\n roles?: string[];\r\n groups?: string[];\r\n};\r\n\r\nexport enum AppType {\r\n WebApp\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AADAuthorityConstants, ConfigurationErrorMessages, OIDC_SCOPES } from '../utils/Constants';\r\nimport { AppSettings, AppType, Resource, WebAppSettings } from './AppSettings';\r\n\r\nexport class ConfigHelper {\r\n /**\r\n * Validates the fields in the configuration file\r\n * @param {AppSettings} appSettings: configuration object\r\n * @returns {void}\r\n */\r\n static validateAppSettings(appSettings: AppSettings, appType: AppType): void {\r\n if (StringUtils.isEmpty(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_CLIENT_ID);\r\n } else if (!ConfigHelper.isGuid(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_CLIENT_ID);\r\n }\r\n\r\n if (StringUtils.isEmpty(appSettings.appCredentials.tenantId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_TENANT_INFO);\r\n } else if (\r\n !ConfigHelper.isGuid(appSettings.appCredentials.tenantId) &&\r\n !Object.values(AADAuthorityConstants).includes(appSettings.appCredentials.tenantId)\r\n ) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_TENANT_INFO);\r\n }\r\n\r\n switch (appType) {\r\n case AppType.WebApp:\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.redirect)) {\r\n throw new Error(ConfigurationErrorMessages.NO_REDIRECT_URI);\r\n }\r\n\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.unauthorized)) {\r\n throw new Error(ConfigurationErrorMessages.NO_UNAUTHORIZED_ROUTE);\r\n }\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Verifies if a string is GUID\r\n * @param {string} guid\r\n * @returns {boolean}\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Util method to get the resource name for a given scope(s)\r\n * @param {Array} scopes: an array of scopes that the resource is associated with\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string {\r\n const index = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).findIndex((resource: Resource) =>\r\n JSON.stringify(resource.scopes.sort()) === JSON.stringify(scopes.sort())\r\n );\r\n\r\n const resourceName = Object.keys({\r\n ...webAppSettings.protectedResources,\r\n })[index];\r\n\r\n return resourceName;\r\n }\r\n\r\n /**\r\n * Util method to get the scopes for a given resource name\r\n * @param {string} resourceEndpoint: the resource name\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[] {\r\n const scopes = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).find((resource: Resource) => resource.endpoint === resourceEndpoint)?.scopes;\r\n\r\n return scopes ? scopes : [];\r\n }\r\n\r\n /**\r\n * Util method to strip the default OIDC scopes from the scopes array\r\n * @param {Array} scopesList full list of scopes for this resource\r\n * @returns\r\n */\r\n static getEffectiveScopes(scopesList: string[]): string[] {\r\n const effectiveScopesList = scopesList.filter(scope => !OIDC_SCOPES.includes(scope));\r\n return effectiveScopesList;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICachePlugin } from '@azure/msal-node';\r\n\r\nimport { ConfigHelper } from '../config/ConfigHelper';\r\nimport { AppSettings, AppType, KeyVaultCredential } from '../config/AppSettings';\r\n\r\nexport abstract class BaseAuthClientBuilder {\r\n appSettings: AppSettings;\r\n protected keyVaultCredential: KeyVaultCredential | undefined;\r\n protected customCachePlugin: ICachePlugin | undefined;\r\n\r\n protected constructor(appSettings: AppSettings, appType: AppType) {\r\n ConfigHelper.validateAppSettings(appSettings, appType);\r\n this.appSettings = appSettings;\r\n }\r\n\r\n withKeyVaultCredentials(keyVaultCredential: KeyVaultCredential): BaseAuthClientBuilder {\r\n this.keyVaultCredential = keyVaultCredential;\r\n return this;\r\n }\r\n\r\n withCustomCachePlugin(cachePlugin: ICachePlugin): BaseAuthClientBuilder {\r\n this.customCachePlugin = cachePlugin;\r\n return this;\r\n }\r\n\r\n abstract build(): any;\r\n\r\n abstract buildAsync(): Promise;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport * as crypto from 'crypto';\r\n\r\nexport class CryptoUtils {\r\n private algorithm: string;\r\n\r\n constructor(algorithm: string = 'aes-192-cbc') {\r\n this.algorithm = algorithm;\r\n }\r\n\r\n generateSalt(): string {\r\n return crypto.randomBytes(20).toString('hex');\r\n }\r\n\r\n createKey(password: string, salt: string): Buffer {\r\n return crypto.scryptSync(password, salt, 24);\r\n }\r\n\r\n encryptData(stringifiedData: string, key: Buffer): string {\r\n const iv = crypto.randomBytes(16);\r\n const cipher = crypto.createCipheriv(this.algorithm, key, iv);\r\n const encryptedData = cipher.update(stringifiedData, 'utf8', 'hex');\r\n\r\n return [iv.toString('hex'), encryptedData + cipher.final('hex')].join('.');\r\n }\r\n\r\n decryptData(encryptedData: string, key: Buffer): string {\r\n const [iv, encrypted] = encryptedData.split('.');\r\n const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(iv, 'hex'));\r\n return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from '@azure/msal-common';\r\nimport { ConfidentialClientApplication, Configuration, CryptoProvider } from '@azure/msal-node';\r\n\r\nimport { AppSettings } from '../config/AppSettings';\r\nimport { CryptoUtils } from '../utils/CryptoUtils';\r\nimport { packageName, packageVersion } from '../packageMetadata';\r\n\r\nexport abstract class BaseAuthClient {\r\n appSettings: AppSettings;\r\n\r\n protected msalConfig: Configuration;\r\n protected msalClient: ConfidentialClientApplication;\r\n protected cryptoProvider: CryptoProvider;\r\n protected cryptoUtils: CryptoUtils;\r\n protected logger: Logger;\r\n\r\n protected constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n this.appSettings = appSettings;\r\n this.msalConfig = msalConfig;\r\n this.cryptoProvider = new CryptoProvider();\r\n this.cryptoUtils = new CryptoUtils();\r\n\r\n this.logger = new Logger(this.msalConfig.system?.loggerOptions!, packageName, packageVersion);\r\n\r\n this.msalClient = new ConfidentialClientApplication(this.msalConfig);\r\n }\r\n\r\n getMsalClient(): ConfidentialClientApplication {\r\n return this.msalClient;\r\n }\r\n\r\n getMsalConfig(): Configuration {\r\n return this.msalConfig;\r\n }\r\n\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const packageName = '@azure-samples/microsoft-identity-express';\r\nexport const packageVersion = 'beta';\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport axios, { AxiosResponse, AxiosRequestConfig } from 'axios';\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AccessControlConstants, ErrorMessages } from '../utils/Constants';\r\n\r\nexport class FetchManager {\r\n /**\r\n * Calls a resource endpoint\r\n * @param {string} endpoint\r\n * @returns {Promise}\r\n */\r\n static callApiEndpoint = async (endpoint: string): Promise => {\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Calls a resource endpoint with a raw access token\r\n * using the authorization bearer token scheme\r\n * @param {string} endpoint\r\n * @param {string} accessToken\r\n * @returns {Promise}\r\n */\r\n static callApiEndpointWithToken = async (endpoint: string, accessToken: string): Promise> => {\r\n if (StringUtils.isEmpty(accessToken)) {\r\n throw new Error(ErrorMessages.TOKEN_NOT_FOUND);\r\n }\r\n\r\n const options: AxiosRequestConfig = {\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint, options);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Handles queries against Microsoft Graph that return multiple pages of data\r\n * @param {string} accessToken: access token required by endpoint\r\n * @param {string} nextPage: next page link\r\n * @param {Array} data: stores data from each page\r\n * @returns {Promise}\r\n */\r\n static handlePagination = async (accessToken: string, nextPage: string, data: string[] = []): Promise => {\r\n try {\r\n const graphResponse = await (await FetchManager.callApiEndpointWithToken(nextPage, accessToken)).data;\r\n graphResponse['value'].map((v: any) => data.push(v.id));\r\n\r\n if (graphResponse[AccessControlConstants.PAGINATION_LINK]) {\r\n return await FetchManager.handlePagination(\r\n accessToken,\r\n graphResponse[AccessControlConstants.PAGINATION_LINK],\r\n data\r\n );\r\n } else {\r\n return data;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Request } from 'express';\r\nimport { IUri, UrlString } from '@azure/msal-common';\r\n\r\nexport class UrlUtils {\r\n /**\r\n * Gets the absolute URL from a given request and path string\r\n * @param {Request} req: express request object\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static ensureAbsoluteUrl = (req: Request, url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n\r\n if (!urlComponents.Protocol) {\r\n if (!urlComponents.HostNameAndPort && !url.startsWith('www')) {\r\n if (!url.startsWith('/')) {\r\n return req.protocol + '://' + req.get('host') + '/' + url;\r\n }\r\n return req.protocol + '://' + req.get('host') + url;\r\n }\r\n return req.protocol + '://' + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n /**\r\n * Gets the path segment from a given URL\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static getPathFromUrl = (url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n return `/${urlComponents.PathSegments.join('/')}`;\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { RequestHandler, Request, Response, NextFunction, Router } from 'express';\r\nimport { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, StringUtils, ResponseMode } from '@azure/msal-common';\r\nimport { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node';\r\nimport { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings';\r\nimport { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions';\r\nimport { AppStages, ErrorMessages, AccessControlConstants, ConfigurationErrorMessages } from '../../utils/Constants';\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { FetchManager } from '../../network/FetchManager';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { AppState } from '../../utils/Types';\r\n\r\n/**\r\n * A simple wrapper around MSAL Node ConfidentialClientApplication object.\r\n * It offers a collection of middleware and utility methods that automate\r\n * basic authentication and authorization tasks in Express web apps\r\n */\r\nexport class MsalWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction) => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n next();\r\n });\r\n\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n if (this.webAppSettings.authRoutes.frontChannelLogout) {\r\n /**\r\n * Expose front-channel logout route. For more information, visit:\r\n * https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#single-sign-out\r\n */\r\n appRouter.get(this.webAppSettings.authRoutes.frontChannelLogout, (req: Request, res: Response) => {\r\n req.session.destroy(() => {\r\n res.sendStatus(200);\r\n });\r\n });\r\n }\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): Promise => {\r\n const appState = {\r\n appStage: AppStages.SIGN_IN,\r\n redirectTo: options.postLoginRedirect,\r\n csrfToken: req.session.csrfToken,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationCodeRequest;\r\n\r\n // get url to sign user in\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return async (req: Request, res: Response): Promise => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n\r\n /**\r\n * Construct a logout URI and redirect the user to end the\r\n * session with Azure AD/B2C. For more information, visit:\r\n * (AAD) https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#send-a-sign-out-request\r\n * (B2C) https://docs.microsoft.com/azure/active-directory-b2c/openid-connect#send-a-sign-out-request\r\n */\r\n const logoutUri = `${this.msalConfig.auth.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${postLogoutRedirectUri}`;\r\n\r\n const tokenCache = this.msalClient.getTokenCache();\r\n\r\n const account = req.session.account?.homeAccountId\r\n ?\r\n await tokenCache.getAccountByHomeId(req.session.account.homeAccountId)\r\n :\r\n await tokenCache.getAccountByLocalId(req.session.account?.localAccountId!);\r\n\r\n if (account) {\r\n await tokenCache.removeAccount(account);\r\n }\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!req.session.key) {\r\n this.logger.error(ErrorMessages.SESSION_KEY_NOT_FOUND);\r\n return next(new Error(ErrorMessages.SESSION_KEY_NOT_FOUND));\r\n }\r\n\r\n if (!req.session.authorizationCodeRequest) {\r\n this.logger.error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND);\r\n return next(new Error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND));\r\n }\r\n\r\n if (req.body.state) {\r\n const state: AppState = JSON.parse(\r\n this.cryptoUtils.decryptData(\r\n this.cryptoProvider.base64Decode(req.body.state as string),\r\n Buffer.from(req.session.key, 'hex')\r\n )\r\n );\r\n\r\n // check if csrfToken matches\r\n if (state.csrfToken === req.session.csrfToken) {\r\n switch (state.appStage) {\r\n case AppStages.SIGN_IN: {\r\n // token request should have auth code\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n // exchange auth code for tokens\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.isAuthenticated = true;\r\n req.session.account = tokenResponse.account!; // this won't be null in any web app scenario\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n case AppStages.ACQUIRE_TOKEN: {\r\n // get the name of the resource associated with scope\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(\r\n req.session.authorizationCodeRequest.scopes,\r\n this.webAppSettings\r\n );\r\n\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n accessToken: tokenResponse.accessToken,\r\n } as Resource,\r\n };\r\n\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n next(new Error(ErrorMessages.CANNOT_DETERMINE_APP_STAGE));\r\n break;\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens via acquireToken*\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const scopes = options.resource.scopes;\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n try {\r\n const silentRequest = {\r\n account: req.session.account,\r\n scopes: scopes,\r\n } as SilentFlowRequest;\r\n\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse || StringUtils.isEmpty(tokenResponse.accessToken)) {\r\n // In B2C scenarios, sometimes an access token is returned empty.\r\n // In that case, we will acquire token interactively instead.\r\n\r\n throw new InteractionRequiredAuthError(ErrorMessages.INTERACTION_REQUIRED);\r\n }\r\n\r\n req.session.protectedResources[resourceName].accessToken = tokenResponse.accessToken;\r\n next();\r\n } catch (error) {\r\n // in case there are no cached tokens, initiate an interactive call\r\n if (error instanceof InteractionRequiredAuthError) {\r\n const appState = {\r\n appStage: AppStages.ACQUIRE_TOKEN,\r\n redirectTo: req.originalUrl,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: scopes,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: scopes,\r\n } as AuthorizationCodeRequest;\r\n\r\n // initiate the first leg of auth code grant to get token\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n } else {\r\n next(error);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Checks if the user has access for this route, defined in access matrix\r\n * @param {GuardOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n hasAccess(options: GuardOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.accessMatrix) {\r\n this.logger.error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED));\r\n }\r\n\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const checkFor = options.accessRule.hasOwnProperty(AccessControlConstants.GROUPS)\r\n ? AccessControlConstants.GROUPS\r\n : AccessControlConstants.ROLES;\r\n\r\n switch (checkFor) {\r\n case AccessControlConstants.GROUPS:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.GROUPS]) {\r\n if (\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_NAMES] ||\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_SOURCES]\r\n ) {\r\n return await this.handleOverage(req, res, next, options.accessRule);\r\n } else {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n const groups = req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, groups, AccessControlConstants.GROUPS)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.ROLES]) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n const roles = req.session.account.idTokenClaims[AccessControlConstants.ROLES] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, roles, AccessControlConstants.ROLES)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n };\r\n }\r\n\r\n // ============== UTILS ===============\r\n\r\n /**\r\n * This method is used to generate an auth code url request\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AuthCodeParams} params: modifies auth code url request\r\n * @returns {Promise}\r\n */\r\n private async redirectToAuthCodeUrl(\r\n req: Request,\r\n res: Response,\r\n next: NextFunction,\r\n authUrlParams: AuthorizationUrlRequest,\r\n authCodeParams: AuthorizationCodeRequest,\r\n appState: AppState\r\n ): Promise {\r\n // add session csrfToken for crsf\r\n req.session.csrfToken = this.cryptoProvider.createNewGuid();\r\n\r\n const key = this.cryptoUtils.createKey(req.session.csrfToken, this.cryptoUtils.generateSalt());\r\n req.session.key = key.toString('hex');\r\n\r\n const state = JSON.stringify({\r\n ...appState,\r\n csrfToken: req.session.csrfToken,\r\n });\r\n\r\n // prepare the request\r\n req.session.authorizationUrlRequest = {\r\n ...authUrlParams,\r\n state: this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(state, key)),\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n responseMode: ResponseMode.FORM_POST\r\n };\r\n\r\n req.session.authorizationCodeRequest = {\r\n ...authCodeParams,\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n code: ''\r\n };\r\n\r\n // request an authorization code to exchange for tokens\r\n try {\r\n const response = await this.msalClient.getAuthCodeUrl(req.session.authorizationUrlRequest);\r\n res.redirect(response);\r\n } catch (error) {\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles group overage claims by querying MS Graph /memberOf endpoint\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AccessRule} rule: a given access rule\r\n * @returns {Promise}\r\n */\r\n private async handleOverage(req: Request, res: Response, next: NextFunction, rule: AccessRule): Promise {\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const { _claim_names, _claim_sources, ...newIdTokenClaims } = req.session.account.idTokenClaims;\r\n\r\n const silentRequest: SilentFlowRequest = {\r\n account: req.session.account,\r\n scopes: AccessControlConstants.GRAPH_MEMBER_SCOPES.split(' '),\r\n };\r\n\r\n try {\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n try {\r\n const graphResponse = await FetchManager.callApiEndpointWithToken(\r\n AccessControlConstants.GRAPH_MEMBERS_ENDPOINT,\r\n tokenResponse.accessToken\r\n );\r\n\r\n /**\r\n * Some queries against Microsoft Graph return multiple pages of data either due to server-side paging\r\n * or due to the use of the $top query parameter to specifically limit the page size in a request.\r\n * When a result set spans multiple pages, Microsoft Graph returns an @odata.nextLink property in\r\n * the response that contains a URL to the next page of results. Learn more at https://docs.microsoft.com/graph/paging\r\n */\r\n if (graphResponse.data[AccessControlConstants.PAGINATION_LINK]) {\r\n try {\r\n const userGroups = await FetchManager.handlePagination(\r\n tokenResponse.accessToken,\r\n graphResponse.data[AccessControlConstants.PAGINATION_LINK]\r\n );\r\n\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: userGroups,\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } else {\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: graphResponse.data['value'].map((v: any) => v.id),\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } catch (error) {\r\n // TODO: handle silent token acquisition error\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the request passes a given access rule\r\n * @param {string} method: HTTP method for this route\r\n * @param {AccessRule} rule: access rule for this route\r\n * @param {Array} creds: user's credentials i.e. roles or groups\r\n * @param {string} credType: roles or groups\r\n * @returns {boolean}\r\n */\r\n private checkAccessRule(method: string, rule: AccessRule, creds: string[], credType: string): boolean {\r\n if (rule.methods.includes(method)) {\r\n switch (credType) {\r\n case AccessControlConstants.GROUPS:\r\n if (!rule.groups || rule.groups.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!rule.roles || rule.roles!.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { Router, RequestHandler, Request, Response, NextFunction } from 'express';\r\nimport { AccountInfo, AuthToken } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { AccessTokenClaims, IdTokenClaims } from '../../utils/Types';\r\nimport { AppSettings, Resource, WebAppSettings } from '../../config/AppSettings';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { SignInOptions, SignOutOptions, TokenRequestOptions } from '../MiddlewareOptions';\r\nimport {\r\n AppServiceAuthenticationHeaders,\r\n AppServiceEnvironmentVariables,\r\n AppServiceAuthenticationEndpoints,\r\n AppServiceAuthenticationQueryParameters,\r\n ErrorMessages,\r\n ConfigurationErrorMessages,\r\n} from '../../utils/Constants';\r\n\r\nexport class AppServiceWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @param {InitializationOptions} options\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n // handle redirect\r\n appRouter.get(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n if (!req.session.isAuthenticated) {\r\n // check headers for id token\r\n const rawIdToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawIdToken) {\r\n // parse the id token\r\n const idTokenClaims: IdTokenClaims = AuthToken.extractTokenClaims(rawIdToken, this.cryptoProvider);\r\n\r\n req.session.isAuthenticated = true;\r\n\r\n req.session.account = {\r\n tenantId: idTokenClaims.tid,\r\n homeAccountId: idTokenClaims.oid + '.' + idTokenClaims.tid,\r\n localAccountId: idTokenClaims.oid,\r\n environment: idTokenClaims.iss?.split('://')[1].split('/')[0],\r\n username: idTokenClaims.preferred_username,\r\n name: idTokenClaims.name,\r\n idTokenClaims: idTokenClaims,\r\n } as AccountInfo;\r\n }\r\n }\r\n\r\n next();\r\n });\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n let loginUri;\r\n const postLoginRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLoginRedirect);\r\n loginUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_IN_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGIN_REDIRECT_QUERY_PARAM +\r\n postLoginRedirectUri;\r\n res.redirect(loginUri);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n const logoutUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_OUT_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGOUT_REDIRECT_QUERY_PARAM +\r\n postLogoutRedirectUri;\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(options.resource.scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n const rawAccessToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawAccessToken) {\r\n const accessTokenClaims = AuthToken.extractTokenClaims(\r\n rawAccessToken,\r\n this.cryptoProvider\r\n ) as AccessTokenClaims;\r\n\r\n // get the name of the resource associated with scope\r\n const scopes = accessTokenClaims?.scp.split(' ');\r\n const effectiveScopes = ConfigHelper.getEffectiveScopes(scopes);\r\n\r\n if (options.resource.scopes.every(elem => effectiveScopes.includes(elem))) {\r\n req.session.protectedResources[resourceName].accessToken = rawAccessToken;\r\n return next();\r\n } else {\r\n return next(new Error('No tokens found for given scopes'));\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DefaultAzureCredential } from '@azure/identity';\r\nimport { CertificateClient, KeyVaultCertificate } from '@azure/keyvault-certificates';\r\nimport { KeyVaultSecret, SecretClient } from '@azure/keyvault-secrets';\r\n\r\nimport { KeyVaultCredential, ClientCertificate } from '../config/AppSettings';\r\nimport { KeyVaultCredentialTypes } from '../utils/Constants';\r\n\r\nexport type KeyVaultCredentialResponse = {\r\n type: KeyVaultCredentialTypes.SECRET | KeyVaultCredentialTypes.CERTIFICATE;\r\n value: string & ClientCertificate;\r\n};\r\n\r\nexport class KeyVaultManager {\r\n /**\r\n * Fetches credentials from Key Vault and updates appSettings\r\n * @param {AppSettings} appSettings\r\n * @returns {Promise}\r\n */\r\n async getCredentialFromKeyVault(keyVaultCredential: KeyVaultCredential): Promise {\r\n const credential = new DefaultAzureCredential();\r\n let response: KeyVaultCredentialResponse = {} as KeyVaultCredentialResponse;\r\n\r\n switch (keyVaultCredential.credentialType) {\r\n case KeyVaultCredentialTypes.SECRET: {\r\n try {\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.SECRET,\r\n value: secretResponse.value,\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n case KeyVaultCredentialTypes.CERTIFICATE: {\r\n try {\r\n const certificateResponse = await this.getCertificateCredential(keyVaultCredential, credential);\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.CERTIFICATE,\r\n value: {\r\n thumbprint: certificateResponse?.properties?.x509Thumbprint?.toString(),\r\n privateKey: secretResponse?.value?.split('-----BEGIN CERTIFICATE-----\\n')[0],\r\n },\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Gets a certificate credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getCertificateCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new CertificateClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultCertificate = await secretClient.getCertificate(keyVaultCredential.credentialName);\r\n return keyVaultCertificate;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a secret credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getSecretCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new SecretClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultSecret = await secretClient.getSecret(keyVaultCredential.credentialName);\r\n return keyVaultSecret;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { UrlString, Constants } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { DEFAULT_LOGGER_OPTIONS } from '../utils/Constants';\r\nimport { AppSettings } from './AppSettings';\r\n\r\nexport class MsalConfiguration {\r\n /**\r\n * Maps the custom configuration object to configuration\r\n * object expected by MSAL Node ConfidentialClientApplication class\r\n * @param {AppSettings} appSettings: configuration object\r\n * @param {ICachePlugin} cachePlugin: custom cache plugin\r\n * @param {IDistributedPersistence} distributedPersistence: distributed persistence client\r\n * @returns {Configuration}\r\n */\r\n static getMsalConfiguration(appSettings: AppSettings): Configuration {\r\n return {\r\n auth: {\r\n clientId: appSettings.appCredentials.clientId,\r\n authority: appSettings.b2cPolicies\r\n ? Object.entries(appSettings.b2cPolicies)[0][1]['authority'] // the first policy/user-flow is the default authority\r\n : appSettings.appCredentials.instance\r\n ? `https://${appSettings.appCredentials.instance}/${appSettings.appCredentials.tenantId}`\r\n : `https://${Constants.DEFAULT_AUTHORITY_HOST}/${appSettings.appCredentials.tenantId}`,\r\n ...(appSettings.appCredentials.hasOwnProperty('clientSecret') && {\r\n clientSecret: appSettings.appCredentials.clientSecret,\r\n }),\r\n ...(appSettings.appCredentials.hasOwnProperty('clientCertificate') && {\r\n clientCertificate: appSettings.appCredentials.clientCertificate,\r\n }),\r\n knownAuthorities: appSettings.b2cPolicies\r\n ? [UrlString.getDomainFromUrl(Object.entries(appSettings.b2cPolicies)[0][1]['authority'])] // in B2C scenarios\r\n : [],\r\n },\r\n system: {\r\n loggerOptions: appSettings.loggerOptions ? appSettings.loggerOptions : DEFAULT_LOGGER_OPTIONS,\r\n },\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AppServiceEnvironmentVariables } from './Constants';\r\n\r\nexport class EnvironmentUtils {\r\n static isProduction(): boolean {\r\n return process.env.NODE_ENV === 'production';\r\n }\r\n\r\n static isDevelopment(): boolean {\r\n return process.env.NODE_ENV === 'development';\r\n }\r\n\r\n static isAppServiceAuthEnabled(): boolean {\r\n return process.env[AppServiceEnvironmentVariables.WEBSITE_AUTH_ENABLED] === 'True';\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClientBuilder } from '../BaseAuthClientBuilder';\r\nimport { MsalWebAppAuthClient } from './MsalWebAppAuthClient';\r\nimport { AppServiceWebAppAuthClient } from './AppServiceWebAppAuthClient';\r\nimport { KeyVaultManager } from '../../network/KeyVaultManager';\r\nimport { MsalConfiguration } from '../../config/MsalConfiguration';\r\nimport { AppSettings, AppType } from '../../config/AppSettings';\r\nimport { EnvironmentUtils } from '../../utils/EnvironmentUtils';\r\nimport { ErrorMessages } from '../../utils/Constants';\r\n\r\nexport class WebAppAuthClientBuilder extends BaseAuthClientBuilder {\r\n appSettings!: AppSettings;\r\n private msalConfig!: Configuration;\r\n\r\n constructor(appSettings: AppSettings) {\r\n super(appSettings, AppType.WebApp);\r\n }\r\n\r\n build(): MsalWebAppAuthClient | AppServiceWebAppAuthClient {\r\n // TODO: throw error if key vault credential is being built\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n }\r\n\r\n async buildAsync(): Promise {\r\n try {\r\n if (this.keyVaultCredential) {\r\n const keyVaultManager = new KeyVaultManager();\r\n const credential = await keyVaultManager.getCredentialFromKeyVault(this.keyVaultCredential);\r\n this.appSettings.appCredentials[credential.type] = credential.value;\r\n }\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n } catch (error) {\r\n throw new Error(ErrorMessages.CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT);\r\n }\r\n }\r\n}\r\n"],"names":["AppStages","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","KeyVaultCredentialTypes","AADAuthorityConstants","COMMON","ORGANIZATIONS","CONSUMERS","AppType","OIDC_SCOPES","AppServiceAuthenticationHeaders","APP_SERVICE_AUTHENTICATION_HEADER","APP_SERVICE_ACCESS_TOKEN_HEADER","APP_SERVICE_ID_TOKEN_HEADER","APP_SERVICE_REFRESH_TOKEN_HEADER","APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER","APP_SERVICE_USER_OID_HEADER","APP_SERVICE_USER_UPN_HEADER","APP_SERVICE_IDP_X_HEADER","AccessControlConstants","GROUPS","ROLES","CLAIM_NAMES","CLAIM_SOURCES","PAGINATION_LINK","GRAPH_MEMBERS_ENDPOINT","GRAPH_MEMBER_SCOPES","ConfigurationErrorMessages","DEFAULT_LOGGER_OPTIONS","loggerCallback","logLevel","message","containsPii","console","piiLoggingEnabled","LogLevel","Info","ConfigHelper","validateAppSettings","appSettings","appType","StringUtils","isEmpty","appCredentials","clientId","isGuid","tenantId","includes","WebApp","authRoutes","_appSettings$authRout","redirect","_appSettings$authRout2","unauthorized","guid","test","getResourceNameFromScopes","scopes","webAppSettings","index","protectedResources","findIndex","resource","JSON","stringify","sort","getScopesFromResourceEndpoint","resourceEndpoint","find","endpoint","_Object$values$find","getEffectiveScopes","scopesList","filter","scope","BaseAuthClientBuilder","withKeyVaultCredentials","keyVaultCredential","withCustomCachePlugin","cachePlugin","customCachePlugin","CryptoUtils","algorithm","generateSalt","crypto","toString","createKey","password","salt","encryptData","stringifiedData","iv","cipher","encryptedData","update","join","decryptData","split","encrypted","decipher","Buffer","from","BaseAuthClient","msalConfig","cryptoProvider","CryptoProvider","cryptoUtils","logger","Logger","system","_this$msalConfig$syst","loggerOptions","msalClient","ConfidentialClientApplication","getMsalClient","getMsalConfig","getLogger","FetchManager","axios","get","data","accessToken","options","headers","Authorization","nextPage","callApiEndpointWithToken","graphResponse","map","v","id","handlePagination","UrlUtils","req","url","urlComponents","UrlString","getUrlComponents","Protocol","HostNameAndPort","startsWith","protocol","PathSegments","MsalWebAppAuthClient","initialize","appRouter","express","Router","use","res","session","_this2","post","getPathFromUrl","handleRedirect","frontChannelLogout","destroy","sendStatus","signIn","postLoginRedirect","failureRedirect","_this3","redirectToAuthCodeUrl","OIDC_DEFAULT_SCOPES","appStage","SIGN_IN","redirectTo","csrfToken","signOut","postLogoutRedirect","postLogoutRedirectUri","ensureAbsoluteUrl","logoutUri","_this4","auth","authority","tokenCache","getTokenCache","account","_req$session$account","homeAccountId","getAccountByHomeId","getAccountByLocalId","_req$session$account2","localAccountId","removeAccount","_this5","authorizationCodeRequest","body","parse","base64Decode","ACQUIRE_TOKEN","code","acquireTokenByCode","tokenResponse","isAuthenticated","resourceName","getToken","_this6","silentRequest","acquireTokenSilent","InteractionRequiredAuthError","_context3","originalUrl","_this7","hasAccess","_this8","accessMatrix","_req$session$account3","idTokenClaims","checkFor","accessRule","handleOverage","checkAccessRule","authUrlParams","authCodeParams","appState","createNewGuid","authorizationUrlRequest","base64Encode","redirectUri","responseMode","ResponseMode","FORM_POST","getAuthCodeUrl","rule","_req$session$account4","_claim_names","newIdTokenClaims","groups","creds","credType","methods","elem","roles","AppServiceWebAppAuthClient","rawIdToken","toLowerCase","AuthToken","extractTokenClaims","tid","oid","environment","iss","_idTokenClaims$iss","username","preferred_username","loginUri","postLoginRedirectUri","process","env","rawAccessToken","accessTokenClaims","scp","effectiveScopes","every","KeyVaultManager","getCredentialFromKeyVault","credential","DefaultAzureCredential","response","credentialType","SECRET","CERTIFICATE","getSecretCredential","getCertificateCredential","certificateResponse","secretResponse","thumbprint","properties","_certificateResponse$","x509Thumbprint","_certificateResponse$2","privateKey","_secretResponse$value","secretClient","CertificateClient","keyVaultUrl","getCertificate","credentialName","SecretClient","getSecret","MsalConfiguration","getMsalConfiguration","b2cPolicies","entries","instance","Constants","DEFAULT_AUTHORITY_HOST","clientSecret","clientCertificate","knownAuthorities","getDomainFromUrl","EnvironmentUtils","isProduction","isDevelopment","isAppServiceAuthEnabled","WebAppAuthClientBuilder","_BaseAuthClientBuilde","build","buildAsync","keyVaultManager"],"mappings":"kqCAWYA,mBCJZ,IAAIC,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKC,GAOxB,OANAf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,GAEb,IAEEF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,GAC1B,OAA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,IAAIwC,EAAqBhO,KAAKwH,YAAaxH,KAAKwL,eAIzDqM,sCAAN,iGAEY7X,KAAK8J,0CACCgO,EAAkB,IAAI7C,WACH6C,EAAgB5C,0BAA0BlV,KAAK8J,gCACnEtC,YAAYI,gBADXuN,UACqC1V,MAAQ0V,EAAW3X,qBAG7DgO,WAAamL,EAAkBC,qBAAqB5W,KAAKwH,cAE1D8P,EAAiBG,oEACV,IAAI7D,EAA2B5T,KAAKwH,YAAaxH,KAAKwL,8CAEtD,IAAIwC,EAAqBhO,KAAKwH,YAAaxH,KAAKwL,6EAGrD,IAAI5M,MfuFwB,8Je3HDgL,oORVf"} \ No newline at end of file diff --git a/dist/microsoft-identity-express.esm.js b/dist/microsoft-identity-express.esm.js index 91b0dcc..3d3dea8 100644 --- a/dist/microsoft-identity-express.esm.js +++ b/dist/microsoft-identity-express.esm.js @@ -1,4 +1,4 @@ -import { LogLevel, StringUtils, Logger, UrlString, OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, ClientAuthError, ResponseMode, AuthToken, Constants } from '@azure/msal-common'; +import { LogLevel, StringUtils, Logger, UrlString, OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, ResponseMode, AuthToken, Constants } from '@azure/msal-common'; import express from 'express'; import { CryptoProvider, ConfidentialClientApplication } from '@azure/msal-node'; import { randomBytes, scryptSync, createCipheriv, createDecipheriv } from 'crypto'; @@ -1827,7 +1827,7 @@ var MsalWebAppAuthClient = /*#__PURE__*/function (_BaseAuthClient) { _context3.prev = 17; _context3.t0 = _context3["catch"](6); - if (!(_context3.t0 instanceof InteractionRequiredAuthError || _context3.t0 instanceof ClientAuthError)) { + if (!(_context3.t0 instanceof InteractionRequiredAuthError)) { _context3.next = 26; break; } diff --git a/dist/microsoft-identity-express.esm.js.map b/dist/microsoft-identity-express.esm.js.map index 2692417..c09ec45 100644 --- a/dist/microsoft-identity-express.esm.js.map +++ b/dist/microsoft-identity-express.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"microsoft-identity-express.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/utils/Constants.ts","../src/config/AppSettings.ts","../src/config/ConfigHelper.ts","../src/client/BaseAuthClientBuilder.ts","../src/utils/CryptoUtils.ts","../src/packageMetadata.ts","../src/client/BaseAuthClient.ts","../src/network/FetchManager.ts","../src/utils/UrlUtils.ts","../src/client/webapp/MsalWebAppAuthClient.ts","../src/client/webapp/AppServiceWebAppAuthClient.ts","../src/network/KeyVaultManager.ts","../src/config/MsalConfiguration.ts","../src/utils/EnvironmentUtils.ts","../src/client/webapp/WebAppAuthClientBuilder.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions, LogLevel } from '@azure/msal-common';\r\n\r\n/**\r\n * Basic authentication stages used to determine\r\n * appropriate action after redirect occurs\r\n */\r\nexport enum AppStages {\r\n SIGN_IN = 'sign_in',\r\n SIGN_OUT = 'sign_out',\r\n ACQUIRE_TOKEN = 'acquire_token',\r\n}\r\n\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nexport const AADAuthorityConstants = {\r\n COMMON: 'common',\r\n ORGANIZATIONS: 'organizations',\r\n CONSUMERS: 'consumers',\r\n};\r\n\r\n/**\r\n * String constants related credential type\r\n */\r\nexport enum KeyVaultCredentialTypes {\r\n SECRET = 'clientSecret',\r\n CERTIFICATE = 'clientCertificate',\r\n}\r\n\r\nexport const OIDC_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\r\n\r\n/**\r\n * Request headers used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationHeaders = {\r\n APP_SERVICE_AUTHENTICATION_HEADER: 'X-MSAL-APP-SERVICE-AUTHENTICATION',\r\n APP_SERVICE_ACCESS_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ACCESS-TOKEN',\r\n APP_SERVICE_ID_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ID-TOKEN',\r\n APP_SERVICE_REFRESH_TOKEN_HEADER: 'X-MS-TOKEN-AAD-REFRESH-TOKEN',\r\n APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER: 'X-MS-TOKEN-AAD-EXPIRES-ON',\r\n APP_SERVICE_USER_OID_HEADER: 'X-MS-CLIENT-PRINCIPAL-ID',\r\n APP_SERVICE_USER_UPN_HEADER: 'X-MS-CLIENT-PRINCIPAL-NAME',\r\n APP_SERVICE_IDP_X_HEADER: 'X-MS-CLIENT-PRINCIPAL-IDP',\r\n};\r\n\r\n/**\r\n * Endpoints used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationEndpoints = {\r\n ID_TOKEN_ENDPOINT: '/.auth/me',\r\n POST_LOGOUT_DEFAULT_ENDPOINT: '/.auth/logout/done',\r\n POST_LOGIN_DEFAULT_ENDPOINT: '/.auth/login/done',\r\n AAD_SIGN_IN_ENDPOINT: '/.auth/login/aad',\r\n AAD_SIGN_OUT_ENDPOINT: '/.auth/logout',\r\n TOKEN_REFRESH_ENDPOINT: '/.auth/refresh',\r\n AAD_REDIRECT_ENDPOINT: '/.auth/login/aad/callback',\r\n};\r\n\r\n/**\r\n * Query parameters used by App Service authentication endpoints\r\n */\r\nexport const AppServiceAuthenticationQueryParameters = {\r\n POST_LOGIN_REDIRECT_QUERY_PARAM: '?post_login_redirect_url=',\r\n POST_LOGOUT_REDIRECT_QUERY_PARAM: '?post_logout_redirect_uri=',\r\n};\r\n\r\n/**\r\n * Environment variables used by App Service authentication\r\n */\r\nexport const AppServiceEnvironmentVariables = {\r\n WEBSITE_AUTH_ENABLED: 'WEBSITE_AUTH_ENABLED',\r\n WEBSITE_AUTH_ALLOWED_AUDIENCES: 'WEBSITE_AUTH_ALLOWED_AUDIENCES',\r\n WEBSITE_AUTH_DEFAULT_PROVIDER: 'WEBSITE_AUTH_DEFAULT_PROVIDER',\r\n WEBSITE_AUTH_TOKEN_STORE: 'WEBSITE_AUTH_TOKEN_STORE',\r\n WEBSITE_AUTH_LOGIN_PARAMS: 'WEBSITE_AUTH_LOGIN_PARAMS',\r\n WEBSITE_AUTH_PRESERVE_URL_FRAGMENT: 'WEBSITE_AUTH_PRESERVE_URL_FRAGMENT',\r\n WEBSITE_AUTH_OPENID_ISSUER: 'WEBSITE_AUTH_OPENID_ISSUER',\r\n WEBSITE_AUTH_CLIENT_ID: 'WEBSITE_AUTH_CLIENT_ID',\r\n WEBSITE_HOSTNAME: 'WEBSITE_HOSTNAME',\r\n WEBSITE_SITE_NAME: 'WEBSITE_SITE_NAME',\r\n WEBSITE_AUTH_REQUIRE_HTTPS: 'WEBSITE_AUTH_REQUIRE_HTTPS',\r\n WEBSITE_AUTH_UNAUTHENTICATED_ACTION: 'WEBSITE_AUTH_UNAUTHENTICATED_ACTION',\r\n WEBSITE_AUTH_API_PREFIX: 'WEBSITE_AUTH_API_PREFIX',\r\n MICROSOFT_PROVIDER_AUTHENTICATION_SECRET: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET',\r\n};\r\n\r\n/**\r\n * Constants used in access control scenarios\r\n */\r\nexport const AccessControlConstants = {\r\n GROUPS: 'groups',\r\n ROLES: 'roles',\r\n CLAIM_NAMES: '_claim_name',\r\n CLAIM_SOURCES: '_claim_sources',\r\n PAGINATION_LINK: '@odata.nextLink',\r\n GRAPH_MEMBERS_ENDPOINT: 'https://graph.microsoft.com/v1.0/me/memberOf',\r\n GRAPH_MEMBER_SCOPES: 'User.Read GroupMember.Read.All',\r\n};\r\n\r\n/**\r\n * Various information constants\r\n */\r\nexport const InfoMessages = {\r\n APP_SERVICE_AUTH_DETECTED: 'App Service Authentication detected',\r\n REQUEST_FOR_RESOURCE: 'Request made to web API',\r\n OVERAGE_OCCURRED: 'User has too many groups. Groups overage claim occurred',\r\n};\r\n\r\n/**\r\n * Various error constants\r\n */\r\nexport const ErrorMessages = {\r\n NOT_PERMITTED: 'Not permitted',\r\n INVALID_TOKEN: 'Invalid token',\r\n CANNOT_DETERMINE_APP_STAGE: 'Cannot determine application stage',\r\n CANNOT_VALIDATE_TOKEN: 'Cannot validate token',\r\n CSRF_TOKEN_MISMATCH: 'CSRF token in response does not match to original request',\r\n INTERACTION_REQUIRED: 'interaction_required',\r\n TOKEN_ACQUISITION_FAILED: 'Token acquisition failed',\r\n TOKEN_RESPONSE_NULL: 'Token response is null',\r\n AUTH_CODE_URL_NOT_OBTAINED: 'Authorization code url cannot be obtained',\r\n TOKEN_NOT_FOUND: 'No token found',\r\n TOKEN_NOT_DECODED: 'Token cannot be decoded',\r\n TOKEN_NOT_VERIFIED: 'Token cannot be verified',\r\n KEYS_NOT_OBTAINED: 'Signing keys cannot be obtained',\r\n STATE_NOT_FOUND: 'State not found',\r\n USER_HAS_NO_ROLE: 'User does not have any roles',\r\n USER_NOT_IN_ROLE: 'User does not have this role',\r\n USER_HAS_NO_GROUP: 'User does not have any groups',\r\n USER_NOT_IN_GROUP: 'User does not have this group',\r\n METHOD_NOT_ALLOWED: 'Method not allowed for this route',\r\n RULE_NOT_FOUND: 'No rule found for this route',\r\n SESSION_NOT_FOUND: 'No session found for this request',\r\n KEY_VAULT_CONFIG_NOT_FOUND: 'No coordinates found for Key Vault',\r\n CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT: 'Cannot obtain credentials from Key Vault',\r\n SESSION_KEY_NOT_FOUND: 'No session key found in session. Cannot encrypt state data',\r\n AUTH_CODE_REQUEST_OBJECT_NOT_FOUND: 'No auth code request object found in session',\r\n ID_TOKEN_CLAIMS_NOT_FOUND: 'No id token claims found in session',\r\n};\r\n\r\n/**\r\n * Various configuration error constants\r\n */\r\nexport const ConfigurationErrorMessages = {\r\n AUTH_ROUTES_NOT_CONFIGURED:\r\n 'Authentication routes are not defined. Ensure that the application settings are configured properly.',\r\n NO_PROTECTED_RESOURCE_CONFIGURED:\r\n 'No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.',\r\n NO_ACCESS_MATRIX_CONFIGURED:\r\n 'No access matrix is configured to control access for. Ensure that the application settings are configured properly.',\r\n NO_CLIENT_ID: 'No clientId provided!',\r\n INVALID_CLIENT_ID: 'Invalid clientId!',\r\n NO_TENANT_INFO: 'No tenant info provided!',\r\n INVALID_TENANT_INFO: 'Invalid tenant info!',\r\n NO_CLIENT_CREDENTIAL: 'No client credential provided!',\r\n NO_REDIRECT_URI: 'No redirect URI provided!',\r\n NO_UNAUTHORIZED_ROUTE: 'No unauthorized route provided!',\r\n};\r\n\r\n/**\r\n * For more information, visit: https://login.microsoftonline.com/error\r\n */\r\nexport const ErrorCodes = {\r\n 65001: 'AADSTS65001', // consent required\r\n 50076: 'AADSTS50076', // mfa required\r\n 50079: 'AADSTS50079', // mfa enrollment required\r\n 50001: 'AADSTS50001', // invalid resource uri\r\n 65004: 'AADSTS65004', // user declined consent\r\n 70011: 'AADSTS70011', // invalid scope\r\n 700022: 'AADSTS700022', // multiple resources\r\n 700020: 'AADSTS700020', // interaction required\r\n 90118: 'AADB2C90118', // password forgotten (B2C)\r\n};\r\n\r\nexport const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\r\n loggerCallback: (logLevel, message, containsPii) => {\r\n if (containsPii) {\r\n return;\r\n }\r\n console.info(message);\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions } from '@azure/msal-common';\r\n\r\nexport type AppSettings = {\r\n appCredentials: AppCredentials;\r\n loggerOptions?: LoggerOptions;\r\n b2cPolicies?: Record;\r\n accessMatrix?: Record;\r\n};\r\n\r\nexport type WebAppSettings = AppSettings & {\r\n authRoutes: AuthRoutes;\r\n protectedResources?: Record\r\n};\r\n\r\nexport type AppCredentials = {\r\n instance?: string;\r\n clientId: string;\r\n tenantId: string;\r\n clientSecret?: string;\r\n clientCertificate?: ClientCertificate;\r\n};\r\n\r\nexport type ClientCertificate = {\r\n thumbprint: string;\r\n privateKey: string;\r\n x5c?: string;\r\n};\r\n\r\nexport type KeyVaultCredential = {\r\n credentialType: string;\r\n credentialName: string;\r\n keyVaultUrl: string;\r\n};\r\n\r\nexport type AuthRoutes = {\r\n redirect: string;\r\n unauthorized: string;\r\n frontChannelLogout?: string;\r\n};\r\n\r\nexport type Policy = {\r\n authority: string;\r\n};\r\n\r\nexport type Resource = {\r\n endpoint: string;\r\n scopes: string[];\r\n accessToken?: string;\r\n};\r\n\r\nexport type AccessRule = {\r\n path: string;\r\n methods: string[];\r\n roles?: string[];\r\n groups?: string[];\r\n};\r\n\r\nexport enum AppType {\r\n WebApp\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AADAuthorityConstants, ConfigurationErrorMessages, OIDC_SCOPES } from '../utils/Constants';\r\nimport { AppSettings, AppType, Resource, WebAppSettings } from './AppSettings';\r\n\r\nexport class ConfigHelper {\r\n /**\r\n * Validates the fields in the configuration file\r\n * @param {AppSettings} appSettings: configuration object\r\n * @returns {void}\r\n */\r\n static validateAppSettings(appSettings: AppSettings, appType: AppType): void {\r\n if (StringUtils.isEmpty(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_CLIENT_ID);\r\n } else if (!ConfigHelper.isGuid(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_CLIENT_ID);\r\n }\r\n\r\n if (StringUtils.isEmpty(appSettings.appCredentials.tenantId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_TENANT_INFO);\r\n } else if (\r\n !ConfigHelper.isGuid(appSettings.appCredentials.tenantId) &&\r\n !Object.values(AADAuthorityConstants).includes(appSettings.appCredentials.tenantId)\r\n ) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_TENANT_INFO);\r\n }\r\n\r\n switch (appType) {\r\n case AppType.WebApp:\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.redirect)) {\r\n throw new Error(ConfigurationErrorMessages.NO_REDIRECT_URI);\r\n }\r\n\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.unauthorized)) {\r\n throw new Error(ConfigurationErrorMessages.NO_UNAUTHORIZED_ROUTE);\r\n }\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Verifies if a string is GUID\r\n * @param {string} guid\r\n * @returns {boolean}\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Util method to get the resource name for a given scope(s)\r\n * @param {Array} scopes: an array of scopes that the resource is associated with\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string {\r\n const index = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).findIndex((resource: Resource) =>\r\n JSON.stringify(resource.scopes.sort()) === JSON.stringify(scopes.sort())\r\n );\r\n\r\n const resourceName = Object.keys({\r\n ...webAppSettings.protectedResources,\r\n })[index];\r\n\r\n return resourceName;\r\n }\r\n\r\n /**\r\n * Util method to get the scopes for a given resource name\r\n * @param {string} resourceEndpoint: the resource name\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[] {\r\n const scopes = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).find((resource: Resource) => resource.endpoint === resourceEndpoint)?.scopes;\r\n\r\n return scopes ? scopes : [];\r\n }\r\n\r\n /**\r\n * Util method to strip the default OIDC scopes from the scopes array\r\n * @param {Array} scopesList full list of scopes for this resource\r\n * @returns\r\n */\r\n static getEffectiveScopes(scopesList: string[]): string[] {\r\n const effectiveScopesList = scopesList.filter(scope => !OIDC_SCOPES.includes(scope));\r\n return effectiveScopesList;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICachePlugin } from '@azure/msal-node';\r\n\r\nimport { ConfigHelper } from '../config/ConfigHelper';\r\nimport { AppSettings, AppType, KeyVaultCredential } from '../config/AppSettings';\r\n\r\nexport abstract class BaseAuthClientBuilder {\r\n appSettings: AppSettings;\r\n protected keyVaultCredential: KeyVaultCredential | undefined;\r\n protected customCachePlugin: ICachePlugin | undefined;\r\n\r\n protected constructor(appSettings: AppSettings, appType: AppType) {\r\n ConfigHelper.validateAppSettings(appSettings, appType);\r\n this.appSettings = appSettings;\r\n }\r\n\r\n withKeyVaultCredentials(keyVaultCredential: KeyVaultCredential): BaseAuthClientBuilder {\r\n this.keyVaultCredential = keyVaultCredential;\r\n return this;\r\n }\r\n\r\n withCustomCachePlugin(cachePlugin: ICachePlugin): BaseAuthClientBuilder {\r\n this.customCachePlugin = cachePlugin;\r\n return this;\r\n }\r\n\r\n abstract build(): any;\r\n\r\n abstract buildAsync(): Promise;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport * as crypto from 'crypto';\r\n\r\nexport class CryptoUtils {\r\n private algorithm: string;\r\n\r\n constructor(algorithm: string = 'aes-192-cbc') {\r\n this.algorithm = algorithm;\r\n }\r\n\r\n generateSalt(): string {\r\n return crypto.randomBytes(20).toString('hex');\r\n }\r\n\r\n createKey(password: string, salt: string): Buffer {\r\n return crypto.scryptSync(password, salt, 24);\r\n }\r\n\r\n encryptData(stringifiedData: string, key: Buffer): string {\r\n const iv = crypto.randomBytes(16);\r\n const cipher = crypto.createCipheriv(this.algorithm, key, iv);\r\n const encryptedData = cipher.update(stringifiedData, 'utf8', 'hex');\r\n\r\n return [iv.toString('hex'), encryptedData + cipher.final('hex')].join('.');\r\n }\r\n\r\n decryptData(encryptedData: string, key: Buffer): string {\r\n const [iv, encrypted] = encryptedData.split('.');\r\n const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(iv, 'hex'));\r\n return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const packageName = '@azure-samples/microsoft-identity-express';\r\nexport const packageVersion = 'beta';\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from '@azure/msal-common';\r\nimport { ConfidentialClientApplication, Configuration, CryptoProvider } from '@azure/msal-node';\r\n\r\nimport { AppSettings } from '../config/AppSettings';\r\nimport { CryptoUtils } from '../utils/CryptoUtils';\r\nimport { packageName, packageVersion } from '../packageMetadata';\r\n\r\nexport abstract class BaseAuthClient {\r\n appSettings: AppSettings;\r\n\r\n protected msalConfig: Configuration;\r\n protected msalClient: ConfidentialClientApplication;\r\n protected cryptoProvider: CryptoProvider;\r\n protected cryptoUtils: CryptoUtils;\r\n protected logger: Logger;\r\n\r\n protected constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n this.appSettings = appSettings;\r\n this.msalConfig = msalConfig;\r\n this.cryptoProvider = new CryptoProvider();\r\n this.cryptoUtils = new CryptoUtils();\r\n\r\n this.logger = new Logger(this.msalConfig.system?.loggerOptions!, packageName, packageVersion);\r\n\r\n this.msalClient = new ConfidentialClientApplication(this.msalConfig);\r\n }\r\n\r\n getMsalClient(): ConfidentialClientApplication {\r\n return this.msalClient;\r\n }\r\n\r\n getMsalConfig(): Configuration {\r\n return this.msalConfig;\r\n }\r\n\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport axios, { AxiosResponse, AxiosRequestConfig } from 'axios';\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AccessControlConstants, ErrorMessages } from '../utils/Constants';\r\n\r\nexport class FetchManager {\r\n /**\r\n * Calls a resource endpoint\r\n * @param {string} endpoint\r\n * @returns {Promise}\r\n */\r\n static callApiEndpoint = async (endpoint: string): Promise => {\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Calls a resource endpoint with a raw access token\r\n * using the authorization bearer token scheme\r\n * @param {string} endpoint\r\n * @param {string} accessToken\r\n * @returns {Promise}\r\n */\r\n static callApiEndpointWithToken = async (endpoint: string, accessToken: string): Promise> => {\r\n if (StringUtils.isEmpty(accessToken)) {\r\n throw new Error(ErrorMessages.TOKEN_NOT_FOUND);\r\n }\r\n\r\n const options: AxiosRequestConfig = {\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint, options);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Handles queries against Microsoft Graph that return multiple pages of data\r\n * @param {string} accessToken: access token required by endpoint\r\n * @param {string} nextPage: next page link\r\n * @param {Array} data: stores data from each page\r\n * @returns {Promise}\r\n */\r\n static handlePagination = async (accessToken: string, nextPage: string, data: string[] = []): Promise => {\r\n try {\r\n const graphResponse = await (await FetchManager.callApiEndpointWithToken(nextPage, accessToken)).data;\r\n graphResponse['value'].map((v: any) => data.push(v.id));\r\n\r\n if (graphResponse[AccessControlConstants.PAGINATION_LINK]) {\r\n return await FetchManager.handlePagination(\r\n accessToken,\r\n graphResponse[AccessControlConstants.PAGINATION_LINK],\r\n data\r\n );\r\n } else {\r\n return data;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Request } from 'express';\r\nimport { IUri, UrlString } from '@azure/msal-common';\r\n\r\nexport class UrlUtils {\r\n /**\r\n * Gets the absolute URL from a given request and path string\r\n * @param {Request} req: express request object\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static ensureAbsoluteUrl = (req: Request, url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n\r\n if (!urlComponents.Protocol) {\r\n if (!urlComponents.HostNameAndPort && !url.startsWith('www')) {\r\n if (!url.startsWith('/')) {\r\n return req.protocol + '://' + req.get('host') + '/' + url;\r\n }\r\n return req.protocol + '://' + req.get('host') + url;\r\n }\r\n return req.protocol + '://' + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n /**\r\n * Gets the path segment from a given URL\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static getPathFromUrl = (url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n return `/${urlComponents.PathSegments.join('/')}`;\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { RequestHandler, Request, Response, NextFunction, Router } from 'express';\r\nimport { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, ClientAuthError, StringUtils, ResponseMode } from '@azure/msal-common';\r\nimport { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node';\r\nimport { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings';\r\nimport { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions';\r\nimport { AppStages, ErrorMessages, AccessControlConstants, ConfigurationErrorMessages } from '../../utils/Constants';\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { FetchManager } from '../../network/FetchManager';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { AppState } from '../../utils/Types';\r\n\r\n/**\r\n * A simple wrapper around MSAL Node ConfidentialClientApplication object.\r\n * It offers a collection of middleware and utility methods that automate\r\n * basic authentication and authorization tasks in Express web apps\r\n */\r\nexport class MsalWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction) => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n next();\r\n });\r\n\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n if (this.webAppSettings.authRoutes.frontChannelLogout) {\r\n /**\r\n * Expose front-channel logout route. For more information, visit:\r\n * https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#single-sign-out\r\n */\r\n appRouter.get(this.webAppSettings.authRoutes.frontChannelLogout, (req: Request, res: Response) => {\r\n req.session.destroy(() => {\r\n res.sendStatus(200);\r\n });\r\n });\r\n }\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): Promise => {\r\n const appState = {\r\n appStage: AppStages.SIGN_IN,\r\n redirectTo: options.postLoginRedirect,\r\n csrfToken: req.session.csrfToken,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationCodeRequest;\r\n\r\n // get url to sign user in\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return async (req: Request, res: Response): Promise => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n\r\n /**\r\n * Construct a logout URI and redirect the user to end the\r\n * session with Azure AD/B2C. For more information, visit:\r\n * (AAD) https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#send-a-sign-out-request\r\n * (B2C) https://docs.microsoft.com/azure/active-directory-b2c/openid-connect#send-a-sign-out-request\r\n */\r\n const logoutUri = `${this.msalConfig.auth.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${postLogoutRedirectUri}`;\r\n\r\n const tokenCache = this.msalClient.getTokenCache();\r\n\r\n const account = req.session.account?.homeAccountId\r\n ?\r\n await tokenCache.getAccountByHomeId(req.session.account.homeAccountId)\r\n :\r\n await tokenCache.getAccountByLocalId(req.session.account?.localAccountId!);\r\n\r\n if (account) {\r\n await tokenCache.removeAccount(account);\r\n }\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!req.session.key) {\r\n this.logger.error(ErrorMessages.SESSION_KEY_NOT_FOUND);\r\n return next(new Error(ErrorMessages.SESSION_KEY_NOT_FOUND));\r\n }\r\n\r\n if (!req.session.authorizationCodeRequest) {\r\n this.logger.error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND);\r\n return next(new Error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND));\r\n }\r\n\r\n if (req.body.state) {\r\n const state: AppState = JSON.parse(\r\n this.cryptoUtils.decryptData(\r\n this.cryptoProvider.base64Decode(req.body.state as string),\r\n Buffer.from(req.session.key, 'hex')\r\n )\r\n );\r\n\r\n // check if csrfToken matches\r\n if (state.csrfToken === req.session.csrfToken) {\r\n switch (state.appStage) {\r\n case AppStages.SIGN_IN: {\r\n // token request should have auth code\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n // exchange auth code for tokens\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.isAuthenticated = true;\r\n req.session.account = tokenResponse.account!; // this won't be null in any web app scenario\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n case AppStages.ACQUIRE_TOKEN: {\r\n // get the name of the resource associated with scope\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(\r\n req.session.authorizationCodeRequest.scopes,\r\n this.webAppSettings\r\n );\r\n\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n accessToken: tokenResponse.accessToken,\r\n } as Resource,\r\n };\r\n\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n next(new Error(ErrorMessages.CANNOT_DETERMINE_APP_STAGE));\r\n break;\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens via acquireToken*\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const scopes = options.resource.scopes;\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n try {\r\n const silentRequest = {\r\n account: req.session.account,\r\n scopes: scopes,\r\n } as SilentFlowRequest;\r\n\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse || StringUtils.isEmpty(tokenResponse.accessToken)) {\r\n // In B2C scenarios, sometimes an access token is returned empty.\r\n // In that case, we will acquire token interactively instead.\r\n\r\n throw new InteractionRequiredAuthError(ErrorMessages.INTERACTION_REQUIRED);\r\n }\r\n\r\n req.session.protectedResources[resourceName].accessToken = tokenResponse.accessToken;\r\n next();\r\n } catch (error) {\r\n // in case there are no cached tokens, initiate an interactive call\r\n // FIXME: ClientAuthError used for temporary workaround regarding issue: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/4878\r\n if (error instanceof InteractionRequiredAuthError || error instanceof ClientAuthError) {\r\n const appState = {\r\n appStage: AppStages.ACQUIRE_TOKEN,\r\n redirectTo: req.originalUrl,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: scopes,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: scopes,\r\n } as AuthorizationCodeRequest;\r\n\r\n // initiate the first leg of auth code grant to get token\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n } else {\r\n next(error);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Checks if the user has access for this route, defined in access matrix\r\n * @param {GuardOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n hasAccess(options: GuardOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.accessMatrix) {\r\n this.logger.error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED));\r\n }\r\n\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const checkFor = options.accessRule.hasOwnProperty(AccessControlConstants.GROUPS)\r\n ? AccessControlConstants.GROUPS\r\n : AccessControlConstants.ROLES;\r\n\r\n switch (checkFor) {\r\n case AccessControlConstants.GROUPS:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.GROUPS]) {\r\n if (\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_NAMES] ||\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_SOURCES]\r\n ) {\r\n return await this.handleOverage(req, res, next, options.accessRule);\r\n } else {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n const groups = req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, groups, AccessControlConstants.GROUPS)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.ROLES]) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n const roles = req.session.account.idTokenClaims[AccessControlConstants.ROLES] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, roles, AccessControlConstants.ROLES)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n };\r\n }\r\n\r\n // ============== UTILS ===============\r\n\r\n /**\r\n * This method is used to generate an auth code url request\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AuthCodeParams} params: modifies auth code url request\r\n * @returns {Promise}\r\n */\r\n private async redirectToAuthCodeUrl(\r\n req: Request,\r\n res: Response,\r\n next: NextFunction,\r\n authUrlParams: AuthorizationUrlRequest,\r\n authCodeParams: AuthorizationCodeRequest,\r\n appState: AppState\r\n ): Promise {\r\n // add session csrfToken for crsf\r\n req.session.csrfToken = this.cryptoProvider.createNewGuid();\r\n\r\n const key = this.cryptoUtils.createKey(req.session.csrfToken, this.cryptoUtils.generateSalt());\r\n req.session.key = key.toString('hex');\r\n\r\n const state = JSON.stringify({\r\n ...appState,\r\n csrfToken: req.session.csrfToken,\r\n });\r\n\r\n // prepare the request\r\n req.session.authorizationUrlRequest = {\r\n ...authUrlParams,\r\n state: this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(state, key)),\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n responseMode: ResponseMode.FORM_POST\r\n };\r\n\r\n req.session.authorizationCodeRequest = {\r\n ...authCodeParams,\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n code: ''\r\n };\r\n\r\n // request an authorization code to exchange for tokens\r\n try {\r\n const response = await this.msalClient.getAuthCodeUrl(req.session.authorizationUrlRequest);\r\n res.redirect(response);\r\n } catch (error) {\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles group overage claims by querying MS Graph /memberOf endpoint\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AccessRule} rule: a given access rule\r\n * @returns {Promise}\r\n */\r\n private async handleOverage(req: Request, res: Response, next: NextFunction, rule: AccessRule): Promise {\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const { _claim_names, _claim_sources, ...newIdTokenClaims } = req.session.account.idTokenClaims;\r\n\r\n const silentRequest: SilentFlowRequest = {\r\n account: req.session.account,\r\n scopes: AccessControlConstants.GRAPH_MEMBER_SCOPES.split(' '),\r\n };\r\n\r\n try {\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n try {\r\n const graphResponse = await FetchManager.callApiEndpointWithToken(\r\n AccessControlConstants.GRAPH_MEMBERS_ENDPOINT,\r\n tokenResponse.accessToken\r\n );\r\n\r\n /**\r\n * Some queries against Microsoft Graph return multiple pages of data either due to server-side paging\r\n * or due to the use of the $top query parameter to specifically limit the page size in a request.\r\n * When a result set spans multiple pages, Microsoft Graph returns an @odata.nextLink property in\r\n * the response that contains a URL to the next page of results. Learn more at https://docs.microsoft.com/graph/paging\r\n */\r\n if (graphResponse.data[AccessControlConstants.PAGINATION_LINK]) {\r\n try {\r\n const userGroups = await FetchManager.handlePagination(\r\n tokenResponse.accessToken,\r\n graphResponse.data[AccessControlConstants.PAGINATION_LINK]\r\n );\r\n\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: userGroups,\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } else {\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: graphResponse.data['value'].map((v: any) => v.id),\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } catch (error) {\r\n // TODO: handle silent token acquisition error\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the request passes a given access rule\r\n * @param {string} method: HTTP method for this route\r\n * @param {AccessRule} rule: access rule for this route\r\n * @param {Array} creds: user's credentials i.e. roles or groups\r\n * @param {string} credType: roles or groups\r\n * @returns {boolean}\r\n */\r\n private checkAccessRule(method: string, rule: AccessRule, creds: string[], credType: string): boolean {\r\n if (rule.methods.includes(method)) {\r\n switch (credType) {\r\n case AccessControlConstants.GROUPS:\r\n if (!rule.groups || rule.groups.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!rule.roles || rule.roles!.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { Router, RequestHandler, Request, Response, NextFunction } from 'express';\r\nimport { AccountInfo, AuthToken } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { AccessTokenClaims, IdTokenClaims } from '../../utils/Types';\r\nimport { AppSettings, Resource, WebAppSettings } from '../../config/AppSettings';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { SignInOptions, SignOutOptions, TokenRequestOptions } from '../MiddlewareOptions';\r\nimport {\r\n AppServiceAuthenticationHeaders,\r\n AppServiceEnvironmentVariables,\r\n AppServiceAuthenticationEndpoints,\r\n AppServiceAuthenticationQueryParameters,\r\n ErrorMessages,\r\n ConfigurationErrorMessages,\r\n} from '../../utils/Constants';\r\n\r\nexport class AppServiceWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @param {InitializationOptions} options\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n // handle redirect\r\n appRouter.get(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n if (!req.session.isAuthenticated) {\r\n // check headers for id token\r\n const rawIdToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawIdToken) {\r\n // parse the id token\r\n const idTokenClaims: IdTokenClaims = AuthToken.extractTokenClaims(rawIdToken, this.cryptoProvider);\r\n\r\n req.session.isAuthenticated = true;\r\n\r\n req.session.account = {\r\n tenantId: idTokenClaims.tid,\r\n homeAccountId: idTokenClaims.oid + '.' + idTokenClaims.tid,\r\n localAccountId: idTokenClaims.oid,\r\n environment: idTokenClaims.iss?.split('://')[1].split('/')[0],\r\n username: idTokenClaims.preferred_username,\r\n name: idTokenClaims.name,\r\n idTokenClaims: idTokenClaims,\r\n } as AccountInfo;\r\n }\r\n }\r\n\r\n next();\r\n });\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n let loginUri;\r\n const postLoginRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLoginRedirect);\r\n loginUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_IN_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGIN_REDIRECT_QUERY_PARAM +\r\n postLoginRedirectUri;\r\n res.redirect(loginUri);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n const logoutUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_OUT_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGOUT_REDIRECT_QUERY_PARAM +\r\n postLogoutRedirectUri;\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(options.resource.scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n const rawAccessToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawAccessToken) {\r\n const accessTokenClaims = AuthToken.extractTokenClaims(\r\n rawAccessToken,\r\n this.cryptoProvider\r\n ) as AccessTokenClaims;\r\n\r\n // get the name of the resource associated with scope\r\n const scopes = accessTokenClaims?.scp.split(' ');\r\n const effectiveScopes = ConfigHelper.getEffectiveScopes(scopes);\r\n\r\n if (options.resource.scopes.every(elem => effectiveScopes.includes(elem))) {\r\n req.session.protectedResources[resourceName].accessToken = rawAccessToken;\r\n return next();\r\n } else {\r\n return next(new Error('No tokens found for given scopes'));\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DefaultAzureCredential } from '@azure/identity';\r\nimport { CertificateClient, KeyVaultCertificate } from '@azure/keyvault-certificates';\r\nimport { KeyVaultSecret, SecretClient } from '@azure/keyvault-secrets';\r\n\r\nimport { KeyVaultCredential, ClientCertificate } from '../config/AppSettings';\r\nimport { KeyVaultCredentialTypes } from '../utils/Constants';\r\n\r\nexport type KeyVaultCredentialResponse = {\r\n type: KeyVaultCredentialTypes.SECRET | KeyVaultCredentialTypes.CERTIFICATE;\r\n value: string & ClientCertificate;\r\n};\r\n\r\nexport class KeyVaultManager {\r\n /**\r\n * Fetches credentials from Key Vault and updates appSettings\r\n * @param {AppSettings} appSettings\r\n * @returns {Promise}\r\n */\r\n async getCredentialFromKeyVault(keyVaultCredential: KeyVaultCredential): Promise {\r\n const credential = new DefaultAzureCredential();\r\n let response: KeyVaultCredentialResponse = {} as KeyVaultCredentialResponse;\r\n\r\n switch (keyVaultCredential.credentialType) {\r\n case KeyVaultCredentialTypes.SECRET: {\r\n try {\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.SECRET,\r\n value: secretResponse.value,\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n case KeyVaultCredentialTypes.CERTIFICATE: {\r\n try {\r\n const certificateResponse = await this.getCertificateCredential(keyVaultCredential, credential);\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.CERTIFICATE,\r\n value: {\r\n thumbprint: certificateResponse?.properties?.x509Thumbprint?.toString(),\r\n privateKey: secretResponse?.value?.split('-----BEGIN CERTIFICATE-----\\n')[0],\r\n },\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Gets a certificate credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getCertificateCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new CertificateClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultCertificate = await secretClient.getCertificate(keyVaultCredential.credentialName);\r\n return keyVaultCertificate;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a secret credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getSecretCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new SecretClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultSecret = await secretClient.getSecret(keyVaultCredential.credentialName);\r\n return keyVaultSecret;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { UrlString, Constants } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { DEFAULT_LOGGER_OPTIONS } from '../utils/Constants';\r\nimport { AppSettings } from './AppSettings';\r\n\r\nexport class MsalConfiguration {\r\n /**\r\n * Maps the custom configuration object to configuration\r\n * object expected by MSAL Node ConfidentialClientApplication class\r\n * @param {AppSettings} appSettings: configuration object\r\n * @param {ICachePlugin} cachePlugin: custom cache plugin\r\n * @param {IDistributedPersistence} distributedPersistence: distributed persistence client\r\n * @returns {Configuration}\r\n */\r\n static getMsalConfiguration(appSettings: AppSettings): Configuration {\r\n return {\r\n auth: {\r\n clientId: appSettings.appCredentials.clientId,\r\n authority: appSettings.b2cPolicies\r\n ? Object.entries(appSettings.b2cPolicies)[0][1]['authority'] // the first policy/user-flow is the default authority\r\n : appSettings.appCredentials.instance\r\n ? `https://${appSettings.appCredentials.instance}/${appSettings.appCredentials.tenantId}`\r\n : `https://${Constants.DEFAULT_AUTHORITY_HOST}/${appSettings.appCredentials.tenantId}`,\r\n ...(appSettings.appCredentials.hasOwnProperty('clientSecret') && {\r\n clientSecret: appSettings.appCredentials.clientSecret,\r\n }),\r\n ...(appSettings.appCredentials.hasOwnProperty('clientCertificate') && {\r\n clientCertificate: appSettings.appCredentials.clientCertificate,\r\n }),\r\n knownAuthorities: appSettings.b2cPolicies\r\n ? [UrlString.getDomainFromUrl(Object.entries(appSettings.b2cPolicies)[0][1]['authority'])] // in B2C scenarios\r\n : [],\r\n },\r\n system: {\r\n loggerOptions: appSettings.loggerOptions ? appSettings.loggerOptions : DEFAULT_LOGGER_OPTIONS,\r\n },\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AppServiceEnvironmentVariables } from './Constants';\r\n\r\nexport class EnvironmentUtils {\r\n static isProduction(): boolean {\r\n return process.env.NODE_ENV === 'production';\r\n }\r\n\r\n static isDevelopment(): boolean {\r\n return process.env.NODE_ENV === 'development';\r\n }\r\n\r\n static isAppServiceAuthEnabled(): boolean {\r\n return process.env[AppServiceEnvironmentVariables.WEBSITE_AUTH_ENABLED] === 'True';\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClientBuilder } from '../BaseAuthClientBuilder';\r\nimport { MsalWebAppAuthClient } from './MsalWebAppAuthClient';\r\nimport { AppServiceWebAppAuthClient } from './AppServiceWebAppAuthClient';\r\nimport { KeyVaultManager } from '../../network/KeyVaultManager';\r\nimport { MsalConfiguration } from '../../config/MsalConfiguration';\r\nimport { AppSettings, AppType } from '../../config/AppSettings';\r\nimport { EnvironmentUtils } from '../../utils/EnvironmentUtils';\r\nimport { ErrorMessages } from '../../utils/Constants';\r\n\r\nexport class WebAppAuthClientBuilder extends BaseAuthClientBuilder {\r\n appSettings!: AppSettings;\r\n private msalConfig!: Configuration;\r\n\r\n constructor(appSettings: AppSettings) {\r\n super(appSettings, AppType.WebApp);\r\n }\r\n\r\n build(): MsalWebAppAuthClient | AppServiceWebAppAuthClient {\r\n // TODO: throw error if key vault credential is being built\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n }\r\n\r\n async buildAsync(): Promise {\r\n try {\r\n if (this.keyVaultCredential) {\r\n const keyVaultManager = new KeyVaultManager();\r\n const credential = await keyVaultManager.getCredentialFromKeyVault(this.keyVaultCredential);\r\n this.appSettings.appCredentials[credential.type] = credential.value;\r\n }\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n } catch (error) {\r\n throw new Error(ErrorMessages.CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT);\r\n }\r\n }\r\n}\r\n"],"names":["undefined","AppStages","AADAuthorityConstants","COMMON","ORGANIZATIONS","CONSUMERS","KeyVaultCredentialTypes","OIDC_SCOPES","AppServiceAuthenticationHeaders","APP_SERVICE_AUTHENTICATION_HEADER","APP_SERVICE_ACCESS_TOKEN_HEADER","APP_SERVICE_ID_TOKEN_HEADER","APP_SERVICE_REFRESH_TOKEN_HEADER","APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER","APP_SERVICE_USER_OID_HEADER","APP_SERVICE_USER_UPN_HEADER","APP_SERVICE_IDP_X_HEADER","AppServiceAuthenticationEndpoints","ID_TOKEN_ENDPOINT","POST_LOGOUT_DEFAULT_ENDPOINT","POST_LOGIN_DEFAULT_ENDPOINT","AAD_SIGN_IN_ENDPOINT","AAD_SIGN_OUT_ENDPOINT","TOKEN_REFRESH_ENDPOINT","AAD_REDIRECT_ENDPOINT","AppServiceAuthenticationQueryParameters","POST_LOGIN_REDIRECT_QUERY_PARAM","POST_LOGOUT_REDIRECT_QUERY_PARAM","AppServiceEnvironmentVariables","WEBSITE_AUTH_ENABLED","WEBSITE_AUTH_ALLOWED_AUDIENCES","WEBSITE_AUTH_DEFAULT_PROVIDER","WEBSITE_AUTH_TOKEN_STORE","WEBSITE_AUTH_LOGIN_PARAMS","WEBSITE_AUTH_PRESERVE_URL_FRAGMENT","WEBSITE_AUTH_OPENID_ISSUER","WEBSITE_AUTH_CLIENT_ID","WEBSITE_HOSTNAME","WEBSITE_SITE_NAME","WEBSITE_AUTH_REQUIRE_HTTPS","WEBSITE_AUTH_UNAUTHENTICATED_ACTION","WEBSITE_AUTH_API_PREFIX","MICROSOFT_PROVIDER_AUTHENTICATION_SECRET","AccessControlConstants","GROUPS","ROLES","CLAIM_NAMES","CLAIM_SOURCES","PAGINATION_LINK","GRAPH_MEMBERS_ENDPOINT","GRAPH_MEMBER_SCOPES","ErrorMessages","NOT_PERMITTED","INVALID_TOKEN","CANNOT_DETERMINE_APP_STAGE","CANNOT_VALIDATE_TOKEN","CSRF_TOKEN_MISMATCH","INTERACTION_REQUIRED","TOKEN_ACQUISITION_FAILED","TOKEN_RESPONSE_NULL","AUTH_CODE_URL_NOT_OBTAINED","TOKEN_NOT_FOUND","TOKEN_NOT_DECODED","TOKEN_NOT_VERIFIED","KEYS_NOT_OBTAINED","STATE_NOT_FOUND","USER_HAS_NO_ROLE","USER_NOT_IN_ROLE","USER_HAS_NO_GROUP","USER_NOT_IN_GROUP","METHOD_NOT_ALLOWED","RULE_NOT_FOUND","SESSION_NOT_FOUND","KEY_VAULT_CONFIG_NOT_FOUND","CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT","SESSION_KEY_NOT_FOUND","AUTH_CODE_REQUEST_OBJECT_NOT_FOUND","ID_TOKEN_CLAIMS_NOT_FOUND","ConfigurationErrorMessages","AUTH_ROUTES_NOT_CONFIGURED","NO_PROTECTED_RESOURCE_CONFIGURED","NO_ACCESS_MATRIX_CONFIGURED","NO_CLIENT_ID","INVALID_CLIENT_ID","NO_TENANT_INFO","INVALID_TENANT_INFO","NO_CLIENT_CREDENTIAL","NO_REDIRECT_URI","NO_UNAUTHORIZED_ROUTE","DEFAULT_LOGGER_OPTIONS","loggerCallback","logLevel","message","containsPii","console","info","piiLoggingEnabled","LogLevel","Info","AppType","ConfigHelper","validateAppSettings","appSettings","appType","StringUtils","isEmpty","appCredentials","clientId","Error","isGuid","tenantId","Object","values","includes","WebApp","authRoutes","redirect","unauthorized","guid","regexGuid","test","getResourceNameFromScopes","scopes","webAppSettings","index","protectedResources","findIndex","resource","JSON","stringify","sort","resourceName","keys","getScopesFromResourceEndpoint","resourceEndpoint","find","endpoint","getEffectiveScopes","scopesList","effectiveScopesList","filter","scope","BaseAuthClientBuilder","withKeyVaultCredentials","keyVaultCredential","withCustomCachePlugin","cachePlugin","customCachePlugin","CryptoUtils","algorithm","generateSalt","crypto","toString","createKey","password","salt","encryptData","stringifiedData","key","iv","cipher","encryptedData","update","join","decryptData","split","encrypted","decipher","Buffer","from","packageName","packageVersion","BaseAuthClient","msalConfig","cryptoProvider","CryptoProvider","cryptoUtils","logger","Logger","system","loggerOptions","msalClient","ConfidentialClientApplication","getMsalClient","getMsalConfig","getLogger","FetchManager","axios","get","response","data","accessToken","options","headers","Authorization","nextPage","callApiEndpointWithToken","graphResponse","map","v","push","id","handlePagination","UrlUtils","req","url","urlComponents","UrlString","getUrlComponents","Protocol","HostNameAndPort","startsWith","protocol","PathSegments","MsalWebAppAuthClient","initialize","appRouter","express","Router","use","res","next","session","error","post","getPathFromUrl","handleRedirect","frontChannelLogout","destroy","sendStatus","signIn","postLoginRedirect","failureRedirect","appState","appStage","SIGN_IN","redirectTo","csrfToken","authUrlParams","OIDC_DEFAULT_SCOPES","authCodeParams","redirectToAuthCodeUrl","signOut","postLogoutRedirect","postLogoutRedirectUri","ensureAbsoluteUrl","logoutUri","auth","authority","tokenCache","getTokenCache","account","homeAccountId","getAccountByHomeId","getAccountByLocalId","localAccountId","removeAccount","authorizationCodeRequest","body","state","parse","base64Decode","ACQUIRE_TOKEN","code","acquireTokenByCode","tokenResponse","isAuthenticated","getToken","silentRequest","acquireTokenSilent","InteractionRequiredAuthError","ClientAuthError","originalUrl","hasAccess","accessMatrix","idTokenClaims","checkFor","accessRule","hasOwnProperty","handleOverage","groups","checkAccessRule","method","roles","createNewGuid","authorizationUrlRequest","base64Encode","redirectUri","responseMode","ResponseMode","FORM_POST","getAuthCodeUrl","rule","_claim_names","newIdTokenClaims","userGroups","creds","credType","methods","elem","length","AppServiceWebAppAuthClient","rawIdToken","toLowerCase","AuthToken","extractTokenClaims","tid","oid","environment","iss","username","preferred_username","name","loginUri","postLoginRedirectUri","process","env","rawAccessToken","accessTokenClaims","scp","effectiveScopes","every","KeyVaultManager","getCredentialFromKeyVault","credential","DefaultAzureCredential","credentialType","SECRET","CERTIFICATE","getSecretCredential","secretResponse","type","value","getCertificateCredential","certificateResponse","thumbprint","properties","x509Thumbprint","privateKey","secretClient","CertificateClient","keyVaultUrl","getCertificate","credentialName","keyVaultCertificate","SecretClient","getSecret","keyVaultSecret","MsalConfiguration","getMsalConfiguration","b2cPolicies","entries","instance","Constants","DEFAULT_AUTHORITY_HOST","clientSecret","clientCertificate","knownAuthorities","getDomainFromUrl","EnvironmentUtils","isProduction","NODE_ENV","isDevelopment","isAppServiceAuthEnabled","WebAppAuthClientBuilder","build","buildAsync","keyVaultManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AACjC,EAAE,IAAIA,WAAS,CAAC;AAChB,EAAE,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE,CAAC;AAC3D,EAAE,IAAI,cAAc,GAAG,OAAO,CAAC,QAAQ,IAAI,Y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A7C;;;;"} \ No newline at end of file +{"version":3,"file":"microsoft-identity-express.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/utils/Constants.ts","../src/config/AppSettings.ts","../src/config/ConfigHelper.ts","../src/client/BaseAuthClientBuilder.ts","../src/utils/CryptoUtils.ts","../src/packageMetadata.ts","../src/client/BaseAuthClient.ts","../src/network/FetchManager.ts","../src/utils/UrlUtils.ts","../src/client/webapp/MsalWebAppAuthClient.ts","../src/client/webapp/AppServiceWebAppAuthClient.ts","../src/network/KeyVaultManager.ts","../src/config/MsalConfiguration.ts","../src/utils/EnvironmentUtils.ts","../src/client/webapp/WebAppAuthClientBuilder.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions, LogLevel } from '@azure/msal-common';\r\n\r\n/**\r\n * Basic authentication stages used to determine\r\n * appropriate action after redirect occurs\r\n */\r\nexport enum AppStages {\r\n SIGN_IN = 'sign_in',\r\n SIGN_OUT = 'sign_out',\r\n ACQUIRE_TOKEN = 'acquire_token',\r\n}\r\n\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nexport const AADAuthorityConstants = {\r\n COMMON: 'common',\r\n ORGANIZATIONS: 'organizations',\r\n CONSUMERS: 'consumers',\r\n};\r\n\r\n/**\r\n * String constants related credential type\r\n */\r\nexport enum KeyVaultCredentialTypes {\r\n SECRET = 'clientSecret',\r\n CERTIFICATE = 'clientCertificate',\r\n}\r\n\r\nexport const OIDC_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\r\n\r\n/**\r\n * Request headers used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationHeaders = {\r\n APP_SERVICE_AUTHENTICATION_HEADER: 'X-MSAL-APP-SERVICE-AUTHENTICATION',\r\n APP_SERVICE_ACCESS_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ACCESS-TOKEN',\r\n APP_SERVICE_ID_TOKEN_HEADER: 'X-MS-TOKEN-AAD-ID-TOKEN',\r\n APP_SERVICE_REFRESH_TOKEN_HEADER: 'X-MS-TOKEN-AAD-REFRESH-TOKEN',\r\n APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER: 'X-MS-TOKEN-AAD-EXPIRES-ON',\r\n APP_SERVICE_USER_OID_HEADER: 'X-MS-CLIENT-PRINCIPAL-ID',\r\n APP_SERVICE_USER_UPN_HEADER: 'X-MS-CLIENT-PRINCIPAL-NAME',\r\n APP_SERVICE_IDP_X_HEADER: 'X-MS-CLIENT-PRINCIPAL-IDP',\r\n};\r\n\r\n/**\r\n * Endpoints used by App Service authentication\r\n */\r\nexport const AppServiceAuthenticationEndpoints = {\r\n ID_TOKEN_ENDPOINT: '/.auth/me',\r\n POST_LOGOUT_DEFAULT_ENDPOINT: '/.auth/logout/done',\r\n POST_LOGIN_DEFAULT_ENDPOINT: '/.auth/login/done',\r\n AAD_SIGN_IN_ENDPOINT: '/.auth/login/aad',\r\n AAD_SIGN_OUT_ENDPOINT: '/.auth/logout',\r\n TOKEN_REFRESH_ENDPOINT: '/.auth/refresh',\r\n AAD_REDIRECT_ENDPOINT: '/.auth/login/aad/callback',\r\n};\r\n\r\n/**\r\n * Query parameters used by App Service authentication endpoints\r\n */\r\nexport const AppServiceAuthenticationQueryParameters = {\r\n POST_LOGIN_REDIRECT_QUERY_PARAM: '?post_login_redirect_url=',\r\n POST_LOGOUT_REDIRECT_QUERY_PARAM: '?post_logout_redirect_uri=',\r\n};\r\n\r\n/**\r\n * Environment variables used by App Service authentication\r\n */\r\nexport const AppServiceEnvironmentVariables = {\r\n WEBSITE_AUTH_ENABLED: 'WEBSITE_AUTH_ENABLED',\r\n WEBSITE_AUTH_ALLOWED_AUDIENCES: 'WEBSITE_AUTH_ALLOWED_AUDIENCES',\r\n WEBSITE_AUTH_DEFAULT_PROVIDER: 'WEBSITE_AUTH_DEFAULT_PROVIDER',\r\n WEBSITE_AUTH_TOKEN_STORE: 'WEBSITE_AUTH_TOKEN_STORE',\r\n WEBSITE_AUTH_LOGIN_PARAMS: 'WEBSITE_AUTH_LOGIN_PARAMS',\r\n WEBSITE_AUTH_PRESERVE_URL_FRAGMENT: 'WEBSITE_AUTH_PRESERVE_URL_FRAGMENT',\r\n WEBSITE_AUTH_OPENID_ISSUER: 'WEBSITE_AUTH_OPENID_ISSUER',\r\n WEBSITE_AUTH_CLIENT_ID: 'WEBSITE_AUTH_CLIENT_ID',\r\n WEBSITE_HOSTNAME: 'WEBSITE_HOSTNAME',\r\n WEBSITE_SITE_NAME: 'WEBSITE_SITE_NAME',\r\n WEBSITE_AUTH_REQUIRE_HTTPS: 'WEBSITE_AUTH_REQUIRE_HTTPS',\r\n WEBSITE_AUTH_UNAUTHENTICATED_ACTION: 'WEBSITE_AUTH_UNAUTHENTICATED_ACTION',\r\n WEBSITE_AUTH_API_PREFIX: 'WEBSITE_AUTH_API_PREFIX',\r\n MICROSOFT_PROVIDER_AUTHENTICATION_SECRET: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET',\r\n};\r\n\r\n/**\r\n * Constants used in access control scenarios\r\n */\r\nexport const AccessControlConstants = {\r\n GROUPS: 'groups',\r\n ROLES: 'roles',\r\n CLAIM_NAMES: '_claim_name',\r\n CLAIM_SOURCES: '_claim_sources',\r\n PAGINATION_LINK: '@odata.nextLink',\r\n GRAPH_MEMBERS_ENDPOINT: 'https://graph.microsoft.com/v1.0/me/memberOf',\r\n GRAPH_MEMBER_SCOPES: 'User.Read GroupMember.Read.All',\r\n};\r\n\r\n/**\r\n * Various information constants\r\n */\r\nexport const InfoMessages = {\r\n APP_SERVICE_AUTH_DETECTED: 'App Service Authentication detected',\r\n REQUEST_FOR_RESOURCE: 'Request made to web API',\r\n OVERAGE_OCCURRED: 'User has too many groups. Groups overage claim occurred',\r\n};\r\n\r\n/**\r\n * Various error constants\r\n */\r\nexport const ErrorMessages = {\r\n NOT_PERMITTED: 'Not permitted',\r\n INVALID_TOKEN: 'Invalid token',\r\n CANNOT_DETERMINE_APP_STAGE: 'Cannot determine application stage',\r\n CANNOT_VALIDATE_TOKEN: 'Cannot validate token',\r\n CSRF_TOKEN_MISMATCH: 'CSRF token in response does not match to original request',\r\n INTERACTION_REQUIRED: 'interaction_required',\r\n TOKEN_ACQUISITION_FAILED: 'Token acquisition failed',\r\n TOKEN_RESPONSE_NULL: 'Token response is null',\r\n AUTH_CODE_URL_NOT_OBTAINED: 'Authorization code url cannot be obtained',\r\n TOKEN_NOT_FOUND: 'No token found',\r\n TOKEN_NOT_DECODED: 'Token cannot be decoded',\r\n TOKEN_NOT_VERIFIED: 'Token cannot be verified',\r\n KEYS_NOT_OBTAINED: 'Signing keys cannot be obtained',\r\n STATE_NOT_FOUND: 'State not found',\r\n USER_HAS_NO_ROLE: 'User does not have any roles',\r\n USER_NOT_IN_ROLE: 'User does not have this role',\r\n USER_HAS_NO_GROUP: 'User does not have any groups',\r\n USER_NOT_IN_GROUP: 'User does not have this group',\r\n METHOD_NOT_ALLOWED: 'Method not allowed for this route',\r\n RULE_NOT_FOUND: 'No rule found for this route',\r\n SESSION_NOT_FOUND: 'No session found for this request',\r\n KEY_VAULT_CONFIG_NOT_FOUND: 'No coordinates found for Key Vault',\r\n CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT: 'Cannot obtain credentials from Key Vault',\r\n SESSION_KEY_NOT_FOUND: 'No session key found in session. Cannot encrypt state data',\r\n AUTH_CODE_REQUEST_OBJECT_NOT_FOUND: 'No auth code request object found in session',\r\n ID_TOKEN_CLAIMS_NOT_FOUND: 'No id token claims found in session',\r\n};\r\n\r\n/**\r\n * Various configuration error constants\r\n */\r\nexport const ConfigurationErrorMessages = {\r\n AUTH_ROUTES_NOT_CONFIGURED:\r\n 'Authentication routes are not defined. Ensure that the application settings are configured properly.',\r\n NO_PROTECTED_RESOURCE_CONFIGURED:\r\n 'No protected resource is configured to acquire a token for. Ensure that the application settings are configured properly.',\r\n NO_ACCESS_MATRIX_CONFIGURED:\r\n 'No access matrix is configured to control access for. Ensure that the application settings are configured properly.',\r\n NO_CLIENT_ID: 'No clientId provided!',\r\n INVALID_CLIENT_ID: 'Invalid clientId!',\r\n NO_TENANT_INFO: 'No tenant info provided!',\r\n INVALID_TENANT_INFO: 'Invalid tenant info!',\r\n NO_CLIENT_CREDENTIAL: 'No client credential provided!',\r\n NO_REDIRECT_URI: 'No redirect URI provided!',\r\n NO_UNAUTHORIZED_ROUTE: 'No unauthorized route provided!',\r\n};\r\n\r\n/**\r\n * For more information, visit: https://login.microsoftonline.com/error\r\n */\r\nexport const ErrorCodes = {\r\n 65001: 'AADSTS65001', // consent required\r\n 50076: 'AADSTS50076', // mfa required\r\n 50079: 'AADSTS50079', // mfa enrollment required\r\n 50001: 'AADSTS50001', // invalid resource uri\r\n 65004: 'AADSTS65004', // user declined consent\r\n 70011: 'AADSTS70011', // invalid scope\r\n 700022: 'AADSTS700022', // multiple resources\r\n 700020: 'AADSTS700020', // interaction required\r\n 90118: 'AADB2C90118', // password forgotten (B2C)\r\n};\r\n\r\nexport const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\r\n loggerCallback: (logLevel, message, containsPii) => {\r\n if (containsPii) {\r\n return;\r\n }\r\n console.info(message);\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { LoggerOptions } from '@azure/msal-common';\r\n\r\nexport type AppSettings = {\r\n appCredentials: AppCredentials;\r\n loggerOptions?: LoggerOptions;\r\n b2cPolicies?: Record;\r\n accessMatrix?: Record;\r\n};\r\n\r\nexport type WebAppSettings = AppSettings & {\r\n authRoutes: AuthRoutes;\r\n protectedResources?: Record\r\n};\r\n\r\nexport type AppCredentials = {\r\n instance?: string;\r\n clientId: string;\r\n tenantId: string;\r\n clientSecret?: string;\r\n clientCertificate?: ClientCertificate;\r\n};\r\n\r\nexport type ClientCertificate = {\r\n thumbprint: string;\r\n privateKey: string;\r\n x5c?: string;\r\n};\r\n\r\nexport type KeyVaultCredential = {\r\n credentialType: string;\r\n credentialName: string;\r\n keyVaultUrl: string;\r\n};\r\n\r\nexport type AuthRoutes = {\r\n redirect: string;\r\n unauthorized: string;\r\n frontChannelLogout?: string;\r\n};\r\n\r\nexport type Policy = {\r\n authority: string;\r\n};\r\n\r\nexport type Resource = {\r\n endpoint: string;\r\n scopes: string[];\r\n accessToken?: string;\r\n};\r\n\r\nexport type AccessRule = {\r\n path: string;\r\n methods: string[];\r\n roles?: string[];\r\n groups?: string[];\r\n};\r\n\r\nexport enum AppType {\r\n WebApp\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AADAuthorityConstants, ConfigurationErrorMessages, OIDC_SCOPES } from '../utils/Constants';\r\nimport { AppSettings, AppType, Resource, WebAppSettings } from './AppSettings';\r\n\r\nexport class ConfigHelper {\r\n /**\r\n * Validates the fields in the configuration file\r\n * @param {AppSettings} appSettings: configuration object\r\n * @returns {void}\r\n */\r\n static validateAppSettings(appSettings: AppSettings, appType: AppType): void {\r\n if (StringUtils.isEmpty(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_CLIENT_ID);\r\n } else if (!ConfigHelper.isGuid(appSettings.appCredentials.clientId)) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_CLIENT_ID);\r\n }\r\n\r\n if (StringUtils.isEmpty(appSettings.appCredentials.tenantId)) {\r\n throw new Error(ConfigurationErrorMessages.NO_TENANT_INFO);\r\n } else if (\r\n !ConfigHelper.isGuid(appSettings.appCredentials.tenantId) &&\r\n !Object.values(AADAuthorityConstants).includes(appSettings.appCredentials.tenantId)\r\n ) {\r\n throw new Error(ConfigurationErrorMessages.INVALID_TENANT_INFO);\r\n }\r\n\r\n switch (appType) {\r\n case AppType.WebApp:\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.redirect)) {\r\n throw new Error(ConfigurationErrorMessages.NO_REDIRECT_URI);\r\n }\r\n\r\n if (StringUtils.isEmpty((appSettings).authRoutes?.unauthorized)) {\r\n throw new Error(ConfigurationErrorMessages.NO_UNAUTHORIZED_ROUTE);\r\n }\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Verifies if a string is GUID\r\n * @param {string} guid\r\n * @returns {boolean}\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Util method to get the resource name for a given scope(s)\r\n * @param {Array} scopes: an array of scopes that the resource is associated with\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string {\r\n const index = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).findIndex((resource: Resource) =>\r\n JSON.stringify(resource.scopes.sort()) === JSON.stringify(scopes.sort())\r\n );\r\n\r\n const resourceName = Object.keys({\r\n ...webAppSettings.protectedResources,\r\n })[index];\r\n\r\n return resourceName;\r\n }\r\n\r\n /**\r\n * Util method to get the scopes for a given resource name\r\n * @param {string} resourceEndpoint: the resource name\r\n * @param {AppSettings} appSettings: application authentication parameters\r\n * @returns {string}\r\n */\r\n static getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[] {\r\n const scopes = Object.values({\r\n ...webAppSettings.protectedResources,\r\n }).find((resource: Resource) => resource.endpoint === resourceEndpoint)?.scopes;\r\n\r\n return scopes ? scopes : [];\r\n }\r\n\r\n /**\r\n * Util method to strip the default OIDC scopes from the scopes array\r\n * @param {Array} scopesList full list of scopes for this resource\r\n * @returns\r\n */\r\n static getEffectiveScopes(scopesList: string[]): string[] {\r\n const effectiveScopesList = scopesList.filter(scope => !OIDC_SCOPES.includes(scope));\r\n return effectiveScopesList;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICachePlugin } from '@azure/msal-node';\r\n\r\nimport { ConfigHelper } from '../config/ConfigHelper';\r\nimport { AppSettings, AppType, KeyVaultCredential } from '../config/AppSettings';\r\n\r\nexport abstract class BaseAuthClientBuilder {\r\n appSettings: AppSettings;\r\n protected keyVaultCredential: KeyVaultCredential | undefined;\r\n protected customCachePlugin: ICachePlugin | undefined;\r\n\r\n protected constructor(appSettings: AppSettings, appType: AppType) {\r\n ConfigHelper.validateAppSettings(appSettings, appType);\r\n this.appSettings = appSettings;\r\n }\r\n\r\n withKeyVaultCredentials(keyVaultCredential: KeyVaultCredential): BaseAuthClientBuilder {\r\n this.keyVaultCredential = keyVaultCredential;\r\n return this;\r\n }\r\n\r\n withCustomCachePlugin(cachePlugin: ICachePlugin): BaseAuthClientBuilder {\r\n this.customCachePlugin = cachePlugin;\r\n return this;\r\n }\r\n\r\n abstract build(): any;\r\n\r\n abstract buildAsync(): Promise;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport * as crypto from 'crypto';\r\n\r\nexport class CryptoUtils {\r\n private algorithm: string;\r\n\r\n constructor(algorithm: string = 'aes-192-cbc') {\r\n this.algorithm = algorithm;\r\n }\r\n\r\n generateSalt(): string {\r\n return crypto.randomBytes(20).toString('hex');\r\n }\r\n\r\n createKey(password: string, salt: string): Buffer {\r\n return crypto.scryptSync(password, salt, 24);\r\n }\r\n\r\n encryptData(stringifiedData: string, key: Buffer): string {\r\n const iv = crypto.randomBytes(16);\r\n const cipher = crypto.createCipheriv(this.algorithm, key, iv);\r\n const encryptedData = cipher.update(stringifiedData, 'utf8', 'hex');\r\n\r\n return [iv.toString('hex'), encryptedData + cipher.final('hex')].join('.');\r\n }\r\n\r\n decryptData(encryptedData: string, key: Buffer): string {\r\n const [iv, encrypted] = encryptedData.split('.');\r\n const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(iv, 'hex'));\r\n return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const packageName = '@azure-samples/microsoft-identity-express';\r\nexport const packageVersion = 'beta';\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from '@azure/msal-common';\r\nimport { ConfidentialClientApplication, Configuration, CryptoProvider } from '@azure/msal-node';\r\n\r\nimport { AppSettings } from '../config/AppSettings';\r\nimport { CryptoUtils } from '../utils/CryptoUtils';\r\nimport { packageName, packageVersion } from '../packageMetadata';\r\n\r\nexport abstract class BaseAuthClient {\r\n appSettings: AppSettings;\r\n\r\n protected msalConfig: Configuration;\r\n protected msalClient: ConfidentialClientApplication;\r\n protected cryptoProvider: CryptoProvider;\r\n protected cryptoUtils: CryptoUtils;\r\n protected logger: Logger;\r\n\r\n protected constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n this.appSettings = appSettings;\r\n this.msalConfig = msalConfig;\r\n this.cryptoProvider = new CryptoProvider();\r\n this.cryptoUtils = new CryptoUtils();\r\n\r\n this.logger = new Logger(this.msalConfig.system?.loggerOptions!, packageName, packageVersion);\r\n\r\n this.msalClient = new ConfidentialClientApplication(this.msalConfig);\r\n }\r\n\r\n getMsalClient(): ConfidentialClientApplication {\r\n return this.msalClient;\r\n }\r\n\r\n getMsalConfig(): Configuration {\r\n return this.msalConfig;\r\n }\r\n\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport axios, { AxiosResponse, AxiosRequestConfig } from 'axios';\r\nimport { StringUtils } from '@azure/msal-common';\r\n\r\nimport { AccessControlConstants, ErrorMessages } from '../utils/Constants';\r\n\r\nexport class FetchManager {\r\n /**\r\n * Calls a resource endpoint\r\n * @param {string} endpoint\r\n * @returns {Promise}\r\n */\r\n static callApiEndpoint = async (endpoint: string): Promise => {\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Calls a resource endpoint with a raw access token\r\n * using the authorization bearer token scheme\r\n * @param {string} endpoint\r\n * @param {string} accessToken\r\n * @returns {Promise}\r\n */\r\n static callApiEndpointWithToken = async (endpoint: string, accessToken: string): Promise> => {\r\n if (StringUtils.isEmpty(accessToken)) {\r\n throw new Error(ErrorMessages.TOKEN_NOT_FOUND);\r\n }\r\n\r\n const options: AxiosRequestConfig = {\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n try {\r\n const response: AxiosResponse = await axios.get(endpoint, options);\r\n return response.data;\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n /**\r\n * Handles queries against Microsoft Graph that return multiple pages of data\r\n * @param {string} accessToken: access token required by endpoint\r\n * @param {string} nextPage: next page link\r\n * @param {Array} data: stores data from each page\r\n * @returns {Promise}\r\n */\r\n static handlePagination = async (accessToken: string, nextPage: string, data: string[] = []): Promise => {\r\n try {\r\n const graphResponse = await (await FetchManager.callApiEndpointWithToken(nextPage, accessToken)).data;\r\n graphResponse['value'].map((v: any) => data.push(v.id));\r\n\r\n if (graphResponse[AccessControlConstants.PAGINATION_LINK]) {\r\n return await FetchManager.handlePagination(\r\n accessToken,\r\n graphResponse[AccessControlConstants.PAGINATION_LINK],\r\n data\r\n );\r\n } else {\r\n return data;\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Request } from 'express';\r\nimport { IUri, UrlString } from '@azure/msal-common';\r\n\r\nexport class UrlUtils {\r\n /**\r\n * Gets the absolute URL from a given request and path string\r\n * @param {Request} req: express request object\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static ensureAbsoluteUrl = (req: Request, url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n\r\n if (!urlComponents.Protocol) {\r\n if (!urlComponents.HostNameAndPort && !url.startsWith('www')) {\r\n if (!url.startsWith('/')) {\r\n return req.protocol + '://' + req.get('host') + '/' + url;\r\n }\r\n return req.protocol + '://' + req.get('host') + url;\r\n }\r\n return req.protocol + '://' + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n /**\r\n * Gets the path segment from a given URL\r\n * @param {string} url: a given URL\r\n * @returns {string}\r\n */\r\n static getPathFromUrl = (url: string): string => {\r\n const urlComponents: IUri = new UrlString(url).getUrlComponents();\r\n return `/${urlComponents.PathSegments.join('/')}`;\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { RequestHandler, Request, Response, NextFunction, Router } from 'express';\r\nimport { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, StringUtils, ResponseMode } from '@azure/msal-common';\r\nimport { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node';\r\nimport { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings';\r\nimport { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions';\r\nimport { AppStages, ErrorMessages, AccessControlConstants, ConfigurationErrorMessages } from '../../utils/Constants';\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { FetchManager } from '../../network/FetchManager';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { AppState } from '../../utils/Types';\r\n\r\n/**\r\n * A simple wrapper around MSAL Node ConfidentialClientApplication object.\r\n * It offers a collection of middleware and utility methods that automate\r\n * basic authentication and authorization tasks in Express web apps\r\n */\r\nexport class MsalWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction) => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n next();\r\n });\r\n\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n if (this.webAppSettings.authRoutes.frontChannelLogout) {\r\n /**\r\n * Expose front-channel logout route. For more information, visit:\r\n * https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#single-sign-out\r\n */\r\n appRouter.get(this.webAppSettings.authRoutes.frontChannelLogout, (req: Request, res: Response) => {\r\n req.session.destroy(() => {\r\n res.sendStatus(200);\r\n });\r\n });\r\n }\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): Promise => {\r\n const appState = {\r\n appStage: AppStages.SIGN_IN,\r\n redirectTo: options.postLoginRedirect,\r\n csrfToken: req.session.csrfToken,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n } as AuthorizationCodeRequest;\r\n\r\n // get url to sign user in\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return async (req: Request, res: Response): Promise => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n\r\n /**\r\n * Construct a logout URI and redirect the user to end the\r\n * session with Azure AD/B2C. For more information, visit:\r\n * (AAD) https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc#send-a-sign-out-request\r\n * (B2C) https://docs.microsoft.com/azure/active-directory-b2c/openid-connect#send-a-sign-out-request\r\n */\r\n const logoutUri = `${this.msalConfig.auth.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${postLogoutRedirectUri}`;\r\n\r\n const tokenCache = this.msalClient.getTokenCache();\r\n\r\n const account = req.session.account?.homeAccountId\r\n ?\r\n await tokenCache.getAccountByHomeId(req.session.account.homeAccountId)\r\n :\r\n await tokenCache.getAccountByLocalId(req.session.account?.localAccountId!);\r\n\r\n if (account) {\r\n await tokenCache.removeAccount(account);\r\n }\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!req.session.key) {\r\n this.logger.error(ErrorMessages.SESSION_KEY_NOT_FOUND);\r\n return next(new Error(ErrorMessages.SESSION_KEY_NOT_FOUND));\r\n }\r\n\r\n if (!req.session.authorizationCodeRequest) {\r\n this.logger.error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND);\r\n return next(new Error(ErrorMessages.AUTH_CODE_REQUEST_OBJECT_NOT_FOUND));\r\n }\r\n\r\n if (req.body.state) {\r\n const state: AppState = JSON.parse(\r\n this.cryptoUtils.decryptData(\r\n this.cryptoProvider.base64Decode(req.body.state as string),\r\n Buffer.from(req.session.key, 'hex')\r\n )\r\n );\r\n\r\n // check if csrfToken matches\r\n if (state.csrfToken === req.session.csrfToken) {\r\n switch (state.appStage) {\r\n case AppStages.SIGN_IN: {\r\n // token request should have auth code\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n // exchange auth code for tokens\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.isAuthenticated = true;\r\n req.session.account = tokenResponse.account!; // this won't be null in any web app scenario\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n case AppStages.ACQUIRE_TOKEN: {\r\n // get the name of the resource associated with scope\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(\r\n req.session.authorizationCodeRequest.scopes,\r\n this.webAppSettings\r\n );\r\n\r\n req.session.authorizationCodeRequest.code = req.body.code as string;\r\n\r\n try {\r\n const tokenResponse = await this.msalClient.acquireTokenByCode(\r\n req.session.authorizationCodeRequest\r\n );\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n accessToken: tokenResponse.accessToken,\r\n } as Resource,\r\n };\r\n\r\n res.redirect(state.redirectTo);\r\n } catch (error) {\r\n next(error);\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n next(new Error(ErrorMessages.CANNOT_DETERMINE_APP_STAGE));\r\n break;\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens via acquireToken*\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const scopes = options.resource.scopes;\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n try {\r\n const silentRequest = {\r\n account: req.session.account,\r\n scopes: scopes,\r\n } as SilentFlowRequest;\r\n\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse || StringUtils.isEmpty(tokenResponse.accessToken)) {\r\n // In B2C scenarios, sometimes an access token is returned empty.\r\n // In that case, we will acquire token interactively instead.\r\n\r\n throw new InteractionRequiredAuthError(ErrorMessages.INTERACTION_REQUIRED);\r\n }\r\n\r\n req.session.protectedResources[resourceName].accessToken = tokenResponse.accessToken;\r\n next();\r\n } catch (error) {\r\n // in case there are no cached tokens, initiate an interactive call\r\n if (error instanceof InteractionRequiredAuthError) {\r\n const appState = {\r\n appStage: AppStages.ACQUIRE_TOKEN,\r\n redirectTo: req.originalUrl,\r\n } as AppState;\r\n\r\n const authUrlParams = {\r\n scopes: scopes,\r\n } as AuthorizationUrlRequest;\r\n\r\n const authCodeParams = {\r\n scopes: scopes,\r\n } as AuthorizationCodeRequest;\r\n\r\n // initiate the first leg of auth code grant to get token\r\n return this.redirectToAuthCodeUrl(req, res, next, authUrlParams, authCodeParams, appState);\r\n } else {\r\n next(error);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Checks if the user has access for this route, defined in access matrix\r\n * @param {GuardOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n hasAccess(options: GuardOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n if (!this.webAppSettings.accessMatrix) {\r\n this.logger.error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_ACCESS_MATRIX_CONFIGURED));\r\n }\r\n\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const checkFor = options.accessRule.hasOwnProperty(AccessControlConstants.GROUPS)\r\n ? AccessControlConstants.GROUPS\r\n : AccessControlConstants.ROLES;\r\n\r\n switch (checkFor) {\r\n case AccessControlConstants.GROUPS:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.GROUPS]) {\r\n if (\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_NAMES] ||\r\n req.session.account.idTokenClaims[AccessControlConstants.CLAIM_SOURCES]\r\n ) {\r\n return await this.handleOverage(req, res, next, options.accessRule);\r\n } else {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n } else {\r\n const groups = req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, groups, AccessControlConstants.GROUPS)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!req.session.account.idTokenClaims[AccessControlConstants.ROLES]) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n const roles = req.session.account.idTokenClaims[AccessControlConstants.ROLES] as string[];\r\n\r\n if (\r\n !this.checkAccessRule(req.method, options.accessRule, roles, AccessControlConstants.ROLES)\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n }\r\n\r\n next();\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n };\r\n }\r\n\r\n // ============== UTILS ===============\r\n\r\n /**\r\n * This method is used to generate an auth code url request\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AuthCodeParams} params: modifies auth code url request\r\n * @returns {Promise}\r\n */\r\n private async redirectToAuthCodeUrl(\r\n req: Request,\r\n res: Response,\r\n next: NextFunction,\r\n authUrlParams: AuthorizationUrlRequest,\r\n authCodeParams: AuthorizationCodeRequest,\r\n appState: AppState\r\n ): Promise {\r\n // add session csrfToken for crsf\r\n req.session.csrfToken = this.cryptoProvider.createNewGuid();\r\n\r\n const key = this.cryptoUtils.createKey(req.session.csrfToken, this.cryptoUtils.generateSalt());\r\n req.session.key = key.toString('hex');\r\n\r\n const state = JSON.stringify({\r\n ...appState,\r\n csrfToken: req.session.csrfToken,\r\n });\r\n\r\n // prepare the request\r\n req.session.authorizationUrlRequest = {\r\n ...authUrlParams,\r\n state: this.cryptoProvider.base64Encode(this.cryptoUtils.encryptData(state, key)),\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n responseMode: ResponseMode.FORM_POST\r\n };\r\n\r\n req.session.authorizationCodeRequest = {\r\n ...authCodeParams,\r\n redirectUri: UrlUtils.ensureAbsoluteUrl(req, this.webAppSettings.authRoutes.redirect),\r\n code: ''\r\n };\r\n\r\n // request an authorization code to exchange for tokens\r\n try {\r\n const response = await this.msalClient.getAuthCodeUrl(req.session.authorizationUrlRequest);\r\n res.redirect(response);\r\n } catch (error) {\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles group overage claims by querying MS Graph /memberOf endpoint\r\n * @param {Request} req: express request object\r\n * @param {Response} res: express response object\r\n * @param {NextFunction} next: express next function\r\n * @param {AccessRule} rule: a given access rule\r\n * @returns {Promise}\r\n */\r\n private async handleOverage(req: Request, res: Response, next: NextFunction, rule: AccessRule): Promise {\r\n if (!req.session.account?.idTokenClaims) {\r\n this.logger.error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND);\r\n return next(new Error(ErrorMessages.ID_TOKEN_CLAIMS_NOT_FOUND));\r\n }\r\n\r\n const { _claim_names, _claim_sources, ...newIdTokenClaims } = req.session.account.idTokenClaims;\r\n\r\n const silentRequest: SilentFlowRequest = {\r\n account: req.session.account,\r\n scopes: AccessControlConstants.GRAPH_MEMBER_SCOPES.split(' '),\r\n };\r\n\r\n try {\r\n // acquire token silently to be used in resource call\r\n const tokenResponse = await this.msalClient.acquireTokenSilent(silentRequest);\r\n\r\n if (!tokenResponse) return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n\r\n try {\r\n const graphResponse = await FetchManager.callApiEndpointWithToken(\r\n AccessControlConstants.GRAPH_MEMBERS_ENDPOINT,\r\n tokenResponse.accessToken\r\n );\r\n\r\n /**\r\n * Some queries against Microsoft Graph return multiple pages of data either due to server-side paging\r\n * or due to the use of the $top query parameter to specifically limit the page size in a request.\r\n * When a result set spans multiple pages, Microsoft Graph returns an @odata.nextLink property in\r\n * the response that contains a URL to the next page of results. Learn more at https://docs.microsoft.com/graph/paging\r\n */\r\n if (graphResponse.data[AccessControlConstants.PAGINATION_LINK]) {\r\n try {\r\n const userGroups = await FetchManager.handlePagination(\r\n tokenResponse.accessToken,\r\n graphResponse.data[AccessControlConstants.PAGINATION_LINK]\r\n );\r\n\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: userGroups,\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } else {\r\n req.session.account.idTokenClaims = {\r\n ...newIdTokenClaims,\r\n groups: graphResponse.data['value'].map((v: any) => v.id),\r\n };\r\n\r\n if (\r\n !this.checkAccessRule(\r\n req.method,\r\n rule,\r\n req.session.account.idTokenClaims[AccessControlConstants.GROUPS] as string[],\r\n AccessControlConstants.GROUPS\r\n )\r\n ) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n } else {\r\n return next();\r\n }\r\n }\r\n } catch (error) {\r\n next(error);\r\n }\r\n } catch (error) {\r\n // TODO: handle silent token acquisition error\r\n next(error);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the request passes a given access rule\r\n * @param {string} method: HTTP method for this route\r\n * @param {AccessRule} rule: access rule for this route\r\n * @param {Array} creds: user's credentials i.e. roles or groups\r\n * @param {string} credType: roles or groups\r\n * @returns {boolean}\r\n */\r\n private checkAccessRule(method: string, rule: AccessRule, creds: string[], credType: string): boolean {\r\n if (rule.methods.includes(method)) {\r\n switch (credType) {\r\n case AccessControlConstants.GROUPS:\r\n if (!rule.groups || rule.groups.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n case AccessControlConstants.ROLES:\r\n if (!rule.roles || rule.roles!.filter(elem => creds.includes(elem)).length < 1) {\r\n return false;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport express, { Router, RequestHandler, Request, Response, NextFunction } from 'express';\r\nimport { AccountInfo, AuthToken } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClient } from '../BaseAuthClient';\r\nimport { AccessTokenClaims, IdTokenClaims } from '../../utils/Types';\r\nimport { AppSettings, Resource, WebAppSettings } from '../../config/AppSettings';\r\nimport { ConfigHelper } from '../../config/ConfigHelper';\r\nimport { UrlUtils } from '../../utils/UrlUtils';\r\nimport { SignInOptions, SignOutOptions, TokenRequestOptions } from '../MiddlewareOptions';\r\nimport {\r\n AppServiceAuthenticationHeaders,\r\n AppServiceEnvironmentVariables,\r\n AppServiceAuthenticationEndpoints,\r\n AppServiceAuthenticationQueryParameters,\r\n ErrorMessages,\r\n ConfigurationErrorMessages,\r\n} from '../../utils/Constants';\r\n\r\nexport class AppServiceWebAppAuthClient extends BaseAuthClient {\r\n\r\n webAppSettings: WebAppSettings;\r\n\r\n /**\r\n * @param {AppSettings} appSettings\r\n * @param {Configuration} msalConfig\r\n * @constructor\r\n */\r\n constructor(appSettings: AppSettings, msalConfig: Configuration) {\r\n super(appSettings, msalConfig);\r\n this.webAppSettings = appSettings as WebAppSettings;\r\n }\r\n\r\n /**\r\n * Initialize AuthProvider and set default routes and handlers\r\n * @param {InitializationOptions} options\r\n * @returns {Router}\r\n */\r\n initialize(): Router {\r\n const appRouter = express.Router();\r\n\r\n // handle redirect\r\n appRouter.get(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n appRouter.post(UrlUtils.getPathFromUrl(this.webAppSettings.authRoutes.redirect), this.handleRedirect());\r\n\r\n appRouter.use((req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session) {\r\n this.logger.error(ErrorMessages.SESSION_NOT_FOUND);\r\n throw new Error(ErrorMessages.SESSION_NOT_FOUND);\r\n }\r\n\r\n if (!req.session.isAuthenticated) {\r\n // check headers for id token\r\n const rawIdToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ID_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawIdToken) {\r\n // parse the id token\r\n const idTokenClaims: IdTokenClaims = AuthToken.extractTokenClaims(rawIdToken, this.cryptoProvider);\r\n\r\n req.session.isAuthenticated = true;\r\n\r\n req.session.account = {\r\n tenantId: idTokenClaims.tid,\r\n homeAccountId: idTokenClaims.oid + '.' + idTokenClaims.tid,\r\n localAccountId: idTokenClaims.oid,\r\n environment: idTokenClaims.iss?.split('://')[1].split('/')[0],\r\n username: idTokenClaims.preferred_username,\r\n name: idTokenClaims.name,\r\n idTokenClaims: idTokenClaims,\r\n } as AccountInfo;\r\n }\r\n }\r\n\r\n next();\r\n });\r\n\r\n return appRouter;\r\n }\r\n\r\n /**\r\n * Initiates sign in flow\r\n * @param {SignInOptions} options: options to modify login request\r\n * @returns {RequestHandler}\r\n */\r\n signIn(\r\n options: SignInOptions = {\r\n postLoginRedirect: '/',\r\n failureRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n let loginUri;\r\n const postLoginRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLoginRedirect);\r\n loginUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_IN_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGIN_REDIRECT_QUERY_PARAM +\r\n postLoginRedirectUri;\r\n res.redirect(loginUri);\r\n };\r\n }\r\n\r\n /**\r\n * Initiate sign out and destroy the session\r\n * @param {SignOutOptions} options: options to modify logout request\r\n * @returns {RequestHandler}\r\n */\r\n signOut(\r\n options: SignOutOptions = {\r\n postLogoutRedirect: '/',\r\n }\r\n ): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n const postLogoutRedirectUri = UrlUtils.ensureAbsoluteUrl(req, options.postLogoutRedirect);\r\n const logoutUri =\r\n 'https://' +\r\n process.env[AppServiceEnvironmentVariables.WEBSITE_HOSTNAME] +\r\n AppServiceAuthenticationEndpoints.AAD_SIGN_OUT_ENDPOINT +\r\n AppServiceAuthenticationQueryParameters.POST_LOGOUT_REDIRECT_QUERY_PARAM +\r\n postLogoutRedirectUri;\r\n\r\n req.session.destroy(() => {\r\n res.redirect(logoutUri);\r\n });\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that handles redirect depending on request state\r\n * There are basically 2 stages: sign-in and acquire token\r\n * @returns {RequestHandler}\r\n */\r\n private handleRedirect(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n next();\r\n };\r\n }\r\n\r\n /**\r\n * Middleware that gets tokens\r\n * @param {TokenRequestOptions} options: options to modify this middleware\r\n * @returns {RequestHandler}\r\n */\r\n getToken(options: TokenRequestOptions): RequestHandler {\r\n return async (req: Request, res: Response, next: NextFunction): Promise => {\r\n\r\n if (!this.webAppSettings.protectedResources) {\r\n this.logger.error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED);\r\n return next(new Error(ConfigurationErrorMessages.NO_PROTECTED_RESOURCE_CONFIGURED));\r\n }\r\n\r\n // get scopes for token request\r\n const resourceName = ConfigHelper.getResourceNameFromScopes(options.resource.scopes, this.webAppSettings);\r\n\r\n req.session.protectedResources = {\r\n [resourceName]: {\r\n ...this.webAppSettings.protectedResources[resourceName],\r\n accessToken: undefined,\r\n } as Resource,\r\n };\r\n\r\n const rawAccessToken = req.headers[\r\n AppServiceAuthenticationHeaders.APP_SERVICE_ACCESS_TOKEN_HEADER.toLowerCase()\r\n ] as string;\r\n\r\n if (rawAccessToken) {\r\n const accessTokenClaims = AuthToken.extractTokenClaims(\r\n rawAccessToken,\r\n this.cryptoProvider\r\n ) as AccessTokenClaims;\r\n\r\n // get the name of the resource associated with scope\r\n const scopes = accessTokenClaims?.scp.split(' ');\r\n const effectiveScopes = ConfigHelper.getEffectiveScopes(scopes);\r\n\r\n if (options.resource.scopes.every(elem => effectiveScopes.includes(elem))) {\r\n req.session.protectedResources[resourceName].accessToken = rawAccessToken;\r\n return next();\r\n } else {\r\n return next(new Error('No tokens found for given scopes'));\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Check if authenticated in session\r\n * @returns {RequestHandler}\r\n */\r\n isAuthenticated(): RequestHandler {\r\n return (req: Request, res: Response, next: NextFunction): void => {\r\n if (!req.session.isAuthenticated) {\r\n return res.redirect(this.webAppSettings.authRoutes.unauthorized);\r\n }\r\n\r\n next();\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DefaultAzureCredential } from '@azure/identity';\r\nimport { CertificateClient, KeyVaultCertificate } from '@azure/keyvault-certificates';\r\nimport { KeyVaultSecret, SecretClient } from '@azure/keyvault-secrets';\r\n\r\nimport { KeyVaultCredential, ClientCertificate } from '../config/AppSettings';\r\nimport { KeyVaultCredentialTypes } from '../utils/Constants';\r\n\r\nexport type KeyVaultCredentialResponse = {\r\n type: KeyVaultCredentialTypes.SECRET | KeyVaultCredentialTypes.CERTIFICATE;\r\n value: string & ClientCertificate;\r\n};\r\n\r\nexport class KeyVaultManager {\r\n /**\r\n * Fetches credentials from Key Vault and updates appSettings\r\n * @param {AppSettings} appSettings\r\n * @returns {Promise}\r\n */\r\n async getCredentialFromKeyVault(keyVaultCredential: KeyVaultCredential): Promise {\r\n const credential = new DefaultAzureCredential();\r\n let response: KeyVaultCredentialResponse = {} as KeyVaultCredentialResponse;\r\n\r\n switch (keyVaultCredential.credentialType) {\r\n case KeyVaultCredentialTypes.SECRET: {\r\n try {\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.SECRET,\r\n value: secretResponse.value,\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n case KeyVaultCredentialTypes.CERTIFICATE: {\r\n try {\r\n const certificateResponse = await this.getCertificateCredential(keyVaultCredential, credential);\r\n const secretResponse = await this.getSecretCredential(keyVaultCredential, credential);\r\n\r\n response = {\r\n type: KeyVaultCredentialTypes.CERTIFICATE,\r\n value: {\r\n thumbprint: certificateResponse?.properties?.x509Thumbprint?.toString(),\r\n privateKey: secretResponse?.value?.split('-----BEGIN CERTIFICATE-----\\n')[0],\r\n },\r\n } as KeyVaultCredentialResponse;\r\n } catch (error) {\r\n throw error;\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Gets a certificate credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getCertificateCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new CertificateClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultCertificate = await secretClient.getCertificate(keyVaultCredential.credentialName);\r\n return keyVaultCertificate;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a secret credential from Key Vault\r\n * @param {AppSettings} config\r\n * @param {DefaultAzureCredential} credential\r\n * @returns {Promise}\r\n */\r\n async getSecretCredential(\r\n keyVaultCredential: KeyVaultCredential,\r\n credential: DefaultAzureCredential\r\n ): Promise {\r\n // Initialize secretClient with credentials\r\n const secretClient = new SecretClient(keyVaultCredential.keyVaultUrl, credential);\r\n\r\n try {\r\n const keyVaultSecret = await secretClient.getSecret(keyVaultCredential.credentialName);\r\n return keyVaultSecret;\r\n } catch (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { UrlString, Constants } from '@azure/msal-common';\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { DEFAULT_LOGGER_OPTIONS } from '../utils/Constants';\r\nimport { AppSettings } from './AppSettings';\r\n\r\nexport class MsalConfiguration {\r\n /**\r\n * Maps the custom configuration object to configuration\r\n * object expected by MSAL Node ConfidentialClientApplication class\r\n * @param {AppSettings} appSettings: configuration object\r\n * @param {ICachePlugin} cachePlugin: custom cache plugin\r\n * @param {IDistributedPersistence} distributedPersistence: distributed persistence client\r\n * @returns {Configuration}\r\n */\r\n static getMsalConfiguration(appSettings: AppSettings): Configuration {\r\n return {\r\n auth: {\r\n clientId: appSettings.appCredentials.clientId,\r\n authority: appSettings.b2cPolicies\r\n ? Object.entries(appSettings.b2cPolicies)[0][1]['authority'] // the first policy/user-flow is the default authority\r\n : appSettings.appCredentials.instance\r\n ? `https://${appSettings.appCredentials.instance}/${appSettings.appCredentials.tenantId}`\r\n : `https://${Constants.DEFAULT_AUTHORITY_HOST}/${appSettings.appCredentials.tenantId}`,\r\n ...(appSettings.appCredentials.hasOwnProperty('clientSecret') && {\r\n clientSecret: appSettings.appCredentials.clientSecret,\r\n }),\r\n ...(appSettings.appCredentials.hasOwnProperty('clientCertificate') && {\r\n clientCertificate: appSettings.appCredentials.clientCertificate,\r\n }),\r\n knownAuthorities: appSettings.b2cPolicies\r\n ? [UrlString.getDomainFromUrl(Object.entries(appSettings.b2cPolicies)[0][1]['authority'])] // in B2C scenarios\r\n : [],\r\n },\r\n system: {\r\n loggerOptions: appSettings.loggerOptions ? appSettings.loggerOptions : DEFAULT_LOGGER_OPTIONS,\r\n },\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AppServiceEnvironmentVariables } from './Constants';\r\n\r\nexport class EnvironmentUtils {\r\n static isProduction(): boolean {\r\n return process.env.NODE_ENV === 'production';\r\n }\r\n\r\n static isDevelopment(): boolean {\r\n return process.env.NODE_ENV === 'development';\r\n }\r\n\r\n static isAppServiceAuthEnabled(): boolean {\r\n return process.env[AppServiceEnvironmentVariables.WEBSITE_AUTH_ENABLED] === 'True';\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Configuration } from '@azure/msal-node';\r\n\r\nimport { BaseAuthClientBuilder } from '../BaseAuthClientBuilder';\r\nimport { MsalWebAppAuthClient } from './MsalWebAppAuthClient';\r\nimport { AppServiceWebAppAuthClient } from './AppServiceWebAppAuthClient';\r\nimport { KeyVaultManager } from '../../network/KeyVaultManager';\r\nimport { MsalConfiguration } from '../../config/MsalConfiguration';\r\nimport { AppSettings, AppType } from '../../config/AppSettings';\r\nimport { EnvironmentUtils } from '../../utils/EnvironmentUtils';\r\nimport { ErrorMessages } from '../../utils/Constants';\r\n\r\nexport class WebAppAuthClientBuilder extends BaseAuthClientBuilder {\r\n appSettings!: AppSettings;\r\n private msalConfig!: Configuration;\r\n\r\n constructor(appSettings: AppSettings) {\r\n super(appSettings, AppType.WebApp);\r\n }\r\n\r\n build(): MsalWebAppAuthClient | AppServiceWebAppAuthClient {\r\n // TODO: throw error if key vault credential is being built\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n }\r\n\r\n async buildAsync(): Promise {\r\n try {\r\n if (this.keyVaultCredential) {\r\n const keyVaultManager = new KeyVaultManager();\r\n const credential = await keyVaultManager.getCredentialFromKeyVault(this.keyVaultCredential);\r\n this.appSettings.appCredentials[credential.type] = credential.value;\r\n }\r\n\r\n this.msalConfig = MsalConfiguration.getMsalConfiguration(this.appSettings);\r\n\r\n if (EnvironmentUtils.isAppServiceAuthEnabled()) {\r\n return new AppServiceWebAppAuthClient(this.appSettings, this.msalConfig);\r\n } else {\r\n return new MsalWebAppAuthClient(this.appSettings, this.msalConfig);\r\n }\r\n } catch (error) {\r\n throw new Error(ErrorMessages.CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT);\r\n }\r\n }\r\n}\r\n"],"names":["undefined","AppStages","AADAuthorityConstants","COMMON","ORGANIZATIONS","CONSUMERS","KeyVaultCredentialTypes","OIDC_SCOPES","AppServiceAuthenticationHeaders","APP_SERVICE_AUTHENTICATION_HEADER","APP_SERVICE_ACCESS_TOKEN_HEADER","APP_SERVICE_ID_TOKEN_HEADER","APP_SERVICE_REFRESH_TOKEN_HEADER","APP_SERVICE_ACCESS_TOKEN_EXPIRES_HEADER","APP_SERVICE_USER_OID_HEADER","APP_SERVICE_USER_UPN_HEADER","APP_SERVICE_IDP_X_HEADER","AppServiceAuthenticationEndpoints","ID_TOKEN_ENDPOINT","POST_LOGOUT_DEFAULT_ENDPOINT","POST_LOGIN_DEFAULT_ENDPOINT","AAD_SIGN_IN_ENDPOINT","AAD_SIGN_OUT_ENDPOINT","TOKEN_REFRESH_ENDPOINT","AAD_REDIRECT_ENDPOINT","AppServiceAuthenticationQueryParameters","POST_LOGIN_REDIRECT_QUERY_PARAM","POST_LOGOUT_REDIRECT_QUERY_PARAM","AppServiceEnvironmentVariables","WEBSITE_AUTH_ENABLED","WEBSITE_AUTH_ALLOWED_AUDIENCES","WEBSITE_AUTH_DEFAULT_PROVIDER","WEBSITE_AUTH_TOKEN_STORE","WEBSITE_AUTH_LOGIN_PARAMS","WEBSITE_AUTH_PRESERVE_URL_FRAGMENT","WEBSITE_AUTH_OPENID_ISSUER","WEBSITE_AUTH_CLIENT_ID","WEBSITE_HOSTNAME","WEBSITE_SITE_NAME","WEBSITE_AUTH_REQUIRE_HTTPS","WEBSITE_AUTH_UNAUTHENTICATED_ACTION","WEBSITE_AUTH_API_PREFIX","MICROSOFT_PROVIDER_AUTHENTICATION_SECRET","AccessControlConstants","GROUPS","ROLES","CLAIM_NAMES","CLAIM_SOURCES","PAGINATION_LINK","GRAPH_MEMBERS_ENDPOINT","GRAPH_MEMBER_SCOPES","ErrorMessages","NOT_PERMITTED","INVALID_TOKEN","CANNOT_DETERMINE_APP_STAGE","CANNOT_VALIDATE_TOKEN","CSRF_TOKEN_MISMATCH","INTERACTION_REQUIRED","TOKEN_ACQUISITION_FAILED","TOKEN_RESPONSE_NULL","AUTH_CODE_URL_NOT_OBTAINED","TOKEN_NOT_FOUND","TOKEN_NOT_DECODED","TOKEN_NOT_VERIFIED","KEYS_NOT_OBTAINED","STATE_NOT_FOUND","USER_HAS_NO_ROLE","USER_NOT_IN_ROLE","USER_HAS_NO_GROUP","USER_NOT_IN_GROUP","METHOD_NOT_ALLOWED","RULE_NOT_FOUND","SESSION_NOT_FOUND","KEY_VAULT_CONFIG_NOT_FOUND","CANNOT_OBTAIN_CREDENTIALS_FROM_KEY_VAULT","SESSION_KEY_NOT_FOUND","AUTH_CODE_REQUEST_OBJECT_NOT_FOUND","ID_TOKEN_CLAIMS_NOT_FOUND","ConfigurationErrorMessages","AUTH_ROUTES_NOT_CONFIGURED","NO_PROTECTED_RESOURCE_CONFIGURED","NO_ACCESS_MATRIX_CONFIGURED","NO_CLIENT_ID","INVALID_CLIENT_ID","NO_TENANT_INFO","INVALID_TENANT_INFO","NO_CLIENT_CREDENTIAL","NO_REDIRECT_URI","NO_UNAUTHORIZED_ROUTE","DEFAULT_LOGGER_OPTIONS","loggerCallback","logLevel","message","containsPii","console","info","piiLoggingEnabled","LogLevel","Info","AppType","ConfigHelper","validateAppSettings","appSettings","appType","StringUtils","isEmpty","appCredentials","clientId","Error","isGuid","tenantId","Object","values","includes","WebApp","authRoutes","redirect","unauthorized","guid","regexGuid","test","getResourceNameFromScopes","scopes","webAppSettings","index","protectedResources","findIndex","resource","JSON","stringify","sort","resourceName","keys","getScopesFromResourceEndpoint","resourceEndpoint","find","endpoint","getEffectiveScopes","scopesList","effectiveScopesList","filter","scope","BaseAuthClientBuilder","withKeyVaultCredentials","keyVaultCredential","withCustomCachePlugin","cachePlugin","customCachePlugin","CryptoUtils","algorithm","generateSalt","crypto","toString","createKey","password","salt","encryptData","stringifiedData","key","iv","cipher","encryptedData","update","join","decryptData","split","encrypted","decipher","Buffer","from","packageName","packageVersion","BaseAuthClient","msalConfig","cryptoProvider","CryptoProvider","cryptoUtils","logger","Logger","system","loggerOptions","msalClient","ConfidentialClientApplication","getMsalClient","getMsalConfig","getLogger","FetchManager","axios","get","response","data","accessToken","options","headers","Authorization","nextPage","callApiEndpointWithToken","graphResponse","map","v","push","id","handlePagination","UrlUtils","req","url","urlComponents","UrlString","getUrlComponents","Protocol","HostNameAndPort","startsWith","protocol","PathSegments","MsalWebAppAuthClient","initialize","appRouter","express","Router","use","res","next","session","error","post","getPathFromUrl","handleRedirect","frontChannelLogout","destroy","sendStatus","signIn","postLoginRedirect","failureRedirect","appState","appStage","SIGN_IN","redirectTo","csrfToken","authUrlParams","OIDC_DEFAULT_SCOPES","authCodeParams","redirectToAuthCodeUrl","signOut","postLogoutRedirect","postLogoutRedirectUri","ensureAbsoluteUrl","logoutUri","auth","authority","tokenCache","getTokenCache","account","homeAccountId","getAccountByHomeId","getAccountByLocalId","localAccountId","removeAccount","authorizationCodeRequest","body","state","parse","base64Decode","ACQUIRE_TOKEN","code","acquireTokenByCode","tokenResponse","isAuthenticated","getToken","silentRequest","acquireTokenSilent","InteractionRequiredAuthError","originalUrl","hasAccess","accessMatrix","idTokenClaims","checkFor","accessRule","hasOwnProperty","handleOverage","groups","checkAccessRule","method","roles","createNewGuid","authorizationUrlRequest","base64Encode","redirectUri","responseMode","ResponseMode","FORM_POST","getAuthCodeUrl","rule","_claim_names","newIdTokenClaims","userGroups","creds","credType","methods","elem","length","AppServiceWebAppAuthClient","rawIdToken","toLowerCase","AuthToken","extractTokenClaims","tid","oid","environment","iss","username","preferred_username","name","loginUri","postLoginRedirectUri","process","env","rawAccessToken","accessTokenClaims","scp","effectiveScopes","every","KeyVaultManager","getCredentialFromKeyVault","credential","DefaultAzureCredential","credentialType","SECRET","CERTIFICATE","getSecretCredential","secretResponse","type","value","getCertificateCredential","certificateResponse","thumbprint","properties","x509Thumbprint","privateKey","secretClient","CertificateClient","keyVaultUrl","getCertificate","credentialName","keyVaultCertificate","SecretClient","getSecret","keyVaultSecret","MsalConfiguration","getMsalConfiguration","b2cPolicies","entries","instance","Constants","DEFAULT_AUTHORITY_HOST","clientSecret","clientCertificate","knownAuthorities","getDomainFromUrl","EnvironmentUtils","isProduction","NODE_ENV","isDevelopment","isAppServiceAuthEnabled","WebAppAuthClientBuilder","build","buildAsync","keyVaultManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AACjC,EAAE,IAAIA,WAAS,CAAC;AAChB,EAAE,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE,CAAC;AAC3D,EAAE,IAAI,cAAc,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY,CAAC;AACxD,EAAE,IAAI,mBAAmB,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAiB,CAAC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100644 --- a/docs/classes/AppServiceWebAppAuthClient.html +++ b/docs/classes/AppServiceWebAppAuthClient.html @@ -1,14 +1,14 @@ -AppServiceWebAppAuthClient | microsoft-identity-express
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BaseAuthClient
    • AppServiceWebAppAuthClient

Index

Constructors

Properties

appSettings: AppSettings
cryptoProvider: CryptoProvider
cryptoUtils: CryptoUtils
logger: Logger
msalClient: ConfidentialClientApplication
msalConfig: Configuration
webAppSettings: WebAppSettings

Methods

  • getLogger(): Logger
  • getMsalClient(): ConfidentialClientApplication
  • getMsalConfig(): Configuration
  • getToken(options: TokenRequestOptions): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
  • +AppServiceWebAppAuthClient | microsoft-identity-express
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • BaseAuthClient
      • AppServiceWebAppAuthClient

    Index

    Constructors

    Properties

    appSettings: AppSettings
    cryptoProvider: CryptoProvider
    cryptoUtils: CryptoUtils
    logger: Logger
    msalClient: ConfidentialClientApplication
    msalConfig: Configuration
    webAppSettings: WebAppSettings

    Methods

    • getLogger(): Logger
    • getMsalClient(): ConfidentialClientApplication
    • getMsalConfig(): Configuration
    • getToken(options: TokenRequestOptions): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • handleRedirect(): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • handleRedirect(): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • Middleware that handles redirect depending on request state There are basically 2 stages: sign-in and acquire token

      -

      Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

    • initialize(): Router
    • initialize(): Router
    • isAuthenticated(): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • isAuthenticated(): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • signIn(options?: SignInOptions): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • signIn(options?: SignInOptions): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • signOut(options?: SignOutOptions): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • signOut(options?: SignOutOptions): RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

    Legend

    • Constructor
    • Property
    • Method
    • Inherited property
    • Inherited method
    • Private property
    • Private method
    • Static method

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/ConfigHelper.html b/docs/classes/ConfigHelper.html index c0bd9c4..ddc56fd 100644 --- a/docs/classes/ConfigHelper.html +++ b/docs/classes/ConfigHelper.html @@ -1,13 +1,13 @@ -ConfigHelper | microsoft-identity-express
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • ConfigHelper

    Index

    Constructors

    Methods

    • getEffectiveScopes(scopesList: string[]): string[]
    • getResourceNameFromScopes(scopes: string[], webAppSettings: WebAppSettings): string
    • getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[]
    • getScopesFromResourceEndpoint(resourceEndpoint: string, webAppSettings: WebAppSettings): string[]
    • isGuid(guid: string): boolean
    • isGuid(guid: string): boolean
    • validateAppSettings(appSettings: AppSettings, appType: WebApp): void
    • validateAppSettings(appSettings: AppSettings, appType: WebApp): void

    Legend

    • Constructor
    • Property
    • Method
    • Inherited property
    • Inherited method
    • Private property
    • Private method
    • Static method

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/FetchManager.html b/docs/classes/FetchManager.html index ad6cc18..787766b 100644 --- a/docs/classes/FetchManager.html +++ b/docs/classes/FetchManager.html @@ -1,8 +1,8 @@ -FetchManager | microsoft-identity-express
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • FetchManager

    Index

    Constructors

    Methods

    • callApiEndpoint(endpoint: string): Promise<AxiosResponse<any, any>>
    • +FetchManager | microsoft-identity-express
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Hierarchy

      • FetchManager

      Index

      Constructors

      Methods

      • callApiEndpoint(endpoint: string): Promise<AxiosResponse<any, any>>
      • Calls a resource endpoint

        -

        Parameters

        • endpoint: string

        Returns Promise<AxiosResponse<any, any>>

      • callApiEndpointWithToken(endpoint: string, accessToken: string): Promise<AxiosResponse<any, any>>
      • callApiEndpointWithToken(endpoint: string, accessToken: string): Promise<AxiosResponse<any, any>>
      • Calls a resource endpoint with a raw access token using the authorization bearer token scheme

        -

        Parameters

        • endpoint: string
        • accessToken: string

        Returns Promise<AxiosResponse<any, any>>

      • handlePagination(accessToken: string, nextPage: string, data?: string[]): Promise<string[]>
      • handlePagination(accessToken: string, nextPage: string, data?: string[]): Promise<string[]>
      • Handles queries against Microsoft Graph that return multiple pages of data

        Parameters

        • accessToken: string
        • nextPage: string
        • data: string[] = []

        Returns Promise<string[]>

      Legend

      • Constructor
      • Property
      • Method
      • Inherited property
      • Inherited method
      • Private property
      • Private method
      • Static method

      Settings

      Theme

      Generated using TypeDoc

      \ No newline at end of file diff --git a/docs/classes/KeyVaultManager.html b/docs/classes/KeyVaultManager.html index 5d3bec3..9ec8e53 100644 --- a/docs/classes/KeyVaultManager.html +++ b/docs/classes/KeyVaultManager.html @@ -1,7 +1,7 @@ -KeyVaultManager | microsoft-identity-express
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Hierarchy

      • KeyVaultManager

      Index

      Constructors

      Methods

      • getCertificateCredential(keyVaultCredential: KeyVaultCredential, credential: DefaultAzureCredential): Promise<KeyVaultCertificate>
      @@ -32,8 +32,8 @@

      Features

      Prerequisites

      @@ -64,7 +64,7 @@

      Configuration

      1. Initialize the wrapper in your app by providing a settings object. The object looks like the follows:
      -
      const appSettings = {
      appCredentials: {
      clientId: "CLIENT_ID", // Application (client) ID on Azure AD
      tenantId: "TENANT_ID", // alt. "common" "organizations" "consumers"
      clientSecret: "CLIENT_SECRET" // alt. client certificate or key vault credential
      },
      authRoutes: {
      redirect: "/redirect", // redirect path or the full URI configured on Azure AD
      unauthorized: "/unauthorized" // unauthorized access attempts will be redirected to this route
      frontChannelLogout: "/sso_logout" // front-channel logout path or the full URI configured on Azure AD
      },
      protectedResources: {
      graphAPI: {
      endpoint: "https://graph.microsoft.com/v1.0/me", // Microsoft Graph API
      scopes: ["user.read"]
      },
      armAPI: {
      endpoint: "https://management.azure.com/tenants?api-version=2020-01-01", // Azure Resource Manager REST API
      scopes: ["https://management.azure.com/user_impersonation"]
      }
      }
      } +
      const appSettings = {
      appCredentials: {
      clientId: "CLIENT_ID", // Application (client) ID on Azure AD
      tenantId: "TENANT_ID", // alt. "common" "organizations" "consumers"
      clientSecret: "CLIENT_SECRET" // alt. client certificate or key vault credential
      },
      authRoutes: {
      redirect: "/redirect", // redirect path or the full URI configured on Azure AD
      unauthorized: "/unauthorized", // unauthorized access attempts will be redirected to this route
      frontChannelLogout: "/sso_logout" // front-channel logout path or the full URI configured on Azure AD
      },
      protectedResources: {
      graphAPI: {
      endpoint: "https://graph.microsoft.com/v1.0/me", // Microsoft Graph API
      scopes: ["user.read"]
      },
      armAPI: {
      endpoint: "https://management.azure.com/tenants?api-version=2020-01-01", // Azure Resource Manager REST API
      scopes: ["https://management.azure.com/user_impersonation"]
      }
      }
      }
      1. If you are authenticating with Azure AD B2C, user-flows should be provided as well. The first item is used as default authority.
      2. diff --git a/docs/modules.html b/docs/modules.html index adfcdaa..720dc2c 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -microsoft-identity-express
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        microsoft-identity-express

        Index

        Type aliases

        AccessRule: { groups?: string[]; methods: string[]; path: string; roles?: string[] }

        Type declaration

        • Optional groups?: string[]
        • methods: string[]
        • path: string
        • Optional roles?: string[]
        AccessTokenClaims: TokenClaims & { _claim_names?: string[]; _claim_sources?: string[]; acrs?: string[]; aud?: string; groups?: string[]; roles?: string[]; scp: string; xms_cc?: string }
        AppCredentials: { clientCertificate?: ClientCertificate; clientId: string; clientSecret?: string; instance?: string; tenantId: string }

        Type declaration

        • Optional clientCertificate?: ClientCertificate
        • clientId: string
        • Optional clientSecret?: string
        • Optional instance?: string
        • tenantId: string
        AppSettings: { accessMatrix?: Record<string, AccessRule>; appCredentials: AppCredentials; b2cPolicies?: Record<string, Policy>; loggerOptions?: LoggerOptions }

        Type declaration

        • Optional accessMatrix?: Record<string, AccessRule>
        • appCredentials: AppCredentials
        • Optional b2cPolicies?: Record<string, Policy>
        • Optional loggerOptions?: LoggerOptions
        AppState: { appStage: AppStages; csrfToken: string; redirectTo: string }

        Type declaration

        • appStage: AppStages
        • csrfToken: string
        • redirectTo: string
        AuthRoutes: { frontChannelLogout?: string; redirect: string; unauthorized: string }

        Type declaration

        • Optional frontChannelLogout?: string
        • redirect: string
        • unauthorized: string
        ClientCertificate: { privateKey: string; thumbprint: string; x5c?: string }

        Type declaration

        • privateKey: string
        • thumbprint: string
        • Optional x5c?: string
        GuardOptions: { accessRule: AccessRule }

        Type declaration

        IdTokenClaims: TokenClaims & { _claim_names?: string[]; _claim_sources?: string[]; acrs?: string[]; aud?: string; groups?: string[]; roles?: string[]; xms_cc?: string }
        KeyVaultCredential: { credentialName: string; credentialType: string; keyVaultUrl: string }

        Type declaration

        • credentialName: string
        • credentialType: string
        • keyVaultUrl: string
        Policy: { authority: string }

        Type declaration

        • authority: string
        Resource: { accessToken?: string; endpoint: string; scopes: string[] }

        Type declaration

        • Optional accessToken?: string
        • endpoint: string
        • scopes: string[]
        SignInOptions: { failureRedirect: string; postLoginRedirect: string }

        Type declaration

        • failureRedirect: string
        • postLoginRedirect: string
        SignOutOptions: { postLogoutRedirect: string }

        Type declaration

        • postLogoutRedirect: string
        TokenRequestOptions: { resource: Resource }

        Type declaration

        WebAppSettings: AppSettings & { authRoutes: AuthRoutes; protectedResources?: Record<string, Resource> }

        Variables

        packageVersion: "beta" = 'beta'

        Legend

        • Constructor
        • Property
        • Method
        • Inherited property
        • Inherited method
        • Private property
        • Private method
        • Static method

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +microsoft-identity-express
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        microsoft-identity-express

        Index

        Type aliases

        AccessRule: { groups?: string[]; methods: string[]; path: string; roles?: string[] }

        Type declaration

        • Optional groups?: string[]
        • methods: string[]
        • path: string
        • Optional roles?: string[]
        AccessTokenClaims: TokenClaims & { _claim_names?: string[]; _claim_sources?: string[]; acrs?: string[]; aud?: string; groups?: string[]; roles?: string[]; scp: string; xms_cc?: string }
        AppCredentials: { clientCertificate?: ClientCertificate; clientId: string; clientSecret?: string; instance?: string; tenantId: string }

        Type declaration

        • Optional clientCertificate?: ClientCertificate
        • clientId: string
        • Optional clientSecret?: string
        • Optional instance?: string
        • tenantId: string
        AppSettings: { accessMatrix?: Record<string, AccessRule>; appCredentials: AppCredentials; b2cPolicies?: Record<string, Policy>; loggerOptions?: LoggerOptions }

        Type declaration

        • Optional accessMatrix?: Record<string, AccessRule>
        • appCredentials: AppCredentials
        • Optional b2cPolicies?: Record<string, Policy>
        • Optional loggerOptions?: LoggerOptions
        AppState: { appStage: AppStages; csrfToken: string; redirectTo: string }

        Type declaration

        • appStage: AppStages
        • csrfToken: string
        • redirectTo: string
        AuthRoutes: { frontChannelLogout?: string; redirect: string; unauthorized: string }

        Type declaration

        • Optional frontChannelLogout?: string
        • redirect: string
        • unauthorized: string
        ClientCertificate: { privateKey: string; thumbprint: string; x5c?: string }

        Type declaration

        • privateKey: string
        • thumbprint: string
        • Optional x5c?: string
        GuardOptions: { accessRule: AccessRule }

        Type declaration

        IdTokenClaims: TokenClaims & { _claim_names?: string[]; _claim_sources?: string[]; acrs?: string[]; aud?: string; groups?: string[]; roles?: string[]; xms_cc?: string }
        KeyVaultCredential: { credentialName: string; credentialType: string; keyVaultUrl: string }

        Type declaration

        • credentialName: string
        • credentialType: string
        • keyVaultUrl: string
        Policy: { authority: string }

        Type declaration

        • authority: string
        Resource: { accessToken?: string; endpoint: string; scopes: string[] }

        Type declaration

        • Optional accessToken?: string
        • endpoint: string
        • scopes: string[]
        SignInOptions: { failureRedirect: string; postLoginRedirect: string }

        Type declaration

        • failureRedirect: string
        • postLoginRedirect: string
        SignOutOptions: { postLogoutRedirect: string }

        Type declaration

        • postLogoutRedirect: string
        TokenRequestOptions: { resource: Resource }

        Type declaration

        WebAppSettings: AppSettings & { authRoutes: AuthRoutes; protectedResources?: Record<string, Resource> }

        Variables

        packageVersion: "beta" = 'beta'

        Legend

        • Constructor
        • Property
        • Method
        • Inherited property
        • Inherited method
        • Private property
        • Private method
        • Static method

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f04ab81..631ef5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,173 +5,153 @@ "requires": true, "dependencies": { "@azure/abort-controller": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", - "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", "requires": { - "tslib": "^2.0.0" + "tslib": "^2.2.0" } }, - "@azure/core-asynciterator-polyfill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", - "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" - }, "@azure/core-auth": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz", - "integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", + "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", "requires": { "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" } }, "@azure/core-client": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.5.0.tgz", - "integrity": "sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.6.1.tgz", + "integrity": "sha512-mZ1MSKhZBYoV8GAWceA+PEJFWV2VpdNSpxxcj1wjIAOi00ykRuIQChT99xlQGZWLY3/NApWhSImlFwsmCEs4vA==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-asynciterator-polyfill": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.5.0", - "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-auth": "^1.4.0", + "@azure/core-rest-pipeline": "^1.9.1", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" } }, - "@azure/core-http": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.1.tgz", - "integrity": "sha512-7ATnV3OGzCO2K9kMrh3NKUM8b4v+xasmlUhkNZz6uMbm+8XH/AexLkhRGsoo0GyKNlEGvyGEfytqTk0nUY2I4A==", + "@azure/core-http-compat": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-1.3.0.tgz", + "integrity": "sha512-ZN9avruqbQ5TxopzG3ih3KRy52n8OAbitX3fnZT5go4hzu0J+KVPSzkL+Wt3hpJpdG8WIfg1sBD1tWkgUdEpBA==", "requires": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-asynciterator-polyfill": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-tracing": "1.0.0-preview.13", - "@azure/logger": "^1.0.0", - "@types/node-fetch": "^2.5.0", - "@types/tunnel": "^0.0.3", - "form-data": "^4.0.0", - "node-fetch": "^2.6.0", - "process": "^0.11.10", - "tough-cookie": "^4.0.0", - "tslib": "^2.2.0", - "tunnel": "^0.0.6", - "uuid": "^8.3.0", - "xml2js": "^0.4.19" + "@azure/abort-controller": "^1.0.4", + "@azure/core-client": "^1.3.0", + "@azure/core-rest-pipeline": "^1.3.0" } }, "@azure/core-lro": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.1.tgz", - "integrity": "sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.4.0.tgz", + "integrity": "sha512-F65+rYkll1dpw3RGm8/SSiSj+/QkMeYDanzS/QKlM1dmuneVyXbO46C88V1MRHluLGdMP6qfD3vDRYALn0z0tQ==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" } }, "@azure/core-paging": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.0.tgz", - "integrity": "sha512-ZX1bCjm/MjKPCN6kQD/9GJErYSoKA8YWp6YWoo5EIzcTWlSBLXu3gNaBTUl8usGl+UShiKo7b4Gdy1NSTIlpZg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.3.0.tgz", + "integrity": "sha512-H6Tg9eBm0brHqLy0OSAGzxIh1t4UL8eZVrSUMJ60Ra9cwq2pOskFqVpz2pYoHDsBY1jZ4V/P8LRGb5D5pmC6rg==", "requires": { - "@azure/core-asynciterator-polyfill": "^1.0.0", "tslib": "^2.2.0" } }, "@azure/core-rest-pipeline": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.5.0.tgz", - "integrity": "sha512-Lofjl3mu1TULhjxoPKY4IqXt6mC8Q+r3xMF1dOz0D/aElKfrbqtO2fts36PCClAq+DJzQM/kbnrNTf3X601I5w==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.9.2.tgz", + "integrity": "sha512-8rXI6ircjenaLp+PkOFpo37tQ1PQfztZkfVj97BIF3RPxHAsoVSgkJtu3IK/bUEWcb7HzXSoyBe06M7ODRkRyw==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-auth": "^1.4.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "form-data": "^4.0.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "tslib": "^2.2.0", "uuid": "^8.3.0" } }, "@azure/core-tracing": { - "version": "1.0.0-preview.13", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", - "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", "requires": { - "@opentelemetry/api": "^1.0.1", "tslib": "^2.2.0" } }, "@azure/core-util": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.0.0.tgz", - "integrity": "sha512-yWshY9cdPthlebnb3Zuz/j0Lv4kjU6u7PR5sW7A9FF7EX+0irMRJAtyTq5TPiDHJfjH8gTSlnIYFj9m7Ed76IQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.1.1.tgz", + "integrity": "sha512-A4TBYVQCtHOigFb2ETiiKFDocBoI1Zk2Ui1KpI42aJSIDexF7DHQFpnjonltXAIU/ceH+1fsZAWWgvX6/AKzog==", "requires": { + "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" } }, "@azure/identity": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-2.0.4.tgz", - "integrity": "sha512-ZgFubAsmo7dji63NLPaot6O7pmDfceAUPY57uphSCr0hmRj+Cakqb4SUz5SohCHFtscrhcmejRU903Fowz6iXg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-2.1.0.tgz", + "integrity": "sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw==", "requires": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.3.0", "@azure/core-client": "^1.4.0", "@azure/core-rest-pipeline": "^1.1.0", - "@azure/core-tracing": "1.0.0-preview.13", - "@azure/core-util": "^1.0.0-beta.1", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", - "@azure/msal-browser": "^2.16.0", - "@azure/msal-common": "^4.5.1", - "@azure/msal-node": "^1.3.0", + "@azure/msal-browser": "^2.26.0", + "@azure/msal-common": "^7.0.0", + "@azure/msal-node": "^1.10.0", "events": "^3.0.0", "jws": "^4.0.0", "open": "^8.0.0", "stoppable": "^1.1.0", "tslib": "^2.2.0", "uuid": "^8.3.0" - }, - "dependencies": { - "@azure/msal-common": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-4.5.1.tgz", - "integrity": "sha512-/i5dXM+QAtO+6atYd5oHGBAx48EGSISkXNXViheliOQe+SIFMDo3gSq3lL54W0suOSAsVPws3XnTaIHlla0PIQ==", - "requires": { - "debug": "^4.1.1" - } - } } }, "@azure/keyvault-certificates": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@azure/keyvault-certificates/-/keyvault-certificates-4.4.0.tgz", - "integrity": "sha512-42RSptwsDTfMYREnlYZgj85wMj5SyVhtsP2wQePq/k1s7MUKlX3dygCLkkVVJ6rpi1ivQZItwQ/grYu4Zek7TQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@azure/keyvault-certificates/-/keyvault-certificates-4.6.0.tgz", + "integrity": "sha512-dykrEZPvk4LC5xudJNxnEXT7XTHsTzOhuY1LHE+mTk/5WhN858ijPWBpjXR21CQRbAGozSfROxR8aWjGFhzWwQ==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-http": "^2.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-client": "^1.5.0", + "@azure/core-http-compat": "^1.3.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" } }, "@azure/keyvault-secrets": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@azure/keyvault-secrets/-/keyvault-secrets-4.4.0.tgz", - "integrity": "sha512-D7s5f+YDJYBLjjAY25Bl0P32h0ztFdHExViqbydsx8QjcrRgq62DJfbYBC4+9/M80BSBH5jRzKw5VWNFFp++AA==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@azure/keyvault-secrets/-/keyvault-secrets-4.6.0.tgz", + "integrity": "sha512-MDqsyODCGC2srqLKmO6MFw9WdgLrbPsfCNxgbekHXEd6XKM6KKyBlup5joj96EmdfZnXDFriecAIpj0Dtu81RQ==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-http": "^2.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-client": "^1.5.0", + "@azure/core-http-compat": "^1.3.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" } @@ -185,33 +165,26 @@ } }, "@azure/msal-browser": { - "version": "2.25.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.25.0.tgz", - "integrity": "sha512-hXyqNqNO1pcGqfPLBFutqlsk4VvXXuj0SLXdFpV3dq/dPUgbXDj+9ZkY/Lm+GyqWKBjKuU2AXDOhL9qDjwAWVw==", + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.29.0.tgz", + "integrity": "sha512-ezrB0qL1WsJSNgvLmAN5vKr/4pH28UYLe8JUZeHzB6Z408JU8qYXXGnHAhDPzpDg0g91eG05IdIVrLwxk/i15g==", "requires": { - "@azure/msal-common": "^6.4.0" + "@azure/msal-common": "^7.5.0" } }, "@azure/msal-common": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-6.4.0.tgz", - "integrity": "sha512-WZdgq9f9O8cbxGzdRwLLMM5xjmLJ2mdtuzgXeiGxIRkVVlJ9nZ6sWnDFKa2TX8j72UXD1IfL0p/RYNoTXYoGfg==" + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.5.0.tgz", + "integrity": "sha512-W+SIsGSjkUAyDggA/6QVMKErttQ/8Bq9l/7ADr7GJwt9JFsc+XNBdQDsOsUvZ7YCVkZcSgzJw2MZJLIBqfQtQA==" }, "@azure/msal-node": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.12.0.tgz", - "integrity": "sha512-bNJe5xx3YXj7lrj9wUYl7HX4g1Be7s8VHjDhKPzOnlI54JnRKI+nQ95EmFBs3ckUYM9u82HUsHumDcB21YIC9w==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.14.1.tgz", + "integrity": "sha512-RftjLd35xlafh5cPT17zrzpYdcsbHKJal7R/FTbThpbetSk8y8vQHUzNwWNhBM6GFFiyMS4IQ+zs+z8bgJ4sKQ==", "requires": { - "@azure/msal-common": "^7.2.0", + "@azure/msal-common": "^7.5.0", "jsonwebtoken": "^8.5.1", "uuid": "^8.3.0" - }, - "dependencies": { - "@azure/msal-common": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.2.0.tgz", - "integrity": "sha512-+Oz8LKTOACDHqDmv+MZy/z+DZRH8RZbMjhadmvp0scQ0R75OrzZro+HkxifWhtDG8l1ViYkvV9NHb4pEZyajAQ==" - } } }, "@babel/code-frame": { @@ -912,6 +885,23 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", + "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz", + "integrity": "sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==", + "dev": true + } + } + }, "@babel/plugin-transform-arrow-functions": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz", @@ -1482,221 +1472,1005 @@ } } }, - "@jest/test-result": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-25.5.0.tgz", - "integrity": "sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A==", - "dev": true, - "requires": { - "@jest/console": "^25.5.0", - "@jest/types": "^25.5.0", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - } - }, - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", + "@jest/core": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.5.1.tgz", + "integrity": "sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ==", "dev": true, "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" + "@jest/console": "^27.5.1", + "@jest/reporters": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/transform": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^27.5.1", + "jest-config": "^27.5.1", + "jest-haste-map": "^27.5.1", + "jest-message-util": "^27.5.1", + "jest-regex-util": "^27.5.1", + "jest-resolve": "^27.5.1", + "jest-resolve-dependencies": "^27.5.1", + "jest-runner": "^27.5.1", + "jest-runtime": "^27.5.1", + "jest-snapshot": "^27.5.1", + "jest-util": "^27.5.1", + "jest-validate": "^27.5.1", + "jest-watcher": "^27.5.1", + "micromatch": "^4.0.4", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" + } + }, + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "dev": true, + "requires": { + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "jest-watcher": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.5.1.tgz", + "integrity": "sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw==", + "dev": true, + "requires": { + "@jest/test-result": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^27.5.1", + "string-length": "^4.0.1" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" } } } }, - "@opentelemetry/api": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz", - "integrity": "sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ==" - }, - "@rollup/plugin-babel": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz", - "integrity": "sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@rollup/pluginutils": "^3.1.0" - } - }, - "@rollup/plugin-commonjs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz", - "integrity": "sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.0.8", - "commondir": "^1.0.1", - "estree-walker": "^1.0.1", - "glob": "^7.1.2", - "is-reference": "^1.1.2", - "magic-string": "^0.25.2", - "resolve": "^1.11.0" - } - }, - "@rollup/plugin-json": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", - "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "@jest/environment": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.5.1.tgz", + "integrity": "sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.0.8" + "@jest/fake-timers": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "jest-mock": "^27.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + } } }, - "@rollup/plugin-node-resolve": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", - "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", + "@jest/fake-timers": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.5.1.tgz", + "integrity": "sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.17.0" + "@jest/types": "^27.5.1", + "@sinonjs/fake-timers": "^8.0.1", + "@types/node": "*", + "jest-message-util": "^27.5.1", + "jest-mock": "^27.5.1", + "jest-util": "^27.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + } } }, - "@rollup/plugin-replace": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", - "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", + "@jest/globals": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.5.1.tgz", + "integrity": "sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.1.0", - "magic-string": "^0.25.7" + "@jest/environment": "^27.5.1", + "@jest/types": "^27.5.1", + "expect": "^27.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + } } }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "@jest/reporters": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.5.1.tgz", + "integrity": "sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw==", "dev": true, "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/transform": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-haste-map": "^27.5.1", + "jest-resolve": "^27.5.1", + "jest-util": "^27.5.1", + "jest-worker": "^27.5.1", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^8.1.0" + }, + "dependencies": { + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" + } + }, + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "dev": true, + "requires": { + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + } + } } }, - "@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "@jest/source-map": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.5.1.tgz", + "integrity": "sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg==", "dev": true, "requires": { - "type-detect": "4.0.8" + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" - }, - "@types/babel__core": { - "version": "7.1.16", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", - "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==", + "@jest/test-result": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-25.5.0.tgz", + "integrity": "sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A==", "dev": true, "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" + "@jest/console": "^25.5.0", + "@jest/types": "^25.5.0", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" } }, - "@types/babel__generator": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz", - "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==", + "@jest/test-sequencer": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz", + "integrity": "sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@jest/test-result": "^27.5.1", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^27.5.1", + "jest-runtime": "^27.5.1" + }, + "dependencies": { + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" + } + }, + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "dev": true, + "requires": { + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + } } }, - "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "@jest/transform": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.5.1.tgz", + "integrity": "sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw==", "dev": true, "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/core": "^7.1.0", + "@jest/types": "^27.5.1", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^27.5.1", + "jest-regex-util": "^27.5.1", + "jest-util": "^27.5.1", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, - "@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "@jest/types": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", + "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", "dev": true, "requires": { - "@babel/types": "^7.3.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^3.0.0" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, - "@types/body-parser": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz", - "integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==", + "@rollup/plugin-babel": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz", + "integrity": "sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==", "dev": true, "requires": { - "@types/connect": "*", - "@types/node": "*" + "@babel/helper-module-imports": "^7.10.4", + "@rollup/pluginutils": "^3.1.0" } }, - "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "@rollup/plugin-commonjs": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz", + "integrity": "sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA==", "dev": true, "requires": { - "@types/node": "*" + "@rollup/pluginutils": "^3.0.8", + "commondir": "^1.0.1", + "estree-walker": "^1.0.1", + "glob": "^7.1.2", + "is-reference": "^1.1.2", + "magic-string": "^0.25.2", + "resolve": "^1.11.0" } }, - "@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", "dev": true, "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" + "@rollup/pluginutils": "^3.0.8" } }, - "@types/express-serve-static-core": { - "version": "4.17.24", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", - "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", + "@rollup/plugin-node-resolve": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", + "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", "dev": true, "requires": { - "@types/node": "*", + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.17.0" + } + }, + "@rollup/plugin-replace": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", + "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "magic-string": "^0.25.7" + } + }, + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + } + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", + "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" + }, + "@types/babel__core": { + "version": "7.1.16", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", + "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz", + "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", + "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/body-parser": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz", + "integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.24", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", + "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", + "dev": true, + "requires": { + "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*" } @@ -1763,7 +2537,7 @@ "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@types/mime": { @@ -1775,28 +2549,8 @@ "@types/node": { "version": "16.11.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.0.tgz", - "integrity": "sha512-8MLkBIYQMuhRBQzGN9875bYsOhPnf/0rgXGo66S2FemHkhbn9qtsz9ywV1iCG+vbjigE4WUNVvw37Dx+L0qsPg==" - }, - "@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } + "integrity": "sha512-8MLkBIYQMuhRBQzGN9875bYsOhPnf/0rgXGo66S2FemHkhbn9qtsz9ywV1iCG+vbjigE4WUNVvw37Dx+L0qsPg==", + "dev": true }, "@types/normalize-package-data": { "version": "2.4.1", @@ -1810,6 +2564,12 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "@types/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==", + "dev": true + }, "@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -1847,14 +2607,6 @@ "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", "dev": true }, - "@types/tunnel": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", - "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", - "requires": { - "@types/node": "*" - } - }, "@types/yargs": { "version": "15.0.14", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", @@ -2035,7 +2787,7 @@ "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "array-includes": { "version": "3.1.4", @@ -2102,13 +2854,13 @@ "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==", "dev": true }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "asyncro": { "version": "3.0.0", @@ -2161,6 +2913,55 @@ "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", "dev": true }, + "babel-jest": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.5.1.tgz", + "integrity": "sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg==", + "dev": true, + "requires": { + "@jest/transform": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^27.5.1", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + } + } + }, "babel-plugin-annotate-pure-calls": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/babel-plugin-annotate-pure-calls/-/babel-plugin-annotate-pure-calls-0.4.0.tgz", @@ -2195,6 +2996,18 @@ "test-exclude": "^6.0.0" } }, + "babel-plugin-jest-hoist": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz", + "integrity": "sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + } + }, "babel-plugin-macros": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", @@ -2274,6 +3087,36 @@ "integrity": "sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ==", "dev": true }, + "babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz", + "integrity": "sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^27.5.1", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2386,7 +3229,7 @@ "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", "dev": true } } @@ -2425,7 +3268,7 @@ "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" }, "buffer-from": { "version": "1.1.2", @@ -2513,6 +3356,12 @@ "supports-color": "^7.1.0" } }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -2525,6 +3374,12 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, + "cjs-module-lexer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", + "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "dev": true + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -2626,10 +3481,34 @@ "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, "clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "dev": true }, "co": { @@ -2686,7 +3565,7 @@ "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "component-emitter": { @@ -2698,7 +3577,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "confusing-browser-globals": { @@ -2744,7 +3623,7 @@ "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "cookiejar": { "version": "2.1.3", @@ -2888,13 +3767,25 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true + }, + "decimal.js": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.1.tgz", + "integrity": "sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw==", "dev": true }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", + "dev": true + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, "deep-is": { @@ -2945,7 +3836,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, "depd": { "version": "2.0.0", @@ -3016,6 +3907,12 @@ "integrity": "sha512-qcLvDUPf8DSIMWarHT2ptgcqrYg62n3vPA7vhrOF24d8UNzbUBaHu2CySiENR3nEDzYgaN60071t0F6KLYMQ7Q==", "dev": true }, + "emittery": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "dev": true + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -3465,14 +4362,97 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true } } }, - "express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", + "expect": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-27.5.1.tgz", + "integrity": "sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "jest-get-type": "^27.5.1", + "jest-matcher-utils": "^27.5.1", + "jest-message-util": "^27.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + } + } + }, + "express": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", "requires": { "accepts": "~1.3.8", @@ -3559,7 +4539,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "safe-buffer": { "version": "5.2.1", @@ -3664,7 +4644,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fast-safe-stringify": { @@ -3825,7 +4805,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "fsevents": { @@ -3843,7 +4823,7 @@ "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "dev": true }, "gensync": { @@ -3902,13 +4882,13 @@ "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", "dev": true }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, "requires": { "assert-plus": "^1.0.0" @@ -3958,14 +4938,14 @@ "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", "dev": true, "optional": true }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "dev": true }, "har-validator": { @@ -4015,7 +4995,7 @@ "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", "dev": true, "requires": { "get-value": "^2.0.6", @@ -4026,7 +5006,7 @@ "has-values": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", "dev": true, "requires": { "is-number": "^3.0.0", @@ -4036,7 +5016,7 @@ "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -4045,7 +5025,7 @@ "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -4056,7 +5036,7 @@ "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -4098,11 +5078,11 @@ } }, "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "requires": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" } @@ -4110,7 +5090,7 @@ "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dev": true, "requires": { "assert-plus": "^1.0.0", @@ -4176,13 +5156,13 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", @@ -4254,7 +5234,7 @@ "ip-regex": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==", "dev": true }, "ipaddr.js": { @@ -4274,7 +5254,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "is-bigint": { @@ -4372,7 +5352,13 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "is-generator-fn": { @@ -4399,7 +5385,7 @@ "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, "is-negative-zero": { @@ -4432,6 +5418,12 @@ "isobject": "^3.0.1" } }, + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, "is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -4481,789 +5473,2643 @@ "has-symbols": "^1.0.2" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-weakref": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", - "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, + "is-weakref": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", + "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "requires": { + "is-docker": "^2.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", + "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", + "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-27.0.0.tgz", + "integrity": "sha512-rOVbFCiNh9i7qj4236yQNipFJ80GiqyzkHumQvyOYXDYkVy7E1Hn6nm1xNaqPs80plE8LohX+AEKKLAWo3C5CQ==", + "dev": true, + "requires": { + "@jest/core": "^27.0.0", + "import-local": "^3.0.2", + "jest-cli": "^27.0.0" + }, + "dependencies": { + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" + } + }, + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "dev": true, + "requires": { + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-cli": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.5.1.tgz", + "integrity": "sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw==", + "dev": true, + "requires": { + "@jest/core": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/types": "^27.5.1", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^27.5.1", + "jest-util": "^27.5.1", + "jest-validate": "^27.5.1", + "prompts": "^2.0.1", + "yargs": "^16.2.0" + } + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + } + } + }, + "jest-changed-files": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.5.1.tgz", + "integrity": "sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "execa": "^5.0.0", + "throat": "^6.0.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + } + } + }, + "jest-circus": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.5.1.tgz", + "integrity": "sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw==", + "dev": true, + "requires": { + "@jest/environment": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "expect": "^27.5.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.5.1", + "jest-matcher-utils": "^27.5.1", + "jest-message-util": "^27.5.1", + "jest-runtime": "^27.5.1", + "jest-snapshot": "^27.5.1", + "jest-util": "^27.5.1", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3", + "throat": "^6.0.1" + }, + "dependencies": { + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" + } + }, + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "dev": true, + "requires": { + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + } + } + }, + "jest-config": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.5.1.tgz", + "integrity": "sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA==", + "dev": true, + "requires": { + "@babel/core": "^7.8.0", + "@jest/test-sequencer": "^27.5.1", + "@jest/types": "^27.5.1", + "babel-jest": "^27.5.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.9", + "jest-circus": "^27.5.1", + "jest-environment-jsdom": "^27.5.1", + "jest-environment-node": "^27.5.1", + "jest-get-type": "^27.5.1", + "jest-jasmine2": "^27.5.1", + "jest-regex-util": "^27.5.1", + "jest-resolve": "^27.5.1", + "jest-runner": "^27.5.1", + "jest-util": "^27.5.1", + "jest-validate": "^27.5.1", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" + } + }, + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "dev": true, + "requires": { + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "dev": true + }, + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } + } + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "requires": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + } + }, + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "requires": { + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.5" + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, + "jest-environment-jsdom": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz", + "integrity": "sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw==", + "dev": true, + "requires": { + "@jest/environment": "^27.5.1", + "@jest/fake-timers": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "jest-mock": "^27.5.1", + "jest-util": "^27.5.1", + "jsdom": "^16.6.0" + } + }, + "jest-jasmine2": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz", + "integrity": "sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ==", + "dev": true, + "requires": { + "@jest/environment": "^27.5.1", + "@jest/source-map": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^27.5.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.5.1", + "jest-matcher-utils": "^27.5.1", + "jest-message-util": "^27.5.1", + "jest-runtime": "^27.5.1", + "jest-snapshot": "^27.5.1", + "jest-util": "^27.5.1", + "pretty-format": "^27.5.1", + "throat": "^6.0.1" + } + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "requires": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + } + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + } + }, + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "requires": { + "xml-name-validator": "^3.0.0" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true + } + } + }, + "jest-diff": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", + "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^27.5.1", + "jest-get-type": "^27.5.1", + "pretty-format": "^27.5.1" + }, + "dependencies": { + "jest-get-type": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", + "dev": true + } + } + }, + "jest-docblock": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.5.1.tgz", + "integrity": "sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.5.1.tgz", + "integrity": "sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "chalk": "^4.0.0", + "jest-get-type": "^27.5.1", + "jest-util": "^27.5.1", + "pretty-format": "^27.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + } + } + }, + "jest-environment-jsdom": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-25.5.0.tgz", + "integrity": "sha512-7Jr02ydaq4jaWMZLY+Skn8wL5nVIYpWvmeatOHL3tOcV3Zw8sjnPpx+ZdeBfc457p8jCR9J6YCc+Lga0oIy62A==", + "dev": true, + "requires": { + "@jest/environment": "^25.5.0", + "@jest/fake-timers": "^25.5.0", + "@jest/types": "^25.5.0", + "jest-mock": "^25.5.0", + "jest-util": "^25.5.0", + "jsdom": "^15.2.1" + }, + "dependencies": { + "@jest/environment": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-25.5.0.tgz", + "integrity": "sha512-U2VXPEqL07E/V7pSZMSQCvV5Ea4lqOlT+0ZFijl/i316cRMHvZ4qC+jBdryd+lmRetjQo0YIQr6cVPNxxK87mA==", + "dev": true, + "requires": { + "@jest/fake-timers": "^25.5.0", + "@jest/types": "^25.5.0", + "jest-mock": "^25.5.0" + } + }, + "@jest/fake-timers": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.5.0.tgz", + "integrity": "sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "jest-message-util": "^25.5.0", + "jest-mock": "^25.5.0", + "jest-util": "^25.5.0", + "lolex": "^5.0.0" + } + }, + "jest-mock": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-25.5.0.tgz", + "integrity": "sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0" + } + } + } + }, + "jest-environment-node": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.5.1.tgz", + "integrity": "sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw==", + "dev": true, + "requires": { + "@jest/environment": "^27.5.1", + "@jest/fake-timers": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "jest-mock": "^27.5.1", + "jest-util": "^27.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + } + } + }, + "jest-get-type": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", + "dev": true + }, + "jest-haste-map": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.5.1.tgz", + "integrity": "sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^27.5.1", + "jest-serializer": "^27.5.1", + "jest-util": "^27.5.1", + "jest-worker": "^27.5.1", + "micromatch": "^4.0.4", + "walker": "^1.0.7" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true + }, + "jest-serializer": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.5.1.tgz", + "integrity": "sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==", + "dev": true, + "requires": { + "@types/node": "*", + "graceful-fs": "^4.2.9" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + } + } + }, + "jest-jasmine2": { + "version": "25.5.4", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz", + "integrity": "sha512-9acbWEfbmS8UpdcfqnDO+uBUgKa/9hcRh983IHdM+pKmJPL77G0sWAAK0V0kr5LK3a8cSBfkFSoncXwQlRZfkQ==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^25.5.0", + "@jest/source-map": "^25.5.0", + "@jest/test-result": "^25.5.0", + "@jest/types": "^25.5.0", + "chalk": "^3.0.0", + "co": "^4.6.0", + "expect": "^25.5.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^25.5.0", + "jest-matcher-utils": "^25.5.0", + "jest-message-util": "^25.5.0", + "jest-runtime": "^25.5.4", + "jest-snapshot": "^25.5.1", + "jest-util": "^25.5.0", + "pretty-format": "^25.5.0", + "throat": "^5.0.0" + }, + "dependencies": { + "@jest/environment": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-25.5.0.tgz", + "integrity": "sha512-U2VXPEqL07E/V7pSZMSQCvV5Ea4lqOlT+0ZFijl/i316cRMHvZ4qC+jBdryd+lmRetjQo0YIQr6cVPNxxK87mA==", + "dev": true, + "requires": { + "@jest/fake-timers": "^25.5.0", + "@jest/types": "^25.5.0", + "jest-mock": "^25.5.0" + } + }, + "@jest/fake-timers": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.5.0.tgz", + "integrity": "sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "jest-message-util": "^25.5.0", + "jest-mock": "^25.5.0", + "jest-util": "^25.5.0", + "lolex": "^5.0.0" + } + }, + "@jest/globals": { + "version": "25.5.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-25.5.2.tgz", + "integrity": "sha512-AgAS/Ny7Q2RCIj5kZ+0MuKM1wbF0WMLxbCVl/GOMoCNbODRdJ541IxJ98xnZdVSZXivKpJlNPIWa3QmY0l4CXA==", + "dev": true, + "requires": { + "@jest/environment": "^25.5.0", + "@jest/types": "^25.5.0", + "expect": "^25.5.0" + } + }, + "@jest/source-map": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-25.5.0.tgz", + "integrity": "sha512-eIGx0xN12yVpMcPaVpjXPnn3N30QGJCJQSkEDUt9x1fI1Gdvb07Ml6K5iN2hG7NmMP6FDmtPEssE3z6doOYUwQ==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + } + }, + "@jest/test-sequencer": { + "version": "25.5.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz", + "integrity": "sha512-pTJGEkSeg1EkCO2YWq6hbFvKNXk8ejqlxiOg1jBNLnWrgXOkdY6UmqZpwGFXNnRt9B8nO1uWMzLLZ4eCmhkPNA==", + "dev": true, + "requires": { + "@jest/test-result": "^25.5.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^25.5.1", + "jest-runner": "^25.5.4", + "jest-runtime": "^25.5.4" + } + }, + "@jest/transform": { + "version": "25.5.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-25.5.1.tgz", + "integrity": "sha512-Y8CEoVwXb4QwA6Y/9uDkn0Xfz0finGkieuV0xkdF9UtZGJeLukD5nLkaVrVsODB1ojRWlaoD0AJZpVHCSnJEvg==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^25.5.0", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^3.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^25.5.1", + "jest-regex-util": "^25.2.6", + "jest-util": "^25.5.0", + "micromatch": "^4.0.2", + "pirates": "^4.0.1", + "realpath-native": "^2.0.0", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + } + }, + "@types/prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==", + "dev": true + }, + "babel-jest": { + "version": "25.5.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-25.5.1.tgz", + "integrity": "sha512-9dA9+GmMjIzgPnYtkhBg73gOo/RHqPmLruP3BaGL4KEX3Dwz6pI8auSN8G8+iuEG90+GSswyKvslN+JYSaacaQ==", + "dev": true, + "requires": { + "@jest/transform": "^25.5.1", + "@jest/types": "^25.5.0", + "@types/babel__core": "^7.1.7", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^25.5.0", + "chalk": "^3.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + } + }, + "babel-plugin-jest-hoist": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.5.0.tgz", + "integrity": "sha512-u+/W+WAjMlvoocYGTwthAiQSxDcJAyHpQ6oWlHdFZaaN+Rlk8Q7iiwDPg2lN/FyJtAYnKjFxbn7xus4HCFkg5g==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", + "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-25.5.0.tgz", + "integrity": "sha512-8ZczygctQkBU+63DtSOKGh7tFL0CeCuz+1ieud9lJ1WPQ9O6A1a/r+LGn6Y705PA6whHQ3T1XuB/PmpfNYf8Fw==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^25.5.0", + "babel-preset-current-node-syntax": "^0.1.2" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "diff-sequences": { + "version": "25.2.6", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz", + "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", + "dev": true + }, + "expect": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-25.5.0.tgz", + "integrity": "sha512-w7KAXo0+6qqZZhovCaBVPSIqQp7/UTcx4M9uKt2m6pd2VB1voyC8JizLRqeEqud3AAVP02g+hbErDu5gu64tlA==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "ansi-styles": "^4.0.0", + "jest-get-type": "^25.2.6", + "jest-matcher-utils": "^25.5.0", + "jest-message-util": "^25.5.0", + "jest-regex-util": "^25.2.6" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "jest-config": { + "version": "25.5.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-25.5.4.tgz", + "integrity": "sha512-SZwR91SwcdK6bz7Gco8qL7YY2sx8tFJYzvg216DLihTWf+LKY/DoJXpM9nTzYakSyfblbqeU48p/p7Jzy05Atg==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^25.5.4", + "@jest/types": "^25.5.0", + "babel-jest": "^25.5.1", + "chalk": "^3.0.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-environment-jsdom": "^25.5.0", + "jest-environment-node": "^25.5.0", + "jest-get-type": "^25.2.6", + "jest-jasmine2": "^25.5.4", + "jest-regex-util": "^25.2.6", + "jest-resolve": "^25.5.1", + "jest-util": "^25.5.0", + "jest-validate": "^25.5.0", + "micromatch": "^4.0.2", + "pretty-format": "^25.5.0", + "realpath-native": "^2.0.0" + } + }, + "jest-diff": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz", + "integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "diff-sequences": "^25.2.6", + "jest-get-type": "^25.2.6", + "pretty-format": "^25.5.0" + } + }, + "jest-docblock": { + "version": "25.3.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-25.3.0.tgz", + "integrity": "sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-25.5.0.tgz", + "integrity": "sha512-QBogUxna3D8vtiItvn54xXde7+vuzqRrEeaw8r1s+1TG9eZLVJE5ZkKoSUlqFwRjnlaA4hyKGiu9OlkFIuKnjA==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "chalk": "^3.0.0", + "jest-get-type": "^25.2.6", + "jest-util": "^25.5.0", + "pretty-format": "^25.5.0" + } + }, + "jest-environment-node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-25.5.0.tgz", + "integrity": "sha512-iuxK6rQR2En9EID+2k+IBs5fCFd919gVVK5BeND82fYeLWPqvRcFNPKu9+gxTwfB5XwBGBvZ0HFQa+cHtIoslA==", + "dev": true, + "requires": { + "@jest/environment": "^25.5.0", + "@jest/fake-timers": "^25.5.0", + "@jest/types": "^25.5.0", + "jest-mock": "^25.5.0", + "jest-util": "^25.5.0", + "semver": "^6.3.0" + } + }, + "jest-get-type": { + "version": "25.2.6", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz", + "integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==", + "dev": true + }, + "jest-haste-map": { + "version": "25.5.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-25.5.1.tgz", + "integrity": "sha512-dddgh9UZjV7SCDQUrQ+5t9yy8iEgKc1AKqZR9YDww8xsVOtzPQSMVLDChc21+g29oTRexb9/B0bIlZL+sWmvAQ==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "@types/graceful-fs": "^4.1.2", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.1.2", + "graceful-fs": "^4.2.4", + "jest-serializer": "^25.5.0", + "jest-util": "^25.5.0", + "jest-worker": "^25.5.0", + "micromatch": "^4.0.2", + "sane": "^4.0.3", + "walker": "^1.0.7", + "which": "^2.0.2" + } + }, + "jest-leak-detector": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-25.5.0.tgz", + "integrity": "sha512-rV7JdLsanS8OkdDpZtgBf61L5xZ4NnYLBq72r6ldxahJWWczZjXawRsoHyXzibM5ed7C2QRjpp6ypgwGdKyoVA==", + "dev": true, + "requires": { + "jest-get-type": "^25.2.6", + "pretty-format": "^25.5.0" + } + }, + "jest-matcher-utils": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.5.0.tgz", + "integrity": "sha512-VWI269+9JS5cpndnpCwm7dy7JtGQT30UHfrnM3mXl22gHGt/b7NkjBqXfbhZ8V4B7ANUsjK18PlSBmG0YH7gjw==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "jest-diff": "^25.5.0", + "jest-get-type": "^25.2.6", + "pretty-format": "^25.5.0" + } + }, + "jest-mock": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-25.5.0.tgz", + "integrity": "sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0" + } + }, + "jest-resolve": { + "version": "25.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-25.5.1.tgz", + "integrity": "sha512-Hc09hYch5aWdtejsUZhA+vSzcotf7fajSlPA6EZPE1RmPBAD39XtJhvHWFStid58iit4IPDLI/Da4cwdDmAHiQ==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "browser-resolve": "^1.11.3", + "chalk": "^3.0.0", + "graceful-fs": "^4.2.4", + "jest-pnp-resolver": "^1.2.1", + "read-pkg-up": "^7.0.1", + "realpath-native": "^2.0.0", + "resolve": "^1.17.0", + "slash": "^3.0.0" + } + }, + "jest-runner": { + "version": "25.5.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-25.5.4.tgz", + "integrity": "sha512-V/2R7fKZo6blP8E9BL9vJ8aTU4TH2beuqGNxHbxi6t14XzTb+x90B3FRgdvuHm41GY8ch4xxvf0ATH4hdpjTqg==", + "dev": true, + "requires": { + "@jest/console": "^25.5.0", + "@jest/environment": "^25.5.0", + "@jest/test-result": "^25.5.0", + "@jest/types": "^25.5.0", + "chalk": "^3.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-config": "^25.5.4", + "jest-docblock": "^25.3.0", + "jest-haste-map": "^25.5.1", + "jest-jasmine2": "^25.5.4", + "jest-leak-detector": "^25.5.0", + "jest-message-util": "^25.5.0", + "jest-resolve": "^25.5.1", + "jest-runtime": "^25.5.4", + "jest-util": "^25.5.0", + "jest-worker": "^25.5.0", + "source-map-support": "^0.5.6", + "throat": "^5.0.0" + } + }, + "jest-runtime": { + "version": "25.5.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-25.5.4.tgz", + "integrity": "sha512-RWTt8LeWh3GvjYtASH2eezkc8AehVoWKK20udV6n3/gC87wlTbE1kIA+opCvNWyyPeBs6ptYsc6nyHUb1GlUVQ==", + "dev": true, + "requires": { + "@jest/console": "^25.5.0", + "@jest/environment": "^25.5.0", + "@jest/globals": "^25.5.2", + "@jest/source-map": "^25.5.0", + "@jest/test-result": "^25.5.0", + "@jest/transform": "^25.5.1", + "@jest/types": "^25.5.0", + "@types/yargs": "^15.0.0", + "chalk": "^3.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-config": "^25.5.4", + "jest-haste-map": "^25.5.1", + "jest-message-util": "^25.5.0", + "jest-mock": "^25.5.0", + "jest-regex-util": "^25.2.6", + "jest-resolve": "^25.5.1", + "jest-snapshot": "^25.5.1", + "jest-util": "^25.5.0", + "jest-validate": "^25.5.0", + "realpath-native": "^2.0.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^15.3.1" + } + }, + "jest-snapshot": { + "version": "25.5.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-25.5.1.tgz", + "integrity": "sha512-C02JE1TUe64p2v1auUJ2ze5vcuv32tkv9PyhEb318e8XOKF7MOyXdJ7kdjbvrp3ChPLU2usI7Rjxs97Dj5P0uQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0", + "@jest/types": "^25.5.0", + "@types/prettier": "^1.19.0", + "chalk": "^3.0.0", + "expect": "^25.5.0", + "graceful-fs": "^4.2.4", + "jest-diff": "^25.5.0", + "jest-get-type": "^25.2.6", + "jest-matcher-utils": "^25.5.0", + "jest-message-util": "^25.5.0", + "jest-resolve": "^25.5.1", + "make-dir": "^3.0.0", + "natural-compare": "^1.4.0", + "pretty-format": "^25.5.0", + "semver": "^6.3.0" + } + }, + "jest-validate": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-25.5.0.tgz", + "integrity": "sha512-okUFKqhZIpo3jDdtUXUZ2LxGUZJIlfdYBvZb1aczzxrlyMlqdnnws9MOxezoLGhSaFc2XYaHNReNQfj5zPIWyQ==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "jest-get-type": "^25.2.6", + "leven": "^3.1.0", + "pretty-format": "^25.5.0" + } + }, + "jest-worker": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.5.0.tgz", + "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, + "pretty-format": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", + "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", + "dev": true, + "requires": { + "@jest/types": "^25.5.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + } + } + }, + "jest-leak-detector": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz", + "integrity": "sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ==", "dev": true, "requires": { - "call-bind": "^1.0.0" - } - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "requires": { - "is-docker": "^2.0.0" + "jest-get-type": "^27.5.1", + "pretty-format": "^27.5.1" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true - }, - "istanbul-lib-instrument": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", - "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", + "jest-matcher-utils": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", + "integrity": "sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==", "dev": true, "requires": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" + "chalk": "^4.0.0", + "jest-diff": "^27.5.1", + "jest-get-type": "^27.5.1", + "pretty-format": "^27.5.1" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "jest-get-type": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", "dev": true } } }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "jest-message-util": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz", + "integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==", "dev": true, "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" + "@babel/code-frame": "^7.0.0", + "@jest/types": "^25.5.0", + "@types/stack-utils": "^1.0.1", + "chalk": "^3.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.2", + "slash": "^3.0.0", + "stack-utils": "^1.0.1" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, - "istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "jest-mock": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz", + "integrity": "sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==", "dev": true, "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "@jest/types": "^27.5.1", + "@types/node": "*" }, "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } } } }, - "istanbul-reports": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", - "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } + "jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true }, - "jest-diff": { + "jest-regex-util": { + "version": "25.2.6", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-25.2.6.tgz", + "integrity": "sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw==", + "dev": true + }, + "jest-resolve": { "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", - "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.5.1.tgz", + "integrity": "sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw==", "dev": true, "requires": { + "@jest/types": "^27.5.1", "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "graceful-fs": "^4.2.9", + "jest-haste-map": "^27.5.1", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^27.5.1", + "jest-validate": "^27.5.1", + "resolve": "^1.20.0", + "resolve.exports": "^1.1.0", + "slash": "^3.0.0" }, "dependencies": { - "jest-get-type": { + "@jest/types": { "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "requires": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } } } }, - "jest-environment-jsdom": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-25.5.0.tgz", - "integrity": "sha512-7Jr02ydaq4jaWMZLY+Skn8wL5nVIYpWvmeatOHL3tOcV3Zw8sjnPpx+ZdeBfc457p8jCR9J6YCc+Lga0oIy62A==", + "jest-resolve-dependencies": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz", + "integrity": "sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg==", "dev": true, "requires": { - "@jest/environment": "^25.5.0", - "@jest/fake-timers": "^25.5.0", - "@jest/types": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-util": "^25.5.0", - "jsdom": "^15.2.1" + "@jest/types": "^27.5.1", + "jest-regex-util": "^27.5.1", + "jest-snapshot": "^27.5.1" }, "dependencies": { - "@jest/environment": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-25.5.0.tgz", - "integrity": "sha512-U2VXPEqL07E/V7pSZMSQCvV5Ea4lqOlT+0ZFijl/i316cRMHvZ4qC+jBdryd+lmRetjQo0YIQr6cVPNxxK87mA==", + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, "requires": { - "@jest/fake-timers": "^25.5.0", - "@jest/types": "^25.5.0", - "jest-mock": "^25.5.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" } }, - "@jest/fake-timers": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.5.0.tgz", - "integrity": "sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ==", + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-util": "^25.5.0", - "lolex": "^5.0.0" + "@types/istanbul-lib-report": "*" } }, - "jest-mock": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-25.5.0.tgz", - "integrity": "sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA==", + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", "dev": true, "requires": { - "@jest/types": "^25.5.0" + "@types/yargs-parser": "*" } + }, + "jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true } } }, - "jest-jasmine2": { - "version": "25.5.4", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz", - "integrity": "sha512-9acbWEfbmS8UpdcfqnDO+uBUgKa/9hcRh983IHdM+pKmJPL77G0sWAAK0V0kr5LK3a8cSBfkFSoncXwQlRZfkQ==", + "jest-runner": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.5.1.tgz", + "integrity": "sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ==", "dev": true, "requires": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^25.5.0", - "@jest/source-map": "^25.5.0", - "@jest/test-result": "^25.5.0", - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "co": "^4.6.0", - "expect": "^25.5.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^25.5.0", - "jest-matcher-utils": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-runtime": "^25.5.4", - "jest-snapshot": "^25.5.1", - "jest-util": "^25.5.0", - "pretty-format": "^25.5.0", - "throat": "^5.0.0" + "@jest/console": "^27.5.1", + "@jest/environment": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/transform": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^27.5.1", + "jest-environment-jsdom": "^27.5.1", + "jest-environment-node": "^27.5.1", + "jest-haste-map": "^27.5.1", + "jest-leak-detector": "^27.5.1", + "jest-message-util": "^27.5.1", + "jest-resolve": "^27.5.1", + "jest-runtime": "^27.5.1", + "jest-util": "^27.5.1", + "jest-worker": "^27.5.1", + "source-map-support": "^0.5.6", + "throat": "^6.0.1" }, "dependencies": { - "@jest/environment": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-25.5.0.tgz", - "integrity": "sha512-U2VXPEqL07E/V7pSZMSQCvV5Ea4lqOlT+0ZFijl/i316cRMHvZ4qC+jBdryd+lmRetjQo0YIQr6cVPNxxK87mA==", + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", "dev": true, "requires": { - "@jest/fake-timers": "^25.5.0", - "@jest/types": "^25.5.0", - "jest-mock": "^25.5.0" + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" } }, - "@jest/fake-timers": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.5.0.tgz", - "integrity": "sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ==", + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-util": "^25.5.0", - "lolex": "^5.0.0" + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" } }, - "@jest/globals": { - "version": "25.5.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-25.5.2.tgz", - "integrity": "sha512-AgAS/Ny7Q2RCIj5kZ+0MuKM1wbF0WMLxbCVl/GOMoCNbODRdJ541IxJ98xnZdVSZXivKpJlNPIWa3QmY0l4CXA==", + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, "requires": { - "@jest/environment": "^25.5.0", - "@jest/types": "^25.5.0", - "expect": "^25.5.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" } }, - "@jest/source-map": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-25.5.0.tgz", - "integrity": "sha512-eIGx0xN12yVpMcPaVpjXPnn3N30QGJCJQSkEDUt9x1fI1Gdvb07Ml6K5iN2hG7NmMP6FDmtPEssE3z6doOYUwQ==", - "dev": true, - "requires": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" - } + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true }, - "@jest/test-sequencer": { - "version": "25.5.4", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz", - "integrity": "sha512-pTJGEkSeg1EkCO2YWq6hbFvKNXk8ejqlxiOg1jBNLnWrgXOkdY6UmqZpwGFXNnRt9B8nO1uWMzLLZ4eCmhkPNA==", + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { - "@jest/test-result": "^25.5.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^25.5.1", - "jest-runner": "^25.5.4", - "jest-runtime": "^25.5.4" + "@types/istanbul-lib-report": "*" } }, - "@jest/transform": { - "version": "25.5.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-25.5.1.tgz", - "integrity": "sha512-Y8CEoVwXb4QwA6Y/9uDkn0Xfz0finGkieuV0xkdF9UtZGJeLukD5nLkaVrVsODB1ojRWlaoD0AJZpVHCSnJEvg==", + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "@jest/types": "^25.5.0", - "babel-plugin-istanbul": "^6.0.0", - "chalk": "^3.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^25.5.1", - "jest-regex-util": "^25.2.6", - "jest-util": "^25.5.0", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", - "realpath-native": "^2.0.0", - "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" - } - }, - "@types/prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==", + "@types/yargs-parser": "*" + } + }, + "acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true }, - "babel-jest": { - "version": "25.5.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-25.5.1.tgz", - "integrity": "sha512-9dA9+GmMjIzgPnYtkhBg73gOo/RHqPmLruP3BaGL4KEX3Dwz6pI8auSN8G8+iuEG90+GSswyKvslN+JYSaacaQ==", + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", "dev": true, "requires": { - "@jest/transform": "^25.5.1", - "@jest/types": "^25.5.0", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^25.5.0", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "slash": "^3.0.0" + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } } }, - "babel-plugin-jest-hoist": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.5.0.tgz", - "integrity": "sha512-u+/W+WAjMlvoocYGTwthAiQSxDcJAyHpQ6oWlHdFZaaN+Rlk8Q7iiwDPg2lN/FyJtAYnKjFxbn7xus4HCFkg5g==", + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", "dev": true, "requires": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__traverse": "^7.0.6" + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" } }, - "babel-preset-current-node-syntax": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", - "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", "dev": true, "requires": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } } }, - "babel-preset-jest": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-25.5.0.tgz", - "integrity": "sha512-8ZczygctQkBU+63DtSOKGh7tFL0CeCuz+1ieud9lJ1WPQ9O6A1a/r+LGn6Y705PA6whHQ3T1XuB/PmpfNYf8Fw==", + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^25.5.0", - "babel-preset-current-node-syntax": "^0.1.2" + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", "dev": true, "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "whatwg-encoding": "^1.0.5" } }, - "diff-sequences": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz", - "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", - "dev": true - }, - "expect": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-25.5.0.tgz", - "integrity": "sha512-w7KAXo0+6qqZZhovCaBVPSIqQp7/UTcx4M9uKt2m6pd2VB1voyC8JizLRqeEqud3AAVP02g+hbErDu5gu64tlA==", + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "ansi-styles": "^4.0.0", - "jest-get-type": "^25.2.6", - "jest-matcher-utils": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-regex-util": "^25.2.6" + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" } }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "jest-environment-jsdom": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz", + "integrity": "sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw==", + "dev": true, + "requires": { + "@jest/environment": "^27.5.1", + "@jest/fake-timers": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/node": "*", + "jest-mock": "^27.5.1", + "jest-util": "^27.5.1", + "jsdom": "^16.6.0" + } }, - "jest-config": { - "version": "25.5.4", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-25.5.4.tgz", - "integrity": "sha512-SZwR91SwcdK6bz7Gco8qL7YY2sx8tFJYzvg216DLihTWf+LKY/DoJXpM9nTzYakSyfblbqeU48p/p7Jzy05Atg==", + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^25.5.4", - "@jest/types": "^25.5.0", - "babel-jest": "^25.5.1", - "chalk": "^3.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^25.5.0", - "jest-environment-node": "^25.5.0", - "jest-get-type": "^25.2.6", - "jest-jasmine2": "^25.5.4", - "jest-regex-util": "^25.2.6", - "jest-resolve": "^25.5.1", - "jest-util": "^25.5.0", - "jest-validate": "^25.5.0", - "micromatch": "^4.0.2", - "pretty-format": "^25.5.0", - "realpath-native": "^2.0.0" + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" } }, - "jest-diff": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz", - "integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==", + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", "dev": true, "requires": { - "chalk": "^3.0.0", - "diff-sequences": "^25.2.6", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.5.0" + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" } }, - "jest-docblock": { - "version": "25.3.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-25.3.0.tgz", - "integrity": "sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg==", + "jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "requires": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + } + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", "dev": true, "requires": { - "detect-newline": "^3.0.0" + "xmlchars": "^2.2.0" } }, - "jest-each": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-25.5.0.tgz", - "integrity": "sha512-QBogUxna3D8vtiItvn54xXde7+vuzqRrEeaw8r1s+1TG9eZLVJE5ZkKoSUlqFwRjnlaA4hyKGiu9OlkFIuKnjA==", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "jest-get-type": "^25.2.6", - "jest-util": "^25.5.0", - "pretty-format": "^25.5.0" + "escape-string-regexp": "^2.0.0" } }, - "jest-environment-node": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-25.5.0.tgz", - "integrity": "sha512-iuxK6rQR2En9EID+2k+IBs5fCFd919gVVK5BeND82fYeLWPqvRcFNPKu9+gxTwfB5XwBGBvZ0HFQa+cHtIoslA==", + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", "dev": true, "requires": { - "@jest/environment": "^25.5.0", - "@jest/fake-timers": "^25.5.0", - "@jest/types": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-util": "^25.5.0", - "semver": "^6.3.0" + "xml-name-validator": "^3.0.0" } }, - "jest-get-type": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz", - "integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==", + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", "dev": true - }, - "jest-haste-map": { - "version": "25.5.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-25.5.1.tgz", - "integrity": "sha512-dddgh9UZjV7SCDQUrQ+5t9yy8iEgKc1AKqZR9YDww8xsVOtzPQSMVLDChc21+g29oTRexb9/B0bIlZL+sWmvAQ==", + } + } + }, + "jest-runtime": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.5.1.tgz", + "integrity": "sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A==", + "dev": true, + "requires": { + "@jest/environment": "^27.5.1", + "@jest/fake-timers": "^27.5.1", + "@jest/globals": "^27.5.1", + "@jest/source-map": "^27.5.1", + "@jest/test-result": "^27.5.1", + "@jest/transform": "^27.5.1", + "@jest/types": "^27.5.1", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "execa": "^5.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^27.5.1", + "jest-message-util": "^27.5.1", + "jest-mock": "^27.5.1", + "jest-regex-util": "^27.5.1", + "jest-resolve": "^27.5.1", + "jest-snapshot": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "dependencies": { + "@jest/console": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", + "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "@types/graceful-fs": "^4.1.2", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", - "graceful-fs": "^4.2.4", - "jest-serializer": "^25.5.0", - "jest-util": "^25.5.0", - "jest-worker": "^25.5.0", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7", - "which": "^2.0.2" + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "slash": "^3.0.0" } }, - "jest-leak-detector": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-25.5.0.tgz", - "integrity": "sha512-rV7JdLsanS8OkdDpZtgBf61L5xZ4NnYLBq72r6ldxahJWWczZjXawRsoHyXzibM5ed7C2QRjpp6ypgwGdKyoVA==", + "@jest/test-result": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", + "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", "dev": true, "requires": { - "jest-get-type": "^25.2.6", - "pretty-format": "^25.5.0" + "@jest/console": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" } }, - "jest-matcher-utils": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.5.0.tgz", - "integrity": "sha512-VWI269+9JS5cpndnpCwm7dy7JtGQT30UHfrnM3mXl22gHGt/b7NkjBqXfbhZ8V4B7ANUsjK18PlSBmG0YH7gjw==", + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, "requires": { - "chalk": "^3.0.0", - "jest-diff": "^25.5.0", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.5.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" } }, - "jest-mock": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-25.5.0.tgz", - "integrity": "sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA==", + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { - "@jest/types": "^25.5.0" + "@types/istanbul-lib-report": "*" } }, - "jest-resolve": { - "version": "25.5.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-25.5.1.tgz", - "integrity": "sha512-Hc09hYch5aWdtejsUZhA+vSzcotf7fajSlPA6EZPE1RmPBAD39XtJhvHWFStid58iit4IPDLI/Da4cwdDmAHiQ==", + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "browser-resolve": "^1.11.3", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "jest-pnp-resolver": "^1.2.1", - "read-pkg-up": "^7.0.1", - "realpath-native": "^2.0.0", - "resolve": "^1.17.0", - "slash": "^3.0.0" + "@types/yargs-parser": "*" } }, - "jest-runner": { - "version": "25.5.4", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-25.5.4.tgz", - "integrity": "sha512-V/2R7fKZo6blP8E9BL9vJ8aTU4TH2beuqGNxHbxi6t14XzTb+x90B3FRgdvuHm41GY8ch4xxvf0ATH4hdpjTqg==", + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "requires": { - "@jest/console": "^25.5.0", - "@jest/environment": "^25.5.0", - "@jest/test-result": "^25.5.0", - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^25.5.4", - "jest-docblock": "^25.3.0", - "jest-haste-map": "^25.5.1", - "jest-jasmine2": "^25.5.4", - "jest-leak-detector": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-resolve": "^25.5.1", - "jest-runtime": "^25.5.4", - "jest-util": "^25.5.0", - "jest-worker": "^25.5.0", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" } }, - "jest-runtime": { - "version": "25.5.4", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-25.5.4.tgz", - "integrity": "sha512-RWTt8LeWh3GvjYtASH2eezkc8AehVoWKK20udV6n3/gC87wlTbE1kIA+opCvNWyyPeBs6ptYsc6nyHUb1GlUVQ==", + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", "dev": true, "requires": { - "@jest/console": "^25.5.0", - "@jest/environment": "^25.5.0", - "@jest/globals": "^25.5.2", - "@jest/source-map": "^25.5.0", - "@jest/test-result": "^25.5.0", - "@jest/transform": "^25.5.1", - "@jest/types": "^25.5.0", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^25.5.4", - "jest-haste-map": "^25.5.1", - "jest-message-util": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-regex-util": "^25.2.6", - "jest-resolve": "^25.5.1", - "jest-snapshot": "^25.5.1", - "jest-util": "^25.5.0", - "jest-validate": "^25.5.0", - "realpath-native": "^2.0.0", + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.3.1" + "stack-utils": "^2.0.3" } }, - "jest-snapshot": { - "version": "25.5.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-25.5.1.tgz", - "integrity": "sha512-C02JE1TUe64p2v1auUJ2ze5vcuv32tkv9PyhEb318e8XOKF7MOyXdJ7kdjbvrp3ChPLU2usI7Rjxs97Dj5P0uQ==", + "jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", "dev": true, "requires": { - "@babel/types": "^7.0.0", - "@jest/types": "^25.5.0", - "@types/prettier": "^1.19.0", - "chalk": "^3.0.0", - "expect": "^25.5.0", - "graceful-fs": "^4.2.4", - "jest-diff": "^25.5.0", - "jest-get-type": "^25.2.6", - "jest-matcher-utils": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-resolve": "^25.5.1", - "make-dir": "^3.0.0", - "natural-compare": "^1.4.0", - "pretty-format": "^25.5.0", - "semver": "^6.3.0" + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" } }, - "jest-validate": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-25.5.0.tgz", - "integrity": "sha512-okUFKqhZIpo3jDdtUXUZ2LxGUZJIlfdYBvZb1aczzxrlyMlqdnnws9MOxezoLGhSaFc2XYaHNReNQfj5zPIWyQ==", + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "jest-get-type": "^25.2.6", - "leven": "^3.1.0", - "pretty-format": "^25.5.0" + "escape-string-regexp": "^2.0.0" } - }, - "jest-worker": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.5.0.tgz", - "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", + } + } + }, + "jest-serializer": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-25.5.0.tgz", + "integrity": "sha512-LxD8fY1lByomEPflwur9o4e2a5twSQ7TaVNLlFUuToIdoJuBt8tzHfCsZ42Ok6LkKXWzFWf3AGmheuLAA7LcCA==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4" + } + }, + "jest-snapshot": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.5.1.tgz", + "integrity": "sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA==", + "dev": true, + "requires": { + "@babel/core": "^7.7.2", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.0.0", + "@jest/transform": "^27.5.1", + "@jest/types": "^27.5.1", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^27.5.1", + "graceful-fs": "^4.2.9", + "jest-diff": "^27.5.1", + "jest-get-type": "^27.5.1", + "jest-haste-map": "^27.5.1", + "jest-matcher-utils": "^27.5.1", + "jest-message-util": "^27.5.1", + "jest-util": "^27.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^27.5.1", + "semver": "^7.3.2" + }, + "dependencies": { + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, "requires": { - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" } }, - "pretty-format": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", - "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^16.12.0" + "@types/istanbul-lib-report": "*" } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", "dev": true, "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "@types/yargs-parser": "*" } }, - "throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", "dev": true }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "jest-message-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", + "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.5.1", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^27.5.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" } }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "escape-string-regexp": "^2.0.0" } } } }, - "jest-matcher-utils": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", - "integrity": "sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "jest-diff": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" - }, - "dependencies": { - "jest-get-type": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", - "dev": true - } - } - }, - "jest-message-util": { + "jest-util": { "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz", - "integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.5.0.tgz", + "integrity": "sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", "@jest/types": "^25.5.0", - "@types/stack-utils": "^1.0.1", "chalk": "^3.0.0", "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "slash": "^3.0.0", - "stack-utils": "^1.0.1" + "is-ci": "^2.0.0", + "make-dir": "^3.0.0" }, "dependencies": { "chalk": { @@ -5278,48 +8124,49 @@ } } }, - "jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true - }, - "jest-regex-util": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-25.2.6.tgz", - "integrity": "sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw==", - "dev": true - }, - "jest-serializer": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-25.5.0.tgz", - "integrity": "sha512-LxD8fY1lByomEPflwur9o4e2a5twSQ7TaVNLlFUuToIdoJuBt8tzHfCsZ42Ok6LkKXWzFWf3AGmheuLAA7LcCA==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4" - } - }, - "jest-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.5.0.tgz", - "integrity": "sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA==", + "jest-validate": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz", + "integrity": "sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==", "dev": true, "requires": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "make-dir": "^3.0.0" + "@jest/types": "^27.5.1", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^27.5.1", + "leven": "^3.1.0", + "pretty-format": "^27.5.1" }, "dependencies": { - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" } } } @@ -5377,6 +8224,28 @@ } } }, + "jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "jpjs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/jpjs/-/jpjs-1.2.1.tgz", @@ -5402,7 +8271,7 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", "dev": true }, "jsdom": { @@ -5499,13 +8368,13 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, "json5": { @@ -5555,16 +8424,6 @@ "semver": "^5.6.0" }, "dependencies": { - "jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, "jws": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", @@ -5604,9 +8463,9 @@ } }, "jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "requires": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -5620,6 +8479,18 @@ "requires": { "jwa": "^2.0.0", "safe-buffer": "^5.0.1" + }, + "dependencies": { + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + } } }, "kind-of": { @@ -5643,7 +8514,7 @@ "language-tags": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=", + "integrity": "sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==", "dev": true, "requires": { "language-subtag-registry": "~0.3.2" @@ -5658,7 +8529,7 @@ "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, "requires": { "prelude-ls": "~1.1.2", @@ -5689,7 +8560,7 @@ "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, "lodash.includes": { @@ -5725,7 +8596,7 @@ "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true }, "lodash.merge": { @@ -5742,7 +8613,7 @@ "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", "dev": true }, "log-symbols": { @@ -5786,13 +8657,13 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { @@ -5809,7 +8680,7 @@ "log-update": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz", - "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=", + "integrity": "sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", @@ -5826,7 +8697,7 @@ "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", "dev": true, "requires": { "restore-cursor": "^2.0.0" @@ -5841,7 +8712,7 @@ "onetime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", "dev": true, "requires": { "mimic-fn": "^1.0.0" @@ -5850,7 +8721,7 @@ "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", "dev": true, "requires": { "onetime": "^2.0.0", @@ -5936,13 +8807,13 @@ "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", "dev": true }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", "dev": true, "requires": { "object-visit": "^1.0.0" @@ -5962,7 +8833,7 @@ "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, "merge-stream": { "version": "2.0.0", @@ -5973,7 +8844,7 @@ "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, "micromatch": { "version": "4.0.4", @@ -6082,7 +8953,7 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "negotiator": { @@ -6106,18 +8977,10 @@ "tslib": "^2.0.3" } }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true }, "node-releases": { @@ -6176,13 +9039,13 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", "dev": true, "requires": { "copy-descriptor": "^0.1.0", @@ -6239,7 +9102,7 @@ "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -6261,7 +9124,7 @@ "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", "dev": true, "requires": { "isobject": "^3.0.0" @@ -6314,7 +9177,7 @@ "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -6347,7 +9210,7 @@ "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" @@ -6417,7 +9280,7 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true }, "p-each-series": { @@ -6429,7 +9292,7 @@ "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true }, "p-limit": { @@ -6501,7 +9364,7 @@ "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", "dev": true }, "path-exists": { @@ -6513,7 +9376,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { @@ -6531,7 +9394,7 @@ "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "path-type": { "version": "4.0.0", @@ -6542,7 +9405,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, "picocolors": { @@ -6581,13 +9444,13 @@ "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", "dev": true }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true }, "prettier": { @@ -6630,11 +9493,6 @@ } } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" - }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -6691,13 +9549,13 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { @@ -6744,7 +9602,8 @@ "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true }, "pump": { "version": "3.0.0", @@ -6759,7 +9618,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "qs": { "version": "6.10.3", @@ -6769,10 +9629,16 @@ "side-channel": "^1.0.4" } }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==" }, "randombytes": { "version": "2.1.0", @@ -6845,7 +9711,7 @@ "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "requires": { "resolve": "^1.1.6" @@ -6947,7 +9813,7 @@ "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", "dev": true }, "repeat-element": { @@ -6959,7 +9825,7 @@ "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", "dev": true }, "request": { @@ -7060,7 +9926,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "require-main-filename": { @@ -7069,6 +9935,12 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -7105,7 +9977,13 @@ "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", + "dev": true + }, + "resolve.exports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", + "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", "dev": true }, "restore-cursor": { @@ -7124,6 +10002,15 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "rollup": { "version": "1.32.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.32.1.tgz", @@ -7161,7 +10048,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "jest-worker": { @@ -7212,7 +10099,7 @@ "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, "requires": { "graceful-fs": "^4.1.6" @@ -7298,7 +10185,7 @@ "safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", "dev": true, "requires": { "ret": "~0.1.10" @@ -7434,7 +10321,7 @@ "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -7443,7 +10330,7 @@ "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -7454,7 +10341,7 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", "dev": true }, "micromatch": { @@ -7481,7 +10368,7 @@ "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", "dev": true, "requires": { "remove-trailing-separator": "^1.0.1" @@ -7490,7 +10377,7 @@ "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", "dev": true, "requires": { "path-key": "^2.0.0" @@ -7526,7 +10413,7 @@ "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", "dev": true, "requires": { "is-number": "^3.0.0", @@ -7544,11 +10431,6 @@ } } }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, "saxes": { "version": "3.1.11", "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", @@ -7649,7 +10531,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "set-value": { @@ -7867,7 +10749,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "source-map-resolve": { @@ -7919,7 +10801,7 @@ "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -8017,7 +10899,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, "sshpk": { @@ -8057,7 +10939,7 @@ "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", "dev": true, "requires": { "define-property": "^0.2.5", @@ -8140,7 +11022,7 @@ "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "integrity": "sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==", "dev": true }, "stoppable": { @@ -8181,6 +11063,17 @@ } } }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz", @@ -8244,7 +11137,7 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", "dev": true }, "strip-final-newline": { @@ -8386,13 +11279,19 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "throat": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", + "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", "dev": true }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, "tiny-glob": { @@ -8423,13 +11322,13 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8438,7 +11337,7 @@ "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -8473,19 +11372,33 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", + "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "dev": true, "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "dependencies": { + "universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true + } } }, "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } }, "ts-jest": { "version": "27.1.5", @@ -10942,15 +13855,10 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, "requires": { "safe-buffer": "^5.0.1" @@ -10959,13 +13867,13 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", "dev": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, "requires": { "prelude-ls": "~1.1.2" @@ -11111,7 +14019,8 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true }, "unpipe": { "version": "1.0.0", @@ -11121,7 +14030,7 @@ "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", "dev": true, "requires": { "has-value": "^0.3.1", @@ -11131,7 +14040,7 @@ "has-value": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", "dev": true, "requires": { "get-value": "^2.0.3", @@ -11142,7 +14051,7 @@ "isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", "dev": true, "requires": { "isarray": "1.0.0" @@ -11153,7 +14062,7 @@ "has-values": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", "dev": true } } @@ -11170,9 +14079,19 @@ "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", "dev": true }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -11188,7 +14107,7 @@ "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "uuid": { "version": "8.3.2", @@ -11201,6 +14120,25 @@ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, + "v8-to-istanbul": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz", + "integrity": "sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true + } + } + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -11214,12 +14152,12 @@ "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, "requires": { "assert-plus": "^1.0.0", @@ -11279,7 +14217,7 @@ "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, "requires": { "defaults": "^1.0.3" @@ -11307,18 +14245,21 @@ "dev": true }, "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" }, "dependencies": { "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true } } }, @@ -11347,7 +14288,7 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, "word-wrap": { @@ -11402,7 +14343,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "write": { @@ -11438,32 +14379,47 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, - "xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - } - }, - "xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" - }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", diff --git a/package.json b/package.json index dff1ae3..8ad9d11 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,11 @@ "src" ], "engines": { - "node": ">=12" + "node": ">=14" + }, + "repository": { + "type": "git", + "url": "git://github.com/Azure-Samples/microsoft-identity-express.git" }, "scripts": { "start": "tsdx watch", @@ -40,6 +44,7 @@ "@types/jest": "^27.5.1", "@types/node": "^16.6.2", "husky": "^6.0.0", + "jest": "^27.0.0", "supertest": "^6.1.6", "ts-jest": "^27.1.5", "tsdx": "^0.14.1", @@ -48,10 +53,10 @@ "typescript": "^4.6.4" }, "dependencies": { - "@azure/identity": "^2.0.4", - "@azure/keyvault-certificates": "^4.4.0", - "@azure/keyvault-secrets": "^4.4.0", - "@azure/msal-node": "^1.12.0", + "@azure/identity": "^2.1.0", + "@azure/keyvault-certificates": "^4.6.0", + "@azure/keyvault-secrets": "^4.6.0", + "@azure/msal-node": "^1.14.1", "axios": "^0.27.2", "express": "^4.18.1", "express-session": "^1.17.3" diff --git a/src/client/webapp/MsalWebAppAuthClient.ts b/src/client/webapp/MsalWebAppAuthClient.ts index a99a7c3..2aee68c 100644 --- a/src/client/webapp/MsalWebAppAuthClient.ts +++ b/src/client/webapp/MsalWebAppAuthClient.ts @@ -4,7 +4,7 @@ */ import express, { RequestHandler, Request, Response, NextFunction, Router } from 'express'; -import { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, ClientAuthError, StringUtils, ResponseMode } from '@azure/msal-common'; +import { OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError, StringUtils, ResponseMode } from '@azure/msal-common'; import { AuthorizationCodeRequest, AuthorizationUrlRequest, Configuration, SilentFlowRequest } from '@azure/msal-node'; import { Resource, AppSettings, AccessRule, WebAppSettings } from '../../config/AppSettings'; import { TokenRequestOptions, GuardOptions, SignInOptions, SignOutOptions } from '../MiddlewareOptions'; @@ -271,8 +271,7 @@ export class MsalWebAppAuthClient extends BaseAuthClient { next(); } catch (error) { // in case there are no cached tokens, initiate an interactive call - // FIXME: ClientAuthError used for temporary workaround regarding issue: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/4878 - if (error instanceof InteractionRequiredAuthError || error instanceof ClientAuthError) { + if (error instanceof InteractionRequiredAuthError) { const appState = { appStage: AppStages.ACQUIRE_TOKEN, redirectTo: req.originalUrl, From 0e578977aa44ab08797295edc8769f763bf49971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Eri=C5=9Fen?= Date: Mon, 10 Oct 2022 17:04:31 -0700 Subject: [PATCH 3/4] bump msal-node --- package-lock.json | 15 +++++++++++---- package.json | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 631ef5d..94b27f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -178,13 +178,20 @@ "integrity": "sha512-W+SIsGSjkUAyDggA/6QVMKErttQ/8Bq9l/7ADr7GJwt9JFsc+XNBdQDsOsUvZ7YCVkZcSgzJw2MZJLIBqfQtQA==" }, "@azure/msal-node": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.14.1.tgz", - "integrity": "sha512-RftjLd35xlafh5cPT17zrzpYdcsbHKJal7R/FTbThpbetSk8y8vQHUzNwWNhBM6GFFiyMS4IQ+zs+z8bgJ4sKQ==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.14.2.tgz", + "integrity": "sha512-t3whVhhLdZVVeDEtUPD2Wqfa8BDi3EDMnpWp8dbuRW0GhUpikBfs4AQU0Fe6P9zS87n9LpmUTLrIcPEEuzkvfA==", "requires": { - "@azure/msal-common": "^7.5.0", + "@azure/msal-common": "^7.6.0", "jsonwebtoken": "^8.5.1", "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/msal-common": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.6.0.tgz", + "integrity": "sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q==" + } } }, "@babel/code-frame": { diff --git a/package.json b/package.json index 8ad9d11..569b92b 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@azure/identity": "^2.1.0", "@azure/keyvault-certificates": "^4.6.0", "@azure/keyvault-secrets": "^4.6.0", - "@azure/msal-node": "^1.14.1", + "@azure/msal-node": "^1.14.2", "axios": "^0.27.2", "express": "^4.18.1", "express-session": "^1.17.3" From 492ac051a5b309408c8821751cce14d40d38235b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 22:32:43 +0000 Subject: [PATCH 4/4] Bump got and nodemon in /demo Removes [got](https://github.com/sindresorhus/got). It's no longer used after updating ancestor dependency [nodemon](https://github.com/remy/nodemon). These dependencies need to be updated together. Removes `got` Updates `nodemon` from 2.0.18 to 2.0.20 - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v2.0.18...v2.0.20) --- updated-dependencies: - dependency-name: got dependency-type: indirect - dependency-name: nodemon dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- demo/package-lock.json | 1578 ++-------------------------------------- demo/package.json | 2 +- 2 files changed, 49 insertions(+), 1531 deletions(-) diff --git a/demo/package-lock.json b/demo/package-lock.json index 11e9cc6..b191009 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -20,7 +20,7 @@ "devDependencies": { "@playwright/test": "^1.22.2", "dotenv": "^16.0.1", - "nodemon": "^2.0.18", + "nodemon": "^2.0.20", "playwright": "^1.22.2" } }, @@ -40,27 +40,6 @@ "node": ">=14" } }, - "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@types/node": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", @@ -85,24 +64,6 @@ "node": ">= 0.6" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -204,28 +165,6 @@ "popper.js": "^1.16.1" } }, - "node_modules/boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -255,48 +194,6 @@ "node": ">= 0.8" } }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -309,18 +206,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -363,33 +248,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -422,23 +280,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "node_modules/configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, - "dependencies": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -471,15 +312,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -488,33 +320,6 @@ "ms": "2.0.0" } }, - "node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -540,18 +345,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/dotenv": { "version": "16.0.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", @@ -561,12 +354,6 @@ "node": ">=12" } }, - "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA==", - "dev": true - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -586,12 +373,6 @@ "node": ">=0.10.0" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -600,24 +381,6 @@ "node": ">= 0.8" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -845,18 +608,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -869,49 +620,6 @@ "node": ">= 6" } }, - "node_modules/global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", - "dev": true, - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -942,21 +650,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -989,38 +682,11 @@ "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "dev": true }, - "node_modules/import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -1041,18 +707,6 @@ "node": ">=8" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1062,15 +716,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1083,34 +728,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-npm": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", - "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1120,36 +737,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "node_modules/is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, "node_modules/jake": { "version": "10.8.5", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", @@ -1173,78 +760,6 @@ "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==", "peer": true }, - "node_modules/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", - "dev": true - }, - "node_modules/keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.0" - } - }, - "node_modules/latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "dependencies": { - "package-json": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1296,15 +811,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1316,12 +822,6 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1336,22 +836,21 @@ } }, "node_modules/nodemon": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.18.tgz", - "integrity": "sha512-uAvrKipi2zAz8E7nkSz4qW4F4zd5fs2wNGsTx+xXlP8KXqd9ucE0vY9wankOsPboeDyuUGN9vsXGV1pLn80l/A==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", "dev": true, - "hasInstallScript": true, "dependencies": { "chokidar": "^3.5.2", "debug": "^3.2.7", "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "pstree.remy": "^1.1.8", "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", "supports-color": "^5.5.0", "touch": "^3.1.0", - "undefsafe": "^2.0.5", - "update-notifier": "^5.1.0" + "undefsafe": "^2.0.5" }, "bin": { "nodemon": "bin/nodemon.js" @@ -1424,15 +923,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/object-inspect": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", @@ -1460,48 +950,6 @@ "node": ">= 0.8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/package-json/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1566,15 +1014,6 @@ "url": "https://opencollective.com/popperjs" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1593,28 +1032,6 @@ "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "dev": true }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, - "dependencies": { - "escape-goat": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/qs": { "version": "6.10.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", @@ -1659,27 +1076,6 @@ "node": ">= 0.8" } }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1692,39 +1088,6 @@ "node": ">=8.10.0" } }, - "node_modules/registry-auth-token": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.2.tgz", - "integrity": "sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg==", - "dev": true, - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", - "dev": true, - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1758,27 +1121,6 @@ "semver": "bin/semver" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "dependencies": { - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -1839,53 +1181,33 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "semver": "~7.0.0" }, "engines": { - "node": ">=8" + "node": ">=8.10.0" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/strip-json-comments": { + "node_modules/statuses": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "engines": { - "node": ">=0.10.0" + "node": ">= 0.8" } }, "node_modules/supports-color": { @@ -1899,15 +1221,6 @@ "node": ">=8" } }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1940,18 +1253,6 @@ "nodetouch": "bin/nodetouch.js" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1964,15 +1265,6 @@ "node": ">= 0.6" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", @@ -1990,18 +1282,6 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, - "node_modules/unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -2010,61 +1290,6 @@ "node": ">= 0.8" } }, - "node_modules/update-notifier": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", - "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", - "dev": true, - "dependencies": { - "boxen": "^5.0.0", - "chalk": "^4.1.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.4.0", - "is-npm": "^5.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.1.0", - "pupa": "^2.1.1", - "semver": "^7.3.4", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", - "dev": true, - "dependencies": { - "prepend-http": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2080,68 +1305,6 @@ "engines": { "node": ">= 0.8" } - }, - "node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } }, "dependencies": { @@ -2155,21 +1318,6 @@ "playwright-core": "1.22.2" } }, - "@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true - }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, - "requires": { - "defer-to-connect": "^1.0.1" - } - }, "@types/node": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", @@ -2191,21 +1339,6 @@ "negotiator": "0.6.3" } }, - "ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "requires": { - "string-width": "^4.1.0" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -2284,22 +1417,6 @@ "integrity": "sha512-0dj+VgI9Ecom+rvvpNZ4MUZJz8dcX7WCX+eTID9+/8HgOkv3dsRzi8BGeZJCQU6flWQVYxwTQnEZFrmJSEO7og==", "requires": {} }, - "boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2323,38 +1440,6 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, - "cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "dependencies": { - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } - } - }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -2364,12 +1449,6 @@ "get-intrinsic": "^1.0.2" } }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2390,30 +1469,9 @@ "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true - }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" } }, "color-convert": { @@ -2442,20 +1500,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, - "requires": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - } - }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -2479,12 +1523,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2493,27 +1531,6 @@ "ms": "2.0.0" } }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2529,27 +1546,12 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "requires": { - "is-obj": "^2.0.0" - } - }, "dotenv": { "version": "16.0.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", "dev": true }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA==", - "dev": true - }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2563,32 +1565,11 @@ "jake": "^10.8.5" } }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2761,15 +1742,6 @@ "has-symbols": "^1.0.3" } }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -2779,40 +1751,6 @@ "is-glob": "^4.0.1" } }, - "global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", - "dev": true, - "requires": { - "ini": "2.0.0" - } - }, - "got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2831,18 +1769,6 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, - "has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true - }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, "http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -2869,29 +1795,11 @@ "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "dev": true }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==", - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true - }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true - }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -2906,27 +1814,12 @@ "binary-extensions": "^2.0.0" } }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2936,52 +1829,12 @@ "is-extglob": "^2.1.1" } }, - "is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, - "requires": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - } - }, - "is-npm": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", - "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", - "dev": true - }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, "jake": { "version": "10.8.5", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", @@ -2999,62 +1852,6 @@ "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==", "peer": true }, - "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", - "dev": true - }, - "keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, - "requires": { - "json-buffer": "3.0.0" - } - }, - "latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "requires": { - "package-json": "^6.3.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -3088,12 +1885,6 @@ "mime-db": "1.52.0" } }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3102,12 +1893,6 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3119,21 +1904,21 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "nodemon": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.18.tgz", - "integrity": "sha512-uAvrKipi2zAz8E7nkSz4qW4F4zd5fs2wNGsTx+xXlP8KXqd9ucE0vY9wankOsPboeDyuUGN9vsXGV1pLn80l/A==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", "dev": true, "requires": { "chokidar": "^3.5.2", "debug": "^3.2.7", "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "pstree.remy": "^1.1.8", "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", "supports-color": "^5.5.0", "touch": "^3.1.0", - "undefsafe": "^2.0.5", - "update-notifier": "^5.1.0" + "undefsafe": "^2.0.5" }, "dependencies": { "debug": { @@ -3183,12 +1968,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true - }, "object-inspect": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", @@ -3207,41 +1986,6 @@ "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true - }, - "package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "requires": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3279,12 +2023,6 @@ "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", "peer": true }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", - "dev": true - }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -3300,25 +2038,6 @@ "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "dev": true }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, - "requires": { - "escape-goat": "^2.0.0" - } - }, "qs": { "version": "6.10.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", @@ -3348,26 +2067,6 @@ "unpipe": "1.0.0" } }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - } - } - }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3377,33 +2076,6 @@ "picomatch": "^2.2.1" } }, - "registry-auth-token": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.2.tgz", - "integrity": "sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg==", - "dev": true, - "requires": { - "rc": "1.2.8" - } - }, - "registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "requires": { - "rc": "^1.2.8" - } - }, - "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", - "dev": true, - "requires": { - "lowercase-keys": "^1.0.0" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3420,23 +2092,6 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, - "semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -3490,42 +2145,27 @@ "object-inspect": "^1.9.0" } }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", "dev": true, "requires": { - "ansi-regex": "^5.0.1" + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } } }, - "strip-json-comments": { + "statuses": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, "supports-color": { "version": "7.2.0", @@ -3535,12 +2175,6 @@ "has-flag": "^4.0.0" } }, - "to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3564,12 +2198,6 @@ "nopt": "~1.0.10" } }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -3579,15 +2207,6 @@ "mime-types": "~2.1.24" } }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, "uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", @@ -3602,62 +2221,11 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, - "unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "requires": { - "crypto-random-string": "^2.0.0" - } - }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, - "update-notifier": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", - "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", - "dev": true, - "requires": { - "boxen": "^5.0.0", - "chalk": "^4.1.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.4.0", - "is-npm": "^5.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.1.0", - "pupa": "^2.1.1", - "semver": "^7.3.4", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "dependencies": { - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -3667,56 +2235,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" - }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "requires": { - "string-width": "^4.0.0" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } } diff --git a/demo/package.json b/demo/package.json index 258a6b0..3d33990 100644 --- a/demo/package.json +++ b/demo/package.json @@ -24,7 +24,7 @@ "devDependencies": { "@playwright/test": "^1.22.2", "dotenv": "^16.0.1", - "nodemon": "^2.0.18", + "nodemon": "^2.0.20", "playwright": "^1.22.2" } }