@iblai/web-utils 1.2.12 → 1.2.13
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type AuditLogChange = [oldValue: string, newValue: string];
|
|
1
2
|
export interface AuditLogEntry {
|
|
2
3
|
id: number;
|
|
3
4
|
timestamp: string;
|
|
@@ -7,10 +8,7 @@ export interface AuditLogEntry {
|
|
|
7
8
|
resource_type: string;
|
|
8
9
|
resource_id: string;
|
|
9
10
|
resource_repr: string;
|
|
10
|
-
changes: Record<string,
|
|
11
|
-
old?: unknown;
|
|
12
|
-
new?: unknown;
|
|
13
|
-
}>;
|
|
11
|
+
changes: Record<string, AuditLogChange>;
|
|
14
12
|
}
|
|
15
13
|
export type AuditLogsResponse = {
|
|
16
14
|
count: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -814,7 +814,7 @@ declare const isWeb: () => boolean;
|
|
|
814
814
|
declare const isNode: () => string | false;
|
|
815
815
|
declare const isExpo: () => any;
|
|
816
816
|
declare const isTauri: () => boolean;
|
|
817
|
-
declare const getPlatform: () => "
|
|
817
|
+
declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
|
|
818
818
|
declare const safeRequire: (moduleName: string) => any;
|
|
819
819
|
declare const getNextNavigation: () => any;
|
|
820
820
|
|
|
@@ -1532,7 +1532,7 @@ type Props$2 = {
|
|
|
1532
1532
|
* 4. Handles redirects to auth SPA when needed
|
|
1533
1533
|
* 5. Manages public route access state
|
|
1534
1534
|
*/
|
|
1535
|
-
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1535
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1536
1536
|
|
|
1537
1537
|
/**
|
|
1538
1538
|
* Props for the MentorProvider component
|
|
@@ -1565,7 +1565,7 @@ type Props$1 = {
|
|
|
1565
1565
|
* 3. Manages redirection based on mentor availability
|
|
1566
1566
|
* 4. Integrates with tenant context for access control
|
|
1567
1567
|
*/
|
|
1568
|
-
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1568
|
+
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1569
1569
|
|
|
1570
1570
|
/**
|
|
1571
1571
|
* Type definition for the tenant context
|
|
@@ -1628,7 +1628,7 @@ type Props = {
|
|
|
1628
1628
|
* 4. Handles tenant-specific domain redirects
|
|
1629
1629
|
* 5. Maintains tenant access state
|
|
1630
1630
|
*/
|
|
1631
|
-
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, }: Props): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1631
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, }: Props): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1632
1632
|
|
|
1633
1633
|
/**
|
|
1634
1634
|
* Chat area size constants
|
package/dist/index.esm.js
CHANGED
|
@@ -730,7 +730,7 @@ const LOCAL_STORAGE_KEYS = {
|
|
|
730
730
|
USER_DATA: "userData",
|
|
731
731
|
USER_TENANTS: "tenants",
|
|
732
732
|
EDX_TOKEN_KEY: "edx_jwt_token",
|
|
733
|
-
DM_TOKEN_KEY: "
|
|
733
|
+
DM_TOKEN_KEY: "dm_token",
|
|
734
734
|
DM_TOKEN_EXPIRES: "dm_token_expires",
|
|
735
735
|
};
|
|
736
736
|
const TOOLS = {
|
|
@@ -2992,9 +2992,9 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
|
|
|
2992
2992
|
// Check JWT token expiry and force logout for protected routes
|
|
2993
2993
|
if (isProtectedRoute && storageService) {
|
|
2994
2994
|
const dmTokenInLocalStorage = await storageService.getItem(LOCAL_STORAGE_KEYS.DM_TOKEN_KEY);
|
|
2995
|
+
console.log('[auth-redirect] local storage keys ', LOCAL_STORAGE_KEYS);
|
|
2995
2996
|
const dmTokenExpired = await isDmTokenExpired(storageService);
|
|
2996
2997
|
if (!dmTokenInLocalStorage || dmTokenExpired) {
|
|
2997
|
-
console.log();
|
|
2998
2998
|
if (!!dmTokenInLocalStorage) {
|
|
2999
2999
|
console.log("[auth-redirect] DM token doesn't exists");
|
|
3000
3000
|
}
|