@azure/msal-common 14.14.2 → 14.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/browser/README.md +1 -0
  2. package/browser/package.json +5 -0
  3. package/dist/account/AccountInfo.d.ts +1 -1
  4. package/dist/account/AccountInfo.d.ts.map +1 -1
  5. package/dist/account/AccountInfo.mjs +1 -1
  6. package/dist/account/AuthToken.d.ts +1 -1
  7. package/dist/account/AuthToken.d.ts.map +1 -1
  8. package/dist/account/AuthToken.mjs +1 -1
  9. package/dist/account/CcsCredential.mjs +1 -1
  10. package/dist/account/ClientInfo.mjs +1 -1
  11. package/dist/account/TokenClaims.mjs +1 -1
  12. package/dist/authority/Authority.d.ts +12 -12
  13. package/dist/authority/Authority.d.ts.map +1 -1
  14. package/dist/authority/Authority.mjs +1 -1
  15. package/dist/authority/AuthorityFactory.d.ts +6 -6
  16. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  17. package/dist/authority/AuthorityFactory.mjs +1 -1
  18. package/dist/authority/AuthorityMetadata.d.ts +6 -6
  19. package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
  20. package/dist/authority/AuthorityMetadata.mjs +1 -1
  21. package/dist/authority/AuthorityOptions.d.ts +4 -4
  22. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  23. package/dist/authority/AuthorityOptions.mjs +1 -1
  24. package/dist/authority/AuthorityType.mjs +1 -1
  25. package/dist/authority/AzureRegionConfiguration.d.ts +1 -1
  26. package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -1
  27. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  28. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +1 -1
  29. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -1
  30. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  31. package/dist/authority/OIDCOptions.d.ts +1 -1
  32. package/dist/authority/OIDCOptions.d.ts.map +1 -1
  33. package/dist/authority/OpenIdConfigResponse.mjs +1 -1
  34. package/dist/authority/ProtocolMode.mjs +1 -1
  35. package/dist/authority/RegionDiscovery.d.ts +5 -5
  36. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  37. package/dist/authority/RegionDiscovery.mjs +1 -1
  38. package/dist/authority/RegionDiscoveryMetadata.d.ts +1 -1
  39. package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -1
  40. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +6 -6
  41. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
  42. package/dist/cache/CacheManager.d.ts +18 -18
  43. package/dist/cache/CacheManager.d.ts.map +1 -1
  44. package/dist/cache/CacheManager.mjs +1 -1
  45. package/dist/cache/entities/AccessTokenEntity.d.ts +2 -2
  46. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  47. package/dist/cache/entities/AccountEntity.d.ts +6 -6
  48. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  49. package/dist/cache/entities/AccountEntity.mjs +1 -1
  50. package/dist/cache/entities/CacheRecord.d.ts +5 -5
  51. package/dist/cache/entities/CacheRecord.d.ts.map +1 -1
  52. package/dist/cache/entities/CredentialEntity.d.ts +1 -1
  53. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  54. package/dist/cache/entities/IdTokenEntity.d.ts +1 -1
  55. package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
  56. package/dist/cache/entities/RefreshTokenEntity.d.ts +1 -1
  57. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  58. package/dist/cache/interface/ICacheManager.d.ts +12 -12
  59. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  60. package/dist/cache/interface/ICachePlugin.d.ts +1 -1
  61. package/dist/cache/interface/ICachePlugin.d.ts.map +1 -1
  62. package/dist/cache/persistence/TokenCacheContext.d.ts +1 -1
  63. package/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -1
  64. package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  65. package/dist/cache/utils/CacheHelpers.d.ts +9 -9
  66. package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
  67. package/dist/cache/utils/CacheHelpers.mjs +1 -1
  68. package/dist/cache/utils/CacheTypes.d.ts +11 -11
  69. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  70. package/dist/client/AuthorizationCodeClient.d.ts +10 -9
  71. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  72. package/dist/client/AuthorizationCodeClient.mjs +13 -5
  73. package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
  74. package/dist/client/BaseClient.d.ts +13 -13
  75. package/dist/client/BaseClient.d.ts.map +1 -1
  76. package/dist/client/BaseClient.mjs +1 -1
  77. package/dist/client/RefreshTokenClient.d.ts +6 -6
  78. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  79. package/dist/client/RefreshTokenClient.mjs +1 -1
  80. package/dist/client/SilentFlowClient.d.ts +6 -6
  81. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  82. package/dist/client/SilentFlowClient.mjs +1 -1
  83. package/dist/config/ClientConfiguration.d.ts +13 -11
  84. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  85. package/dist/config/ClientConfiguration.mjs +2 -1
  86. package/dist/config/ClientConfiguration.mjs.map +1 -1
  87. package/dist/constants/AADServerParamKeys.mjs +1 -1
  88. package/dist/crypto/ICrypto.d.ts +2 -2
  89. package/dist/crypto/ICrypto.d.ts.map +1 -1
  90. package/dist/crypto/ICrypto.mjs +1 -1
  91. package/dist/crypto/JoseHeader.d.ts +1 -1
  92. package/dist/crypto/JoseHeader.d.ts.map +1 -1
  93. package/dist/crypto/JoseHeader.mjs +1 -1
  94. package/dist/crypto/PopTokenGenerator.d.ts +3 -3
  95. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  96. package/dist/crypto/PopTokenGenerator.mjs +1 -1
  97. package/dist/crypto/SignedHttpRequest.d.ts +1 -1
  98. package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
  99. package/dist/error/AuthError.d.ts +1 -1
  100. package/dist/error/AuthError.d.ts.map +1 -1
  101. package/dist/error/AuthError.mjs +1 -1
  102. package/dist/error/AuthErrorCodes.mjs +1 -1
  103. package/dist/error/CacheError.d.ts +1 -1
  104. package/dist/error/CacheError.d.ts.map +1 -1
  105. package/dist/error/CacheError.mjs +1 -1
  106. package/dist/error/CacheErrorCodes.mjs +1 -1
  107. package/dist/error/ClientAuthError.d.ts +2 -2
  108. package/dist/error/ClientAuthError.d.ts.map +1 -1
  109. package/dist/error/ClientAuthError.mjs +1 -1
  110. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  111. package/dist/error/ClientConfigurationError.d.ts +2 -2
  112. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  113. package/dist/error/ClientConfigurationError.mjs +1 -1
  114. package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
  115. package/dist/error/InteractionRequiredAuthError.d.ts +2 -2
  116. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  117. package/dist/error/InteractionRequiredAuthError.mjs +1 -1
  118. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
  119. package/dist/error/JoseHeaderError.d.ts +2 -2
  120. package/dist/error/JoseHeaderError.d.ts.map +1 -1
  121. package/dist/error/JoseHeaderError.mjs +1 -1
  122. package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
  123. package/dist/error/ServerError.d.ts +1 -1
  124. package/dist/error/ServerError.d.ts.map +1 -1
  125. package/dist/error/ServerError.mjs +1 -1
  126. package/dist/exports-browser-only.d.ts +10 -0
  127. package/dist/exports-browser-only.d.ts.map +1 -0
  128. package/dist/exports-common.d.ts +80 -0
  129. package/dist/exports-common.d.ts.map +1 -0
  130. package/dist/exports-node-only.d.ts +18 -0
  131. package/dist/exports-node-only.d.ts.map +1 -0
  132. package/dist/index-browser.d.ts +7 -0
  133. package/dist/index-browser.d.ts.map +1 -0
  134. package/dist/index-browser.mjs +67 -0
  135. package/dist/index-browser.mjs.map +1 -0
  136. package/dist/index-node.d.ts +7 -0
  137. package/dist/index-node.d.ts.map +1 -0
  138. package/dist/index-node.mjs +66 -0
  139. package/dist/index-node.mjs.map +1 -0
  140. package/dist/index.d.ts +7 -103
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.mjs +30 -30
  143. package/dist/logger/Logger.d.ts +1 -1
  144. package/dist/logger/Logger.d.ts.map +1 -1
  145. package/dist/logger/Logger.mjs +1 -1
  146. package/dist/network/INetworkModule.d.ts +1 -1
  147. package/dist/network/INetworkModule.d.ts.map +1 -1
  148. package/dist/network/INetworkModule.mjs +1 -1
  149. package/dist/network/NetworkManager.d.ts +4 -4
  150. package/dist/network/NetworkManager.d.ts.map +1 -1
  151. package/dist/network/NetworkManager.mjs +1 -1
  152. package/dist/network/RequestThumbprint.d.ts +2 -2
  153. package/dist/network/RequestThumbprint.d.ts.map +1 -1
  154. package/dist/network/ThrottlingUtils.d.ts +5 -5
  155. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  156. package/dist/network/ThrottlingUtils.mjs +1 -1
  157. package/dist/packageMetadata.d.ts +1 -1
  158. package/dist/packageMetadata.mjs +2 -2
  159. package/dist/request/AuthenticationHeaderParser.mjs +1 -1
  160. package/dist/request/BaseAuthRequest.d.ts +5 -5
  161. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  162. package/dist/request/CommonAuthorizationCodeRequest.d.ts +3 -3
  163. package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  164. package/dist/request/CommonAuthorizationUrlRequest.d.ts +4 -4
  165. package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
  166. package/dist/request/CommonClientCredentialRequest.d.ts +3 -3
  167. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  168. package/dist/request/CommonDeviceCodeRequest.d.ts +3 -3
  169. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  170. package/dist/request/CommonEndSessionRequest.d.ts +2 -2
  171. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  172. package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -1
  173. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  174. package/dist/request/CommonRefreshTokenRequest.d.ts +3 -3
  175. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  176. package/dist/request/CommonSilentFlowRequest.d.ts +3 -3
  177. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  178. package/dist/request/CommonUsernamePasswordRequest.d.ts +1 -1
  179. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  180. package/dist/request/NativeRequest.d.ts +1 -1
  181. package/dist/request/NativeRequest.d.ts.map +1 -1
  182. package/dist/request/RequestParameterBuilder.d.ts +5 -5
  183. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  184. package/dist/request/RequestParameterBuilder.mjs +1 -1
  185. package/dist/request/RequestValidator.mjs +1 -1
  186. package/dist/request/ScopeSet.mjs +1 -1
  187. package/dist/response/AuthenticationResult.d.ts +1 -1
  188. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  189. package/dist/response/ExternalTokenResponse.d.ts +1 -1
  190. package/dist/response/ExternalTokenResponse.d.ts.map +1 -1
  191. package/dist/response/ResponseHandler.d.ts +16 -16
  192. package/dist/response/ResponseHandler.d.ts.map +1 -1
  193. package/dist/response/ResponseHandler.mjs +1 -1
  194. package/dist/response/ServerAuthorizationTokenResponse.d.ts +1 -1
  195. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  196. package/dist/telemetry/performance/IPerformanceClient.d.ts +2 -2
  197. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  198. package/dist/telemetry/performance/PerformanceClient.d.ts +5 -5
  199. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  200. package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
  201. package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
  202. package/dist/telemetry/performance/StubPerformanceClient.d.ts +3 -3
  203. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  204. package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
  205. package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
  206. package/dist/telemetry/server/ServerTelemetryManager.d.ts +5 -5
  207. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  208. package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
  209. package/dist/url/UrlString.d.ts +1 -1
  210. package/dist/url/UrlString.d.ts.map +1 -1
  211. package/dist/url/UrlString.mjs +1 -1
  212. package/dist/utils/ClientAssertionUtils.d.ts +1 -1
  213. package/dist/utils/ClientAssertionUtils.d.ts.map +1 -1
  214. package/dist/utils/ClientAssertionUtils.mjs +1 -1
  215. package/dist/utils/Constants.mjs +1 -1
  216. package/dist/utils/FunctionWrappers.d.ts +2 -2
  217. package/dist/utils/FunctionWrappers.d.ts.map +1 -1
  218. package/dist/utils/FunctionWrappers.mjs +1 -1
  219. package/dist/utils/ProtocolUtils.d.ts +1 -1
  220. package/dist/utils/ProtocolUtils.d.ts.map +1 -1
  221. package/dist/utils/ProtocolUtils.mjs +1 -1
  222. package/dist/utils/StringUtils.mjs +1 -1
  223. package/dist/utils/TimeUtils.mjs +1 -1
  224. package/dist/utils/UrlUtils.d.ts +1 -1
  225. package/dist/utils/UrlUtils.d.ts.map +1 -1
  226. package/dist/utils/UrlUtils.mjs +1 -1
  227. package/lib/index-browser.cjs +838 -0
  228. package/lib/index-browser.cjs.map +1 -0
  229. package/{dist/index.cjs → lib/index-node-aee3f7b6.js} +39 -765
  230. package/lib/index-node-aee3f7b6.js.map +1 -0
  231. package/lib/index-node.cjs +103 -0
  232. package/lib/index-node.cjs.map +1 -0
  233. package/lib/index.cjs +111 -0
  234. package/lib/index.cjs.map +1 -0
  235. package/lib/package.json +1 -0
  236. package/lib/types/account/AccountInfo.d.ts +67 -0
  237. package/lib/types/account/AccountInfo.d.ts.map +1 -0
  238. package/lib/types/account/AuthToken.d.ts +18 -0
  239. package/lib/types/account/AuthToken.d.ts.map +1 -0
  240. package/lib/types/account/CcsCredential.d.ts +10 -0
  241. package/lib/types/account/CcsCredential.d.ts.map +1 -0
  242. package/lib/types/account/ClientCredentials.d.ts +20 -0
  243. package/lib/types/account/ClientCredentials.d.ts.map +1 -0
  244. package/lib/types/account/ClientInfo.d.ts +19 -0
  245. package/lib/types/account/ClientInfo.d.ts.map +1 -0
  246. package/lib/types/account/TokenClaims.d.ts +84 -0
  247. package/lib/types/account/TokenClaims.d.ts.map +1 -0
  248. package/lib/types/authority/Authority.d.ts +255 -0
  249. package/lib/types/authority/Authority.d.ts.map +1 -0
  250. package/lib/types/authority/AuthorityFactory.d.ts +19 -0
  251. package/lib/types/authority/AuthorityFactory.d.ts.map +1 -0
  252. package/lib/types/authority/AuthorityMetadata.d.ts +44 -0
  253. package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -0
  254. package/lib/types/authority/AuthorityOptions.d.ts +28 -0
  255. package/lib/types/authority/AuthorityOptions.d.ts.map +1 -0
  256. package/lib/types/authority/AuthorityType.d.ts +11 -0
  257. package/lib/types/authority/AuthorityType.d.ts.map +1 -0
  258. package/lib/types/authority/AzureRegion.d.ts +2 -0
  259. package/lib/types/authority/AzureRegion.d.ts.map +1 -0
  260. package/lib/types/authority/AzureRegionConfiguration.d.ts +6 -0
  261. package/lib/types/authority/AzureRegionConfiguration.d.ts.map +1 -0
  262. package/lib/types/authority/CloudDiscoveryMetadata.d.ts +6 -0
  263. package/lib/types/authority/CloudDiscoveryMetadata.d.ts.map +1 -0
  264. package/lib/types/authority/CloudInstanceDiscoveryErrorResponse.d.ts +14 -0
  265. package/lib/types/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -0
  266. package/lib/types/authority/CloudInstanceDiscoveryResponse.d.ts +10 -0
  267. package/lib/types/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -0
  268. package/lib/types/authority/ImdsOptions.d.ts +6 -0
  269. package/lib/types/authority/ImdsOptions.d.ts.map +1 -0
  270. package/lib/types/authority/OIDCOptions.d.ts +9 -0
  271. package/lib/types/authority/OIDCOptions.d.ts.map +1 -0
  272. package/lib/types/authority/OpenIdConfigResponse.d.ts +12 -0
  273. package/lib/types/authority/OpenIdConfigResponse.d.ts.map +1 -0
  274. package/lib/types/authority/ProtocolMode.d.ts +9 -0
  275. package/lib/types/authority/ProtocolMode.d.ts.map +1 -0
  276. package/lib/types/authority/RegionDiscovery.d.ts +33 -0
  277. package/lib/types/authority/RegionDiscovery.d.ts.map +1 -0
  278. package/lib/types/authority/RegionDiscoveryMetadata.d.ts +7 -0
  279. package/lib/types/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
  280. package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
  281. package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
  282. package/lib/types/cache/CacheManager.d.ts +498 -0
  283. package/lib/types/cache/CacheManager.d.ts.map +1 -0
  284. package/lib/types/cache/entities/AccessTokenEntity.d.ts +26 -0
  285. package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -0
  286. package/lib/types/cache/entities/AccountEntity.d.ts +107 -0
  287. package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -0
  288. package/lib/types/cache/entities/AppMetadataEntity.d.ts +12 -0
  289. package/lib/types/cache/entities/AppMetadataEntity.d.ts.map +1 -0
  290. package/lib/types/cache/entities/AuthorityMetadataEntity.d.ts +16 -0
  291. package/lib/types/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -0
  292. package/lib/types/cache/entities/CacheRecord.d.ts +14 -0
  293. package/lib/types/cache/entities/CacheRecord.d.ts.map +1 -0
  294. package/lib/types/cache/entities/CredentialEntity.d.ts +31 -0
  295. package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -0
  296. package/lib/types/cache/entities/IdTokenEntity.d.ts +9 -0
  297. package/lib/types/cache/entities/IdTokenEntity.d.ts.map +1 -0
  298. package/lib/types/cache/entities/RefreshTokenEntity.d.ts +8 -0
  299. package/lib/types/cache/entities/RefreshTokenEntity.d.ts.map +1 -0
  300. package/lib/types/cache/entities/ServerTelemetryEntity.d.ts +7 -0
  301. package/lib/types/cache/entities/ServerTelemetryEntity.d.ts.map +1 -0
  302. package/lib/types/cache/entities/ThrottlingEntity.d.ts +8 -0
  303. package/lib/types/cache/entities/ThrottlingEntity.d.ts.map +1 -0
  304. package/lib/types/cache/interface/ICacheManager.d.ts +167 -0
  305. package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -0
  306. package/lib/types/cache/interface/ICachePlugin.d.ts +6 -0
  307. package/lib/types/cache/interface/ICachePlugin.d.ts.map +1 -0
  308. package/lib/types/cache/interface/ISerializableTokenCache.d.ts +5 -0
  309. package/lib/types/cache/interface/ISerializableTokenCache.d.ts.map +1 -0
  310. package/lib/types/cache/persistence/TokenCacheContext.d.ts +24 -0
  311. package/lib/types/cache/persistence/TokenCacheContext.d.ts.map +1 -0
  312. package/lib/types/cache/utils/CacheHelpers.d.ts +95 -0
  313. package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -0
  314. package/lib/types/cache/utils/CacheTypes.d.ts +70 -0
  315. package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -0
  316. package/lib/types/client/AuthorizationCodeClient.d.ts +76 -0
  317. package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -0
  318. package/lib/types/client/BaseClient.d.ts +52 -0
  319. package/lib/types/client/BaseClient.d.ts.map +1 -0
  320. package/lib/types/client/RefreshTokenClient.d.ts +36 -0
  321. package/lib/types/client/RefreshTokenClient.d.ts.map +1 -0
  322. package/lib/types/client/SilentFlowClient.d.ts +28 -0
  323. package/lib/types/client/SilentFlowClient.d.ts.map +1 -0
  324. package/lib/types/config/AppTokenProvider.d.ts +39 -0
  325. package/lib/types/config/AppTokenProvider.d.ts.map +1 -0
  326. package/lib/types/config/ClientConfiguration.d.ts +153 -0
  327. package/lib/types/config/ClientConfiguration.d.ts.map +1 -0
  328. package/lib/types/constants/AADServerParamKeys.d.ts +54 -0
  329. package/lib/types/constants/AADServerParamKeys.d.ts.map +1 -0
  330. package/lib/types/crypto/ICrypto.d.ts +69 -0
  331. package/lib/types/crypto/ICrypto.d.ts.map +1 -0
  332. package/lib/types/crypto/IGuidGenerator.d.ts +5 -0
  333. package/lib/types/crypto/IGuidGenerator.d.ts.map +1 -0
  334. package/lib/types/crypto/JoseHeader.d.ts +23 -0
  335. package/lib/types/crypto/JoseHeader.d.ts.map +1 -0
  336. package/lib/types/crypto/PopTokenGenerator.d.ts +60 -0
  337. package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -0
  338. package/lib/types/crypto/SignedHttpRequest.d.ts +16 -0
  339. package/lib/types/crypto/SignedHttpRequest.d.ts.map +1 -0
  340. package/lib/types/error/AuthError.d.ts +45 -0
  341. package/lib/types/error/AuthError.d.ts.map +1 -0
  342. package/lib/types/error/AuthErrorCodes.d.ts +6 -0
  343. package/lib/types/error/AuthErrorCodes.d.ts.map +1 -0
  344. package/lib/types/error/CacheError.d.ts +21 -0
  345. package/lib/types/error/CacheError.d.ts.map +1 -0
  346. package/lib/types/error/CacheErrorCodes.d.ts +3 -0
  347. package/lib/types/error/CacheErrorCodes.d.ts.map +1 -0
  348. package/lib/types/error/ClientAuthError.d.ts +238 -0
  349. package/lib/types/error/ClientAuthError.d.ts.map +1 -0
  350. package/lib/types/error/ClientAuthErrorCodes.d.ts +45 -0
  351. package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -0
  352. package/lib/types/error/ClientConfigurationError.d.ts +129 -0
  353. package/lib/types/error/ClientConfigurationError.d.ts.map +1 -0
  354. package/lib/types/error/ClientConfigurationErrorCodes.d.ts +23 -0
  355. package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -0
  356. package/lib/types/error/InteractionRequiredAuthError.d.ts +66 -0
  357. package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -0
  358. package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts +8 -0
  359. package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -0
  360. package/lib/types/error/JoseHeaderError.d.ts +16 -0
  361. package/lib/types/error/JoseHeaderError.d.ts.map +1 -0
  362. package/lib/types/error/JoseHeaderErrorCodes.d.ts +3 -0
  363. package/lib/types/error/JoseHeaderErrorCodes.d.ts.map +1 -0
  364. package/lib/types/error/ServerError.d.ts +16 -0
  365. package/lib/types/error/ServerError.d.ts.map +1 -0
  366. package/lib/types/exports-browser-only.d.ts +10 -0
  367. package/lib/types/exports-browser-only.d.ts.map +1 -0
  368. package/lib/types/exports-common.d.ts +80 -0
  369. package/lib/types/exports-common.d.ts.map +1 -0
  370. package/lib/types/exports-node-only.d.ts +18 -0
  371. package/lib/types/exports-node-only.d.ts.map +1 -0
  372. package/lib/types/index-browser.d.ts +7 -0
  373. package/lib/types/index-browser.d.ts.map +1 -0
  374. package/lib/types/index-node.d.ts +7 -0
  375. package/lib/types/index-node.d.ts.map +1 -0
  376. package/lib/types/index.d.ts +12 -0
  377. package/lib/types/index.d.ts.map +1 -0
  378. package/lib/types/logger/Logger.d.ts +96 -0
  379. package/lib/types/logger/Logger.d.ts.map +1 -0
  380. package/lib/types/network/INetworkModule.d.ts +30 -0
  381. package/lib/types/network/INetworkModule.d.ts.map +1 -0
  382. package/lib/types/network/NetworkManager.d.ts +34 -0
  383. package/lib/types/network/NetworkManager.d.ts.map +1 -0
  384. package/lib/types/network/RequestThumbprint.d.ts +19 -0
  385. package/lib/types/network/RequestThumbprint.d.ts.map +1 -0
  386. package/lib/types/network/ThrottlingUtils.d.ts +43 -0
  387. package/lib/types/network/ThrottlingUtils.d.ts.map +1 -0
  388. package/lib/types/packageMetadata.d.ts +3 -0
  389. package/lib/types/packageMetadata.d.ts.map +1 -0
  390. package/lib/types/request/AuthenticationHeaderParser.d.ts +20 -0
  391. package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -0
  392. package/lib/types/request/BaseAuthRequest.d.ts +48 -0
  393. package/lib/types/request/BaseAuthRequest.d.ts.map +1 -0
  394. package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +28 -0
  395. package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -0
  396. package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +51 -0
  397. package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -0
  398. package/lib/types/request/CommonClientCredentialRequest.d.ts +18 -0
  399. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -0
  400. package/lib/types/request/CommonDeviceCodeRequest.d.ts +22 -0
  401. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -0
  402. package/lib/types/request/CommonEndSessionRequest.d.ts +22 -0
  403. package/lib/types/request/CommonEndSessionRequest.d.ts.map +1 -0
  404. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +14 -0
  405. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -0
  406. package/lib/types/request/CommonRefreshTokenRequest.d.ts +23 -0
  407. package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -0
  408. package/lib/types/request/CommonSilentFlowRequest.d.ts +28 -0
  409. package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -0
  410. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +18 -0
  411. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -0
  412. package/lib/types/request/NativeRequest.d.ts +20 -0
  413. package/lib/types/request/NativeRequest.d.ts.map +1 -0
  414. package/lib/types/request/NativeSignOutRequest.d.ts +6 -0
  415. package/lib/types/request/NativeSignOutRequest.d.ts.map +1 -0
  416. package/lib/types/request/RequestParameterBuilder.d.ts +218 -0
  417. package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -0
  418. package/lib/types/request/RequestValidator.d.ts +28 -0
  419. package/lib/types/request/RequestValidator.d.ts.map +1 -0
  420. package/lib/types/request/ScopeSet.d.ts +89 -0
  421. package/lib/types/request/ScopeSet.d.ts.map +1 -0
  422. package/lib/types/request/StoreInCache.d.ts +9 -0
  423. package/lib/types/request/StoreInCache.d.ts.map +1 -0
  424. package/lib/types/response/AuthenticationResult.d.ts +42 -0
  425. package/lib/types/response/AuthenticationResult.d.ts.map +1 -0
  426. package/lib/types/response/AuthorizationCodePayload.d.ts +14 -0
  427. package/lib/types/response/AuthorizationCodePayload.d.ts.map +1 -0
  428. package/lib/types/response/DeviceCodeResponse.d.ts +26 -0
  429. package/lib/types/response/DeviceCodeResponse.d.ts.map +1 -0
  430. package/lib/types/response/ExternalTokenResponse.d.ts +16 -0
  431. package/lib/types/response/ExternalTokenResponse.d.ts.map +1 -0
  432. package/lib/types/response/IMDSBadResponse.d.ts +5 -0
  433. package/lib/types/response/IMDSBadResponse.d.ts.map +1 -0
  434. package/lib/types/response/ResponseHandler.d.ts +70 -0
  435. package/lib/types/response/ResponseHandler.d.ts.map +1 -0
  436. package/lib/types/response/ServerAuthorizationCodeResponse.d.ts +27 -0
  437. package/lib/types/response/ServerAuthorizationCodeResponse.d.ts.map +1 -0
  438. package/lib/types/response/ServerAuthorizationTokenResponse.d.ts +48 -0
  439. package/lib/types/response/ServerAuthorizationTokenResponse.d.ts.map +1 -0
  440. package/lib/types/telemetry/performance/IPerformanceClient.d.ts +58 -0
  441. package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
  442. package/lib/types/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
  443. package/lib/types/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
  444. package/lib/types/telemetry/performance/PerformanceClient.d.ts +243 -0
  445. package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -0
  446. package/lib/types/telemetry/performance/PerformanceEvent.d.ts +512 -0
  447. package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
  448. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +25 -0
  449. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
  450. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +79 -0
  451. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -0
  452. package/lib/types/telemetry/server/ServerTelemetryRequest.d.ts +9 -0
  453. package/lib/types/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -0
  454. package/lib/types/url/IUri.d.ts +13 -0
  455. package/lib/types/url/IUri.d.ts.map +1 -0
  456. package/lib/types/url/UrlString.d.ts +49 -0
  457. package/lib/types/url/UrlString.d.ts.map +1 -0
  458. package/lib/types/utils/ClientAssertionUtils.d.ts +3 -0
  459. package/lib/types/utils/ClientAssertionUtils.d.ts.map +1 -0
  460. package/lib/types/utils/Constants.d.ts +310 -0
  461. package/lib/types/utils/Constants.d.ts.map +1 -0
  462. package/lib/types/utils/FunctionWrappers.d.ts +28 -0
  463. package/lib/types/utils/FunctionWrappers.d.ts.map +1 -0
  464. package/lib/types/utils/MsalTypes.d.ts +7 -0
  465. package/lib/types/utils/MsalTypes.d.ts.map +1 -0
  466. package/lib/types/utils/ProtocolUtils.d.ts +43 -0
  467. package/lib/types/utils/ProtocolUtils.d.ts.map +1 -0
  468. package/lib/types/utils/StringUtils.d.ts +41 -0
  469. package/lib/types/utils/StringUtils.d.ts.map +1 -0
  470. package/lib/types/utils/TimeUtils.d.ts +26 -0
  471. package/lib/types/utils/TimeUtils.d.ts.map +1 -0
  472. package/lib/types/utils/UrlUtils.d.ts +11 -0
  473. package/lib/types/utils/UrlUtils.d.ts.map +1 -0
  474. package/node/README.md +1 -0
  475. package/node/package.json +5 -0
  476. package/package.json +37 -8
  477. package/src/account/AccountInfo.ts +1 -1
  478. package/src/account/AuthToken.ts +2 -2
  479. package/src/account/ClientInfo.ts +2 -2
  480. package/src/authority/Authority.ts +26 -26
  481. package/src/authority/AuthorityFactory.ts +9 -9
  482. package/src/authority/AuthorityMetadata.ts +7 -7
  483. package/src/authority/AuthorityOptions.ts +4 -4
  484. package/src/authority/AzureRegionConfiguration.ts +1 -1
  485. package/src/authority/CloudInstanceDiscoveryResponse.ts +1 -1
  486. package/src/authority/OIDCOptions.ts +1 -1
  487. package/src/authority/RegionDiscovery.ts +10 -10
  488. package/src/authority/RegionDiscoveryMetadata.ts +1 -1
  489. package/src/broker/nativeBroker/INativeBrokerPlugin.ts +5 -5
  490. package/src/cache/CacheManager.ts +28 -28
  491. package/src/cache/entities/AccessTokenEntity.ts +2 -2
  492. package/src/cache/entities/AccountEntity.ts +10 -10
  493. package/src/cache/entities/CacheRecord.ts +5 -5
  494. package/src/cache/entities/CredentialEntity.ts +1 -1
  495. package/src/cache/entities/IdTokenEntity.ts +1 -1
  496. package/src/cache/entities/RefreshTokenEntity.ts +1 -1
  497. package/src/cache/interface/ICacheManager.ts +12 -12
  498. package/src/cache/interface/ICachePlugin.ts +1 -1
  499. package/src/cache/persistence/TokenCacheContext.ts +1 -1
  500. package/src/cache/utils/CacheHelpers.ts +13 -13
  501. package/src/cache/utils/CacheTypes.ts +11 -11
  502. package/src/client/AuthorizationCodeClient.ts +51 -38
  503. package/src/client/BaseClient.ts +19 -19
  504. package/src/client/RefreshTokenClient.ts +29 -29
  505. package/src/client/SilentFlowClient.ts +17 -17
  506. package/src/config/ClientConfiguration.ts +18 -15
  507. package/src/crypto/ICrypto.ts +3 -3
  508. package/src/crypto/JoseHeader.ts +2 -2
  509. package/src/crypto/PopTokenGenerator.ts +7 -7
  510. package/src/crypto/SignedHttpRequest.ts +1 -1
  511. package/src/error/AuthError.ts +2 -2
  512. package/src/error/CacheError.ts +1 -1
  513. package/src/error/ClientAuthError.ts +2 -2
  514. package/src/error/ClientConfigurationError.ts +2 -2
  515. package/src/error/InteractionRequiredAuthError.ts +3 -3
  516. package/src/error/JoseHeaderError.ts +2 -2
  517. package/src/error/ServerError.ts +1 -1
  518. package/src/exports-browser-only.ts +29 -0
  519. package/src/exports-common.ts +192 -0
  520. package/src/exports-node-only.ts +35 -0
  521. package/src/index-browser.ts +11 -0
  522. package/src/index-node.ts +11 -0
  523. package/src/index.ts +7 -250
  524. package/src/logger/Logger.ts +2 -2
  525. package/src/network/INetworkModule.ts +2 -2
  526. package/src/network/NetworkManager.ts +7 -7
  527. package/src/network/RequestThumbprint.ts +2 -2
  528. package/src/network/ThrottlingUtils.ts +8 -8
  529. package/src/packageMetadata.ts +1 -1
  530. package/src/request/AuthenticationHeaderParser.ts +2 -2
  531. package/src/request/BaseAuthRequest.ts +5 -5
  532. package/src/request/CommonAuthorizationCodeRequest.ts +3 -3
  533. package/src/request/CommonAuthorizationUrlRequest.ts +4 -4
  534. package/src/request/CommonClientCredentialRequest.ts +3 -3
  535. package/src/request/CommonDeviceCodeRequest.ts +3 -3
  536. package/src/request/CommonEndSessionRequest.ts +2 -2
  537. package/src/request/CommonOnBehalfOfRequest.ts +1 -1
  538. package/src/request/CommonRefreshTokenRequest.ts +3 -3
  539. package/src/request/CommonSilentFlowRequest.ts +3 -3
  540. package/src/request/CommonUsernamePasswordRequest.ts +1 -1
  541. package/src/request/NativeRequest.ts +1 -1
  542. package/src/request/RequestParameterBuilder.ts +9 -9
  543. package/src/request/RequestValidator.ts +2 -2
  544. package/src/request/ScopeSet.ts +4 -4
  545. package/src/response/AuthenticationResult.ts +1 -1
  546. package/src/response/ExternalTokenResponse.ts +1 -1
  547. package/src/response/ResponseHandler.ts +31 -31
  548. package/src/response/ServerAuthorizationTokenResponse.ts +1 -1
  549. package/src/telemetry/performance/IPerformanceClient.ts +2 -2
  550. package/src/telemetry/performance/PerformanceClient.ts +10 -10
  551. package/src/telemetry/performance/StubPerformanceClient.ts +6 -3
  552. package/src/telemetry/server/ServerTelemetryManager.ts +6 -6
  553. package/src/url/UrlString.ts +5 -5
  554. package/src/utils/ClientAssertionUtils.ts +1 -1
  555. package/src/utils/FunctionWrappers.ts +2 -2
  556. package/src/utils/ProtocolUtils.ts +3 -3
  557. package/src/utils/UrlUtils.ts +2 -2
  558. package/dist/index.cjs.map +0 -1
@@ -0,0 +1,26 @@
1
+ /**
2
+ * DeviceCode returned by the security token service device code endpoint containing information necessary for device code flow.
3
+ * - userCode: code which user needs to provide when authenticating at the verification URI
4
+ * - deviceCode: code which should be included in the request for the access token
5
+ * - verificationUri: URI where user can authenticate
6
+ * - expiresIn: expiration time of the device code in seconds
7
+ * - interval: interval at which the STS should be polled at
8
+ * - message: message which should be displayed to the user
9
+ */
10
+ export type DeviceCodeResponse = {
11
+ userCode: string;
12
+ deviceCode: string;
13
+ verificationUri: string;
14
+ expiresIn: number;
15
+ interval: number;
16
+ message: string;
17
+ };
18
+ export type ServerDeviceCodeResponse = {
19
+ user_code: string;
20
+ device_code: string;
21
+ verification_uri: string;
22
+ expires_in: number;
23
+ interval: number;
24
+ message: string;
25
+ };
26
+ //# sourceMappingURL=DeviceCodeResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceCodeResponse.d.ts","sourceRoot":"","sources":["../../../src/response/DeviceCodeResponse.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,MAAM,MAAM,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,MAAM,MAAM,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"}
@@ -0,0 +1,16 @@
1
+ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResponse.js";
2
+ /**
3
+ * Response object used for loading external tokens to cache.
4
+ * - token_type: Indicates the token type value. The only type that Azure AD supports is Bearer.
5
+ * - scope: The scopes that the access_token is valid for.
6
+ * - expires_in: How long the access token is valid (in seconds).
7
+ * - id_token: A JSON Web Token (JWT). The app can decode the segments of this token to request information about the user who signed in.
8
+ * - refresh_token: An OAuth 2.0 refresh token. The app can use this token acquire additional access tokens after the current access token expires.
9
+ * - access_token: The requested access token. The app can use this token to authenticate to the secured resource, such as a web API.
10
+ * - client_info: Client info object
11
+ */
12
+ export type ExternalTokenResponse = Pick<ServerAuthorizationTokenResponse, "token_type" | "scope" | "expires_in" | "ext_expires_in" | "id_token" | "refresh_token" | "refresh_token_expires_in" | "foci"> & {
13
+ access_token?: string;
14
+ client_info?: string;
15
+ };
16
+ //# sourceMappingURL=ExternalTokenResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalTokenResponse.d.ts","sourceRoot":"","sources":["../../../src/response/ExternalTokenResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACpC,gCAAgC,EAC9B,YAAY,GACZ,OAAO,GACP,YAAY,GACZ,gBAAgB,GAChB,UAAU,GACV,eAAe,GACf,0BAA0B,GAC1B,MAAM,CACX,GAAG;IACA,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type IMDSBadResponse = {
2
+ error: string;
3
+ "newest-versions": Array<string>;
4
+ };
5
+ //# sourceMappingURL=IMDSBadResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMDSBadResponse.d.ts","sourceRoot":"","sources":["../../../src/response/IMDSBadResponse.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResponse.js";
2
+ import { ICrypto } from "../crypto/ICrypto.js";
3
+ import { ServerAuthorizationCodeResponse } from "./ServerAuthorizationCodeResponse.js";
4
+ import { Logger } from "../logger/Logger.js";
5
+ import { AuthenticationResult } from "./AuthenticationResult.js";
6
+ import { AccountEntity } from "../cache/entities/AccountEntity.js";
7
+ import { Authority } from "../authority/Authority.js";
8
+ import { CacheRecord } from "../cache/entities/CacheRecord.js";
9
+ import { CacheManager } from "../cache/CacheManager.js";
10
+ import { RequestStateObject } from "../utils/ProtocolUtils.js";
11
+ import { ICachePlugin } from "../cache/interface/ICachePlugin.js";
12
+ import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache.js";
13
+ import { AuthorizationCodePayload } from "./AuthorizationCodePayload.js";
14
+ import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
15
+ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
16
+ import { TokenClaims } from "../account/TokenClaims.js";
17
+ /**
18
+ * Class that handles response parsing.
19
+ * @internal
20
+ */
21
+ export declare class ResponseHandler {
22
+ private clientId;
23
+ private cacheStorage;
24
+ private cryptoObj;
25
+ private logger;
26
+ private homeAccountIdentifier;
27
+ private serializableCache;
28
+ private persistencePlugin;
29
+ private performanceClient?;
30
+ constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null, performanceClient?: IPerformanceClient);
31
+ /**
32
+ * Function which validates server authorization code response.
33
+ * @param serverResponseHash
34
+ * @param requestState
35
+ * @param cryptoObj
36
+ */
37
+ validateServerAuthorizationCodeResponse(serverResponse: ServerAuthorizationCodeResponse, requestState: string): void;
38
+ /**
39
+ * Function which validates server authorization token response.
40
+ * @param serverResponse
41
+ * @param refreshAccessToken
42
+ */
43
+ validateTokenResponse(serverResponse: ServerAuthorizationTokenResponse, refreshAccessToken?: boolean): void;
44
+ /**
45
+ * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.
46
+ * @param serverTokenResponse
47
+ * @param authority
48
+ */
49
+ handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, authCodePayload?: AuthorizationCodePayload, userAssertionHash?: string, handlingRefreshTokenResponse?: boolean, forceCacheRefreshTokenResponse?: boolean, serverRequestId?: string): Promise<AuthenticationResult>;
50
+ /**
51
+ * Generates CacheRecord
52
+ * @param serverTokenResponse
53
+ * @param idTokenObj
54
+ * @param authority
55
+ */
56
+ private generateCacheRecord;
57
+ /**
58
+ * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
59
+ *
60
+ * Optionally takes a state string that is set as-is in the response.
61
+ *
62
+ * @param cacheRecord
63
+ * @param idTokenObj
64
+ * @param fromTokenCache
65
+ * @param stateString
66
+ */
67
+ static generateAuthenticationResult(cryptoObj: ICrypto, authority: Authority, cacheRecord: CacheRecord, fromTokenCache: boolean, request: BaseAuthRequest, idTokenClaims?: TokenClaims, requestState?: RequestStateObject, serverTokenResponse?: ServerAuthorizationTokenResponse, requestId?: string): Promise<AuthenticationResult>;
68
+ }
69
+ export declare function buildAccountToCache(cacheStorage: CacheManager, authority: Authority, homeAccountId: string, base64Decode: (input: string) => string, idTokenClaims?: TokenClaims, clientInfo?: string, environment?: string, claimsTenantId?: string | null, authCodePayload?: AuthorizationCodePayload, nativeAccountId?: string, logger?: Logger): AccountEntity;
70
+ //# sourceMappingURL=ResponseHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseHandler.d.ts","sourceRoot":"","sources":["../../../src/response/ResponseHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;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AAe,CAAC,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,GAChB,aAAa,CAiDf"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Deserialized response object from server authorization code request.
3
+ * - code: authorization code from server
4
+ * - client_info: client info object
5
+ * - state: OAuth2 request state
6
+ * - error: error sent back in hash
7
+ * - error: description
8
+ */
9
+ export type ServerAuthorizationCodeResponse = {
10
+ code?: string;
11
+ client_info?: string;
12
+ state?: string;
13
+ cloud_instance_name?: string;
14
+ cloud_instance_host_name?: string;
15
+ cloud_graph_host_name?: string;
16
+ msgraph_host?: string;
17
+ error?: string;
18
+ error_uri?: string;
19
+ error_description?: string;
20
+ suberror?: string;
21
+ timestamp?: string;
22
+ trace_id?: string;
23
+ correlation_id?: string;
24
+ claims?: string;
25
+ accountId?: string;
26
+ };
27
+ //# sourceMappingURL=ServerAuthorizationCodeResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerAuthorizationCodeResponse.d.ts","sourceRoot":"","sources":["../../../src/response/ServerAuthorizationCodeResponse.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,MAAM,+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,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { AuthenticationScheme } from "../utils/Constants.js";
2
+ /**
3
+ * Deserialized response object from server authorization code request.
4
+ * - token_type: Indicates the token type value. Can be either Bearer or pop.
5
+ * - scope: The scopes that the access_token is valid for.
6
+ * - expires_in: How long the access token is valid (in seconds).
7
+ * - refresh_in: Duration afer which a token should be renewed, regardless of expiration.
8
+ * - ext_expires_in: How long the access token is valid (in seconds) if the server isn't responding.
9
+ * - access_token: The requested access token. The app can use this token to authenticate to the secured resource, such as a web API.
10
+ * - refresh_token: An OAuth 2.0 refresh token. The app can use this token acquire additional access tokens after the current access token expires.
11
+ * - id_token: A JSON Web Token (JWT). The app can decode the segments of this token to request information about the user who signed in.
12
+ * - key_id: A string that uniquely identifies a public key that the request is bound to.
13
+ *
14
+ * In case of error:
15
+ * - error: An error code string that can be used to classify types of errors that occur, and can be used to react to errors.
16
+ * - error_description: A specific error message that can help a developer identify the root cause of an authentication error.
17
+ * - error_codes: A list of STS-specific error codes that can help in diagnostics.
18
+ * - timestamp: The time at which the error occurred.
19
+ * - trace_id: A unique identifier for the request that can help in diagnostics.
20
+ * - correlation_id: A unique identifier for the request that can help in diagnostics across components.
21
+ * - status: the network request's response status
22
+ */
23
+ export type ServerAuthorizationTokenResponse = {
24
+ status?: number;
25
+ token_type?: AuthenticationScheme;
26
+ scope?: string;
27
+ expires_in?: number;
28
+ refresh_in?: number;
29
+ ext_expires_in?: number;
30
+ access_token?: string;
31
+ refresh_token?: string;
32
+ refresh_token_expires_in?: number;
33
+ id_token?: string;
34
+ client_info?: string;
35
+ foci?: string;
36
+ spa_code?: string;
37
+ spa_accountid?: string;
38
+ key_id?: string;
39
+ error?: string;
40
+ error_description?: string;
41
+ error_codes?: Array<string>;
42
+ suberror?: string;
43
+ timestamp?: string;
44
+ trace_id?: string;
45
+ correlation_id?: string;
46
+ claims?: string;
47
+ };
48
+ //# sourceMappingURL=ServerAuthorizationTokenResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerAuthorizationTokenResponse.d.ts","sourceRoot":"","sources":["../../../src/response/ServerAuthorizationTokenResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,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,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,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;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { PerformanceEvent } from "./PerformanceEvent.js";
2
+ import { IPerformanceMeasurement } from "./IPerformanceMeasurement.js";
3
+ export type PerformanceCallbackFunction = (events: PerformanceEvent[]) => void;
4
+ export type InProgressPerformanceEvent = {
5
+ end: (event?: Partial<PerformanceEvent>, error?: unknown) => PerformanceEvent | null;
6
+ discard: () => void;
7
+ add: (fields: {
8
+ [key: string]: {} | undefined;
9
+ }) => void;
10
+ increment: (fields: {
11
+ [key: string]: number | undefined;
12
+ }) => void;
13
+ event: PerformanceEvent;
14
+ /**
15
+ * @deprecated This attribute will be removed in the next major version
16
+ */
17
+ measurement: IPerformanceMeasurement;
18
+ };
19
+ export interface IPerformanceClient {
20
+ startMeasurement(measureName: string, correlationId?: string): InProgressPerformanceEvent;
21
+ endMeasurement(event: PerformanceEvent): PerformanceEvent | null;
22
+ discardMeasurements(correlationId: string): void;
23
+ addFields(fields: {
24
+ [key: string]: {} | undefined;
25
+ }, correlationId: string): void;
26
+ incrementFields(fields: {
27
+ [key: string]: number | undefined;
28
+ }, correlationId: string): void;
29
+ removePerformanceCallback(callbackId: string): boolean;
30
+ addPerformanceCallback(callback: PerformanceCallbackFunction): string;
31
+ emitEvents(events: PerformanceEvent[], correlationId: string): void;
32
+ /**
33
+ * @deprecated This method will be removed in the next major version
34
+ */
35
+ startPerformanceMeasurement(measureName: string, correlationId: string): IPerformanceMeasurement;
36
+ generateId(): string;
37
+ calculateQueuedTime(preQueueTime: number, currentTime: number): number;
38
+ addQueueMeasurement(eventName: string, correlationId?: string, queueTime?: number, manuallyCompleted?: boolean): void;
39
+ setPreQueueTime(eventName: string, correlationId?: string): void;
40
+ }
41
+ /**
42
+ * Queue measurement type
43
+ */
44
+ export type QueueMeasurement = {
45
+ /**
46
+ * Name of performance event
47
+ */
48
+ eventName: string;
49
+ /**
50
+ * Time spent in JS queue
51
+ */
52
+ queueTime: number;
53
+ /**
54
+ * Incomplete pre-queue events are instrumentation bugs that should be fixed.
55
+ */
56
+ manuallyCompleted?: boolean;
57
+ };
58
+ //# sourceMappingURL=IPerformanceClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPerformanceClient.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/performance/IPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;AAE/E,MAAM,MAAM,0BAA0B,GAAG;IACrC,GAAG,EAAE,CACD,KAAK,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACjC,KAAK,CAAC,EAAE,OAAO,KACd,gBAAgB,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,GAAG,EAAE,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,GAAG,SAAS,CAAA;KAAE,KAAK,IAAI,CAAC;IACzD,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,KAAK,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,WAAW,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAC/B,gBAAgB,CACZ,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,GACvB,0BAA0B,CAAC;IAC9B,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACjE,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,SAAS,CACL,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,GAAG,SAAS,CAAA;KAAE,EACzC,aAAa,EAAE,MAAM,GACtB,IAAI,CAAC;IACR,eAAe,CACX,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,EAC7C,aAAa,EAAE,MAAM,GACtB,IAAI,CAAC;IACR,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;;OAEG;IACH,2BAA2B,CACvB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACtB,uBAAuB,CAAC;IAC3B,UAAU,IAAI,MAAM,CAAC;IACrB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IACvE,mBAAmB,CACf,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,OAAO,GAC5B,IAAI,CAAC;IACR,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface IPerformanceMeasurement {
2
+ startMeasurement(): void;
3
+ endMeasurement(): void;
4
+ flushMeasurement(): number | null;
5
+ }
6
+ //# sourceMappingURL=IPerformanceMeasurement.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,243 @@
1
+ import { ApplicationTelemetry } from "../../config/ClientConfiguration.js";
2
+ import { Logger } from "../../logger/Logger.js";
3
+ import { InProgressPerformanceEvent, IPerformanceClient, PerformanceCallbackFunction, QueueMeasurement } from "./IPerformanceClient.js";
4
+ import { PerformanceEvent, PerformanceEventContext, PerformanceEvents, PerformanceEventStackedContext } from "./PerformanceEvent.js";
5
+ import { IPerformanceMeasurement } from "./IPerformanceMeasurement.js";
6
+ export interface PreQueueEvent {
7
+ name: PerformanceEvents;
8
+ time: number;
9
+ }
10
+ /**
11
+ * Starts context by adding payload to the stack
12
+ * @param event {PerformanceEvent}
13
+ * @param abbreviations {Map<string, string>} event name abbreviations
14
+ * @param stack {?PerformanceEventStackedContext[]} stack
15
+ */
16
+ export declare function startContext(event: PerformanceEvent, abbreviations: Map<string, string>, stack?: PerformanceEventStackedContext[]): void;
17
+ /**
18
+ * Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
19
+ *
20
+ * @param event {PerformanceEvent}
21
+ * @param abbreviations {Map<string, string>} event name abbreviations
22
+ * @param stack {?PerformanceEventStackedContext[]} stack
23
+ * @param error {?unknown} error
24
+ */
25
+ export declare function endContext(event: PerformanceEvent, abbreviations: Map<string, string>, stack?: PerformanceEventStackedContext[], error?: unknown): PerformanceEventContext | undefined;
26
+ /**
27
+ * Adds error name and stack trace to the telemetry event
28
+ * @param error {Error}
29
+ * @param logger {Logger}
30
+ * @param event {PerformanceEvent}
31
+ * @param stackMaxSize {number} max error stack size to capture
32
+ */
33
+ export declare function addError(error: unknown, logger: Logger, event: PerformanceEvent, stackMaxSize?: number): void;
34
+ /**
35
+ * Compacts error stack into array by fetching N first entries
36
+ * @param stack {string} error stack
37
+ * @param stackMaxSize {number} max error stack size to capture
38
+ * @returns {string[]}
39
+ */
40
+ export declare function compactStack(stack: string, stackMaxSize: number): string[];
41
+ /**
42
+ * Compacts error stack line by shortening file path
43
+ * Example: https://localhost/msal-common/src/authority/Authority.js:100:1 -> Authority.js:100:1
44
+ * @param line {string} stack line
45
+ * @returns {string}
46
+ */
47
+ export declare function compactStackLine(line: string): string;
48
+ export declare abstract class PerformanceClient implements IPerformanceClient {
49
+ protected authority: string;
50
+ protected libraryName: string;
51
+ protected libraryVersion: string;
52
+ protected applicationTelemetry: ApplicationTelemetry;
53
+ protected clientId: string;
54
+ protected logger: Logger;
55
+ protected callbacks: Map<string, PerformanceCallbackFunction>;
56
+ /**
57
+ * Multiple events with the same correlation id.
58
+ * @protected
59
+ * @type {Map<string, PerformanceEvent>}
60
+ */
61
+ protected eventsByCorrelationId: Map<string, PerformanceEvent>;
62
+ /**
63
+ * Map of pre-queue times by correlation Id
64
+ *
65
+ * @protected
66
+ * @type {Map<string, PreQueueEvent>}
67
+ */
68
+ protected preQueueTimeByCorrelationId: Map<string, PreQueueEvent>;
69
+ /**
70
+ * Map of queue measurements by correlation Id
71
+ *
72
+ * @protected
73
+ * @type {Map<string, Array<QueueMeasurement>>}
74
+ */
75
+ protected queueMeasurements: Map<string, Array<QueueMeasurement>>;
76
+ protected intFields: Set<string>;
77
+ /**
78
+ * Map of stacked events by correlation id.
79
+ *
80
+ * @protected
81
+ */
82
+ protected eventStack: Map<string, PerformanceEventStackedContext[]>;
83
+ /**
84
+ * Event name abbreviations
85
+ *
86
+ * @protected
87
+ */
88
+ protected abbreviations: Map<string, string>;
89
+ /**
90
+ * Creates an instance of PerformanceClient,
91
+ * an abstract class containing core performance telemetry logic.
92
+ *
93
+ * @constructor
94
+ * @param {string} clientId Client ID of the application
95
+ * @param {string} authority Authority used by the application
96
+ * @param {Logger} logger Logger used by the application
97
+ * @param {string} libraryName Name of the library
98
+ * @param {string} libraryVersion Version of the library
99
+ * @param {ApplicationTelemetry} applicationTelemetry application name and version
100
+ * @param {Set<String>} intFields integer fields to be truncated
101
+ * @param {Map<string, string>} abbreviations event name abbreviations
102
+ */
103
+ constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, intFields?: Set<string>, abbreviations?: Map<string, string>);
104
+ /**
105
+ * Generates and returns a unique id, typically a guid.
106
+ *
107
+ * @abstract
108
+ * @returns {string}
109
+ */
110
+ abstract generateId(): string;
111
+ /**
112
+ * Starts and returns an platform-specific implementation of IPerformanceMeasurement.
113
+ * Note: this function can be changed to abstract at the next major version bump.
114
+ *
115
+ * @param {string} measureName
116
+ * @param {string} correlationId
117
+ * @returns {IPerformanceMeasurement}
118
+ * @deprecated This method will be removed in the next major version
119
+ */
120
+ startPerformanceMeasurement(measureName: string, // eslint-disable-line @typescript-eslint/no-unused-vars
121
+ correlationId: string): IPerformanceMeasurement;
122
+ /**
123
+ * Sets pre-queue time by correlation Id
124
+ *
125
+ * @abstract
126
+ * @param {PerformanceEvents} eventName
127
+ * @param {string} correlationId
128
+ * @returns
129
+ */
130
+ abstract setPreQueueTime(eventName: PerformanceEvents, correlationId?: string): void;
131
+ /**
132
+ * Gets map of pre-queue times by correlation Id
133
+ *
134
+ * @param {PerformanceEvents} eventName
135
+ * @param {string} correlationId
136
+ * @returns {number}
137
+ */
138
+ getPreQueueTime(eventName: string, correlationId: string): number | void;
139
+ /**
140
+ * Calculates the difference between current time and time when function was queued.
141
+ * Note: It is possible to have 0 as the queue time if the current time and the queued time was the same.
142
+ *
143
+ * @param {number} preQueueTime
144
+ * @param {number} currentTime
145
+ * @returns {number}
146
+ */
147
+ calculateQueuedTime(preQueueTime: number, currentTime: number): number;
148
+ /**
149
+ * Adds queue measurement time to QueueMeasurements array for given correlation ID.
150
+ *
151
+ * @param {PerformanceEvents} eventName
152
+ * @param {?string} correlationId
153
+ * @param {?number} queueTime
154
+ * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
155
+ * @returns
156
+ */
157
+ addQueueMeasurement(eventName: string, correlationId?: string, queueTime?: number, manuallyCompleted?: boolean): void;
158
+ /**
159
+ * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
160
+ *
161
+ * @param {PerformanceEvents} measureName
162
+ * @param {?string} [correlationId]
163
+ * @returns {InProgressPerformanceEvent}
164
+ */
165
+ startMeasurement(measureName: string, correlationId?: string): InProgressPerformanceEvent;
166
+ /**
167
+ * Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,
168
+ * as consumers should instead use the function returned by startMeasurement.
169
+ * Adds a new field named as "[event name]DurationMs" for sub-measurements, completes and emits an event
170
+ * otherwise.
171
+ *
172
+ * @param {PerformanceEvent} event
173
+ * @param {unknown} error
174
+ * @returns {(PerformanceEvent | null)}
175
+ */
176
+ endMeasurement(event: PerformanceEvent, error?: unknown): PerformanceEvent | null;
177
+ /**
178
+ * Saves extra information to be emitted when the measurements are flushed
179
+ * @param fields
180
+ * @param correlationId
181
+ */
182
+ addFields(fields: {
183
+ [key: string]: {} | undefined;
184
+ }, correlationId: string): void;
185
+ /**
186
+ * Increment counters to be emitted when the measurements are flushed
187
+ * @param fields {string[]}
188
+ * @param correlationId {string} correlation identifier
189
+ */
190
+ incrementFields(fields: {
191
+ [key: string]: number | undefined;
192
+ }, correlationId: string): void;
193
+ /**
194
+ * Upserts event into event cache.
195
+ * First key is the correlation id, second key is the event id.
196
+ * Allows for events to be grouped by correlation id,
197
+ * and to easily allow for properties on them to be updated.
198
+ *
199
+ * @private
200
+ * @param {PerformanceEvent} event
201
+ */
202
+ protected cacheEventByCorrelationId(event: PerformanceEvent): void;
203
+ private getQueueInfo;
204
+ /**
205
+ * Removes measurements and aux data for a given correlation id.
206
+ *
207
+ * @param {string} correlationId
208
+ */
209
+ discardMeasurements(correlationId: string): void;
210
+ /**
211
+ * Registers a callback function to receive performance events.
212
+ *
213
+ * @param {PerformanceCallbackFunction} callback
214
+ * @returns {string}
215
+ */
216
+ addPerformanceCallback(callback: PerformanceCallbackFunction): string;
217
+ /**
218
+ * Removes a callback registered with addPerformanceCallback.
219
+ *
220
+ * @param {string} callbackId
221
+ * @returns {boolean}
222
+ */
223
+ removePerformanceCallback(callbackId: string): boolean;
224
+ /**
225
+ * Emits events to all registered callbacks.
226
+ *
227
+ * @param {PerformanceEvent[]} events
228
+ * @param {?string} [correlationId]
229
+ */
230
+ emitEvents(events: PerformanceEvent[], correlationId: string): void;
231
+ /**
232
+ * Enforce truncation of integral fields in performance event.
233
+ * @param {PerformanceEvent} event performance event to update.
234
+ */
235
+ private truncateIntegralFields;
236
+ /**
237
+ * Returns event duration in milliseconds
238
+ * @param startTimeMs {number}
239
+ * @returns {number}
240
+ */
241
+ private getDurationMs;
242
+ }
243
+ //# sourceMappingURL=PerformanceClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceClient.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/performance/PerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEH,gBAAgB,EAEhB,uBAAuB,EACvB,iBAAiB,EACjB,8BAA8B,EAEjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAOvE,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,KAAK,CAAC,EAAE,8BAA8B,EAAE,GACzC,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