openxiangda 1.0.89 → 1.0.90
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/README.md +16 -6
- package/openxiangda-skills/SKILL.md +3 -3
- package/openxiangda-skills/references/architecture-design.md +2 -1
- package/openxiangda-skills/references/openxiangda-api.md +1 -1
- package/openxiangda-skills/references/pages/page-sdk.md +17 -8
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +15 -5
- package/package.json +1 -1
- package/packages/sdk/dist/runtime/index.cjs +1495 -1371
- 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 +504 -380
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +311 -6
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +11 -1
- package/packages/sdk/dist/runtime/react.d.ts +11 -1
- package/packages/sdk/dist/runtime/react.mjs +311 -6
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/templates/openxiangda-react-spa/src/app/router.tsx +4 -1
|
@@ -1301,6 +1301,15 @@ interface OpenXiangdaProviderProps {
|
|
|
1301
1301
|
fetchImpl?: typeof fetch;
|
|
1302
1302
|
children: React__default.ReactNode;
|
|
1303
1303
|
}
|
|
1304
|
+
interface OpenXiangdaPageProviderProps {
|
|
1305
|
+
children: React__default.ReactNode;
|
|
1306
|
+
page?: Partial<PageInfo>;
|
|
1307
|
+
route?: Partial<PageRouteInfo>;
|
|
1308
|
+
env?: Record<string, unknown>;
|
|
1309
|
+
message?: Partial<PageMessageApi>;
|
|
1310
|
+
modal?: Partial<PageModalApi>;
|
|
1311
|
+
navigation?: Partial<PageNavigationApi>;
|
|
1312
|
+
}
|
|
1304
1313
|
interface OpenXiangdaRuntimeStore extends RuntimeRequestState<RuntimeBootstrap> {
|
|
1305
1314
|
appType: string;
|
|
1306
1315
|
servicePrefix: string;
|
|
@@ -1311,6 +1320,7 @@ interface OpenXiangdaRuntimeStore extends RuntimeRequestState<RuntimeBootstrap>
|
|
|
1311
1320
|
declare const OpenXiangdaProvider: React__default.FC<OpenXiangdaProviderProps>;
|
|
1312
1321
|
declare const useOpenXiangda: () => OpenXiangdaRuntimeStore;
|
|
1313
1322
|
declare const useRuntimeBootstrap: () => OpenXiangdaRuntimeStore;
|
|
1323
|
+
declare const OpenXiangdaPageProvider: React__default.FC<OpenXiangdaPageProviderProps>;
|
|
1314
1324
|
declare const useAppMenus: () => {
|
|
1315
1325
|
data: RuntimeMenuItem[];
|
|
1316
1326
|
appType: string;
|
|
@@ -1397,4 +1407,4 @@ interface PublicAccessGateProps extends UsePublicAccessOptions {
|
|
|
1397
1407
|
}
|
|
1398
1408
|
declare const PublicAccessGate: React__default.FC<PublicAccessGateProps>;
|
|
1399
1409
|
|
|
1400
|
-
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, 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 };
|
|
1410
|
+
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 };
|
|
@@ -1301,6 +1301,15 @@ interface OpenXiangdaProviderProps {
|
|
|
1301
1301
|
fetchImpl?: typeof fetch;
|
|
1302
1302
|
children: React__default.ReactNode;
|
|
1303
1303
|
}
|
|
1304
|
+
interface OpenXiangdaPageProviderProps {
|
|
1305
|
+
children: React__default.ReactNode;
|
|
1306
|
+
page?: Partial<PageInfo>;
|
|
1307
|
+
route?: Partial<PageRouteInfo>;
|
|
1308
|
+
env?: Record<string, unknown>;
|
|
1309
|
+
message?: Partial<PageMessageApi>;
|
|
1310
|
+
modal?: Partial<PageModalApi>;
|
|
1311
|
+
navigation?: Partial<PageNavigationApi>;
|
|
1312
|
+
}
|
|
1304
1313
|
interface OpenXiangdaRuntimeStore extends RuntimeRequestState<RuntimeBootstrap> {
|
|
1305
1314
|
appType: string;
|
|
1306
1315
|
servicePrefix: string;
|
|
@@ -1311,6 +1320,7 @@ interface OpenXiangdaRuntimeStore extends RuntimeRequestState<RuntimeBootstrap>
|
|
|
1311
1320
|
declare const OpenXiangdaProvider: React__default.FC<OpenXiangdaProviderProps>;
|
|
1312
1321
|
declare const useOpenXiangda: () => OpenXiangdaRuntimeStore;
|
|
1313
1322
|
declare const useRuntimeBootstrap: () => OpenXiangdaRuntimeStore;
|
|
1323
|
+
declare const OpenXiangdaPageProvider: React__default.FC<OpenXiangdaPageProviderProps>;
|
|
1314
1324
|
declare const useAppMenus: () => {
|
|
1315
1325
|
data: RuntimeMenuItem[];
|
|
1316
1326
|
appType: string;
|
|
@@ -1397,4 +1407,4 @@ interface PublicAccessGateProps extends UsePublicAccessOptions {
|
|
|
1397
1407
|
}
|
|
1398
1408
|
declare const PublicAccessGate: React__default.FC<PublicAccessGateProps>;
|
|
1399
1409
|
|
|
1400
|
-
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, 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 };
|
|
1410
|
+
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 };
|
|
@@ -2489,6 +2489,187 @@ var createBoundFetch = (fetchImpl) => {
|
|
|
2489
2489
|
return ((input, init) => baseFetch.call(globalThis, input, init));
|
|
2490
2490
|
};
|
|
2491
2491
|
|
|
2492
|
+
// packages/sdk/src/runtime/host/browserHost.ts
|
|
2493
|
+
var trimTrailingSlash = (value) => value.replace(/\/+$/, "");
|
|
2494
|
+
var getDefaultServicePrefix = () => typeof window !== "undefined" ? trimTrailingSlash(window.__OPENXIANGDA_SERVICE_PREFIX__ || "/service") : "/service";
|
|
2495
|
+
var joinServicePath = (servicePrefix, path) => {
|
|
2496
|
+
if (/^https?:\/\//i.test(path)) return path;
|
|
2497
|
+
const normalizedPrefix = trimTrailingSlash(servicePrefix || "/service");
|
|
2498
|
+
if (path.startsWith(normalizedPrefix)) return path;
|
|
2499
|
+
return `${normalizedPrefix}${path.startsWith("/") ? path : `/${path}`}`;
|
|
2500
|
+
};
|
|
2501
|
+
var appendQuery = (url, query) => {
|
|
2502
|
+
if (!query) return url;
|
|
2503
|
+
return `${url}${url.includes("?") ? "&" : "?"}${query}`;
|
|
2504
|
+
};
|
|
2505
|
+
var normalizeMethod2 = (method) => {
|
|
2506
|
+
const value = String(method || "get").toUpperCase();
|
|
2507
|
+
return ["GET", "POST", "PUT", "DELETE", "PATCH"].includes(value) ? value : "GET";
|
|
2508
|
+
};
|
|
2509
|
+
var normalizeEnvelopeCode2 = (value, fallback) => {
|
|
2510
|
+
if (value === void 0 || value === null || value === "") return fallback;
|
|
2511
|
+
const normalized = Number(value);
|
|
2512
|
+
return Number.isFinite(normalized) ? normalized : String(value);
|
|
2513
|
+
};
|
|
2514
|
+
var isSuccessCode2 = (value) => {
|
|
2515
|
+
if (value === void 0 || value === null || value === "") return true;
|
|
2516
|
+
const normalized = Number(value);
|
|
2517
|
+
return Number.isFinite(normalized) ? normalized === 0 || normalized >= 200 && normalized < 300 : false;
|
|
2518
|
+
};
|
|
2519
|
+
var parseJsonResponse = async (response) => {
|
|
2520
|
+
const payload = await response.json().catch(() => null);
|
|
2521
|
+
if (!response.ok) {
|
|
2522
|
+
const message2 = payload && typeof payload === "object" ? payload.message || payload.error || response.statusText : response.statusText;
|
|
2523
|
+
throw new Error(message2 || "\u8BF7\u6C42\u5931\u8D25");
|
|
2524
|
+
}
|
|
2525
|
+
if (payload && typeof payload === "object" && "code" in payload) {
|
|
2526
|
+
const code = normalizeEnvelopeCode2(payload.code, response.status);
|
|
2527
|
+
return {
|
|
2528
|
+
code,
|
|
2529
|
+
success: payload.success !== false && isSuccessCode2(code),
|
|
2530
|
+
message: payload.message,
|
|
2531
|
+
result: payload.result ?? payload.data ?? null,
|
|
2532
|
+
data: payload.data,
|
|
2533
|
+
raw: payload
|
|
2534
|
+
};
|
|
2535
|
+
}
|
|
2536
|
+
return {
|
|
2537
|
+
code: response.status,
|
|
2538
|
+
success: response.ok,
|
|
2539
|
+
message: response.statusText,
|
|
2540
|
+
result: payload,
|
|
2541
|
+
data: payload,
|
|
2542
|
+
raw: payload
|
|
2543
|
+
};
|
|
2544
|
+
};
|
|
2545
|
+
var createBrowserPageBridge = (options = {}) => {
|
|
2546
|
+
const servicePrefix = options.servicePrefix || getDefaultServicePrefix();
|
|
2547
|
+
const fetchImpl = createBoundFetch(options.fetchImpl);
|
|
2548
|
+
const request = async (payload) => {
|
|
2549
|
+
if (!payload?.path) {
|
|
2550
|
+
throw new Error("transport.request \u9700\u8981 path");
|
|
2551
|
+
}
|
|
2552
|
+
const url = appendQuery(joinServicePath(servicePrefix, payload.path), payload.query);
|
|
2553
|
+
const headers = new Headers(payload.headers);
|
|
2554
|
+
let body;
|
|
2555
|
+
if (payload.body !== void 0) {
|
|
2556
|
+
if (payload.body instanceof FormData) {
|
|
2557
|
+
body = payload.body;
|
|
2558
|
+
} else {
|
|
2559
|
+
headers.set("Content-Type", headers.get("Content-Type") || "application/json");
|
|
2560
|
+
body = JSON.stringify(payload.body);
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
const response = await fetchImpl(url, {
|
|
2564
|
+
method: normalizeMethod2(payload.method),
|
|
2565
|
+
headers,
|
|
2566
|
+
body,
|
|
2567
|
+
credentials: "include"
|
|
2568
|
+
});
|
|
2569
|
+
return parseJsonResponse(response);
|
|
2570
|
+
};
|
|
2571
|
+
const download = async (payload) => {
|
|
2572
|
+
if (!payload?.path) {
|
|
2573
|
+
throw new Error("transport.download \u9700\u8981 path");
|
|
2574
|
+
}
|
|
2575
|
+
const url = appendQuery(joinServicePath(servicePrefix, payload.path), payload.query);
|
|
2576
|
+
const headers = new Headers(payload.headers);
|
|
2577
|
+
let body;
|
|
2578
|
+
if (payload.body !== void 0) {
|
|
2579
|
+
if (payload.body instanceof FormData) {
|
|
2580
|
+
body = payload.body;
|
|
2581
|
+
} else {
|
|
2582
|
+
headers.set("Content-Type", headers.get("Content-Type") || "application/json");
|
|
2583
|
+
body = JSON.stringify(payload.body);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
const response = await fetchImpl(url, {
|
|
2587
|
+
method: normalizeMethod2(payload.method),
|
|
2588
|
+
headers,
|
|
2589
|
+
body,
|
|
2590
|
+
credentials: "include"
|
|
2591
|
+
});
|
|
2592
|
+
if (!response.ok) {
|
|
2593
|
+
throw new Error(response.statusText || "\u4E0B\u8F7D\u5931\u8D25");
|
|
2594
|
+
}
|
|
2595
|
+
return {
|
|
2596
|
+
blob: await response.blob(),
|
|
2597
|
+
contentType: response.headers.get("content-type") || void 0,
|
|
2598
|
+
fileName: response.headers.get("content-disposition") || void 0,
|
|
2599
|
+
headers: Object.fromEntries(response.headers.entries())
|
|
2600
|
+
};
|
|
2601
|
+
};
|
|
2602
|
+
return {
|
|
2603
|
+
invoke: async (method, payload) => {
|
|
2604
|
+
if (method === "transport.request") return await request(payload);
|
|
2605
|
+
if (method === "transport.download") return await download(payload);
|
|
2606
|
+
throw new Error(`\u4E0D\u652F\u6301\u7684 bridge \u65B9\u6CD5: ${method}`);
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2609
|
+
};
|
|
2610
|
+
var createBrowserPageContext = (bootstrap, options = {}) => {
|
|
2611
|
+
const route = {
|
|
2612
|
+
pathname: options.route?.pathname || (typeof window !== "undefined" ? window.location.pathname : ""),
|
|
2613
|
+
fullPath: options.route?.fullPath || (typeof window !== "undefined" ? `${window.location.pathname}${window.location.search}${window.location.hash}` : ""),
|
|
2614
|
+
params: options.route?.params || {},
|
|
2615
|
+
query: options.route?.query || {},
|
|
2616
|
+
hash: options.route?.hash || (typeof window !== "undefined" ? window.location.hash : "")
|
|
2617
|
+
};
|
|
2618
|
+
return {
|
|
2619
|
+
protocolVersion: bootstrap.asset?.protocolVersion || "1.0",
|
|
2620
|
+
app: bootstrap.app,
|
|
2621
|
+
page: {
|
|
2622
|
+
...bootstrap.page,
|
|
2623
|
+
version: bootstrap.asset?.version || bootstrap.page.version,
|
|
2624
|
+
buildId: bootstrap.asset?.buildId || bootstrap.page.buildId
|
|
2625
|
+
},
|
|
2626
|
+
user: bootstrap.user,
|
|
2627
|
+
route,
|
|
2628
|
+
env: bootstrap.env || {},
|
|
2629
|
+
permissions: {
|
|
2630
|
+
canView: bootstrap.permissions?.canView !== false,
|
|
2631
|
+
hasFullAccess: bootstrap.permissions?.hasFullAccess === true,
|
|
2632
|
+
...bootstrap.permissions || {}
|
|
2633
|
+
},
|
|
2634
|
+
capabilities: Array.from(
|
|
2635
|
+
/* @__PURE__ */ new Set([
|
|
2636
|
+
"navigation",
|
|
2637
|
+
"ui.message",
|
|
2638
|
+
"ui.modal",
|
|
2639
|
+
"transport.request",
|
|
2640
|
+
"transport.download",
|
|
2641
|
+
...bootstrap.sdk?.supportedBridgeMethods || []
|
|
2642
|
+
])
|
|
2643
|
+
),
|
|
2644
|
+
ui: {
|
|
2645
|
+
message: {
|
|
2646
|
+
success: (text) => options.message?.success?.(text),
|
|
2647
|
+
error: (text) => options.message?.error?.(text),
|
|
2648
|
+
warning: (text) => options.message?.warning?.(text),
|
|
2649
|
+
info: (text) => options.message?.info?.(text),
|
|
2650
|
+
loading: (text) => options.message?.loading?.(text) || (() => void 0)
|
|
2651
|
+
},
|
|
2652
|
+
modal: {
|
|
2653
|
+
confirm: (input) => options.modal?.confirm?.(input) || Promise.resolve(false)
|
|
2654
|
+
}
|
|
2655
|
+
},
|
|
2656
|
+
navigation: {
|
|
2657
|
+
pushPage: (pageKey, query) => options.navigation?.pushPage?.(pageKey, query),
|
|
2658
|
+
replacePage: (pageKey, query) => options.navigation?.replacePage?.(pageKey, query),
|
|
2659
|
+
pushRoute: (routeValue, query) => options.navigation?.pushRoute?.(routeValue, query),
|
|
2660
|
+
replaceRoute: (routeValue, query) => options.navigation?.replaceRoute?.(routeValue, query),
|
|
2661
|
+
updateQuery: (query) => options.navigation?.updateQuery?.(query),
|
|
2662
|
+
setHash: (hash) => options.navigation?.setHash?.(hash),
|
|
2663
|
+
back: () => options.navigation?.back?.()
|
|
2664
|
+
},
|
|
2665
|
+
bridge: createBrowserPageBridge(options),
|
|
2666
|
+
sdk: {
|
|
2667
|
+
...bootstrap.sdk,
|
|
2668
|
+
supportedBridgeMethods: ["transport.request", "transport.download"]
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2492
2673
|
// packages/sdk/src/runtime/react/auth.tsx
|
|
2493
2674
|
import {
|
|
2494
2675
|
useCallback as useCallback3,
|
|
@@ -2548,7 +2729,7 @@ var createAuthClient = ({
|
|
|
2548
2729
|
const payload = await readPayload(response);
|
|
2549
2730
|
const code = getRecordValue(payload, "code");
|
|
2550
2731
|
const success = getRecordValue(payload, "success");
|
|
2551
|
-
if (!response.ok || success === false || !
|
|
2732
|
+
if (!response.ok || success === false || !isSuccessCode3(code)) {
|
|
2552
2733
|
throw new AuthClientError(
|
|
2553
2734
|
String(getRecordValue(payload, "message") || `Auth request failed: ${response.status}`),
|
|
2554
2735
|
{ status: response.status, code, payload }
|
|
@@ -2601,7 +2782,7 @@ var getRecordValue = (value, key) => {
|
|
|
2601
2782
|
if (!value || typeof value !== "object") return void 0;
|
|
2602
2783
|
return value[key];
|
|
2603
2784
|
};
|
|
2604
|
-
var
|
|
2785
|
+
var isSuccessCode3 = (code) => {
|
|
2605
2786
|
if (code === void 0 || code === null || code === "") return true;
|
|
2606
2787
|
const normalized = Number(code);
|
|
2607
2788
|
return Number.isFinite(normalized) ? normalized === 0 || normalized >= 200 && normalized < 300 : false;
|
|
@@ -3230,6 +3411,96 @@ var useOpenXiangda = () => {
|
|
|
3230
3411
|
return context;
|
|
3231
3412
|
};
|
|
3232
3413
|
var useRuntimeBootstrap = () => useOpenXiangda();
|
|
3414
|
+
var OpenXiangdaPageProvider = ({
|
|
3415
|
+
children,
|
|
3416
|
+
page,
|
|
3417
|
+
route,
|
|
3418
|
+
env,
|
|
3419
|
+
message: message2,
|
|
3420
|
+
modal,
|
|
3421
|
+
navigation
|
|
3422
|
+
}) => {
|
|
3423
|
+
const runtime = useOpenXiangda();
|
|
3424
|
+
const context = useMemo5(() => {
|
|
3425
|
+
const bootstrap = runtime.data;
|
|
3426
|
+
const app = toRuntimeRecord(bootstrap?.app);
|
|
3427
|
+
const user = toRuntimeRecord(bootstrap?.user);
|
|
3428
|
+
const permissions = bootstrap?.permissions;
|
|
3429
|
+
const tenantId = toStringValue(getRecordValue2(app, "tenantId")) || toStringValue(getRecordValue2(user, "tenantId")) || toStringValue(getRecordValue2(app, "tenantCode")) || "";
|
|
3430
|
+
const appType = runtime.appType || bootstrap?.appType || toStringValue(getRecordValue2(app, "appType"));
|
|
3431
|
+
const routeInfo = buildBrowserRouteInfo(route);
|
|
3432
|
+
return createBrowserPageContext(
|
|
3433
|
+
{
|
|
3434
|
+
app: {
|
|
3435
|
+
...app,
|
|
3436
|
+
appType,
|
|
3437
|
+
tenantId
|
|
3438
|
+
},
|
|
3439
|
+
page: {
|
|
3440
|
+
id: routeInfo.pathname || "react-spa",
|
|
3441
|
+
code: routeInfo.pathname || "react-spa",
|
|
3442
|
+
name: "OpenXiangda React SPA",
|
|
3443
|
+
type: "react-spa",
|
|
3444
|
+
rendererType: "react-spa",
|
|
3445
|
+
routeKey: routeInfo.pathname || "react-spa",
|
|
3446
|
+
status: "ACTIVE",
|
|
3447
|
+
props: {},
|
|
3448
|
+
route: {},
|
|
3449
|
+
dataSources: [],
|
|
3450
|
+
capabilities: {},
|
|
3451
|
+
buildId: toStringValue(
|
|
3452
|
+
getRecordValue2(bootstrap?.runtime, "activeBuildId")
|
|
3453
|
+
),
|
|
3454
|
+
...page
|
|
3455
|
+
},
|
|
3456
|
+
user: {
|
|
3457
|
+
...user,
|
|
3458
|
+
id: toStringValue(getRecordValue2(user, "id")) || (user.isGuest ? "guest" : "current"),
|
|
3459
|
+
username: toStringValue(getRecordValue2(user, "username")) || toStringValue(getRecordValue2(user, "name")) || (user.isGuest ? "guest" : "current"),
|
|
3460
|
+
tenantId,
|
|
3461
|
+
isGuest: user.isGuest === true || user.userType === "guest" || Boolean(getRecordValue2(user, "publicAccess")),
|
|
3462
|
+
userType: user.userType === "guest" || user.isGuest === true ? "guest" : "normal"
|
|
3463
|
+
},
|
|
3464
|
+
env: {
|
|
3465
|
+
appType,
|
|
3466
|
+
servicePrefix: runtime.servicePrefix,
|
|
3467
|
+
runtimeMode: bootstrap?.runtime?.mode || "react-spa",
|
|
3468
|
+
...env || {}
|
|
3469
|
+
},
|
|
3470
|
+
permissions: {
|
|
3471
|
+
canView: runtime.error?.type !== "forbidden",
|
|
3472
|
+
hasFullAccess: permissions?.hasFullAccess === true,
|
|
3473
|
+
...permissions || {}
|
|
3474
|
+
},
|
|
3475
|
+
sdk: {
|
|
3476
|
+
packageName: "openxiangda",
|
|
3477
|
+
supportedBridgeMethods: ["transport.request", "transport.download"]
|
|
3478
|
+
}
|
|
3479
|
+
},
|
|
3480
|
+
{
|
|
3481
|
+
servicePrefix: runtime.servicePrefix,
|
|
3482
|
+
fetchImpl: runtime.fetchImpl,
|
|
3483
|
+
route: routeInfo,
|
|
3484
|
+
message: message2,
|
|
3485
|
+
modal,
|
|
3486
|
+
navigation
|
|
3487
|
+
}
|
|
3488
|
+
);
|
|
3489
|
+
}, [
|
|
3490
|
+
env,
|
|
3491
|
+
message2,
|
|
3492
|
+
modal,
|
|
3493
|
+
navigation,
|
|
3494
|
+
page,
|
|
3495
|
+
route,
|
|
3496
|
+
runtime.appType,
|
|
3497
|
+
runtime.data,
|
|
3498
|
+
runtime.error?.type,
|
|
3499
|
+
runtime.fetchImpl,
|
|
3500
|
+
runtime.servicePrefix
|
|
3501
|
+
]);
|
|
3502
|
+
return /* @__PURE__ */ jsx4(PageProvider, { context, children });
|
|
3503
|
+
};
|
|
3233
3504
|
var useAppMenus = () => {
|
|
3234
3505
|
const runtime = useOpenXiangda();
|
|
3235
3506
|
return {
|
|
@@ -3607,7 +3878,40 @@ var getRecordValue2 = (value, key) => {
|
|
|
3607
3878
|
if (!value || typeof value !== "object") return void 0;
|
|
3608
3879
|
return value[key];
|
|
3609
3880
|
};
|
|
3610
|
-
var
|
|
3881
|
+
var toRuntimeRecord = (value) => {
|
|
3882
|
+
return value && typeof value === "object" ? { ...value } : {};
|
|
3883
|
+
};
|
|
3884
|
+
var toStringValue = (value) => {
|
|
3885
|
+
if (value === void 0 || value === null) return "";
|
|
3886
|
+
return String(value);
|
|
3887
|
+
};
|
|
3888
|
+
var parseBrowserQuery = () => {
|
|
3889
|
+
if (typeof window === "undefined") return {};
|
|
3890
|
+
const query = {};
|
|
3891
|
+
const params = new URLSearchParams(window.location.search);
|
|
3892
|
+
params.forEach((value, key) => {
|
|
3893
|
+
const currentValue = query[key];
|
|
3894
|
+
if (currentValue === void 0) {
|
|
3895
|
+
query[key] = value;
|
|
3896
|
+
return;
|
|
3897
|
+
}
|
|
3898
|
+
query[key] = Array.isArray(currentValue) ? [...currentValue, value] : [currentValue, value];
|
|
3899
|
+
});
|
|
3900
|
+
return query;
|
|
3901
|
+
};
|
|
3902
|
+
var buildBrowserRouteInfo = (route) => {
|
|
3903
|
+
const pathname = route?.pathname || (typeof window !== "undefined" ? window.location.pathname : "");
|
|
3904
|
+
const search = typeof window !== "undefined" ? window.location.search : "";
|
|
3905
|
+
const hash = route?.hash || (typeof window !== "undefined" ? window.location.hash : "");
|
|
3906
|
+
return {
|
|
3907
|
+
pathname,
|
|
3908
|
+
fullPath: route?.fullPath || (typeof window !== "undefined" ? `${pathname}${search}${hash}` : pathname),
|
|
3909
|
+
params: route?.params || {},
|
|
3910
|
+
query: route?.query || parseBrowserQuery(),
|
|
3911
|
+
hash
|
|
3912
|
+
};
|
|
3913
|
+
};
|
|
3914
|
+
var isSuccessCode4 = (code) => {
|
|
3611
3915
|
if (code === void 0 || code === null || code === "") return true;
|
|
3612
3916
|
const normalized = Number(code);
|
|
3613
3917
|
return Number.isFinite(normalized) ? normalized === 0 || normalized >= 200 && normalized < 300 : false;
|
|
@@ -3615,7 +3919,7 @@ var isSuccessCode3 = (code) => {
|
|
|
3615
3919
|
var isRuntimeEnvelopeFailure = (response, payload) => {
|
|
3616
3920
|
const code = getRecordValue2(payload, "code");
|
|
3617
3921
|
const success = getRecordValue2(payload, "success");
|
|
3618
|
-
return !response.ok || success === false || !
|
|
3922
|
+
return !response.ok || success === false || !isSuccessCode4(code);
|
|
3619
3923
|
};
|
|
3620
3924
|
var isServerErrorCode = (code) => {
|
|
3621
3925
|
const normalized = Number(code);
|
|
@@ -3685,7 +3989,7 @@ var createPublicAccessClient = ({
|
|
|
3685
3989
|
const payload = await readPayload2(response);
|
|
3686
3990
|
const code = getRecordValue3(payload, "code");
|
|
3687
3991
|
const success = getRecordValue3(payload, "success");
|
|
3688
|
-
if (!response.ok || success === false || !
|
|
3992
|
+
if (!response.ok || success === false || !isSuccessCode5(code)) {
|
|
3689
3993
|
throw new PublicAccessClientError(
|
|
3690
3994
|
String(
|
|
3691
3995
|
getRecordValue3(payload, "message") || `Public access session failed: ${response.status}`
|
|
@@ -3723,7 +4027,7 @@ var getRecordValue3 = (value, key) => {
|
|
|
3723
4027
|
if (!value || typeof value !== "object") return void 0;
|
|
3724
4028
|
return value[key];
|
|
3725
4029
|
};
|
|
3726
|
-
var
|
|
4030
|
+
var isSuccessCode5 = (code) => {
|
|
3727
4031
|
if (code === void 0 || code === null || code === "") return true;
|
|
3728
4032
|
const normalized = Number(code);
|
|
3729
4033
|
return Number.isFinite(normalized) ? normalized === 0 || normalized >= 200 && normalized < 300 : false;
|
|
@@ -3842,6 +4146,7 @@ var readPathFromLocation = () => typeof window === "undefined" ? void 0 : window
|
|
|
3842
4146
|
export {
|
|
3843
4147
|
AuthClientError,
|
|
3844
4148
|
LoginPage,
|
|
4149
|
+
OpenXiangdaPageProvider,
|
|
3845
4150
|
OpenXiangdaProvider,
|
|
3846
4151
|
PageProvider,
|
|
3847
4152
|
PermissionBoundary,
|