@flow97/react-toolkit 0.0.5 → 0.0.6
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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +52 -22
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/locale/hooks.js +3 -1
- package/locale/index.js +3 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -811,18 +811,24 @@ declare const SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugi
|
|
|
811
811
|
declare const APP_ID_HEADER = "App-ID";
|
|
812
812
|
declare const FRONTEND_ROUTE_PREFIX = "/console/";
|
|
813
813
|
/**
|
|
814
|
-
*
|
|
815
|
-
* - GAME_SCOPED: 游戏范围权限(角色权限包含游戏信息)
|
|
816
|
-
* - GROUP_BASED: 基于项目组的权限(需要先选择项目组才能选择游戏)
|
|
817
|
-
* - DIRECT_GAME: 直接游戏权限(不需要项目组,直接选择游戏)
|
|
814
|
+
* 认证模式枚举:合并了用户配置和角色配置的所有有效组合
|
|
818
815
|
*/
|
|
819
816
|
declare enum AuthMode {
|
|
820
|
-
/**
|
|
817
|
+
/** 直接角色模式(不带游戏):直接将角色分配给用户,角色权限不包含游戏信息 */
|
|
818
|
+
DIRECT_ROLE = "direct_role",
|
|
819
|
+
/** 直接角色模式(带游戏):直接将角色分配给用户,角色权限包含游戏信息 */
|
|
820
|
+
DIRECT_ROLE_WITH_GAME = "direct_role_with_game",
|
|
821
|
+
/** 游戏范围模式:按游戏分配角色,角色权限不包含游戏信息 */
|
|
821
822
|
GAME_SCOPED = "game_scoped",
|
|
822
|
-
/**
|
|
823
|
-
GROUP_BASED = "group_based"
|
|
824
|
-
|
|
825
|
-
|
|
823
|
+
/** 项目组模式:按项目组-游戏-角色分配,角色权限不包含游戏信息 */
|
|
824
|
+
GROUP_BASED = "group_based"
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* 认证配置:直接使用 AuthMode
|
|
828
|
+
*/
|
|
829
|
+
interface AuthConfig {
|
|
830
|
+
/** 认证模式 */
|
|
831
|
+
mode: AuthMode;
|
|
826
832
|
}
|
|
827
833
|
declare const WILDCARD = "*";
|
|
828
834
|
|
|
@@ -917,16 +923,6 @@ type Locale = {
|
|
|
917
923
|
};
|
|
918
924
|
};
|
|
919
925
|
|
|
920
|
-
/**
|
|
921
|
-
* JWT Token 解密后的用户信息
|
|
922
|
-
*/
|
|
923
|
-
interface UserInfo {
|
|
924
|
-
authorityId: string;
|
|
925
|
-
exp: number;
|
|
926
|
-
}
|
|
927
|
-
/**
|
|
928
|
-
* Context 配置接口
|
|
929
|
-
*/
|
|
930
926
|
interface ContextSlice {
|
|
931
927
|
/** 是否使用游戏 API V2 版本 */
|
|
932
928
|
useGameApiV2: boolean;
|
|
@@ -944,9 +940,18 @@ interface ContextSlice {
|
|
|
944
940
|
gameScoped?: boolean;
|
|
945
941
|
/** 本地化语言包 */
|
|
946
942
|
locale: Locale;
|
|
947
|
-
/**
|
|
948
|
-
|
|
943
|
+
/** 认证配置 */
|
|
944
|
+
authConfig: AuthConfig;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* JWT Token 解密后的用户信息
|
|
949
|
+
*/
|
|
950
|
+
interface UserInfo {
|
|
951
|
+
authorityId: string;
|
|
952
|
+
exp: number;
|
|
949
953
|
}
|
|
954
|
+
|
|
950
955
|
/**
|
|
951
956
|
* Token 状态接口
|
|
952
957
|
*/
|
|
@@ -1227,6 +1232,31 @@ declare function useFormModal<Values extends AnyObject = AnyObject, ExtraValues
|
|
|
1227
1232
|
*/
|
|
1228
1233
|
declare function useModalStore(): VisibilityState;
|
|
1229
1234
|
|
|
1235
|
+
/**
|
|
1236
|
+
* 获取当前有效的认证配置
|
|
1237
|
+
*/
|
|
1238
|
+
declare function useAuthConfig(): AuthConfig;
|
|
1239
|
+
/**
|
|
1240
|
+
* 获取当前认证模式
|
|
1241
|
+
*/
|
|
1242
|
+
declare function useAuthMode(): AuthMode;
|
|
1243
|
+
/**
|
|
1244
|
+
* 判断是否为直接角色模式
|
|
1245
|
+
*/
|
|
1246
|
+
declare function useIsDirectRole(): boolean;
|
|
1247
|
+
/**
|
|
1248
|
+
* 判断是否为游戏范围模式
|
|
1249
|
+
*/
|
|
1250
|
+
declare function useIsGameScoped(): boolean;
|
|
1251
|
+
/**
|
|
1252
|
+
* 判断是否为项目组模式
|
|
1253
|
+
*/
|
|
1254
|
+
declare function useIsGroupBased(): boolean;
|
|
1255
|
+
/**
|
|
1256
|
+
* 判断角色是否包含游戏信息
|
|
1257
|
+
*/
|
|
1258
|
+
declare function useIsRoleWithGame(): boolean;
|
|
1259
|
+
|
|
1230
1260
|
interface NotFoundProps {
|
|
1231
1261
|
redirectUrl?: string;
|
|
1232
1262
|
}
|
|
@@ -1467,4 +1497,4 @@ declare function useAuth(code?: string | string[], config?: RequestOptions): {
|
|
|
1467
1497
|
declare function useMenuList(): _tanstack_react_query.UseQueryResult<MenuListItem[], Error>;
|
|
1468
1498
|
declare const useGames: () => _tanstack_react_query.UseQueryResult<Game[], Error>;
|
|
1469
1499
|
|
|
1470
|
-
export { APP_ID_HEADER, AuthButton, type AuthButtonProps, AuthMode, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, type GameSelectConfig, type GameSelectProps, type HeaderExtra, type HeaderExtraConfig, Highlight, type HighlightProps, InfiniteList, type InfiniteListDataAdapter, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, type InfiniteListRequestConfigType, type JsonResponse, KeepAlive, type KeepAliveCacheItem, KeepAliveOutlet, type KeepAliveOutletProps, type KeepAliveProps, KeepAliveProvider, type KeepAliveProviderProps, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, type NavItem, type NavMenuItemGroupType, type NavMenuItemType, type NavSubMenuType, type NavigationConfig, NotFound, OperationLogList, type PageParam, type Permission, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, RequireAuth, type RequireAuthProps, RequireGame, type RouteMatchRule, SSO_URL, SelectAll, type SelectAllProps, type ShowFormOptions$1 as ShowFormDrawerOptions, type ShowFormOptions as ShowFormModalOptions, SignIn, ToolkitProvider, type ToolkitProviderProps, type UseDrawerOperation, type UseDrawerProps, type UseFormDrawerProps, type UseFormDrawerReturn, type UseFormModalProps, type UseFormModalReturn, type UseKeepAliveReturn, type UseModalOperation, type UseModalProps, UserDropdown, type VisibilityState, WILDCARD, createVisibilityStoreConfig, generateId, _default$1 as menuRoutes, mixedStorage, _default as permissionRoutes, toolkitStore, useAuth, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useKeepAlive, useKeepAliveContext, useMenuList, useModal, useModalStore, useQueryListStore, useToolkitStore };
|
|
1500
|
+
export { APP_ID_HEADER, AuthButton, type AuthButtonProps, type AuthConfig, AuthMode, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, type GameSelectConfig, type GameSelectProps, type HeaderExtra, type HeaderExtraConfig, Highlight, type HighlightProps, InfiniteList, type InfiniteListDataAdapter, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, type InfiniteListRequestConfigType, type JsonResponse, KeepAlive, type KeepAliveCacheItem, KeepAliveOutlet, type KeepAliveOutletProps, type KeepAliveProps, KeepAliveProvider, type KeepAliveProviderProps, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, type NavItem, type NavMenuItemGroupType, type NavMenuItemType, type NavSubMenuType, type NavigationConfig, NotFound, OperationLogList, type PageParam, type Permission, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, RequireAuth, type RequireAuthProps, RequireGame, type RouteMatchRule, SSO_URL, SelectAll, type SelectAllProps, type ShowFormOptions$1 as ShowFormDrawerOptions, type ShowFormOptions as ShowFormModalOptions, SignIn, ToolkitProvider, type ToolkitProviderProps, type UseDrawerOperation, type UseDrawerProps, type UseFormDrawerProps, type UseFormDrawerReturn, type UseFormModalProps, type UseFormModalReturn, type UseKeepAliveReturn, type UseModalOperation, type UseModalProps, UserDropdown, type VisibilityState, WILDCARD, createVisibilityStoreConfig, generateId, _default$1 as menuRoutes, mixedStorage, _default as permissionRoutes, toolkitStore, useAuth, useAuthConfig, useAuthMode, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useIsDirectRole, useIsGameScoped, useIsGroupBased, useIsRoleWithGame, useKeepAlive, useKeepAliveContext, useMenuList, useModal, useModalStore, useQueryListStore, useToolkitStore };
|