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-beta.5 to 1.0.0-beta.6

dist/cache/ITokenCache.d.ts.map

33

CHANGELOG.json

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

{
"date": "Tue, 09 Feb 2021 01:48:22 GMT",
"tag": "@azure/msal-node_v1.0.0-beta.6",
"version": "1.0.0-beta.6",
"comments": {
"prerelease": [
{
"comment": "Fix version.json import errors (#2993)",
"author": "thomas.norling@microsoft.com",
"commit": "6dc3bc9e2148bc53b181d9f079f6e11e0159620b",
"package": "@azure/msal-node"
},
{
"comment": "Ignore OIDC scopes during cache lookup or replacement (#2969)",
"author": "prkanher@microsoft.com",
"commit": "b113b562ffc33ad44b8d98417753db397256aadf",
"package": "@azure/msal-node"
},
{
"comment": "Set the validateStatus locally than globally for `axios` (#2959)",
"author": "sameera.gajjarapu@microsoft.com",
"commit": "55617cb8bc5289c29fd4357a16605b6720195cbc",
"package": "@azure/msal-node"
},
{
"comment": "Add API Extractor for msal-node",
"author": "sameera.gajjarapu@microsoft.com",
"commit": "01747296efdf08eefe585930097d9bbbf6b00789",
"package": "@azure/msal-node"
}
]
}
},
{
"date": "Tue, 02 Feb 2021 01:56:47 GMT",

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

13

changelog.md
# Change Log - @azure/msal-node
This log was last generated on Tue, 02 Feb 2021 01:56:47 GMT and should not be manually modified.
This log was last generated on Tue, 09 Feb 2021 01:48:22 GMT and should not be manually modified.
<!-- Start content -->
## 1.0.0-beta.6
Tue, 09 Feb 2021 01:48:22 GMT
### Changes
- Fix version.json import errors (#2993) (thomas.norling@microsoft.com)
- Ignore OIDC scopes during cache lookup or replacement (#2969) (prkanher@microsoft.com)
- Set the validateStatus locally than globally for `axios` (#2959) (sameera.gajjarapu@microsoft.com)
- Add API Extractor for msal-node (sameera.gajjarapu@microsoft.com)
## 1.0.0-beta.5

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

import { AccountInfo } from "@azure/msal-common";
/**
* Token cache interface for the client, giving access to cache APIs
* @public
*/
export interface ITokenCache {
/** API that retrieves all accounts currently in cache to the user */
getAllAccounts(): Promise<AccountInfo[]>;
/** Returns the signed in account matching homeAccountId */
getAccountByHomeId(homeAccountId: string): Promise<AccountInfo | null>;
/** Returns the signed in account matching localAccountId */
getAccountByLocalId(localAccountId: string): Promise<AccountInfo | null>;
/** API to remove a specific account and the relevant data from cache */
removeAccount(account: AccountInfo): Promise<void>;
}
//# sourceMappingURL=ITokenCache.d.ts.map

@@ -43,1 +43,2 @@ import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache } from "@azure/msal-common";

}
//# sourceMappingURL=Deserializer.d.ts.map

@@ -40,1 +40,2 @@ import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache } from "@azure/msal-common";

}
//# sourceMappingURL=Serializer.d.ts.map
import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache, ValidCacheType } from "@azure/msal-common";
/**
* Key value store for in-memory cache
* @public
*/
export declare type CacheKVStore = Record<string, ValidCacheType>;
/**
* Cache format read from the cache blob provided to the configuration during app instantiation
* @public
*/
export declare type JsonCache = {

@@ -10,2 +18,6 @@ Account: Record<string, SerializedAccountEntity>;

};
/**
* Intermittent type to handle in-memory data objects with defined types
* @public
*/
export declare type InMemoryCache = {

@@ -18,2 +30,6 @@ accounts: AccountCache;

};
/**
* Account type
* @public
*/
export declare type SerializedAccountEntity = {

@@ -31,2 +47,6 @@ home_account_id: string;

};
/**
* Idtoken credential type
* @public
*/
export declare type SerializedIdTokenEntity = {

@@ -40,2 +60,6 @@ home_account_id: string;

};
/**
* Access token credential type
* @public
*/
export declare type SerializedAccessTokenEntity = {

@@ -56,2 +80,6 @@ home_account_id: string;

};
/**
* Refresh token credential type
* @public
*/
export declare type SerializedRefreshTokenEntity = {

@@ -67,2 +95,6 @@ home_account_id: string;

};
/**
* AppMetadata type
* @public
*/
export declare type SerializedAppMetadataEntity = {

@@ -73,1 +105,2 @@ client_id: string;

};
//# sourceMappingURL=SerializerTypes.d.ts.map

38

dist/cache/TokenCache.d.ts

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

import { Storage } from "./Storage";
import { NodeStorage } from "./NodeStorage";
import { AccountInfo, Logger, ISerializableTokenCache, ICachePlugin } from "@azure/msal-common";

@@ -7,2 +7,3 @@ import { CacheKVStore } from "./serializer/SerializerTypes";

* In-memory token cache manager
* @public
*/

@@ -15,3 +16,3 @@ export declare class TokenCache implements ISerializableTokenCache, ITokenCache {

private logger;
constructor(storage: Storage, logger: Logger, cachePlugin?: ICachePlugin);
constructor(storage: NodeStorage, logger: Logger, cachePlugin?: ICachePlugin);
/**

@@ -27,5 +28,8 @@ * Set to true if cache state has changed since last time serialize or writeToPersistence was called

* Deserializes JSON to in-memory cache. JSON should be in MSAL cache schema format
* @param cache
* @param cache - blob formatted cache
*/
deserialize(cache: string): void;
/**
* Fetches the cache key-value map
*/
getKVStore(): CacheKVStore;

@@ -40,3 +44,3 @@ /**

* or null when no matching account is found
* @returns {@link AccountInfo} - the account object stored in MSAL
* @param homeAccountId - unique identifier for an account (uid.utid)
*/

@@ -48,3 +52,3 @@ getAccountByHomeId(homeAccountId: string): Promise<AccountInfo | null>;

* or null when no matching account is found
* @returns {@link AccountInfo} - the account object stored in MSAL
* @param localAccountId - unique identifier of an account (sub/obj when homeAccountId cannot be populated)
*/

@@ -54,3 +58,3 @@ getAccountByLocalId(localAccountId: string): Promise<AccountInfo | null>;

* API to remove a specific account and the relevant data from cache
* @param account
* @param account - AccountInfo passed by the user
*/

@@ -64,4 +68,4 @@ removeAccount(account: AccountInfo): Promise<void>;

* Merge in memory cache with the cache snapshot.
* @param oldState
* @param currentState
* @param oldState - cache before changes
* @param currentState - current cache state in the library
*/

@@ -71,4 +75,4 @@ private mergeState;

* Deep update of oldState based on newState values
* @param oldState
* @param newState
* @param oldState - cache before changes
* @param newState - updated cache
*/

@@ -79,8 +83,18 @@ private mergeUpdates;

* oldState that are not recognized, they are left untouched.
* @param oldState
* @param newState
* @param oldState - cache before changes
* @param newState - updated cache
*/
private mergeRemovals;
/**
* Helper to merge new cache with the old one
* @param oldState - cache before changes
* @param newState - updated cache
*/
private mergeRemovalsDict;
/**
* Helper to overlay as a part of cache merge
* @param passedInCache - cache read from the blob
*/
private overlayDefaults;
}
//# sourceMappingURL=TokenCache.d.ts.map
import { ClientConfiguration, AuthenticationResult, BaseAuthRequest, Logger, ServerTelemetryManager } from "@azure/msal-common";
import { Configuration } from "../config/Configuration";
import { Storage } from "../cache/Storage";
import { NodeStorage } from "../cache/NodeStorage";
import { TokenCache } from "../cache/TokenCache";

@@ -10,9 +10,28 @@ import { ClientAssertion } from "./ClientAssertion";

import { SilentFlowRequest } from "../request/SilentFlowRequest";
/**
* Base abstract class for all ClientApplications - public and confidential
* @public
*/
export declare abstract class ClientApplication {
private readonly cryptoProvider;
protected storage: Storage;
private tokenCache;
/**
* Platform storage object
*/
protected storage: NodeStorage;
/**
* Logger object to log the application flow
*/
protected logger: Logger;
/**
* Platform configuration initialized by the application
*/
protected config: Configuration;
/**
* Client assertion passed by the user for confidential client flows
*/
protected clientAssertion: ClientAssertion;
/**
* Client secret passed by the user for confidential client flows
*/
protected clientSecret: string;

@@ -69,5 +88,10 @@ /**

* Replaces the default logger set in configurations with new Logger with new configurations
* @param logger Logger instance
* @param logger - Logger instance
*/
setLogger(logger: Logger): void;
/**
* Builds the common configuration to be passed to the common component based on the platform configurarion
* @param authority - user passed authority in configuration
* @param serverTelemetryManager - initializes servertelemetry if passed
*/
protected buildOauthClientConfiguration(authority: string, serverTelemetryManager?: ServerTelemetryManager): Promise<ClientConfiguration>;

@@ -77,5 +101,11 @@ private getClientAssertion;

* Generates a request with the default scopes & generates a correlationId.
* @param authRequest
* @param authRequest - BaseAuthRequest for initialization
*/
protected initializeBaseRequest(authRequest: Partial<BaseAuthRequest>): BaseAuthRequest;
/**
* Initializes the server telemetry payload
* @param apiId - Id for a specific request
* @param correlationId - GUID
* @param forceRefresh - boolean to indicate network call
*/
protected initializeServerTelemetryManager(apiId: number, correlationId: string, forceRefresh?: boolean): ServerTelemetryManager;

@@ -85,5 +115,6 @@ /**

* object. If no authority set in application object, then default to common authority.
* @param authorityString
* @param authorityString - authority from user configuration
*/
private createAuthority;
}
//# sourceMappingURL=ClientApplication.d.ts.map
import { CryptoProvider } from "../crypto/CryptoProvider";
/**
* Client assertion of type jwt-bearer used in confidential client flows
* @public
*/

@@ -13,12 +14,35 @@ export declare class ClientAssertion {

private publicCertificate;
/**
* Initialize the ClientAssertion class from the clientAssertion passed by the user
* @param assertion - refer https://tools.ietf.org/html/rfc7521
*/
static fromAssertion(assertion: string): ClientAssertion;
/**
* Initialize the ClientAssertion class from the certificate passed by the user
* @param thumbprint - identifier of a certificate
* @param privateKey - secret key
* @param publicCertificate - electronic document provided to prove the ownership of the public key
*/
static fromCertificate(thumbprint: string, privateKey: string, publicCertificate?: string): ClientAssertion;
/**
* Update JWT for certificate based clientAssertion, if passed by the user, uses it as is
* @param cryptoProvider - library's crypto helper
* @param issuer - iss claim
* @param jwtAudience - aud claim
*/
getJwt(cryptoProvider: CryptoProvider, issuer: string, jwtAudience: string): string;
/**
* JWT format and required claims specified: https://tools.ietf.org/html/rfc7523#section-3
*/
private createJwt;
/**
* Utility API to check expiration
*/
private isExpired;
/**
* Extracts the raw certs from a given certificate string and returns them in an array.
* @param publicCertificate
* @param publicCertificate - electronic document provided to prove the ownership of the public key
*/
static parseCertificate(publicCertificate: string): Array<string>;
}
//# sourceMappingURL=ClientAssertion.d.ts.map

@@ -7,5 +7,9 @@ import { ClientApplication } from "./ClientApplication";

import { ClientCredentialRequest } from "../request/ClientCredentialRequest";
/**
* This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications
* will configure application secrets, client certificates/assertions as applicable
* @public
*/
export declare class ConfidentialClientApplication extends ClientApplication implements IConfidentialClientApplication {
/**
* @constructor
* Constructor for the ConfidentialClientApplication

@@ -18,3 +22,3 @@ *

*
* In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}.
* In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).

@@ -25,6 +29,6 @@ * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.

*
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
* In Azure B2C, authority is of the form https://\{instance\}/tfp/\{tenant\}/\{policyName\}/
* Full B2C functionality will be available in this library in future versions.
*
* @param {@link (Configuration:type)} configuration object for the MSAL ConfidentialClientApplication instance
* @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
*/

@@ -50,1 +54,2 @@ constructor(configuration: Configuration);

}
//# sourceMappingURL=ConfidentialClientApplication.d.ts.map

@@ -9,12 +9,26 @@ import { AuthenticationResult, Logger } from "@azure/msal-common";

import { TokenCache } from "../cache/TokenCache";
/**
* Interface for the ConfidentialClientApplication class defining the public API signatures
* @public
*/
export interface IConfidentialClientApplication {
/** Creates the URL of the authorization request */
getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>;
/** Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow */
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult | null>;
/** Acquires a token silently when a user specifies the account the token is requested for */
acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult | null>;
/** Acquires a token by exchanging the refresh token provided for a new set of tokens */
acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;
/** Acquires tokens from the authority for the application (not for an end user) */
acquireTokenByClientCredential(request: ClientCredentialRequest): Promise<AuthenticationResult | null>;
/** Acquires tokens from the authority for the application */
acquireTokenOnBehalfOf(request: OnBehalfOfRequest): Promise<AuthenticationResult | null>;
/** Gets the token cache for the application */
getTokenCache(): TokenCache;
/** Returns the logger instance */
getLogger(): Logger;
/** Replaces the default logger set in configurations with new Logger with new configurations */
setLogger(logger: Logger): void;
}
//# sourceMappingURL=IConfidentialClientApplication.d.ts.map

@@ -9,12 +9,26 @@ import { AuthenticationResult, Logger } from "@azure/msal-common";

import { TokenCache } from "../cache/TokenCache";
/**
* Interface for the PublicClientApplication class defining the public API signatures
* @public
*/
export interface IPublicClientApplication {
/** Creates the URL of the authorization request */
getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>;
/** Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow */
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult | null>;
/** Acquires a token silently when a user specifies the account the token is requested for */
acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult | null>;
/** Acquires a token by exchanging the refresh token provided for a new set of tokens */
acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;
/** Acquires a token from the authority using OAuth2.0 device code flow */
acquireTokenByDeviceCode(request: DeviceCodeRequest): Promise<AuthenticationResult | null>;
/** Acquires tokens with password grant by exchanging client applications username and password for credentials */
acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>;
/** Gets the token cache for the application */
getTokenCache(): TokenCache;
/** Returns the logger instance */
getLogger(): Logger;
/** Replaces the default logger set in configurations with new Logger with new configurations */
setLogger(logger: Logger): void;
}
//# sourceMappingURL=IPublicClientApplication.d.ts.map

@@ -10,2 +10,3 @@ import { AuthenticationResult } from "@azure/msal-common";

* are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user.
* @public
*/

@@ -18,3 +19,3 @@ export declare class PublicClientApplication extends ClientApplication implements IPublicClientApplication {

*
* AAD authorities are of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}.
* AAD authorities are of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
* - If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).

@@ -25,7 +26,7 @@ * - If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.

*
* Azure B2C authorities are of the form https://{instance}/{tenant}/{policy}. Each policy is considered
* Azure B2C authorities are of the form https://\{instance\}/\{tenant\}/\{policy\}. Each policy is considered
* its own authority. You will have to set the all of the knownAuthorities at the time of the client application
* construction.
*
* ADFS authorities are of the form https://{instance}/adfs.
* ADFS authorities are of the form https://\{instance\}/adfs.
*/

@@ -51,5 +52,6 @@ constructor(configuration: Configuration);

*
* @param request
* @param request - UsenamePasswordRequest
*/
acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>;
}
//# sourceMappingURL=PublicClientApplication.d.ts.map

@@ -10,2 +10,3 @@ import { LoggerOptions, INetworkModule, ProtocolMode, ICachePlugin } from "@azure/msal-common";

* - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
* @public
*/

@@ -32,2 +33,3 @@ export declare type NodeAuthOptions = {

* - cachePlugin - Plugin for reading and writing token cache to disk.
* @public
*/

@@ -42,2 +44,3 @@ export declare type CacheOptions = {

* - networkClient - Http client used for all http get and post calls. Defaults to using MSAL's default http client.
* @public
*/

@@ -54,2 +57,3 @@ export declare type NodeSystemOptions = {

* - system: this is where you can configure the network client, logger
* @public
*/

@@ -64,8 +68,10 @@ export declare type Configuration = {

*
* @param auth
* @param cache
* @param system
* @param auth - Authentication options
* @param cache - Cache options
* @param system - System options
*
* @returns Configuration
* @public
*/
export declare function buildAppConfiguration({ auth, cache, system, }: Configuration): Configuration;
//# sourceMappingURL=Configuration.d.ts.map

@@ -5,2 +5,3 @@ import { ICrypto, PkceCodes } from "@azure/msal-common";

* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
* @public
*/

@@ -17,3 +18,3 @@ export declare class CryptoProvider implements ICrypto {

* Encodes input string to base64.
* @param input
* @param input - string to be encoded
*/

@@ -23,3 +24,3 @@ base64Encode(input: string): string;

* Decodes input string from base64.
* @param input
* @param input - string to be decoded
*/

@@ -31,4 +32,11 @@ base64Decode(input: string): string;

generatePkceCodes(): Promise<PkceCodes>;
/**
* Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
*/
getPublicKeyThumbprint(): Promise<string>;
/**
* Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
*/
signJwt(): Promise<string>;
}
//# sourceMappingURL=CryptoProvider.d.ts.map

@@ -14,1 +14,2 @@ export declare class GuidGenerator {

}
//# sourceMappingURL=GuidGenerator.d.ts.map

@@ -31,1 +31,2 @@ import { PkceCodes } from "@azure/msal-common";

}
//# sourceMappingURL=PkceGenerator.d.ts.map

@@ -7,10 +7,11 @@ /**

export { IConfidentialClientApplication } from "./client/IConfidentialClientApplication";
export { ITokenCache } from "./cache/ITokenCache";
export { PublicClientApplication } from "./client/PublicClientApplication";
export { ConfidentialClientApplication } from "./client/ConfidentialClientApplication";
export { Configuration, buildAppConfiguration } from "./config/Configuration";
export { Storage } from "./cache/Storage";
export { Serializer } from "./cache/serializer/Serializer";
export { Deserializer } from "./cache/serializer/Deserializer";
export { ClientApplication } from "./client/ClientApplication";
export { Configuration, buildAppConfiguration, NodeAuthOptions, NodeSystemOptions, CacheOptions } from "./config/Configuration";
export { ClientAssertion } from "./client/ClientAssertion";
export { TokenCache } from "./cache/TokenCache";
export { CacheKVStore } from "./cache/serializer/SerializerTypes";
export { NodeStorage } from "./cache/NodeStorage";
export { CacheKVStore, JsonCache, InMemoryCache, SerializedAccountEntity, SerializedIdTokenEntity, SerializedAccessTokenEntity, SerializedAppMetadataEntity, SerializedRefreshTokenEntity } from "./cache/serializer/SerializerTypes";
export { CryptoProvider } from "./crypto/CryptoProvider";

@@ -22,4 +23,6 @@ export type { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest";

export type { OnBehalfOfRequest } from "./request/OnBehalfOfRequest";
export type { UsernamePasswordRequest } from "./request/UsernamePasswordRequest";
export type { RefreshTokenRequest } from "./request/RefreshTokenRequest";
export type { SilentFlowRequest } from "./request/SilentFlowRequest";
export { PromptValue, ResponseMode, AuthenticationResult, AccountInfo, AuthError, AuthErrorMessage, InteractionRequiredAuthError, ServerError, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache } from "@azure/msal-common";
export { PromptValue, ResponseMode, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, InteractionRequiredAuthError, ServerError, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache } from "@azure/msal-common";
//# sourceMappingURL=index.d.ts.map

@@ -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=require("@azure/msal-common"),r=e(require("axios")),n=require("uuid"),i=e(require("crypto")),o=require("jsonwebtoken");function a(e,t,r,n,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,i)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function c(e){a(o,n,i,c,s,"next",e)}function s(e){a(o,n,i,c,s,"throw",e)}c(void 0)}))}}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}var h,l,f=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=Object.create((t&&t.prototype instanceof l?t:l).prototype),o=new A(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===h)continue;return c}}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 s=u(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};d[i]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(w([])));y&&y!==t&&r.call(y,i)&&(d=y);var v=p.prototype=l.prototype=Object.create(d);function m(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,c){var s=u(e[i],e,o);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(l).then((function(e){h.value=e,a(h)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function k(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,k(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function b(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 T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function w(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=v.constructor=p,p.constructor=f,f.displayName=c(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},m(C.prototype),C.prototype[o]=function(){return this},e.AsyncIterator=C,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new C(s(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(v),c(v,a,"Generator"),v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=w,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},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 i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(l={exports:{}}),l.exports);!function(e){e.GET="get",e.POST="post"}(h||(h={}));var p,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";!function(e){e[e.acquireTokenSilent=62]="acquireTokenSilent",e[e.acquireTokenByUsernamePassword=371]="acquireTokenByUsernamePassword",e[e.acquireTokenByDeviceCode=671]="acquireTokenByDeviceCode",e[e.acquireTokenByClientCredential=771]="acquireTokenByClientCredential",e[e.acquireTokenByCode=871]="acquireTokenByCode",e[e.acquireTokenByRefreshToken=872]="acquireTokenByRefreshToken"}(p||(p={}));var g=function(){function e(){r.defaults.validateStatus=function(){return!0}}var t=e.prototype;return t.sendGetRequestAsync=function(){var e=c(f.mark((function e(t,n){var i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={method:h.GET,url:t,headers:n&&n.headers},e.next=3,r(i);case 3:return e.abrupt("return",{headers:(o=e.sent).headers,body:o.data,status:o.status});case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),t.sendPostRequestAsync=function(){var e=c(f.mark((function e(t,n){var i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={method:h.POST,url:t,data:n&&n.body||"",headers:n&&n.headers},e.next=3,r(i);case 3:return e.abrupt("return",{headers:(o=e.sent).headers,body:o.data,status:o.status});case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),e}(),y={clientId:"",authority:t.Constants.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],protocolMode:t.ProtocolMode.AAD},v={},m={loggerOptions:{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:t.LogLevel.Info},networkClient:function(){function e(){}return e.getNetworkClient=function(){return new g},e}().getNetworkClient()};function C(e){var t=e.cache,r=e.system;return{auth:s({},y,e.auth),cache:s({},v,t),system:s({},m,r)}}var k=function(){function e(){}return e.generateGuid=function(){return n.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}(),b=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}(),T=function(){function e(){}var t=e.prototype;return t.generatePkceCodes=function(){var e=c(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(t),e.abrupt("return",{verifier:t,challenge:r});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.generateCodeVerifier=function(){var e=i.randomBytes(32),t=this.bufferToCVString(e);return b.base64EncodeUrl(t)},t.generateCodeChallengeFromVerifier=function(e){return b.base64EncodeUrl(this.sha256(e).toString("base64"),"base64")},t.sha256=function(e){return i.createHash("sha256").update(e).digest()},t.bufferToCVString=function(e){for(var t=[],r=0;r<e.byteLength;r+=1)t.push(d[e[r]%d.length]);return t.join("")},e}(),A=function(){function e(){this.pkceGenerator=new T}var t=e.prototype;return t.createNewGuid=function(){return k.generateGuid()},t.base64Encode=function(e){return b.base64Encode(e)},t.base64Decode=function(e){return b.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}(),w=function(){function e(){}return e.deserializeJSONBlob=function(e){return t.StringUtils.isEmpty(e)?{}:JSON.parse(e)},e.deserializeAccounts=function(e){var r={};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 t.AccountEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeIdTokens=function(e){var r={};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 t.IdTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAccessTokens=function(e){var r={};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 t.AccessTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeRefreshTokens=function(e){var r={};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 t.RefreshTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAppMetadata=function(e){var r={};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 t.AppMetadataEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},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}(),x=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}(),E=function(e){function r(t,r,n){var i;return(i=e.call(this,r,n)||this).cache={},i.changeEmitters=[],i.logger=t,i}u(r,e);var n=r.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 r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(var n in e)if(e[n]instanceof t.AccountEntity)r.accounts[n]=e[n];else if(e[n]instanceof t.IdTokenEntity)r.idTokens[n]=e[n];else if(e[n]instanceof t.AccessTokenEntity)r.accessTokens[n]=e[n];else if(e[n]instanceof t.RefreshTokenEntity)r.refreshTokens[n]=e[n];else{if(!(e[n]instanceof t.AppMetadataEntity))continue;r.appMetadata[n]=e[n]}return r},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.getItem=function(e){return this.logger.verbosePii("Item key: "+e),this.getCache()[e]},n.setItem=function(e,t){this.logger.verbosePii("Item key: "+e);var r=this.getCache();r[e]=t,this.setCache(r)},n.getAccount=function(e){var r=this.getItem(e);return t.AccountEntity.isAccountEntity(r)?r:null},n.setAccount=function(e){var t=e.generateAccountKey();this.setItem(t,e)},n.getIdTokenCredential=function(e){var r=this.getItem(e);return t.IdTokenEntity.isIdTokenEntity(r)?r:null},n.setIdTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getAccessTokenCredential=function(e){var r=this.getItem(e);return t.AccessTokenEntity.isAccessTokenEntity(r)?r:null},n.setAccessTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getRefreshTokenCredential=function(e){var r=this.getItem(e);return t.RefreshTokenEntity.isRefreshTokenEntity(r)?r:null},n.setRefreshTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getAppMetadata=function(e){var r=this.getItem(e);return t.AppMetadataEntity.isAppMetadataEntity(e,r)?r:null},n.setAppMetadata=function(e){var t=e.generateAppMetadataKey();this.setItem(t,e)},n.getServerTelemetry=function(e){var r=this.getItem(e);return r&&t.ServerTelemetryEntity.isServerTelemetryEntity(e,r)?r:null},n.setServerTelemetry=function(e,t){this.setItem(e,t)},n.getAuthorityMetadata=function(e){var r=this.getItem(e);return r&&t.AuthorityMetadataEntity.isAuthorityMetadataEntity(e,r)?r:null},n.getAuthorityMetadataKeys=function(){var e=this;return this.getKeys().filter((function(t){return e.isAuthorityMetadata(t)}))},n.setAuthorityMetadata=function(e,t){this.setItem(e,t)},n.getThrottlingCache=function(e){var r=this.getItem(e);return r&&t.ThrottlingEntity.isThrottlingEntity(e,r)?r:null},n.setThrottlingCache=function(e,t){this.setItem(e,t)},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),this.emitChange()),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()},r.generateInMemoryCache=function(e){return w.deserializeAllCache(w.deserializeJSONBlob(e))},r.generateJsonCache=function(e){return x.serializeAllCache(e)},r}(t.CacheManager),I={},O={},_={},M={},S={},R=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 r=e.prototype;return r.hasChanged=function(){return this.cacheHasChanged},r.serialize=function(){this.logger.verbose("Serializing in-memory cache");var e=x.serializeAllCache(this.storage.getInMemoryCache());return t.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)},r.deserialize=function(e){if(this.logger.verbose("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,t.StringUtils.isEmpty(this.cacheSnapshot))this.logger.verbose("No cache snapshot to deserialize");else{this.logger.verbose("Reading cache snapshot from disk");var r=w.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}},r.getKVStore=function(){return this.storage.getCache()},r.getAllAccounts=function(){var e=c(f.mark((function e(){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("getAllAccounts called"),e.prev=1,!this.persistence){e.next=6;break}return r=new t.TokenCacheContext(this,!1),e.next=6,this.persistence.beforeCacheAccess(r);case 6:return e.abrupt("return",this.storage.getAllAccounts());case 7:if(e.prev=7,!this.persistence||!r){e.next=11;break}return e.next=11,this.persistence.afterCacheAccess(r);case 11:return e.finish(7);case 12:case"end":return e.stop()}}),e,this,[[1,,7,12]])})));return function(){return e.apply(this,arguments)}}(),r.getAccountByHomeId=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllAccounts();case 2:if(n=e.sent,t.StringUtils.isEmpty(r)||!n||!n.length){e.next=7;break}return e.abrupt("return",n.filter((function(e){return e.homeAccountId===r}))[0]||null);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.getAccountByLocalId=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllAccounts();case 2:if(n=e.sent,t.StringUtils.isEmpty(r)||!n||!n.length){e.next=7;break}return e.abrupt("return",n.filter((function(e){return e.localAccountId===r}))[0]||null);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.removeAccount=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("removeAccount called"),e.prev=1,!this.persistence){e.next=6;break}return n=new t.TokenCacheContext(this,!0),e.next=6,this.persistence.beforeCacheAccess(n);case 6:this.storage.removeAccount(t.AccountEntity.generateAccountCacheKey(r));case 7:if(e.prev=7,!this.persistence||!n){e.next=11;break}return e.next=11,this.persistence.afterCacheAccess(n);case 11:return e.finish(7);case 12:case"end":return e.stop()}}),e,this,[[1,,7,12]])})));return function(t){return e.apply(this,arguments)}}(),r.handleChangeEvent=function(){this.cacheHasChanged=!0},r.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)},r.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},r.mergeRemovals=function(e,t){return this.logger.verbose("Remove updated entries in cache"),s({},e,{Account:e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,AccessToken:e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,RefreshToken:e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,IdToken:e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,AppMetadata:e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata})},r.mergeRemovalsDict=function(e,t){var r=s({},e);return Object.keys(e).forEach((function(e){t&&t.hasOwnProperty(e)||delete r[e]})),r},r.overlayDefaults=function(e){return this.logger.verbose("Overlaying input cache with the default cache"),{Account:s({},I,e.Account),IdToken:s({},O,e.IdToken),AccessToken:s({},_,e.AccessToken),RefreshToken:s({},M,e.RefreshToken),AppMetadata:s({},S,e.AppMetadata)}},e}(),j=function(){function e(e){this.config=C(e),this.cryptoProvider=new A,this.logger=new t.Logger(this.config.system.loggerOptions,"@azure/msal-node","1.0.0-beta.5"),this.storage=new E(this.logger,this.config.auth.clientId,this.cryptoProvider),this.tokenCache=new R(this.storage,this.logger,this.config.cache.cachePlugin)}var r=e.prototype;return r.getAuthCodeUrl=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("getAuthCodeUrl called"),n=s({},r,this.initializeBaseRequest(r),{responseMode:r.responseMode||t.ResponseMode.QUERY,authenticationScheme:t.AuthenticationScheme.BEARER}),e.next=4,this.buildOauthClientConfiguration(n.authority);case 4:return i=e.sent,this.logger.verbose("Auth client config generated"),o=new t.AuthorizationCodeClient(i),e.abrupt("return",o.getAuthCodeUrl(n));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.acquireTokenByCode=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByCode called"),n=s({},r,this.initializeBaseRequest(r),{authenticationScheme:t.AuthenticationScheme.BEARER}),i=this.initializeServerTelemetryManager(p.acquireTokenByCode,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.AuthorizationCodeClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r.acquireTokenByRefreshToken=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByRefreshToken called"),n=s({},r,this.initializeBaseRequest(r),{authenticationScheme:t.AuthenticationScheme.BEARER}),i=this.initializeServerTelemetryManager(p.acquireTokenByRefreshToken,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.RefreshTokenClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r.acquireTokenSilent=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s({},r,this.initializeBaseRequest(r),{forceRefresh:r.forceRefresh||!1}),i=this.initializeServerTelemetryManager(p.acquireTokenSilent,n.correlationId,n.forceRefresh),e.prev=2,e.next=5,this.buildOauthClientConfiguration(n.authority,i);case 5:return o=new t.SilentFlowClient(e.sent),e.abrupt("return",o.acquireToken(n));case 10:throw e.prev=10,e.t0=e.catch(2),i.cacheFailedRequest(e.t0),e.t0;case 14:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),r.getTokenCache=function(){return this.logger.info("getTokenCache called"),this.tokenCache},r.getLogger=function(){return this.logger},r.setLogger=function(e){this.logger=e},r.buildOauthClientConfiguration=function(){var e=c(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.verbose("buildOauthClientConfiguration called"),e.next=3,this.createAuthority(t);case 3:return e.abrupt("return",{authOptions:{clientId:this.config.auth.clientId,authority:n=e.sent,clientCapabilities:this.config.auth.clientCapabilities},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:r,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:this.clientAssertion?this.getClientAssertion(n):void 0},libraryInfo:{sku:"msal.js.node",version:"1.0.0-beta.5",cpu:process.arch||"",os:process.platform||""},persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache});case 5:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),r.getClientAssertion=function(e){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},r.initializeBaseRequest=function(e){return this.logger.verbose("initializeRequestScopes called"),s({},e,{scopes:[].concat(e&&e.scopes||[],[t.Constants.OPENID_SCOPE,t.Constants.PROFILE_SCOPE,t.Constants.OFFLINE_ACCESS_SCOPE]),correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid(),authority:e.authority||this.config.auth.authority})},r.initializeServerTelemetryManager=function(e,r,n){return new t.ServerTelemetryManager({clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1},this.storage)},r.createAuthority=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.verbose("createAuthority called"),n={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e.next=4,t.AuthorityFactory.createDiscoveredInstance(r,this.config.system.networkClient,this.storage,n);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e}(),q=function(e){function r(t){return e.call(this,t)||this}u(r,e);var n=r.prototype;return n.acquireTokenByDeviceCode=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByDeviceCode called"),n=s({},r,this.initializeBaseRequest(r)),i=this.initializeServerTelemetryManager(p.acquireTokenByDeviceCode,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.DeviceCodeClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenByUsernamePassword=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByUsernamePassword called"),n=s({},r,this.initializeBaseRequest(r)),i=this.initializeServerTelemetryManager(p.acquireTokenByUsernamePassword,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.UsernamePasswordClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r}(j),P=function(){function e(){}e.fromAssertion=function(t){var r=new e;return r.jwt=t,r},e.fromCertificate=function(t,r,n){var i=new e;return i.privateKey=r,i.thumbprint=t,n&&(i.publicCertificate=this.parseCertificate(n)),i};var r=e.prototype;return r.getJwt=function(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw t.ClientAuthError.createInvalidAssertionError()},r.createJwt=function(e,r,n){var i,a;this.issuer=r,this.jwtAudience=n;var c=t.TimeUtils.nowSeconds();this.expirationTime=c+600;var s,u=((i={}).alg="RS256",i.x5t=b.base64EncodeUrl(this.thumbprint,"hex"),i);this.publicCertificate&&Object.assign(u,((s={}).x5c=this.publicCertificate,s));var h=((a={}).aud=this.jwtAudience,a.exp=this.expirationTime,a.iss=this.issuer,a.sub=this.issuer,a.nbf=c,a.jti=e.createNewGuid(),a);return this.jwt=o.sign(h,this.privateKey,{header:u}),this.jwt},r.isExpired=function(){return this.expirationTime<t.TimeUtils.nowSeconds()},e.parseCertificate=function(e){for(var t,r=/\x2D\x2D\x2D\x2D\x2DBEGIN CERTIFICATE\x2D\x2D\x2D\x2D\x2D\n([\s\S]+?)\n\x2D\x2D\x2D\x2D\x2DEND CERTIFICATE\x2D\x2D\x2D\x2D\x2D/g,n=[];null!==(t=r.exec(e));)n.push(t[1].replace(/\n/,""));return n},e}(),z=function(e){function r(t){var r;return(r=e.call(this,t)||this).setClientCredential(r.config),r}u(r,e);var n=r.prototype;return n.acquireTokenByClientCredential=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByClientCredential called"),n=s({},r,this.initializeBaseRequest(r)),i=this.initializeServerTelemetryManager(p.acquireTokenByClientCredential,n.correlationId,n.skipCache),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.ClientCredentialClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenOnBehalfOf=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenOnBehalfOf called"),n=s({},r,this.initializeBaseRequest(r)),e.next=4,this.buildOauthClientConfiguration(n.authority);case 4:return i=e.sent,this.logger.verbose("Auth client config generated"),o=new t.OnBehalfOfClient(i),e.abrupt("return",o.acquireToken(n));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.setClientCredential=function(e){var r=!t.StringUtils.isEmpty(e.auth.clientSecret),n=!t.StringUtils.isEmpty(e.auth.clientAssertion),i=e.auth.clientCertificate,o=!t.StringUtils.isEmpty(i.thumbprint)||!t.StringUtils.isEmpty(i.privateKey);if(r&&n||n&&o||r&&o)throw t.ClientAuthError.createInvalidCredentialError();if(r)this.clientSecret=e.auth.clientSecret;else if(n)this.clientAssertion=P.fromAssertion(e.auth.clientAssertion);else{if(!o)throw t.ClientAuthError.createInvalidCredentialError();var a;this.clientAssertion=P.fromCertificate(i.thumbprint,i.privateKey,null==(a=e.auth.clientCertificate)?void 0:a.x5c)}},r}(j);Object.defineProperty(exports,"AuthError",{enumerable:!0,get:function(){return t.AuthError}}),Object.defineProperty(exports,"AuthErrorMessage",{enumerable:!0,get:function(){return t.AuthErrorMessage}}),Object.defineProperty(exports,"ClientAuthError",{enumerable:!0,get:function(){return t.ClientAuthError}}),Object.defineProperty(exports,"ClientAuthErrorMessage",{enumerable:!0,get:function(){return t.ClientAuthErrorMessage}}),Object.defineProperty(exports,"ClientConfigurationError",{enumerable:!0,get:function(){return t.ClientConfigurationError}}),Object.defineProperty(exports,"ClientConfigurationErrorMessage",{enumerable:!0,get:function(){return t.ClientConfigurationErrorMessage}}),Object.defineProperty(exports,"InteractionRequiredAuthError",{enumerable:!0,get:function(){return t.InteractionRequiredAuthError}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"Logger",{enumerable:!0,get:function(){return t.Logger}}),Object.defineProperty(exports,"PromptValue",{enumerable:!0,get:function(){return t.PromptValue}}),Object.defineProperty(exports,"ProtocolMode",{enumerable:!0,get:function(){return t.ProtocolMode}}),Object.defineProperty(exports,"ResponseMode",{enumerable:!0,get:function(){return t.ResponseMode}}),Object.defineProperty(exports,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(exports,"TokenCacheContext",{enumerable:!0,get:function(){return t.TokenCacheContext}}),exports.ConfidentialClientApplication=z,exports.CryptoProvider=A,exports.Deserializer=w,exports.PublicClientApplication=q,exports.Serializer=x,exports.Storage=E,exports.TokenCache=R,exports.buildAppConfiguration=C;
"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("axios")),n=require("uuid"),i=e(require("crypto")),o=require("jsonwebtoken");function a(e,t,r,n,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,i)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function c(e){a(o,n,i,c,s,"next",e)}function s(e){a(o,n,i,c,s,"throw",e)}c(void 0)}))}}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}var h,l,f=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=Object.create((t&&t.prototype instanceof l?t:l).prototype),o=new A(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=C(a,r);if(c){if(c===h)continue;return c}}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 s=u(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};d[i]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(w([])));y&&y!==t&&r.call(y,i)&&(d=y);var v=p.prototype=l.prototype=Object.create(d);function m(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,c){var s=u(e[i],e,o);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(l).then((function(e){h.value=e,a(h)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function C(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,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function b(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 T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function w(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=v.constructor=p,p.constructor=f,f.displayName=c(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},m(k.prototype),k.prototype[o]=function(){return this},e.AsyncIterator=k,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new k(s(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(v),c(v,a,"Generator"),v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=w,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},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 i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(l={exports:{}}),l.exports);!function(e){e.GET="get",e.POST="post"}(h||(h={}));var p,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";!function(e){e[e.acquireTokenSilent=62]="acquireTokenSilent",e[e.acquireTokenByUsernamePassword=371]="acquireTokenByUsernamePassword",e[e.acquireTokenByDeviceCode=671]="acquireTokenByDeviceCode",e[e.acquireTokenByClientCredential=771]="acquireTokenByClientCredential",e[e.acquireTokenByCode=871]="acquireTokenByCode",e[e.acquireTokenByRefreshToken=872]="acquireTokenByRefreshToken"}(p||(p={}));var g=function(){function e(){}var t=e.prototype;return t.sendGetRequestAsync=function(){var e=c(f.mark((function e(t,n){var i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={method:h.GET,url:t,headers:n&&n.headers,validateStatus:function(){return!0}},e.next=3,r(i);case 3:return e.abrupt("return",{headers:(o=e.sent).headers,body:o.data,status:o.status});case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),t.sendPostRequestAsync=function(){var e=c(f.mark((function e(t,n){var i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={method:h.POST,url:t,data:n&&n.body||"",headers:n&&n.headers,validateStatus:function(){return!0}},e.next=3,r(i);case 3:return e.abrupt("return",{headers:(o=e.sent).headers,body:o.data,status:o.status});case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),e}(),y={clientId:"",authority:t.Constants.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],protocolMode:t.ProtocolMode.AAD},v={},m={loggerOptions:{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:t.LogLevel.Info},networkClient:function(){function e(){}return e.getNetworkClient=function(){return new g},e}().getNetworkClient()};function k(e){var t=e.cache,r=e.system;return{auth:s({},y,e.auth),cache:s({},v,t),system:s({},m,r)}}var C=function(){function e(){}return e.generateGuid=function(){return n.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}(),b=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}(),T=function(){function e(){}var t=e.prototype;return t.generatePkceCodes=function(){var e=c(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(t),e.abrupt("return",{verifier:t,challenge:r});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.generateCodeVerifier=function(){var e=i.randomBytes(32),t=this.bufferToCVString(e);return b.base64EncodeUrl(t)},t.generateCodeChallengeFromVerifier=function(e){return b.base64EncodeUrl(this.sha256(e).toString("base64"),"base64")},t.sha256=function(e){return i.createHash("sha256").update(e).digest()},t.bufferToCVString=function(e){for(var t=[],r=0;r<e.byteLength;r+=1)t.push(d[e[r]%d.length]);return t.join("")},e}(),A=function(){function e(){this.pkceGenerator=new T}var t=e.prototype;return t.createNewGuid=function(){return C.generateGuid()},t.base64Encode=function(e){return b.base64Encode(e)},t.base64Decode=function(e){return b.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}(),w=function(){function e(){}return e.deserializeJSONBlob=function(e){return t.StringUtils.isEmpty(e)?{}:JSON.parse(e)},e.deserializeAccounts=function(e){var r={};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 t.AccountEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeIdTokens=function(e){var r={};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 t.IdTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAccessTokens=function(e){var r={};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 t.AccessTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeRefreshTokens=function(e){var r={};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 t.RefreshTokenEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},e.deserializeAppMetadata=function(e){var r={};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 t.AppMetadataEntity;t.CacheManager.toObject(a,o),r[n]=a})),r},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}(),x=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}(),E=function(e){function r(t,r,n){var i;return(i=e.call(this,r,n)||this).cache={},i.changeEmitters=[],i.logger=t,i}u(r,e);var n=r.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 r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(var n in e)if(e[n]instanceof t.AccountEntity)r.accounts[n]=e[n];else if(e[n]instanceof t.IdTokenEntity)r.idTokens[n]=e[n];else if(e[n]instanceof t.AccessTokenEntity)r.accessTokens[n]=e[n];else if(e[n]instanceof t.RefreshTokenEntity)r.refreshTokens[n]=e[n];else{if(!(e[n]instanceof t.AppMetadataEntity))continue;r.appMetadata[n]=e[n]}return r},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.getItem=function(e){return this.logger.verbosePii("Item key: "+e),this.getCache()[e]},n.setItem=function(e,t){this.logger.verbosePii("Item key: "+e);var r=this.getCache();r[e]=t,this.setCache(r)},n.getAccount=function(e){var r=this.getItem(e);return t.AccountEntity.isAccountEntity(r)?r:null},n.setAccount=function(e){var t=e.generateAccountKey();this.setItem(t,e)},n.getIdTokenCredential=function(e){var r=this.getItem(e);return t.IdTokenEntity.isIdTokenEntity(r)?r:null},n.setIdTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getAccessTokenCredential=function(e){var r=this.getItem(e);return t.AccessTokenEntity.isAccessTokenEntity(r)?r:null},n.setAccessTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getRefreshTokenCredential=function(e){var r=this.getItem(e);return t.RefreshTokenEntity.isRefreshTokenEntity(r)?r:null},n.setRefreshTokenCredential=function(e){var t=e.generateCredentialKey();this.setItem(t,e)},n.getAppMetadata=function(e){var r=this.getItem(e);return t.AppMetadataEntity.isAppMetadataEntity(e,r)?r:null},n.setAppMetadata=function(e){var t=e.generateAppMetadataKey();this.setItem(t,e)},n.getServerTelemetry=function(e){var r=this.getItem(e);return r&&t.ServerTelemetryEntity.isServerTelemetryEntity(e,r)?r:null},n.setServerTelemetry=function(e,t){this.setItem(e,t)},n.getAuthorityMetadata=function(e){var r=this.getItem(e);return r&&t.AuthorityMetadataEntity.isAuthorityMetadataEntity(e,r)?r:null},n.getAuthorityMetadataKeys=function(){var e=this;return this.getKeys().filter((function(t){return e.isAuthorityMetadata(t)}))},n.setAuthorityMetadata=function(e,t){this.setItem(e,t)},n.getThrottlingCache=function(e){var r=this.getItem(e);return r&&t.ThrottlingEntity.isThrottlingEntity(e,r)?r:null},n.setThrottlingCache=function(e,t){this.setItem(e,t)},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),this.emitChange()),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()},r.generateInMemoryCache=function(e){return w.deserializeAllCache(w.deserializeJSONBlob(e))},r.generateJsonCache=function(e){return x.serializeAllCache(e)},r}(t.CacheManager),I={},O={},_={},M={},S={},R=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 r=e.prototype;return r.hasChanged=function(){return this.cacheHasChanged},r.serialize=function(){this.logger.verbose("Serializing in-memory cache");var e=x.serializeAllCache(this.storage.getInMemoryCache());return t.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)},r.deserialize=function(e){if(this.logger.verbose("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,t.StringUtils.isEmpty(this.cacheSnapshot))this.logger.verbose("No cache snapshot to deserialize");else{this.logger.verbose("Reading cache snapshot from disk");var r=w.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}},r.getKVStore=function(){return this.storage.getCache()},r.getAllAccounts=function(){var e=c(f.mark((function e(){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("getAllAccounts called"),e.prev=1,!this.persistence){e.next=6;break}return r=new t.TokenCacheContext(this,!1),e.next=6,this.persistence.beforeCacheAccess(r);case 6:return e.abrupt("return",this.storage.getAllAccounts());case 7:if(e.prev=7,!this.persistence||!r){e.next=11;break}return e.next=11,this.persistence.afterCacheAccess(r);case 11:return e.finish(7);case 12:case"end":return e.stop()}}),e,this,[[1,,7,12]])})));return function(){return e.apply(this,arguments)}}(),r.getAccountByHomeId=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllAccounts();case 2:if(n=e.sent,t.StringUtils.isEmpty(r)||!n||!n.length){e.next=7;break}return e.abrupt("return",n.filter((function(e){return e.homeAccountId===r}))[0]||null);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.getAccountByLocalId=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllAccounts();case 2:if(n=e.sent,t.StringUtils.isEmpty(r)||!n||!n.length){e.next=7;break}return e.abrupt("return",n.filter((function(e){return e.localAccountId===r}))[0]||null);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.removeAccount=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.verbose("removeAccount called"),e.prev=1,!this.persistence){e.next=6;break}return n=new t.TokenCacheContext(this,!0),e.next=6,this.persistence.beforeCacheAccess(n);case 6:this.storage.removeAccount(t.AccountEntity.generateAccountCacheKey(r));case 7:if(e.prev=7,!this.persistence||!n){e.next=11;break}return e.next=11,this.persistence.afterCacheAccess(n);case 11:return e.finish(7);case 12:case"end":return e.stop()}}),e,this,[[1,,7,12]])})));return function(t){return e.apply(this,arguments)}}(),r.handleChangeEvent=function(){this.cacheHasChanged=!0},r.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)},r.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},r.mergeRemovals=function(e,t){return this.logger.verbose("Remove updated entries in cache"),s({},e,{Account:e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,AccessToken:e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,RefreshToken:e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,IdToken:e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,AppMetadata:e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata})},r.mergeRemovalsDict=function(e,t){var r=s({},e);return Object.keys(e).forEach((function(e){t&&t.hasOwnProperty(e)||delete r[e]})),r},r.overlayDefaults=function(e){return this.logger.verbose("Overlaying input cache with the default cache"),{Account:s({},I,e.Account),IdToken:s({},O,e.IdToken),AccessToken:s({},_,e.AccessToken),RefreshToken:s({},M,e.RefreshToken),AppMetadata:s({},S,e.AppMetadata)}},e}(),j=function(){function e(e){this.config=k(e),this.cryptoProvider=new A,this.logger=new t.Logger(this.config.system.loggerOptions,"@azure/msal-node","1.0.0-beta.6"),this.storage=new E(this.logger,this.config.auth.clientId,this.cryptoProvider),this.tokenCache=new R(this.storage,this.logger,this.config.cache.cachePlugin)}var r=e.prototype;return r.getAuthCodeUrl=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("getAuthCodeUrl called"),n=s({},r,this.initializeBaseRequest(r),{responseMode:r.responseMode||t.ResponseMode.QUERY,authenticationScheme:t.AuthenticationScheme.BEARER}),e.next=4,this.buildOauthClientConfiguration(n.authority);case 4:return i=e.sent,this.logger.verbose("Auth client config generated"),o=new t.AuthorizationCodeClient(i),e.abrupt("return",o.getAuthCodeUrl(n));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.acquireTokenByCode=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByCode called"),n=s({},r,this.initializeBaseRequest(r),{authenticationScheme:t.AuthenticationScheme.BEARER}),i=this.initializeServerTelemetryManager(p.acquireTokenByCode,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.AuthorizationCodeClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r.acquireTokenByRefreshToken=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByRefreshToken called"),n=s({},r,this.initializeBaseRequest(r),{authenticationScheme:t.AuthenticationScheme.BEARER}),i=this.initializeServerTelemetryManager(p.acquireTokenByRefreshToken,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.RefreshTokenClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r.acquireTokenSilent=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s({},r,this.initializeBaseRequest(r),{forceRefresh:r.forceRefresh||!1}),i=this.initializeServerTelemetryManager(p.acquireTokenSilent,n.correlationId,n.forceRefresh),e.prev=2,e.next=5,this.buildOauthClientConfiguration(n.authority,i);case 5:return o=new t.SilentFlowClient(e.sent),e.abrupt("return",o.acquireToken(n));case 10:throw e.prev=10,e.t0=e.catch(2),i.cacheFailedRequest(e.t0),e.t0;case 14:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),r.getTokenCache=function(){return this.logger.info("getTokenCache called"),this.tokenCache},r.getLogger=function(){return this.logger},r.setLogger=function(e){this.logger=e},r.buildOauthClientConfiguration=function(){var e=c(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.verbose("buildOauthClientConfiguration called"),e.next=3,this.createAuthority(t);case 3:return e.abrupt("return",{authOptions:{clientId:this.config.auth.clientId,authority:n=e.sent,clientCapabilities:this.config.auth.clientCapabilities},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:r,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:this.clientAssertion?this.getClientAssertion(n):void 0},libraryInfo:{sku:"msal.js.node",version:"1.0.0-beta.6",cpu:process.arch||"",os:process.platform||""},persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache});case 5:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),r.getClientAssertion=function(e){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},r.initializeBaseRequest=function(e){return this.logger.verbose("initializeRequestScopes called"),s({},e,{scopes:[].concat(e&&e.scopes||[],t.OIDC_DEFAULT_SCOPES),correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid(),authority:e.authority||this.config.auth.authority})},r.initializeServerTelemetryManager=function(e,r,n){return new t.ServerTelemetryManager({clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1},this.storage)},r.createAuthority=function(){var e=c(f.mark((function e(r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.verbose("createAuthority called"),n={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e.next=4,t.AuthorityFactory.createDiscoveredInstance(r,this.config.system.networkClient,this.storage,n);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e}(),q=function(e){function r(t){return e.call(this,t)||this}u(r,e);var n=r.prototype;return n.acquireTokenByDeviceCode=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByDeviceCode called"),n=s({},r,this.initializeBaseRequest(r)),i=this.initializeServerTelemetryManager(p.acquireTokenByDeviceCode,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.DeviceCodeClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenByUsernamePassword=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByUsernamePassword called"),n=s({},r,this.initializeBaseRequest(r)),i=this.initializeServerTelemetryManager(p.acquireTokenByUsernamePassword,n.correlationId),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.UsernamePasswordClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),r}(j),P=function(){function e(){}e.fromAssertion=function(t){var r=new e;return r.jwt=t,r},e.fromCertificate=function(t,r,n){var i=new e;return i.privateKey=r,i.thumbprint=t,n&&(i.publicCertificate=this.parseCertificate(n)),i};var r=e.prototype;return r.getJwt=function(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw t.ClientAuthError.createInvalidAssertionError()},r.createJwt=function(e,r,n){var i,a;this.issuer=r,this.jwtAudience=n;var c=t.TimeUtils.nowSeconds();this.expirationTime=c+600;var s,u=((i={}).alg="RS256",i.x5t=b.base64EncodeUrl(this.thumbprint,"hex"),i);this.publicCertificate&&Object.assign(u,((s={}).x5c=this.publicCertificate,s));var h=((a={}).aud=this.jwtAudience,a.exp=this.expirationTime,a.iss=this.issuer,a.sub=this.issuer,a.nbf=c,a.jti=e.createNewGuid(),a);return this.jwt=o.sign(h,this.privateKey,{header:u}),this.jwt},r.isExpired=function(){return this.expirationTime<t.TimeUtils.nowSeconds()},e.parseCertificate=function(e){for(var t,r=/\x2D\x2D\x2D\x2D\x2DBEGIN CERTIFICATE\x2D\x2D\x2D\x2D\x2D\n([\s\S]+?)\n\x2D\x2D\x2D\x2D\x2DEND CERTIFICATE\x2D\x2D\x2D\x2D\x2D/g,n=[];null!==(t=r.exec(e));)n.push(t[1].replace(/\n/,""));return n},e}(),z=function(e){function r(t){var r;return(r=e.call(this,t)||this).setClientCredential(r.config),r}u(r,e);var n=r.prototype;return n.acquireTokenByClientCredential=function(){var e=c(f.mark((function e(r){var n,i,o,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenByClientCredential called"),n=s({},r,this.initializeBaseRequest(r)),i=this.initializeServerTelemetryManager(p.acquireTokenByClientCredential,n.correlationId,n.skipCache),e.prev=3,e.next=6,this.buildOauthClientConfiguration(n.authority,i);case 6:return o=e.sent,this.logger.verbose("Auth client config generated"),a=new t.ClientCredentialClient(o),e.abrupt("return",a.acquireToken(n));case 12:throw e.prev=12,e.t0=e.catch(3),i.cacheFailedRequest(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(t){return e.apply(this,arguments)}}(),n.acquireTokenOnBehalfOf=function(){var e=c(f.mark((function e(r){var n,i,o;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("acquireTokenOnBehalfOf called"),n=s({},r,this.initializeBaseRequest(r)),e.next=4,this.buildOauthClientConfiguration(n.authority);case 4:return i=e.sent,this.logger.verbose("Auth client config generated"),o=new t.OnBehalfOfClient(i),e.abrupt("return",o.acquireToken(n));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.setClientCredential=function(e){var r=!t.StringUtils.isEmpty(e.auth.clientSecret),n=!t.StringUtils.isEmpty(e.auth.clientAssertion),i=e.auth.clientCertificate,o=!t.StringUtils.isEmpty(i.thumbprint)||!t.StringUtils.isEmpty(i.privateKey);if(r&&n||n&&o||r&&o)throw t.ClientAuthError.createInvalidCredentialError();if(r)this.clientSecret=e.auth.clientSecret;else if(n)this.clientAssertion=P.fromAssertion(e.auth.clientAssertion);else{if(!o)throw t.ClientAuthError.createInvalidCredentialError();var a;this.clientAssertion=P.fromCertificate(i.thumbprint,i.privateKey,null==(a=e.auth.clientCertificate)?void 0:a.x5c)}},r}(j);Object.defineProperty(exports,"AuthError",{enumerable:!0,get:function(){return t.AuthError}}),Object.defineProperty(exports,"AuthErrorMessage",{enumerable:!0,get:function(){return t.AuthErrorMessage}}),Object.defineProperty(exports,"ClientAuthError",{enumerable:!0,get:function(){return t.ClientAuthError}}),Object.defineProperty(exports,"ClientAuthErrorMessage",{enumerable:!0,get:function(){return t.ClientAuthErrorMessage}}),Object.defineProperty(exports,"ClientConfigurationError",{enumerable:!0,get:function(){return t.ClientConfigurationError}}),Object.defineProperty(exports,"ClientConfigurationErrorMessage",{enumerable:!0,get:function(){return t.ClientConfigurationErrorMessage}}),Object.defineProperty(exports,"InteractionRequiredAuthError",{enumerable:!0,get:function(){return t.InteractionRequiredAuthError}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"Logger",{enumerable:!0,get:function(){return t.Logger}}),Object.defineProperty(exports,"PromptValue",{enumerable:!0,get:function(){return t.PromptValue}}),Object.defineProperty(exports,"ProtocolMode",{enumerable:!0,get:function(){return t.ProtocolMode}}),Object.defineProperty(exports,"ResponseMode",{enumerable:!0,get:function(){return t.ResponseMode}}),Object.defineProperty(exports,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(exports,"TokenCacheContext",{enumerable:!0,get:function(){return t.TokenCacheContext}}),exports.ClientApplication=j,exports.ClientAssertion=P,exports.ConfidentialClientApplication=z,exports.CryptoProvider=A,exports.NodeStorage=E,exports.PublicClientApplication=q,exports.TokenCache=R,exports.buildAppConfiguration=k;
//# sourceMappingURL=msal-node.cjs.production.min.js.map

@@ -6,3 +6,2 @@ import { INetworkModule, NetworkRequestOptions, NetworkResponse } from "@azure/msal-common";

export declare class HttpClient implements INetworkModule {
constructor();
/**

@@ -21,1 +20,2 @@ * Http Get request

}
//# sourceMappingURL=HttpClient.d.ts.map

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

import { AuthorizationCodeRequest as CommonAuthorizationCodeRequest } from "@azure/msal-common";
import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
/**

@@ -12,2 +12,3 @@ * Request object passed by user to acquire a token from the server exchanging a valid authorization code (second leg of OAuth2.0 Authorization Code flow)

* - codeVerifier - The same code_verifier that was used to obtain the authorization_code. Required if PKCE was used in the authorization code grant request.For more information, see the PKCE RFC: https://tools.ietf.org/html/rfc7636
* @public
*/

@@ -19,1 +20,2 @@ export declare type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "scopes" | "redirectUri" | "code" | "authenticationScheme" | "resourceRequestMethod" | "resourceRequestUri">> & {

};
//# sourceMappingURL=AuthorizationCodeRequest.d.ts.map

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

import { AuthorizationUrlRequest as CommonAuthorizationUrlRequest } from "@azure/msal-common";
import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
/**

@@ -26,2 +26,3 @@ * Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow)

* - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
* @public
*/

@@ -32,1 +33,2 @@ export declare type AuthorizationUrlRequest = Partial<Omit<CommonAuthorizationUrlRequest, "scopes" | "redirectUri" | "resourceRequestMethod" | "resourceRequestUri" | "authenticationScheme">> & {

};
//# sourceMappingURL=AuthorizationUrlRequest.d.ts.map

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

import { ClientCredentialRequest as CommonClientCredentialRequest } from "@azure/msal-common";
import { CommonClientCredentialRequest } from "@azure/msal-common";
/**

@@ -8,2 +8,3 @@ * CommonClientCredentialRequest

* - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
* @public
*/

@@ -13,1 +14,2 @@ export declare type ClientCredentialRequest = Partial<Omit<CommonClientCredentialRequest, "scopes" | "resourceRequestMethod" | "resourceRequestUri">> & {

};
//# sourceMappingURL=ClientCredentialRequest.d.ts.map

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

import { DeviceCodeRequest as CommonDeviceCodeRequest, DeviceCodeResponse } from "@azure/msal-common";
import { CommonDeviceCodeRequest, DeviceCodeResponse } from "@azure/msal-common";
/**

@@ -9,2 +9,3 @@ * Parameters for Oauth2 device code flow.

* - cancel - Boolean to cancel polling of device code endpoint. While the user authenticates on a separate device, MSAL polls the the token endpoint of security token service for the interval specified in the device code response (usually 15 minutes). To stop polling and cancel the request, set cancel=true.
* @public
*/

@@ -15,1 +16,2 @@ export declare type DeviceCodeRequest = Partial<Omit<CommonDeviceCodeRequest, "scopes" | "deviceCodeCallback" | "resourceRequestMethod" | "resourceRequestUri">> & {

};
//# sourceMappingURL=DeviceCodeRequest.d.ts.map

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

import { OnBehalfOfRequest as CommonOnBehalfOfRequest } from "@azure/msal-common";
import { CommonOnBehalfOfRequest } from "@azure/msal-common";
/**

@@ -8,2 +8,3 @@ * - scopes - Array of scopes the application is requesting access to.

* - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
* @public
*/

@@ -14,1 +15,2 @@ export declare type OnBehalfOfRequest = Partial<Omit<CommonOnBehalfOfRequest, "oboAssertion" | "scopes" | "resourceRequestMethod" | "resourceRequestUri">> & {

};
//# sourceMappingURL=OnBehalfOfRequest.d.ts.map

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

import { RefreshTokenRequest as CommonRefreshTokenRequest } from "@azure/msal-common";
import { CommonRefreshTokenRequest } from "@azure/msal-common";
/**

@@ -9,2 +9,3 @@ * CommonRefreshTokenRequest

* - refreshToken - A refresh token returned from a previous request to the Identity provider.
* @public
*/

@@ -15,1 +16,2 @@ export declare type RefreshTokenRequest = Partial<Omit<CommonRefreshTokenRequest, "scopes" | "refreshToken" | "authenticationScheme" | "resourceRequestMethod" | "resourceRequestUri">> & {

};
//# sourceMappingURL=RefreshTokenRequest.d.ts.map

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

import { AccountInfo, SilentFlowRequest as CommonSilentFlowRequest } from "@azure/msal-common";
import { AccountInfo, CommonSilentFlowRequest } from "@azure/msal-common";
/**

@@ -10,2 +10,3 @@ * SilentFlow parameters passed by the user to retrieve credentials silently

* - forceRefresh - Forces silent requests to make network calls if true.
* @public
*/

@@ -16,1 +17,2 @@ export declare type SilentFlowRequest = Partial<Omit<CommonSilentFlowRequest, "account" | "scopes" | "resourceRequestMethod" | "resourceRequestUri">> & {

};
//# sourceMappingURL=SilentFlowRequest.d.ts.map

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

import { UsernamePasswordRequest as CommonUsernamePasswordRequest } from "@azure/msal-common";
import { CommonUsernamePasswordRequest } from "@azure/msal-common";
/**

@@ -12,2 +12,3 @@ * UsernamePassword parameters passed by the user to retrieve credentials

* - password - credentials
* @public
*/

@@ -19,1 +20,2 @@ export declare type UsernamePasswordRequest = Partial<Omit<CommonUsernamePasswordRequest, "scopes" | "resourceRequestMethod" | "resourceRequestUri" | "username" | "password">> & {

};
//# sourceMappingURL=UsernamePasswordRequest.d.ts.map

@@ -68,1 +68,2 @@ /**

};
//# sourceMappingURL=Constants.d.ts.map

@@ -27,1 +27,2 @@ /// <reference types="node" />

}
//# sourceMappingURL=EncodingUtils.d.ts.map

@@ -8,1 +8,2 @@ import { INetworkModule } from "@azure/msal-common";

}
//# sourceMappingURL=NetworkUtils.d.ts.map
{
"name": "@azure/msal-node",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.6",
"author": {

@@ -65,6 +65,7 @@ "name": "Microsoft",

"tslib": "^1.10.0",
"typescript": "^3.8.3"
"typescript": "^3.8.3",
"@microsoft/api-extractor": "^7.13.0"
},
"dependencies": {
"@azure/msal-common": "^3.1.0",
"@azure/msal-common": "^4.0.0",
"axios": "^0.21.1",

@@ -71,0 +72,0 @@ "jsonwebtoken": "^8.5.1",

Sorry, the diff of this file is too big to display

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 too big to display

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