openxiangda 1.0.103 → 1.0.104
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 +1 -1
- package/packages/sdk/dist/runtime/index.cjs +136 -5
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +1 -1
- package/packages/sdk/dist/runtime/index.d.ts +1 -1
- package/packages/sdk/dist/runtime/index.mjs +169 -38
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +134 -3
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +39 -7
- package/packages/sdk/dist/runtime/react.d.ts +39 -7
- package/packages/sdk/dist/runtime/react.mjs +143 -12
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
|
@@ -976,6 +976,26 @@ interface PhoneCodeSendResult {
|
|
|
976
976
|
ttlSeconds?: number;
|
|
977
977
|
message?: string;
|
|
978
978
|
}
|
|
979
|
+
interface AuthChallengePayload {
|
|
980
|
+
id?: string;
|
|
981
|
+
challengeId?: string;
|
|
982
|
+
type?: string;
|
|
983
|
+
question?: string;
|
|
984
|
+
attemptsLeft?: number;
|
|
985
|
+
expireAt?: number | string | Date;
|
|
986
|
+
expiresAt?: number | string | Date;
|
|
987
|
+
[key: string]: unknown;
|
|
988
|
+
}
|
|
989
|
+
interface AuthErrorExtra {
|
|
990
|
+
reason?: string;
|
|
991
|
+
guardCode?: string;
|
|
992
|
+
challenge?: AuthChallengePayload;
|
|
993
|
+
retryAfter?: number;
|
|
994
|
+
retryAfterSeconds?: number;
|
|
995
|
+
remainingAttempts?: number;
|
|
996
|
+
lockUntil?: string | Date | null;
|
|
997
|
+
[key: string]: unknown;
|
|
998
|
+
}
|
|
979
999
|
interface SsoLoginUrlResult {
|
|
980
1000
|
loginUrl: string;
|
|
981
1001
|
protocol?: string;
|
|
@@ -1043,16 +1063,28 @@ interface AppAuthClient {
|
|
|
1043
1063
|
logout: () => Promise<void>;
|
|
1044
1064
|
resolveLoginUrl: (input?: ResolveLoginUrlInput) => string;
|
|
1045
1065
|
}
|
|
1046
|
-
|
|
1066
|
+
interface AuthClientErrorOptions {
|
|
1047
1067
|
status?: number;
|
|
1048
1068
|
code?: number | string;
|
|
1049
1069
|
payload?: unknown;
|
|
1050
|
-
|
|
1051
|
-
status?: number;
|
|
1052
|
-
code?: number | string;
|
|
1053
|
-
payload?: unknown;
|
|
1054
|
-
});
|
|
1070
|
+
extra?: AuthErrorExtra;
|
|
1055
1071
|
}
|
|
1072
|
+
declare class AuthClientError extends Error {
|
|
1073
|
+
status?: number;
|
|
1074
|
+
code?: number | string;
|
|
1075
|
+
payload?: unknown;
|
|
1076
|
+
extra?: AuthErrorExtra;
|
|
1077
|
+
reason?: string;
|
|
1078
|
+
challenge?: AuthChallengePayload;
|
|
1079
|
+
retryAfter?: number;
|
|
1080
|
+
remainingAttempts?: number;
|
|
1081
|
+
lockUntil?: string | Date | null;
|
|
1082
|
+
constructor(message: string, options?: AuthClientErrorOptions);
|
|
1083
|
+
}
|
|
1084
|
+
declare const isAuthClientError: (error: unknown) => error is AuthClientError;
|
|
1085
|
+
declare const getAuthErrorExtra: (error: unknown) => AuthErrorExtra | undefined;
|
|
1086
|
+
declare const getAuthErrorReason: (error: unknown) => string | undefined;
|
|
1087
|
+
declare const isAuthChallengeRequired: (error: unknown) => boolean;
|
|
1056
1088
|
declare const createAuthClient: ({ appType, servicePrefix, fetchImpl, }: AuthClientOptions) => AppAuthClient;
|
|
1057
1089
|
|
|
1058
1090
|
interface PublicAccessClaim {
|
|
@@ -1410,4 +1442,4 @@ interface PublicAccessGateProps extends UsePublicAccessOptions {
|
|
|
1410
1442
|
}
|
|
1411
1443
|
declare const PublicAccessGate: React__default.FC<PublicAccessGateProps>;
|
|
1412
1444
|
|
|
1413
|
-
export { type ApiPermissionListParams, type AppAuthClient, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, AuthClientError, type AuthClientOptions, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type DataViewQueryParams, type DataViewQueryResult, type DataViewStatsParams, type DingTalkLoginInput, type FieldAccessLevel, type FieldAccessPolicyDto, type FieldAccessPolicyItemDto, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type FunctionInvokeParams, type FunctionInvokeResult, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type GuestLoginInput, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PasswordLoginInput, PermissionBoundary, type PermissionBoundaryFallback, type PermissionBoundaryFallbackState, type PermissionBoundaryProps, type PhoneCodeInput, type PhoneCodeLoginInput, type PhoneCodeRegisterInput, type PhoneCodeSendResult, type PreviewNotificationTemplateParams, type ProcessApproveAction, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResolveLoginUrlInput, type RoleListParams, type RoleUsersParams, type RouteAccessResult, type RuntimeBootstrap, type RuntimeErrorSnapshot, type RuntimeErrorType, type RuntimeLogoutOptions, type RuntimeMenuItem, type RuntimePagePermissions, type RuntimeRedirectLoginOptions, type RuntimeRequestError, type RuntimeRequestState, type RuntimeResolveLoginOptions, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SsoLoginUrlInput, type SsoLoginUrlResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap };
|
|
1445
|
+
export { type ApiPermissionListParams, type AppAuthClient, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type AuthChallengePayload, AuthClientError, type AuthClientErrorOptions, type AuthClientOptions, type AuthErrorExtra, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type DataViewQueryParams, type DataViewQueryResult, type DataViewStatsParams, type DingTalkLoginInput, type FieldAccessLevel, type FieldAccessPolicyDto, type FieldAccessPolicyItemDto, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type FunctionInvokeParams, type FunctionInvokeResult, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type GuestLoginInput, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PasswordLoginInput, PermissionBoundary, type PermissionBoundaryFallback, type PermissionBoundaryFallbackState, type PermissionBoundaryProps, type PhoneCodeInput, type PhoneCodeLoginInput, type PhoneCodeRegisterInput, type PhoneCodeSendResult, type PreviewNotificationTemplateParams, type ProcessApproveAction, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResolveLoginUrlInput, type RoleListParams, type RoleUsersParams, type RouteAccessResult, type RuntimeBootstrap, type RuntimeErrorSnapshot, type RuntimeErrorType, type RuntimeLogoutOptions, type RuntimeMenuItem, type RuntimePagePermissions, type RuntimeRedirectLoginOptions, type RuntimeRequestError, type RuntimeRequestState, type RuntimeResolveLoginOptions, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SsoLoginUrlInput, type SsoLoginUrlResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, getAuthErrorExtra, getAuthErrorReason, isAuthChallengeRequired, isAuthClientError, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap };
|
|
@@ -976,6 +976,26 @@ interface PhoneCodeSendResult {
|
|
|
976
976
|
ttlSeconds?: number;
|
|
977
977
|
message?: string;
|
|
978
978
|
}
|
|
979
|
+
interface AuthChallengePayload {
|
|
980
|
+
id?: string;
|
|
981
|
+
challengeId?: string;
|
|
982
|
+
type?: string;
|
|
983
|
+
question?: string;
|
|
984
|
+
attemptsLeft?: number;
|
|
985
|
+
expireAt?: number | string | Date;
|
|
986
|
+
expiresAt?: number | string | Date;
|
|
987
|
+
[key: string]: unknown;
|
|
988
|
+
}
|
|
989
|
+
interface AuthErrorExtra {
|
|
990
|
+
reason?: string;
|
|
991
|
+
guardCode?: string;
|
|
992
|
+
challenge?: AuthChallengePayload;
|
|
993
|
+
retryAfter?: number;
|
|
994
|
+
retryAfterSeconds?: number;
|
|
995
|
+
remainingAttempts?: number;
|
|
996
|
+
lockUntil?: string | Date | null;
|
|
997
|
+
[key: string]: unknown;
|
|
998
|
+
}
|
|
979
999
|
interface SsoLoginUrlResult {
|
|
980
1000
|
loginUrl: string;
|
|
981
1001
|
protocol?: string;
|
|
@@ -1043,16 +1063,28 @@ interface AppAuthClient {
|
|
|
1043
1063
|
logout: () => Promise<void>;
|
|
1044
1064
|
resolveLoginUrl: (input?: ResolveLoginUrlInput) => string;
|
|
1045
1065
|
}
|
|
1046
|
-
|
|
1066
|
+
interface AuthClientErrorOptions {
|
|
1047
1067
|
status?: number;
|
|
1048
1068
|
code?: number | string;
|
|
1049
1069
|
payload?: unknown;
|
|
1050
|
-
|
|
1051
|
-
status?: number;
|
|
1052
|
-
code?: number | string;
|
|
1053
|
-
payload?: unknown;
|
|
1054
|
-
});
|
|
1070
|
+
extra?: AuthErrorExtra;
|
|
1055
1071
|
}
|
|
1072
|
+
declare class AuthClientError extends Error {
|
|
1073
|
+
status?: number;
|
|
1074
|
+
code?: number | string;
|
|
1075
|
+
payload?: unknown;
|
|
1076
|
+
extra?: AuthErrorExtra;
|
|
1077
|
+
reason?: string;
|
|
1078
|
+
challenge?: AuthChallengePayload;
|
|
1079
|
+
retryAfter?: number;
|
|
1080
|
+
remainingAttempts?: number;
|
|
1081
|
+
lockUntil?: string | Date | null;
|
|
1082
|
+
constructor(message: string, options?: AuthClientErrorOptions);
|
|
1083
|
+
}
|
|
1084
|
+
declare const isAuthClientError: (error: unknown) => error is AuthClientError;
|
|
1085
|
+
declare const getAuthErrorExtra: (error: unknown) => AuthErrorExtra | undefined;
|
|
1086
|
+
declare const getAuthErrorReason: (error: unknown) => string | undefined;
|
|
1087
|
+
declare const isAuthChallengeRequired: (error: unknown) => boolean;
|
|
1056
1088
|
declare const createAuthClient: ({ appType, servicePrefix, fetchImpl, }: AuthClientOptions) => AppAuthClient;
|
|
1057
1089
|
|
|
1058
1090
|
interface PublicAccessClaim {
|
|
@@ -1410,4 +1442,4 @@ interface PublicAccessGateProps extends UsePublicAccessOptions {
|
|
|
1410
1442
|
}
|
|
1411
1443
|
declare const PublicAccessGate: React__default.FC<PublicAccessGateProps>;
|
|
1412
1444
|
|
|
1413
|
-
export { type ApiPermissionListParams, type AppAuthClient, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, AuthClientError, type AuthClientOptions, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type DataViewQueryParams, type DataViewQueryResult, type DataViewStatsParams, type DingTalkLoginInput, type FieldAccessLevel, type FieldAccessPolicyDto, type FieldAccessPolicyItemDto, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type FunctionInvokeParams, type FunctionInvokeResult, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type GuestLoginInput, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PasswordLoginInput, PermissionBoundary, type PermissionBoundaryFallback, type PermissionBoundaryFallbackState, type PermissionBoundaryProps, type PhoneCodeInput, type PhoneCodeLoginInput, type PhoneCodeRegisterInput, type PhoneCodeSendResult, type PreviewNotificationTemplateParams, type ProcessApproveAction, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResolveLoginUrlInput, type RoleListParams, type RoleUsersParams, type RouteAccessResult, type RuntimeBootstrap, type RuntimeErrorSnapshot, type RuntimeErrorType, type RuntimeLogoutOptions, type RuntimeMenuItem, type RuntimePagePermissions, type RuntimeRedirectLoginOptions, type RuntimeRequestError, type RuntimeRequestState, type RuntimeResolveLoginOptions, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SsoLoginUrlInput, type SsoLoginUrlResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap };
|
|
1445
|
+
export { type ApiPermissionListParams, type AppAuthClient, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type AuthChallengePayload, AuthClientError, type AuthClientErrorOptions, type AuthClientOptions, type AuthErrorExtra, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type DataViewQueryParams, type DataViewQueryResult, type DataViewStatsParams, type DingTalkLoginInput, type FieldAccessLevel, type FieldAccessPolicyDto, type FieldAccessPolicyItemDto, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type FunctionInvokeParams, type FunctionInvokeResult, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type GuestLoginInput, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PasswordLoginInput, PermissionBoundary, type PermissionBoundaryFallback, type PermissionBoundaryFallbackState, type PermissionBoundaryProps, type PhoneCodeInput, type PhoneCodeLoginInput, type PhoneCodeRegisterInput, type PhoneCodeSendResult, type PreviewNotificationTemplateParams, type ProcessApproveAction, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResolveLoginUrlInput, type RoleListParams, type RoleUsersParams, type RouteAccessResult, type RuntimeBootstrap, type RuntimeErrorSnapshot, type RuntimeErrorType, type RuntimeLogoutOptions, type RuntimeMenuItem, type RuntimePagePermissions, type RuntimeRedirectLoginOptions, type RuntimeRequestError, type RuntimeRequestState, type RuntimeResolveLoginOptions, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SsoLoginUrlInput, type SsoLoginUrlResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, getAuthErrorExtra, getAuthErrorReason, isAuthChallengeRequired, isAuthClientError, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap };
|
|
@@ -2705,8 +2705,43 @@ var AuthClientError = class extends Error {
|
|
|
2705
2705
|
this.status = options.status;
|
|
2706
2706
|
this.code = options.code;
|
|
2707
2707
|
this.payload = options.payload;
|
|
2708
|
+
this.extra = normalizeAuthErrorExtra(
|
|
2709
|
+
options.extra || getRecordValue(options.payload, "extra")
|
|
2710
|
+
);
|
|
2711
|
+
this.reason = this.extra?.reason || this.extra?.guardCode || (typeof options.code === "string" ? options.code : void 0);
|
|
2712
|
+
this.challenge = this.extra?.challenge;
|
|
2713
|
+
this.retryAfter = readNumber(
|
|
2714
|
+
this.extra?.retryAfter ?? this.extra?.retryAfterSeconds
|
|
2715
|
+
);
|
|
2716
|
+
this.remainingAttempts = readNumber(this.extra?.remainingAttempts);
|
|
2717
|
+
this.lockUntil = this.extra?.lockUntil ?? null;
|
|
2708
2718
|
}
|
|
2709
2719
|
};
|
|
2720
|
+
var isAuthClientError = (error) => {
|
|
2721
|
+
if (error instanceof AuthClientError) return true;
|
|
2722
|
+
return Boolean(
|
|
2723
|
+
error && typeof error === "object" && error.name === "AuthClientError"
|
|
2724
|
+
);
|
|
2725
|
+
};
|
|
2726
|
+
var getAuthErrorExtra = (error) => {
|
|
2727
|
+
if (!error || typeof error !== "object") return void 0;
|
|
2728
|
+
const record = error;
|
|
2729
|
+
return normalizeAuthErrorExtra(record.extra || getRecordValue(record.payload, "extra"));
|
|
2730
|
+
};
|
|
2731
|
+
var getAuthErrorReason = (error) => {
|
|
2732
|
+
if (!error || typeof error !== "object") return void 0;
|
|
2733
|
+
const record = error;
|
|
2734
|
+
const extra = getAuthErrorExtra(error);
|
|
2735
|
+
return extra?.reason || extra?.guardCode || (typeof record.reason === "string" ? record.reason : void 0) || (typeof record.code === "string" ? record.code : void 0);
|
|
2736
|
+
};
|
|
2737
|
+
var isAuthChallengeRequired = (error) => {
|
|
2738
|
+
if (!error || typeof error !== "object") return false;
|
|
2739
|
+
const record = error;
|
|
2740
|
+
const code = record.code;
|
|
2741
|
+
const reason = getAuthErrorReason(error);
|
|
2742
|
+
const extra = getAuthErrorExtra(error);
|
|
2743
|
+
return code === 460 || code === "460" || code === "LOGIN_CHALLENGE_REQUIRED" || reason === "LOGIN_CHALLENGE_REQUIRED" || reason === "CHALLENGE_REQUIRED" || extra?.guardCode === "LOGIN_CHALLENGE_REQUIRED";
|
|
2744
|
+
};
|
|
2710
2745
|
var createAuthClient = ({
|
|
2711
2746
|
appType,
|
|
2712
2747
|
servicePrefix = "/service",
|
|
@@ -2733,7 +2768,12 @@ var createAuthClient = ({
|
|
|
2733
2768
|
if (!response.ok || success === false || !isSuccessCode3(code)) {
|
|
2734
2769
|
throw new AuthClientError(
|
|
2735
2770
|
String(getRecordValue(payload, "message") || `Auth request failed: ${response.status}`),
|
|
2736
|
-
{
|
|
2771
|
+
{
|
|
2772
|
+
status: response.status,
|
|
2773
|
+
code,
|
|
2774
|
+
payload,
|
|
2775
|
+
extra: normalizeAuthErrorExtra(getRecordValue(payload, "extra"))
|
|
2776
|
+
}
|
|
2737
2777
|
);
|
|
2738
2778
|
}
|
|
2739
2779
|
return unwrapPayload(payload);
|
|
@@ -2783,6 +2823,27 @@ var getRecordValue = (value, key) => {
|
|
|
2783
2823
|
if (!value || typeof value !== "object") return void 0;
|
|
2784
2824
|
return value[key];
|
|
2785
2825
|
};
|
|
2826
|
+
var normalizeAuthErrorExtra = (value) => {
|
|
2827
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
2828
|
+
const record = value;
|
|
2829
|
+
const challenge = record.challenge && typeof record.challenge === "object" && !Array.isArray(record.challenge) ? record.challenge : void 0;
|
|
2830
|
+
const reason = readString(record.reason);
|
|
2831
|
+
const guardCode = readString(record.guardCode);
|
|
2832
|
+
return {
|
|
2833
|
+
...record,
|
|
2834
|
+
...reason ? { reason } : {},
|
|
2835
|
+
...guardCode ? { guardCode } : {},
|
|
2836
|
+
...challenge ? { challenge } : {},
|
|
2837
|
+
...readNumber(record.retryAfter) !== void 0 ? { retryAfter: readNumber(record.retryAfter) } : {},
|
|
2838
|
+
...readNumber(record.retryAfterSeconds) !== void 0 ? { retryAfterSeconds: readNumber(record.retryAfterSeconds) } : {},
|
|
2839
|
+
...readNumber(record.remainingAttempts) !== void 0 ? { remainingAttempts: readNumber(record.remainingAttempts) } : {}
|
|
2840
|
+
};
|
|
2841
|
+
};
|
|
2842
|
+
var readString = (value) => typeof value === "string" ? value : void 0;
|
|
2843
|
+
var readNumber = (value) => {
|
|
2844
|
+
const numberValue = Number(value);
|
|
2845
|
+
return Number.isFinite(numberValue) ? numberValue : void 0;
|
|
2846
|
+
};
|
|
2786
2847
|
var isSuccessCode3 = (code) => {
|
|
2787
2848
|
if (code === void 0 || code === null || code === "") return true;
|
|
2788
2849
|
const normalized = Number(code);
|
|
@@ -2813,7 +2874,7 @@ var resolveLoginUrl = (appType, {
|
|
|
2813
2874
|
var getCurrentHref2 = () => typeof window === "undefined" ? "" : window.location.href;
|
|
2814
2875
|
|
|
2815
2876
|
// packages/sdk/src/runtime/react/auth.tsx
|
|
2816
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
2877
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
2817
2878
|
var useAuth = (options = {}) => {
|
|
2818
2879
|
const runtime = useOpenXiangda();
|
|
2819
2880
|
const client = useMemo4(
|
|
@@ -2920,6 +2981,7 @@ var LoginPage = ({
|
|
|
2920
2981
|
"login"
|
|
2921
2982
|
);
|
|
2922
2983
|
const [phoneChallengeId, setPhoneChallengeId] = useState3("");
|
|
2984
|
+
const [passwordChallenge, setPasswordChallenge] = useState3(null);
|
|
2923
2985
|
const [submitting, setSubmitting] = useState3(false);
|
|
2924
2986
|
const [sendingCode, setSendingCode] = useState3(false);
|
|
2925
2987
|
const [error, setError] = useState3(null);
|
|
@@ -2942,6 +3004,7 @@ var LoginPage = ({
|
|
|
2942
3004
|
children: /* @__PURE__ */ jsx3(
|
|
2943
3005
|
PasswordLoginForm,
|
|
2944
3006
|
{
|
|
3007
|
+
challenge: passwordChallenge,
|
|
2945
3008
|
form: passwordForm,
|
|
2946
3009
|
loading: submitting,
|
|
2947
3010
|
onFinish: async (values) => {
|
|
@@ -2950,12 +3013,25 @@ var LoginPage = ({
|
|
|
2950
3013
|
try {
|
|
2951
3014
|
await handleSuccess(
|
|
2952
3015
|
await auth.passwordLogin({
|
|
3016
|
+
challengeAnswer: passwordChallenge ? values.challengeAnswer : void 0,
|
|
3017
|
+
challengeId: readChallengeId(passwordChallenge),
|
|
3018
|
+
clientFingerprint: getOrCreateLoginFingerprint(auth.client),
|
|
2953
3019
|
username: values.username,
|
|
2954
3020
|
password: values.password
|
|
2955
3021
|
})
|
|
2956
3022
|
);
|
|
3023
|
+
setPasswordChallenge(null);
|
|
2957
3024
|
} catch (loginError) {
|
|
2958
|
-
|
|
3025
|
+
if (isAuthChallengeRequired(loginError)) {
|
|
3026
|
+
const nextChallenge = getAuthErrorExtra(loginError)?.challenge;
|
|
3027
|
+
if (nextChallenge) {
|
|
3028
|
+
setPasswordChallenge(nextChallenge);
|
|
3029
|
+
passwordForm.setFieldValue("challengeAnswer", "");
|
|
3030
|
+
}
|
|
3031
|
+
} else {
|
|
3032
|
+
setPasswordChallenge(null);
|
|
3033
|
+
}
|
|
3034
|
+
setError(formatAuthErrorMessage(loginError));
|
|
2959
3035
|
} finally {
|
|
2960
3036
|
setSubmitting(false);
|
|
2961
3037
|
}
|
|
@@ -3025,6 +3101,7 @@ var LoginPage = ({
|
|
|
3025
3101
|
allowRegister,
|
|
3026
3102
|
auth,
|
|
3027
3103
|
handleSuccess,
|
|
3104
|
+
passwordChallenge,
|
|
3028
3105
|
passwordForm,
|
|
3029
3106
|
passwordMethod,
|
|
3030
3107
|
phoneChallengeId,
|
|
@@ -3178,7 +3255,7 @@ var LoginPage = ({
|
|
|
3178
3255
|
}
|
|
3179
3256
|
);
|
|
3180
3257
|
};
|
|
3181
|
-
var PasswordLoginForm = ({ form, loading, onFinish }) => /* @__PURE__ */ jsxs(Form, { form, layout: "vertical", requiredMark: false, onFinish, children: [
|
|
3258
|
+
var PasswordLoginForm = ({ challenge, form, loading, onFinish }) => /* @__PURE__ */ jsxs(Form, { form, layout: "vertical", requiredMark: false, onFinish, children: [
|
|
3182
3259
|
/* @__PURE__ */ jsx3(
|
|
3183
3260
|
Form.Item,
|
|
3184
3261
|
{
|
|
@@ -3197,6 +3274,26 @@ var PasswordLoginForm = ({ form, loading, onFinish }) => /* @__PURE__ */ jsxs(Fo
|
|
|
3197
3274
|
children: /* @__PURE__ */ jsx3(Input.Password, { autoComplete: "current-password" })
|
|
3198
3275
|
}
|
|
3199
3276
|
),
|
|
3277
|
+
challenge ? /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
3278
|
+
/* @__PURE__ */ jsx3(
|
|
3279
|
+
Alert,
|
|
3280
|
+
{
|
|
3281
|
+
showIcon: true,
|
|
3282
|
+
type: "warning",
|
|
3283
|
+
message: "\u8BF7\u5B8C\u6210\u989D\u5916\u9A8C\u8BC1",
|
|
3284
|
+
description: readChallengeQuestion(challenge) || "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\u540E\u7EE7\u7EED\u767B\u5F55\u3002"
|
|
3285
|
+
}
|
|
3286
|
+
),
|
|
3287
|
+
/* @__PURE__ */ jsx3(
|
|
3288
|
+
Form.Item,
|
|
3289
|
+
{
|
|
3290
|
+
label: "\u9A8C\u8BC1\u7B54\u6848",
|
|
3291
|
+
name: "challengeAnswer",
|
|
3292
|
+
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7B54\u6848" }],
|
|
3293
|
+
children: /* @__PURE__ */ jsx3(Input, { autoComplete: "one-time-code" })
|
|
3294
|
+
}
|
|
3295
|
+
)
|
|
3296
|
+
] }) : null,
|
|
3200
3297
|
/* @__PURE__ */ jsx3(Button, { block: true, htmlType: "submit", icon: /* @__PURE__ */ jsx3(LoginOutlined, {}), loading, type: "primary", children: "\u767B\u5F55" })
|
|
3201
3298
|
] });
|
|
3202
3299
|
var PhoneCodeLoginForm = ({
|
|
@@ -3258,6 +3355,22 @@ var PhoneCodeLoginForm = ({
|
|
|
3258
3355
|
] });
|
|
3259
3356
|
var findMethod = (methods, type) => methods.find((method) => method.type === type);
|
|
3260
3357
|
var normalizeError = (error) => error instanceof Error ? error : new Error(String(error || "\u8BF7\u6C42\u5931\u8D25"));
|
|
3358
|
+
var formatAuthErrorMessage = (error) => {
|
|
3359
|
+
const normalized = normalizeError(error);
|
|
3360
|
+
const extra = getAuthErrorExtra(error);
|
|
3361
|
+
const reason = getAuthErrorReason(error);
|
|
3362
|
+
if (isAuthChallengeRequired(error)) {
|
|
3363
|
+
return extra?.challenge?.question ? "\u8BF7\u5B8C\u6210\u4E0B\u65B9\u9A8C\u8BC1\u540E\u518D\u767B\u5F55" : normalized.message || "\u8BF7\u5148\u5B8C\u6210\u989D\u5916\u9A8C\u8BC1\u540E\u518D\u5C1D\u8BD5\u767B\u5F55";
|
|
3364
|
+
}
|
|
3365
|
+
if (reason === "LOGIN_BLOCKED" || reason === "USERNAME_BLOCKED" || reason === "IP_BLOCKED" || reason === "ACCOUNT_LOCKED") {
|
|
3366
|
+
const retryAfter = Number(extra?.retryAfter ?? extra?.retryAfterSeconds);
|
|
3367
|
+
if (Number.isFinite(retryAfter) && retryAfter > 0) {
|
|
3368
|
+
const minutes = Math.ceil(retryAfter / 60);
|
|
3369
|
+
return `\u767B\u5F55\u53D7\u9650\uFF0C\u8BF7\u7EA6 ${minutes} \u5206\u949F\u540E\u518D\u8BD5\u6216\u8054\u7CFB\u7BA1\u7406\u5458`;
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
return normalized.message || "\u767B\u5F55\u5931\u8D25";
|
|
3373
|
+
};
|
|
3261
3374
|
var getString = (value, key) => {
|
|
3262
3375
|
if (!value || typeof value !== "object") return void 0;
|
|
3263
3376
|
const result = value[key];
|
|
@@ -3291,7 +3404,21 @@ var getOrCreateGuestIdentifier = (client) => {
|
|
|
3291
3404
|
window.localStorage.setItem(key, next);
|
|
3292
3405
|
return next;
|
|
3293
3406
|
};
|
|
3407
|
+
var getOrCreateLoginFingerprint = (client) => {
|
|
3408
|
+
const key = `openxiangda:${client.appType}:login_fingerprint`;
|
|
3409
|
+
if (typeof window === "undefined") return createGuestIdentifier();
|
|
3410
|
+
const current = window.localStorage.getItem(key);
|
|
3411
|
+
const id = current || createGuestIdentifier();
|
|
3412
|
+
if (!current) window.localStorage.setItem(key, id);
|
|
3413
|
+
return `${id}:${window.navigator?.userAgent || "unknown"}`;
|
|
3414
|
+
};
|
|
3294
3415
|
var createGuestIdentifier = () => `guest_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`;
|
|
3416
|
+
var readChallengeId = (challenge) => {
|
|
3417
|
+
if (!challenge) return void 0;
|
|
3418
|
+
const id = challenge.id || challenge.challengeId;
|
|
3419
|
+
return typeof id === "string" && id.trim() ? id.trim() : void 0;
|
|
3420
|
+
};
|
|
3421
|
+
var readChallengeQuestion = (challenge) => typeof challenge.question === "string" ? challenge.question : void 0;
|
|
3295
3422
|
var getCurrentHref3 = () => typeof window === "undefined" ? "" : window.location.href;
|
|
3296
3423
|
var getCurrentHostname = () => typeof window === "undefined" ? "" : window.location.hostname;
|
|
3297
3424
|
var getCallbackUrl = () => {
|
|
@@ -3301,7 +3428,7 @@ var getCallbackUrl = () => {
|
|
|
3301
3428
|
};
|
|
3302
3429
|
|
|
3303
3430
|
// packages/sdk/src/runtime/react/openxiangdaProvider.tsx
|
|
3304
|
-
import { Fragment as
|
|
3431
|
+
import { Fragment as Fragment3, jsx as jsx4 } from "react/jsx-runtime";
|
|
3305
3432
|
var RuntimeHttpError = class extends Error {
|
|
3306
3433
|
constructor(snapshot) {
|
|
3307
3434
|
super(snapshot.message);
|
|
@@ -3651,12 +3778,12 @@ var PermissionBoundary = ({
|
|
|
3651
3778
|
const access = useCanAccessRoute({ routeCode, menuCode, path });
|
|
3652
3779
|
const fallbackState = createPermissionFallbackState(access, runtime);
|
|
3653
3780
|
if (access.loading) {
|
|
3654
|
-
return /* @__PURE__ */ jsx4(
|
|
3781
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: renderBoundaryFallback(loadingFallback, fallbackState) });
|
|
3655
3782
|
}
|
|
3656
3783
|
if (!access.canAccess) {
|
|
3657
|
-
return /* @__PURE__ */ jsx4(
|
|
3784
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: renderBoundaryFallback(fallback, fallbackState) });
|
|
3658
3785
|
}
|
|
3659
|
-
return /* @__PURE__ */ jsx4(
|
|
3786
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children });
|
|
3660
3787
|
};
|
|
3661
3788
|
var useRuntimeAuth = () => {
|
|
3662
3789
|
const runtime = useOpenXiangda();
|
|
@@ -4062,7 +4189,7 @@ var createRandomIdentifier = (appType) => {
|
|
|
4062
4189
|
};
|
|
4063
4190
|
|
|
4064
4191
|
// packages/sdk/src/runtime/react/publicAccess.tsx
|
|
4065
|
-
import { Fragment as
|
|
4192
|
+
import { Fragment as Fragment4, jsx as jsx5 } from "react/jsx-runtime";
|
|
4066
4193
|
var usePublicAccess = (options = {}) => {
|
|
4067
4194
|
const runtime = useOpenXiangda();
|
|
4068
4195
|
const {
|
|
@@ -4139,11 +4266,11 @@ var PublicAccessGate = ({
|
|
|
4139
4266
|
...options
|
|
4140
4267
|
}) => {
|
|
4141
4268
|
const state = usePublicAccess(options);
|
|
4142
|
-
if (state.loading) return /* @__PURE__ */ jsx5(
|
|
4269
|
+
if (state.loading) return /* @__PURE__ */ jsx5(Fragment4, { children: fallback });
|
|
4143
4270
|
if (state.error) {
|
|
4144
|
-
return /* @__PURE__ */ jsx5(
|
|
4271
|
+
return /* @__PURE__ */ jsx5(Fragment4, { children: typeof errorFallback === "function" ? errorFallback(state.error) : errorFallback });
|
|
4145
4272
|
}
|
|
4146
|
-
return /* @__PURE__ */ jsx5(
|
|
4273
|
+
return /* @__PURE__ */ jsx5(Fragment4, { children });
|
|
4147
4274
|
};
|
|
4148
4275
|
var readTicketFromLocation = () => {
|
|
4149
4276
|
if (typeof window === "undefined") return void 0;
|
|
@@ -4163,6 +4290,10 @@ export {
|
|
|
4163
4290
|
createPageSdk,
|
|
4164
4291
|
createPublicAccessClient,
|
|
4165
4292
|
createReactPage,
|
|
4293
|
+
getAuthErrorExtra,
|
|
4294
|
+
getAuthErrorReason,
|
|
4295
|
+
isAuthChallengeRequired,
|
|
4296
|
+
isAuthClientError,
|
|
4166
4297
|
useAppMenus,
|
|
4167
4298
|
useAuth,
|
|
4168
4299
|
useCanAccessRoute,
|