daftari 3.13.0 → 3.14.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 (267) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/distill/propose.d.ts +10 -0
  3. package/dist/distill/propose.d.ts.map +1 -1
  4. package/dist/distill/propose.js +49 -10
  5. package/dist/distill/propose.js.map +1 -1
  6. package/dist/distill/state.d.ts +6 -0
  7. package/dist/distill/state.d.ts.map +1 -1
  8. package/dist/distill/state.js +1 -1
  9. package/dist/distill/state.js.map +1 -1
  10. package/dist/extract/index.d.ts +16 -0
  11. package/dist/extract/index.d.ts.map +1 -0
  12. package/dist/extract/index.js +95 -0
  13. package/dist/extract/index.js.map +1 -0
  14. package/dist/extract/normalize.d.ts +7 -0
  15. package/dist/extract/normalize.d.ts.map +1 -0
  16. package/dist/extract/normalize.js +52 -0
  17. package/dist/extract/normalize.js.map +1 -0
  18. package/dist/extract/office.d.ts +63 -0
  19. package/dist/extract/office.d.ts.map +1 -0
  20. package/dist/extract/office.js +763 -0
  21. package/dist/extract/office.js.map +1 -0
  22. package/dist/extract/pdf.d.ts +16 -0
  23. package/dist/extract/pdf.d.ts.map +1 -0
  24. package/dist/extract/pdf.js +196 -0
  25. package/dist/extract/pdf.js.map +1 -0
  26. package/dist/extract/types.d.ts +55 -0
  27. package/dist/extract/types.d.ts.map +1 -0
  28. package/dist/extract/types.js +47 -0
  29. package/dist/extract/types.js.map +1 -0
  30. package/dist/extract/worker.d.ts +2 -0
  31. package/dist/extract/worker.d.ts.map +1 -0
  32. package/dist/extract/worker.js +57 -0
  33. package/dist/extract/worker.js.map +1 -0
  34. package/dist/integrations/distill.d.ts.map +1 -1
  35. package/dist/integrations/distill.js +1 -0
  36. package/dist/integrations/distill.js.map +1 -1
  37. package/dist/integrations/engine.d.ts +208 -2
  38. package/dist/integrations/engine.d.ts.map +1 -1
  39. package/dist/integrations/engine.js +360 -30
  40. package/dist/integrations/engine.js.map +1 -1
  41. package/dist/integrations/google.d.ts +2 -1
  42. package/dist/integrations/google.d.ts.map +1 -1
  43. package/dist/integrations/google.js +13 -117
  44. package/dist/integrations/google.js.map +1 -1
  45. package/dist/integrations/http-json.d.ts +27 -0
  46. package/dist/integrations/http-json.d.ts.map +1 -0
  47. package/dist/integrations/http-json.js +148 -0
  48. package/dist/integrations/http-json.js.map +1 -0
  49. package/dist/integrations/microsoft.d.ts +22 -0
  50. package/dist/integrations/microsoft.d.ts.map +1 -0
  51. package/dist/integrations/microsoft.js +1780 -0
  52. package/dist/integrations/microsoft.js.map +1 -0
  53. package/dist/integrations/microsoft.ui.d.ts +18 -0
  54. package/dist/integrations/microsoft.ui.d.ts.map +1 -0
  55. package/dist/integrations/microsoft.ui.js +131 -0
  56. package/dist/integrations/microsoft.ui.js.map +1 -0
  57. package/dist/integrations/oauth.d.ts.map +1 -1
  58. package/dist/integrations/oauth.js +10 -2
  59. package/dist/integrations/oauth.js.map +1 -1
  60. package/dist/integrations/queue.d.ts +1 -1
  61. package/dist/integrations/queue.d.ts.map +1 -1
  62. package/dist/integrations/queue.js +23 -1
  63. package/dist/integrations/queue.js.map +1 -1
  64. package/dist/integrations/routes.d.ts +26 -0
  65. package/dist/integrations/routes.d.ts.map +1 -1
  66. package/dist/integrations/routes.js +525 -11
  67. package/dist/integrations/routes.js.map +1 -1
  68. package/dist/integrations/runtime.d.ts +14 -2
  69. package/dist/integrations/runtime.d.ts.map +1 -1
  70. package/dist/integrations/runtime.js +51 -11
  71. package/dist/integrations/runtime.js.map +1 -1
  72. package/dist/integrations/state.d.ts +1 -1
  73. package/dist/integrations/state.d.ts.map +1 -1
  74. package/dist/integrations/state.js +74 -5
  75. package/dist/integrations/state.js.map +1 -1
  76. package/dist/integrations/types.d.ts +84 -1
  77. package/dist/integrations/types.d.ts.map +1 -1
  78. package/dist/integrations/types.js +21 -1
  79. package/dist/integrations/types.js.map +1 -1
  80. package/dist/okf/import.d.ts.map +1 -1
  81. package/dist/okf/import.js +208 -65
  82. package/dist/okf/import.js.map +1 -1
  83. package/dist/okf/index.d.ts.map +1 -1
  84. package/dist/okf/index.js +5 -0
  85. package/dist/okf/index.js.map +1 -1
  86. package/dist/okf/map.d.ts.map +1 -1
  87. package/dist/okf/map.js +3 -2
  88. package/dist/okf/map.js.map +1 -1
  89. package/dist/search/watcher.d.ts.map +1 -1
  90. package/dist/search/watcher.js +3 -22
  91. package/dist/search/watcher.js.map +1 -1
  92. package/dist/serve/index.d.ts.map +1 -1
  93. package/dist/serve/index.js +7 -0
  94. package/dist/serve/index.js.map +1 -1
  95. package/dist/sleep/index.js +2 -2
  96. package/dist/sleep/report.js +1 -1
  97. package/dist/sleep/report.js.map +1 -1
  98. package/dist/sleep/tension-scan.d.ts.map +1 -1
  99. package/dist/sleep/tension-scan.js +0 -0
  100. package/dist/sleep/tension-scan.js.map +1 -1
  101. package/dist/storage/local.d.ts +1 -0
  102. package/dist/storage/local.d.ts.map +1 -1
  103. package/dist/storage/local.js +8 -1
  104. package/dist/storage/local.js.map +1 -1
  105. package/dist/utils/config.d.ts +8 -1
  106. package/dist/utils/config.d.ts.map +1 -1
  107. package/dist/utils/config.js +143 -18
  108. package/dist/utils/config.js.map +1 -1
  109. package/dist/view/pages.d.ts.map +1 -1
  110. package/dist/view/pages.js +11 -0
  111. package/dist/view/pages.js.map +1 -1
  112. package/dist/view/render.d.ts.map +1 -1
  113. package/dist/view/render.js +37 -2
  114. package/dist/view/render.js.map +1 -1
  115. package/package.json +11 -4
  116. package/src/integrations/microsoft/assets/VENDORING.md +109 -0
  117. package/src/integrations/microsoft/assets/glue.js +244 -0
  118. package/src/integrations/microsoft/assets/picker-serializer.js +99 -0
  119. package/src/integrations/microsoft/assets/vendor/msal-browser/app/IPublicClientApplication.mjs +91 -0
  120. package/src/integrations/microsoft/assets/vendor/msal-browser/app/PublicClientApplication.mjs +355 -0
  121. package/src/integrations/microsoft/assets/vendor/msal-browser/broker/nativeBroker/NativeStatusCodes.mjs +15 -0
  122. package/src/integrations/microsoft/assets/vendor/msal-browser/broker/nativeBroker/PlatformAuthDOMHandler.mjs +153 -0
  123. package/src/integrations/microsoft/assets/vendor/msal-browser/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +271 -0
  124. package/src/integrations/microsoft/assets/vendor/msal-browser/broker/nativeBroker/PlatformAuthProvider.mjs +95 -0
  125. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/AccountManager.mjs +49 -0
  126. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/AsyncMemoryStorage.mjs +144 -0
  127. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/BrowserCacheManager.mjs +1465 -0
  128. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/CacheHelpers.mjs +45 -0
  129. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/CacheKeys.mjs +32 -0
  130. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/CookieStorage.mjs +94 -0
  131. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/DatabaseStorage.mjs +208 -0
  132. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/EncryptedData.mjs +13 -0
  133. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/LocalStorage.mjs +319 -0
  134. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/MemoryStorage.mjs +48 -0
  135. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/SessionStorage.mjs +46 -0
  136. package/src/integrations/microsoft/assets/vendor/msal-browser/cache/TokenCache.mjs +220 -0
  137. package/src/integrations/microsoft/assets/vendor/msal-browser/config/Configuration.mjs +138 -0
  138. package/src/integrations/microsoft/assets/vendor/msal-browser/controllers/NestedAppAuthController.mjs +483 -0
  139. package/src/integrations/microsoft/assets/vendor/msal-browser/controllers/StandardController.mjs +1532 -0
  140. package/src/integrations/microsoft/assets/vendor/msal-browser/crypto/BrowserCrypto.mjs +354 -0
  141. package/src/integrations/microsoft/assets/vendor/msal-browser/crypto/CryptoOps.mjs +146 -0
  142. package/src/integrations/microsoft/assets/vendor/msal-browser/crypto/PkceGenerator.mjs +63 -0
  143. package/src/integrations/microsoft/assets/vendor/msal-browser/crypto/SignedHttpRequest.mjs +50 -0
  144. package/src/integrations/microsoft/assets/vendor/msal-browser/crypto/TokenBindingKeyManager.mjs +156 -0
  145. package/src/integrations/microsoft/assets/vendor/msal-browser/encode/Base64Decode.mjs +43 -0
  146. package/src/integrations/microsoft/assets/vendor/msal-browser/encode/Base64Encode.mjs +47 -0
  147. package/src/integrations/microsoft/assets/vendor/msal-browser/error/BrowserAuthError.mjs +26 -0
  148. package/src/integrations/microsoft/assets/vendor/msal-browser/error/BrowserAuthErrorCodes.mjs +65 -0
  149. package/src/integrations/microsoft/assets/vendor/msal-browser/error/BrowserConfigurationAuthError.mjs +24 -0
  150. package/src/integrations/microsoft/assets/vendor/msal-browser/error/BrowserConfigurationAuthErrorCodes.mjs +11 -0
  151. package/src/integrations/microsoft/assets/vendor/msal-browser/error/NativeAuthError.mjs +79 -0
  152. package/src/integrations/microsoft/assets/vendor/msal-browser/error/NativeAuthErrorCodes.mjs +12 -0
  153. package/src/integrations/microsoft/assets/vendor/msal-browser/error/NestedAppAuthError.mjs +25 -0
  154. package/src/integrations/microsoft/assets/vendor/msal-browser/event/EventHandler.mjs +110 -0
  155. package/src/integrations/microsoft/assets/vendor/msal-browser/event/EventMessage.mjs +60 -0
  156. package/src/integrations/microsoft/assets/vendor/msal-browser/event/EventType.mjs +30 -0
  157. package/src/integrations/microsoft/assets/vendor/msal-browser/index.mjs +48 -0
  158. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/BaseInteractionClient.mjs +150 -0
  159. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/HybridSpaAuthorizationCodeClient.mjs +16 -0
  160. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/PlatformAuthInteractionClient.mjs +734 -0
  161. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/PopupClient.mjs +528 -0
  162. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/RedirectClient.mjs +464 -0
  163. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/SilentAuthCodeClient.mjs +85 -0
  164. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/SilentCacheClient.mjs +58 -0
  165. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/SilentIframeClient.mjs +255 -0
  166. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/SilentRefreshClient.mjs +77 -0
  167. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_client/StandardInteractionClient.mjs +217 -0
  168. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_handler/InteractionHandler.mjs +95 -0
  169. package/src/integrations/microsoft/assets/vendor/msal-browser/interaction_handler/SilentHandler.mjs +71 -0
  170. package/src/integrations/microsoft/assets/vendor/msal-browser/naa/BridgeError.mjs +11 -0
  171. package/src/integrations/microsoft/assets/vendor/msal-browser/naa/BridgeProxy.mjs +152 -0
  172. package/src/integrations/microsoft/assets/vendor/msal-browser/naa/BridgeStatusCode.mjs +18 -0
  173. package/src/integrations/microsoft/assets/vendor/msal-browser/naa/mapping/NestedAppAuthAdapter.mjs +239 -0
  174. package/src/integrations/microsoft/assets/vendor/msal-browser/navigation/NavigationClient.mjs +47 -0
  175. package/src/integrations/microsoft/assets/vendor/msal-browser/network/FetchClient.mjs +153 -0
  176. package/src/integrations/microsoft/assets/vendor/msal-browser/operatingcontext/BaseOperatingContext.mjs +112 -0
  177. package/src/integrations/microsoft/assets/vendor/msal-browser/operatingcontext/NestedAppOperatingContext.mjs +79 -0
  178. package/src/integrations/microsoft/assets/vendor/msal-browser/operatingcontext/StandardOperatingContext.mjs +50 -0
  179. package/src/integrations/microsoft/assets/vendor/msal-browser/packageMetadata.mjs +7 -0
  180. package/src/integrations/microsoft/assets/vendor/msal-browser/popup_relay/constants.mjs +20 -0
  181. package/src/integrations/microsoft/assets/vendor/msal-browser/popup_relay/relayClient.mjs +113 -0
  182. package/src/integrations/microsoft/assets/vendor/msal-browser/protocol/Authorize.mjs +326 -0
  183. package/src/integrations/microsoft/assets/vendor/msal-browser/request/RequestHelpers.mjs +143 -0
  184. package/src/integrations/microsoft/assets/vendor/msal-browser/response/ResponseHandler.mjs +45 -0
  185. package/src/integrations/microsoft/assets/vendor/msal-browser/telemetry/BrowserPerformanceClient.mjs +126 -0
  186. package/src/integrations/microsoft/assets/vendor/msal-browser/telemetry/BrowserPerformanceEvents.mjs +133 -0
  187. package/src/integrations/microsoft/assets/vendor/msal-browser/telemetry/BrowserPerformanceMeasurement.mjs +96 -0
  188. package/src/integrations/microsoft/assets/vendor/msal-browser/telemetry/BrowserRootPerformanceEvents.mjs +53 -0
  189. package/src/integrations/microsoft/assets/vendor/msal-browser/utils/BrowserConstants.mjs +220 -0
  190. package/src/integrations/microsoft/assets/vendor/msal-browser/utils/BrowserProtocolUtils.mjs +27 -0
  191. package/src/integrations/microsoft/assets/vendor/msal-browser/utils/BrowserUtils.mjs +364 -0
  192. package/src/integrations/microsoft/assets/vendor/msal-browser/utils/Helpers.mjs +19 -0
  193. package/src/integrations/microsoft/assets/vendor/msal-browser/utils/MsalFrameStatsUtils.mjs +38 -0
  194. package/src/integrations/microsoft/assets/vendor/msal-browser/webBrokerBridge/PendingRequestRegistry.mjs +63 -0
  195. package/src/integrations/microsoft/assets/vendor/msal-browser/webBrokerBridge/WebBrokerBridgeError.mjs +38 -0
  196. package/src/integrations/microsoft/assets/vendor/msal-browser/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +57 -0
  197. package/src/integrations/microsoft/assets/vendor/msal-common/account/AccountInfo.mjs +91 -0
  198. package/src/integrations/microsoft/assets/vendor/msal-common/account/AuthToken.mjs +70 -0
  199. package/src/integrations/microsoft/assets/vendor/msal-common/account/CcsCredential.mjs +12 -0
  200. package/src/integrations/microsoft/assets/vendor/msal-common/account/ClientInfo.mjs +43 -0
  201. package/src/integrations/microsoft/assets/vendor/msal-common/account/TokenClaims.mjs +24 -0
  202. package/src/integrations/microsoft/assets/vendor/msal-common/authority/Authority.mjs +988 -0
  203. package/src/integrations/microsoft/assets/vendor/msal-common/authority/AuthorityFactory.mjs +41 -0
  204. package/src/integrations/microsoft/assets/vendor/msal-common/authority/AuthorityMetadata.mjs +158 -0
  205. package/src/integrations/microsoft/assets/vendor/msal-common/authority/AuthorityOptions.mjs +20 -0
  206. package/src/integrations/microsoft/assets/vendor/msal-common/authority/AuthorityType.mjs +16 -0
  207. package/src/integrations/microsoft/assets/vendor/msal-common/authority/CloudInstanceDiscoveryErrorResponse.mjs +12 -0
  208. package/src/integrations/microsoft/assets/vendor/msal-common/authority/CloudInstanceDiscoveryResponse.mjs +12 -0
  209. package/src/integrations/microsoft/assets/vendor/msal-common/authority/OpenIdConfigResponse.mjs +14 -0
  210. package/src/integrations/microsoft/assets/vendor/msal-common/authority/ProtocolMode.mjs +26 -0
  211. package/src/integrations/microsoft/assets/vendor/msal-common/authority/RegionDiscovery.mjs +116 -0
  212. package/src/integrations/microsoft/assets/vendor/msal-common/cache/CacheManager.mjs +1202 -0
  213. package/src/integrations/microsoft/assets/vendor/msal-common/cache/persistence/TokenCacheContext.mjs +29 -0
  214. package/src/integrations/microsoft/assets/vendor/msal-common/cache/utils/AccountEntityUtils.mjs +222 -0
  215. package/src/integrations/microsoft/assets/vendor/msal-common/cache/utils/CacheHelpers.mjs +294 -0
  216. package/src/integrations/microsoft/assets/vendor/msal-common/client/AuthorizationCodeClient.mjs +289 -0
  217. package/src/integrations/microsoft/assets/vendor/msal-common/client/RefreshTokenClient.mjs +262 -0
  218. package/src/integrations/microsoft/assets/vendor/msal-common/client/SilentFlowClient.mjs +142 -0
  219. package/src/integrations/microsoft/assets/vendor/msal-common/config/ClientConfiguration.mjs +111 -0
  220. package/src/integrations/microsoft/assets/vendor/msal-common/constants/AADServerParamKeys.mjs +74 -0
  221. package/src/integrations/microsoft/assets/vendor/msal-common/crypto/DpopProofGenerator.mjs +152 -0
  222. package/src/integrations/microsoft/assets/vendor/msal-common/crypto/ICrypto.mjs +52 -0
  223. package/src/integrations/microsoft/assets/vendor/msal-common/crypto/ITokenBindingKeyManager.mjs +27 -0
  224. package/src/integrations/microsoft/assets/vendor/msal-common/crypto/JoseHeader.mjs +72 -0
  225. package/src/integrations/microsoft/assets/vendor/msal-common/crypto/PopTokenGenerator.mjs +109 -0
  226. package/src/integrations/microsoft/assets/vendor/msal-common/error/AuthError.mjs +31 -0
  227. package/src/integrations/microsoft/assets/vendor/msal-common/error/AuthErrorCodes.mjs +13 -0
  228. package/src/integrations/microsoft/assets/vendor/msal-common/error/CacheError.mjs +44 -0
  229. package/src/integrations/microsoft/assets/vendor/msal-common/error/CacheErrorCodes.mjs +10 -0
  230. package/src/integrations/microsoft/assets/vendor/msal-common/error/ClientAuthError.mjs +26 -0
  231. package/src/integrations/microsoft/assets/vendor/msal-common/error/ClientAuthErrorCodes.mjs +46 -0
  232. package/src/integrations/microsoft/assets/vendor/msal-common/error/ClientConfigurationError.mjs +23 -0
  233. package/src/integrations/microsoft/assets/vendor/msal-common/error/ClientConfigurationErrorCodes.mjs +38 -0
  234. package/src/integrations/microsoft/assets/vendor/msal-common/error/InteractionRequiredAuthError.mjs +73 -0
  235. package/src/integrations/microsoft/assets/vendor/msal-common/error/InteractionRequiredAuthErrorCodes.mjs +53 -0
  236. package/src/integrations/microsoft/assets/vendor/msal-common/error/JoseHeaderError.mjs +24 -0
  237. package/src/integrations/microsoft/assets/vendor/msal-common/error/JoseHeaderErrorCodes.mjs +12 -0
  238. package/src/integrations/microsoft/assets/vendor/msal-common/error/NetworkError.mjs +34 -0
  239. package/src/integrations/microsoft/assets/vendor/msal-common/error/PlatformBrokerError.mjs +48 -0
  240. package/src/integrations/microsoft/assets/vendor/msal-common/error/ServerError.mjs +22 -0
  241. package/src/integrations/microsoft/assets/vendor/msal-common/index-browser.mjs +79 -0
  242. package/src/integrations/microsoft/assets/vendor/msal-common/logger/Logger.mjs +291 -0
  243. package/src/integrations/microsoft/assets/vendor/msal-common/network/INetworkModule.mjs +20 -0
  244. package/src/integrations/microsoft/assets/vendor/msal-common/network/RequestThumbprint.mjs +27 -0
  245. package/src/integrations/microsoft/assets/vendor/msal-common/network/ThrottlingUtils.mjs +91 -0
  246. package/src/integrations/microsoft/assets/vendor/msal-common/packageMetadata.mjs +7 -0
  247. package/src/integrations/microsoft/assets/vendor/msal-common/protocol/Authorize.mjs +239 -0
  248. package/src/integrations/microsoft/assets/vendor/msal-common/protocol/Token.mjs +148 -0
  249. package/src/integrations/microsoft/assets/vendor/msal-common/request/AuthenticationHeaderParser.mjs +63 -0
  250. package/src/integrations/microsoft/assets/vendor/msal-common/request/BaseAuthRequest.mjs +37 -0
  251. package/src/integrations/microsoft/assets/vendor/msal-common/request/RequestParameterBuilder.mjs +529 -0
  252. package/src/integrations/microsoft/assets/vendor/msal-common/request/ScopeSet.mjs +204 -0
  253. package/src/integrations/microsoft/assets/vendor/msal-common/response/ResponseHandler.mjs +432 -0
  254. package/src/integrations/microsoft/assets/vendor/msal-common/telemetry/performance/PerformanceClient.mjs +557 -0
  255. package/src/integrations/microsoft/assets/vendor/msal-common/telemetry/performance/PerformanceEvent.mjs +68 -0
  256. package/src/integrations/microsoft/assets/vendor/msal-common/telemetry/performance/PerformanceEvents.mjs +73 -0
  257. package/src/integrations/microsoft/assets/vendor/msal-common/telemetry/performance/StubPerformanceClient.mjs +61 -0
  258. package/src/integrations/microsoft/assets/vendor/msal-common/telemetry/server/ServerTelemetryManager.mjs +297 -0
  259. package/src/integrations/microsoft/assets/vendor/msal-common/url/UrlString.mjs +164 -0
  260. package/src/integrations/microsoft/assets/vendor/msal-common/utils/ClientAssertionUtils.mjs +21 -0
  261. package/src/integrations/microsoft/assets/vendor/msal-common/utils/Constants.mjs +304 -0
  262. package/src/integrations/microsoft/assets/vendor/msal-common/utils/FunctionWrappers.mjs +95 -0
  263. package/src/integrations/microsoft/assets/vendor/msal-common/utils/ObjectUtils.mjs +27 -0
  264. package/src/integrations/microsoft/assets/vendor/msal-common/utils/ProtocolUtils.mjs +76 -0
  265. package/src/integrations/microsoft/assets/vendor/msal-common/utils/StringUtils.mjs +82 -0
  266. package/src/integrations/microsoft/assets/vendor/msal-common/utils/TimeUtils.mjs +75 -0
  267. package/src/integrations/microsoft/assets/vendor/msal-common/utils/UrlUtils.mjs +128 -0
@@ -0,0 +1,91 @@
1
+ /*! @azure/msal-browser v5.20.0 2026-08-28 */
2
+ 'use strict';
3
+ import { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';
4
+ import { stubbedPublicClientApplicationCalled } from '../error/BrowserConfigurationAuthErrorCodes.mjs';
5
+
6
+ /*
7
+ * Copyright (c) Microsoft Corporation. All rights reserved.
8
+ * Licensed under the MIT License.
9
+ */
10
+ const stubbedPublicClientApplication = {
11
+ initialize: () => {
12
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
13
+ },
14
+ acquireTokenPopup: () => {
15
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
16
+ },
17
+ acquireTokenRedirect: () => {
18
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
19
+ },
20
+ acquireTokenSilent: () => {
21
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
22
+ },
23
+ acquireTokenByCode: () => {
24
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
25
+ },
26
+ getAllAccounts: () => {
27
+ return [];
28
+ },
29
+ getAccount: () => {
30
+ return null;
31
+ },
32
+ handleRedirectPromise: () => {
33
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
34
+ },
35
+ loginPopup: () => {
36
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
37
+ },
38
+ loginRedirect: () => {
39
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
40
+ },
41
+ logoutRedirect: () => {
42
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
43
+ },
44
+ logoutPopup: () => {
45
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
46
+ },
47
+ ssoSilent: () => {
48
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
49
+ },
50
+ addEventCallback: () => {
51
+ return null;
52
+ },
53
+ removeEventCallback: () => {
54
+ return;
55
+ },
56
+ addPerformanceCallback: () => {
57
+ return "";
58
+ },
59
+ removePerformanceCallback: () => {
60
+ return false;
61
+ },
62
+ getLogger: () => {
63
+ throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, "");
64
+ },
65
+ setLogger: () => {
66
+ return;
67
+ },
68
+ setActiveAccount: () => {
69
+ return;
70
+ },
71
+ getActiveAccount: () => {
72
+ return null;
73
+ },
74
+ initializeWrapperLibrary: () => {
75
+ return;
76
+ },
77
+ setNavigationClient: () => {
78
+ return;
79
+ },
80
+ getConfiguration: () => {
81
+ throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, "");
82
+ },
83
+ hydrateCache: () => {
84
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
85
+ },
86
+ clearCache: () => {
87
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
88
+ },
89
+ };
90
+
91
+ export { stubbedPublicClientApplication };
@@ -0,0 +1,355 @@
1
+ /*! @azure/msal-browser v5.20.0 2026-08-28 */
2
+ 'use strict';
3
+ import { StandardController } from '../controllers/StandardController.mjs';
4
+ import { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';
5
+ import { NestedAppAuthController } from '../controllers/NestedAppAuthController.mjs';
6
+ import { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';
7
+ import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
8
+ import { waitForBridgeResponse } from '../utils/BrowserUtils.mjs';
9
+
10
+ /*
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License.
13
+ */
14
+ /**
15
+ * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications
16
+ * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.
17
+ */
18
+ class PublicClientApplication {
19
+ /**
20
+ * @constructor
21
+ * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
22
+ *
23
+ * Important attributes in the Configuration object for auth are:
24
+ * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
25
+ * - authority: the authority URL for your application.
26
+ * - redirect_uri: the uri of your application registered in the portal.
27
+ *
28
+ * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
29
+ * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
30
+ * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
31
+ * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
32
+ * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
33
+ * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
34
+ *
35
+ * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
36
+ * Full B2C functionality will be available in this library in future versions.
37
+ *
38
+ * @param configuration Object for the MSAL PublicClientApplication instance
39
+ * @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
40
+ */
41
+ constructor(configuration, controller) {
42
+ this.controller =
43
+ controller ||
44
+ new StandardController(new StandardOperatingContext(configuration, {
45
+ waitForPopupResponse: this.waitForPopupResponse.bind(this),
46
+ waitForIframeResponse: this.waitForIframeResponse.bind(this),
47
+ }));
48
+ }
49
+ /**
50
+ * Waits for the auth response from a popup window opened by MSAL.
51
+ *
52
+ * The default implementation delegates to MSAL's `BroadcastChannel`-based bridge.
53
+ * Subclasses must return the raw response string (hash/query/fragment), or reject
54
+ * with an `AuthError` on failure.
55
+ *
56
+ * @internal
57
+ * @param request The in-flight authorization or end-session request.
58
+ * @param popupWindow The popup window opened by MSAL.
59
+ * @param popupWindowParent The parent window that opened the popup.
60
+ */
61
+ async waitForPopupResponse(request,
62
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
63
+ popupWindow,
64
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
65
+ popupWindowParent) {
66
+ const controller = this.controller;
67
+ return waitForBridgeResponse(controller.getConfiguration().system.popupBridgeTimeout, controller.getLogger(), request, controller.getPerformanceClient());
68
+ }
69
+ /**
70
+ * Waits for the auth response from a hidden iframe used by MSAL silent flows.
71
+ *
72
+ * The default implementation delegates to MSAL's `BroadcastChannel`-based bridge.
73
+ * Subclasses must return the raw response string (hash/query/fragment), or reject
74
+ * with an `AuthError` on failure.
75
+ *
76
+ * @internal
77
+ * @param iframe The hidden iframe MSAL attached to the document.
78
+ * @param request The in-flight authorization request.
79
+ */
80
+ async waitForIframeResponse(
81
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
82
+ iframe, request) {
83
+ const controller = this.controller;
84
+ const config = controller.getConfiguration();
85
+ return waitForBridgeResponse(config.system.iframeBridgeTimeout, controller.getLogger(), request, controller.getPerformanceClient(), config.experimental);
86
+ }
87
+ /**
88
+ * Initializer function to perform async startup tasks such as connecting to WAM extension
89
+ * @param request {?InitializeApplicationRequest}
90
+ */
91
+ async initialize(request) {
92
+ return this.controller.initialize(request);
93
+ }
94
+ /**
95
+ * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
96
+ *
97
+ * @param request
98
+ *
99
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
100
+ */
101
+ async acquireTokenPopup(request) {
102
+ return this.controller.acquireTokenPopup(request);
103
+ }
104
+ /**
105
+ * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
106
+ * the page, so any code that follows this function will not execute.
107
+ *
108
+ * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
109
+ * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
110
+ *
111
+ * @param request
112
+ */
113
+ acquireTokenRedirect(request) {
114
+ return this.controller.acquireTokenRedirect(request);
115
+ }
116
+ /**
117
+ * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
118
+ *
119
+ * @param {@link (SilentRequest:type)}
120
+ * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
121
+ */
122
+ acquireTokenSilent(silentRequest) {
123
+ return this.controller.acquireTokenSilent(silentRequest);
124
+ }
125
+ /**
126
+ * This function redeems an authorization code (passed as code) from the eSTS token endpoint.
127
+ * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
128
+ * This API is not indended for normal authorization code acquisition and redemption.
129
+ *
130
+ * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
131
+ *
132
+ * @param request {@link AuthorizationCodeRequest}
133
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
134
+ */
135
+ acquireTokenByCode(request) {
136
+ return this.controller.acquireTokenByCode(request);
137
+ }
138
+ /**
139
+ * Adds event callbacks to array
140
+ * @param callback
141
+ * @param eventTypes
142
+ */
143
+ addEventCallback(callback, eventTypes) {
144
+ return this.controller.addEventCallback(callback, eventTypes);
145
+ }
146
+ /**
147
+ * Removes callback with provided id from callback array
148
+ * @param callbackId
149
+ */
150
+ removeEventCallback(callbackId) {
151
+ return this.controller.removeEventCallback(callbackId);
152
+ }
153
+ /**
154
+ * Registers a callback to receive performance events.
155
+ *
156
+ * @param {PerformanceCallbackFunction} callback
157
+ * @returns {string}
158
+ */
159
+ addPerformanceCallback(callback) {
160
+ return this.controller.addPerformanceCallback(callback);
161
+ }
162
+ /**
163
+ * Removes a callback registered with addPerformanceCallback.
164
+ *
165
+ * @param {string} callbackId
166
+ * @returns {boolean}
167
+ */
168
+ removePerformanceCallback(callbackId) {
169
+ return this.controller.removePerformanceCallback(callbackId);
170
+ }
171
+ /**
172
+ * Returns the first account found in the cache that matches the account filter passed in.
173
+ * @param accountFilter
174
+ * @returns The first account found in the cache matching the provided filter or null if no account could be found.
175
+ */
176
+ getAccount(accountFilter) {
177
+ return this.controller.getAccount(accountFilter);
178
+ }
179
+ /**
180
+ * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
181
+ * @param accountFilter - (Optional) filter to narrow down the accounts returned
182
+ * @returns Array of AccountInfo objects in cache
183
+ */
184
+ getAllAccounts(accountFilter) {
185
+ return this.controller.getAllAccounts(accountFilter);
186
+ }
187
+ /**
188
+ * Event handler function which allows users to fire events after the PublicClientApplication object
189
+ * has loaded during redirect flows. This should be invoked on all page loads involved in redirect
190
+ * auth flows.
191
+ * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
192
+ * @param options Object containing optional configuration for redirect promise handling.
193
+ * @returns Token response or null. If the return value is null, then no auth redirect was detected.
194
+ */
195
+ handleRedirectPromise(options) {
196
+ return this.controller.handleRedirectPromise(options);
197
+ }
198
+ /**
199
+ * Use when initiating the login process via opening a popup window in the user's browser
200
+ *
201
+ * @param request
202
+ *
203
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
204
+ */
205
+ loginPopup(request) {
206
+ return this.controller.loginPopup(request);
207
+ }
208
+ /**
209
+ * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
210
+ * any code that follows this function will not execute.
211
+ *
212
+ * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
213
+ * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
214
+ *
215
+ * @param request
216
+ */
217
+ loginRedirect(request) {
218
+ return this.controller.loginRedirect(request);
219
+ }
220
+ /**
221
+ * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
222
+ * Default behaviour is to redirect the user to `window.location.href`.
223
+ * @param logoutRequest
224
+ */
225
+ logoutRedirect(logoutRequest) {
226
+ return this.controller.logoutRedirect(logoutRequest);
227
+ }
228
+ /**
229
+ * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
230
+ * @param logoutRequest
231
+ */
232
+ logoutPopup(logoutRequest) {
233
+ return this.controller.logoutPopup(logoutRequest);
234
+ }
235
+ /**
236
+ * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
237
+ * - Any browser using a form of Intelligent Tracking Prevention
238
+ * - If there is not an established session with the service
239
+ *
240
+ * In these cases, the request must be done inside a popup or full frame redirect.
241
+ *
242
+ * For the cases where interaction is required, you cannot send a request with prompt=none.
243
+ *
244
+ * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
245
+ * you session on the server still exists.
246
+ * @param request {@link SsoSilentRequest}
247
+ *
248
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
249
+ */
250
+ ssoSilent(request) {
251
+ return this.controller.ssoSilent(request);
252
+ }
253
+ /**
254
+ * Returns the logger instance
255
+ */
256
+ getLogger() {
257
+ return this.controller.getLogger();
258
+ }
259
+ /**
260
+ * Replaces the default logger set in configurations with new Logger with new configurations
261
+ * @param logger Logger instance
262
+ */
263
+ setLogger(logger) {
264
+ this.controller.setLogger(logger);
265
+ }
266
+ /**
267
+ * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
268
+ * @param account
269
+ */
270
+ setActiveAccount(account) {
271
+ this.controller.setActiveAccount(account);
272
+ }
273
+ /**
274
+ * Gets the currently active account
275
+ */
276
+ getActiveAccount() {
277
+ return this.controller.getActiveAccount();
278
+ }
279
+ /**
280
+ * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
281
+ * @param sku
282
+ * @param version
283
+ */
284
+ initializeWrapperLibrary(sku, version) {
285
+ return this.controller.initializeWrapperLibrary(sku, version);
286
+ }
287
+ /**
288
+ * Sets navigation client
289
+ * @param navigationClient
290
+ */
291
+ setNavigationClient(navigationClient) {
292
+ this.controller.setNavigationClient(navigationClient);
293
+ }
294
+ /**
295
+ * Returns the configuration object
296
+ * @internal
297
+ */
298
+ getConfiguration() {
299
+ return this.controller.getConfiguration();
300
+ }
301
+ /**
302
+ * Hydrates cache with the tokens and account in the AuthenticationResult object
303
+ * @param result
304
+ * @param request - The request object that was used to obtain the AuthenticationResult
305
+ * @returns
306
+ */
307
+ async hydrateCache(result, request) {
308
+ return this.controller.hydrateCache(result, request);
309
+ }
310
+ /**
311
+ * Clears tokens and account from the browser cache.
312
+ * @param logoutRequest
313
+ */
314
+ clearCache(logoutRequest) {
315
+ return this.controller.clearCache(logoutRequest);
316
+ }
317
+ }
318
+ /**
319
+ * creates NestedAppAuthController and passes it to the PublicClientApplication,
320
+ * falls back to StandardController if NestedAppAuthController is not available
321
+ *
322
+ * @param configuration
323
+ * @param correlationId
324
+ * @param pcaFactory
325
+ * @returns IPublicClientApplication
326
+ *
327
+ */
328
+ async function createNestablePublicClientApplication(configuration, correlationId, pcaFactory) {
329
+ const nestedAppAuth = new NestedAppOperatingContext(configuration);
330
+ await nestedAppAuth.initialize(correlationId);
331
+ if (nestedAppAuth.isAvailable()) {
332
+ const cid = correlationId || createNewGuid();
333
+ const controller = new NestedAppAuthController(nestedAppAuth);
334
+ const nestablePCA = pcaFactory
335
+ ? pcaFactory(configuration, controller)
336
+ : new PublicClientApplication(configuration, controller);
337
+ await nestablePCA.initialize({ correlationId: cid });
338
+ return nestablePCA;
339
+ }
340
+ return createStandardPublicClientApplication(configuration);
341
+ }
342
+ /**
343
+ * creates PublicClientApplication using StandardController
344
+ *
345
+ * @param configuration
346
+ * @returns IPublicClientApplication
347
+ *
348
+ */
349
+ async function createStandardPublicClientApplication(configuration) {
350
+ const pca = new PublicClientApplication(configuration);
351
+ await pca.initialize();
352
+ return pca;
353
+ }
354
+
355
+ export { PublicClientApplication, createNestablePublicClientApplication, createStandardPublicClientApplication };
@@ -0,0 +1,15 @@
1
+ /*! @azure/msal-browser v5.20.0 2026-08-28 */
2
+ 'use strict';
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ // Status Codes that can be thrown by WAM
8
+ const USER_INTERACTION_REQUIRED = "USER_INTERACTION_REQUIRED";
9
+ const USER_CANCEL = "USER_CANCEL";
10
+ const NO_NETWORK = "NO_NETWORK";
11
+ const DISABLED = "DISABLED";
12
+ const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE";
13
+ const UI_NOT_ALLOWED = "UI_NOT_ALLOWED";
14
+
15
+ export { ACCOUNT_UNAVAILABLE, DISABLED, NO_NETWORK, UI_NOT_ALLOWED, USER_CANCEL, USER_INTERACTION_REQUIRED };
@@ -0,0 +1,153 @@
1
+ /*! @azure/msal-browser v5.20.0 2026-08-28 */
2
+ 'use strict';
3
+ import { createAuthError, AuthErrorCodes } from '../../../msal-common/index-browser.mjs';
4
+ import { PlatformAuthConstants } from '../../utils/BrowserConstants.mjs';
5
+ import { createNativeAuthError } from '../../error/NativeAuthError.mjs';
6
+
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ class PlatformAuthDOMHandler {
12
+ constructor(logger, performanceClient, correlationId) {
13
+ this.logger = logger;
14
+ this.performanceClient = performanceClient;
15
+ this.correlationId = correlationId;
16
+ this.platformAuthType = PlatformAuthConstants.PLATFORM_DOM_PROVIDER;
17
+ }
18
+ static async createProvider(logger, performanceClient, correlationId) {
19
+ logger.trace("12mj4a", correlationId);
20
+ // @ts-ignore
21
+ if (window.navigator?.platformAuthentication) {
22
+ const supportedContracts =
23
+ // @ts-ignore
24
+ await window.navigator.platformAuthentication.getSupportedContracts(PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID);
25
+ if (supportedContracts?.includes(PlatformAuthConstants.PLATFORM_DOM_APIS)) {
26
+ logger.trace("1h5q1r", correlationId);
27
+ return new PlatformAuthDOMHandler(logger, performanceClient, correlationId);
28
+ }
29
+ }
30
+ return undefined;
31
+ }
32
+ /**
33
+ * Returns the Id for the broker extension this handler is communicating with
34
+ * @returns
35
+ */
36
+ getExtensionId() {
37
+ return PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID;
38
+ }
39
+ getExtensionVersion() {
40
+ return "";
41
+ }
42
+ getExtensionName() {
43
+ return PlatformAuthConstants.DOM_API_NAME;
44
+ }
45
+ /**
46
+ * Send token request to platform broker via browser DOM API
47
+ * @param request
48
+ * @returns
49
+ */
50
+ async sendMessage(request) {
51
+ this.logger.trace(`02bcil ${this.platformAuthType}`, request.correlationId);
52
+ try {
53
+ const platformDOMRequest = this.initializePlatformDOMRequest(request);
54
+ const response =
55
+ // @ts-ignore
56
+ await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
57
+ return this.validatePlatformBrokerResponse(response, request.correlationId);
58
+ }
59
+ catch (e) {
60
+ this.logger.error(`11im7g ${this.platformAuthType}`, request.correlationId);
61
+ throw e;
62
+ }
63
+ }
64
+ initializePlatformDOMRequest(request) {
65
+ this.logger.trace(`15d6yv ${this.platformAuthType}`, request.correlationId);
66
+ const { accountId, clientId, authority, scope, redirectUri, correlationId, state, extraParameters, ...remainingProperties } = request;
67
+ const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
68
+ const platformDOMRequest = {
69
+ accountId: accountId,
70
+ brokerId: this.getExtensionId(),
71
+ authority: authority,
72
+ clientId: clientId,
73
+ correlationId: correlationId || this.correlationId,
74
+ extraParameters: {
75
+ ...extraParameters,
76
+ ...validExtraParameters,
77
+ },
78
+ isSecurityTokenService: false,
79
+ redirectUri: redirectUri,
80
+ scope: scope,
81
+ state: state,
82
+ };
83
+ return platformDOMRequest;
84
+ }
85
+ validatePlatformBrokerResponse(response, correlationId) {
86
+ if (response.hasOwnProperty("isSuccess")) {
87
+ if (response.hasOwnProperty("accessToken") &&
88
+ response.hasOwnProperty("idToken") &&
89
+ response.hasOwnProperty("clientInfo") &&
90
+ response.hasOwnProperty("account") &&
91
+ response.hasOwnProperty("scopes") &&
92
+ response.hasOwnProperty("expiresIn")) {
93
+ this.logger.trace(`0h4vei ${this.platformAuthType}`, correlationId);
94
+ return this.convertToPlatformBrokerResponse(response, correlationId);
95
+ }
96
+ else if (response.hasOwnProperty("error")) {
97
+ const errorResponse = response;
98
+ if (errorResponse.isSuccess === false &&
99
+ errorResponse.error &&
100
+ errorResponse.error.code) {
101
+ this.logger.trace(`0g92vm ${this.platformAuthType}`, correlationId);
102
+ throw createNativeAuthError(errorResponse.error.code, correlationId, errorResponse.error.description, {
103
+ error: parseInt(errorResponse.error.errorCode),
104
+ protocol_error: errorResponse.error.protocolError,
105
+ status: errorResponse.error.status,
106
+ properties: errorResponse.error.properties,
107
+ });
108
+ }
109
+ }
110
+ }
111
+ throw createAuthError(AuthErrorCodes.unexpectedError, correlationId, "Response missing expected properties.");
112
+ }
113
+ convertToPlatformBrokerResponse(response, correlationId) {
114
+ this.logger.trace(`14913t ${this.platformAuthType}`, correlationId);
115
+ const nativeResponse = {
116
+ access_token: response.accessToken,
117
+ id_token: response.idToken,
118
+ client_info: response.clientInfo,
119
+ account: response.account,
120
+ expires_in: response.expiresIn,
121
+ scope: response.scopes,
122
+ state: response.state || "",
123
+ properties: response.properties || {},
124
+ extendedLifetimeToken: response.extendedLifetimeToken ?? false,
125
+ shr: response.proofOfPossessionPayload,
126
+ };
127
+ return nativeResponse;
128
+ }
129
+ getDOMExtraParams(extraParameters, correlationId) {
130
+ try {
131
+ const stringifiedProperties = {};
132
+ for (const [key, value] of Object.entries(extraParameters)) {
133
+ if (!value) {
134
+ continue;
135
+ }
136
+ if (typeof value === "object") {
137
+ stringifiedProperties[key] = JSON.stringify(value);
138
+ }
139
+ else {
140
+ stringifiedProperties[key] = String(value);
141
+ }
142
+ }
143
+ return stringifiedProperties;
144
+ }
145
+ catch (e) {
146
+ this.logger.error(`0eu9o3 ${this.platformAuthType}`, correlationId);
147
+ this.logger.errorPii(`17rpl5 ${this.platformAuthType} ${e}`, correlationId);
148
+ return {};
149
+ }
150
+ }
151
+ }
152
+
153
+ export { PlatformAuthDOMHandler };