@fluxo-dev/api-client-base 25.1.12 → 25.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluxo-dev/api-client-base",
3
- "version": "25.1.12",
3
+ "version": "25.2.2",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "react": "^18.3.1",
@@ -8,7 +8,7 @@
8
8
  "react-router-dom": "^6.11.2",
9
9
  "react-redux": "^8.0.5",
10
10
  "@reduxjs/toolkit": "^1.9.1",
11
- "@fluxo-dev/state": "^25.1.12"
11
+ "@fluxo-dev/state": "^25.2.2"
12
12
  },
13
13
  "main": "./index.cjs.js",
14
14
  "types": "./index.cjs.d.ts"
package/src/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from './lib/security/user';
13
13
  export * from './lib/security/apikey';
14
14
  export * from './lib/security/domain-role';
15
15
  export * from './lib/security/permission';
16
+ export * from './lib/auth';
16
17
  export * from './lib/communication';
17
18
  export * from './lib/korebi';
18
19
  export * from './lib/apps';
@@ -33,7 +33,7 @@ export interface EmbeddedModuleNavigation {
33
33
  export interface EmbeddedModuleRoute {
34
34
  route?: string;
35
35
  component?: any;
36
- title?: string;
36
+ title: string;
37
37
  routes?: EmbeddedModuleRoute[];
38
38
  isPublic?: boolean;
39
39
  }
@@ -1,9 +1,40 @@
1
+ import { SecurityPolicyInfo } from '../security/user';
2
+ export interface FluxoUserProfile {
3
+ userId: string;
4
+ firstname: string;
5
+ lastname: string;
6
+ username: string;
7
+ email: string;
8
+ lastLogin: string | null;
9
+ domainRoles: {
10
+ [key: string]: string;
11
+ };
12
+ roles: string[];
13
+ twoFactorEnabled: boolean;
14
+ canChangePassword: boolean;
15
+ canHandle2FA: boolean;
16
+ }
1
17
  export declare class AuthService {
2
18
  private isRefreshingToken;
3
19
  constructor();
4
20
  setup(): Promise<void>;
21
+ getProfile(): Promise<FluxoUserProfile | null>;
5
22
  private tryAutoLogin;
6
- login(username: string, password: string): Promise<boolean>;
23
+ login(username: string, password: string): Promise<{
24
+ success: boolean;
25
+ require2FA: boolean;
26
+ userId: string;
27
+ }>;
28
+ verify2FA(code: string, userId: string): Promise<boolean>;
29
+ enable2FA(userId: string): Promise<{
30
+ qrCodeUri: string;
31
+ sharedKey: string;
32
+ } | null>;
33
+ confirmEnable2FA(code: string, userId: string): Promise<{
34
+ recoveryCodes: string[];
35
+ }>;
36
+ disable2FA(userId: string): Promise<boolean>;
37
+ updateSecurityPolicyInfo(userId: string, info: SecurityPolicyInfo): Promise<void>;
7
38
  logout(): void;
8
39
  refreshToken(): Promise<boolean>;
9
40
  static getJwtTokenRemainingLifetime(): number | null;
@@ -0,0 +1 @@
1
+ export { FluxoUserProfile } from './auth-service';
@@ -0,0 +1,36 @@
1
+ export declare class TabSyncAuthManager {
2
+ private static _instance;
3
+ private broadcastChannel;
4
+ private tabId;
5
+ private refreshTokenAction;
6
+ private onErrorCallback;
7
+ private refreshTimeout;
8
+ private heartbeatInterval;
9
+ private lockCleanupInterval;
10
+ private isDestroyed;
11
+ private constructor();
12
+ static Init(refreshAction: () => Promise<boolean>, onErrorCallback: () => void): void;
13
+ static get Instance(): TabSyncAuthManager;
14
+ private generateTabId;
15
+ private initBroadcastChannel;
16
+ private setupIntervals;
17
+ private setupEventListeners;
18
+ private handleTabMessage;
19
+ private handleTokenRefreshed;
20
+ private handleTokenRefreshFailed;
21
+ private syncWithStoredToken;
22
+ startRefreshTimer(timeoutMs: number): Promise<void>;
23
+ stopRefreshTimer(): void;
24
+ start(timeoutMs: number): void;
25
+ stop(): void;
26
+ private coordinatedRefresh;
27
+ private acquireLock;
28
+ private tryAcquireLockOnce;
29
+ private releaseLock;
30
+ private cleanupOrphanedLocks;
31
+ private scheduleNextRefresh;
32
+ private getJwtTokenRemainingLifetime;
33
+ private sendHeartbeat;
34
+ private broadcastMessage;
35
+ destroy(): void;
36
+ }
@@ -21,10 +21,14 @@ export type InitialConfiguration = {
21
21
  hasDataAnalystAccess: boolean;
22
22
  systemSettings: SystemSettings;
23
23
  userId: string;
24
+ enabledRoutes: {
25
+ [key: string]: string[];
26
+ };
24
27
  };
25
28
  export type SystemSettings = {
26
29
  aclMode: FluxoACLMode;
27
30
  allowExternalUsers: boolean;
31
+ twoFactorEnabled: boolean;
28
32
  };
29
33
  export declare enum FluxoACLMode {
30
34
  DomainRole = 1,
@@ -50,4 +54,6 @@ export declare class ConfigurationService {
50
54
  domainRoleId: number;
51
55
  frontends: string[];
52
56
  }[]>;
57
+ getMultisessionUserState(): Promise<string>;
58
+ setMultisessionUserState(state: string): Promise<void>;
53
59
  }
@@ -1,3 +1,4 @@
1
1
  export * from './module';
2
2
  export * from './feature';
3
3
  export * from './feature-list';
4
+ export * from './update-routes-command';
@@ -0,0 +1,14 @@
1
+ export interface UpdateRoutesCommand {
2
+ routes: {
3
+ [key: string]: UpdateRouteItem[];
4
+ };
5
+ }
6
+ export interface UpdateRouteItem {
7
+ id: string;
8
+ description: string;
9
+ frontend: string;
10
+ isExternal: boolean;
11
+ moduleScope: string;
12
+ moduleName: string;
13
+ moduleDescription: string;
14
+ }
@@ -25,6 +25,7 @@ export declare class FluxoStateDispatcher {
25
25
  }[]): void;
26
26
  static dispatchSetCurrentFrontend(frontend: string): void;
27
27
  static dispatchSetSessionMode(mode: 'single-session' | 'multi-session'): void;
28
+ static dispatchSetNavigationMode(mode: 'sidebar' | 'topmenu' | 'none'): void;
28
29
  static dispatchSetRoutes(routes: {
29
30
  [id: string]: {
30
31
  title: string | undefined;
@@ -7,7 +7,10 @@ export declare abstract class BaseCommonService<TFind, TCreate = TFind, TCreateO
7
7
  find(take: number, skip: number, filters?: string, include?: string, namedFilters?: {
8
8
  key: string;
9
9
  value: string;
10
- }[], orderBy?: string): Promise<PaginatedResult<TFind>>;
10
+ }[], sort?: {
11
+ selector: string;
12
+ desc: boolean;
13
+ }[]): Promise<PaginatedResult<TFind>>;
11
14
  create(entity: TCreate): Promise<TCreateOut>;
12
15
  update(id: string, entity: TUpdate): Promise<TUpdateOut>;
13
16
  delete(entityId: string): Promise<any>;
@@ -1,6 +1,12 @@
1
1
  import { PaginatedResult } from "./rc-paginated-result";
2
2
  export interface CrudServiceInterface<TFind, TCreate = TFind, TCreateOut = TCreate, TUpdate = TCreate, TUpdateOut = TUpdate> {
3
- find(take: number, skip: number, filters?: string, include?: string): Promise<PaginatedResult<TFind>>;
3
+ find(take: number, skip: number, filters?: string, include?: string, namedFilters?: {
4
+ key: string;
5
+ value: string;
6
+ }[], sort?: {
7
+ selector: string;
8
+ desc: boolean;
9
+ }[]): Promise<PaginatedResult<TFind>>;
4
10
  create(entity: TCreate): Promise<TCreateOut>;
5
11
  update(id: string, entity: TUpdate): Promise<TUpdateOut>;
6
12
  get(id: string): Promise<TFind>;
@@ -12,8 +12,14 @@ export interface User {
12
12
  lockoutEnd: string | null;
13
13
  lockoutEnabled: boolean;
14
14
  isLockedOut: boolean;
15
+ twoFactorEnabled: boolean;
16
+ securityPolicyInfo: SecurityPolicyInfo;
15
17
  }
16
18
  export interface UserData {
17
19
  FirstName: string;
18
20
  LastName: string;
19
21
  }
22
+ export interface SecurityPolicyInfo {
23
+ canChangePassword: boolean;
24
+ canHandle2FA: boolean;
25
+ }