academe-kit 0.3.6 → 0.3.7
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.
- package/dist/index.d.ts +6 -1
- package/dist/index.esm.js +16 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/roles/applications.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10251,6 +10251,11 @@ declare enum APPLICATIONS_ROLES {
|
|
|
10251
10251
|
ACCESS_MIKE = "Acesso mike",
|
|
10252
10252
|
VIEW_WIDGET = "Visualizar Widget"
|
|
10253
10253
|
}
|
|
10254
|
+
declare enum MIKE_ROLES {
|
|
10255
|
+
ACCESS_ROLEPLAY = "Acesso roleplay",
|
|
10256
|
+
ACCESS_JOURNEYS = "Acesso jornadas",
|
|
10257
|
+
ACCESS_FREEPLAY = "Acesso freeplay"
|
|
10258
|
+
}
|
|
10254
10259
|
|
|
10255
|
-
export { APPLICATIONS_ROLES, AcademeAuthProvider, BACKOFFICE_ROLES, Button, DASHBOARD_ROLES, GLOBAL_ROLES, ProtectedApp, ProtectedComponent, ProtectedRouter, Spinner, academeApi_d as apiTypes, cn, createAcademeApiClient, index_d as types, useAcademeAuth };
|
|
10260
|
+
export { APPLICATIONS_ROLES, AcademeAuthProvider, BACKOFFICE_ROLES, Button, DASHBOARD_ROLES, GLOBAL_ROLES, MIKE_ROLES, ProtectedApp, ProtectedComponent, ProtectedRouter, Spinner, academeApi_d as apiTypes, cn, createAcademeApiClient, index_d as types, useAcademeAuth };
|
|
10256
10261
|
export type { AcademeApiClient, AcademeKeycloakContextProps, AcademeUser, ButtonProps, KeycloakUser, SecurityContextType, SecurityProviderProps };
|
package/dist/index.esm.js
CHANGED
|
@@ -4946,7 +4946,9 @@ const AcademeAuthProvider = ({ realm, hubUrl, children, clientId, keycloakUrl, a
|
|
|
4946
4946
|
const oidcConfig = {
|
|
4947
4947
|
authority: `${keycloakUrl}/realms/${realm}`,
|
|
4948
4948
|
client_id: clientId,
|
|
4949
|
-
redirect_uri: window
|
|
4949
|
+
redirect_uri: typeof window !== "undefined"
|
|
4950
|
+
? window.location.origin
|
|
4951
|
+
: process.env.NEXT_PUBLIC_REDIRECT_URI,
|
|
4950
4952
|
scope: "openid profile email",
|
|
4951
4953
|
onSigninCallback: () => {
|
|
4952
4954
|
window.history.replaceState({}, document.title, window.location.pathname);
|
|
@@ -4969,7 +4971,6 @@ const SecurityContext = createContext({
|
|
|
4969
4971
|
services: null,
|
|
4970
4972
|
accessToken: undefined,
|
|
4971
4973
|
});
|
|
4972
|
-
console.log("hey!!");
|
|
4973
4974
|
// Função pura fora do componente - sem re-criação
|
|
4974
4975
|
const decodeAccessToken = (token) => {
|
|
4975
4976
|
if (!token)
|
|
@@ -5025,10 +5026,14 @@ const SecurityProvider = ({ apiBaseUrl = "https://stg-api.academe.com.br", skipA
|
|
|
5025
5026
|
return request;
|
|
5026
5027
|
},
|
|
5027
5028
|
});
|
|
5028
|
-
window
|
|
5029
|
+
if (typeof window !== "undefined") {
|
|
5030
|
+
window.accessToken = accessToken;
|
|
5031
|
+
}
|
|
5029
5032
|
}
|
|
5030
5033
|
else {
|
|
5031
|
-
window
|
|
5034
|
+
if (typeof window !== "undefined") {
|
|
5035
|
+
window.accessToken = undefined;
|
|
5036
|
+
}
|
|
5032
5037
|
}
|
|
5033
5038
|
}, [accessToken, apiClient]);
|
|
5034
5039
|
// --- 3. Helpers de Usuário e Roles ---
|
|
@@ -8348,6 +8353,12 @@ var APPLICATIONS_ROLES;
|
|
|
8348
8353
|
APPLICATIONS_ROLES["ACCESS_MIKE"] = "Acesso mike";
|
|
8349
8354
|
APPLICATIONS_ROLES["VIEW_WIDGET"] = "Visualizar Widget";
|
|
8350
8355
|
})(APPLICATIONS_ROLES || (APPLICATIONS_ROLES = {}));
|
|
8356
|
+
var MIKE_ROLES;
|
|
8357
|
+
(function (MIKE_ROLES) {
|
|
8358
|
+
MIKE_ROLES["ACCESS_ROLEPLAY"] = "Acesso roleplay";
|
|
8359
|
+
MIKE_ROLES["ACCESS_JOURNEYS"] = "Acesso jornadas";
|
|
8360
|
+
MIKE_ROLES["ACCESS_FREEPLAY"] = "Acesso freeplay";
|
|
8361
|
+
})(MIKE_ROLES || (MIKE_ROLES = {}));
|
|
8351
8362
|
|
|
8352
8363
|
var index = /*#__PURE__*/Object.freeze({
|
|
8353
8364
|
__proto__: null
|
|
@@ -8362,5 +8373,5 @@ var academeApi = /*#__PURE__*/Object.freeze({
|
|
|
8362
8373
|
__proto__: null
|
|
8363
8374
|
});
|
|
8364
8375
|
|
|
8365
|
-
export { APPLICATIONS_ROLES, AcademeAuthProvider, BACKOFFICE_ROLES, Button, DASHBOARD_ROLES, GLOBAL_ROLES, ProtectedApp, ProtectedComponent, ProtectedRouter, Spinner, academeApi as apiTypes, cn, createAcademeApiClient, index as types, useAcademeAuth };
|
|
8376
|
+
export { APPLICATIONS_ROLES, AcademeAuthProvider, BACKOFFICE_ROLES, Button, DASHBOARD_ROLES, GLOBAL_ROLES, MIKE_ROLES, ProtectedApp, ProtectedComponent, ProtectedRouter, Spinner, academeApi as apiTypes, cn, createAcademeApiClient, index as types, useAcademeAuth };
|
|
8366
8377
|
//# sourceMappingURL=index.esm.js.map
|