Commit 3a84cbd5 authored by Ahmet Turan Koçak's avatar Ahmet Turan Koçak
Browse files

Initial commit

parents
{"version":3,"file":"AuthorizationCodePayload.d.ts","sourceRoot":"","sources":["../../src/response/AuthorizationCodePayload.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,wBAAwB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
\ No newline at end of file
{"version":3,"file":"DeviceCodeResponse.d.ts","sourceRoot":"","sources":["../../src/response/DeviceCodeResponse.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,oBAAY,kBAAkB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC"}
\ No newline at end of file
{"version":3,"file":"ExternalTokenResponse.d.ts","sourceRoot":"","sources":["../../src/response/ExternalTokenResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF;;;;;;;;;GASG;AACH,oBAAY,qBAAqB,GAAG,IAAI,CAAC,gCAAgC,EAAE,YAAY,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,CAAC,GAAG;IAC/I,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB,CAAC"}
\ No newline at end of file
{"version":3,"file":"IMDSBadResponse.d.ts","sourceRoot":"","sources":["../../src/response/IMDSBadResponse.ts"],"names":[],"mappings":"AAKA,oBAAY,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC"}
\ No newline at end of file
{"version":3,"file":"ResponseHandler.d.ts","sourceRoot":"","sources":["../../src/response/ResponseHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI3E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE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AC,EAAE,SAAS,EACtB,YAAY,CAAC,EAAE,kBAAkB,EACjC,IAAI,CAAC,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC;CAsDnC"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __awaiter, __generator } from '../_virtual/_tslib.js';
import { buildClientInfo } from '../account/ClientInfo.js';
import { ClientAuthError } from '../error/ClientAuthError.js';
import { StringUtils } from '../utils/StringUtils.js';
import { ServerError } from '../error/ServerError.js';
import { AuthToken } from '../account/AuthToken.js';
import { ScopeSet } from '../request/ScopeSet.js';
import { AccountEntity } from '../cache/entities/AccountEntity.js';
import { AuthorityType } from '../authority/AuthorityType.js';
import { IdTokenEntity } from '../cache/entities/IdTokenEntity.js';
import { AccessTokenEntity } from '../cache/entities/AccessTokenEntity.js';
import { RefreshTokenEntity } from '../cache/entities/RefreshTokenEntity.js';
import { InteractionRequiredAuthError } from '../error/InteractionRequiredAuthError.js';
import { CacheRecord } from '../cache/entities/CacheRecord.js';
import { ProtocolUtils } from '../utils/ProtocolUtils.js';
import { Constants, AuthenticationScheme, THE_FAMILY_ID } from '../utils/Constants.js';
import { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';
import { AppMetadataEntity } from '../cache/entities/AppMetadataEntity.js';
import { TokenCacheContext } from '../cache/persistence/TokenCacheContext.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Class that handles response parsing.
*/
var ResponseHandler = /** @class */ (function () {
function ResponseHandler(clientId, cacheStorage, cryptoObj, logger, serializableCache, persistencePlugin) {
this.clientId = clientId;
this.cacheStorage = cacheStorage;
this.cryptoObj = cryptoObj;
this.logger = logger;
this.serializableCache = serializableCache;
this.persistencePlugin = persistencePlugin;
}
/**
* Function which validates server authorization code response.
* @param serverResponseHash
* @param cachedState
* @param cryptoObj
*/
ResponseHandler.prototype.validateServerAuthorizationCodeResponse = function (serverResponseHash, cachedState, cryptoObj) {
if (!serverResponseHash.state || !cachedState) {
throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError("Server State") : ClientAuthError.createStateNotFoundError("Cached State");
}
if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {
throw ClientAuthError.createStateMismatchError();
}
// Check for error
if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {
if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {
throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);
}
throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);
}
if (serverResponseHash.client_info) {
buildClientInfo(serverResponseHash.client_info, cryptoObj);
}
};
/**
* Function which validates server authorization token response.
* @param serverResponse
*/
ResponseHandler.prototype.validateTokenResponse = function (serverResponse) {
// Check for error
if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {
if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror);
}
var errString = serverResponse.error_codes + " - [" + serverResponse.timestamp + "]: " + serverResponse.error_description + " - Correlation ID: " + serverResponse.correlation_id + " - Trace ID: " + serverResponse.trace_id;
throw new ServerError(serverResponse.error, errString, serverResponse.suberror);
}
};
/**
* Returns a constructed token response based on given string. Also manages the cache updates and cleanups.
* @param serverTokenResponse
* @param authority
*/
ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {
return __awaiter(this, void 0, void 0, function () {
var idTokenObj, authTime, requestStateObj, cacheRecord, cacheContext, key, account;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (serverTokenResponse.id_token) {
idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);
// token nonce check (TODO: Add a warning if no nonce is given?)
if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {
if (idTokenObj.claims.nonce !== authCodePayload.nonce) {
throw ClientAuthError.createNonceMismatchError();
}
}
// token max_age check
if (request.maxAge || (request.maxAge === 0)) {
authTime = idTokenObj.claims.auth_time;
if (!authTime) {
throw ClientAuthError.createAuthTimeNotFoundError();
}
AuthToken.checkMaxAge(authTime, request.maxAge);
}
}
// generate homeAccountId
this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);
if (!!authCodePayload && !!authCodePayload.state) {
requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);
}
// Add keyId from request to serverTokenResponse if defined
serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);
_a.label = 1;
case 1:
_a.trys.push([1, , 5, 8]);
if (!(this.persistencePlugin && this.serializableCache)) return [3 /*break*/, 3];
this.logger.verbose("Persistence enabled, calling beforeCacheAccess");
cacheContext = new TokenCacheContext(this.serializableCache, true);
return [4 /*yield*/, this.persistencePlugin.beforeCacheAccess(cacheContext)];
case 2:
_a.sent();
_a.label = 3;
case 3:
/*
* When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.
* If not present, we should return null, as it's the case that another application called removeAccount in between
* the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal, unless explicitly flagged by
* the developer, as in the case of refresh token flow used in ADAL Node to MSAL Node migration.
*/
if (handlingRefreshTokenResponse && !forceCacheRefreshTokenResponse && cacheRecord.account) {
key = cacheRecord.account.generateAccountKey();
account = this.cacheStorage.getAccount(key);
if (!account) {
this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
return [2 /*return*/, ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, undefined, serverRequestId)];
}
}
return [4 /*yield*/, this.cacheStorage.saveCacheRecord(cacheRecord)];
case 4:
_a.sent();
return [3 /*break*/, 8];
case 5:
if (!(this.persistencePlugin && this.serializableCache && cacheContext)) return [3 /*break*/, 7];
this.logger.verbose("Persistence enabled, calling afterCacheAccess");
return [4 /*yield*/, this.persistencePlugin.afterCacheAccess(cacheContext)];
case 6:
_a.sent();
_a.label = 7;
case 7: return [7 /*endfinally*/];
case 8: return [2 /*return*/, ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse.spa_code, serverRequestId)];
}
});
});
};
/**
* Generates CacheRecord
* @param serverTokenResponse
* @param idTokenObj
* @param authority
*/
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload) {
var env = authority.getPreferredCache();
if (StringUtils.isEmpty(env)) {
throw ClientAuthError.createInvalidCacheEnvironmentError();
}
// IdToken: non AAD scenarios can have empty realm
var cachedIdToken;
var cachedAccount;
if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {
cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, authCodePayload);
}
// AccessToken
var cachedAccessToken = null;
if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {
// If scopes not returned in server response, use request scopes
var responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);
/*
* Use timestamp calculated before request
* Server may return timestamps as strings, parse to numbers if so.
*/
var expiresIn = (typeof serverTokenResponse.expires_in === "string" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;
var extExpiresIn = (typeof serverTokenResponse.ext_expires_in === "string" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;
var refreshIn = (typeof serverTokenResponse.refresh_in === "string" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;
var tokenExpirationSeconds = reqTimestamp + expiresIn;
var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;
var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;
// non AAD scenarios can have empty realm
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
}
// refreshToken
var cachedRefreshToken = null;
if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {
cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, userAssertionHash);
}
// appMetadata
var cachedAppMetadata = null;
if (!StringUtils.isEmpty(serverTokenResponse.foci)) {
cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);
}
return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);
};
/**
* Generate Account
* @param serverTokenResponse
* @param idToken
* @param authority
*/
ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, authCodePayload) {
var authorityType = authority.authorityType;
var cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;
var msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;
// ADFS does not require client_info in the response
if (authorityType === AuthorityType.Adfs) {
this.logger.verbose("Authority type is ADFS, creating ADFS account");
return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
}
// This fallback applies to B2C as well as they fall under an AAD account type.
if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === "AAD") {
throw ClientAuthError.createClientInfoEmptyError();
}
return serverTokenResponse.client_info ?
AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :
AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
};
/**
* Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
*
* Optionally takes a state string that is set as-is in the response.
*
* @param cacheRecord
* @param idTokenObj
* @param fromTokenCache
* @param stateString
*/
ResponseHandler.generateAuthenticationResult = function (cryptoObj, authority, cacheRecord, fromTokenCache, request, idTokenObj, requestState, code, requestId) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function () {
var accessToken, responseScopes, expiresOn, extExpiresOn, familyId, popTokenGenerator, _d, secret, keyId, uid, tid;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
accessToken = Constants.EMPTY_STRING;
responseScopes = [];
expiresOn = null;
familyId = Constants.EMPTY_STRING;
if (!cacheRecord.accessToken) return [3 /*break*/, 4];
if (!(cacheRecord.accessToken.tokenType === AuthenticationScheme.POP)) return [3 /*break*/, 2];
popTokenGenerator = new PopTokenGenerator(cryptoObj);
_d = cacheRecord.accessToken, secret = _d.secret, keyId = _d.keyId;
if (!keyId) {
throw ClientAuthError.createKeyIdMissingError();
}
return [4 /*yield*/, popTokenGenerator.signPopToken(secret, keyId, request)];
case 1:
accessToken = _e.sent();
return [3 /*break*/, 3];
case 2:
accessToken = cacheRecord.accessToken.secret;
_e.label = 3;
case 3:
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
_e.label = 4;
case 4:
if (cacheRecord.appMetadata) {
familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;
}
uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;
tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;
return [2 /*return*/, {
authority: authority.canonicalAuthority,
uniqueId: uid,
tenantId: tid,
scopes: responseScopes,
account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,
idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
idTokenClaims: idTokenObj ? idTokenObj.claims : {},
accessToken: accessToken,
fromCache: fromTokenCache,
expiresOn: expiresOn,
correlationId: request.correlationId,
requestId: requestId || Constants.EMPTY_STRING,
extExpiresOn: extExpiresOn,
familyId: familyId,
tokenType: ((_a = cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,
cloudGraphHostName: ((_b = cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,
msGraphHost: ((_c = cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,
code: code,
fromNativeBroker: false
}];
}
});
});
};
return ResponseHandler;
}());
export { ResponseHandler };
//# sourceMappingURL=ResponseHandler.js.map
{"version":3,"file":"ResponseHandler.js","sources":["../../src/response/ResponseHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerAuthorizationTokenResponse } from \"./ServerAuthorizationTokenResponse\";\nimport { buildClientInfo} from \"../account/ClientInfo\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerAuthorizationCodeResponse } from \"./ServerAuthorizationCodeResponse\";\nimport { Logger } from \"../logger/Logger\";\nimport { ServerError } from \"../error/ServerError\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AuthenticationResult } from \"./AuthenticationResult\";\nimport { AccountEntity } from \"../cache/entities/AccountEntity\";\nimport { Authority } from \"../authority/Authority\";\nimport { AuthorityType } from \"../authority/AuthorityType\";\nimport { IdTokenEntity } from \"../cache/entities/IdTokenEntity\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { RefreshTokenEntity } from \"../cache/entities/RefreshTokenEntity\";\nimport { InteractionRequiredAuthError } from \"../error/InteractionRequiredAuthError\";\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { ProtocolUtils, RequestStateObject } from \"../utils/ProtocolUtils\";\nimport { AuthenticationScheme, Constants, THE_FAMILY_ID } from \"../utils/Constants\";\nimport { PopTokenGenerator } from \"../crypto/PopTokenGenerator\";\nimport { AppMetadataEntity } from \"../cache/entities/AppMetadataEntity\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { TokenCacheContext } from \"../cache/persistence/TokenCacheContext\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { AuthorizationCodePayload } from \"./AuthorizationCodePayload\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Class that handles response parsing.\n */\nexport class ResponseHandler {\n private clientId: string;\n private cacheStorage: CacheManager;\n private cryptoObj: ICrypto;\n private logger: Logger;\n private homeAccountIdentifier: string;\n private serializableCache: ISerializableTokenCache | null;\n private persistencePlugin: ICachePlugin | null;\n\n constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null) {\n this.clientId = clientId;\n this.cacheStorage = cacheStorage;\n this.cryptoObj = cryptoObj;\n this.logger = logger;\n this.serializableCache = serializableCache;\n this.persistencePlugin = persistencePlugin;\n }\n\n /**\n * Function which validates server authorization code response.\n * @param serverResponseHash\n * @param cachedState\n * @param cryptoObj\n */\n validateServerAuthorizationCodeResponse(serverResponseHash: ServerAuthorizationCodeResponse, cachedState: string, cryptoObj: ICrypto): void {\n\n if (!serverResponseHash.state || !cachedState) {\n throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError(\"Server State\") : ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {\n throw ClientAuthError.createStateMismatchError();\n }\n\n // Check for error\n if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {\n throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n if (serverResponseHash.client_info) {\n buildClientInfo(serverResponseHash.client_info, cryptoObj);\n }\n }\n\n /**\n * Function which validates server authorization token response.\n * @param serverResponse\n */\n validateTokenResponse(serverResponse: ServerAuthorizationTokenResponse): void {\n // Check for error\n if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\n throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror);\n }\n\n const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;\n throw new ServerError(serverResponse.error, errString, serverResponse.suberror);\n }\n }\n\n /**\n * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.\n * @param serverTokenResponse\n * @param authority\n */\n async handleServerTokenResponse(\n serverTokenResponse: ServerAuthorizationTokenResponse,\n authority: Authority,\n reqTimestamp: number,\n request: BaseAuthRequest,\n authCodePayload?: AuthorizationCodePayload,\n userAssertionHash?: string,\n handlingRefreshTokenResponse?: boolean,\n forceCacheRefreshTokenResponse?: boolean,\n serverRequestId?: string): Promise<AuthenticationResult> {\n\n // create an idToken object (not entity)\n let idTokenObj: AuthToken | undefined;\n if (serverTokenResponse.id_token) {\n idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);\n\n // token nonce check (TODO: Add a warning if no nonce is given?)\n if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {\n if (idTokenObj.claims.nonce !== authCodePayload.nonce) {\n throw ClientAuthError.createNonceMismatchError();\n }\n }\n\n // token max_age check\n if (request.maxAge || (request.maxAge === 0)) {\n const authTime = idTokenObj.claims.auth_time;\n if (!authTime) {\n throw ClientAuthError.createAuthTimeNotFoundError();\n }\n\n AuthToken.checkMaxAge(authTime, request.maxAge);\n }\n }\n\n // generate homeAccountId\n this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);\n\n // save the response tokens\n let requestStateObj: RequestStateObject | undefined;\n if (!!authCodePayload && !!authCodePayload.state) {\n requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);\n }\n\n // Add keyId from request to serverTokenResponse if defined\n serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;\n\n const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);\n let cacheContext;\n try {\n if (this.persistencePlugin && this.serializableCache) {\n this.logger.verbose(\"Persistence enabled, calling beforeCacheAccess\");\n cacheContext = new TokenCacheContext(this.serializableCache, true);\n await this.persistencePlugin.beforeCacheAccess(cacheContext);\n }\n /*\n * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.\n * If not present, we should return null, as it's the case that another application called removeAccount in between\n * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal, unless explicitly flagged by\n * the developer, as in the case of refresh token flow used in ADAL Node to MSAL Node migration.\n */\n if (handlingRefreshTokenResponse && !forceCacheRefreshTokenResponse && cacheRecord.account) {\n const key = cacheRecord.account.generateAccountKey();\n const account = this.cacheStorage.getAccount(key);\n if (!account) {\n this.logger.warning(\"Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache\");\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, undefined, serverRequestId);\n }\n }\n await this.cacheStorage.saveCacheRecord(cacheRecord);\n } finally {\n if (this.persistencePlugin && this.serializableCache && cacheContext) {\n this.logger.verbose(\"Persistence enabled, calling afterCacheAccess\");\n await this.persistencePlugin.afterCacheAccess(cacheContext);\n }\n }\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse.spa_code, serverRequestId);\n }\n\n /**\n * Generates CacheRecord\n * @param serverTokenResponse\n * @param idTokenObj\n * @param authority\n */\n private generateCacheRecord(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, idTokenObj?: AuthToken, userAssertionHash?: string, authCodePayload?: AuthorizationCodePayload): CacheRecord {\n const env = authority.getPreferredCache();\n if (StringUtils.isEmpty(env)) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n // IdToken: non AAD scenarios can have empty realm\n let cachedIdToken: IdTokenEntity | undefined;\n let cachedAccount: AccountEntity | undefined;\n if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {\n cachedIdToken = IdTokenEntity.createIdTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.id_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj.claims.tid || Constants.EMPTY_STRING,\n );\n\n cachedAccount = this.generateAccountEntity(\n serverTokenResponse,\n idTokenObj,\n authority,\n authCodePayload\n );\n }\n\n // AccessToken\n let cachedAccessToken: AccessTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {\n\n // If scopes not returned in server response, use request scopes\n const responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);\n\n /*\n * Use timestamp calculated before request\n * Server may return timestamps as strings, parse to numbers if so.\n */\n const expiresIn: number = (typeof serverTokenResponse.expires_in === \"string\" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;\n const extExpiresIn: number = (typeof serverTokenResponse.ext_expires_in === \"string\" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;\n const refreshIn: number | undefined = (typeof serverTokenResponse.refresh_in === \"string\" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\n const extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;\n const refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;\n\n // non AAD scenarios can have empty realm\n cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.access_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant,\n responseScopes.printScopes(),\n tokenExpirationSeconds,\n extendedTokenExpirationSeconds,\n this.cryptoObj,\n refreshOnSeconds,\n serverTokenResponse.token_type,\n userAssertionHash,\n serverTokenResponse.key_id,\n request.claims,\n request.requestedClaimsHash\n );\n }\n\n // refreshToken\n let cachedRefreshToken: RefreshTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {\n cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.refresh_token || Constants.EMPTY_STRING,\n this.clientId,\n serverTokenResponse.foci,\n userAssertionHash\n );\n }\n\n // appMetadata\n let cachedAppMetadata: AppMetadataEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.foci)) {\n cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);\n }\n\n return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);\n }\n\n /**\n * Generate Account\n * @param serverTokenResponse\n * @param idToken\n * @param authority\n */\n private generateAccountEntity(serverTokenResponse: ServerAuthorizationTokenResponse, idToken: AuthToken, authority: Authority, authCodePayload?: AuthorizationCodePayload): AccountEntity {\n const authorityType = authority.authorityType;\n const cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;\n const msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;\n\n // ADFS does not require client_info in the response\n if (authorityType === AuthorityType.Adfs) {\n this.logger.verbose(\"Authority type is ADFS, creating ADFS account\");\n return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\n }\n\n // This fallback applies to B2C as well as they fall under an AAD account type.\n if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === \"AAD\") {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n return serverTokenResponse.client_info ?\n AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :\n AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\n }\n\n /**\n * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.\n *\n * Optionally takes a state string that is set as-is in the response.\n *\n * @param cacheRecord\n * @param idTokenObj\n * @param fromTokenCache\n * @param stateString\n */\n static async generateAuthenticationResult(\n cryptoObj: ICrypto,\n authority: Authority,\n cacheRecord: CacheRecord,\n fromTokenCache: boolean,\n request: BaseAuthRequest,\n idTokenObj?: AuthToken,\n requestState?: RequestStateObject,\n code?: string,\n requestId?: string\n ): Promise<AuthenticationResult> {\n let accessToken: string = Constants.EMPTY_STRING;\n let responseScopes: Array<string> = [];\n let expiresOn: Date | null = null;\n let extExpiresOn: Date | undefined;\n let familyId: string = Constants.EMPTY_STRING;\n\n if (cacheRecord.accessToken) {\n if (cacheRecord.accessToken.tokenType === AuthenticationScheme.POP) {\n const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(cryptoObj);\n const { secret, keyId } = cacheRecord.accessToken;\n\n if (!keyId) {\n throw ClientAuthError.createKeyIdMissingError();\n }\n\n accessToken = await popTokenGenerator.signPopToken(secret, keyId, request);\n } else {\n accessToken = cacheRecord.accessToken.secret;\n }\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\n }\n\n if (cacheRecord.appMetadata) {\n familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;\n }\n const uid = idTokenObj?.claims.oid || idTokenObj?.claims.sub || Constants.EMPTY_STRING;\n const tid = idTokenObj?.claims.tid || Constants.EMPTY_STRING;\n\n return {\n authority: authority.canonicalAuthority,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes,\n account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\n accessToken: accessToken,\n fromCache: fromTokenCache,\n expiresOn: expiresOn,\n correlationId: request.correlationId,\n requestId: requestId || Constants.EMPTY_STRING,\n extExpiresOn: extExpiresOn,\n familyId: familyId,\n tokenType: cacheRecord.accessToken?.tokenType || Constants.EMPTY_STRING,\n state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,\n cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || Constants.EMPTY_STRING,\n msGraphHost: cacheRecord.account?.msGraphHost || Constants.EMPTY_STRING,\n code,\n fromNativeBroker: false\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;AAGG;AAgCH;;AAEG;AACH,IAAA,eAAA,kBAAA,YAAA;IASI,SAAY,eAAA,CAAA,QAAgB,EAAE,YAA0B,EAAE,SAAkB,EAAE,MAAc,EAAE,iBAAiD,EAAE,iBAAsC,EAAA;AACnL,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACzB,QAAA,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;AACjC,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;AAC3B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;KAC9C;AAED;;;;;AAKG;AACH,IAAA,eAAA,CAAA,SAAA,CAAA,uCAAuC,GAAvC,UAAwC,kBAAmD,EAAE,WAAmB,EAAE,SAAkB,EAAA;AAEhI,QAAA,IAAI,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,WAAW,EAAE;YAC3C,MAAM,CAAC,kBAAkB,CAAC,KAAK,GAAG,eAAe,C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AK;6BAC1B,CAAC,CAAA;;;;AACL,KAAA,CAAA;IACL,OAAC,eAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
\ No newline at end of file
{"version":3,"file":"ServerAuthorizationCodeResponse.d.ts","sourceRoot":"","sources":["../../src/response/ServerAuthorizationCodeResponse.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,oBAAY,+BAA+B,GAAG;IAE1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
\ No newline at end of file
{"version":3,"file":"ServerAuthorizationTokenResponse.d.ts","sourceRoot":"","sources":["../../src/response/ServerAuthorizationTokenResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,oBAAY,gCAAgC,GAAG;IAE3C,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
\ No newline at end of file
{"version":3,"file":"IPerformanceClient.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/IPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,oBAAY,2BAA2B,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;AAE/E,oBAAY,0BAA0B,GAAG;IACrC,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,gBAAgB,GAAG,IAAI,CAAA;IAC9E,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,eAAe,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACtD,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,EAAE,uBAAuB,CAAA;CACvC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAC/B,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,0BAA0B,CAAC;IACrG,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACjE,iBAAiB,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChF,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,eAAe,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACzE,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IACvD,sBAAsB,CAAC,QAAQ,EAAE,2BAA2B,GAAG,MAAM,CAAC;IACtE,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACpE,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAClG,UAAU,IAAI,MAAM,CAAC;CACxB"}
\ No newline at end of file
{"version":3,"file":"IPerformanceMeasurement.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/IPerformanceMeasurement.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IACpC,gBAAgB,IAAI,IAAI,CAAC;IACzB,cAAc,IAAI,IAAI,CAAC;IACvB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAAC;CACrC"}
\ No newline at end of file
{"version":3,"file":"PerformanceClient.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/PerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA0B,YAAY,EAAE,MAAM,oBAAoB,CAAC;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eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAAI,IAAI;IAWnE;;;;;;;;OAQG;IACH,OAAO,CAAC,yBAAyB;IAWjC;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;;OAKG;IACH,iBAAiB,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IA8E9E;;;;OAIG;IACH,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAKhD;;;;;OAKG;IACH,sBAAsB,CAAC,QAAQ,EAAE,2BAA2B,GAAG,MAAM;IAQrE;;;;;OAKG;IACH,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAYtD;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;CAStE"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __assign } from '../../_virtual/_tslib.js';
import { PerformanceEventStatus } from './PerformanceEvent.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var PerformanceClient = /** @class */ (function () {
/**
* Creates an instance of PerformanceClient,
* an abstract class containing core performance telemetry logic.
*
* @constructor
* @param {string} clientId Client ID of the application
* @param {string} authority Authority used by the application
* @param {Logger} logger Logger used by the application
* @param {string} libraryName Name of the library
* @param {string} libraryVersion Version of the library
*/
function PerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
this.authority = authority;
this.libraryName = libraryName;
this.libraryVersion = libraryVersion;
this.applicationTelemetry = applicationTelemetry;
this.clientId = clientId;
this.logger = logger;
this.callbacks = new Map();
this.eventsByCorrelationId = new Map();
this.staticFieldsByCorrelationId = new Map();
this.measurementsById = new Map();
}
/**
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
*
* @param {PerformanceEvents} measureName
* @param {?string} [correlationId]
* @returns {InProgressPerformanceEvent}
*/
PerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {
var _this = this;
var _a, _b;
// Generate a placeholder correlation if the request does not provide one
var eventCorrelationId = correlationId || this.generateId();
if (!correlationId) {
this.logger.info("PerformanceClient: No correlation id provided for " + measureName + ", generating", eventCorrelationId);
}
this.logger.trace("PerformanceClient: Performance measurement started for " + measureName, eventCorrelationId);
var performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);
performanceMeasurement.startMeasurement();
var inProgressEvent = {
eventId: this.generateId(),
status: PerformanceEventStatus.InProgress,
authority: this.authority,
libraryName: this.libraryName,
libraryVersion: this.libraryVersion,
clientId: this.clientId,
name: measureName,
startTimeMs: Date.now(),
correlationId: eventCorrelationId,
};
// Store in progress events so they can be discarded if not ended properly
this.cacheEventByCorrelationId(inProgressEvent);
var staticFields = {
appName: (_a = this.applicationTelemetry) === null || _a === void 0 ? void 0 : _a.appName,
appVersion: (_b = this.applicationTelemetry) === null || _b === void 0 ? void 0 : _b.appVersion,
};
this.addStaticFields(staticFields, eventCorrelationId);
this.cacheMeasurement(inProgressEvent, performanceMeasurement);
// Return the event and functions the caller can use to properly end/flush the measurement
return {
endMeasurement: function (event) {
var completedEvent = _this.endMeasurement(__assign(__assign({}, inProgressEvent), event));
if (completedEvent) {
// Cache event so that submeasurements can be added downstream
_this.cacheEventByCorrelationId(completedEvent);
}
return completedEvent;
},
flushMeasurement: function () {
return _this.flushMeasurements(inProgressEvent.name, inProgressEvent.correlationId);
},
discardMeasurement: function () {
return _this.discardMeasurements(inProgressEvent.correlationId);
},
addStaticFields: function (fields) {
return _this.addStaticFields(fields, inProgressEvent.correlationId);
},
measurement: performanceMeasurement,
event: inProgressEvent
};
};
/**
* Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,
* as consumers should instead use the function returned by startMeasurement.
*
* @param {PerformanceEvent} event
* @returns {(PerformanceEvent | null)}
*/
PerformanceClient.prototype.endMeasurement = function (event) {
var performanceMeasurement = this.measurementsById.get(event.eventId);
if (performanceMeasurement) {
// Immediately delete so that the same event isnt ended twice
this.measurementsById.delete(event.eventId);
performanceMeasurement.endMeasurement();
var durationMs = performanceMeasurement.flushMeasurement();
// null indicates no measurement was taken (e.g. needed performance APIs not present)
if (durationMs !== null) {
this.logger.trace("PerformanceClient: Performance measurement ended for " + event.name + ": " + durationMs + " ms", event.correlationId);
var completedEvent = __assign(__assign({
// Allow duration to be overwritten when event ends (e.g. testing), but not status
durationMs: Math.round(durationMs) }, event), { status: PerformanceEventStatus.Completed });
return completedEvent;
}
else {
this.logger.trace("PerformanceClient: Performance measurement not taken", event.correlationId);
}
}
else {
this.logger.trace("PerformanceClient: Measurement not found for " + event.eventId, event.correlationId);
}
return null;
};
/**
* Saves extra information to be emitted when the measurements are flushed
* @param fields
* @param correlationId
*/
PerformanceClient.prototype.addStaticFields = function (fields, correlationId) {
var existingStaticFields = this.staticFieldsByCorrelationId.get(correlationId);
if (existingStaticFields) {
this.logger.trace("PerformanceClient: Updating static fields");
this.staticFieldsByCorrelationId.set(correlationId, __assign(__assign({}, existingStaticFields), fields));
}
else {
this.logger.trace("PerformanceClient: Adding static fields");
this.staticFieldsByCorrelationId.set(correlationId, fields);
}
};
/**
* Upserts event into event cache.
* First key is the correlation id, second key is the event id.
* Allows for events to be grouped by correlation id,
* and to easily allow for properties on them to be updated.
*
* @private
* @param {PerformanceEvent} event
*/
PerformanceClient.prototype.cacheEventByCorrelationId = function (event) {
var existingEvents = this.eventsByCorrelationId.get(event.correlationId);
if (existingEvents) {
this.logger.trace("PerformanceClient: Performance measurement for " + event.name + " added/updated", event.correlationId);
existingEvents.set(event.eventId, event);
}
else {
this.logger.trace("PerformanceClient: Performance measurement for " + event.name + " started", event.correlationId);
this.eventsByCorrelationId.set(event.correlationId, new Map().set(event.eventId, event));
}
};
/**
* Cache measurements by their id.
*
* @private
* @param {PerformanceEvent} event
* @param {IPerformanceMeasurement} measurement
*/
PerformanceClient.prototype.cacheMeasurement = function (event, measurement) {
this.measurementsById.set(event.eventId, measurement);
};
/**
* Gathers and emits performance events for measurements taked for the given top-level API and correlation ID.
*
* @param {PerformanceEvents} measureName
* @param {string} correlationId
*/
PerformanceClient.prototype.flushMeasurements = function (measureName, correlationId) {
var _this = this;
this.logger.trace("PerformanceClient: Performance measurements flushed for " + measureName, correlationId);
var eventsForCorrelationId = this.eventsByCorrelationId.get(correlationId);
if (eventsForCorrelationId) {
this.discardMeasurements(correlationId);
/*
* Manually end incomplete submeasurements to ensure there arent orphaned/never ending events.
* Incomplete submeasurements are likely an instrumentation bug that should be fixed.
* IE only supports Map.forEach.
*/
var completedEvents_1 = [];
eventsForCorrelationId.forEach(function (event) {
if (event.name !== measureName && event.status !== PerformanceEventStatus.Completed) {
_this.logger.trace("PerformanceClient: Incomplete submeasurement " + event.name + " found for " + measureName, correlationId);
var completedEvent = _this.endMeasurement(event);
if (completedEvent) {
completedEvents_1.push(completedEvent);
}
}
completedEvents_1.push(event);
});
// Sort events by start time (earliest first)
var sortedCompletedEvents = completedEvents_1.sort(function (eventA, eventB) { return eventA.startTimeMs - eventB.startTimeMs; });
// Take completed top level event and add completed submeasurements durations as properties
var topLevelEvents = sortedCompletedEvents.filter(function (event) { return event.name === measureName && event.status === PerformanceEventStatus.Completed; });
if (topLevelEvents.length > 0) {
/*
* Only take the first top-level event if there are multiple events with the same correlation id.
* This greatly simplifies logic for submeasurements.
*/
if (topLevelEvents.length > 1) {
this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first", correlationId);
}
var topLevelEvent = topLevelEvents[0];
this.logger.verbose("PerformanceClient: Measurement found for " + measureName, correlationId);
// Build event object with top level and sub measurements
var eventToEmit = sortedCompletedEvents.reduce(function (previous, current) {
if (current.name !== measureName) {
_this.logger.trace("PerformanceClient: Complete submeasurement found for " + current.name, correlationId);
// TODO: Emit additional properties for each subMeasurement
var subMeasurementName = current.name + "DurationMs";
/*
* Some code paths, such as resolving an authority, can occur multiple times.
* Only take the first measurement, since the second could be read from the cache,
* or due to the same correlation id being used for two distinct requests.
*/
if (!previous[subMeasurementName]) {
previous[subMeasurementName] = current.durationMs;
}
else {
_this.logger.verbose("PerformanceClient: Submeasurement for " + measureName + " already exists for " + current.name + ", ignoring", correlationId);
}
}
return previous;
}, topLevelEvent);
var staticFields = this.staticFieldsByCorrelationId.get(correlationId);
var finalEvent = __assign(__assign({}, eventToEmit), staticFields);
this.emitEvents([finalEvent], eventToEmit.correlationId);
}
else {
this.logger.verbose("PerformanceClient: No completed top-level measurements found for " + measureName, correlationId);
}
}
else {
this.logger.verbose("PerformanceClient: No measurements found", correlationId);
}
};
/**
* Removes measurements for a given correlation id.
*
* @param {string} correlationId
*/
PerformanceClient.prototype.discardMeasurements = function (correlationId) {
this.logger.trace("PerformanceClient: Performance measurements discarded", correlationId);
this.eventsByCorrelationId.delete(correlationId);
};
/**
* Registers a callback function to receive performance events.
*
* @param {PerformanceCallbackFunction} callback
* @returns {string}
*/
PerformanceClient.prototype.addPerformanceCallback = function (callback) {
var callbackId = this.generateId();
this.callbacks.set(callbackId, callback);
this.logger.verbose("PerformanceClient: Performance callback registered with id: " + callbackId);
return callbackId;
};
/**
* Removes a callback registered with addPerformanceCallback.
*
* @param {string} callbackId
* @returns {boolean}
*/
PerformanceClient.prototype.removePerformanceCallback = function (callbackId) {
var result = this.callbacks.delete(callbackId);
if (result) {
this.logger.verbose("PerformanceClient: Performance callback " + callbackId + " removed.");
}
else {
this.logger.verbose("PerformanceClient: Performance callback " + callbackId + " not removed.");
}
return result;
};
/**
* Emits events to all registered callbacks.
*
* @param {PerformanceEvent[]} events
* @param {?string} [correlationId]
*/
PerformanceClient.prototype.emitEvents = function (events, correlationId) {
var _this = this;
this.logger.verbose("PerformanceClient: Emitting performance events", correlationId);
this.callbacks.forEach(function (callback, callbackId) {
_this.logger.trace("PerformanceClient: Emitting event to callback " + callbackId, correlationId);
callback.apply(null, [events]);
});
};
return PerformanceClient;
}());
export { PerformanceClient };
//# sourceMappingURL=PerformanceClient.js.map
{"version":3,"file":"PerformanceClient.js","sources":["../../../src/telemetry/performance/PerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ApplicationTelemetry } from \"../../config/ClientConfiguration\";\nimport { Logger } from \"../../logger/Logger\";\nimport { InProgressPerformanceEvent, IPerformanceClient, PerformanceCallbackFunction } from \"./IPerformanceClient\";\nimport { IPerformanceMeasurement } from \"./IPerformanceMeasurement\";\nimport { PerformanceEvent, PerformanceEvents, PerformanceEventStatus, StaticFields } from \"./PerformanceEvent\";\n\nexport abstract class PerformanceClient implements IPerformanceClient {\n protected authority: string;\n protected libraryName: string;\n protected libraryVersion: string;\n protected applicationTelemetry: ApplicationTelemetry;\n protected clientId: string;\n protected logger: Logger;\n protected callbacks: Map<string, PerformanceCallbackFunction>;\n\n /**\n * Multiple events with the same correlation id.\n * Double keyed by correlation id and event id.\n * @protected\n * @type {Map<string, Map<string, PerformanceEvent>>}\n */\n protected eventsByCorrelationId: Map<string, Map<string, PerformanceEvent>>;\n\n /**\n * Fields to be emitted which are scoped to the top level request and whose value will not change in submeasurements\n * For example: App name, version, etc.\n */\n protected staticFieldsByCorrelationId: Map<string, StaticFields>;\n\n /**\n * Underlying performance measurements for each operation\n *\n * @protected\n * @type {Map<string, IPerformanceMeasurement>}\n */\n protected measurementsById: Map<string, IPerformanceMeasurement>;\n\n /**\n * Creates an instance of PerformanceClient, \n * an abstract class containing core performance telemetry logic.\n *\n * @constructor\n * @param {string} clientId Client ID of the application\n * @param {string} authority Authority used by the application\n * @param {Logger} logger Logger used by the application\n * @param {string} libraryName Name of the library\n * @param {string} libraryVersion Version of the library\n */\n constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry) {\n this.authority = authority;\n this.libraryName = libraryName;\n this.libraryVersion = libraryVersion;\n this.applicationTelemetry = applicationTelemetry;\n this.clientId = clientId;\n this.logger = logger;\n this.callbacks = new Map();\n this.eventsByCorrelationId = new Map();\n this.staticFieldsByCorrelationId = new Map();\n this.measurementsById = new Map();\n }\n\n /**\n * Starts and returns an platform-specific implementation of IPerformanceMeasurement.\n *\n * @abstract\n * @param {string} measureName\n * @param {string} correlationId\n * @returns {IPerformanceMeasurement}\n */\n abstract startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;\n\n /**\n * Generates and returns a unique id, typically a guid.\n *\n * @abstract\n * @returns {string}\n */\n abstract generateId(): string;\n\n /**\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\n *\n * @param {PerformanceEvents} measureName\n * @param {?string} [correlationId]\n * @returns {InProgressPerformanceEvent}\n */\n startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent {\n // Generate a placeholder correlation if the request does not provide one\n const eventCorrelationId = correlationId || this.generateId();\n if (!correlationId) {\n this.logger.info(`PerformanceClient: No correlation id provided for ${measureName}, generating`, eventCorrelationId);\n }\n\n this.logger.trace(`PerformanceClient: Performance measurement started for ${measureName}`, eventCorrelationId);\n const performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);\n performanceMeasurement.startMeasurement();\n\n const inProgressEvent: PerformanceEvent = {\n eventId: this.generateId(),\n status: PerformanceEventStatus.InProgress,\n authority: this.authority,\n libraryName: this.libraryName,\n libraryVersion: this.libraryVersion,\n clientId: this.clientId,\n name: measureName,\n startTimeMs: Date.now(),\n correlationId: eventCorrelationId,\n };\n\n // Store in progress events so they can be discarded if not ended properly\n this.cacheEventByCorrelationId(inProgressEvent);\n\n const staticFields: StaticFields = {\n appName: this.applicationTelemetry?.appName,\n appVersion: this.applicationTelemetry?.appVersion,\n };\n this.addStaticFields(staticFields, eventCorrelationId);\n this.cacheMeasurement(inProgressEvent, performanceMeasurement);\n\n // Return the event and functions the caller can use to properly end/flush the measurement\n return {\n endMeasurement: (event?: Partial<PerformanceEvent>): PerformanceEvent | null => {\n const completedEvent = this.endMeasurement({\n // Initial set of event properties\n ...inProgressEvent,\n // Properties set when event ends\n ...event\n });\n\n if (completedEvent) {\n // Cache event so that submeasurements can be added downstream\n this.cacheEventByCorrelationId(completedEvent);\n }\n\n return completedEvent;\n },\n flushMeasurement: () => {\n return this.flushMeasurements(inProgressEvent.name, inProgressEvent.correlationId);\n },\n discardMeasurement: () => {\n return this.discardMeasurements(inProgressEvent.correlationId);\n },\n addStaticFields: (fields: StaticFields) => {\n return this.addStaticFields(fields, inProgressEvent.correlationId);\n },\n measurement: performanceMeasurement,\n event: inProgressEvent\n };\n\n }\n\n /**\n * Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,\n * as consumers should instead use the function returned by startMeasurement.\n *\n * @param {PerformanceEvent} event\n * @returns {(PerformanceEvent | null)}\n */\n endMeasurement(event: PerformanceEvent): PerformanceEvent | null {\n const performanceMeasurement = this.measurementsById.get(event.eventId);\n if (performanceMeasurement) {\n // Immediately delete so that the same event isnt ended twice\n this.measurementsById.delete(event.eventId);\n performanceMeasurement.endMeasurement();\n const durationMs = performanceMeasurement.flushMeasurement();\n // null indicates no measurement was taken (e.g. needed performance APIs not present)\n if (durationMs !== null) {\n this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${durationMs} ms`, event.correlationId);\n\n const completedEvent: PerformanceEvent = {\n // Allow duration to be overwritten when event ends (e.g. testing), but not status\n durationMs: Math.round(durationMs),\n ...event,\n status: PerformanceEventStatus.Completed,\n };\n\n return completedEvent;\n } else {\n this.logger.trace(\"PerformanceClient: Performance measurement not taken\", event.correlationId);\n }\n } else {\n this.logger.trace(`PerformanceClient: Measurement not found for ${event.eventId}`, event.correlationId);\n }\n\n return null;\n }\n\n /**\n * Saves extra information to be emitted when the measurements are flushed\n * @param fields \n * @param correlationId \n */\n addStaticFields(fields: StaticFields, correlationId: string) : void{\n const existingStaticFields = this.staticFieldsByCorrelationId.get(correlationId);\n if (existingStaticFields) {\n this.logger.trace(\"PerformanceClient: Updating static fields\");\n this.staticFieldsByCorrelationId.set(correlationId, {...existingStaticFields, ...fields});\n } else {\n this.logger.trace(\"PerformanceClient: Adding static fields\");\n this.staticFieldsByCorrelationId.set(correlationId, fields);\n }\n }\n\n /**\n * Upserts event into event cache.\n * First key is the correlation id, second key is the event id.\n * Allows for events to be grouped by correlation id,\n * and to easily allow for properties on them to be updated.\n *\n * @private\n * @param {PerformanceEvent} event\n */\n private cacheEventByCorrelationId(event: PerformanceEvent) {\n const existingEvents = this.eventsByCorrelationId.get(event.correlationId);\n if (existingEvents) {\n this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} added/updated`, event.correlationId);\n existingEvents.set(event.eventId, event);\n } else {\n this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} started`, event.correlationId);\n this.eventsByCorrelationId.set(event.correlationId, new Map().set(event.eventId, event));\n }\n }\n\n /**\n * Cache measurements by their id.\n *\n * @private\n * @param {PerformanceEvent} event\n * @param {IPerformanceMeasurement} measurement\n */\n private cacheMeasurement(event: PerformanceEvent, measurement: IPerformanceMeasurement) {\n this.measurementsById.set(event.eventId, measurement);\n }\n\n /**\n * Gathers and emits performance events for measurements taked for the given top-level API and correlation ID.\n *\n * @param {PerformanceEvents} measureName\n * @param {string} correlationId\n */\n flushMeasurements(measureName: PerformanceEvents, correlationId: string): void {\n this.logger.trace(`PerformanceClient: Performance measurements flushed for ${measureName}`, correlationId);\n const eventsForCorrelationId = this.eventsByCorrelationId.get(correlationId);\n if (eventsForCorrelationId) {\n this.discardMeasurements(correlationId);\n\n /*\n * Manually end incomplete submeasurements to ensure there arent orphaned/never ending events.\n * Incomplete submeasurements are likely an instrumentation bug that should be fixed.\n * IE only supports Map.forEach.\n */\n const completedEvents: PerformanceEvent[] = [];\n eventsForCorrelationId.forEach(event => {\n if (event.name !== measureName && event.status !== PerformanceEventStatus.Completed) {\n this.logger.trace(`PerformanceClient: Incomplete submeasurement ${event.name} found for ${measureName}`, correlationId);\n\n const completedEvent = this.endMeasurement(event);\n if (completedEvent) {\n completedEvents.push(completedEvent);\n }\n }\n\n completedEvents.push(event);\n });\n\n // Sort events by start time (earliest first)\n const sortedCompletedEvents = completedEvents.sort((eventA, eventB) => eventA.startTimeMs - eventB.startTimeMs);\n\n // Take completed top level event and add completed submeasurements durations as properties\n const topLevelEvents = sortedCompletedEvents.filter(event => event.name === measureName && event.status === PerformanceEventStatus.Completed);\n if (topLevelEvents.length > 0) {\n /*\n * Only take the first top-level event if there are multiple events with the same correlation id.\n * This greatly simplifies logic for submeasurements.\n */\n if (topLevelEvents.length > 1) {\n this.logger.verbose(\"PerformanceClient: Multiple distinct top-level performance events found, using the first\", correlationId);\n }\n const topLevelEvent = topLevelEvents[0];\n\n this.logger.verbose(`PerformanceClient: Measurement found for ${measureName}`, correlationId);\n\n // Build event object with top level and sub measurements\n const eventToEmit = sortedCompletedEvents.reduce((previous, current) => {\n if (current.name !== measureName) {\n this.logger.trace(`PerformanceClient: Complete submeasurement found for ${current.name}`, correlationId);\n // TODO: Emit additional properties for each subMeasurement\n const subMeasurementName = `${current.name}DurationMs`;\n /*\n * Some code paths, such as resolving an authority, can occur multiple times.\n * Only take the first measurement, since the second could be read from the cache,\n * or due to the same correlation id being used for two distinct requests.\n */\n if (!previous[subMeasurementName]) {\n previous[subMeasurementName] = current.durationMs;\n } else {\n this.logger.verbose(`PerformanceClient: Submeasurement for ${measureName} already exists for ${current.name}, ignoring`, correlationId);\n }\n }\n\n return previous;\n }, topLevelEvent);\n\n const staticFields = this.staticFieldsByCorrelationId.get(correlationId);\n const finalEvent: PerformanceEvent = {\n ...eventToEmit,\n ...staticFields\n };\n\n this.emitEvents([finalEvent], eventToEmit.correlationId);\n } else {\n this.logger.verbose(`PerformanceClient: No completed top-level measurements found for ${measureName}`, correlationId);\n }\n } else {\n this.logger.verbose(\"PerformanceClient: No measurements found\", correlationId);\n }\n }\n\n /**\n * Removes measurements for a given correlation id.\n *\n * @param {string} correlationId\n */\n discardMeasurements(correlationId: string): void {\n this.logger.trace(\"PerformanceClient: Performance measurements discarded\", correlationId);\n this.eventsByCorrelationId.delete(correlationId);\n }\n\n /**\n * Registers a callback function to receive performance events.\n *\n * @param {PerformanceCallbackFunction} callback\n * @returns {string}\n */\n addPerformanceCallback(callback: PerformanceCallbackFunction): string {\n const callbackId = this.generateId();\n this.callbacks.set(callbackId, callback);\n this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${callbackId}`);\n\n return callbackId;\n }\n\n /**\n * Removes a callback registered with addPerformanceCallback.\n *\n * @param {string} callbackId\n * @returns {boolean}\n */\n removePerformanceCallback(callbackId: string): boolean {\n const result = this.callbacks.delete(callbackId);\n\n if (result) {\n this.logger.verbose(`PerformanceClient: Performance callback ${callbackId} removed.`);\n } else {\n this.logger.verbose(`PerformanceClient: Performance callback ${callbackId} not removed.`);\n }\n\n return result;\n }\n\n /**\n * Emits events to all registered callbacks.\n *\n * @param {PerformanceEvent[]} events\n * @param {?string} [correlationId]\n */\n emitEvents(events: PerformanceEvent[], correlationId: string): void {\n this.logger.verbose(\"PerformanceClient: Emitting performance events\", correlationId);\n\n this.callbacks.forEach((callback: PerformanceCallbackFunction, callbackId: string) => {\n this.logger.trace(`PerformanceClient: Emitting event to callback ${callbackId}`, correlationId);\n callback.apply(null, [events]);\n });\n }\n\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAQH,IAAA,iBAAA,kBAAA,YAAA;AA+BI;;;;;;;;;;AAUG;IACH,SAAY,iBAAA,CAAA,QAAgB,EAAE,SAAiB,EAAE,MAAc,EAAE,WAAmB,EAAE,cAAsB,EAAE,oBAA0C,EAAA;AACpJ,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;AAC3B,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;AACrC,QAAA,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;AACjD,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;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,CAAA,yBAAA,GAAzB,UAA0B,UAAkB,EAAA;QACxC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAEjD,QAAA,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0CAA2C,GAAA,UAAU,GAAW,WAAA,CAAC,CAAC;AACzF,SAAA;AAAM,aAAA;YACH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0CAA2C,GAAA,UAAU,GAAe,eAAA,CAAC,CAAC;AAC7F,SAAA;AAED,QAAA,OAAO,MAAM,CAAC;KACjB,CAAA;AAED;;;;;AAKG;AACH,IAAA,iBAAA,CAAA,SAAA,CAAA,UAAU,GAAV,UAAW,MAA0B,EAAE,aAAqB,EAAA;QAA5D,IAOC,KAAA,GAAA,IAAA,CAAA;QANG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gDAAgD,EAAE,aAAa,CAAC,CAAC;QAErF,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAC,QAAqC,EAAE,UAAkB,EAAA;YAC7E,KAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mDAAiD,UAAY,EAAE,aAAa,CAAC,CAAC;YAChG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACnC,SAAC,CAAC,CAAC;KACN,CAAA;IAEL,OAAC,iBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
\ No newline at end of file
{"version":3,"file":"PerformanceEvent.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/PerformanceEvent.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,oBAAY,iBAAiB;IAEzB;;;OAGG;IACH,kBAAkB,uBAAuB;IAEzC;;;OAGG;IACH,0BAA0B,+BAA+B;IAEzD;;;OAGG;IACH,kBAAkB,uBAAuB;IAEzC;;;OAGG;IACH,uBAAuB,4BAA4B;IAEnD;;;OAGG;IACH,i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,CAAC;IAEtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.
*
* @export
* @enum {number}
*/
var PerformanceEvents;
(function (PerformanceEvents) {
/**
* acquireTokenByCode API (msal-browser and msal-node).
* Used to acquire tokens by trading an authorization code against the token endpoint.
*/
PerformanceEvents["AcquireTokenByCode"] = "acquireTokenByCode";
/**
* acquireTokenByRefreshToken API (msal-browser and msal-node).
* Used to renew an access token using a refresh token against the token endpoint.
*/
PerformanceEvents["AcquireTokenByRefreshToken"] = "acquireTokenByRefreshToken";
/**
* acquireTokenSilent API (msal-browser and msal-node).
* Used to silently acquire a new access token (from the cache or the network).
*/
PerformanceEvents["AcquireTokenSilent"] = "acquireTokenSilent";
/**
* acquireTokenSilentAsync (msal-browser).
* Internal API for acquireTokenSilent.
*/
PerformanceEvents["AcquireTokenSilentAsync"] = "acquireTokenSilentAsync";
/**
* acquireTokenPopup (msal-browser).
* Used to acquire a new access token interactively through pop ups
*/
PerformanceEvents["AcquireTokenPopup"] = "acquireTokenPopup";
/**
* getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
* Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
*/
PerformanceEvents["CryptoOptsGetPublicKeyThumbprint"] = "cryptoOptsGetPublicKeyThumbprint";
/**
* signJwt API in CryptoOpts class (msal-browser).
* Used to signed a pop token.
*/
PerformanceEvents["CryptoOptsSignJwt"] = "cryptoOptsSignJwt";
/**
* acquireToken API in the SilentCacheClient class (msal-browser).
* Used to read access tokens from the cache.
*/
PerformanceEvents["SilentCacheClientAcquireToken"] = "silentCacheClientAcquireToken";
/**
* acquireToken API in the SilentIframeClient class (msal-browser).
* Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
*/
PerformanceEvents["SilentIframeClientAcquireToken"] = "silentIframeClientAcquireToken";
/**
* acquireToken API in SilentRereshClient (msal-browser).
* Used to acquire a new set of tokens from the token endpoint using a refresh token.
*/
PerformanceEvents["SilentRefreshClientAcquireToken"] = "silentRefreshClientAcquireToken";
/**
* ssoSilent API (msal-browser).
* Used to silently acquire an authorization code and set of tokens using a hidden iframe.
*/
PerformanceEvents["SsoSilent"] = "ssoSilent";
/**
* getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
* Used to load authority metadata for a request.
*/
PerformanceEvents["StandardInteractionClientGetDiscoveredAuthority"] = "standardInteractionClientGetDiscoveredAuthority";
/**
* acquireToken APIs in msal-browser.
* Used to make an /authorize endpoint call with native brokering enabled.
*/
PerformanceEvents["FetchAccountIdWithNativeBroker"] = "fetchAccountIdWithNativeBroker";
/**
* acquireToken API in NativeInteractionClient class (msal-browser).
* Used to acquire a token from Native component when native brokering is enabled.
*/
PerformanceEvents["NativeInteractionClientAcquireToken"] = "nativeInteractionClientAcquireToken";
/**
* Time spent creating default headers for requests to token endpoint
*/
PerformanceEvents["BaseClientCreateTokenRequestHeaders"] = "baseClientCreateTokenRequestHeaders";
/**
* Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
*/
PerformanceEvents["BrokerHandhshake"] = "brokerHandshake";
/**
* acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
*/
PerformanceEvents["AcquireTokenByRefreshTokenInBroker"] = "acquireTokenByRefreshTokenInBroker";
/**
* Time taken for token acquisition by broker
*/
PerformanceEvents["AcquireTokenByBroker"] = "acquireTokenByBroker";
/**
* Time spent on the network for refresh token acquisition
*/
PerformanceEvents["RefreshTokenClientExecuteTokenRequest"] = "refreshTokenClientExecuteTokenRequest";
/**
* Time taken for acquiring refresh token , records RT size
*/
PerformanceEvents["RefreshTokenClientAcquireToken"] = "refreshTokenClientAcquireToken";
/**
* Time taken for acquiring cached refresh token
*/
PerformanceEvents["RefreshTokenClientAcquireTokenWithCachedRefreshToken"] = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
})(PerformanceEvents || (PerformanceEvents = {}));
/**
* State of the performance event.
*
* @export
* @enum {number}
*/
var PerformanceEventStatus;
(function (PerformanceEventStatus) {
PerformanceEventStatus[PerformanceEventStatus["NotStarted"] = 0] = "NotStarted";
PerformanceEventStatus[PerformanceEventStatus["InProgress"] = 1] = "InProgress";
PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
})(PerformanceEventStatus || (PerformanceEventStatus = {}));
export { PerformanceEventStatus, PerformanceEvents };
//# sourceMappingURL=PerformanceEvent.js.map
{"version":3,"file":"PerformanceEvent.js","sources":["../../../src/telemetry/performance/PerformanceEvent.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.\n *\n * @export\n * @enum {number}\n */\nexport enum PerformanceEvents {\n\n /**\n * acquireTokenByCode API (msal-browser and msal-node).\n * Used to acquire tokens by trading an authorization code against the token endpoint.\n */\n AcquireTokenByCode = \"acquireTokenByCode\",\n\n /**\n * acquireTokenByRefreshToken API (msal-browser and msal-node).\n * Used to renew an access token using a refresh token against the token endpoint.\n */\n AcquireTokenByRefreshToken = \"acquireTokenByRefreshToken\",\n\n /**\n * acquireTokenSilent API (msal-browser and msal-node).\n * Used to silently acquire a new access token (from the cache or the network).\n */\n AcquireTokenSilent = \"acquireTokenSilent\",\n\n /**\n * acquireTokenSilentAsync (msal-browser).\n * Internal API for acquireTokenSilent.\n */\n AcquireTokenSilentAsync = \"acquireTokenSilentAsync\",\n\n /**\n * acquireTokenPopup (msal-browser).\n * Used to acquire a new access token interactively through pop ups\n */\n AcquireTokenPopup = \"acquireTokenPopup\",\n\n /**\n * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).\n * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.\n */\n CryptoOptsGetPublicKeyThumbprint = \"cryptoOptsGetPublicKeyThumbprint\",\n\n /**\n * signJwt API in CryptoOpts class (msal-browser).\n * Used to signed a pop token.\n */\n CryptoOptsSignJwt = \"cryptoOptsSignJwt\",\n\n /**\n * acquireToken API in the SilentCacheClient class (msal-browser).\n * Used to read access tokens from the cache.\n */\n SilentCacheClientAcquireToken = \"silentCacheClientAcquireToken\",\n\n /**\n * acquireToken API in the SilentIframeClient class (msal-browser).\n * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.\n */\n SilentIframeClientAcquireToken = \"silentIframeClientAcquireToken\",\n\n /**\n * acquireToken API in SilentRereshClient (msal-browser).\n * Used to acquire a new set of tokens from the token endpoint using a refresh token.\n */\n SilentRefreshClientAcquireToken = \"silentRefreshClientAcquireToken\",\n\n /**\n * ssoSilent API (msal-browser).\n * Used to silently acquire an authorization code and set of tokens using a hidden iframe.\n */\n SsoSilent = \"ssoSilent\",\n\n /**\n * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).\n * Used to load authority metadata for a request.\n */\n StandardInteractionClientGetDiscoveredAuthority = \"standardInteractionClientGetDiscoveredAuthority\",\n\n /**\n * acquireToken APIs in msal-browser.\n * Used to make an /authorize endpoint call with native brokering enabled.\n */\n FetchAccountIdWithNativeBroker = \"fetchAccountIdWithNativeBroker\",\n\n /**\n * acquireToken API in NativeInteractionClient class (msal-browser).\n * Used to acquire a token from Native component when native brokering is enabled.\n */\n NativeInteractionClientAcquireToken = \"nativeInteractionClientAcquireToken\",\n /**\n * Time spent creating default headers for requests to token endpoint\n */\n BaseClientCreateTokenRequestHeaders = \"baseClientCreateTokenRequestHeaders\",\n /**\n * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).\n */\n BrokerHandhshake = \"brokerHandshake\",\n /**\n * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .\n */\n AcquireTokenByRefreshTokenInBroker = \"acquireTokenByRefreshTokenInBroker\",\n /**\n * Time taken for token acquisition by broker\n */\n AcquireTokenByBroker = \"acquireTokenByBroker\",\n\n /**\n * Time spent on the network for refresh token acquisition\n */\n RefreshTokenClientExecuteTokenRequest = \"refreshTokenClientExecuteTokenRequest\",\n\n /**\n * Time taken for acquiring refresh token , records RT size\n */\n RefreshTokenClientAcquireToken = \"refreshTokenClientAcquireToken\",\n\n /**\n * Time taken for acquiring cached refresh token \n */\n RefreshTokenClientAcquireTokenWithCachedRefreshToken = \"refreshTokenClientAcquireTokenWithCachedRefreshToken\",\n}\n\n/**\n * State of the performance event.\n *\n * @export\n * @enum {number}\n */\nexport enum PerformanceEventStatus {\n NotStarted,\n InProgress,\n Completed\n}\n\n/**\n * Fields whose value will not change throughout a request\n */\nexport type StaticFields = { \n /**\n * The Silent Token Cache Lookup Policy\n *\n * @type {?(number | undefined)}\n */\n cacheLookupPolicy?: number | undefined,\n\n /**\n * Size of the id token\n *\n * @type {number}\n */\n idTokenSize?: number,\n \n /**\n * \n * Size of the access token\n *\n * @type {number}\n */\n \n accessTokenSize?: number,\n\n /**\n * \n * Size of the refresh token\n *\n * @type {number}\n */\n\n refreshTokenSize?: number | undefined,\n \n /**\n * Application name as specified by the app.\n *\n * @type {?string}\n */\n appName?: string,\n \n /**\n * Application version as specified by the app.\n *\n * @type {?string}\n */\n appVersion?: string,\n\n /**\n * The following are fields that may be emitted in native broker scenarios\n */\n extensionId?: string,\n extensionVersion?: string\n matsBrokerVersion?: string;\n matsAccountJoinOnStart?: string;\n matsAccountJoinOnEnd?: string;\n matsDeviceJoin?: string;\n matsPromptBehavior?: string;\n matsApiErrorCode?: number;\n matsUiVisible?: boolean;\n matsSilentCode?: number;\n matsSilentBiSubCode?: number;\n matsSilentMessage?: string;\n matsSilentStatus?: number;\n matsHttpStatus?: number\n matsHttpEventCount?: number;\n};\n\n/**\n * Performance measurement taken by the library, including metadata about the request and application.\n *\n * @export\n * @typedef {PerformanceEvent}\n */\nexport type PerformanceEvent = StaticFields & {\n /**\n * Unique id for the event\n *\n * @type {string}\n */\n eventId: string,\n\n /**\n * State of the perforance measure.\n *\n * @type {PerformanceEventStatus}\n */\n status: PerformanceEventStatus,\n\n /**\n * Login authority used for the request\n *\n * @type {string}\n */\n authority: string,\n\n /**\n * Client id for the application\n *\n * @type {string}\n */\n clientId: string\n\n /**\n * Correlation ID used for the request\n *\n * @type {string}\n */\n correlationId: string,\n\n /**\n * End-to-end duration in milliseconds.\n * @date 3/22/2022 - 3:40:05 PM\n *\n * @type {number}\n */\n durationMs?: number,\n\n /**\n * Visibility of the page when the event completed.\n * Read from: https://developer.mozilla.org/docs/Web/API/Page_Visibility_API\n *\n * @type {?(string | null)}\n */\n endPageVisibility?: string | null,\n\n /**\n * Whether the result was retrieved from the cache.\n *\n * @type {(boolean | null)}\n */\n fromCache?: boolean | null,\n\n /**\n * Event name (usually in the form of classNameFunctionName)\n *\n * @type {PerformanceEvents}\n */\n name: PerformanceEvents,\n\n /**\n * Visibility of the page when the event completed.\n * Read from: https://developer.mozilla.org/docs/Web/API/Page_Visibility_API\n *\n * @type {?(string | null)}\n */\n startPageVisibility?: string | null,\n\n /**\n * Unix millisecond timestamp when the event was initiated.\n *\n * @type {number}\n */\n startTimeMs: number,\n\n /**\n * Whether or the operation completed successfully.\n *\n * @type {(boolean | null)}\n */\n success?: boolean | null,\n\n /**\n * Add specific error code in case of failure\n *\n * @type {string}\n */\n errorCode?: string,\n\n /**\n * Add specific sub error code in case of failure\n *\n * @type {string}\n */\n subErrorCode?: string,\n\n /**\n * Name of the library used for the operation.\n *\n * @type {string}\n */\n libraryName: string,\n\n /**\n * Version of the library used for the operation.\n *\n * @type {string}\n */\n libraryVersion: string,\n\n /**\n * Whether the response is from a native component (e.g., WAM)\n *\n * @type {?boolean}\n */\n isNativeBroker?: boolean,\n\n /**\n * Request ID returned from the response\n * \n * @type {?string}\n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iBAAA,CAAA,kBAAA,CAAA,GAAA,iBAAoC,CAAA;AACpC;;AAEG;AACH,IAAA,iBAAA,CAAA,oCAAA,CAAA,GAAA,oCAAyE,CAAA;AACzE;;AAEG;AACH,IAAA,iBAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C,CAAA;AAE7C;;AAEG;AACH,IAAA,iBAAA,CAAA,uCAAA,CAAA,GAAA,uCAA+E,CAAA;AAE/E;;AAEG;AACH,IAAA,iBAAA,CAAA,gCAAA,CAAA,GAAA,gCAAiE,CAAA;AAEjE;;AAEG;AACH,IAAA,iBAAA,CAAA,sDAAA,CAAA,GAAA,sDAA6G,CAAA;AACjH,CAAC,EApHW,iBAAiB,KAAjB,iBAAiB,GAoH5B,EAAA,CAAA,CAAA,CAAA;AAED;;;;;AAKG;IACS,uBAIX;AAJD,CAAA,UAAY,sBAAsB,EAAA;AAC9B,IAAA,sBAAA,CAAA,sBAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;AACV,IAAA,sBAAA,CAAA,sBAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;AACV,IAAA,sBAAA,CAAA,sBAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACb,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,GAIjC,EAAA,CAAA,CAAA;;;;"}
\ No newline at end of file
{"version":3,"file":"StubPerformanceClient.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/StubPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,0BAA2B,YAAW,uBAAuB;IAEtE,gBAAgB,IAAI,IAAI;IAExB,cAAc,IAAI,IAAI;IACtB,gBAAgB,IAAI,MAAM,GAAG,IAAI;CAIpC;AAED,qBAAa,qBAAsB,SAAQ,iBAAkB,YAAW,kBAAkB;IACtF,UAAU,IAAI,MAAM;IAIpB,4BAA4B,IAAI,uBAAuB;CAG1D"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __extends } from '../../_virtual/_tslib.js';
import { PerformanceClient } from './PerformanceClient.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var StubPerformanceMeasurement = /** @class */ (function () {
function StubPerformanceMeasurement() {
}
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
StubPerformanceMeasurement.prototype.startMeasurement = function () { };
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
StubPerformanceMeasurement.prototype.endMeasurement = function () { };
StubPerformanceMeasurement.prototype.flushMeasurement = function () {
return null;
};
return StubPerformanceMeasurement;
}());
var StubPerformanceClient = /** @class */ (function (_super) {
__extends(StubPerformanceClient, _super);
function StubPerformanceClient() {
return _super !== null && _super.apply(this, arguments) || this;
}
StubPerformanceClient.prototype.generateId = function () {
return "callback-id";
};
StubPerformanceClient.prototype.startPerformanceMeasuremeant = function () {
return new StubPerformanceMeasurement();
};
return StubPerformanceClient;
}(PerformanceClient));
export { StubPerformanceClient, StubPerformanceMeasurement };
//# sourceMappingURL=StubPerformanceClient.js.map
{"version":3,"file":"StubPerformanceClient.js","sources":["../../../src/telemetry/performance/StubPerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IPerformanceClient } from \"./IPerformanceClient\";\nimport { IPerformanceMeasurement } from \"./IPerformanceMeasurement\";\nimport { PerformanceClient } from \"./PerformanceClient\";\n\nexport class StubPerformanceMeasurement implements IPerformanceMeasurement {\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\n startMeasurement(): void { }\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\n endMeasurement(): void { }\n flushMeasurement(): number | null {\n return null;\n }\n \n}\n\nexport class StubPerformanceClient extends PerformanceClient implements IPerformanceClient {\n generateId(): string {\n return \"callback-id\";\n }\n \n startPerformanceMeasuremeant(): IPerformanceMeasurement {\n return new StubPerformanceMeasurement();\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAMH,IAAA,0BAAA,kBAAA,YAAA;AAAA,IAAA,SAAA,0BAAA,GAAA;KASC;;IAPG,0BAAgB,CAAA,SAAA,CAAA,gBAAA,GAAhB,eAA4B,CAAA;;IAE5B,0BAAc,CAAA,SAAA,CAAA,cAAA,GAAd,eAA0B,CAAA;AAC1B,IAAA,0BAAA,CAAA,SAAA,CAAA,gBAAgB,GAAhB,YAAA;AACI,QAAA,OAAO,IAAI,CAAC;KACf,CAAA;IAEL,OAAC,0BAAA,CAAA;AAAD,CAAC,EAAA,EAAA;AAED,IAAA,qBAAA,kBAAA,UAAA,MAAA,EAAA;IAA2C,SAAiB,CAAA,qBAAA,EAAA,MAAA,CAAA,CAAA;AAA5D,IAAA,SAAA,qBAAA,GAAA;;KAQC;AAPG,IAAA,qBAAA,CAAA,SAAA,CAAA,UAAU,GAAV,YAAA;AACI,QAAA,OAAO,aAAa,CAAC;KACxB,CAAA;AAED,IAAA,qBAAA,CAAA,SAAA,CAAA,4BAA4B,GAA5B,YAAA;QACI,OAAO,IAAI,0BAA0B,EAAE,CAAC;KAC3C,CAAA;IACL,OAAC,qBAAA,CAAA;AAAD,CARA,CAA2C,iBAAiB,CAQ3D;;;;"}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment