@multiplatform.one/keycloak 0.7.15 → 0.7.16

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 (155) hide show
  1. package/package.json +26 -26
  2. package/routes/index.d.ts +22 -0
  3. package/routes/index.js +22 -0
  4. package/src/Authenticated.tsx +27 -17
  5. package/src/authConfig.ts +3 -9
  6. package/src/hooks/index.ts +0 -3
  7. package/src/hooks/useTokensFromQuery/index.ts +1 -0
  8. package/src/hooks/useTokensFromState.ts +1 -1
  9. package/src/index.ts +3 -0
  10. package/src/{@types/coreJsPure.d.ts → keycloak/context.ts} +6 -11
  11. package/{lib/@types/expoKeycloakAuth.d.d.mts → src/keycloak/index.ts} +4 -7
  12. package/src/keycloak/keycloak.native.ts +148 -0
  13. package/src/keycloak/keycloak.ts +175 -0
  14. package/src/provider/AfterAuth.tsx +63 -0
  15. package/src/provider/{keycloakProvider.native.tsx → AuthProvider/AuthProvider.native.tsx} +8 -16
  16. package/src/provider/{keycloakProvider.tsx → AuthProvider/AuthProvider.tsx} +81 -94
  17. package/{lib/@types/expoKeycloakAuth.d.d.ts → src/provider/AuthProvider/index.ts} +4 -7
  18. package/src/provider/KeycloakProvider.tsx +53 -0
  19. package/src/{hooks/useCurrentRouteName/index.native.ts → provider/index.ts} +6 -11
  20. package/src/routes.ts +163 -0
  21. package/src/session/index.ts +22 -0
  22. package/src/session/session.native.ts +31 -0
  23. package/src/session/session.ts +68 -0
  24. package/src/{state/index.ts → state.ts} +5 -4
  25. package/src/{util.ts → token.ts} +25 -11
  26. package/src/types.ts +4 -1
  27. package/lib/@types/coreJsPure.d.d.mts +0 -2
  28. package/lib/@types/coreJsPure.d.d.ts +0 -2
  29. package/lib/@types/coreJsPure.d.js +0 -1
  30. package/lib/@types/coreJsPure.d.mjs +0 -0
  31. package/lib/@types/expoKeycloakAuth.d.js +0 -1
  32. package/lib/@types/expoKeycloakAuth.d.mjs +0 -0
  33. package/lib/Authenticated.d.mts +0 -33
  34. package/lib/Authenticated.d.ts +0 -33
  35. package/lib/Authenticated.js +0 -19
  36. package/lib/Authenticated.mjs +0 -20
  37. package/lib/authConfig.d.mts +0 -14
  38. package/lib/authConfig.d.ts +0 -14
  39. package/lib/authConfig.js +0 -8
  40. package/lib/authConfig.mjs +0 -9
  41. package/lib/chunk-2GUOEPFY.mjs +0 -0
  42. package/lib/chunk-3ZPHNEJL.js +0 -11
  43. package/lib/chunk-64PPU7Q3.mjs +0 -13
  44. package/lib/chunk-6NDWOV55.js +0 -1
  45. package/lib/chunk-7MTPH6XK.mjs +0 -26
  46. package/lib/chunk-A7UBOIAL.js +0 -13
  47. package/lib/chunk-AD6VPMID.mjs +0 -20
  48. package/lib/chunk-AUUZ6BI7.js +0 -78
  49. package/lib/chunk-AYKQVWMR.mjs +0 -0
  50. package/lib/chunk-BVB33X7V.mjs +0 -265
  51. package/lib/chunk-C2FNSVJO.js +0 -17
  52. package/lib/chunk-J4CCMILN.mjs +0 -41
  53. package/lib/chunk-K33RKJZX.js +0 -443
  54. package/lib/chunk-KLLABHIC.js +0 -13
  55. package/lib/chunk-L5HMOY4M.mjs +0 -18
  56. package/lib/chunk-MZ6E62HK.js +0 -33
  57. package/lib/chunk-NWRANDZ6.js +0 -98
  58. package/lib/chunk-NXTVYIBR.mjs +0 -11
  59. package/lib/chunk-OYWAYMFN.js +0 -17
  60. package/lib/chunk-RPUOO7AV.mjs +0 -10
  61. package/lib/chunk-RYM7KERK.mjs +0 -52
  62. package/lib/chunk-UBVYEZI3.js +0 -1
  63. package/lib/chunk-UHTKOFS6.mjs +0 -84
  64. package/lib/chunk-UL6L5ONI.js +0 -460
  65. package/lib/chunk-UOKDJT5L.mjs +0 -16
  66. package/lib/chunk-W5DJLFTQ.js +0 -56
  67. package/lib/chunk-WT5W6BSZ.js +0 -161
  68. package/lib/chunk-XEO3YXBM.js +0 -22
  69. package/lib/chunk-XO4W2SMN.mjs +0 -50
  70. package/lib/chunk-XVPWAAZ4.mjs +0 -76
  71. package/lib/chunk-Y4XMF3R6.mjs +0 -13
  72. package/lib/chunk-YGNNHTFE.js +0 -12
  73. package/lib/hooks/index.d.mts +0 -9
  74. package/lib/hooks/index.d.ts +0 -9
  75. package/lib/hooks/index.js +0 -23
  76. package/lib/hooks/index.mjs +0 -34
  77. package/lib/hooks/useAuthConfig.d.mts +0 -6
  78. package/lib/hooks/useAuthConfig.d.ts +0 -6
  79. package/lib/hooks/useAuthConfig.js +0 -8
  80. package/lib/hooks/useAuthConfig.mjs +0 -8
  81. package/lib/hooks/useCurrentRouteName/index.d.mts +0 -3
  82. package/lib/hooks/useCurrentRouteName/index.d.ts +0 -3
  83. package/lib/hooks/useCurrentRouteName/index.js +0 -7
  84. package/lib/hooks/useCurrentRouteName/index.mjs +0 -7
  85. package/lib/hooks/useCurrentRouteName/index.native.d.mts +0 -3
  86. package/lib/hooks/useCurrentRouteName/index.native.d.ts +0 -3
  87. package/lib/hooks/useCurrentRouteName/index.native.js +0 -14
  88. package/lib/hooks/useCurrentRouteName/index.native.mjs +0 -14
  89. package/lib/hooks/useKeycloak/index.d.mts +0 -46
  90. package/lib/hooks/useKeycloak/index.d.ts +0 -46
  91. package/lib/hooks/useKeycloak/index.js +0 -11
  92. package/lib/hooks/useKeycloak/index.mjs +0 -12
  93. package/lib/hooks/useKeycloak/useKeycloak.d.mts +0 -2
  94. package/lib/hooks/useKeycloak/useKeycloak.d.ts +0 -2
  95. package/lib/hooks/useKeycloak/useKeycloak.js +0 -10
  96. package/lib/hooks/useKeycloak/useKeycloak.mjs +0 -11
  97. package/lib/hooks/useKeycloak/useKeycloak.native.d.mts +0 -20
  98. package/lib/hooks/useKeycloak/useKeycloak.native.d.ts +0 -20
  99. package/lib/hooks/useKeycloak/useKeycloak.native.js +0 -80
  100. package/lib/hooks/useKeycloak/useKeycloak.native.mjs +0 -69
  101. package/lib/hooks/useLogin.d.mts +0 -3
  102. package/lib/hooks/useLogin.d.ts +0 -3
  103. package/lib/hooks/useLogin.js +0 -11
  104. package/lib/hooks/useLogin.mjs +0 -11
  105. package/lib/hooks/useTokensFromQuery/index.d.mts +0 -3
  106. package/lib/hooks/useTokensFromQuery/index.d.ts +0 -3
  107. package/lib/hooks/useTokensFromQuery/index.js +0 -7
  108. package/lib/hooks/useTokensFromQuery/index.mjs +0 -7
  109. package/lib/hooks/useTokensFromQuery/index.native.d.mts +0 -3
  110. package/lib/hooks/useTokensFromQuery/index.native.d.ts +0 -3
  111. package/lib/hooks/useTokensFromQuery/index.native.js +0 -10
  112. package/lib/hooks/useTokensFromQuery/index.native.mjs +0 -7
  113. package/lib/hooks/useTokensFromState.d.mts +0 -3
  114. package/lib/hooks/useTokensFromState.d.ts +0 -3
  115. package/lib/hooks/useTokensFromState.js +0 -9
  116. package/lib/hooks/useTokensFromState.mjs +0 -9
  117. package/lib/index.d.mts +0 -13
  118. package/lib/index.d.ts +0 -13
  119. package/lib/index.js +0 -34
  120. package/lib/index.mjs +0 -56
  121. package/lib/provider/afterAuth.d.mts +0 -29
  122. package/lib/provider/afterAuth.d.ts +0 -29
  123. package/lib/provider/afterAuth.js +0 -18
  124. package/lib/provider/afterAuth.mjs +0 -18
  125. package/lib/provider/index.d.mts +0 -39
  126. package/lib/provider/index.d.ts +0 -39
  127. package/lib/provider/index.js +0 -22
  128. package/lib/provider/index.mjs +0 -25
  129. package/lib/provider/keycloakProvider.d.mts +0 -42
  130. package/lib/provider/keycloakProvider.d.ts +0 -42
  131. package/lib/provider/keycloakProvider.js +0 -20
  132. package/lib/provider/keycloakProvider.mjs +0 -21
  133. package/lib/provider/keycloakProvider.native.d.mts +0 -29
  134. package/lib/provider/keycloakProvider.native.d.ts +0 -29
  135. package/lib/provider/keycloakProvider.native.js +0 -87
  136. package/lib/provider/keycloakProvider.native.mjs +0 -30
  137. package/lib/state/index.d.mts +0 -11
  138. package/lib/state/index.d.ts +0 -11
  139. package/lib/state/index.js +0 -7
  140. package/lib/state/index.mjs +0 -7
  141. package/lib/types.d.mts +0 -17
  142. package/lib/types.d.ts +0 -17
  143. package/lib/types.js +0 -8
  144. package/lib/types.mjs +0 -7
  145. package/lib/util.d.mts +0 -4
  146. package/lib/util.d.ts +0 -4
  147. package/lib/util.js +0 -8
  148. package/lib/util.mjs +0 -9
  149. package/src/hooks/useCurrentRouteName/index.ts +0 -34
  150. package/src/hooks/useKeycloak/index.ts +0 -47
  151. package/src/hooks/useKeycloak/useKeycloak.native.ts +0 -95
  152. package/src/hooks/useKeycloak/useKeycloak.ts +0 -106
  153. package/src/hooks/useLogin.ts +0 -47
  154. package/src/provider/afterAuth.tsx +0 -65
  155. package/src/provider/index.tsx +0 -117
@@ -1,161 +0,0 @@
1
- "use strict";
2
- function _define_property(obj, key, value) {
3
- if (key in obj) {
4
- Object.defineProperty(obj, key, {
5
- value: value,
6
- enumerable: true,
7
- configurable: true,
8
- writable: true
9
- });
10
- } else {
11
- obj[key] = value;
12
- }
13
- return obj;
14
- }
15
- function _object_spread(target) {
16
- for(var i = 1; i < arguments.length; i++){
17
- var source = arguments[i] != null ? arguments[i] : {};
18
- var ownKeys = Object.keys(source);
19
- if (typeof Object.getOwnPropertySymbols === "function") {
20
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
- }));
23
- }
24
- ownKeys.forEach(function(key) {
25
- _define_property(target, key, source[key]);
26
- });
27
- }
28
- return target;
29
- }
30
- function ownKeys(object, enumerableOnly) {
31
- var keys = Object.keys(object);
32
- if (Object.getOwnPropertySymbols) {
33
- var symbols = Object.getOwnPropertySymbols(object);
34
- if (enumerableOnly) {
35
- symbols = symbols.filter(function(sym) {
36
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
- });
38
- }
39
- keys.push.apply(keys, symbols);
40
- }
41
- return keys;
42
- }
43
- function _object_spread_props(target, source) {
44
- source = source != null ? source : {};
45
- if (Object.getOwnPropertyDescriptors) {
46
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
47
- } else {
48
- ownKeys(Object(source)).forEach(function(key) {
49
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
- });
51
- }
52
- return target;
53
- }
54
- function _object_without_properties(source, excluded) {
55
- if (source == null) return {};
56
- var target = _object_without_properties_loose(source, excluded);
57
- var key, i;
58
- if (Object.getOwnPropertySymbols) {
59
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
60
- for(i = 0; i < sourceSymbolKeys.length; i++){
61
- key = sourceSymbolKeys[i];
62
- if (excluded.indexOf(key) >= 0) continue;
63
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
64
- target[key] = source[key];
65
- }
66
- }
67
- return target;
68
- }
69
- function _object_without_properties_loose(source, excluded) {
70
- if (source == null) return {};
71
- var target = {};
72
- var sourceKeys = Object.keys(source);
73
- var key, i;
74
- for(i = 0; i < sourceKeys.length; i++){
75
- key = sourceKeys[i];
76
- if (excluded.indexOf(key) >= 0) continue;
77
- target[key] = source[key];
78
- }
79
- return target;
80
- }
81
- Object.defineProperty(exports, "__esModule", {
82
- value: true
83
- });
84
- function _interopRequireDefault(obj) {
85
- return obj && obj.__esModule ? obj : {
86
- default: obj
87
- };
88
- }
89
- var _chunkK33RKJZXjs = require("./chunk-K33RKJZX.js");
90
- var _chunkKLLABHICjs = require("./chunk-KLLABHIC.js");
91
- var _chunkYGNNHTFEjs = require("./chunk-YGNNHTFE.js");
92
- var _chunkA7UBOIALjs = require("./chunk-A7UBOIAL.js");
93
- // src/provider/index.tsx
94
- var _react = require("react");
95
- var _react2 = _interopRequireDefault(_react);
96
- var _config = require("app/config");
97
- var persist = _config.config.get("KEYCLOAK_PERSIST") === "1";
98
- var AuthProvider = function(_param) {
99
- var // keycloak config
100
- realm = _param.realm, clientId = _param.clientId, baseUrl = _param.baseUrl, // auth config
101
- debug = _param.debug, ensureFreshness = _param.ensureFreshness, loginRoute = _param.loginRoute, messageHandlerKeys = _param.messageHandlerKeys, ssr = _param.ssr, // props
102
- children = _param.children, cookies = _param.cookies, disabled = _param.disabled, loadingComponent = _param.loadingComponent, onEvent = _param.onEvent, onTokens = _param.onTokens, keycloakInitOptions = _object_without_properties(_param, [
103
- "realm",
104
- "clientId",
105
- "baseUrl",
106
- "debug",
107
- "ensureFreshness",
108
- "loginRoute",
109
- "messageHandlerKeys",
110
- "ssr",
111
- "children",
112
- "cookies",
113
- "disabled",
114
- "loadingComponent",
115
- "onEvent",
116
- "onTokens"
117
- ]);
118
- var tokensFromQuery = _chunkKLLABHICjs.useTokensFromQuery.call(void 0);
119
- var tokensFromState = _chunkYGNNHTFEjs.useTokensFromState.call(void 0);
120
- var authConfig = _react.useMemo.call(void 0, function() {
121
- return _object_spread_props(_object_spread({}, _chunkA7UBOIALjs.defaultAuthConfig, typeof debug !== "undefined" ? {
122
- debug: debug
123
- } : {}, typeof ensureFreshness !== "undefined" ? {
124
- ensureFreshness: ensureFreshness
125
- } : {}, typeof loginRoute !== "undefined" ? {
126
- loginRoute: loginRoute
127
- } : {}, typeof messageHandlerKeys !== "undefined" ? {
128
- messageHandlerKeys: messageHandlerKeys
129
- } : {}), {
130
- persist: !tokensFromState && !tokensFromQuery && cookies && ssr ? false : typeof persist !== "undefined" ? persist : _chunkA7UBOIALjs.defaultAuthConfig.persist,
131
- ssr: !tokensFromState && !tokensFromQuery && cookies ? typeof ssr !== "undefined" ? ssr : _chunkA7UBOIALjs.defaultAuthConfig.ssr : false
132
- });
133
- }, [
134
- debug,
135
- ensureFreshness,
136
- loginRoute,
137
- messageHandlerKeys,
138
- persist,
139
- ssr
140
- ]);
141
- if (disabled) {
142
- return /* @__PURE__ */ _react2.default.createElement(_chunkA7UBOIALjs.AuthConfigContext.Provider, {
143
- value: authConfig
144
- }, children);
145
- }
146
- return /* @__PURE__ */ _react2.default.createElement(_chunkA7UBOIALjs.AuthConfigContext.Provider, {
147
- value: authConfig
148
- }, /* @__PURE__ */ _react2.default.createElement(_chunkK33RKJZXjs.KeycloakProvider, {
149
- cookies: cookies,
150
- keycloakConfig: {
151
- realm: realm || "main",
152
- clientId: clientId || "app",
153
- url: baseUrl
154
- },
155
- keycloakInitOptions: keycloakInitOptions,
156
- loadingComponent: loadingComponent,
157
- onEvent: onEvent,
158
- onTokens: onTokens
159
- }, children));
160
- };
161
- exports.AuthProvider = AuthProvider;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- function _type_of(obj) {
3
- "@swc/helpers - typeof";
4
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5
- }
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- var __defProp = Object.defineProperty;
10
- var __defNormalProp = function(obj, key, value) {
11
- return key in obj ? __defProp(obj, key, {
12
- enumerable: true,
13
- configurable: true,
14
- writable: true,
15
- value: value
16
- }) : obj[key] = value;
17
- };
18
- var __publicField = function(obj, key, value) {
19
- __defNormalProp(obj, (typeof key === "undefined" ? "undefined" : _type_of(key)) !== "symbol" ? key + "" : key, value);
20
- return value;
21
- };
22
- exports.__publicField = __publicField;
@@ -1,50 +0,0 @@
1
- import {
2
- useKeycloak
3
- } from "./chunk-UHTKOFS6.mjs";
4
- import {
5
- useAuthConfig
6
- } from "./chunk-Y4XMF3R6.mjs";
7
- import {
8
- useAuthState
9
- } from "./chunk-AD6VPMID.mjs";
10
-
11
- // src/provider/afterAuth.tsx
12
- import React, { useEffect } from "react";
13
- var logger = console;
14
- var AfterAuth = ({ children }) => {
15
- const authConfig = useAuthConfig();
16
- const authState = useAuthState();
17
- const { token, refreshToken, authenticated, idToken } = useKeycloak();
18
- useEffect(() => {
19
- if (!authenticated)
20
- return;
21
- if (authConfig.persist && token) {
22
- authState.setToken(token);
23
- if (idToken)
24
- authState.setIdToken(idToken);
25
- if (authConfig.ensureFreshness && refreshToken)
26
- authState.setRefreshToken(refreshToken);
27
- }
28
- }, [token, refreshToken, idToken]);
29
- useEffect(() => {
30
- if (authConfig.debug && authState.token)
31
- logger.debug("token", authState.token);
32
- }, [authState.token]);
33
- useEffect(() => {
34
- if (authConfig.debug && authState.idToken)
35
- logger.debug("idToken", authState.idToken);
36
- }, [authState.idToken]);
37
- useEffect(() => {
38
- if (authConfig.debug && authState.refreshToken)
39
- logger.debug("refreshToken", authState.refreshToken);
40
- }, [authState.refreshToken]);
41
- useEffect(() => {
42
- if (authConfig.debug)
43
- logger.debug("authenticated", authenticated);
44
- }, [authenticated]);
45
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
46
- };
47
-
48
- export {
49
- AfterAuth
50
- };
@@ -1,76 +0,0 @@
1
- import {
2
- KeycloakProvider
3
- } from "./chunk-BVB33X7V.mjs";
4
- import {
5
- useTokensFromQuery
6
- } from "./chunk-NXTVYIBR.mjs";
7
- import {
8
- useTokensFromState
9
- } from "./chunk-UOKDJT5L.mjs";
10
- import {
11
- AuthConfigContext,
12
- defaultAuthConfig
13
- } from "./chunk-64PPU7Q3.mjs";
14
-
15
- // src/provider/index.tsx
16
- import React, { useMemo } from "react";
17
- import { config } from "app/config";
18
- var persist = config.get("KEYCLOAK_PERSIST") === "1";
19
- var AuthProvider = ({
20
- // keycloak config
21
- realm,
22
- clientId,
23
- baseUrl,
24
- // auth config
25
- debug,
26
- ensureFreshness,
27
- loginRoute,
28
- messageHandlerKeys,
29
- ssr,
30
- // props
31
- children,
32
- cookies,
33
- disabled,
34
- loadingComponent,
35
- onEvent,
36
- onTokens,
37
- ...keycloakInitOptions
38
- }) => {
39
- const tokensFromQuery = useTokensFromQuery();
40
- const tokensFromState = useTokensFromState();
41
- const authConfig = useMemo(
42
- () => ({
43
- ...defaultAuthConfig,
44
- ...typeof debug !== "undefined" ? { debug } : {},
45
- ...typeof ensureFreshness !== "undefined" ? { ensureFreshness } : {},
46
- ...typeof loginRoute !== "undefined" ? { loginRoute } : {},
47
- ...typeof messageHandlerKeys !== "undefined" ? { messageHandlerKeys } : {},
48
- persist: !tokensFromState && !tokensFromQuery && cookies && ssr ? false : typeof persist !== "undefined" ? persist : defaultAuthConfig.persist,
49
- ssr: !tokensFromState && !tokensFromQuery && cookies ? typeof ssr !== "undefined" ? ssr : defaultAuthConfig.ssr : false
50
- }),
51
- [debug, ensureFreshness, loginRoute, messageHandlerKeys, persist, ssr]
52
- );
53
- if (disabled) {
54
- return /* @__PURE__ */ React.createElement(AuthConfigContext.Provider, { value: authConfig }, children);
55
- }
56
- return /* @__PURE__ */ React.createElement(AuthConfigContext.Provider, { value: authConfig }, /* @__PURE__ */ React.createElement(
57
- KeycloakProvider,
58
- {
59
- cookies,
60
- keycloakConfig: {
61
- realm: realm || "main",
62
- clientId: clientId || "app",
63
- url: baseUrl
64
- },
65
- keycloakInitOptions,
66
- loadingComponent,
67
- onEvent,
68
- onTokens
69
- },
70
- children
71
- ));
72
- };
73
-
74
- export {
75
- AuthProvider
76
- };
@@ -1,13 +0,0 @@
1
- import {
2
- AuthConfigContext
3
- } from "./chunk-64PPU7Q3.mjs";
4
-
5
- // src/hooks/useAuthConfig.ts
6
- import { useContext } from "react";
7
- function useAuthConfig() {
8
- return useContext(AuthConfigContext);
9
- }
10
-
11
- export {
12
- useAuthConfig
13
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- var _chunkC2FNSVJOjs = require("./chunk-C2FNSVJO.js");
6
- var _chunkNWRANDZ6js = require("./chunk-NWRANDZ6.js");
7
- // src/hooks/useTokensFromState.ts
8
- function useTokensFromState() {
9
- var authState = _chunkC2FNSVJOjs.useAuthState.call(void 0);
10
- return !!_chunkNWRANDZ6js.validToken.call(void 0, authState.token, authState.refreshToken);
11
- }
12
- exports.useTokensFromState = useTokensFromState;
@@ -1,9 +0,0 @@
1
- export { useAuthConfig } from './useAuthConfig.mjs';
2
- export { useCurrentRouteName } from './useCurrentRouteName/index.mjs';
3
- export { IKeycloak, ITokenParsed, Keycloak, useKeycloak } from './useKeycloak/index.mjs';
4
- export { useLogin } from './useLogin.mjs';
5
- export { useTokensFromQuery } from './useTokensFromQuery/index.mjs';
6
- export { useTokensFromState } from './useTokensFromState.mjs';
7
- import '../authConfig.mjs';
8
- import 'react';
9
- import '@bitspur/keycloak-js';
@@ -1,9 +0,0 @@
1
- export { useAuthConfig } from './useAuthConfig.js';
2
- export { useCurrentRouteName } from './useCurrentRouteName/index.js';
3
- export { IKeycloak, ITokenParsed, Keycloak, useKeycloak } from './useKeycloak/index.js';
4
- export { useLogin } from './useLogin.js';
5
- export { useTokensFromQuery } from './useTokensFromQuery/index.js';
6
- export { useTokensFromState } from './useTokensFromState.js';
7
- import '../authConfig.js';
8
- import 'react';
9
- import '@bitspur/keycloak-js';
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- require("../chunk-UBVYEZI3.js");
6
- require("../chunk-6NDWOV55.js");
7
- var _chunkKLLABHICjs = require("../chunk-KLLABHIC.js");
8
- var _chunkMZ6E62HKjs = require("../chunk-MZ6E62HK.js");
9
- var _chunkOYWAYMFNjs = require("../chunk-OYWAYMFN.js");
10
- var _chunkUL6L5ONIjs = require("../chunk-UL6L5ONI.js");
11
- var _chunk3ZPHNEJLjs = require("../chunk-3ZPHNEJL.js");
12
- var _chunkYGNNHTFEjs = require("../chunk-YGNNHTFE.js");
13
- require("../chunk-C2FNSVJO.js");
14
- require("../chunk-A7UBOIAL.js");
15
- require("../chunk-NWRANDZ6.js");
16
- require("../chunk-XEO3YXBM.js");
17
- exports.Keycloak = _chunkUL6L5ONIjs.Keycloak;
18
- exports.useAuthConfig = _chunk3ZPHNEJLjs.useAuthConfig;
19
- exports.useCurrentRouteName = _chunkOYWAYMFNjs.useCurrentRouteName;
20
- exports.useKeycloak = _chunkUL6L5ONIjs.useKeycloak;
21
- exports.useLogin = _chunkMZ6E62HKjs.useLogin;
22
- exports.useTokensFromQuery = _chunkKLLABHICjs.useTokensFromQuery;
23
- exports.useTokensFromState = _chunkYGNNHTFEjs.useTokensFromState;
@@ -1,34 +0,0 @@
1
- import "../chunk-AYKQVWMR.mjs";
2
- import "../chunk-2GUOEPFY.mjs";
3
- import {
4
- useTokensFromQuery
5
- } from "../chunk-NXTVYIBR.mjs";
6
- import {
7
- useLogin
8
- } from "../chunk-J4CCMILN.mjs";
9
- import {
10
- useCurrentRouteName
11
- } from "../chunk-L5HMOY4M.mjs";
12
- import {
13
- Keycloak,
14
- useKeycloak
15
- } from "../chunk-UHTKOFS6.mjs";
16
- import {
17
- useAuthConfig
18
- } from "../chunk-Y4XMF3R6.mjs";
19
- import {
20
- useTokensFromState
21
- } from "../chunk-UOKDJT5L.mjs";
22
- import "../chunk-AD6VPMID.mjs";
23
- import "../chunk-64PPU7Q3.mjs";
24
- import "../chunk-7MTPH6XK.mjs";
25
- import "../chunk-RPUOO7AV.mjs";
26
- export {
27
- Keycloak,
28
- useAuthConfig,
29
- useCurrentRouteName,
30
- useKeycloak,
31
- useLogin,
32
- useTokensFromQuery,
33
- useTokensFromState
34
- };
@@ -1,6 +0,0 @@
1
- import { AuthConfig } from '../authConfig.mjs';
2
- import 'react';
3
-
4
- declare function useAuthConfig(): AuthConfig;
5
-
6
- export { useAuthConfig };
@@ -1,6 +0,0 @@
1
- import { AuthConfig } from '../authConfig.js';
2
- import 'react';
3
-
4
- declare function useAuthConfig(): AuthConfig;
5
-
6
- export { useAuthConfig };
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- var _chunk3ZPHNEJLjs = require("../chunk-3ZPHNEJL.js");
6
- require("../chunk-A7UBOIAL.js");
7
- require("../chunk-XEO3YXBM.js");
8
- exports.useAuthConfig = _chunk3ZPHNEJLjs.useAuthConfig;
@@ -1,8 +0,0 @@
1
- import {
2
- useAuthConfig
3
- } from "../chunk-Y4XMF3R6.mjs";
4
- import "../chunk-64PPU7Q3.mjs";
5
- import "../chunk-RPUOO7AV.mjs";
6
- export {
7
- useAuthConfig
8
- };
@@ -1,3 +0,0 @@
1
- declare function useCurrentRouteName(): string | null;
2
-
3
- export { useCurrentRouteName };
@@ -1,3 +0,0 @@
1
- declare function useCurrentRouteName(): string | null;
2
-
3
- export { useCurrentRouteName };
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- var _chunkOYWAYMFNjs = require("../../chunk-OYWAYMFN.js");
6
- require("../../chunk-XEO3YXBM.js");
7
- exports.useCurrentRouteName = _chunkOYWAYMFNjs.useCurrentRouteName;
@@ -1,7 +0,0 @@
1
- import {
2
- useCurrentRouteName
3
- } from "../../chunk-L5HMOY4M.mjs";
4
- import "../../chunk-RPUOO7AV.mjs";
5
- export {
6
- useCurrentRouteName
7
- };
@@ -1,3 +0,0 @@
1
- declare function useCurrentRouteName(): string | null;
2
-
3
- export { useCurrentRouteName };
@@ -1,3 +0,0 @@
1
- declare function useCurrentRouteName(): string | null;
2
-
3
- export { useCurrentRouteName };
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- require("../../chunk-XEO3YXBM.js");
6
- // src/hooks/useCurrentRouteName/index.native.ts
7
- var _multiplatformone = require("multiplatform.one");
8
- var _native = require("@react-navigation/native");
9
- function useCurrentRouteName() {
10
- if (_multiplatformone.MultiPlatform.isStorybook) return null;
11
- var route = _native.useRoute.call(void 0);
12
- return route.name;
13
- }
14
- exports.useCurrentRouteName = useCurrentRouteName;
@@ -1,14 +0,0 @@
1
- import "../../chunk-RPUOO7AV.mjs";
2
-
3
- // src/hooks/useCurrentRouteName/index.native.ts
4
- import { MultiPlatform } from "multiplatform.one";
5
- import { useRoute } from "@react-navigation/native";
6
- function useCurrentRouteName() {
7
- if (MultiPlatform.isStorybook)
8
- return null;
9
- const route = useRoute();
10
- return route.name;
11
- }
12
- export {
13
- useCurrentRouteName
14
- };
@@ -1,46 +0,0 @@
1
- import * as _bitspur_keycloak_js from '@bitspur/keycloak-js';
2
- import { KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess } from '@bitspur/keycloak-js';
3
-
4
- declare function useKeycloak(): Keycloak;
5
- declare class Keycloak implements IKeycloak {
6
- private readonly keycloak;
7
- authenticated?: boolean;
8
- constructor(keycloak: IKeycloak | undefined, initialized: boolean);
9
- get idToken(): string | undefined;
10
- get realmAccess(): _bitspur_keycloak_js.KeycloakRoles | undefined;
11
- get refreshToken(): string | undefined;
12
- get refreshTokenParsed(): _bitspur_keycloak_js.KeycloakTokenParsed | undefined;
13
- get resourceAccess(): _bitspur_keycloak_js.KeycloakResourceAccess | undefined;
14
- get subject(): string | undefined;
15
- get token(): string | undefined;
16
- get tokenParsed(): ITokenParsed | undefined;
17
- get email(): any;
18
- get username(): string | undefined;
19
- login(): Promise<unknown>;
20
- logout(): Promise<unknown>;
21
- }
22
-
23
- interface IKeycloak {
24
- authenticated?: boolean;
25
- idToken?: string;
26
- realmAccess?: KeycloakRoles;
27
- refreshToken?: string;
28
- refreshTokenParsed?: KeycloakTokenParsed;
29
- resourceAccess?: KeycloakResourceAccess;
30
- subject?: string;
31
- token?: string;
32
- tokenParsed?: ITokenParsed;
33
- email?: string;
34
- username?: string;
35
- login: () => Promise<unknown>;
36
- logout: () => Promise<unknown>;
37
- }
38
- interface ITokenParsed extends KeycloakTokenParsed {
39
- 'allowed-origins'?: string[];
40
- email_verified?: boolean;
41
- preferred_username?: string;
42
- scope?: string;
43
- sid?: string;
44
- }
45
-
46
- export { type IKeycloak, type ITokenParsed, Keycloak, useKeycloak };
@@ -1,46 +0,0 @@
1
- import * as _bitspur_keycloak_js from '@bitspur/keycloak-js';
2
- import { KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess } from '@bitspur/keycloak-js';
3
-
4
- declare function useKeycloak(): Keycloak;
5
- declare class Keycloak implements IKeycloak {
6
- private readonly keycloak;
7
- authenticated?: boolean;
8
- constructor(keycloak: IKeycloak | undefined, initialized: boolean);
9
- get idToken(): string | undefined;
10
- get realmAccess(): _bitspur_keycloak_js.KeycloakRoles | undefined;
11
- get refreshToken(): string | undefined;
12
- get refreshTokenParsed(): _bitspur_keycloak_js.KeycloakTokenParsed | undefined;
13
- get resourceAccess(): _bitspur_keycloak_js.KeycloakResourceAccess | undefined;
14
- get subject(): string | undefined;
15
- get token(): string | undefined;
16
- get tokenParsed(): ITokenParsed | undefined;
17
- get email(): any;
18
- get username(): string | undefined;
19
- login(): Promise<unknown>;
20
- logout(): Promise<unknown>;
21
- }
22
-
23
- interface IKeycloak {
24
- authenticated?: boolean;
25
- idToken?: string;
26
- realmAccess?: KeycloakRoles;
27
- refreshToken?: string;
28
- refreshTokenParsed?: KeycloakTokenParsed;
29
- resourceAccess?: KeycloakResourceAccess;
30
- subject?: string;
31
- token?: string;
32
- tokenParsed?: ITokenParsed;
33
- email?: string;
34
- username?: string;
35
- login: () => Promise<unknown>;
36
- logout: () => Promise<unknown>;
37
- }
38
- interface ITokenParsed extends KeycloakTokenParsed {
39
- 'allowed-origins'?: string[];
40
- email_verified?: boolean;
41
- preferred_username?: string;
42
- scope?: string;
43
- sid?: string;
44
- }
45
-
46
- export { type IKeycloak, type ITokenParsed, Keycloak, useKeycloak };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- require("../../chunk-6NDWOV55.js");
6
- var _chunkUL6L5ONIjs = require("../../chunk-UL6L5ONI.js");
7
- require("../../chunk-3ZPHNEJL.js");
8
- require("../../chunk-A7UBOIAL.js");
9
- require("../../chunk-XEO3YXBM.js");
10
- exports.Keycloak = _chunkUL6L5ONIjs.Keycloak;
11
- exports.useKeycloak = _chunkUL6L5ONIjs.useKeycloak;
@@ -1,12 +0,0 @@
1
- import "../../chunk-2GUOEPFY.mjs";
2
- import {
3
- Keycloak,
4
- useKeycloak
5
- } from "../../chunk-UHTKOFS6.mjs";
6
- import "../../chunk-Y4XMF3R6.mjs";
7
- import "../../chunk-64PPU7Q3.mjs";
8
- import "../../chunk-RPUOO7AV.mjs";
9
- export {
10
- Keycloak,
11
- useKeycloak
12
- };
@@ -1,2 +0,0 @@
1
- export { Keycloak, useKeycloak } from './index.mjs';
2
- import '@bitspur/keycloak-js';
@@ -1,2 +0,0 @@
1
- export { Keycloak, useKeycloak } from './index.js';
2
- import '@bitspur/keycloak-js';
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- var _chunkUL6L5ONIjs = require("../../chunk-UL6L5ONI.js");
6
- require("../../chunk-3ZPHNEJL.js");
7
- require("../../chunk-A7UBOIAL.js");
8
- require("../../chunk-XEO3YXBM.js");
9
- exports.Keycloak = _chunkUL6L5ONIjs.Keycloak;
10
- exports.useKeycloak = _chunkUL6L5ONIjs.useKeycloak;