Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/msal-node

Package Overview
Dependencies
Maintainers
3
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-node - npm Package Compare versions

Comparing version 1.0.0-alpha.9 to 1.0.0-alpha.10

33

CHANGELOG.json

@@ -5,2 +5,35 @@ {

{
"date": "Wed, 14 Oct 2020 23:45:07 GMT",
"tag": "@azure/msal-node_v1.0.0-alpha.10",
"version": "1.0.0-alpha.10",
"comments": {
"prerelease": [
{
"comment": "Docs update for msal-node release",
"author": "sameera.gajjarapu@microsoft.com",
"commit": "20718209d5d567c02223a7f1b220b4aa40ad6817",
"package": "@azure/msal-node"
},
{
"comment": "Export error types for msal-node",
"author": "sameera.gajjarapu@microsoft.com",
"commit": "7a493ee25d80a31cbfa21f04aa952a9ac3528dfb",
"package": "@azure/msal-node"
},
{
"comment": "Add uuid as dependency in msal-node package.json so it is installed with the library",
"author": "hectormgdev@gmail.com",
"commit": "cedeefacc09b755fc2edf59440ef7c60c4b872f8",
"package": "@azure/msal-node"
},
{
"comment": "Update TokenCache interface (#2348)",
"author": "sameera.gajjarapu@microsoft.com",
"commit": "26723689e35918c59bd6ce58ba8cb886118676c6",
"package": "@azure/msal-node"
}
]
}
},
{
"date": "Fri, 02 Oct 2020 17:42:35 GMT",

@@ -7,0 +40,0 @@ "tag": "@azure/msal-node_v1.0.0-alpha.9",

13

changelog.md
# Change Log - @azure/msal-node
This log was last generated on Fri, 02 Oct 2020 17:42:35 GMT and should not be manually modified.
This log was last generated on Wed, 14 Oct 2020 23:45:07 GMT and should not be manually modified.
<!-- Start content -->
## 1.0.0-alpha.10
Wed, 14 Oct 2020 23:45:07 GMT
### Changes
- Docs update for msal-node release (sameera.gajjarapu@microsoft.com)
- Export error types for msal-node (sameera.gajjarapu@microsoft.com)
- Add uuid as dependency in msal-node package.json so it is installed with the library (hectormgdev@gmail.com)
- Update TokenCache interface (#2348) (sameera.gajjarapu@microsoft.com)
## 1.0.0-alpha.9

@@ -8,0 +19,0 @@

18

dist/cache/TokenCache.d.ts
import { Storage } from "./Storage";
import { AccountInfo, Logger } from "@azure/msal-common";
import { ICachePlugin } from "./ICachePlugin";
import { AccountInfo, Logger, ISerializableTokenCache, ICachePlugin } from "@azure/msal-common";
/**
* In-memory token cache manager
*/
export declare class TokenCache {
export declare class TokenCache implements ISerializableTokenCache {
private storage;

@@ -28,14 +27,5 @@ private cacheHasChanged;

/**
* Serializes cache into JSON and calls ICachePlugin.writeToStorage. ICachePlugin must be set on ClientApplication
*/
writeToPersistence(): Promise<void>;
/**
* Calls ICachePlugin.readFromStorage and deserializes JSON to in-memory cache.
* ICachePlugin must be set on ClientApplication.
*/
readFromPersistence(): Promise<void>;
/**
* API that retrieves all accounts currently in cache to the user
*/
getAllAccounts(): AccountInfo[];
getAllAccounts(): Promise<AccountInfo[]>;
/**

@@ -45,3 +35,3 @@ * API to remove a specific account and the relevant data from cache

*/
removeAccount(account: AccountInfo): void;
removeAccount(account: AccountInfo): Promise<void>;
/**

@@ -48,0 +38,0 @@ * Called when the cache has changed state.

@@ -1,3 +0,2 @@

import { LoggerOptions, INetworkModule } from "@azure/msal-common";
import { ICachePlugin } from "../cache/ICachePlugin";
import { LoggerOptions, INetworkModule, ICachePlugin } from "@azure/msal-common";
/**

@@ -4,0 +3,0 @@ * - clientId - Client id of the application.

@@ -6,4 +6,3 @@ export { PublicClientApplication } from "./client/PublicClientApplication";

export { TokenCache } from "./cache/TokenCache";
export { ICachePlugin } from "./cache/ICachePlugin";
export { CryptoProvider } from "./crypto/CryptoProvider";
export { AuthorizationCodeRequest, DeviceCodeRequest, RefreshTokenRequest, PromptValue, ResponseMode, AuthenticationResult, AccountInfo, AuthError, AuthErrorMessage, INetworkModule, NetworkRequestOptions, NetworkResponse, LogLevel, } from "@azure/msal-common";
export { AuthorizationCodeRequest, DeviceCodeRequest, RefreshTokenRequest, PromptValue, ResponseMode, AuthenticationResult, AccountInfo, AuthError, AuthErrorMessage, InteractionRequiredAuthError, ServerError, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, INetworkModule, NetworkRequestOptions, NetworkResponse, LogLevel, ICachePlugin, TokenCacheContext, ISerializableTokenCache } from "@azure/msal-common";

@@ -73,2 +73,15 @@ 'use strict';

// Asynchronously await a promise and pass the result to a finally continuation
function _finallyRethrows(body, finalizer) {
try {
var result = body();
} catch (e) {
return finalizer(true, e);
}
if (result && result.then) {
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
}
return finalizer(false, result);
}
/*

@@ -1013,2 +1026,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved.

this.setCache(cache);
this.emitChange();
}

@@ -1148,38 +1162,40 @@

/**
* Serializes cache into JSON and calls ICachePlugin.writeToStorage. ICachePlugin must be set on ClientApplication
* API that retrieves all accounts currently in cache to the user
*/
;
_proto.writeToPersistence = function writeToPersistence() {
_proto.getAllAccounts = function getAllAccounts() {
try {
var _this2 = this;
_this2.logger.verbose("Writing to persistent cache");
_this2.logger.verbose("getAllAccounts called");
return Promise.resolve(function () {
if (_this2.persistence) {
_this2.logger.verbose("cachePlugin (persistent cache) not set by the user");
var cacheContext;
return Promise.resolve(_finallyRethrows(function () {
function _temp2() {
return _this2.storage.getAllAccounts();
}
var cache = Serializer.serializeAllCache(_this2.storage.getInMemoryCache());
var _temp = function () {
if (_this2.persistence) {
cacheContext = new msalCommon.TokenCacheContext(_this2, false);
return Promise.resolve(_this2.persistence.beforeCacheAccess(cacheContext)).then(function () {});
}
}();
var getMergedState = function getMergedState(stateFromDisk) {
if (!msalCommon.StringUtils.isEmpty(stateFromDisk)) {
_this2.logger.verbose("Reading state from disk");
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
}, function (_wasThrown, _result) {
function _temp4() {
if (_wasThrown) throw _result;
return _result;
}
_this2.cacheSnapshot = stateFromDisk;
cache = _this2.mergeState(JSON.parse(stateFromDisk), cache);
} else {
_this2.logger.verbose("No state from disk");
}
var _temp3 = function () {
if (_this2.persistence && cacheContext) {
return Promise.resolve(_this2.persistence.afterCacheAccess(cacheContext)).then(function () {});
}
}();
return JSON.stringify(cache);
};
return Promise.resolve(_this2.persistence.writeToStorage(getMergedState)).then(function () {
_this2.cacheHasChanged = false;
});
} else {
throw msalCommon.ClientAuthError.createCachePluginError();
}
}());
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
}));
} catch (e) {

@@ -1190,36 +1206,44 @@ return Promise.reject(e);

/**
* Calls ICachePlugin.readFromStorage and deserializes JSON to in-memory cache.
* ICachePlugin must be set on ClientApplication.
* API to remove a specific account and the relevant data from cache
* @param account
*/
;
_proto.readFromPersistence = function readFromPersistence() {
_proto.removeAccount = function removeAccount(account) {
try {
var _this4 = this;
_this4.logger.verbose("Reading from persistent cache");
_this4.logger.verbose("removeAccount called");
return Promise.resolve(function () {
if (_this4.persistence) {
return Promise.resolve(_this4.persistence.readFromStorage()).then(function (_this3$persistence$re) {
_this4.cacheSnapshot = _this3$persistence$re;
var cacheContext;
if (!msalCommon.StringUtils.isEmpty(_this4.cacheSnapshot)) {
_this4.logger.verbose("Reading cache snapshot from disk");
var _temp10 = _finallyRethrows(function () {
function _temp6() {
_this4.storage.removeAccount(msalCommon.AccountEntity.generateAccountCacheKey(account));
}
var cache = _this4.overlayDefaults(JSON.parse(_this4.cacheSnapshot));
var _temp5 = function () {
if (_this4.persistence) {
cacheContext = new msalCommon.TokenCacheContext(_this4, true);
return Promise.resolve(_this4.persistence.beforeCacheAccess(cacheContext)).then(function () {});
}
}();
_this4.logger.verbose("Deserializing JSON");
return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
}, function (_wasThrown2, _result2) {
function _temp8() {
if (_wasThrown2) throw _result2;
return _result2;
}
var deserializedCache = Deserializer.deserializeAllCache(cache);
var _temp7 = function () {
if (_this4.persistence && cacheContext) {
return Promise.resolve(_this4.persistence.afterCacheAccess(cacheContext)).then(function () {});
}
}();
_this4.storage.setInMemoryCache(deserializedCache);
} else {
_this4.logger.verbose("No cache snapshot to overlay and deserialize");
}
});
} else {
throw msalCommon.ClientAuthError.createCachePluginError();
}
}());
return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
});
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
} catch (e) {

@@ -1230,21 +1254,2 @@ return Promise.reject(e);

/**
* API that retrieves all accounts currently in cache to the user
*/
;
_proto.getAllAccounts = function getAllAccounts() {
this.logger.verbose("getAllAccounts called");
return this.storage.getAllAccounts();
}
/**
* API to remove a specific account and the relevant data from cache
* @param account
*/
;
_proto.removeAccount = function removeAccount(account) {
this.logger.verbose("removeAccount called");
this.storage.removeAccount(msalCommon.AccountEntity.generateAccountCacheKey(account));
}
/**
* Called when the cache has changed state.

@@ -1351,3 +1356,3 @@ */

var version = "1.0.0-alpha.9";
var version = "1.0.0-alpha.10";

@@ -1539,3 +1544,5 @@ var ClientApplication = /*#__PURE__*/function () {

os: process.platform || ""
}
},
persistencePlugin: _this10.config.cache.cachePlugin,
serializableCache: _this10.tokenCache
};

@@ -1910,2 +1917,32 @@ });

});
Object.defineProperty(exports, 'ClientAuthError', {
enumerable: true,
get: function () {
return msalCommon.ClientAuthError;
}
});
Object.defineProperty(exports, 'ClientAuthErrorMessage', {
enumerable: true,
get: function () {
return msalCommon.ClientAuthErrorMessage;
}
});
Object.defineProperty(exports, 'ClientConfigurationError', {
enumerable: true,
get: function () {
return msalCommon.ClientConfigurationError;
}
});
Object.defineProperty(exports, 'ClientConfigurationErrorMessage', {
enumerable: true,
get: function () {
return msalCommon.ClientConfigurationErrorMessage;
}
});
Object.defineProperty(exports, 'InteractionRequiredAuthError', {
enumerable: true,
get: function () {
return msalCommon.InteractionRequiredAuthError;
}
});
Object.defineProperty(exports, 'LogLevel', {

@@ -1929,2 +1966,14 @@ enumerable: true,

});
Object.defineProperty(exports, 'ServerError', {
enumerable: true,
get: function () {
return msalCommon.ServerError;
}
});
Object.defineProperty(exports, 'TokenCacheContext', {
enumerable: true,
get: function () {
return msalCommon.TokenCacheContext;
}
});
exports.ConfidentialClientApplication = ConfidentialClientApplication;

@@ -1931,0 +1980,0 @@ exports.CryptoProvider = CryptoProvider;

@@ -1,2 +0,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,r=require("@azure/msal-common"),n=e(require("axios")),i=e(require("debug")),o=require("uuid"),a=e(require("crypto")),c=require("jsonwebtoken");function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function l(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator"))),function(e){e.GET="get",e.POST="post"}(t||(t={}));var h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";!function(e){e[e.acquireTokenSilent=62]="acquireTokenSilent",e[e.acquireTokenByCode=871]="acquireTokenByCode",e[e.acquireTokenByRefreshToken=872]="acquireTokenByRefreshToken",e[e.acquireTokenByDeviceCode=671]="acquireTokenByDeviceCode",e[e.acquireTokenByClientCredential=771]="acquireTokenByClientCredential"}(h||(h={}));var d=function(){function e(){n.defaults.validateStatus=function(){return!0}}var r=e.prototype;return r.sendGetRequestAsync=function(e,r){try{return Promise.resolve(n({method:t.GET,url:e,headers:r&&r.headers})).then((function(e){return{headers:e.headers,body:e.data,status:e.status}}))}catch(e){return Promise.reject(e)}},r.sendPostRequestAsync=function(e,r){try{return Promise.resolve(n({method:t.POST,url:e,data:r&&r.body||"",headers:r&&r.headers})).then((function(e){return{headers:e.headers,body:e.data,status:e.status}}))}catch(e){return Promise.reject(e)}},e}(),g={clientId:"",authority:"",clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",privateKey:""},knownAuthorities:[],cloudDiscoveryMetadata:"",clientCapabilities:[]},m={},p={loggerOptions:{loggerCallback:function(e,t,n){i("msal:"+r.LogLevel[e]+(n?"-Pii":""))(t)},piiLoggingEnabled:!1,logLevel:r.LogLevel.Info},networkClient:function(){function e(){}return e.getNetworkClient=function(){return new d},e}().getNetworkClient()};function y(e){var t=e.cache,r=e.system;return{auth:s({},g,{},e.auth),cache:s({},m,{},t),system:s({},p,{},r)}}var v=function(){function e(){}return e.generateGuid=function(){return o.v4()},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}(),C=function(){function e(){}return e.base64Encode=function(e,t){return Buffer.from(e,t).toString("base64")},e.base64EncodeUrl=function(t,r){return e.base64Encode(t,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.base64Decode=function(e){return Buffer.from(e,"base64").toString("utf8")},e.base64DecodeUrl=function(t){for(var r=t.replace(/-/g,"+").replace(/_/g,"/");r.length%4;)r+="=";return e.base64Decode(r)},e}(),k=function(){function e(){}var t=e.prototype;return t.generatePkceCodes=function(){try{var e=this.generateCodeVerifier(),t=this.generateCodeChallengeFromVerifier(e);return Promise.resolve({verifier:e,challenge:t})}catch(e){return Promise.reject(e)}},t.generateCodeVerifier=function(){var e=a.randomBytes(32),t=this.bufferToCVString(e);return C.base64EncodeUrl(t)},t.generateCodeChallengeFromVerifier=function(e){return C.base64EncodeUrl(this.sha256(e).toString("ascii"))},t.sha256=function(e){return a.createHash("sha256").update(e).digest()},t.bufferToCVString=function(e){for(var t=[],r=0;r<e.byteLength;r+=1)t.push(f[e[r]%f.length]);return t.join("")},e}(),b=function(){function e(){this.pkceGenerator=new k}var t=e.prototype;return t.createNewGuid=function(){return v.generateGuid()},t.base64Encode=function(e){return C.base64Encode(e)},t.base64Decode=function(e){return C.base64Decode(e)},t.generatePkceCodes=function(){return this.pkceGenerator.generatePkceCodes()},t.getPublicKeyThumbprint=function(){throw new Error("Method not implemented.")},t.signJwt=function(){throw new Error("Method not implemented.")},e}(),T=function(){function e(){}return e.deserializeJSONBlob=function(e){return r.StringUtils.isEmpty(e)?{}:JSON.parse(e)},e.deserializeAccounts=function(e){var t={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,realm:i.realm,localAccountId:i.local_account_id,username:i.username,authorityType:i.authority_type,name:i.name,clientInfo:i.client_info,lastModificationTime:i.last_modification_time,lastModificationApp:i.last_modification_app},a=new r.AccountEntity;r.CacheManager.toObject(a,o),t[n]=a})),t},e.deserializeIdTokens=function(e){var t={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm},a=new r.IdTokenEntity;r.CacheManager.toObject(a,o),t[n]=a})),t},e.deserializeAccessTokens=function(e){var t={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm,target:i.target,cachedAt:i.cached_at,expiresOn:i.expires_on,extendedExpiresOn:i.extended_expires_on,refreshOn:i.refresh_on,keyId:i.key_id,tokenType:i.token_type},a=new r.AccessTokenEntity;r.CacheManager.toObject(a,o),t[n]=a})),t},e.deserializeRefreshTokens=function(e){var t={};return e&&Object.keys(e).map((function(n){var i=e[n],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,familyId:i.family_id,target:i.target,realm:i.realm},a=new r.RefreshTokenEntity;r.CacheManager.toObject(a,o),t[n]=a})),t},e.deserializeAppMetadata=function(e){var t={};return e&&Object.keys(e).map((function(n){var i=e[n],o={clientId:i.client_id,environment:i.environment,familyId:i.family_id},a=new r.AppMetadataEntity;r.CacheManager.toObject(a,o),t[n]=a})),t},e.deserializeAllCache=function(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}},e}(),A=function(){function e(){}return e.serializeJSONBlob=function(e){return JSON.stringify(e)},e.serializeAccounts=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,realm:n.realm,local_account_id:n.localAccountId,username:n.username,authority_type:n.authorityType,name:n.name,client_info:n.clientInfo,last_modification_time:n.lastModificationTime,last_modification_app:n.lastModificationApp}})),t},e.serializeIdTokens=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,realm:n.realm}})),t},e.serializeAccessTokens=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,realm:n.realm,target:n.target,cached_at:n.cachedAt,expires_on:n.expiresOn,extended_expires_on:n.extendedExpiresOn,refresh_on:n.refreshOn,key_id:n.keyId,token_type:n.tokenType}})),t},e.serializeRefreshTokens=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,family_id:n.familyId,target:n.target,realm:n.realm}})),t},e.serializeAppMetadata=function(e){var t={};return Object.keys(e).map((function(r){var n=e[r];t[r]={client_id:n.clientId,environment:n.environment,family_id:n.familyId}})),t},e.serializeAllCache=function(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}},e}(),I=function(e){function t(t){var r;return(r=e.call(this)||this).cache={},r.changeEmitters=[],r.logger=t,r}u(t,e);var n=t.prototype;return n.registerChangeEmitter=function(e){this.changeEmitters.push(e)},n.emitChange=function(){this.changeEmitters.forEach((function(e){return e.call(null)}))},n.cacheToInMemoryCache=function(e){var t={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(var n in e)if(e[n]instanceof r.AccountEntity)t.accounts[n]=e[n];else if(e[n]instanceof r.IdTokenEntity)t.idTokens[n]=e[n];else if(e[n]instanceof r.AccessTokenEntity)t.accessTokens[n]=e[n];else if(e[n]instanceof r.RefreshTokenEntity)t.refreshTokens[n]=e[n];else{if(!(e[n]instanceof r.AppMetadataEntity))continue;t.appMetadata[n]=e[n]}return t},n.inMemoryCacheToCache=function(e){return this.getCache(),s({},e.accounts,{},e.idTokens,{},e.accessTokens,{},e.refreshTokens,{},e.appMetadata)},n.getInMemoryCache=function(){return this.logger.verbose("Getting in-memory cache"),this.cacheToInMemoryCache(this.getCache())},n.setInMemoryCache=function(e){this.logger.verbose("Setting in-memory cache");var t=this.inMemoryCacheToCache(e);this.setCache(t),this.emitChange()},n.getCache=function(){return this.logger.verbose("Getting cache key-value store"),this.cache},n.setCache=function(e){this.logger.verbose("Setting cache key value store"),this.cache=e,this.emitChange()},n.setItem=function(e,t){this.logger.verbosePii("Item key: "+e);var r=this.getCache();r[e]=t,this.setCache(r)},n.getItem=function(e){return this.logger.verbosePii("Item key: "+e),this.getCache()[e]},n.removeItem=function(e){this.logger.verbosePii("Item key: "+e);var t=!1,r=this.getCache();return r[e]&&(delete r[e],t=!0),t&&this.setCache(r),t},n.containsKey=function(e){return this.getKeys().includes(e)},n.getKeys=function(){this.logger.verbose("Retrieving all cache keys");var e=this.getCache();return[].concat(Object.keys(e))},n.clear=function(){var e=this;this.logger.verbose("Clearing cache entries created by MSAL"),this.getKeys().forEach((function(t){e.removeItem(t)})),this.emitChange()},t.generateInMemoryCache=function(e){return T.deserializeAllCache(T.deserializeJSONBlob(e))},t.generateJsonCache=function(e){return A.serializeAllCache(e)},t}(r.CacheManager),S={},O={},_={},w={},E={},P=function(){function e(e,t,r){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),r&&(this.persistence=r),this.logger=t}var t=e.prototype;return t.hasChanged=function(){return this.cacheHasChanged},t.serialize=function(){this.logger.verbose("Serializing in-memory cache");var e=A.serializeAllCache(this.storage.getInMemoryCache());return r.StringUtils.isEmpty(this.cacheSnapshot)?this.logger.verbose("No cache snapshot to merge"):(this.logger.verbose("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)),this.cacheHasChanged=!1,JSON.stringify(e)},t.deserialize=function(e){if(this.logger.verbose("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,r.StringUtils.isEmpty(this.cacheSnapshot))this.logger.verbose("No cache snapshot to deserialize");else{this.logger.verbose("Reading cache snapshot from disk");var t=T.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(t)}},t.writeToPersistence=function(){try{var e=this;return e.logger.verbose("Writing to persistent cache"),Promise.resolve(function(){if(e.persistence){e.logger.verbose("cachePlugin (persistent cache) not set by the user");var t=A.serializeAllCache(e.storage.getInMemoryCache());return Promise.resolve(e.persistence.writeToStorage((function(n){return r.StringUtils.isEmpty(n)?e.logger.verbose("No state from disk"):(e.logger.verbose("Reading state from disk"),e.cacheSnapshot=n,t=e.mergeState(JSON.parse(n),t)),JSON.stringify(t)}))).then((function(){e.cacheHasChanged=!1}))}throw r.ClientAuthError.createCachePluginError()}())}catch(e){return Promise.reject(e)}},t.readFromPersistence=function(){try{var e=this;return e.logger.verbose("Reading from persistent cache"),Promise.resolve(function(){if(e.persistence)return Promise.resolve(e.persistence.readFromStorage()).then((function(t){if(e.cacheSnapshot=t,r.StringUtils.isEmpty(e.cacheSnapshot))e.logger.verbose("No cache snapshot to overlay and deserialize");else{e.logger.verbose("Reading cache snapshot from disk");var n=e.overlayDefaults(JSON.parse(e.cacheSnapshot));e.logger.verbose("Deserializing JSON");var i=T.deserializeAllCache(n);e.storage.setInMemoryCache(i)}}));throw r.ClientAuthError.createCachePluginError()}())}catch(e){return Promise.reject(e)}},t.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.storage.getAllAccounts()},t.removeAccount=function(e){this.logger.verbose("removeAccount called"),this.storage.removeAccount(r.AccountEntity.generateAccountCacheKey(e))},t.handleChangeEvent=function(){this.cacheHasChanged=!0},t.mergeState=function(e,t){this.logger.verbose("Merging in-memory cache with cache snapshot");var r=this.mergeRemovals(e,t);return this.mergeUpdates(r,t)},t.mergeUpdates=function(e,t){var r=this;return Object.keys(t).forEach((function(n){var i=t[n];if(e.hasOwnProperty(n)){var o=null!==i,a="object"==typeof i,c=!Array.isArray(i);o&&a&&c&&null!=e[n]?r.mergeUpdates(e[n],i):e[n]=i}else null!==i&&(e[n]=i)})),e},t.mergeRemovals=function(e,t){return this.logger.verbose("Remove updated entries in cache"),s({},e,{Account:null!=e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,AccessToken:null!=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,RefreshToken:null!=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,IdToken:null!=e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,AppMetadata:null!=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata})},t.mergeRemovalsDict=function(e,t){var r=s({},e);return Object.keys(e).forEach((function(e){t&&t.hasOwnProperty(e)||delete r[e]})),r},t.overlayDefaults=function(e){return this.logger.verbose("Overlaying input cache with the default cache"),{Account:s({},S,{},e.Account),IdToken:s({},O,{},e.IdToken),AccessToken:s({},_,{},e.AccessToken),RefreshToken:s({},w,{},e.RefreshToken),AppMetadata:s({},E,{},e.AppMetadata)}},e}(),M=function(){function e(e){this.config=y(e),this.logger=new r.Logger(this.config.system.loggerOptions),this.storage=new I(this.logger),this.tokenCache=new P(this.storage,this.logger,this.config.cache.cachePlugin),this.cryptoProvider=new b,r.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.knownAuthorities,this.config.auth.cloudDiscoveryMetadata)}var t,n=e.prototype;return n.getAuthCodeUrl=function(e){try{var t=this;return t.logger.info("getAuthCodeUrl called"),Promise.resolve(t.buildOauthClientConfiguration(e.authority)).then((function(n){return t.logger.verbose("Auth client config generated"),new r.AuthorizationCodeClient(n).getAuthCodeUrl(t.initializeRequest(e))}))}catch(e){return Promise.reject(e)}},n.acquireTokenByCode=function(e){try{var t=this;t.logger.info("acquireTokenByCode called");var n=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByCode,n.correlationId);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new r.AuthorizationCodeClient(e).acquireToken(n)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},n.acquireTokenByRefreshToken=function(e){try{var t=this;t.logger.info("acquireTokenByRefreshToken called");var n=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByRefreshToken,n.correlationId);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new r.RefreshTokenClient(e).acquireToken(n)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},n.acquireTokenSilent=function(e){try{var t=this,n=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenSilent,n.correlationId,n.forceRefresh);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return new r.SilentFlowClient(e).acquireToken(n)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},n.getTokenCache=function(){return this.logger.info("getTokenCache called"),this.tokenCache},n.buildOauthClientConfiguration=function(e,t){try{var r=this;r.logger.verbose("buildOauthClientConfiguration called");var n=r.config.auth.clientId;return Promise.resolve(r.createAuthority(e)).then((function(e){return{authOptions:{clientId:n,authority:e,knownAuthorities:r.config.auth.knownAuthorities,cloudDiscoveryMetadata:r.config.auth.cloudDiscoveryMetadata,clientCapabilities:r.config.auth.clientCapabilities},loggerOptions:{loggerCallback:r.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:r.config.system.loggerOptions.piiLoggingEnabled},cryptoInterface:r.cryptoProvider,networkInterface:r.config.system.networkClient,storageInterface:r.storage,serverTelemetryManager:t,clientCredentials:{clientSecret:r.clientSecret,clientAssertion:r.clientAssertion?r.getClientAssertion():void 0},libraryInfo:{sku:"msal.js.node",version:"1.0.0-alpha.9",cpu:process.arch||"",os:process.platform||""}}}))}catch(e){return Promise.reject(e)}},n.getClientAssertion=function(){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,this._authority.tokenEndpoint),assertionType:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},n.initializeRequest=function(e){return this.logger.verbose("initializeRequestScopes called"),s({},e,{scopes:[].concat(e&&e.scopes||[],[r.Constants.OPENID_SCOPE,r.Constants.PROFILE_SCOPE,r.Constants.OFFLINE_ACCESS_SCOPE]),correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid()})},n.initializeServerTelemetryManager=function(e,t,n){return new r.ServerTelemetryManager({clientId:this.config.auth.clientId,correlationId:t,apiId:e,forceRefresh:n||!1},this.storage)},n.createAuthority=function(e){try{var t;return this.logger.verbose("createAuthority called"),e?(this.logger.verbose("Authority passed in, creating authority instance"),t=r.AuthorityFactory.createInstance(e,this.config.system.networkClient)):(this.logger.verbose("No authority passed in request, defaulting to authority set on application object"),t=this.authority),t.discoveryComplete()?Promise.resolve(t):Promise.resolve(l((function(){return Promise.resolve(t.resolveEndpointsAsync()).then((function(){return t}))}),(function(e){throw r.ClientAuthError.createEndpointDiscoveryIncompleteError(e)})))}catch(e){return Promise.reject(e)}},(t=[{key:"authority",get:function(){return this._authority||(this._authority=r.AuthorityFactory.createInstance(this.config.auth.authority||r.Constants.DEFAULT_AUTHORITY,this.config.system.networkClient)),this._authority}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),j=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.acquireTokenByDeviceCode=function(e){try{var t=this;t.logger.info("acquireTokenByDeviceCode called");var n=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByDeviceCode,n.correlationId);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new r.DeviceCodeClient(e).acquireToken(n)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},t}(M),R=function(){function e(){}e.fromAssertion=function(t){var r=new e;return r.jwt=t,r},e.fromCertificate=function(t,r){var n=new e;return n.privateKey=r,n.thumbprint=t,n};var t=e.prototype;return t.getJwt=function(e,t,n){if(null!=this.privateKey&&null!=this.thumbprint)return null==this.jwt||this.isExpired()||t!=this.issuer||n!=this.jwtAudience?this.createJwt(e,t,n):this.jwt;if(null!=this.jwt)return this.jwt;throw r.ClientAuthError.createInvalidAssertionError()},t.createJwt=function(e,t,n){var i,o;this.issuer=t,this.jwtAudience=n;var a=r.TimeUtils.nowSeconds();this.expirationTime=a+600;var s=((i={}).alg="RS256",i.x5t=C.base64EncodeUrl(this.thumbprint,"hex"),i),u=((o={}).aud=this.jwtAudience,o.exp=this.expirationTime,o.iss=this.issuer,o.sub=this.issuer,o.nbf=a,o.jti=e.createNewGuid(),o);return this.jwt=c.sign(u,this.privateKey,{header:s}),this.jwt},t.isExpired=function(){return this.expirationTime<r.TimeUtils.nowSeconds()},e}(),z=function(e){function t(t){var r;return(r=e.call(this,t)||this).setClientCredential(r.config),r}u(t,e);var n=t.prototype;return n.acquireTokenByClientCredential=function(e){try{var t=this;t.logger.info("acquireTokenByClientCredential called");var n=t.initializeRequest(e),i=t.initializeServerTelemetryManager(h.acquireTokenByClientCredential,n.correlationId,n.skipCache);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(n){return t.logger.verbose("Auth client config generated"),new r.ClientCredentialClient(n).acquireToken(e)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},n.acquireTokenOnBehalfOf=function(e){try{var t=this;return t.logger.info("acquireTokenOnBehalfOf called"),Promise.resolve(t.buildOauthClientConfiguration(e.authority)).then((function(n){return t.logger.verbose("Auth client config generated"),new r.OnBehalfOfClient(n).acquireToken(t.initializeRequest(e))}))}catch(e){return Promise.reject(e)}},n.setClientCredential=function(e){var t=!r.StringUtils.isEmpty(e.auth.clientSecret),n=!r.StringUtils.isEmpty(e.auth.clientAssertion),i=e.auth.clientCertificate,o=!r.StringUtils.isEmpty(i.thumbprint)||!r.StringUtils.isEmpty(i.privateKey);if(t&&n||n&&o||t&&o)throw r.ClientAuthError.createInvalidCredentialError();if(t)this.clientSecret=e.auth.clientSecret;else if(n)this.clientAssertion=R.fromAssertion(e.auth.clientAssertion);else{if(!o)throw r.ClientAuthError.createInvalidCredentialError();this.clientAssertion=R.fromCertificate(i.thumbprint,i.privateKey)}},t}(M);Object.defineProperty(exports,"AuthError",{enumerable:!0,get:function(){return r.AuthError}}),Object.defineProperty(exports,"AuthErrorMessage",{enumerable:!0,get:function(){return r.AuthErrorMessage}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return r.LogLevel}}),Object.defineProperty(exports,"PromptValue",{enumerable:!0,get:function(){return r.PromptValue}}),Object.defineProperty(exports,"ResponseMode",{enumerable:!0,get:function(){return r.ResponseMode}}),exports.ConfidentialClientApplication=z,exports.CryptoProvider=b,exports.PublicClientApplication=j,exports.Storage=I,exports.TokenCache=P,exports.buildAppConfiguration=y;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n=require("@azure/msal-common"),r=e(require("axios")),i=e(require("debug")),o=require("uuid"),a=e(require("crypto")),c=require("jsonwebtoken");function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function l(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function h(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator"))),function(e){e.GET="get",e.POST="post"}(t||(t={}));var f,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";!function(e){e[e.acquireTokenSilent=62]="acquireTokenSilent",e[e.acquireTokenByCode=871]="acquireTokenByCode",e[e.acquireTokenByRefreshToken=872]="acquireTokenByRefreshToken",e[e.acquireTokenByDeviceCode=671]="acquireTokenByDeviceCode",e[e.acquireTokenByClientCredential=771]="acquireTokenByClientCredential"}(f||(f={}));var g=function(){function e(){r.defaults.validateStatus=function(){return!0}}var n=e.prototype;return n.sendGetRequestAsync=function(e,n){try{return Promise.resolve(r({method:t.GET,url:e,headers:n&&n.headers})).then((function(e){return{headers:e.headers,body:e.data,status:e.status}}))}catch(e){return Promise.reject(e)}},n.sendPostRequestAsync=function(e,n){try{return Promise.resolve(r({method:t.POST,url:e,data:n&&n.body||"",headers:n&&n.headers})).then((function(e){return{headers:e.headers,body:e.data,status:e.status}}))}catch(e){return Promise.reject(e)}},e}(),m={clientId:"",authority:"",clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",privateKey:""},knownAuthorities:[],cloudDiscoveryMetadata:"",clientCapabilities:[]},p={},y={loggerOptions:{loggerCallback:function(e,t,r){i("msal:"+n.LogLevel[e]+(r?"-Pii":""))(t)},piiLoggingEnabled:!1,logLevel:n.LogLevel.Info},networkClient:function(){function e(){}return e.getNetworkClient=function(){return new g},e}().getNetworkClient()};function v(e){var t=e.cache,n=e.system;return{auth:s({},m,{},e.auth),cache:s({},p,{},t),system:s({},y,{},n)}}var C=function(){function e(){}return e.generateGuid=function(){return o.v4()},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}(),k=function(){function e(){}return e.base64Encode=function(e,t){return Buffer.from(e,t).toString("base64")},e.base64EncodeUrl=function(t,n){return e.base64Encode(t,n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.base64Decode=function(e){return Buffer.from(e,"base64").toString("utf8")},e.base64DecodeUrl=function(t){for(var n=t.replace(/-/g,"+").replace(/_/g,"/");n.length%4;)n+="=";return e.base64Decode(n)},e}(),b=function(){function e(){}var t=e.prototype;return t.generatePkceCodes=function(){try{var e=this.generateCodeVerifier(),t=this.generateCodeChallengeFromVerifier(e);return Promise.resolve({verifier:e,challenge:t})}catch(e){return Promise.reject(e)}},t.generateCodeVerifier=function(){var e=a.randomBytes(32),t=this.bufferToCVString(e);return k.base64EncodeUrl(t)},t.generateCodeChallengeFromVerifier=function(e){return k.base64EncodeUrl(this.sha256(e).toString("ascii"))},t.sha256=function(e){return a.createHash("sha256").update(e).digest()},t.bufferToCVString=function(e){for(var t=[],n=0;n<e.byteLength;n+=1)t.push(d[e[n]%d.length]);return t.join("")},e}(),T=function(){function e(){this.pkceGenerator=new b}var t=e.prototype;return t.createNewGuid=function(){return C.generateGuid()},t.base64Encode=function(e){return k.base64Encode(e)},t.base64Decode=function(e){return k.base64Decode(e)},t.generatePkceCodes=function(){return this.pkceGenerator.generatePkceCodes()},t.getPublicKeyThumbprint=function(){throw new Error("Method not implemented.")},t.signJwt=function(){throw new Error("Method not implemented.")},e}(),A=function(){function e(){}return e.deserializeJSONBlob=function(e){return n.StringUtils.isEmpty(e)?{}:JSON.parse(e)},e.deserializeAccounts=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,realm:i.realm,localAccountId:i.local_account_id,username:i.username,authorityType:i.authority_type,name:i.name,clientInfo:i.client_info,lastModificationTime:i.last_modification_time,lastModificationApp:i.last_modification_app},a=new n.AccountEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeIdTokens=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm},a=new n.IdTokenEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeAccessTokens=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm,target:i.target,cachedAt:i.cached_at,expiresOn:i.expires_on,extendedExpiresOn:i.extended_expires_on,refreshOn:i.refresh_on,keyId:i.key_id,tokenType:i.token_type},a=new n.AccessTokenEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeRefreshTokens=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,familyId:i.family_id,target:i.target,realm:i.realm},a=new n.RefreshTokenEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeAppMetadata=function(e){var t={};return e&&Object.keys(e).map((function(r){var i=e[r],o={clientId:i.client_id,environment:i.environment,familyId:i.family_id},a=new n.AppMetadataEntity;n.CacheManager.toObject(a,o),t[r]=a})),t},e.deserializeAllCache=function(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}},e}(),I=function(){function e(){}return e.serializeJSONBlob=function(e){return JSON.stringify(e)},e.serializeAccounts=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,realm:r.realm,local_account_id:r.localAccountId,username:r.username,authority_type:r.authorityType,name:r.name,client_info:r.clientInfo,last_modification_time:r.lastModificationTime,last_modification_app:r.lastModificationApp}})),t},e.serializeIdTokens=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,realm:r.realm}})),t},e.serializeAccessTokens=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,realm:r.realm,target:r.target,cached_at:r.cachedAt,expires_on:r.expiresOn,extended_expires_on:r.extendedExpiresOn,refresh_on:r.refreshOn,key_id:r.keyId,token_type:r.tokenType}})),t},e.serializeRefreshTokens=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,family_id:r.familyId,target:r.target,realm:r.realm}})),t},e.serializeAppMetadata=function(e){var t={};return Object.keys(e).map((function(n){var r=e[n];t[n]={client_id:r.clientId,environment:r.environment,family_id:r.familyId}})),t},e.serializeAllCache=function(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}},e}(),O=function(e){function t(t){var n;return(n=e.call(this)||this).cache={},n.changeEmitters=[],n.logger=t,n}u(t,e);var r=t.prototype;return r.registerChangeEmitter=function(e){this.changeEmitters.push(e)},r.emitChange=function(){this.changeEmitters.forEach((function(e){return e.call(null)}))},r.cacheToInMemoryCache=function(e){var t={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(var r in e)if(e[r]instanceof n.AccountEntity)t.accounts[r]=e[r];else if(e[r]instanceof n.IdTokenEntity)t.idTokens[r]=e[r];else if(e[r]instanceof n.AccessTokenEntity)t.accessTokens[r]=e[r];else if(e[r]instanceof n.RefreshTokenEntity)t.refreshTokens[r]=e[r];else{if(!(e[r]instanceof n.AppMetadataEntity))continue;t.appMetadata[r]=e[r]}return t},r.inMemoryCacheToCache=function(e){return this.getCache(),s({},e.accounts,{},e.idTokens,{},e.accessTokens,{},e.refreshTokens,{},e.appMetadata)},r.getInMemoryCache=function(){return this.logger.verbose("Getting in-memory cache"),this.cacheToInMemoryCache(this.getCache())},r.setInMemoryCache=function(e){this.logger.verbose("Setting in-memory cache");var t=this.inMemoryCacheToCache(e);this.setCache(t),this.emitChange()},r.getCache=function(){return this.logger.verbose("Getting cache key-value store"),this.cache},r.setCache=function(e){this.logger.verbose("Setting cache key value store"),this.cache=e,this.emitChange()},r.setItem=function(e,t){this.logger.verbosePii("Item key: "+e);var n=this.getCache();n[e]=t,this.setCache(n)},r.getItem=function(e){return this.logger.verbosePii("Item key: "+e),this.getCache()[e]},r.removeItem=function(e){this.logger.verbosePii("Item key: "+e);var t=!1,n=this.getCache();return n[e]&&(delete n[e],t=!0),t&&(this.setCache(n),this.emitChange()),t},r.containsKey=function(e){return this.getKeys().includes(e)},r.getKeys=function(){this.logger.verbose("Retrieving all cache keys");var e=this.getCache();return[].concat(Object.keys(e))},r.clear=function(){var e=this;this.logger.verbose("Clearing cache entries created by MSAL"),this.getKeys().forEach((function(t){e.removeItem(t)})),this.emitChange()},t.generateInMemoryCache=function(e){return A.deserializeAllCache(A.deserializeJSONBlob(e))},t.generateJsonCache=function(e){return I.serializeAllCache(e)},t}(n.CacheManager),E={},P={},_={},w={},S={},j=function(){function e(e,t,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=t}var t=e.prototype;return t.hasChanged=function(){return this.cacheHasChanged},t.serialize=function(){this.logger.verbose("Serializing in-memory cache");var e=I.serializeAllCache(this.storage.getInMemoryCache());return n.StringUtils.isEmpty(this.cacheSnapshot)?this.logger.verbose("No cache snapshot to merge"):(this.logger.verbose("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)),this.cacheHasChanged=!1,JSON.stringify(e)},t.deserialize=function(e){if(this.logger.verbose("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,n.StringUtils.isEmpty(this.cacheSnapshot))this.logger.verbose("No cache snapshot to deserialize");else{this.logger.verbose("Reading cache snapshot from disk");var t=A.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(t)}},t.getAllAccounts=function(){try{var e,t=this;return t.logger.verbose("getAllAccounts called"),Promise.resolve(h((function(){function r(){return t.storage.getAllAccounts()}var i=function(){if(t.persistence)return e=new n.TokenCacheContext(t,!1),Promise.resolve(t.persistence.beforeCacheAccess(e)).then((function(){}))}();return i&&i.then?i.then(r):r()}),(function(n,r){function i(){if(n)throw r;return r}var o=function(){if(t.persistence&&e)return Promise.resolve(t.persistence.afterCacheAccess(e)).then((function(){}))}();return o&&o.then?o.then(i):i()})))}catch(e){return Promise.reject(e)}},t.removeAccount=function(e){try{var t,r=this;r.logger.verbose("removeAccount called");var i=h((function(){function i(){r.storage.removeAccount(n.AccountEntity.generateAccountCacheKey(e))}var o=function(){if(r.persistence)return t=new n.TokenCacheContext(r,!0),Promise.resolve(r.persistence.beforeCacheAccess(t)).then((function(){}))}();return o&&o.then?o.then(i):i()}),(function(e,n){function i(){if(e)throw n;return n}var o=function(){if(r.persistence&&t)return Promise.resolve(r.persistence.afterCacheAccess(t)).then((function(){}))}();return o&&o.then?o.then(i):i()}));return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}},t.handleChangeEvent=function(){this.cacheHasChanged=!0},t.mergeState=function(e,t){this.logger.verbose("Merging in-memory cache with cache snapshot");var n=this.mergeRemovals(e,t);return this.mergeUpdates(n,t)},t.mergeUpdates=function(e,t){var n=this;return Object.keys(t).forEach((function(r){var i=t[r];if(e.hasOwnProperty(r)){var o=null!==i,a="object"==typeof i,c=!Array.isArray(i);o&&a&&c&&null!=e[r]?n.mergeUpdates(e[r],i):e[r]=i}else null!==i&&(e[r]=i)})),e},t.mergeRemovals=function(e,t){return this.logger.verbose("Remove updated entries in cache"),s({},e,{Account:null!=e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,AccessToken:null!=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,RefreshToken:null!=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,IdToken:null!=e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,AppMetadata:null!=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata})},t.mergeRemovalsDict=function(e,t){var n=s({},e);return Object.keys(e).forEach((function(e){t&&t.hasOwnProperty(e)||delete n[e]})),n},t.overlayDefaults=function(e){return this.logger.verbose("Overlaying input cache with the default cache"),{Account:s({},E,{},e.Account),IdToken:s({},P,{},e.IdToken),AccessToken:s({},_,{},e.AccessToken),RefreshToken:s({},w,{},e.RefreshToken),AppMetadata:s({},S,{},e.AppMetadata)}},e}(),M=function(){function e(e){this.config=v(e),this.logger=new n.Logger(this.config.system.loggerOptions),this.storage=new O(this.logger),this.tokenCache=new j(this.storage,this.logger,this.config.cache.cachePlugin),this.cryptoProvider=new T,n.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.knownAuthorities,this.config.auth.cloudDiscoveryMetadata)}var t,r=e.prototype;return r.getAuthCodeUrl=function(e){try{var t=this;return t.logger.info("getAuthCodeUrl called"),Promise.resolve(t.buildOauthClientConfiguration(e.authority)).then((function(r){return t.logger.verbose("Auth client config generated"),new n.AuthorizationCodeClient(r).getAuthCodeUrl(t.initializeRequest(e))}))}catch(e){return Promise.reject(e)}},r.acquireTokenByCode=function(e){try{var t=this;t.logger.info("acquireTokenByCode called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(f.acquireTokenByCode,r.correlationId);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.AuthorizationCodeClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenByRefreshToken=function(e){try{var t=this;t.logger.info("acquireTokenByRefreshToken called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(f.acquireTokenByRefreshToken,r.correlationId);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.RefreshTokenClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenSilent=function(e){try{var t=this,r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(f.acquireTokenSilent,r.correlationId,r.forceRefresh);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return new n.SilentFlowClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.getTokenCache=function(){return this.logger.info("getTokenCache called"),this.tokenCache},r.buildOauthClientConfiguration=function(e,t){try{var n=this;n.logger.verbose("buildOauthClientConfiguration called");var r=n.config.auth.clientId;return Promise.resolve(n.createAuthority(e)).then((function(e){return{authOptions:{clientId:r,authority:e,knownAuthorities:n.config.auth.knownAuthorities,cloudDiscoveryMetadata:n.config.auth.cloudDiscoveryMetadata,clientCapabilities:n.config.auth.clientCapabilities},loggerOptions:{loggerCallback:n.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:n.config.system.loggerOptions.piiLoggingEnabled},cryptoInterface:n.cryptoProvider,networkInterface:n.config.system.networkClient,storageInterface:n.storage,serverTelemetryManager:t,clientCredentials:{clientSecret:n.clientSecret,clientAssertion:n.clientAssertion?n.getClientAssertion():void 0},libraryInfo:{sku:"msal.js.node",version:"1.0.0-alpha.10",cpu:process.arch||"",os:process.platform||""},persistencePlugin:n.config.cache.cachePlugin,serializableCache:n.tokenCache}}))}catch(e){return Promise.reject(e)}},r.getClientAssertion=function(){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,this._authority.tokenEndpoint),assertionType:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},r.initializeRequest=function(e){return this.logger.verbose("initializeRequestScopes called"),s({},e,{scopes:[].concat(e&&e.scopes||[],[n.Constants.OPENID_SCOPE,n.Constants.PROFILE_SCOPE,n.Constants.OFFLINE_ACCESS_SCOPE]),correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid()})},r.initializeServerTelemetryManager=function(e,t,r){return new n.ServerTelemetryManager({clientId:this.config.auth.clientId,correlationId:t,apiId:e,forceRefresh:r||!1},this.storage)},r.createAuthority=function(e){try{var t;return this.logger.verbose("createAuthority called"),e?(this.logger.verbose("Authority passed in, creating authority instance"),t=n.AuthorityFactory.createInstance(e,this.config.system.networkClient)):(this.logger.verbose("No authority passed in request, defaulting to authority set on application object"),t=this.authority),t.discoveryComplete()?Promise.resolve(t):Promise.resolve(l((function(){return Promise.resolve(t.resolveEndpointsAsync()).then((function(){return t}))}),(function(e){throw n.ClientAuthError.createEndpointDiscoveryIncompleteError(e)})))}catch(e){return Promise.reject(e)}},(t=[{key:"authority",get:function(){return this._authority||(this._authority=n.AuthorityFactory.createInstance(this.config.auth.authority||n.Constants.DEFAULT_AUTHORITY,this.config.system.networkClient)),this._authority}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),R=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.acquireTokenByDeviceCode=function(e){try{var t=this;t.logger.info("acquireTokenByDeviceCode called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(f.acquireTokenByDeviceCode,r.correlationId);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(e){return t.logger.verbose("Auth client config generated"),new n.DeviceCodeClient(e).acquireToken(r)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},t}(M),q=function(){function e(){}e.fromAssertion=function(t){var n=new e;return n.jwt=t,n},e.fromCertificate=function(t,n){var r=new e;return r.privateKey=n,r.thumbprint=t,r};var t=e.prototype;return t.getJwt=function(e,t,r){if(null!=this.privateKey&&null!=this.thumbprint)return null==this.jwt||this.isExpired()||t!=this.issuer||r!=this.jwtAudience?this.createJwt(e,t,r):this.jwt;if(null!=this.jwt)return this.jwt;throw n.ClientAuthError.createInvalidAssertionError()},t.createJwt=function(e,t,r){var i,o;this.issuer=t,this.jwtAudience=r;var a=n.TimeUtils.nowSeconds();this.expirationTime=a+600;var s=((i={}).alg="RS256",i.x5t=k.base64EncodeUrl(this.thumbprint,"hex"),i),u=((o={}).aud=this.jwtAudience,o.exp=this.expirationTime,o.iss=this.issuer,o.sub=this.issuer,o.nbf=a,o.jti=e.createNewGuid(),o);return this.jwt=c.sign(u,this.privateKey,{header:s}),this.jwt},t.isExpired=function(){return this.expirationTime<n.TimeUtils.nowSeconds()},e}(),z=function(e){function t(t){var n;return(n=e.call(this,t)||this).setClientCredential(n.config),n}u(t,e);var r=t.prototype;return r.acquireTokenByClientCredential=function(e){try{var t=this;t.logger.info("acquireTokenByClientCredential called");var r=t.initializeRequest(e),i=t.initializeServerTelemetryManager(f.acquireTokenByClientCredential,r.correlationId,r.skipCache);return Promise.resolve(l((function(){return Promise.resolve(t.buildOauthClientConfiguration(e.authority,i)).then((function(r){return t.logger.verbose("Auth client config generated"),new n.ClientCredentialClient(r).acquireToken(e)}))}),(function(e){throw i.cacheFailedRequest(e),e})))}catch(e){return Promise.reject(e)}},r.acquireTokenOnBehalfOf=function(e){try{var t=this;return t.logger.info("acquireTokenOnBehalfOf called"),Promise.resolve(t.buildOauthClientConfiguration(e.authority)).then((function(r){return t.logger.verbose("Auth client config generated"),new n.OnBehalfOfClient(r).acquireToken(t.initializeRequest(e))}))}catch(e){return Promise.reject(e)}},r.setClientCredential=function(e){var t=!n.StringUtils.isEmpty(e.auth.clientSecret),r=!n.StringUtils.isEmpty(e.auth.clientAssertion),i=e.auth.clientCertificate,o=!n.StringUtils.isEmpty(i.thumbprint)||!n.StringUtils.isEmpty(i.privateKey);if(t&&r||r&&o||t&&o)throw n.ClientAuthError.createInvalidCredentialError();if(t)this.clientSecret=e.auth.clientSecret;else if(r)this.clientAssertion=q.fromAssertion(e.auth.clientAssertion);else{if(!o)throw n.ClientAuthError.createInvalidCredentialError();this.clientAssertion=q.fromCertificate(i.thumbprint,i.privateKey)}},t}(M);Object.defineProperty(exports,"AuthError",{enumerable:!0,get:function(){return n.AuthError}}),Object.defineProperty(exports,"AuthErrorMessage",{enumerable:!0,get:function(){return n.AuthErrorMessage}}),Object.defineProperty(exports,"ClientAuthError",{enumerable:!0,get:function(){return n.ClientAuthError}}),Object.defineProperty(exports,"ClientAuthErrorMessage",{enumerable:!0,get:function(){return n.ClientAuthErrorMessage}}),Object.defineProperty(exports,"ClientConfigurationError",{enumerable:!0,get:function(){return n.ClientConfigurationError}}),Object.defineProperty(exports,"ClientConfigurationErrorMessage",{enumerable:!0,get:function(){return n.ClientConfigurationErrorMessage}}),Object.defineProperty(exports,"InteractionRequiredAuthError",{enumerable:!0,get:function(){return n.InteractionRequiredAuthError}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return n.LogLevel}}),Object.defineProperty(exports,"PromptValue",{enumerable:!0,get:function(){return n.PromptValue}}),Object.defineProperty(exports,"ResponseMode",{enumerable:!0,get:function(){return n.ResponseMode}}),Object.defineProperty(exports,"ServerError",{enumerable:!0,get:function(){return n.ServerError}}),Object.defineProperty(exports,"TokenCacheContext",{enumerable:!0,get:function(){return n.TokenCacheContext}}),exports.ConfidentialClientApplication=z,exports.CryptoProvider=T,exports.PublicClientApplication=R,exports.Storage=O,exports.TokenCache=j,exports.buildAppConfiguration=v;
//# sourceMappingURL=msal-node.cjs.production.min.js.map

@@ -1,3 +0,3 @@

import { LogLevel, StringUtils, AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ClientAuthError, AuthorizationCodeClient, RefreshTokenClient, SilentFlowClient, Constants as Constants$1, ServerTelemetryManager, AuthorityFactory, Logger, TrustedAuthority, DeviceCodeClient, TimeUtils, ClientCredentialClient, OnBehalfOfClient } from '@azure/msal-common';
export { AuthError, AuthErrorMessage, LogLevel, PromptValue, ResponseMode } from '@azure/msal-common';
import { LogLevel, StringUtils, AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, TokenCacheContext, AuthorizationCodeClient, RefreshTokenClient, SilentFlowClient, Constants as Constants$1, ServerTelemetryManager, AuthorityFactory, ClientAuthError, Logger, TrustedAuthority, DeviceCodeClient, TimeUtils, ClientCredentialClient, OnBehalfOfClient } from '@azure/msal-common';
export { AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, LogLevel, PromptValue, ResponseMode, ServerError, TokenCacheContext } from '@azure/msal-common';
import axios from 'axios';

@@ -68,2 +68,15 @@ import debug from 'debug';

// Asynchronously await a promise and pass the result to a finally continuation
function _finallyRethrows(body, finalizer) {
try {
var result = body();
} catch (e) {
return finalizer(true, e);
}
if (result && result.then) {
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
}
return finalizer(false, result);
}
/*

@@ -1008,2 +1021,3 @@ * Copyright (c) Microsoft Corporation. All rights reserved.

this.setCache(cache);
this.emitChange();
}

@@ -1143,38 +1157,40 @@

/**
* Serializes cache into JSON and calls ICachePlugin.writeToStorage. ICachePlugin must be set on ClientApplication
* API that retrieves all accounts currently in cache to the user
*/
;
_proto.writeToPersistence = function writeToPersistence() {
_proto.getAllAccounts = function getAllAccounts() {
try {
var _this2 = this;
_this2.logger.verbose("Writing to persistent cache");
_this2.logger.verbose("getAllAccounts called");
return Promise.resolve(function () {
if (_this2.persistence) {
_this2.logger.verbose("cachePlugin (persistent cache) not set by the user");
var cacheContext;
return Promise.resolve(_finallyRethrows(function () {
function _temp2() {
return _this2.storage.getAllAccounts();
}
var cache = Serializer.serializeAllCache(_this2.storage.getInMemoryCache());
var _temp = function () {
if (_this2.persistence) {
cacheContext = new TokenCacheContext(_this2, false);
return Promise.resolve(_this2.persistence.beforeCacheAccess(cacheContext)).then(function () {});
}
}();
var getMergedState = function getMergedState(stateFromDisk) {
if (!StringUtils.isEmpty(stateFromDisk)) {
_this2.logger.verbose("Reading state from disk");
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
}, function (_wasThrown, _result) {
function _temp4() {
if (_wasThrown) throw _result;
return _result;
}
_this2.cacheSnapshot = stateFromDisk;
cache = _this2.mergeState(JSON.parse(stateFromDisk), cache);
} else {
_this2.logger.verbose("No state from disk");
}
var _temp3 = function () {
if (_this2.persistence && cacheContext) {
return Promise.resolve(_this2.persistence.afterCacheAccess(cacheContext)).then(function () {});
}
}();
return JSON.stringify(cache);
};
return Promise.resolve(_this2.persistence.writeToStorage(getMergedState)).then(function () {
_this2.cacheHasChanged = false;
});
} else {
throw ClientAuthError.createCachePluginError();
}
}());
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
}));
} catch (e) {

@@ -1185,36 +1201,44 @@ return Promise.reject(e);

/**
* Calls ICachePlugin.readFromStorage and deserializes JSON to in-memory cache.
* ICachePlugin must be set on ClientApplication.
* API to remove a specific account and the relevant data from cache
* @param account
*/
;
_proto.readFromPersistence = function readFromPersistence() {
_proto.removeAccount = function removeAccount(account) {
try {
var _this4 = this;
_this4.logger.verbose("Reading from persistent cache");
_this4.logger.verbose("removeAccount called");
return Promise.resolve(function () {
if (_this4.persistence) {
return Promise.resolve(_this4.persistence.readFromStorage()).then(function (_this3$persistence$re) {
_this4.cacheSnapshot = _this3$persistence$re;
var cacheContext;
if (!StringUtils.isEmpty(_this4.cacheSnapshot)) {
_this4.logger.verbose("Reading cache snapshot from disk");
var _temp10 = _finallyRethrows(function () {
function _temp6() {
_this4.storage.removeAccount(AccountEntity.generateAccountCacheKey(account));
}
var cache = _this4.overlayDefaults(JSON.parse(_this4.cacheSnapshot));
var _temp5 = function () {
if (_this4.persistence) {
cacheContext = new TokenCacheContext(_this4, true);
return Promise.resolve(_this4.persistence.beforeCacheAccess(cacheContext)).then(function () {});
}
}();
_this4.logger.verbose("Deserializing JSON");
return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
}, function (_wasThrown2, _result2) {
function _temp8() {
if (_wasThrown2) throw _result2;
return _result2;
}
var deserializedCache = Deserializer.deserializeAllCache(cache);
var _temp7 = function () {
if (_this4.persistence && cacheContext) {
return Promise.resolve(_this4.persistence.afterCacheAccess(cacheContext)).then(function () {});
}
}();
_this4.storage.setInMemoryCache(deserializedCache);
} else {
_this4.logger.verbose("No cache snapshot to overlay and deserialize");
}
});
} else {
throw ClientAuthError.createCachePluginError();
}
}());
return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
});
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
} catch (e) {

@@ -1225,21 +1249,2 @@ return Promise.reject(e);

/**
* API that retrieves all accounts currently in cache to the user
*/
;
_proto.getAllAccounts = function getAllAccounts() {
this.logger.verbose("getAllAccounts called");
return this.storage.getAllAccounts();
}
/**
* API to remove a specific account and the relevant data from cache
* @param account
*/
;
_proto.removeAccount = function removeAccount(account) {
this.logger.verbose("removeAccount called");
this.storage.removeAccount(AccountEntity.generateAccountCacheKey(account));
}
/**
* Called when the cache has changed state.

@@ -1346,3 +1351,3 @@ */

var version = "1.0.0-alpha.9";
var version = "1.0.0-alpha.10";

@@ -1534,3 +1539,5 @@ var ClientApplication = /*#__PURE__*/function () {

os: process.platform || ""
}
},
persistencePlugin: _this10.config.cache.cachePlugin,
serializableCache: _this10.tokenCache
};

@@ -1537,0 +1544,0 @@ });

{
"name": "@azure/msal-node",
"version": "1.0.0-alpha.9",
"version": "1.0.0-alpha.10",
"author": {

@@ -74,7 +74,8 @@ "name": "Microsoft",

"dependencies": {
"@azure/msal-common": "^1.5.0",
"@azure/msal-common": "^1.6.0",
"axios": "^0.19.2",
"debug": "^4.1.1",
"jsonwebtoken": "^8.5.1"
"jsonwebtoken": "^8.5.1",
"uuid": "^8.3.0"
}
}

@@ -0,0 +0,0 @@ # Microsoft Authentication Library for Node (msal-node)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc