{"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 * Performance measurement taken by the library, including metadata about the request and application.\n *\n * @export\n * @typedef {PerformanceEvent}\n */\nexport type PerformanceEvent = {\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 * 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 * Whether the response is from a native component (e.g., WAM)\n *\n * @type {?boolean}\n */\n isNativeBroker?: boolean,\n\n /**\n * The Silent Token Cache Lookup Policy\n *\n * @type {?(number | undefined)}\n */\n cacheLookupPolicy?: number | undefined,\n\n /**\n * Request ID returned from the response\n * \n * @type {?string}\n */\n requestId?: string\n};\n"],"names":[],"mappings":";;AAAA;;;AAGG;AAEH;;;;;AAKG;IACS,kBAoHX;AApHD,CAAA,UAAY,iBAAiB,EAAA;AAEzB;;;AAGG;AACH,IAAA,iBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC,CAAA;AAEzC;;;AAGG;AACH,IAAA,iBAAA,CAAA,4BAAA,CAAA,GAAA,4BAAyD,CAAA;AAEzD;;;AAGG;AACH,IAAA,iBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC,CAAA;AAEzC;;;AAGG;AACH,IAAA,iBAAA,CAAA,yBAAA,CAAA,GAAA,yBAAmD,CAAA;AAEnD;;;AAGG;AACH,IAAA,iBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC,CAAA;AAEvC;;;AAGG;AACH,IAAA,iBAAA,CAAA,kCAAA,CAAA,GAAA,kCAAqE,CAAA;AAErE;;;AAGG;AACH,IAAA,iBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC,CAAA;AAEvC;;;AAGG;AACH,IAAA,iBAAA,CAAA,+BAAA,CAAA,GAAA,+BAA+D,CAAA;AAE/D;;;AAGG;AACH,IAAA,iBAAA,CAAA,gCAAA,CAAA,GAAA,gCAAiE,CAAA;AAEjE;;;AAGG;AACH,IAAA,iBAAA,CAAA,iCAAA,CAAA,GAAA,iCAAmE,CAAA;AAEnE;;;AAGG;AACH,IAAA,iBAAA,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