oidc-spa 7.1.10 → 7.2.0-rc.2

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 (367) hide show
  1. package/backend.js +235 -352
  2. package/backend.js.map +1 -1
  3. package/core/AuthResponse.js +12 -49
  4. package/core/AuthResponse.js.map +1 -1
  5. package/core/Oidc.d.ts +1 -2
  6. package/core/Oidc.js.map +1 -1
  7. package/core/OidcInitializationError.d.ts +0 -13
  8. package/core/OidcInitializationError.js +8 -318
  9. package/core/OidcInitializationError.js.map +1 -1
  10. package/core/OidcMetadata.js +1 -1
  11. package/core/OidcMetadata.js.map +1 -1
  12. package/core/StateData.d.ts +5 -5
  13. package/core/StateData.js +25 -25
  14. package/core/StateData.js.map +1 -1
  15. package/core/configId.js +1 -1
  16. package/core/configId.js.map +1 -1
  17. package/core/createOidc.d.ts +8 -0
  18. package/core/createOidc.js +1030 -1292
  19. package/core/createOidc.js.map +1 -1
  20. package/core/diagnostic.d.ts +14 -0
  21. package/core/diagnostic.js +214 -0
  22. package/core/diagnostic.js.map +1 -0
  23. package/core/evtIsUserActive.js +26 -27
  24. package/core/evtIsUserActive.js.map +1 -1
  25. package/core/handleOidcCallback.js +99 -154
  26. package/core/handleOidcCallback.js.map +1 -1
  27. package/core/iframeMessageProtection.d.ts +1 -1
  28. package/core/iframeMessageProtection.js +40 -106
  29. package/core/iframeMessageProtection.js.map +1 -1
  30. package/core/index.d.ts +1 -1
  31. package/core/index.js +3 -3
  32. package/core/index.js.map +1 -1
  33. package/core/initialLocationHref.js +1 -1
  34. package/core/initialLocationHref.js.map +1 -1
  35. package/core/isNewBrowserSession.js +8 -8
  36. package/core/isNewBrowserSession.js.map +1 -1
  37. package/core/loginOrGoToAuthServer.d.ts +1 -1
  38. package/core/loginOrGoToAuthServer.js +188 -310
  39. package/core/loginOrGoToAuthServer.js.map +1 -1
  40. package/core/loginPropagationToOtherTabs.js +15 -16
  41. package/core/loginPropagationToOtherTabs.js.map +1 -1
  42. package/core/loginSilent.d.ts +2 -3
  43. package/core/loginSilent.js +118 -214
  44. package/core/loginSilent.js.map +1 -1
  45. package/core/logoutPropagationToOtherTabs.js +15 -16
  46. package/core/logoutPropagationToOtherTabs.js.map +1 -1
  47. package/core/oidcClientTsUserToTokens.d.ts +1 -1
  48. package/core/oidcClientTsUserToTokens.js +75 -72
  49. package/core/oidcClientTsUserToTokens.js.map +1 -1
  50. package/core/ongoingLoginOrRefreshProcesses.js +23 -89
  51. package/core/ongoingLoginOrRefreshProcesses.js.map +1 -1
  52. package/core/persistedAuthState.js +13 -13
  53. package/core/persistedAuthState.js.map +1 -1
  54. package/entrypoint.js +9 -9
  55. package/entrypoint.js.map +1 -1
  56. package/esm/core/AuthResponse.d.ts +5 -0
  57. package/{src/core/AuthResponse.ts → esm/core/AuthResponse.js} +3 -9
  58. package/esm/core/AuthResponse.js.map +1 -0
  59. package/esm/core/Oidc.d.ts +126 -0
  60. package/esm/core/Oidc.js +2 -0
  61. package/esm/core/Oidc.js.map +1 -0
  62. package/esm/core/OidcInitializationError.d.ts +7 -0
  63. package/esm/core/OidcInitializationError.js +17 -0
  64. package/esm/core/OidcInitializationError.js.map +1 -0
  65. package/{src/core/OidcMetadata.ts → esm/core/OidcMetadata.d.ts} +0 -5
  66. package/esm/core/OidcMetadata.js +3 -0
  67. package/esm/core/OidcMetadata.js.map +1 -0
  68. package/esm/core/StateData.d.ts +42 -0
  69. package/esm/core/StateData.js +55 -0
  70. package/esm/core/StateData.js.map +1 -0
  71. package/esm/core/configId.d.ts +4 -0
  72. package/esm/core/configId.js +4 -0
  73. package/esm/core/configId.js.map +1 -0
  74. package/esm/core/createOidc.d.ts +132 -0
  75. package/{src/core/createOidc.ts → esm/core/createOidc.js} +282 -826
  76. package/esm/core/createOidc.js.map +1 -0
  77. package/esm/core/diagnostic.d.ts +14 -0
  78. package/{src/core/OidcInitializationError.ts → esm/core/diagnostic.js} +40 -117
  79. package/esm/core/diagnostic.js.map +1 -0
  80. package/esm/core/evtIsUserActive.d.ts +5 -0
  81. package/{src/core/evtIsUserActive.ts → esm/core/evtIsUserActive.js} +14 -46
  82. package/esm/core/evtIsUserActive.js.map +1 -0
  83. package/esm/core/handleOidcCallback.d.ts +13 -0
  84. package/{src/core/handleOidcCallback.ts → esm/core/handleOidcCallback.js} +56 -131
  85. package/esm/core/handleOidcCallback.js.map +1 -0
  86. package/esm/core/iframeMessageProtection.d.ts +20 -0
  87. package/{src/core/iframeMessageProtection.ts → esm/core/iframeMessageProtection.js} +14 -49
  88. package/esm/core/iframeMessageProtection.js.map +1 -0
  89. package/{src/core/index.ts → esm/core/index.d.ts} +1 -1
  90. package/esm/core/index.js +4 -0
  91. package/esm/core/index.js.map +1 -0
  92. package/esm/core/initialLocationHref.d.ts +1 -0
  93. package/{src/core/initialLocationHref.ts → esm/core/initialLocationHref.js} +1 -1
  94. package/esm/core/initialLocationHref.js.map +1 -0
  95. package/esm/core/isNewBrowserSession.d.ts +9 -0
  96. package/{src/core/isNewBrowserSession.ts → esm/core/isNewBrowserSession.js} +3 -15
  97. package/esm/core/isNewBrowserSession.js.map +1 -0
  98. package/esm/core/loginOrGoToAuthServer.d.ts +40 -0
  99. package/{src/core/loginOrGoToAuthServer.ts → esm/core/loginOrGoToAuthServer.js} +60 -168
  100. package/esm/core/loginOrGoToAuthServer.js.map +1 -0
  101. package/esm/core/loginPropagationToOtherTabs.d.ts +8 -0
  102. package/{src/core/loginPropagationToOtherTabs.ts → esm/core/loginPropagationToOtherTabs.js} +7 -25
  103. package/esm/core/loginPropagationToOtherTabs.js.map +1 -0
  104. package/esm/core/loginSilent.d.ts +28 -0
  105. package/esm/core/loginSilent.js +125 -0
  106. package/esm/core/loginSilent.js.map +1 -0
  107. package/esm/core/logoutPropagationToOtherTabs.d.ts +10 -0
  108. package/{src/core/logoutPropagationToOtherTabs.ts → esm/core/logoutPropagationToOtherTabs.js} +8 -28
  109. package/esm/core/logoutPropagationToOtherTabs.js.map +1 -0
  110. package/esm/core/oidcClientTsUserToTokens.d.ts +11 -0
  111. package/esm/core/oidcClientTsUserToTokens.js +155 -0
  112. package/esm/core/oidcClientTsUserToTokens.js.map +1 -0
  113. package/esm/core/ongoingLoginOrRefreshProcesses.d.ts +6 -0
  114. package/{src/core/ongoingLoginOrRefreshProcesses.ts → esm/core/ongoingLoginOrRefreshProcesses.js} +6 -24
  115. package/esm/core/ongoingLoginOrRefreshProcesses.js.map +1 -0
  116. package/esm/core/persistedAuthState.d.ts +28 -0
  117. package/esm/core/persistedAuthState.js +64 -0
  118. package/esm/core/persistedAuthState.js.map +1 -0
  119. package/esm/entrypoint.d.ts +7 -0
  120. package/{src/entrypoint.ts → esm/entrypoint.js} +3 -26
  121. package/esm/entrypoint.js.map +1 -0
  122. package/esm/index.d.ts +1 -0
  123. package/esm/index.js +2 -0
  124. package/esm/index.js.map +1 -0
  125. package/esm/keycloak/index.d.ts +3 -0
  126. package/esm/keycloak/index.js +3 -0
  127. package/esm/keycloak/index.js.map +1 -0
  128. package/esm/keycloak/isKeycloak.d.ts +3 -0
  129. package/esm/keycloak/isKeycloak.js +17 -0
  130. package/esm/keycloak/isKeycloak.js.map +1 -0
  131. package/esm/keycloak/keycloak-js/Keycloak.d.ts +284 -0
  132. package/esm/keycloak/keycloak-js/Keycloak.js +774 -0
  133. package/esm/keycloak/keycloak-js/Keycloak.js.map +1 -0
  134. package/esm/keycloak/keycloak-js/index.d.ts +2 -0
  135. package/esm/keycloak/keycloak-js/index.js +2 -0
  136. package/esm/keycloak/keycloak-js/index.js.map +1 -0
  137. package/esm/keycloak/keycloak-js/types.d.ts +361 -0
  138. package/esm/keycloak/keycloak-js/types.js +2 -0
  139. package/esm/keycloak/keycloak-js/types.js.map +1 -0
  140. package/esm/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
  141. package/esm/keycloak/keycloakIssuerUriParsed.js +16 -0
  142. package/esm/keycloak/keycloakIssuerUriParsed.js.map +1 -0
  143. package/esm/keycloak/keycloakUtils.d.ts +37 -0
  144. package/esm/keycloak/keycloakUtils.js +44 -0
  145. package/esm/keycloak/keycloakUtils.js.map +1 -0
  146. package/esm/keycloak-js.d.ts +1 -0
  147. package/esm/keycloak-js.js +2 -0
  148. package/esm/keycloak-js.js.map +1 -0
  149. package/esm/mock/index.js +2 -0
  150. package/esm/mock/index.js.map +1 -0
  151. package/esm/mock/oidc.d.ts +19 -0
  152. package/{src/mock/oidc.ts → esm/mock/oidc.js} +28 -88
  153. package/esm/mock/oidc.js.map +1 -0
  154. package/esm/mock/react.d.ts +58 -0
  155. package/esm/mock/react.js +7 -0
  156. package/esm/mock/react.js.map +1 -0
  157. package/esm/react/index.js +2 -0
  158. package/esm/react/index.js.map +1 -0
  159. package/esm/react/react.d.ts +102 -0
  160. package/esm/react/react.js +221 -0
  161. package/esm/react/react.js.map +1 -0
  162. package/esm/tools/Deferred.d.ts +14 -0
  163. package/esm/tools/Deferred.js +23 -0
  164. package/esm/tools/Deferred.js.map +1 -0
  165. package/esm/tools/EphemeralSessionStorage.d.ts +12 -0
  166. package/{src/tools/EphemeralSessionStorage.ts → esm/tools/EphemeralSessionStorage.js} +30 -112
  167. package/esm/tools/EphemeralSessionStorage.js.map +1 -0
  168. package/esm/tools/Evt.d.ts +11 -0
  169. package/{src/tools/Evt.ts → esm/tools/Evt.js} +7 -25
  170. package/esm/tools/Evt.js.map +1 -0
  171. package/esm/tools/StatefulEvt.d.ts +12 -0
  172. package/esm/tools/StatefulEvt.js +21 -0
  173. package/esm/tools/StatefulEvt.js.map +1 -0
  174. package/esm/tools/ValueOrAsyncGetter.js +2 -0
  175. package/esm/tools/ValueOrAsyncGetter.js.map +1 -0
  176. package/esm/tools/asymmetricEncryption.d.ts +18 -0
  177. package/esm/tools/asymmetricEncryption.js +85 -0
  178. package/esm/tools/asymmetricEncryption.js.map +1 -0
  179. package/esm/tools/base64.d.ts +2 -0
  180. package/{src/tools/base64.ts → esm/tools/base64.js} +3 -3
  181. package/esm/tools/base64.js.map +1 -0
  182. package/esm/tools/createObjectThatThrowsIfAccessed.d.ts +8 -0
  183. package/{src/tools/createObjectThatThrowsIfAccessed.ts → esm/tools/createObjectThatThrowsIfAccessed.js} +7 -18
  184. package/esm/tools/createObjectThatThrowsIfAccessed.js.map +1 -0
  185. package/esm/tools/decodeJwt.d.ts +25 -0
  186. package/esm/tools/decodeJwt.js +60 -0
  187. package/esm/tools/decodeJwt.js.map +1 -0
  188. package/esm/tools/generateUrlSafeRandom.d.ts +3 -0
  189. package/{src/tools/generateUrlSafeRandom.ts → esm/tools/generateUrlSafeRandom.js} +5 -8
  190. package/esm/tools/generateUrlSafeRandom.js.map +1 -0
  191. package/esm/tools/getDownlinkAndRtt.d.ts +4 -0
  192. package/{src/tools/getDownlinkAndRtt.ts → esm/tools/getDownlinkAndRtt.js} +6 -10
  193. package/esm/tools/getDownlinkAndRtt.js.map +1 -0
  194. package/esm/tools/getIsOnline.d.ts +7 -0
  195. package/{src/tools/getIsOnline.ts → esm/tools/getIsOnline.js} +3 -9
  196. package/esm/tools/getIsOnline.js.map +1 -0
  197. package/esm/tools/getIsValidRemoteJson.d.ts +1 -0
  198. package/esm/tools/getIsValidRemoteJson.js +15 -0
  199. package/esm/tools/getIsValidRemoteJson.js.map +1 -0
  200. package/esm/tools/getPrUserInteraction.d.ts +4 -0
  201. package/{src/tools/getPrUserInteraction.ts → esm/tools/getPrUserInteraction.js} +2 -6
  202. package/esm/tools/getPrUserInteraction.js.map +1 -0
  203. package/esm/tools/getUserEnvironmentInfo.d.ts +1 -0
  204. package/esm/tools/getUserEnvironmentInfo.js +50 -0
  205. package/esm/tools/getUserEnvironmentInfo.js.map +1 -0
  206. package/esm/tools/haveSharedParentDomain.d.ts +4 -0
  207. package/{src/tools/haveSharedParentDomain.ts → esm/tools/haveSharedParentDomain.js} +3 -5
  208. package/esm/tools/haveSharedParentDomain.js.map +1 -0
  209. package/esm/tools/isDev.d.ts +1 -0
  210. package/{src/tools/isDev.ts → esm/tools/isDev.js} +5 -12
  211. package/esm/tools/isDev.js.map +1 -0
  212. package/esm/tools/parseKeycloakIssuerUri.d.ts +30 -0
  213. package/esm/tools/parseKeycloakIssuerUri.js +33 -0
  214. package/esm/tools/parseKeycloakIssuerUri.js.map +1 -0
  215. package/esm/tools/readExpirationTimeInJwt.d.ts +1 -0
  216. package/{src/tools/readExpirationTimeInJwt.ts → esm/tools/readExpirationTimeInJwt.js} +6 -7
  217. package/esm/tools/readExpirationTimeInJwt.js.map +1 -0
  218. package/esm/tools/startCountdown.d.ts +11 -0
  219. package/{src/tools/startCountdown.ts → esm/tools/startCountdown.js} +6 -17
  220. package/esm/tools/startCountdown.js.map +1 -0
  221. package/esm/tools/subscribeToUserInteraction.d.ts +6 -0
  222. package/{src/tools/subscribeToUserInteraction.ts → esm/tools/subscribeToUserInteraction.js} +4 -13
  223. package/esm/tools/subscribeToUserInteraction.js.map +1 -0
  224. package/esm/tools/toFullyQualifiedUrl.d.ts +10 -0
  225. package/{src/tools/toFullyQualifiedUrl.ts → esm/tools/toFullyQualifiedUrl.js} +7 -25
  226. package/esm/tools/toFullyQualifiedUrl.js.map +1 -0
  227. package/esm/tools/toHumanReadableDuration.d.ts +1 -0
  228. package/{src/tools/toHumanReadableDuration.ts → esm/tools/toHumanReadableDuration.js} +8 -5
  229. package/esm/tools/toHumanReadableDuration.js.map +1 -0
  230. package/esm/tools/urlSearchParams.d.ts +19 -0
  231. package/{src/tools/urlSearchParams.ts → esm/tools/urlSearchParams.js} +24 -70
  232. package/esm/tools/urlSearchParams.js.map +1 -0
  233. package/esm/tools/workerTimers.d.ts +5 -0
  234. package/{src/tools/workerTimers.ts → esm/tools/workerTimers.js} +7 -27
  235. package/esm/tools/workerTimers.js.map +1 -0
  236. package/esm/vendor/frontend/oidc-client-ts.d.ts +1 -0
  237. package/esm/vendor/frontend/oidc-client-ts.js +3636 -0
  238. package/{src/vendor/frontend/tsafe.ts → esm/vendor/frontend/tsafe.d.ts} +1 -0
  239. package/esm/vendor/frontend/tsafe.js +1 -0
  240. package/esm/vendor/frontend/worker-timers.js +1 -0
  241. package/index.d.ts +1 -1
  242. package/index.js +1 -2
  243. package/index.js.map +1 -1
  244. package/keycloak/index.d.ts +3 -0
  245. package/keycloak/index.js +8 -0
  246. package/keycloak/index.js.map +1 -0
  247. package/keycloak/isKeycloak.d.ts +3 -0
  248. package/keycloak/isKeycloak.js +20 -0
  249. package/keycloak/isKeycloak.js.map +1 -0
  250. package/keycloak/keycloak-js/Keycloak.d.ts +284 -0
  251. package/keycloak/keycloak-js/Keycloak.js +778 -0
  252. package/keycloak/keycloak-js/Keycloak.js.map +1 -0
  253. package/keycloak/keycloak-js/index.d.ts +2 -0
  254. package/keycloak/keycloak-js/index.js +6 -0
  255. package/keycloak/keycloak-js/index.js.map +1 -0
  256. package/keycloak/keycloak-js/types.d.ts +361 -0
  257. package/keycloak/keycloak-js/types.js +3 -0
  258. package/keycloak/keycloak-js/types.js.map +1 -0
  259. package/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
  260. package/keycloak/keycloakIssuerUriParsed.js +19 -0
  261. package/keycloak/keycloakIssuerUriParsed.js.map +1 -0
  262. package/keycloak/keycloakUtils.d.ts +37 -0
  263. package/keycloak/keycloakUtils.js +47 -0
  264. package/keycloak/keycloakUtils.js.map +1 -0
  265. package/keycloak-js.d.ts +1 -0
  266. package/keycloak-js.js +18 -0
  267. package/keycloak-js.js.map +1 -0
  268. package/mock/index.js.map +1 -1
  269. package/mock/oidc.js +147 -194
  270. package/mock/oidc.js.map +1 -1
  271. package/mock/react.js +2 -2
  272. package/mock/react.js.map +1 -1
  273. package/package.json +74 -299
  274. package/react/index.js.map +1 -1
  275. package/react/react.js +133 -244
  276. package/react/react.js.map +1 -1
  277. package/tools/Deferred.js +13 -35
  278. package/tools/Deferred.js.map +1 -1
  279. package/tools/EphemeralSessionStorage.js +46 -48
  280. package/tools/EphemeralSessionStorage.js.map +1 -1
  281. package/tools/Evt.js +14 -14
  282. package/tools/Evt.js.map +1 -1
  283. package/tools/StatefulEvt.js +5 -5
  284. package/tools/StatefulEvt.js.map +1 -1
  285. package/tools/ValueOrAsyncGetter.js.map +1 -1
  286. package/tools/asymmetricEncryption.js +81 -172
  287. package/tools/asymmetricEncryption.js.map +1 -1
  288. package/tools/base64.js +2 -2
  289. package/tools/base64.js.map +1 -1
  290. package/tools/createObjectThatThrowsIfAccessed.js +13 -61
  291. package/tools/createObjectThatThrowsIfAccessed.js.map +1 -1
  292. package/tools/decodeJwt.d.ts +25 -2
  293. package/tools/decodeJwt.js +61 -3
  294. package/tools/decodeJwt.js.map +1 -1
  295. package/tools/generateUrlSafeRandom.js +5 -30
  296. package/tools/generateUrlSafeRandom.js.map +1 -1
  297. package/tools/getDownlinkAndRtt.js +8 -30
  298. package/tools/getDownlinkAndRtt.js.map +1 -1
  299. package/tools/getIsOnline.js +3 -3
  300. package/tools/getIsOnline.js.map +1 -1
  301. package/tools/getIsValidRemoteJson.js +12 -59
  302. package/tools/getIsValidRemoteJson.js.map +1 -1
  303. package/tools/getPrUserInteraction.js +4 -4
  304. package/tools/getPrUserInteraction.js.map +1 -1
  305. package/tools/getUserEnvironmentInfo.js +17 -12
  306. package/tools/getUserEnvironmentInfo.js.map +1 -1
  307. package/tools/haveSharedParentDomain.js +5 -5
  308. package/tools/haveSharedParentDomain.js.map +1 -1
  309. package/tools/isDev.js +2 -2
  310. package/tools/isDev.js.map +1 -1
  311. package/tools/parseKeycloakIssuerUri.d.ts +2 -0
  312. package/tools/parseKeycloakIssuerUri.js +11 -42
  313. package/tools/parseKeycloakIssuerUri.js.map +1 -1
  314. package/tools/readExpirationTimeInJwt.js +4 -4
  315. package/tools/readExpirationTimeInJwt.js.map +1 -1
  316. package/tools/startCountdown.js +17 -65
  317. package/tools/startCountdown.js.map +1 -1
  318. package/tools/subscribeToUserInteraction.js +17 -66
  319. package/tools/subscribeToUserInteraction.js.map +1 -1
  320. package/tools/toFullyQualifiedUrl.js +7 -7
  321. package/tools/toFullyQualifiedUrl.js.map +1 -1
  322. package/tools/toHumanReadableDuration.js +13 -13
  323. package/tools/toHumanReadableDuration.js.map +1 -1
  324. package/tools/urlSearchParams.js +28 -50
  325. package/tools/urlSearchParams.js.map +1 -1
  326. package/tools/workerTimers.js +10 -10
  327. package/tools/workerTimers.js.map +1 -1
  328. package/vendor/frontend/oidc-client-ts.d.ts +1 -0
  329. package/vendor/frontend/oidc-client-ts.js +3686 -0
  330. package/vendor/frontend/tsafe.d.ts +1 -0
  331. package/vendor/frontend/tsafe.js +1 -1
  332. package/LICENSE +0 -21
  333. package/README.md +0 -185
  334. package/core/trustedFetch.d.ts +0 -2
  335. package/core/trustedFetch.js +0 -12
  336. package/core/trustedFetch.js.map +0 -1
  337. package/src/backend.ts +0 -391
  338. package/src/core/Oidc.ts +0 -141
  339. package/src/core/StateData.ts +0 -118
  340. package/src/core/configId.ts +0 -3
  341. package/src/core/loginSilent.ts +0 -206
  342. package/src/core/oidcClientTsUserToTokens.ts +0 -229
  343. package/src/core/persistedAuthState.ts +0 -122
  344. package/src/core/trustedFetch.ts +0 -9
  345. package/src/index.ts +0 -7
  346. package/src/mock/react.tsx +0 -11
  347. package/src/react/react.tsx +0 -460
  348. package/src/tools/Deferred.ts +0 -39
  349. package/src/tools/StatefulEvt.ts +0 -38
  350. package/src/tools/asymmetricEncryption.ts +0 -184
  351. package/src/tools/decodeJwt.ts +0 -2
  352. package/src/tools/getIsValidRemoteJson.ts +0 -18
  353. package/src/tools/getUserEnvironmentInfo.ts +0 -42
  354. package/src/tools/parseKeycloakIssuerUri.ts +0 -68
  355. package/src/vendor/backend/evt.ts +0 -2
  356. package/src/vendor/backend/jsonwebtoken.ts +0 -1
  357. package/src/vendor/backend/node-fetch.ts +0 -2
  358. package/src/vendor/backend/node-jose.ts +0 -1
  359. package/src/vendor/backend/tsafe.ts +0 -5
  360. package/src/vendor/backend/zod.ts +0 -1
  361. package/src/vendor/frontend/oidc-client-ts-and-jwt-decode.ts +0 -4
  362. package/vendor/frontend/oidc-client-ts-and-jwt-decode.d.ts +0 -3
  363. package/vendor/frontend/oidc-client-ts-and-jwt-decode.js +0 -3
  364. /package/{src/mock/index.ts → esm/mock/index.d.ts} +0 -0
  365. /package/{src/react/index.ts → esm/react/index.d.ts} +0 -0
  366. /package/{src/tools/ValueOrAsyncGetter.ts → esm/tools/ValueOrAsyncGetter.d.ts} +0 -0
  367. /package/{src/vendor/frontend/worker-timers.ts → esm/vendor/frontend/worker-timers.d.ts} +0 -0
@@ -0,0 +1,284 @@
1
+ import type { KeycloakServerConfig, KeycloakInitOptions, KeycloakError, KeycloakLogoutOptions, KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess, KeycloakProfile, KeycloakUserInfo, KeycloakLoginOptions, KeycloakRegisterOptions, KeycloakAccountOptions } from "./types";
2
+ type ConstructorParams = KeycloakServerConfig & {
3
+ homeUrl: string;
4
+ };
5
+ /**
6
+ * This module provides a drop-in replacement for `keycloak-js`,
7
+ * designed for teams migrating to `oidc-spa` with minimal changes.
8
+ *
9
+ * ⚠️ While the import path is `oidc-spa/keycloak-js`, this is *not* a re-export or patch —
10
+ * it is a full alternative implementation aligned with the `keycloak-js` API.
11
+ */
12
+ export declare class Keycloak {
13
+ /**
14
+ * Creates a new Keycloak client instance.
15
+ * @param config A configuration object or path to a JSON config file.
16
+ *
17
+ * NOTE oidc-spa: Currently not supporting GenericOidcConfig (providing explicitly authorization_endpoint ect)
18
+ * But we could if with the __metadata parameter of oidc-spa.
19
+ * I'm not seeing the usecase when ran against keycloak right now so not doing it.
20
+ */
21
+ constructor(params: ConstructorParams);
22
+ /**
23
+ * Called to initialize the adapter.
24
+ * @param initOptions Initialization options.
25
+ * @returns A promise to set functions to be invoked on success or error.
26
+ */
27
+ init(initOptions?: KeycloakInitOptions): Promise<boolean>;
28
+ /**
29
+ * Is true if the user is authenticated, false otherwise.
30
+ */
31
+ get authenticated(): boolean;
32
+ /**
33
+ * The user id.
34
+ */
35
+ get subject(): string | undefined;
36
+ /**
37
+ * Response mode passed in init (default value is `'fragment'`).
38
+ *
39
+ * NOTE oidc-spa: Can only be fragment.
40
+ */
41
+ responseMode: string;
42
+ /**
43
+ * Response type sent to Keycloak with login requests. This is determined
44
+ * based on the flow value used during initialization, but can be overridden
45
+ * by setting this value.
46
+ *
47
+ * NOTE oidc-spa: Can only be 'code'
48
+ */
49
+ responseType: string;
50
+ /**
51
+ * Flow passed in init.
52
+ *
53
+ * NOTE oidc-spa: Can only be 'standard'
54
+ */
55
+ flow: string;
56
+ /**
57
+ * The realm roles associated with the token.
58
+ */
59
+ get realmAccess(): KeycloakRoles | undefined;
60
+ /**
61
+ * The resource roles associated with the token.
62
+ */
63
+ get resourceAccess(): KeycloakResourceAccess | undefined;
64
+ /**
65
+ * The base64 encoded token that can be sent in the Authorization header in
66
+ * requests to services.
67
+ */
68
+ get token(): string | undefined;
69
+ /**
70
+ * The parsed token as a JavaScript object.
71
+ */
72
+ get tokenParsed(): KeycloakTokenParsed | undefined;
73
+ /**
74
+ * The base64 encoded refresh token that can be used to retrieve a new token.
75
+ */
76
+ get refreshToken(): string | undefined;
77
+ /**
78
+ * The parsed refresh token as a JavaScript object.
79
+ */
80
+ get refreshTokenParsed(): KeycloakTokenParsed | undefined;
81
+ /**
82
+ * The base64 encoded ID token.
83
+ */
84
+ get idToken(): string | undefined;
85
+ /**
86
+ * The parsed id token as a JavaScript object.
87
+ */
88
+ get idTokenParsed(): KeycloakTokenParsed | undefined;
89
+ /**
90
+ * The estimated time difference between the browser time and the Keycloak
91
+ * server in seconds. This value is just an estimation, but is accurate
92
+ * enough when determining if a token is expired or not.
93
+ *
94
+ * NOTE oidc-spa: Not supported.
95
+ */
96
+ timeSkew: null;
97
+ /**
98
+ * Whether the instance has been initialized by calling `.init()`.
99
+ */
100
+ get didInitialize(): boolean;
101
+ /**
102
+ * @private Undocumented.
103
+ */
104
+ get loginRequired(): boolean;
105
+ /**
106
+ * @private Undocumented.
107
+ */
108
+ get authServerUrl(): string;
109
+ /**
110
+ * @private Undocumented.
111
+ */
112
+ get realm(): string;
113
+ /**
114
+ * @private Undocumented.
115
+ */
116
+ get clientId(): string;
117
+ /**
118
+ * @private Undocumented.
119
+ */
120
+ get redirectUri(): string | undefined;
121
+ /**
122
+ * @private Undocumented.
123
+ */
124
+ get sessionId(): string | undefined;
125
+ /**
126
+ * @private Undocumented.
127
+ */
128
+ get profile(): KeycloakProfile | undefined;
129
+ /**
130
+ * @private Undocumented.
131
+ */
132
+ get userInfo(): KeycloakUserInfo | undefined;
133
+ /**
134
+ * Called when the adapter is initialized.
135
+ */
136
+ onReady?(authenticated: boolean): void;
137
+ /**
138
+ * Called when a user is successfully authenticated.
139
+ */
140
+ onAuthSuccess?(): void;
141
+ /**
142
+ * Called if there was an error during authentication.
143
+ */
144
+ onAuthError?(errorData: KeycloakError): void;
145
+ /**
146
+ * Called when the token is refreshed.
147
+ */
148
+ onAuthRefreshSuccess?(): void;
149
+ /**
150
+ * Called if there was an error while trying to refresh the token.
151
+ *
152
+ * NOTE oidc-spa: In oidc-spa an auth refresh error always triggers a page refresh.
153
+ */
154
+ /**
155
+ * Called if the user is logged out (will only be called if the session
156
+ * status iframe is enabled, or in Cordova mode).
157
+ *
158
+ * NOTE oidc-spa: In oidc-spa a logout always triggers a page refresh.
159
+ */
160
+ /**
161
+ * Called when the access token is expired. If a refresh token is available
162
+ * the token can be refreshed with Keycloak#updateToken, or in cases where
163
+ * it's not (ie. with implicit flow) you can redirect to login screen to
164
+ * obtain a new access token.
165
+ */
166
+ set onTokenExpired(value: (() => void) | undefined);
167
+ get onTokenExpired(): (() => void) | undefined;
168
+ /**
169
+ * Called when a AIA has been requested by the application.
170
+ * @param status the outcome of the required action
171
+ * @param action the alias name of the required action, e.g. UPDATE_PASSWORD, CONFIGURE_TOTP etc.
172
+ */
173
+ onActionUpdate?(status: "success" | "cancelled" | "error", action?: string): void;
174
+ /**
175
+ * Redirects to login form.
176
+ * @param options Login options.
177
+ */
178
+ login(options?: KeycloakLoginOptions & {
179
+ doesCurrentHrefRequiresAuth?: boolean;
180
+ }): Promise<never>;
181
+ /**
182
+ * Redirects to logout.
183
+ * @param options Logout options.
184
+ */
185
+ logout(options?: KeycloakLogoutOptions): Promise<never>;
186
+ /**
187
+ * Redirects to registration form.
188
+ * @param options The options used for the registration.
189
+ */
190
+ register(options?: KeycloakRegisterOptions): Promise<never>;
191
+ /**
192
+ * Redirects to the Account Management Console.
193
+ */
194
+ accountManagement(options?: {
195
+ /**
196
+ * Specifies the uri to redirect to when redirecting back to the application.
197
+ */
198
+ redirectUri?: string;
199
+ locale?: string;
200
+ }): Promise<never>;
201
+ /**
202
+ * Returns the URL to login form.
203
+ * @param options Supports same options as Keycloak#login.
204
+ *
205
+ * NOTE oidc-spa: Not supported, please use login() method.
206
+ */
207
+ /**
208
+ * Returns the URL to logout the user.
209
+ * @param options Logout options.
210
+ *
211
+ * NOTE oidc-spa: Not supported, please use logout() method.
212
+ */
213
+ /**
214
+ * Returns the URL to registration page.
215
+ * @param options The options used for creating the registration URL.
216
+ *
217
+ * NOTE oidc-spa: Not supported please user login({ action: "register" })
218
+ */
219
+ /**
220
+ * Returns the URL to the Account Management Console.
221
+ * @param options The options used for creating the account URL.
222
+ */
223
+ createAccountUrl(options?: KeycloakAccountOptions & {
224
+ locale?: string;
225
+ }): string;
226
+ /**
227
+ * Returns true if the token has less than `minValidity` seconds left before
228
+ * it expires.
229
+ * @param minValidity If not specified, `0` is used.
230
+ */
231
+ isTokenExpired(minValidity?: number): boolean;
232
+ /**
233
+ * If the token expires within `minValidity` seconds, the token is refreshed.
234
+ * If the session status iframe is enabled, the session status is also
235
+ * checked.
236
+ * @param minValidity If not specified, `5` is used.
237
+ * @returns A promise to set functions that can be invoked if the token is
238
+ * still valid, or if the token is no longer valid.
239
+ * @example
240
+ * ```js
241
+ * keycloak.updateToken(5).then(function(refreshed) {
242
+ * if (refreshed) {
243
+ * alert('Token was successfully refreshed');
244
+ * } else {
245
+ * alert('Token is still valid');
246
+ * }
247
+ * }).catch(function() {
248
+ * alert('Failed to refresh the token, or the session has expired');
249
+ * });
250
+ */
251
+ updateToken(minValidity?: number): Promise<boolean>;
252
+ /**
253
+ * Clears authentication state, including tokens. This can be useful if
254
+ * the application has detected the session was expired, for example if
255
+ * updating token fails. Invoking this results in Keycloak#onAuthLogout
256
+ * callback listener being invoked.
257
+ *
258
+ * NOTE oidc-spa: In this implementation we never end up in the kind of
259
+ * state where calling this makes sense.
260
+ * oidc-spa take more control and exposes less complexity to the user of the
261
+ * adapter.
262
+ */
263
+ /**
264
+ * Returns true if the token has the given realm role.
265
+ * @param role A realm role name.
266
+ */
267
+ hasRealmRole(role: string): boolean;
268
+ /**
269
+ * Returns true if the token has the given role for the resource.
270
+ * @param role A role name.
271
+ * @param resource If not specified, `clientId` is used.
272
+ */
273
+ hasResourceRole(role: string, resource?: string): boolean;
274
+ /**
275
+ * Loads the user's profile.
276
+ * @returns A promise to set functions to be invoked on success or error.
277
+ */
278
+ loadUserProfile(): Promise<KeycloakProfile>;
279
+ /**
280
+ * @private Undocumented.
281
+ */
282
+ loadUserInfo(): Promise<KeycloakUserInfo>;
283
+ }
284
+ export {};