@azure/msal-common 14.14.1 → 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 (562) 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.d.ts +0 -4
  202. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  203. package/dist/telemetry/performance/PerformanceEvent.mjs +1 -5
  204. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  205. package/dist/telemetry/performance/StubPerformanceClient.d.ts +3 -3
  206. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  207. package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
  208. package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
  209. package/dist/telemetry/server/ServerTelemetryManager.d.ts +5 -5
  210. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  211. package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
  212. package/dist/url/UrlString.d.ts +1 -1
  213. package/dist/url/UrlString.d.ts.map +1 -1
  214. package/dist/url/UrlString.mjs +1 -1
  215. package/dist/utils/ClientAssertionUtils.d.ts +1 -1
  216. package/dist/utils/ClientAssertionUtils.d.ts.map +1 -1
  217. package/dist/utils/ClientAssertionUtils.mjs +1 -1
  218. package/dist/utils/Constants.mjs +1 -1
  219. package/dist/utils/FunctionWrappers.d.ts +2 -2
  220. package/dist/utils/FunctionWrappers.d.ts.map +1 -1
  221. package/dist/utils/FunctionWrappers.mjs +1 -1
  222. package/dist/utils/ProtocolUtils.d.ts +1 -1
  223. package/dist/utils/ProtocolUtils.d.ts.map +1 -1
  224. package/dist/utils/ProtocolUtils.mjs +1 -1
  225. package/dist/utils/StringUtils.mjs +1 -1
  226. package/dist/utils/TimeUtils.mjs +1 -1
  227. package/dist/utils/UrlUtils.d.ts +1 -1
  228. package/dist/utils/UrlUtils.d.ts.map +1 -1
  229. package/dist/utils/UrlUtils.mjs +1 -1
  230. package/lib/index-browser.cjs +838 -0
  231. package/lib/index-browser.cjs.map +1 -0
  232. package/{dist/index.cjs → lib/index-node-aee3f7b6.js} +39 -769
  233. package/lib/index-node-aee3f7b6.js.map +1 -0
  234. package/lib/index-node.cjs +103 -0
  235. package/lib/index-node.cjs.map +1 -0
  236. package/lib/index.cjs +111 -0
  237. package/lib/index.cjs.map +1 -0
  238. package/lib/package.json +1 -0
  239. package/lib/types/account/AccountInfo.d.ts +67 -0
  240. package/lib/types/account/AccountInfo.d.ts.map +1 -0
  241. package/lib/types/account/AuthToken.d.ts +18 -0
  242. package/lib/types/account/AuthToken.d.ts.map +1 -0
  243. package/lib/types/account/CcsCredential.d.ts +10 -0
  244. package/lib/types/account/CcsCredential.d.ts.map +1 -0
  245. package/lib/types/account/ClientCredentials.d.ts +20 -0
  246. package/lib/types/account/ClientCredentials.d.ts.map +1 -0
  247. package/lib/types/account/ClientInfo.d.ts +19 -0
  248. package/lib/types/account/ClientInfo.d.ts.map +1 -0
  249. package/lib/types/account/TokenClaims.d.ts +84 -0
  250. package/lib/types/account/TokenClaims.d.ts.map +1 -0
  251. package/lib/types/authority/Authority.d.ts +255 -0
  252. package/lib/types/authority/Authority.d.ts.map +1 -0
  253. package/lib/types/authority/AuthorityFactory.d.ts +19 -0
  254. package/lib/types/authority/AuthorityFactory.d.ts.map +1 -0
  255. package/lib/types/authority/AuthorityMetadata.d.ts +44 -0
  256. package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -0
  257. package/lib/types/authority/AuthorityOptions.d.ts +28 -0
  258. package/lib/types/authority/AuthorityOptions.d.ts.map +1 -0
  259. package/lib/types/authority/AuthorityType.d.ts +11 -0
  260. package/lib/types/authority/AuthorityType.d.ts.map +1 -0
  261. package/lib/types/authority/AzureRegion.d.ts +2 -0
  262. package/lib/types/authority/AzureRegion.d.ts.map +1 -0
  263. package/lib/types/authority/AzureRegionConfiguration.d.ts +6 -0
  264. package/lib/types/authority/AzureRegionConfiguration.d.ts.map +1 -0
  265. package/lib/types/authority/CloudDiscoveryMetadata.d.ts +6 -0
  266. package/lib/types/authority/CloudDiscoveryMetadata.d.ts.map +1 -0
  267. package/lib/types/authority/CloudInstanceDiscoveryErrorResponse.d.ts +14 -0
  268. package/lib/types/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -0
  269. package/lib/types/authority/CloudInstanceDiscoveryResponse.d.ts +10 -0
  270. package/lib/types/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -0
  271. package/lib/types/authority/ImdsOptions.d.ts +6 -0
  272. package/lib/types/authority/ImdsOptions.d.ts.map +1 -0
  273. package/lib/types/authority/OIDCOptions.d.ts +9 -0
  274. package/lib/types/authority/OIDCOptions.d.ts.map +1 -0
  275. package/lib/types/authority/OpenIdConfigResponse.d.ts +12 -0
  276. package/lib/types/authority/OpenIdConfigResponse.d.ts.map +1 -0
  277. package/lib/types/authority/ProtocolMode.d.ts +9 -0
  278. package/lib/types/authority/ProtocolMode.d.ts.map +1 -0
  279. package/lib/types/authority/RegionDiscovery.d.ts +33 -0
  280. package/lib/types/authority/RegionDiscovery.d.ts.map +1 -0
  281. package/lib/types/authority/RegionDiscoveryMetadata.d.ts +7 -0
  282. package/lib/types/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
  283. package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
  284. package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
  285. package/lib/types/cache/CacheManager.d.ts +498 -0
  286. package/lib/types/cache/CacheManager.d.ts.map +1 -0
  287. package/lib/types/cache/entities/AccessTokenEntity.d.ts +26 -0
  288. package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -0
  289. package/lib/types/cache/entities/AccountEntity.d.ts +107 -0
  290. package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -0
  291. package/lib/types/cache/entities/AppMetadataEntity.d.ts +12 -0
  292. package/lib/types/cache/entities/AppMetadataEntity.d.ts.map +1 -0
  293. package/lib/types/cache/entities/AuthorityMetadataEntity.d.ts +16 -0
  294. package/lib/types/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -0
  295. package/lib/types/cache/entities/CacheRecord.d.ts +14 -0
  296. package/lib/types/cache/entities/CacheRecord.d.ts.map +1 -0
  297. package/lib/types/cache/entities/CredentialEntity.d.ts +31 -0
  298. package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -0
  299. package/lib/types/cache/entities/IdTokenEntity.d.ts +9 -0
  300. package/lib/types/cache/entities/IdTokenEntity.d.ts.map +1 -0
  301. package/lib/types/cache/entities/RefreshTokenEntity.d.ts +8 -0
  302. package/lib/types/cache/entities/RefreshTokenEntity.d.ts.map +1 -0
  303. package/lib/types/cache/entities/ServerTelemetryEntity.d.ts +7 -0
  304. package/lib/types/cache/entities/ServerTelemetryEntity.d.ts.map +1 -0
  305. package/lib/types/cache/entities/ThrottlingEntity.d.ts +8 -0
  306. package/lib/types/cache/entities/ThrottlingEntity.d.ts.map +1 -0
  307. package/lib/types/cache/interface/ICacheManager.d.ts +167 -0
  308. package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -0
  309. package/lib/types/cache/interface/ICachePlugin.d.ts +6 -0
  310. package/lib/types/cache/interface/ICachePlugin.d.ts.map +1 -0
  311. package/lib/types/cache/interface/ISerializableTokenCache.d.ts +5 -0
  312. package/lib/types/cache/interface/ISerializableTokenCache.d.ts.map +1 -0
  313. package/lib/types/cache/persistence/TokenCacheContext.d.ts +24 -0
  314. package/lib/types/cache/persistence/TokenCacheContext.d.ts.map +1 -0
  315. package/lib/types/cache/utils/CacheHelpers.d.ts +95 -0
  316. package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -0
  317. package/lib/types/cache/utils/CacheTypes.d.ts +70 -0
  318. package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -0
  319. package/lib/types/client/AuthorizationCodeClient.d.ts +76 -0
  320. package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -0
  321. package/lib/types/client/BaseClient.d.ts +52 -0
  322. package/lib/types/client/BaseClient.d.ts.map +1 -0
  323. package/lib/types/client/RefreshTokenClient.d.ts +36 -0
  324. package/lib/types/client/RefreshTokenClient.d.ts.map +1 -0
  325. package/lib/types/client/SilentFlowClient.d.ts +28 -0
  326. package/lib/types/client/SilentFlowClient.d.ts.map +1 -0
  327. package/lib/types/config/AppTokenProvider.d.ts +39 -0
  328. package/lib/types/config/AppTokenProvider.d.ts.map +1 -0
  329. package/lib/types/config/ClientConfiguration.d.ts +153 -0
  330. package/lib/types/config/ClientConfiguration.d.ts.map +1 -0
  331. package/lib/types/constants/AADServerParamKeys.d.ts +54 -0
  332. package/lib/types/constants/AADServerParamKeys.d.ts.map +1 -0
  333. package/lib/types/crypto/ICrypto.d.ts +69 -0
  334. package/lib/types/crypto/ICrypto.d.ts.map +1 -0
  335. package/lib/types/crypto/IGuidGenerator.d.ts +5 -0
  336. package/lib/types/crypto/IGuidGenerator.d.ts.map +1 -0
  337. package/lib/types/crypto/JoseHeader.d.ts +23 -0
  338. package/lib/types/crypto/JoseHeader.d.ts.map +1 -0
  339. package/lib/types/crypto/PopTokenGenerator.d.ts +60 -0
  340. package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -0
  341. package/lib/types/crypto/SignedHttpRequest.d.ts +16 -0
  342. package/lib/types/crypto/SignedHttpRequest.d.ts.map +1 -0
  343. package/lib/types/error/AuthError.d.ts +45 -0
  344. package/lib/types/error/AuthError.d.ts.map +1 -0
  345. package/lib/types/error/AuthErrorCodes.d.ts +6 -0
  346. package/lib/types/error/AuthErrorCodes.d.ts.map +1 -0
  347. package/lib/types/error/CacheError.d.ts +21 -0
  348. package/lib/types/error/CacheError.d.ts.map +1 -0
  349. package/lib/types/error/CacheErrorCodes.d.ts +3 -0
  350. package/lib/types/error/CacheErrorCodes.d.ts.map +1 -0
  351. package/lib/types/error/ClientAuthError.d.ts +238 -0
  352. package/lib/types/error/ClientAuthError.d.ts.map +1 -0
  353. package/lib/types/error/ClientAuthErrorCodes.d.ts +45 -0
  354. package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -0
  355. package/lib/types/error/ClientConfigurationError.d.ts +129 -0
  356. package/lib/types/error/ClientConfigurationError.d.ts.map +1 -0
  357. package/lib/types/error/ClientConfigurationErrorCodes.d.ts +23 -0
  358. package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -0
  359. package/lib/types/error/InteractionRequiredAuthError.d.ts +66 -0
  360. package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -0
  361. package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts +8 -0
  362. package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -0
  363. package/lib/types/error/JoseHeaderError.d.ts +16 -0
  364. package/lib/types/error/JoseHeaderError.d.ts.map +1 -0
  365. package/lib/types/error/JoseHeaderErrorCodes.d.ts +3 -0
  366. package/lib/types/error/JoseHeaderErrorCodes.d.ts.map +1 -0
  367. package/lib/types/error/ServerError.d.ts +16 -0
  368. package/lib/types/error/ServerError.d.ts.map +1 -0
  369. package/lib/types/exports-browser-only.d.ts +10 -0
  370. package/lib/types/exports-browser-only.d.ts.map +1 -0
  371. package/lib/types/exports-common.d.ts +80 -0
  372. package/lib/types/exports-common.d.ts.map +1 -0
  373. package/lib/types/exports-node-only.d.ts +18 -0
  374. package/lib/types/exports-node-only.d.ts.map +1 -0
  375. package/lib/types/index-browser.d.ts +7 -0
  376. package/lib/types/index-browser.d.ts.map +1 -0
  377. package/lib/types/index-node.d.ts +7 -0
  378. package/lib/types/index-node.d.ts.map +1 -0
  379. package/lib/types/index.d.ts +12 -0
  380. package/lib/types/index.d.ts.map +1 -0
  381. package/lib/types/logger/Logger.d.ts +96 -0
  382. package/lib/types/logger/Logger.d.ts.map +1 -0
  383. package/lib/types/network/INetworkModule.d.ts +30 -0
  384. package/lib/types/network/INetworkModule.d.ts.map +1 -0
  385. package/lib/types/network/NetworkManager.d.ts +34 -0
  386. package/lib/types/network/NetworkManager.d.ts.map +1 -0
  387. package/lib/types/network/RequestThumbprint.d.ts +19 -0
  388. package/lib/types/network/RequestThumbprint.d.ts.map +1 -0
  389. package/lib/types/network/ThrottlingUtils.d.ts +43 -0
  390. package/lib/types/network/ThrottlingUtils.d.ts.map +1 -0
  391. package/lib/types/packageMetadata.d.ts +3 -0
  392. package/lib/types/packageMetadata.d.ts.map +1 -0
  393. package/lib/types/request/AuthenticationHeaderParser.d.ts +20 -0
  394. package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -0
  395. package/lib/types/request/BaseAuthRequest.d.ts +48 -0
  396. package/lib/types/request/BaseAuthRequest.d.ts.map +1 -0
  397. package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +28 -0
  398. package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -0
  399. package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +51 -0
  400. package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -0
  401. package/lib/types/request/CommonClientCredentialRequest.d.ts +18 -0
  402. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -0
  403. package/lib/types/request/CommonDeviceCodeRequest.d.ts +22 -0
  404. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -0
  405. package/lib/types/request/CommonEndSessionRequest.d.ts +22 -0
  406. package/lib/types/request/CommonEndSessionRequest.d.ts.map +1 -0
  407. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +14 -0
  408. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -0
  409. package/lib/types/request/CommonRefreshTokenRequest.d.ts +23 -0
  410. package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -0
  411. package/lib/types/request/CommonSilentFlowRequest.d.ts +28 -0
  412. package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -0
  413. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +18 -0
  414. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -0
  415. package/lib/types/request/NativeRequest.d.ts +20 -0
  416. package/lib/types/request/NativeRequest.d.ts.map +1 -0
  417. package/lib/types/request/NativeSignOutRequest.d.ts +6 -0
  418. package/lib/types/request/NativeSignOutRequest.d.ts.map +1 -0
  419. package/lib/types/request/RequestParameterBuilder.d.ts +218 -0
  420. package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -0
  421. package/lib/types/request/RequestValidator.d.ts +28 -0
  422. package/lib/types/request/RequestValidator.d.ts.map +1 -0
  423. package/lib/types/request/ScopeSet.d.ts +89 -0
  424. package/lib/types/request/ScopeSet.d.ts.map +1 -0
  425. package/lib/types/request/StoreInCache.d.ts +9 -0
  426. package/lib/types/request/StoreInCache.d.ts.map +1 -0
  427. package/lib/types/response/AuthenticationResult.d.ts +42 -0
  428. package/lib/types/response/AuthenticationResult.d.ts.map +1 -0
  429. package/lib/types/response/AuthorizationCodePayload.d.ts +14 -0
  430. package/lib/types/response/AuthorizationCodePayload.d.ts.map +1 -0
  431. package/lib/types/response/DeviceCodeResponse.d.ts +26 -0
  432. package/lib/types/response/DeviceCodeResponse.d.ts.map +1 -0
  433. package/lib/types/response/ExternalTokenResponse.d.ts +16 -0
  434. package/lib/types/response/ExternalTokenResponse.d.ts.map +1 -0
  435. package/lib/types/response/IMDSBadResponse.d.ts +5 -0
  436. package/lib/types/response/IMDSBadResponse.d.ts.map +1 -0
  437. package/lib/types/response/ResponseHandler.d.ts +70 -0
  438. package/lib/types/response/ResponseHandler.d.ts.map +1 -0
  439. package/lib/types/response/ServerAuthorizationCodeResponse.d.ts +27 -0
  440. package/lib/types/response/ServerAuthorizationCodeResponse.d.ts.map +1 -0
  441. package/lib/types/response/ServerAuthorizationTokenResponse.d.ts +48 -0
  442. package/lib/types/response/ServerAuthorizationTokenResponse.d.ts.map +1 -0
  443. package/lib/types/telemetry/performance/IPerformanceClient.d.ts +58 -0
  444. package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
  445. package/lib/types/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
  446. package/lib/types/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
  447. package/lib/types/telemetry/performance/PerformanceClient.d.ts +243 -0
  448. package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -0
  449. package/lib/types/telemetry/performance/PerformanceEvent.d.ts +512 -0
  450. package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
  451. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +25 -0
  452. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
  453. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +79 -0
  454. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -0
  455. package/lib/types/telemetry/server/ServerTelemetryRequest.d.ts +9 -0
  456. package/lib/types/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -0
  457. package/lib/types/url/IUri.d.ts +13 -0
  458. package/lib/types/url/IUri.d.ts.map +1 -0
  459. package/lib/types/url/UrlString.d.ts +49 -0
  460. package/lib/types/url/UrlString.d.ts.map +1 -0
  461. package/lib/types/utils/ClientAssertionUtils.d.ts +3 -0
  462. package/lib/types/utils/ClientAssertionUtils.d.ts.map +1 -0
  463. package/lib/types/utils/Constants.d.ts +310 -0
  464. package/lib/types/utils/Constants.d.ts.map +1 -0
  465. package/lib/types/utils/FunctionWrappers.d.ts +28 -0
  466. package/lib/types/utils/FunctionWrappers.d.ts.map +1 -0
  467. package/lib/types/utils/MsalTypes.d.ts +7 -0
  468. package/lib/types/utils/MsalTypes.d.ts.map +1 -0
  469. package/lib/types/utils/ProtocolUtils.d.ts +43 -0
  470. package/lib/types/utils/ProtocolUtils.d.ts.map +1 -0
  471. package/lib/types/utils/StringUtils.d.ts +41 -0
  472. package/lib/types/utils/StringUtils.d.ts.map +1 -0
  473. package/lib/types/utils/TimeUtils.d.ts +26 -0
  474. package/lib/types/utils/TimeUtils.d.ts.map +1 -0
  475. package/lib/types/utils/UrlUtils.d.ts +11 -0
  476. package/lib/types/utils/UrlUtils.d.ts.map +1 -0
  477. package/node/README.md +1 -0
  478. package/node/package.json +5 -0
  479. package/package.json +37 -8
  480. package/src/account/AccountInfo.ts +1 -1
  481. package/src/account/AuthToken.ts +2 -2
  482. package/src/account/ClientInfo.ts +2 -2
  483. package/src/authority/Authority.ts +26 -26
  484. package/src/authority/AuthorityFactory.ts +9 -9
  485. package/src/authority/AuthorityMetadata.ts +7 -7
  486. package/src/authority/AuthorityOptions.ts +4 -4
  487. package/src/authority/AzureRegionConfiguration.ts +1 -1
  488. package/src/authority/CloudInstanceDiscoveryResponse.ts +1 -1
  489. package/src/authority/OIDCOptions.ts +1 -1
  490. package/src/authority/RegionDiscovery.ts +10 -10
  491. package/src/authority/RegionDiscoveryMetadata.ts +1 -1
  492. package/src/broker/nativeBroker/INativeBrokerPlugin.ts +5 -5
  493. package/src/cache/CacheManager.ts +28 -28
  494. package/src/cache/entities/AccessTokenEntity.ts +2 -2
  495. package/src/cache/entities/AccountEntity.ts +10 -10
  496. package/src/cache/entities/CacheRecord.ts +5 -5
  497. package/src/cache/entities/CredentialEntity.ts +1 -1
  498. package/src/cache/entities/IdTokenEntity.ts +1 -1
  499. package/src/cache/entities/RefreshTokenEntity.ts +1 -1
  500. package/src/cache/interface/ICacheManager.ts +12 -12
  501. package/src/cache/interface/ICachePlugin.ts +1 -1
  502. package/src/cache/persistence/TokenCacheContext.ts +1 -1
  503. package/src/cache/utils/CacheHelpers.ts +13 -13
  504. package/src/cache/utils/CacheTypes.ts +11 -11
  505. package/src/client/AuthorizationCodeClient.ts +51 -38
  506. package/src/client/BaseClient.ts +19 -19
  507. package/src/client/RefreshTokenClient.ts +29 -29
  508. package/src/client/SilentFlowClient.ts +17 -17
  509. package/src/config/ClientConfiguration.ts +18 -15
  510. package/src/crypto/ICrypto.ts +3 -3
  511. package/src/crypto/JoseHeader.ts +2 -2
  512. package/src/crypto/PopTokenGenerator.ts +7 -7
  513. package/src/crypto/SignedHttpRequest.ts +1 -1
  514. package/src/error/AuthError.ts +2 -2
  515. package/src/error/CacheError.ts +1 -1
  516. package/src/error/ClientAuthError.ts +2 -2
  517. package/src/error/ClientConfigurationError.ts +2 -2
  518. package/src/error/InteractionRequiredAuthError.ts +3 -3
  519. package/src/error/JoseHeaderError.ts +2 -2
  520. package/src/error/ServerError.ts +1 -1
  521. package/src/exports-browser-only.ts +29 -0
  522. package/src/exports-common.ts +192 -0
  523. package/src/exports-node-only.ts +35 -0
  524. package/src/index-browser.ts +11 -0
  525. package/src/index-node.ts +11 -0
  526. package/src/index.ts +7 -250
  527. package/src/logger/Logger.ts +2 -2
  528. package/src/network/INetworkModule.ts +2 -2
  529. package/src/network/NetworkManager.ts +7 -7
  530. package/src/network/RequestThumbprint.ts +2 -2
  531. package/src/network/ThrottlingUtils.ts +8 -8
  532. package/src/packageMetadata.ts +1 -1
  533. package/src/request/AuthenticationHeaderParser.ts +2 -2
  534. package/src/request/BaseAuthRequest.ts +5 -5
  535. package/src/request/CommonAuthorizationCodeRequest.ts +3 -3
  536. package/src/request/CommonAuthorizationUrlRequest.ts +4 -4
  537. package/src/request/CommonClientCredentialRequest.ts +3 -3
  538. package/src/request/CommonDeviceCodeRequest.ts +3 -3
  539. package/src/request/CommonEndSessionRequest.ts +2 -2
  540. package/src/request/CommonOnBehalfOfRequest.ts +1 -1
  541. package/src/request/CommonRefreshTokenRequest.ts +3 -3
  542. package/src/request/CommonSilentFlowRequest.ts +3 -3
  543. package/src/request/CommonUsernamePasswordRequest.ts +1 -1
  544. package/src/request/NativeRequest.ts +1 -1
  545. package/src/request/RequestParameterBuilder.ts +9 -9
  546. package/src/request/RequestValidator.ts +2 -2
  547. package/src/request/ScopeSet.ts +4 -4
  548. package/src/response/AuthenticationResult.ts +1 -1
  549. package/src/response/ExternalTokenResponse.ts +1 -1
  550. package/src/response/ResponseHandler.ts +31 -31
  551. package/src/response/ServerAuthorizationTokenResponse.ts +1 -1
  552. package/src/telemetry/performance/IPerformanceClient.ts +2 -2
  553. package/src/telemetry/performance/PerformanceClient.ts +10 -10
  554. package/src/telemetry/performance/PerformanceEvent.ts +0 -5
  555. package/src/telemetry/performance/StubPerformanceClient.ts +6 -3
  556. package/src/telemetry/server/ServerTelemetryManager.ts +6 -6
  557. package/src/url/UrlString.ts +5 -5
  558. package/src/utils/ClientAssertionUtils.ts +1 -1
  559. package/src/utils/FunctionWrappers.ts +2 -2
  560. package/src/utils/ProtocolUtils.ts +3 -3
  561. package/src/utils/UrlUtils.ts +2 -2
  562. package/dist/index.cjs.map +0 -1
@@ -0,0 +1,498 @@
1
+ import { AccountFilter, CredentialFilter, ValidCredentialType, AppMetadataFilter, AppMetadataCache, TokenKeys } from "./utils/CacheTypes.js";
2
+ import { CacheRecord } from "./entities/CacheRecord.js";
3
+ import { AccountEntity } from "./entities/AccountEntity.js";
4
+ import { AccessTokenEntity } from "./entities/AccessTokenEntity.js";
5
+ import { IdTokenEntity } from "./entities/IdTokenEntity.js";
6
+ import { RefreshTokenEntity } from "./entities/RefreshTokenEntity.js";
7
+ import { ICacheManager } from "./interface/ICacheManager.js";
8
+ import { AccountInfo } from "../account/AccountInfo.js";
9
+ import { AppMetadataEntity } from "./entities/AppMetadataEntity.js";
10
+ import { ServerTelemetryEntity } from "./entities/ServerTelemetryEntity.js";
11
+ import { ThrottlingEntity } from "./entities/ThrottlingEntity.js";
12
+ import { ICrypto } from "../crypto/ICrypto.js";
13
+ import { AuthorityMetadataEntity } from "./entities/AuthorityMetadataEntity.js";
14
+ import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
15
+ import { Logger } from "../logger/Logger.js";
16
+ import { StoreInCache } from "../request/StoreInCache.js";
17
+ import { StaticAuthorityOptions } from "../authority/AuthorityOptions.js";
18
+ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
19
+ /**
20
+ * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.
21
+ * @internal
22
+ */
23
+ export declare abstract class CacheManager implements ICacheManager {
24
+ protected clientId: string;
25
+ protected cryptoImpl: ICrypto;
26
+ private commonLogger;
27
+ private staticAuthorityOptions?;
28
+ constructor(clientId: string, cryptoImpl: ICrypto, logger: Logger, staticAuthorityOptions?: StaticAuthorityOptions);
29
+ /**
30
+ * fetch the account entity from the platform cache
31
+ * @param accountKey
32
+ */
33
+ abstract getAccount(accountKey: string, logger?: Logger): AccountEntity | null;
34
+ /**
35
+ * Returns deserialized account if found in the cache, otherwiser returns null
36
+ */
37
+ abstract getCachedAccountEntity(accountKey: string): AccountEntity | null;
38
+ /**
39
+ * set account entity in the platform cache
40
+ * @param account
41
+ */
42
+ abstract setAccount(account: AccountEntity): void;
43
+ /**
44
+ * remove account entity from the platform cache if it's outdated
45
+ */
46
+ abstract removeOutdatedAccount(accountKey: string): void;
47
+ /**
48
+ * fetch the idToken entity from the platform cache
49
+ * @param idTokenKey
50
+ */
51
+ abstract getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
52
+ /**
53
+ * set idToken entity to the platform cache
54
+ * @param idToken
55
+ */
56
+ abstract setIdTokenCredential(idToken: IdTokenEntity): void;
57
+ /**
58
+ * fetch the idToken entity from the platform cache
59
+ * @param accessTokenKey
60
+ */
61
+ abstract getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
62
+ /**
63
+ * set idToken entity to the platform cache
64
+ * @param accessToken
65
+ */
66
+ abstract setAccessTokenCredential(accessToken: AccessTokenEntity): void;
67
+ /**
68
+ * fetch the idToken entity from the platform cache
69
+ * @param refreshTokenKey
70
+ */
71
+ abstract getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
72
+ /**
73
+ * set idToken entity to the platform cache
74
+ * @param refreshToken
75
+ */
76
+ abstract setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;
77
+ /**
78
+ * fetch appMetadata entity from the platform cache
79
+ * @param appMetadataKey
80
+ */
81
+ abstract getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
82
+ /**
83
+ * set appMetadata entity to the platform cache
84
+ * @param appMetadata
85
+ */
86
+ abstract setAppMetadata(appMetadata: AppMetadataEntity): void;
87
+ /**
88
+ * fetch server telemetry entity from the platform cache
89
+ * @param serverTelemetryKey
90
+ */
91
+ abstract getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;
92
+ /**
93
+ * set server telemetry entity to the platform cache
94
+ * @param serverTelemetryKey
95
+ * @param serverTelemetry
96
+ */
97
+ abstract setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
98
+ /**
99
+ * fetch cloud discovery metadata entity from the platform cache
100
+ * @param key
101
+ */
102
+ abstract getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
103
+ /**
104
+ *
105
+ */
106
+ abstract getAuthorityMetadataKeys(): Array<string>;
107
+ /**
108
+ * set cloud discovery metadata entity to the platform cache
109
+ * @param key
110
+ * @param value
111
+ */
112
+ abstract setAuthorityMetadata(key: string, value: AuthorityMetadataEntity): void;
113
+ /**
114
+ * fetch throttling entity from the platform cache
115
+ * @param throttlingCacheKey
116
+ */
117
+ abstract getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
118
+ /**
119
+ * set throttling entity to the platform cache
120
+ * @param throttlingCacheKey
121
+ * @param throttlingCache
122
+ */
123
+ abstract setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
124
+ /**
125
+ * Function to remove an item from cache given its key.
126
+ * @param key
127
+ */
128
+ abstract removeItem(key: string): void;
129
+ /**
130
+ * Function which retrieves all current keys from the cache.
131
+ */
132
+ abstract getKeys(): string[];
133
+ /**
134
+ * Function which retrieves all account keys from the cache
135
+ */
136
+ abstract getAccountKeys(): string[];
137
+ /**
138
+ * Function which retrieves all token keys from the cache
139
+ */
140
+ abstract getTokenKeys(): TokenKeys;
141
+ /**
142
+ * Function which clears cache.
143
+ */
144
+ abstract clear(): Promise<void>;
145
+ /**
146
+ * Function which updates an outdated credential cache key
147
+ */
148
+ abstract updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;
149
+ /**
150
+ * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
151
+ * @param accountFilter - (Optional) filter to narrow down the accounts returned
152
+ * @returns Array of AccountInfo objects in cache
153
+ */
154
+ getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
155
+ /**
156
+ * Gets first tenanted AccountInfo object found based on provided filters
157
+ */
158
+ getAccountInfoFilteredBy(accountFilter: AccountFilter): AccountInfo | null;
159
+ /**
160
+ * Returns a single matching
161
+ * @param accountFilter
162
+ * @returns
163
+ */
164
+ getBaseAccountInfo(accountFilter: AccountFilter): AccountInfo | null;
165
+ /**
166
+ * Matches filtered account entities with cached ID tokens that match the tenant profile-specific account filters
167
+ * and builds the account info objects from the matching ID token's claims
168
+ * @param cachedAccounts
169
+ * @param accountFilter
170
+ * @returns Array of AccountInfo objects that match account and tenant profile filters
171
+ */
172
+ private buildTenantProfiles;
173
+ private getTenantedAccountInfoByFilter;
174
+ private getTenantProfilesFromAccountEntity;
175
+ private tenantProfileMatchesFilter;
176
+ private idTokenClaimsMatchTenantProfileFilter;
177
+ /**
178
+ * saves a cache record
179
+ * @param cacheRecord {CacheRecord}
180
+ * @param storeInCache {?StoreInCache}
181
+ * @param correlationId {?string} correlation id
182
+ */
183
+ saveCacheRecord(cacheRecord: CacheRecord, storeInCache?: StoreInCache, correlationId?: string): Promise<void>;
184
+ /**
185
+ * saves access token credential
186
+ * @param credential
187
+ */
188
+ private saveAccessToken;
189
+ /**
190
+ * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
191
+ * Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
192
+ * @param accountFilter - An object containing Account properties to filter by
193
+ */
194
+ getAccountsFilteredBy(accountFilter: AccountFilter): AccountEntity[];
195
+ /**
196
+ * Returns true if the given key matches our account key schema. Also matches homeAccountId and/or tenantId if provided
197
+ * @param key
198
+ * @param homeAccountId
199
+ * @param tenantId
200
+ * @returns
201
+ */
202
+ isAccountKey(key: string, homeAccountId?: string, tenantId?: string): boolean;
203
+ /**
204
+ * Returns true if the given key matches our credential key schema.
205
+ * @param key
206
+ */
207
+ isCredentialKey(key: string): boolean;
208
+ /**
209
+ * Returns whether or not the given credential entity matches the filter
210
+ * @param entity
211
+ * @param filter
212
+ * @returns
213
+ */
214
+ credentialMatchesFilter(entity: ValidCredentialType, filter: CredentialFilter): boolean;
215
+ /**
216
+ * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata
217
+ * @param filter
218
+ */
219
+ getAppMetadataFilteredBy(filter: AppMetadataFilter): AppMetadataCache;
220
+ /**
221
+ * retrieve authorityMetadata that contains a matching alias
222
+ * @param filter
223
+ */
224
+ getAuthorityMetadataByAlias(host: string): AuthorityMetadataEntity | null;
225
+ /**
226
+ * Removes all accounts and related tokens from cache.
227
+ */
228
+ removeAllAccounts(): Promise<void>;
229
+ /**
230
+ * Removes the account and related tokens for a given account key
231
+ * @param account
232
+ */
233
+ removeAccount(accountKey: string): Promise<void>;
234
+ /**
235
+ * Removes credentials associated with the provided account
236
+ * @param account
237
+ */
238
+ removeAccountContext(account: AccountEntity): Promise<void>;
239
+ /**
240
+ * Migrates a single-tenant account and all it's associated alternate cross-tenant account objects in the
241
+ * cache into a condensed multi-tenant account object with tenant profiles.
242
+ * @param accountKey
243
+ * @param accountEntity
244
+ * @param logger
245
+ * @returns
246
+ */
247
+ protected updateOutdatedCachedAccount(accountKey: string, accountEntity: AccountEntity | null, logger?: Logger): AccountEntity | null;
248
+ /**
249
+ * returns a boolean if the given credential is removed
250
+ * @param credential
251
+ */
252
+ removeAccessToken(key: string): Promise<void>;
253
+ /**
254
+ * Removes all app metadata objects from cache.
255
+ */
256
+ removeAppMetadata(): boolean;
257
+ /**
258
+ * Retrieve AccountEntity from cache
259
+ * @param account
260
+ */
261
+ readAccountFromCache(account: AccountInfo): AccountEntity | null;
262
+ /**
263
+ * Retrieve IdTokenEntity from cache
264
+ * @param account {AccountInfo}
265
+ * @param tokenKeys {?TokenKeys}
266
+ * @param targetRealm {?string}
267
+ * @param performanceClient {?IPerformanceClient}
268
+ * @param correlationId {?string}
269
+ */
270
+ getIdToken(account: AccountInfo, tokenKeys?: TokenKeys, targetRealm?: string, performanceClient?: IPerformanceClient, correlationId?: string): IdTokenEntity | null;
271
+ /**
272
+ * Gets all idTokens matching the given filter
273
+ * @param filter
274
+ * @returns
275
+ */
276
+ getIdTokensByFilter(filter: CredentialFilter, tokenKeys?: TokenKeys): Map<string, IdTokenEntity>;
277
+ /**
278
+ * Validate the cache key against filter before retrieving and parsing cache value
279
+ * @param key
280
+ * @param filter
281
+ * @returns
282
+ */
283
+ idTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter): boolean;
284
+ /**
285
+ * Removes idToken from the cache
286
+ * @param key
287
+ */
288
+ removeIdToken(key: string): void;
289
+ /**
290
+ * Removes refresh token from the cache
291
+ * @param key
292
+ */
293
+ removeRefreshToken(key: string): void;
294
+ /**
295
+ * Retrieve AccessTokenEntity from cache
296
+ * @param account {AccountInfo}
297
+ * @param request {BaseAuthRequest}
298
+ * @param tokenKeys {?TokenKeys}
299
+ * @param performanceClient {?IPerformanceClient}
300
+ * @param correlationId {?string}
301
+ */
302
+ getAccessToken(account: AccountInfo, request: BaseAuthRequest, tokenKeys?: TokenKeys, targetRealm?: string, performanceClient?: IPerformanceClient, correlationId?: string): AccessTokenEntity | null;
303
+ /**
304
+ * Validate the cache key against filter before retrieving and parsing cache value
305
+ * @param key
306
+ * @param filter
307
+ * @param keyMustContainAllScopes
308
+ * @returns
309
+ */
310
+ accessTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter, keyMustContainAllScopes: boolean): boolean;
311
+ /**
312
+ * Gets all access tokens matching the filter
313
+ * @param filter
314
+ * @returns
315
+ */
316
+ getAccessTokensByFilter(filter: CredentialFilter): AccessTokenEntity[];
317
+ /**
318
+ * Helper to retrieve the appropriate refresh token from cache
319
+ * @param account {AccountInfo}
320
+ * @param familyRT {boolean}
321
+ * @param tokenKeys {?TokenKeys}
322
+ * @param performanceClient {?IPerformanceClient}
323
+ * @param correlationId {?string}
324
+ */
325
+ getRefreshToken(account: AccountInfo, familyRT: boolean, tokenKeys?: TokenKeys, performanceClient?: IPerformanceClient, correlationId?: string): RefreshTokenEntity | null;
326
+ /**
327
+ * Validate the cache key against filter before retrieving and parsing cache value
328
+ * @param key
329
+ * @param filter
330
+ */
331
+ refreshTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter): boolean;
332
+ /**
333
+ * Retrieve AppMetadataEntity from cache
334
+ */
335
+ readAppMetadataFromCache(environment: string): AppMetadataEntity | null;
336
+ /**
337
+ * Return the family_id value associated with FOCI
338
+ * @param environment
339
+ * @param clientId
340
+ */
341
+ isAppMetadataFOCI(environment: string): boolean;
342
+ /**
343
+ * helper to match account ids
344
+ * @param value
345
+ * @param homeAccountId
346
+ */
347
+ private matchHomeAccountId;
348
+ /**
349
+ * helper to match account ids
350
+ * @param entity
351
+ * @param localAccountId
352
+ * @returns
353
+ */
354
+ private matchLocalAccountIdFromTokenClaims;
355
+ private matchLocalAccountIdFromTenantProfile;
356
+ /**
357
+ * helper to match names
358
+ * @param entity
359
+ * @param name
360
+ * @returns true if the downcased name properties are present and match in the filter and the entity
361
+ */
362
+ private matchName;
363
+ /**
364
+ * helper to match usernames
365
+ * @param entity
366
+ * @param username
367
+ * @returns
368
+ */
369
+ private matchUsername;
370
+ /**
371
+ * helper to match assertion
372
+ * @param value
373
+ * @param oboAssertion
374
+ */
375
+ private matchUserAssertionHash;
376
+ /**
377
+ * helper to match environment
378
+ * @param value
379
+ * @param environment
380
+ */
381
+ private matchEnvironment;
382
+ /**
383
+ * helper to match credential type
384
+ * @param entity
385
+ * @param credentialType
386
+ */
387
+ private matchCredentialType;
388
+ /**
389
+ * helper to match client ids
390
+ * @param entity
391
+ * @param clientId
392
+ */
393
+ private matchClientId;
394
+ /**
395
+ * helper to match family ids
396
+ * @param entity
397
+ * @param familyId
398
+ */
399
+ private matchFamilyId;
400
+ /**
401
+ * helper to match realm
402
+ * @param entity
403
+ * @param realm
404
+ */
405
+ private matchRealm;
406
+ /**
407
+ * helper to match nativeAccountId
408
+ * @param entity
409
+ * @param nativeAccountId
410
+ * @returns boolean indicating the match result
411
+ */
412
+ private matchNativeAccountId;
413
+ /**
414
+ * helper to match loginHint which can be either:
415
+ * 1. login_hint ID token claim
416
+ * 2. username in cached account object
417
+ * 3. upn in ID token claims
418
+ * @param entity
419
+ * @param loginHint
420
+ * @returns
421
+ */
422
+ private matchLoginHintFromTokenClaims;
423
+ /**
424
+ * Helper to match sid
425
+ * @param entity
426
+ * @param sid
427
+ * @returns true if the sid claim is present and matches the filter
428
+ */
429
+ private matchSid;
430
+ private matchAuthorityType;
431
+ /**
432
+ * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.
433
+ * @param entity
434
+ * @param target
435
+ */
436
+ private matchTarget;
437
+ /**
438
+ * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise
439
+ * @param entity
440
+ * @param tokenType
441
+ */
442
+ private matchTokenType;
443
+ /**
444
+ * Returns true if the credential's keyId matches the one in the request, false otherwise
445
+ * @param entity
446
+ * @param keyId
447
+ */
448
+ private matchKeyId;
449
+ /**
450
+ * returns if a given cache entity is of the type appmetadata
451
+ * @param key
452
+ */
453
+ private isAppMetadata;
454
+ /**
455
+ * returns if a given cache entity is of the type authoritymetadata
456
+ * @param key
457
+ */
458
+ protected isAuthorityMetadata(key: string): boolean;
459
+ /**
460
+ * returns cache key used for cloud instance metadata
461
+ */
462
+ generateAuthorityMetadataCacheKey(authority: string): string;
463
+ /**
464
+ * Helper to convert serialized data to object
465
+ * @param obj
466
+ * @param json
467
+ */
468
+ static toObject<T>(obj: T, json: object): T;
469
+ }
470
+ /** @internal */
471
+ export declare class DefaultStorageClass extends CacheManager {
472
+ setAccount(): void;
473
+ getAccount(): AccountEntity;
474
+ getCachedAccountEntity(): AccountEntity | null;
475
+ setIdTokenCredential(): void;
476
+ getIdTokenCredential(): IdTokenEntity;
477
+ setAccessTokenCredential(): void;
478
+ getAccessTokenCredential(): AccessTokenEntity;
479
+ setRefreshTokenCredential(): void;
480
+ getRefreshTokenCredential(): RefreshTokenEntity;
481
+ setAppMetadata(): void;
482
+ getAppMetadata(): AppMetadataEntity;
483
+ setServerTelemetry(): void;
484
+ getServerTelemetry(): ServerTelemetryEntity;
485
+ setAuthorityMetadata(): void;
486
+ getAuthorityMetadata(): AuthorityMetadataEntity | null;
487
+ getAuthorityMetadataKeys(): Array<string>;
488
+ setThrottlingCache(): void;
489
+ getThrottlingCache(): ThrottlingEntity;
490
+ removeItem(): boolean;
491
+ getKeys(): string[];
492
+ getAccountKeys(): string[];
493
+ getTokenKeys(): TokenKeys;
494
+ clear(): Promise<void>;
495
+ updateCredentialCacheKey(): string;
496
+ removeOutdatedAccount(): void;
497
+ }
498
+ //# sourceMappingURL=CacheManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheManager.d.ts","sourceRoot":"","sources":["../../../src/cache/CacheManager.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAYxD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAK7D,OAAO,EACH,WAAW,EAId,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAA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BAAkB,IAAI,IAAI;IAG1B,kBAAkB,IAAI,gBAAgB;IAGtC,UAAU,IAAI,OAAO;IAGrB,OAAO,IAAI,MAAM,EAAE;IAGnB,cAAc,IAAI,MAAM,EAAE;IAG1B,YAAY,IAAI,SAAS;IAGnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAG5B,wBAAwB,IAAI,MAAM;IAGlC,qBAAqB,IAAI,IAAI;CAGhC"}
@@ -0,0 +1,26 @@
1
+ import { CredentialEntity } from "./CredentialEntity.js";
2
+ import { AuthenticationScheme } from "../../utils/Constants.js";
3
+ /**
4
+ * Access token cache type
5
+ */
6
+ export type AccessTokenEntity = CredentialEntity & {
7
+ /** Full tenant or organizational identifier that the account belongs to */
8
+ realm: string;
9
+ /** Permissions that are included in the token, or for refresh tokens, the resource identifier. */
10
+ target: string;
11
+ /** Absolute device time when entry was created in the cache. */
12
+ cachedAt: string;
13
+ /** Token expiry time, calculated based on current UTC time in seconds. Represented as a string. */
14
+ expiresOn: string;
15
+ /** Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds. */
16
+ extendedExpiresOn?: string;
17
+ /** Used for proactive refresh */
18
+ refreshOn?: string;
19
+ /** Matches the authentication scheme for which the token was issued (i.e. Bearer or pop) */
20
+ tokenType?: AuthenticationScheme;
21
+ /** Stringified claims object */
22
+ requestedClaims?: string;
23
+ /** Matches the SHA 256 hash of the claims object included in the token request */
24
+ requestedClaimsHash?: string;
25
+ };
26
+ //# sourceMappingURL=AccessTokenEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessTokenEntity.d.ts","sourceRoot":"","sources":["../../../../src/cache/entities/AccessTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IAC/C,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;IAClB,qIAAqI;IACrI,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { Authority } from "../../authority/Authority.js";
2
+ import { ICrypto } from "../../crypto/ICrypto.js";
3
+ import { AccountInfo, TenantProfile } from "../../account/AccountInfo.js";
4
+ import { AuthorityType } from "../../authority/AuthorityType.js";
5
+ import { Logger } from "../../logger/Logger.js";
6
+ import { TokenClaims } from "../../account/TokenClaims.js";
7
+ /**
8
+ * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).
9
+ *
10
+ * Key : Value Schema
11
+ *
12
+ * Key: <home_account_id>-<environment>-<realm*>
13
+ *
14
+ * Value Schema:
15
+ * {
16
+ * homeAccountId: home account identifier for the auth scheme,
17
+ * environment: entity that issued the token, represented as a full host
18
+ * realm: Full tenant or organizational identifier that the account belongs to
19
+ * localAccountId: Original tenant-specific accountID, usually used for legacy cases
20
+ * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
21
+ * authorityType: Accounts authority type as a string
22
+ * name: Full name for the account, including given name and family name,
23
+ * lastModificationTime: last time this entity was modified in the cache
24
+ * lastModificationApp:
25
+ * nativeAccountId: Account identifier on the native device
26
+ * tenantProfiles: Array of tenant profile objects for each tenant that the account has authenticated with in the browser
27
+ * }
28
+ * @internal
29
+ */
30
+ export declare class AccountEntity {
31
+ homeAccountId: string;
32
+ environment: string;
33
+ realm: string;
34
+ localAccountId: string;
35
+ username: string;
36
+ authorityType: string;
37
+ clientInfo?: string;
38
+ name?: string;
39
+ lastModificationTime?: string;
40
+ lastModificationApp?: string;
41
+ cloudGraphHostName?: string;
42
+ msGraphHost?: string;
43
+ nativeAccountId?: string;
44
+ tenantProfiles?: Array<TenantProfile>;
45
+ /**
46
+ * Generate Account Id key component as per the schema: <home_account_id>-<environment>
47
+ */
48
+ generateAccountId(): string;
49
+ /**
50
+ * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>
51
+ */
52
+ generateAccountKey(): string;
53
+ /**
54
+ * Returns the AccountInfo interface for this account.
55
+ */
56
+ getAccountInfo(): AccountInfo;
57
+ /**
58
+ * Returns true if the account entity is in single tenant format (outdated), false otherwise
59
+ */
60
+ isSingleTenant(): boolean;
61
+ /**
62
+ * Generates account key from interface
63
+ * @param accountInterface
64
+ */
65
+ static generateAccountCacheKey(accountInterface: AccountInfo): string;
66
+ /**
67
+ * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.
68
+ * @param accountDetails
69
+ */
70
+ static createAccount(accountDetails: {
71
+ homeAccountId: string;
72
+ idTokenClaims?: TokenClaims;
73
+ clientInfo?: string;
74
+ cloudGraphHostName?: string;
75
+ msGraphHost?: string;
76
+ environment?: string;
77
+ nativeAccountId?: string;
78
+ tenantProfiles?: Array<TenantProfile>;
79
+ }, authority: Authority, base64Decode?: (input: string) => string): AccountEntity;
80
+ /**
81
+ * Creates an AccountEntity object from AccountInfo
82
+ * @param accountInfo
83
+ * @param cloudGraphHostName
84
+ * @param msGraphHost
85
+ * @returns
86
+ */
87
+ static createFromAccountInfo(accountInfo: AccountInfo, cloudGraphHostName?: string, msGraphHost?: string): AccountEntity;
88
+ /**
89
+ * Generate HomeAccountId from server response
90
+ * @param serverClientInfo
91
+ * @param authType
92
+ */
93
+ static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idTokenClaims?: TokenClaims): string;
94
+ /**
95
+ * Validates an entity: checks for all expected params
96
+ * @param entity
97
+ */
98
+ static isAccountEntity(entity: object): boolean;
99
+ /**
100
+ * Helper function to determine whether 2 accountInfo objects represent the same account
101
+ * @param accountA
102
+ * @param accountB
103
+ * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
104
+ */
105
+ static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean;
106
+ }
107
+ //# sourceMappingURL=AccountEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountEntity.d.ts","sourceRoot":"","sources":["../../../../src/cache/entities/AccountEntity.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EACH,WAAW,EACX,aAAa,EAEhB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACH,WAAW,EAEd,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,e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rB,QAAQ,EAAE,WAAW,GAAG,IAAI,EAC5B,QAAQ,EAAE,WAAW,GAAG,IAAI,EAC5B,aAAa,CAAC,EAAE,OAAO,GACxB,OAAO;CA4Bb"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * App Metadata Cache Type
3
+ */
4
+ export type AppMetadataEntity = {
5
+ /** clientId of the application */
6
+ clientId: string;
7
+ /** entity that issued the token, represented as a full host */
8
+ environment: string;
9
+ /** Family identifier, '1' represents Microsoft Family */
10
+ familyId?: string;
11
+ };
12
+ //# sourceMappingURL=AppMetadataEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppMetadataEntity.d.ts","sourceRoot":"","sources":["../../../../src/cache/entities/AppMetadataEntity.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}