openxiangda 1.0.149 → 1.0.150
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 +1 -1
- package/openxiangda-skills/SKILL.md +1 -1
- package/openxiangda-skills/references/automation-v3.md +1 -1
- package/openxiangda-skills/references/connector-resources.md +1 -1
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +2 -2
- package/openxiangda-skills/references/workflow-v3.md +1 -1
- package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +1 -1
- package/package.json +1 -1
- package/packages/sdk/dist/runtime/index.cjs +299 -34
- 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 +299 -34
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +287 -22
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +18 -1
- package/packages/sdk/dist/runtime/react.d.ts +18 -1
- package/packages/sdk/dist/runtime/react.mjs +287 -22
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/templates/openxiangda-react-spa/src/app/router.tsx +6 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/sync_roles_to_platform/index.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageContext, PageInfo, PageBridgeApi } from './react.mjs';
|
|
2
|
-
export { ApiEnvelope, ApiPermissionListParams, AppAuthClient, AppFunctionConnectorApi, AppFunctionContext, AppFunctionDataViewApi, AppFunctionFormApi, AppFunctionFormGetByIdParams, AppFunctionFormQueryParams, AppFunctionFormWriteParams, AppFunctionNotificationApi, AppFunctionOperatorInfo, AppFunctionOrganizationApi, AppFunctionPermissionContext, AppFunctionRuntimeContext, ApproveTaskParams, AssignPermissionsParams, AssignRolesParams, AuthChallengePayload, AuthClientError, AuthClientErrorOptions, AuthClientOptions, AuthErrorExtra, AuthLogoutRedirectOptions, AuthMethod, AuthMethodType, AuthTokenData, AuthUser, BatchAddUsersToRoleParams, BatchSendNotificationByTypeParams, ChangeOrganizationAccountPasswordParams, ChangeUserRoleParams, ConnectorCallParams, ConnectorInvokeParams, ConnectorInvokeResult, ConnectorRequestBodyType, ConnectorResponseType, CreateApiPermissionParams, CreateFileAccessTicketOptions, CreateFormPermissionGroupDto, CreateOrganizationAccountParams, CreateOrganizationDepartmentParams, CreatePagePermissionGroupDto, CreateRoleParams, CreateUiPermissionParams, CreateUserParams, CurrentUserDepartmentParents, CustomPageEntryConfig, CustomPageEntryMode, DataManagementConfigParams, DataManagementFilterState, DataPermissionConditionDto, DataPermissionDto, DataPermissionRuleDto, DataViewQueryParams, DataViewQueryResult, DataViewStatsParams, DingTalkLoginInput, DingTalkNotificationCapabilities, DingTalkNotificationCardConfig, DingTalkNotificationCardField, DingTalkNotificationCardMode, DingTalkNotificationCardPreview, DingTalkNotificationChannelConfig, DingTalkNotificationDeliveryMode, DingTalkNotificationPreviewResult, ExecuteProcessOperationInput, FieldAccessLevel, FieldAccessPolicyDto, FieldAccessPolicyItemDto, FieldOptionValue, FieldPermissionDto, FileAccessTicketAction, FileAccessTicketResult, FindNotificationConfigParams, FormAdvancedSearchParams, FormChangeRecordParams, FormCreateParams, FormCreateResult, FormDetailResult, FormExportParams, FormFieldValue, FormGetDetailParams, FormImportParams, FormInstanceIdentifierResult, FormPermissionGroup, FormRemoveParams, FormSearchParams, FormUpdateParams, FormUpdateResult, FunctionInvokeParams, FunctionInvokeResult, GetParentDepartmentsOptions, GetProcessInstanceParams, GetUserRolesParams, GuestLoginInput, ImportExportRecordDownloadParams, ImportExportRecordQuery, InitiatorApproverSelector, InstanceStatus, ListNotificationInboxParams, ListWorkCenterItemsParams, LoginLogGetParams, LoginLogListParams, LoginLogRecord, LoginLogStats, LoginLogStatsParams, LoginLogStatus, LoginMethodsResult, LoginPage, LoginPageProps, MarkAllNotificationReadResult, NotificationChannel, NotificationChannelConfig, NotificationChannelsConfig, NotificationConfigLevel, NotificationInboxListResult, NotificationInboxMessage, NotificationInboxReadStatus, NotificationMessageRecord, NotificationTemplate, NotificationTemplatePreview, NotificationTypeConfig, NotificationUnreadCountResult, OpenXiangdaPageProvider, OpenXiangdaPageProviderProps, OpenXiangdaProvider, OpenXiangdaProviderProps, OrganizationAccountListParams, OrganizationCapabilities, OrganizationListResult, PageApiPermissionRecord, PageApiResponse, PageAppInfo, PageBinaryResponse, PageDataManagementConfig, PageDataSourceDescriptor, PageDepartmentInfo, PageDepartmentRecord, PageHttpMethod, PageListResult, PageMessageApi, PageModalApi, PageNavigationApi, PageOffsetListResult, PagePermissionGroup, PagePermissionInfo, PageProvider, PageQueryValue, PageRequestOptions, PageRoleRecord, PageRouteInfo, PageScope, PageSdk, PageSdkError, PageSdkMeta, PageTransportDownloadPayload, PageTransportRequestPayload, PageUiPermissionRecord, PageUiPermissionType, PageUserInfo, PageUserRecord, PageUserType, PasswordLoginInput, PermissionBoundary, PermissionBoundaryFallback, PermissionBoundaryFallbackState, PermissionBoundaryProps, PhoneCodeInput, PhoneCodeLoginInput, PhoneCodeRegisterInput, PhoneCodeSendResult, PreviewDingTalkNotificationParams, PreviewNotificationTemplateParams, ProcessActionBar, ProcessActionBarProps, ProcessApproveAction, ProcessCapabilities, ProcessCapabilityOperation, ProcessInstanceLookupParams, ProcessPreviewPanel, ProcessPreviewPanelProps, ProcessTimeline, ProcessTimelineProps, PublicAccessClaim, PublicAccessClient, PublicAccessClientError, PublicAccessClientOptions, PublicAccessGate, PublicAccessGateProps, PublicAccessSessionData, PublicAccessSessionInput, PublicStorageAction, PublicStorageGrant, QueryFormPermissionGroupDto, QueryPagePermissionGroupDto, RefreshInput, ResetOrganizationAccountPasswordParams, ResolveLoginUrlInput, ResolveProcessCapabilitiesParams, RoleListParams, RoleUsersParams, RouteAccessResult, RuntimeBootstrap, RuntimeErrorSnapshot, RuntimeErrorType, RuntimeLogoutOptions, RuntimeMenuItem, RuntimePagePermissions, RuntimeRedirectLoginOptions, RuntimeRequestError, RuntimeRequestState, RuntimeResolveLoginOptions, SaveDataManagementConfigParams, SearchComponentName, SearchExpression, SearchFieldKey, SearchGroup, SearchLogic, SearchOperator, SearchRule, SearchSortItem, SearchSystemField, SendNotificationByTypeParams, SendNotificationResult, SsoLoginUrlInput, SsoLoginUrlResult, SubFormRule, SwitchAppRoleParams, SwitchPlatformRoleParams, TerminateProcessInstanceParams, TriggerCallbackTaskParams, UiPermissionListParams, UpdateApiPermissionParams, UpdateFormPermissionGroupDto, UpdateOrganizationAccountParams, UpdateOrganizationDepartmentParams, UpdatePagePermissionGroupDto, UpdateRoleParams, UpdateUiPermissionParams, UpdateUserParams, UseAuthOptions, UseCanAccessRouteInput, UseLoginMethodsState, UseProcessActionsOptions, UseProcessActionsReturn, UseProcessCapabilitiesOptions, UseProcessCapabilitiesReturn, UsePublicAccessOptions, UsePublicAccessState, UserListParams, UserMenuPermissionsResponse, ValidateUserParams, ViewFieldPermissionValue, ViewOperationPermission, ViewPermissionSummary, WorkCenterBoxType, WorkCenterGroupedStat, WorkCenterItem, WorkCenterListResult, WorkCenterStats, WorkCenterStatsParams, WorkflowApproveParams, WorkflowCapabilityActionKey, WorkflowDefinitionByFormParams, WorkflowInitiatorSelectCandidatesParams, WorkflowInitiatorSelectRequirementsParams, WorkflowPreviewParams, WorkflowResubmitInitiatorSelectRequirementsParams, WorkflowResubmitParams, WorkflowReturnParams, WorkflowSaveTaskParams, WorkflowStartFromExistingInstanceParams, WorkflowTaskParams, WorkflowTransferParams, WorkflowWithdrawParams, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, getAuthErrorExtra, getAuthErrorReason, isAuthChallengeRequired, isAuthClientError, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, useProcessActions, useProcessCapabilities, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap } from './react.mjs';
|
|
2
|
+
export { ApiEnvelope, ApiPermissionListParams, AppAuthClient, AppFunctionConnectorApi, AppFunctionContext, AppFunctionDataViewApi, AppFunctionFormApi, AppFunctionFormGetByIdParams, AppFunctionFormQueryParams, AppFunctionFormWriteParams, AppFunctionNotificationApi, AppFunctionOperatorInfo, AppFunctionOrganizationApi, AppFunctionPermissionContext, AppFunctionRuntimeContext, ApproveTaskParams, AssignPermissionsParams, AssignRolesParams, AuthChallengePayload, AuthClientError, AuthClientErrorOptions, AuthClientOptions, AuthErrorExtra, AuthLogoutRedirectOptions, AuthMethod, AuthMethodType, AuthTokenData, AuthUser, BatchAddUsersToRoleParams, BatchSendNotificationByTypeParams, ChangeOrganizationAccountPasswordParams, ChangeUserRoleParams, ConnectorCallParams, ConnectorInvokeParams, ConnectorInvokeResult, ConnectorRequestBodyType, ConnectorResponseType, CreateApiPermissionParams, CreateFileAccessTicketOptions, CreateFormPermissionGroupDto, CreateOrganizationAccountParams, CreateOrganizationDepartmentParams, CreatePagePermissionGroupDto, CreateRoleParams, CreateUiPermissionParams, CreateUserParams, CurrentUserDepartmentParents, CustomPageEntryConfig, CustomPageEntryMode, DataManagementConfigParams, DataManagementFilterState, DataPermissionConditionDto, DataPermissionDto, DataPermissionRuleDto, DataViewQueryParams, DataViewQueryResult, DataViewStatsParams, DingTalkLoginInput, DingTalkNotificationCapabilities, DingTalkNotificationCardConfig, DingTalkNotificationCardField, DingTalkNotificationCardMode, DingTalkNotificationCardPreview, DingTalkNotificationChannelConfig, DingTalkNotificationDeliveryMode, DingTalkNotificationPreviewResult, ExecuteProcessOperationInput, FieldAccessLevel, FieldAccessPolicyDto, FieldAccessPolicyItemDto, FieldOptionValue, FieldPermissionDto, FileAccessTicketAction, FileAccessTicketResult, FindNotificationConfigParams, FormAdvancedSearchParams, FormChangeRecordParams, FormCreateParams, FormCreateResult, FormDetailResult, FormExportParams, FormFieldValue, FormGetDetailParams, FormImportParams, FormInstanceIdentifierResult, FormPermissionGroup, FormRemoveParams, FormSearchParams, FormUpdateParams, FormUpdateResult, FunctionInvokeParams, FunctionInvokeResult, GetParentDepartmentsOptions, GetProcessInstanceParams, GetUserRolesParams, GuestLoginInput, ImportExportRecordDownloadParams, ImportExportRecordQuery, InitiatorApproverSelector, InstanceStatus, ListNotificationInboxParams, ListWorkCenterItemsParams, LoginLogGetParams, LoginLogListParams, LoginLogRecord, LoginLogStats, LoginLogStatsParams, LoginLogStatus, LoginMethodsResult, LoginPage, LoginPageProps, MarkAllNotificationReadResult, NotificationChannel, NotificationChannelConfig, NotificationChannelsConfig, NotificationConfigLevel, NotificationInboxListResult, NotificationInboxMessage, NotificationInboxReadStatus, NotificationMessageRecord, NotificationTemplate, NotificationTemplatePreview, NotificationTypeConfig, NotificationUnreadCountResult, OpenXiangdaPageProvider, OpenXiangdaPageProviderProps, OpenXiangdaProvider, OpenXiangdaProviderProps, OrganizationAccountListParams, OrganizationCapabilities, OrganizationListResult, PageApiPermissionRecord, PageApiResponse, PageAppInfo, PageBinaryResponse, PageDataManagementConfig, PageDataSourceDescriptor, PageDepartmentInfo, PageDepartmentRecord, PageHttpMethod, PageListResult, PageMessageApi, PageModalApi, PageNavigationApi, PageOffsetListResult, PagePermissionGroup, PagePermissionInfo, PageProvider, PageQueryValue, PageRequestOptions, PageRoleRecord, PageRouteInfo, PageScope, PageSdk, PageSdkError, PageSdkMeta, PageTransportDownloadPayload, PageTransportRequestPayload, PageUiPermissionRecord, PageUiPermissionType, PageUserInfo, PageUserRecord, PageUserType, PasswordLoginInput, PermissionBoundary, PermissionBoundaryFallback, PermissionBoundaryFallbackState, PermissionBoundaryProps, PhoneCodeInput, PhoneCodeLoginInput, PhoneCodeRegisterInput, PhoneCodeSendResult, PreviewDingTalkNotificationParams, PreviewNotificationTemplateParams, ProcessActionBar, ProcessActionBarProps, ProcessApproveAction, ProcessCapabilities, ProcessCapabilityOperation, ProcessInstanceLookupParams, ProcessPreviewPanel, ProcessPreviewPanelProps, ProcessTimeline, ProcessTimelineProps, PublicAccessClaim, PublicAccessClient, PublicAccessClientError, PublicAccessClientOptions, PublicAccessGate, PublicAccessGateProps, PublicAccessSessionData, PublicAccessSessionInput, PublicStorageAction, PublicStorageGrant, QueryFormPermissionGroupDto, QueryPagePermissionGroupDto, RefreshInput, ResetOrganizationAccountPasswordParams, ResolveLoginUrlInput, ResolveProcessCapabilitiesParams, RoleListParams, RoleUsersParams, RouteAccessResult, RuntimeAuthGuard, RuntimeAuthGuardProps, RuntimeAuthState, RuntimeAuthStatus, RuntimeBootstrap, RuntimeErrorSnapshot, RuntimeErrorType, RuntimeLogoutOptions, RuntimeMenuItem, RuntimePagePermissions, RuntimeRedirectLoginOptions, RuntimeRequestError, RuntimeRequestState, RuntimeResolveLoginOptions, SaveDataManagementConfigParams, SearchComponentName, SearchExpression, SearchFieldKey, SearchGroup, SearchLogic, SearchOperator, SearchRule, SearchSortItem, SearchSystemField, SendNotificationByTypeParams, SendNotificationResult, SsoLoginUrlInput, SsoLoginUrlResult, SubFormRule, SwitchAppRoleParams, SwitchPlatformRoleParams, TerminateProcessInstanceParams, TriggerCallbackTaskParams, UiPermissionListParams, UpdateApiPermissionParams, UpdateFormPermissionGroupDto, UpdateOrganizationAccountParams, UpdateOrganizationDepartmentParams, UpdatePagePermissionGroupDto, UpdateRoleParams, UpdateUiPermissionParams, UpdateUserParams, UseAuthOptions, UseCanAccessRouteInput, UseLoginMethodsState, UseProcessActionsOptions, UseProcessActionsReturn, UseProcessCapabilitiesOptions, UseProcessCapabilitiesReturn, UsePublicAccessOptions, UsePublicAccessState, UserListParams, UserMenuPermissionsResponse, ValidateUserParams, ViewFieldPermissionValue, ViewOperationPermission, ViewPermissionSummary, WorkCenterBoxType, WorkCenterGroupedStat, WorkCenterItem, WorkCenterListResult, WorkCenterStats, WorkCenterStatsParams, WorkflowApproveParams, WorkflowCapabilityActionKey, WorkflowDefinitionByFormParams, WorkflowInitiatorSelectCandidatesParams, WorkflowInitiatorSelectRequirementsParams, WorkflowPreviewParams, WorkflowResubmitInitiatorSelectRequirementsParams, WorkflowResubmitParams, WorkflowReturnParams, WorkflowSaveTaskParams, WorkflowStartFromExistingInstanceParams, WorkflowTaskParams, WorkflowTransferParams, WorkflowWithdrawParams, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, getAuthErrorExtra, getAuthErrorReason, isAuthChallengeRequired, isAuthClientError, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, useProcessActions, useProcessCapabilities, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap } from './react.mjs';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { b as FormSchema, a as FormRuntimeApi, c as FormRuntimeApiConfig } from '../ProcessPreview-BOCARAvP.mjs';
|
|
5
5
|
export { e as extractFieldsFromComponentsTree } from '../dataManagementApi-CLMqf79O.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageContext, PageInfo, PageBridgeApi } from './react.js';
|
|
2
|
-
export { ApiEnvelope, ApiPermissionListParams, AppAuthClient, AppFunctionConnectorApi, AppFunctionContext, AppFunctionDataViewApi, AppFunctionFormApi, AppFunctionFormGetByIdParams, AppFunctionFormQueryParams, AppFunctionFormWriteParams, AppFunctionNotificationApi, AppFunctionOperatorInfo, AppFunctionOrganizationApi, AppFunctionPermissionContext, AppFunctionRuntimeContext, ApproveTaskParams, AssignPermissionsParams, AssignRolesParams, AuthChallengePayload, AuthClientError, AuthClientErrorOptions, AuthClientOptions, AuthErrorExtra, AuthLogoutRedirectOptions, AuthMethod, AuthMethodType, AuthTokenData, AuthUser, BatchAddUsersToRoleParams, BatchSendNotificationByTypeParams, ChangeOrganizationAccountPasswordParams, ChangeUserRoleParams, ConnectorCallParams, ConnectorInvokeParams, ConnectorInvokeResult, ConnectorRequestBodyType, ConnectorResponseType, CreateApiPermissionParams, CreateFileAccessTicketOptions, CreateFormPermissionGroupDto, CreateOrganizationAccountParams, CreateOrganizationDepartmentParams, CreatePagePermissionGroupDto, CreateRoleParams, CreateUiPermissionParams, CreateUserParams, CurrentUserDepartmentParents, CustomPageEntryConfig, CustomPageEntryMode, DataManagementConfigParams, DataManagementFilterState, DataPermissionConditionDto, DataPermissionDto, DataPermissionRuleDto, DataViewQueryParams, DataViewQueryResult, DataViewStatsParams, DingTalkLoginInput, DingTalkNotificationCapabilities, DingTalkNotificationCardConfig, DingTalkNotificationCardField, DingTalkNotificationCardMode, DingTalkNotificationCardPreview, DingTalkNotificationChannelConfig, DingTalkNotificationDeliveryMode, DingTalkNotificationPreviewResult, ExecuteProcessOperationInput, FieldAccessLevel, FieldAccessPolicyDto, FieldAccessPolicyItemDto, FieldOptionValue, FieldPermissionDto, FileAccessTicketAction, FileAccessTicketResult, FindNotificationConfigParams, FormAdvancedSearchParams, FormChangeRecordParams, FormCreateParams, FormCreateResult, FormDetailResult, FormExportParams, FormFieldValue, FormGetDetailParams, FormImportParams, FormInstanceIdentifierResult, FormPermissionGroup, FormRemoveParams, FormSearchParams, FormUpdateParams, FormUpdateResult, FunctionInvokeParams, FunctionInvokeResult, GetParentDepartmentsOptions, GetProcessInstanceParams, GetUserRolesParams, GuestLoginInput, ImportExportRecordDownloadParams, ImportExportRecordQuery, InitiatorApproverSelector, InstanceStatus, ListNotificationInboxParams, ListWorkCenterItemsParams, LoginLogGetParams, LoginLogListParams, LoginLogRecord, LoginLogStats, LoginLogStatsParams, LoginLogStatus, LoginMethodsResult, LoginPage, LoginPageProps, MarkAllNotificationReadResult, NotificationChannel, NotificationChannelConfig, NotificationChannelsConfig, NotificationConfigLevel, NotificationInboxListResult, NotificationInboxMessage, NotificationInboxReadStatus, NotificationMessageRecord, NotificationTemplate, NotificationTemplatePreview, NotificationTypeConfig, NotificationUnreadCountResult, OpenXiangdaPageProvider, OpenXiangdaPageProviderProps, OpenXiangdaProvider, OpenXiangdaProviderProps, OrganizationAccountListParams, OrganizationCapabilities, OrganizationListResult, PageApiPermissionRecord, PageApiResponse, PageAppInfo, PageBinaryResponse, PageDataManagementConfig, PageDataSourceDescriptor, PageDepartmentInfo, PageDepartmentRecord, PageHttpMethod, PageListResult, PageMessageApi, PageModalApi, PageNavigationApi, PageOffsetListResult, PagePermissionGroup, PagePermissionInfo, PageProvider, PageQueryValue, PageRequestOptions, PageRoleRecord, PageRouteInfo, PageScope, PageSdk, PageSdkError, PageSdkMeta, PageTransportDownloadPayload, PageTransportRequestPayload, PageUiPermissionRecord, PageUiPermissionType, PageUserInfo, PageUserRecord, PageUserType, PasswordLoginInput, PermissionBoundary, PermissionBoundaryFallback, PermissionBoundaryFallbackState, PermissionBoundaryProps, PhoneCodeInput, PhoneCodeLoginInput, PhoneCodeRegisterInput, PhoneCodeSendResult, PreviewDingTalkNotificationParams, PreviewNotificationTemplateParams, ProcessActionBar, ProcessActionBarProps, ProcessApproveAction, ProcessCapabilities, ProcessCapabilityOperation, ProcessInstanceLookupParams, ProcessPreviewPanel, ProcessPreviewPanelProps, ProcessTimeline, ProcessTimelineProps, PublicAccessClaim, PublicAccessClient, PublicAccessClientError, PublicAccessClientOptions, PublicAccessGate, PublicAccessGateProps, PublicAccessSessionData, PublicAccessSessionInput, PublicStorageAction, PublicStorageGrant, QueryFormPermissionGroupDto, QueryPagePermissionGroupDto, RefreshInput, ResetOrganizationAccountPasswordParams, ResolveLoginUrlInput, ResolveProcessCapabilitiesParams, RoleListParams, RoleUsersParams, RouteAccessResult, RuntimeBootstrap, RuntimeErrorSnapshot, RuntimeErrorType, RuntimeLogoutOptions, RuntimeMenuItem, RuntimePagePermissions, RuntimeRedirectLoginOptions, RuntimeRequestError, RuntimeRequestState, RuntimeResolveLoginOptions, SaveDataManagementConfigParams, SearchComponentName, SearchExpression, SearchFieldKey, SearchGroup, SearchLogic, SearchOperator, SearchRule, SearchSortItem, SearchSystemField, SendNotificationByTypeParams, SendNotificationResult, SsoLoginUrlInput, SsoLoginUrlResult, SubFormRule, SwitchAppRoleParams, SwitchPlatformRoleParams, TerminateProcessInstanceParams, TriggerCallbackTaskParams, UiPermissionListParams, UpdateApiPermissionParams, UpdateFormPermissionGroupDto, UpdateOrganizationAccountParams, UpdateOrganizationDepartmentParams, UpdatePagePermissionGroupDto, UpdateRoleParams, UpdateUiPermissionParams, UpdateUserParams, UseAuthOptions, UseCanAccessRouteInput, UseLoginMethodsState, UseProcessActionsOptions, UseProcessActionsReturn, UseProcessCapabilitiesOptions, UseProcessCapabilitiesReturn, UsePublicAccessOptions, UsePublicAccessState, UserListParams, UserMenuPermissionsResponse, ValidateUserParams, ViewFieldPermissionValue, ViewOperationPermission, ViewPermissionSummary, WorkCenterBoxType, WorkCenterGroupedStat, WorkCenterItem, WorkCenterListResult, WorkCenterStats, WorkCenterStatsParams, WorkflowApproveParams, WorkflowCapabilityActionKey, WorkflowDefinitionByFormParams, WorkflowInitiatorSelectCandidatesParams, WorkflowInitiatorSelectRequirementsParams, WorkflowPreviewParams, WorkflowResubmitInitiatorSelectRequirementsParams, WorkflowResubmitParams, WorkflowReturnParams, WorkflowSaveTaskParams, WorkflowStartFromExistingInstanceParams, WorkflowTaskParams, WorkflowTransferParams, WorkflowWithdrawParams, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, getAuthErrorExtra, getAuthErrorReason, isAuthChallengeRequired, isAuthClientError, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, useProcessActions, useProcessCapabilities, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap } from './react.js';
|
|
2
|
+
export { ApiEnvelope, ApiPermissionListParams, AppAuthClient, AppFunctionConnectorApi, AppFunctionContext, AppFunctionDataViewApi, AppFunctionFormApi, AppFunctionFormGetByIdParams, AppFunctionFormQueryParams, AppFunctionFormWriteParams, AppFunctionNotificationApi, AppFunctionOperatorInfo, AppFunctionOrganizationApi, AppFunctionPermissionContext, AppFunctionRuntimeContext, ApproveTaskParams, AssignPermissionsParams, AssignRolesParams, AuthChallengePayload, AuthClientError, AuthClientErrorOptions, AuthClientOptions, AuthErrorExtra, AuthLogoutRedirectOptions, AuthMethod, AuthMethodType, AuthTokenData, AuthUser, BatchAddUsersToRoleParams, BatchSendNotificationByTypeParams, ChangeOrganizationAccountPasswordParams, ChangeUserRoleParams, ConnectorCallParams, ConnectorInvokeParams, ConnectorInvokeResult, ConnectorRequestBodyType, ConnectorResponseType, CreateApiPermissionParams, CreateFileAccessTicketOptions, CreateFormPermissionGroupDto, CreateOrganizationAccountParams, CreateOrganizationDepartmentParams, CreatePagePermissionGroupDto, CreateRoleParams, CreateUiPermissionParams, CreateUserParams, CurrentUserDepartmentParents, CustomPageEntryConfig, CustomPageEntryMode, DataManagementConfigParams, DataManagementFilterState, DataPermissionConditionDto, DataPermissionDto, DataPermissionRuleDto, DataViewQueryParams, DataViewQueryResult, DataViewStatsParams, DingTalkLoginInput, DingTalkNotificationCapabilities, DingTalkNotificationCardConfig, DingTalkNotificationCardField, DingTalkNotificationCardMode, DingTalkNotificationCardPreview, DingTalkNotificationChannelConfig, DingTalkNotificationDeliveryMode, DingTalkNotificationPreviewResult, ExecuteProcessOperationInput, FieldAccessLevel, FieldAccessPolicyDto, FieldAccessPolicyItemDto, FieldOptionValue, FieldPermissionDto, FileAccessTicketAction, FileAccessTicketResult, FindNotificationConfigParams, FormAdvancedSearchParams, FormChangeRecordParams, FormCreateParams, FormCreateResult, FormDetailResult, FormExportParams, FormFieldValue, FormGetDetailParams, FormImportParams, FormInstanceIdentifierResult, FormPermissionGroup, FormRemoveParams, FormSearchParams, FormUpdateParams, FormUpdateResult, FunctionInvokeParams, FunctionInvokeResult, GetParentDepartmentsOptions, GetProcessInstanceParams, GetUserRolesParams, GuestLoginInput, ImportExportRecordDownloadParams, ImportExportRecordQuery, InitiatorApproverSelector, InstanceStatus, ListNotificationInboxParams, ListWorkCenterItemsParams, LoginLogGetParams, LoginLogListParams, LoginLogRecord, LoginLogStats, LoginLogStatsParams, LoginLogStatus, LoginMethodsResult, LoginPage, LoginPageProps, MarkAllNotificationReadResult, NotificationChannel, NotificationChannelConfig, NotificationChannelsConfig, NotificationConfigLevel, NotificationInboxListResult, NotificationInboxMessage, NotificationInboxReadStatus, NotificationMessageRecord, NotificationTemplate, NotificationTemplatePreview, NotificationTypeConfig, NotificationUnreadCountResult, OpenXiangdaPageProvider, OpenXiangdaPageProviderProps, OpenXiangdaProvider, OpenXiangdaProviderProps, OrganizationAccountListParams, OrganizationCapabilities, OrganizationListResult, PageApiPermissionRecord, PageApiResponse, PageAppInfo, PageBinaryResponse, PageDataManagementConfig, PageDataSourceDescriptor, PageDepartmentInfo, PageDepartmentRecord, PageHttpMethod, PageListResult, PageMessageApi, PageModalApi, PageNavigationApi, PageOffsetListResult, PagePermissionGroup, PagePermissionInfo, PageProvider, PageQueryValue, PageRequestOptions, PageRoleRecord, PageRouteInfo, PageScope, PageSdk, PageSdkError, PageSdkMeta, PageTransportDownloadPayload, PageTransportRequestPayload, PageUiPermissionRecord, PageUiPermissionType, PageUserInfo, PageUserRecord, PageUserType, PasswordLoginInput, PermissionBoundary, PermissionBoundaryFallback, PermissionBoundaryFallbackState, PermissionBoundaryProps, PhoneCodeInput, PhoneCodeLoginInput, PhoneCodeRegisterInput, PhoneCodeSendResult, PreviewDingTalkNotificationParams, PreviewNotificationTemplateParams, ProcessActionBar, ProcessActionBarProps, ProcessApproveAction, ProcessCapabilities, ProcessCapabilityOperation, ProcessInstanceLookupParams, ProcessPreviewPanel, ProcessPreviewPanelProps, ProcessTimeline, ProcessTimelineProps, PublicAccessClaim, PublicAccessClient, PublicAccessClientError, PublicAccessClientOptions, PublicAccessGate, PublicAccessGateProps, PublicAccessSessionData, PublicAccessSessionInput, PublicStorageAction, PublicStorageGrant, QueryFormPermissionGroupDto, QueryPagePermissionGroupDto, RefreshInput, ResetOrganizationAccountPasswordParams, ResolveLoginUrlInput, ResolveProcessCapabilitiesParams, RoleListParams, RoleUsersParams, RouteAccessResult, RuntimeAuthGuard, RuntimeAuthGuardProps, RuntimeAuthState, RuntimeAuthStatus, RuntimeBootstrap, RuntimeErrorSnapshot, RuntimeErrorType, RuntimeLogoutOptions, RuntimeMenuItem, RuntimePagePermissions, RuntimeRedirectLoginOptions, RuntimeRequestError, RuntimeRequestState, RuntimeResolveLoginOptions, SaveDataManagementConfigParams, SearchComponentName, SearchExpression, SearchFieldKey, SearchGroup, SearchLogic, SearchOperator, SearchRule, SearchSortItem, SearchSystemField, SendNotificationByTypeParams, SendNotificationResult, SsoLoginUrlInput, SsoLoginUrlResult, SubFormRule, SwitchAppRoleParams, SwitchPlatformRoleParams, TerminateProcessInstanceParams, TriggerCallbackTaskParams, UiPermissionListParams, UpdateApiPermissionParams, UpdateFormPermissionGroupDto, UpdateOrganizationAccountParams, UpdateOrganizationDepartmentParams, UpdatePagePermissionGroupDto, UpdateRoleParams, UpdateUiPermissionParams, UpdateUserParams, UseAuthOptions, UseCanAccessRouteInput, UseLoginMethodsState, UseProcessActionsOptions, UseProcessActionsReturn, UseProcessCapabilitiesOptions, UseProcessCapabilitiesReturn, UsePublicAccessOptions, UsePublicAccessState, UserListParams, UserMenuPermissionsResponse, ValidateUserParams, ViewFieldPermissionValue, ViewOperationPermission, ViewPermissionSummary, WorkCenterBoxType, WorkCenterGroupedStat, WorkCenterItem, WorkCenterListResult, WorkCenterStats, WorkCenterStatsParams, WorkflowApproveParams, WorkflowCapabilityActionKey, WorkflowDefinitionByFormParams, WorkflowInitiatorSelectCandidatesParams, WorkflowInitiatorSelectRequirementsParams, WorkflowPreviewParams, WorkflowResubmitInitiatorSelectRequirementsParams, WorkflowResubmitParams, WorkflowReturnParams, WorkflowSaveTaskParams, WorkflowStartFromExistingInstanceParams, WorkflowTaskParams, WorkflowTransferParams, WorkflowWithdrawParams, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, getAuthErrorExtra, getAuthErrorReason, isAuthChallengeRequired, isAuthClientError, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, useProcessActions, useProcessCapabilities, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap } from './react.js';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { b as FormSchema, a as FormRuntimeApi, c as FormRuntimeApiConfig } from '../ProcessPreview-BOCARAvP.js';
|
|
5
5
|
export { e as extractFieldsFromComponentsTree } from '../dataManagementApi-DhpRKmlp.js';
|
|
@@ -5555,14 +5555,14 @@ var useAuth = (options = {}) => {
|
|
|
5555
5555
|
() => createAuthClient({
|
|
5556
5556
|
appType: options.appType || runtime.appType,
|
|
5557
5557
|
servicePrefix: options.servicePrefix || runtime.servicePrefix,
|
|
5558
|
-
fetchImpl: options.fetchImpl || runtime.
|
|
5558
|
+
fetchImpl: options.fetchImpl || runtime.baseFetchImpl
|
|
5559
5559
|
}),
|
|
5560
5560
|
[
|
|
5561
5561
|
options.appType,
|
|
5562
5562
|
options.fetchImpl,
|
|
5563
5563
|
options.servicePrefix,
|
|
5564
5564
|
runtime.appType,
|
|
5565
|
-
runtime.
|
|
5565
|
+
runtime.baseFetchImpl,
|
|
5566
5566
|
runtime.servicePrefix
|
|
5567
5567
|
]
|
|
5568
5568
|
);
|
|
@@ -5841,7 +5841,19 @@ var LoginPage = ({
|
|
|
5841
5841
|
};
|
|
5842
5842
|
async function handleSuccess(data) {
|
|
5843
5843
|
await onSuccess?.(data);
|
|
5844
|
-
|
|
5844
|
+
const accessToken = data.accessToken || data.token;
|
|
5845
|
+
const accessTokenOptions = {
|
|
5846
|
+
expiresAt: data.accessTokenExpiresAt
|
|
5847
|
+
};
|
|
5848
|
+
if (accessToken) {
|
|
5849
|
+
runtime.setAccessToken(accessToken, accessTokenOptions);
|
|
5850
|
+
}
|
|
5851
|
+
await runtime.reload(
|
|
5852
|
+
accessToken ? {
|
|
5853
|
+
accessToken,
|
|
5854
|
+
accessTokenOptions
|
|
5855
|
+
} : void 0
|
|
5856
|
+
);
|
|
5845
5857
|
if (redirectOnSuccess && typeof window !== "undefined") {
|
|
5846
5858
|
window.location.replace(
|
|
5847
5859
|
redirectUrl || getCallbackUrl() || `/view/${auth.client.appType}`
|
|
@@ -6125,27 +6137,125 @@ var OpenXiangdaProvider = ({
|
|
|
6125
6137
|
() => appType || resolveAppTypeFromLocation(),
|
|
6126
6138
|
[appType]
|
|
6127
6139
|
);
|
|
6128
|
-
const [
|
|
6140
|
+
const [, setAccessTokenState] = useState9(null);
|
|
6141
|
+
const [authState, setAuthState] = useState9({
|
|
6142
|
+
status: "unknown",
|
|
6143
|
+
error: null
|
|
6144
|
+
});
|
|
6129
6145
|
const accessTokenRef = useRef5(null);
|
|
6130
|
-
const
|
|
6146
|
+
const refreshRequestRef = useRef5(null);
|
|
6147
|
+
const applyAccessToken = useCallback8(
|
|
6131
6148
|
(nextAccessToken, options = {}) => {
|
|
6132
6149
|
if (!nextAccessToken && options.clearIfToken && accessTokenRef.current?.token !== options.clearIfToken) {
|
|
6133
|
-
return;
|
|
6150
|
+
return accessTokenRef.current;
|
|
6134
6151
|
}
|
|
6135
6152
|
const normalizedAccessToken = nextAccessToken || null;
|
|
6136
6153
|
const nextState = normalizedAccessToken ? {
|
|
6137
6154
|
token: normalizedAccessToken,
|
|
6138
6155
|
scope: options.scope || "default",
|
|
6139
|
-
path: options.path || null
|
|
6156
|
+
path: options.path || null,
|
|
6157
|
+
expiresAt: options.expiresAt
|
|
6140
6158
|
} : null;
|
|
6141
6159
|
accessTokenRef.current = nextState;
|
|
6142
6160
|
setAccessTokenState(nextState);
|
|
6161
|
+
return nextState;
|
|
6143
6162
|
},
|
|
6144
6163
|
[]
|
|
6145
6164
|
);
|
|
6165
|
+
const setAccessToken = useCallback8(
|
|
6166
|
+
(nextAccessToken, options = {}) => {
|
|
6167
|
+
const previousState = accessTokenRef.current;
|
|
6168
|
+
const nextState = applyAccessToken(nextAccessToken, options);
|
|
6169
|
+
if (nextState) {
|
|
6170
|
+
if (nextState.scope === "public") return;
|
|
6171
|
+
setAuthState({
|
|
6172
|
+
status: "authenticated",
|
|
6173
|
+
error: null
|
|
6174
|
+
});
|
|
6175
|
+
} else if (previousState?.scope !== "public") {
|
|
6176
|
+
setAuthState({ status: "unauthenticated", error: null });
|
|
6177
|
+
}
|
|
6178
|
+
},
|
|
6179
|
+
[applyAccessToken]
|
|
6180
|
+
);
|
|
6181
|
+
const markUnauthenticated = useCallback8(
|
|
6182
|
+
(error) => {
|
|
6183
|
+
const runtimeError = normalizeRuntimeError(error);
|
|
6184
|
+
applyAccessToken(null);
|
|
6185
|
+
setAuthState({ status: "unauthenticated", error: runtimeError });
|
|
6186
|
+
},
|
|
6187
|
+
[applyAccessToken]
|
|
6188
|
+
);
|
|
6189
|
+
const refreshAccessToken = useCallback8(async () => {
|
|
6190
|
+
if (!resolvedAppType) return null;
|
|
6191
|
+
if (!refreshRequestRef.current) {
|
|
6192
|
+
setAuthState((prev) => ({ ...prev, status: "refreshing", error: null }));
|
|
6193
|
+
refreshRequestRef.current = (async () => {
|
|
6194
|
+
const response = await resolvedFetch(
|
|
6195
|
+
buildServiceUrl3(
|
|
6196
|
+
servicePrefix,
|
|
6197
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(
|
|
6198
|
+
resolvedAppType
|
|
6199
|
+
)}/auth/refresh`
|
|
6200
|
+
),
|
|
6201
|
+
{
|
|
6202
|
+
method: "POST",
|
|
6203
|
+
credentials: "include",
|
|
6204
|
+
headers: {
|
|
6205
|
+
accept: "application/json",
|
|
6206
|
+
"content-type": "application/json"
|
|
6207
|
+
},
|
|
6208
|
+
body: "{}"
|
|
6209
|
+
}
|
|
6210
|
+
);
|
|
6211
|
+
const payload = await readJsonPayload(response);
|
|
6212
|
+
if (isRuntimeEnvelopeFailure(response, payload)) {
|
|
6213
|
+
throw createRuntimeHttpError(
|
|
6214
|
+
response,
|
|
6215
|
+
payload,
|
|
6216
|
+
payload?.message || `Token refresh failed: ${response.status}`
|
|
6217
|
+
);
|
|
6218
|
+
}
|
|
6219
|
+
const data = unwrapRuntimePayload(payload);
|
|
6220
|
+
const nextAccessToken = getRecordString(data, "accessToken") || getRecordString(data, "token");
|
|
6221
|
+
if (!nextAccessToken) {
|
|
6222
|
+
throw createRuntimeError({
|
|
6223
|
+
type: "unauthenticated",
|
|
6224
|
+
status: response.status,
|
|
6225
|
+
code: getRecordValue3(payload, "code"),
|
|
6226
|
+
message: "Token refresh response missing accessToken",
|
|
6227
|
+
payload
|
|
6228
|
+
});
|
|
6229
|
+
}
|
|
6230
|
+
const nextState = applyAccessToken(nextAccessToken, {
|
|
6231
|
+
expiresAt: getRecordNumber(data, "accessTokenExpiresAt")
|
|
6232
|
+
});
|
|
6233
|
+
setAuthState({
|
|
6234
|
+
status: "authenticated",
|
|
6235
|
+
error: null,
|
|
6236
|
+
refreshedAt: Date.now()
|
|
6237
|
+
});
|
|
6238
|
+
return nextState;
|
|
6239
|
+
})().catch((error) => {
|
|
6240
|
+
const runtimeError = normalizeRuntimeError(error);
|
|
6241
|
+
applyAccessToken(null);
|
|
6242
|
+
setAuthState({ status: "unauthenticated", error: runtimeError });
|
|
6243
|
+
throw runtimeError;
|
|
6244
|
+
}).finally(() => {
|
|
6245
|
+
refreshRequestRef.current = null;
|
|
6246
|
+
});
|
|
6247
|
+
}
|
|
6248
|
+
return refreshRequestRef.current;
|
|
6249
|
+
}, [applyAccessToken, resolvedAppType, resolvedFetch, servicePrefix]);
|
|
6146
6250
|
const authorizedFetch = useMemo11(
|
|
6147
|
-
() => createAuthorizedFetch(
|
|
6148
|
-
|
|
6251
|
+
() => createAuthorizedFetch({
|
|
6252
|
+
appType: resolvedAppType,
|
|
6253
|
+
baseFetch: resolvedFetch,
|
|
6254
|
+
accessTokenRef,
|
|
6255
|
+
markUnauthenticated,
|
|
6256
|
+
refreshAccessToken
|
|
6257
|
+
}),
|
|
6258
|
+
[markUnauthenticated, refreshAccessToken, resolvedAppType, resolvedFetch]
|
|
6149
6259
|
);
|
|
6150
6260
|
const getAuthHeaders = useCallback8(() => {
|
|
6151
6261
|
const state2 = accessTokenRef.current;
|
|
@@ -6171,13 +6281,13 @@ var OpenXiangdaProvider = ({
|
|
|
6171
6281
|
return;
|
|
6172
6282
|
}
|
|
6173
6283
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
6174
|
-
const requestFetch = options.accessToken !== void 0 ?
|
|
6284
|
+
const requestFetch = options.accessToken !== void 0 ? createAccessTokenFetch(
|
|
6175
6285
|
resolvedFetch,
|
|
6176
6286
|
createAccessTokenState(
|
|
6177
6287
|
options.accessToken || null,
|
|
6178
6288
|
options.accessTokenOptions
|
|
6179
6289
|
)
|
|
6180
|
-
) :
|
|
6290
|
+
) : authorizedFetch;
|
|
6181
6291
|
try {
|
|
6182
6292
|
const response = await requestFetch(
|
|
6183
6293
|
buildServiceUrl3(
|
|
@@ -6199,19 +6309,29 @@ var OpenXiangdaProvider = ({
|
|
|
6199
6309
|
payload?.message || `Runtime bootstrap failed: ${response.status}`
|
|
6200
6310
|
);
|
|
6201
6311
|
}
|
|
6312
|
+
const nextData = payload?.data || null;
|
|
6202
6313
|
setState({
|
|
6203
|
-
data:
|
|
6314
|
+
data: nextData,
|
|
6204
6315
|
loading: false,
|
|
6205
6316
|
error: null
|
|
6206
6317
|
});
|
|
6318
|
+
if (isAuthenticatedBootstrap(nextData)) {
|
|
6319
|
+
setAuthState(
|
|
6320
|
+
(prev) => prev.status === "authenticated" ? prev : { status: "authenticated", error: null }
|
|
6321
|
+
);
|
|
6322
|
+
}
|
|
6207
6323
|
} catch (error) {
|
|
6324
|
+
const runtimeError = normalizeRuntimeError(error);
|
|
6208
6325
|
setState({
|
|
6209
6326
|
data: null,
|
|
6210
6327
|
loading: false,
|
|
6211
|
-
error:
|
|
6328
|
+
error: runtimeError
|
|
6212
6329
|
});
|
|
6330
|
+
if (runtimeError.type === "unauthenticated") {
|
|
6331
|
+
setAuthState({ status: "unauthenticated", error: runtimeError });
|
|
6332
|
+
}
|
|
6213
6333
|
}
|
|
6214
|
-
}, [resolvedAppType, resolvedFetch, servicePrefix]);
|
|
6334
|
+
}, [authorizedFetch, resolvedAppType, resolvedFetch, servicePrefix]);
|
|
6215
6335
|
useEffect9(() => {
|
|
6216
6336
|
void reload();
|
|
6217
6337
|
}, [reload]);
|
|
@@ -6222,6 +6342,7 @@ var OpenXiangdaProvider = ({
|
|
|
6222
6342
|
servicePrefix,
|
|
6223
6343
|
fetchImpl: authorizedFetch,
|
|
6224
6344
|
baseFetchImpl: resolvedFetch,
|
|
6345
|
+
authState,
|
|
6225
6346
|
getAuthHeaders,
|
|
6226
6347
|
reload,
|
|
6227
6348
|
setAccessToken
|
|
@@ -6233,7 +6354,8 @@ var OpenXiangdaProvider = ({
|
|
|
6233
6354
|
resolvedAppType,
|
|
6234
6355
|
resolvedFetch,
|
|
6235
6356
|
servicePrefix,
|
|
6236
|
-
state
|
|
6357
|
+
state,
|
|
6358
|
+
authState
|
|
6237
6359
|
]
|
|
6238
6360
|
);
|
|
6239
6361
|
return /* @__PURE__ */ jsx10(OpenXiangdaRuntimeContext.Provider, { value, children });
|
|
@@ -6500,7 +6622,7 @@ var useRuntimeAuth = () => {
|
|
|
6500
6622
|
buildServiceUrl3(runtime.servicePrefix, "/api/sso/status"),
|
|
6501
6623
|
{ domain }
|
|
6502
6624
|
);
|
|
6503
|
-
const statusResponse = await runtime.
|
|
6625
|
+
const statusResponse = await runtime.baseFetchImpl(statusUrl, {
|
|
6504
6626
|
credentials: "include",
|
|
6505
6627
|
headers: { accept: "application/json" }
|
|
6506
6628
|
});
|
|
@@ -6511,7 +6633,7 @@ var useRuntimeAuth = () => {
|
|
|
6511
6633
|
enabled && (sso.forceLogin ?? sso.autoRedirect ?? true)
|
|
6512
6634
|
);
|
|
6513
6635
|
if (shouldUseSso) {
|
|
6514
|
-
const loginUrlResponse = await runtime.
|
|
6636
|
+
const loginUrlResponse = await runtime.baseFetchImpl(
|
|
6515
6637
|
withQuery(buildServiceUrl3(runtime.servicePrefix, "/api/sso/login-url"), {
|
|
6516
6638
|
domain,
|
|
6517
6639
|
redirectUri,
|
|
@@ -6535,7 +6657,7 @@ var useRuntimeAuth = () => {
|
|
|
6535
6657
|
}
|
|
6536
6658
|
return attachCallback("/platform/login", redirectUri);
|
|
6537
6659
|
},
|
|
6538
|
-
[runtime.
|
|
6660
|
+
[runtime.baseFetchImpl, runtime.data?.app, runtime.servicePrefix]
|
|
6539
6661
|
);
|
|
6540
6662
|
const redirectToLogin = useCallback8(
|
|
6541
6663
|
async (options = {}) => {
|
|
@@ -6552,7 +6674,7 @@ var useRuntimeAuth = () => {
|
|
|
6552
6674
|
[resolveLoginUrl2]
|
|
6553
6675
|
);
|
|
6554
6676
|
const logout = useCallback8(async () => {
|
|
6555
|
-
const response = await runtime.
|
|
6677
|
+
const response = await runtime.baseFetchImpl(
|
|
6556
6678
|
buildServiceUrl3(runtime.servicePrefix, "/api/auth/logout"),
|
|
6557
6679
|
{
|
|
6558
6680
|
method: "POST",
|
|
@@ -6568,8 +6690,9 @@ var useRuntimeAuth = () => {
|
|
|
6568
6690
|
payload?.message || `Logout failed: ${response.status}`
|
|
6569
6691
|
);
|
|
6570
6692
|
}
|
|
6693
|
+
runtime.setAccessToken(null);
|
|
6571
6694
|
return payload;
|
|
6572
|
-
}, [runtime.
|
|
6695
|
+
}, [runtime.baseFetchImpl, runtime.servicePrefix, runtime.setAccessToken]);
|
|
6573
6696
|
const logoutAndRedirect = useCallback8(
|
|
6574
6697
|
async (options = {}) => {
|
|
6575
6698
|
try {
|
|
@@ -6588,12 +6711,83 @@ var useRuntimeAuth = () => {
|
|
|
6588
6711
|
resolveLoginUrl: resolveLoginUrl2
|
|
6589
6712
|
};
|
|
6590
6713
|
};
|
|
6714
|
+
var RuntimeAuthGuard = ({
|
|
6715
|
+
children,
|
|
6716
|
+
fallback = null,
|
|
6717
|
+
disabled = false,
|
|
6718
|
+
excludedPaths = [],
|
|
6719
|
+
...redirectOptions
|
|
6720
|
+
}) => {
|
|
6721
|
+
const runtime = useOpenXiangda();
|
|
6722
|
+
const auth = useRuntimeAuth();
|
|
6723
|
+
const redirectedRef = useRef5(false);
|
|
6724
|
+
const currentPath = getCurrentPathname2();
|
|
6725
|
+
const excluded = isRuntimeAuthGuardExcluded(
|
|
6726
|
+
currentPath,
|
|
6727
|
+
runtime.appType,
|
|
6728
|
+
excludedPaths
|
|
6729
|
+
);
|
|
6730
|
+
const shouldRedirect = !disabled && !excluded && !runtime.loading && (runtime.authState.status === "unauthenticated" || runtime.error?.type === "unauthenticated");
|
|
6731
|
+
useEffect9(() => {
|
|
6732
|
+
if (!shouldRedirect || redirectedRef.current) return;
|
|
6733
|
+
redirectedRef.current = true;
|
|
6734
|
+
void auth.redirectToLogin({
|
|
6735
|
+
...redirectOptions,
|
|
6736
|
+
redirectUri: redirectOptions.redirectUri || getCurrentHref4()
|
|
6737
|
+
}).catch(() => {
|
|
6738
|
+
redirectedRef.current = false;
|
|
6739
|
+
});
|
|
6740
|
+
}, [
|
|
6741
|
+
auth,
|
|
6742
|
+
redirectOptions.domain,
|
|
6743
|
+
redirectOptions.loginUrl,
|
|
6744
|
+
redirectOptions.redirectUri,
|
|
6745
|
+
redirectOptions.replace,
|
|
6746
|
+
shouldRedirect
|
|
6747
|
+
]);
|
|
6748
|
+
if (excluded) return /* @__PURE__ */ jsx10(Fragment5, { children });
|
|
6749
|
+
if (shouldRedirect) return /* @__PURE__ */ jsx10(Fragment5, { children: fallback });
|
|
6750
|
+
return /* @__PURE__ */ jsx10(Fragment5, { children });
|
|
6751
|
+
};
|
|
6591
6752
|
var buildServiceUrl3 = (servicePrefix, path) => {
|
|
6592
6753
|
const prefix = servicePrefix.endsWith("/") ? servicePrefix.slice(0, -1) : servicePrefix;
|
|
6593
6754
|
const suffix = path.startsWith("/") ? path : `/${path}`;
|
|
6594
6755
|
return `${prefix}${suffix}`;
|
|
6595
6756
|
};
|
|
6596
|
-
var createAuthorizedFetch = (
|
|
6757
|
+
var createAuthorizedFetch = ({
|
|
6758
|
+
appType,
|
|
6759
|
+
baseFetch,
|
|
6760
|
+
accessTokenRef,
|
|
6761
|
+
refreshAccessToken,
|
|
6762
|
+
markUnauthenticated
|
|
6763
|
+
}) => (async (input, init = {}) => {
|
|
6764
|
+
const currentTokenState = accessTokenRef.current;
|
|
6765
|
+
const response = await createAccessTokenFetch(
|
|
6766
|
+
baseFetch,
|
|
6767
|
+
currentTokenState
|
|
6768
|
+
)(input, init);
|
|
6769
|
+
if (!shouldAttemptAuthRefresh({
|
|
6770
|
+
appType,
|
|
6771
|
+
input,
|
|
6772
|
+
init,
|
|
6773
|
+
tokenState: currentTokenState
|
|
6774
|
+
})) {
|
|
6775
|
+
return response;
|
|
6776
|
+
}
|
|
6777
|
+
if (!await isUnauthenticatedResponse(response)) return response;
|
|
6778
|
+
try {
|
|
6779
|
+
const refreshedTokenState = await refreshAccessToken();
|
|
6780
|
+
if (!refreshedTokenState) return response;
|
|
6781
|
+
return await createAccessTokenFetch(
|
|
6782
|
+
baseFetch,
|
|
6783
|
+
refreshedTokenState
|
|
6784
|
+
)(input, init);
|
|
6785
|
+
} catch (error) {
|
|
6786
|
+
markUnauthenticated(error);
|
|
6787
|
+
return response;
|
|
6788
|
+
}
|
|
6789
|
+
});
|
|
6790
|
+
var createAccessTokenFetch = (baseFetch, accessToken) => {
|
|
6597
6791
|
if (!accessToken) return baseFetch;
|
|
6598
6792
|
return ((input, init = {}) => {
|
|
6599
6793
|
const token = resolveAccessTokenForCurrentRoute(accessToken);
|
|
@@ -6611,8 +6805,53 @@ var createAuthorizedFetch = (baseFetch, accessToken) => {
|
|
|
6611
6805
|
var createAccessTokenState = (accessToken, options = {}) => accessToken ? {
|
|
6612
6806
|
token: accessToken,
|
|
6613
6807
|
scope: options.scope || "default",
|
|
6614
|
-
path: options.path || null
|
|
6808
|
+
path: options.path || null,
|
|
6809
|
+
expiresAt: options.expiresAt
|
|
6615
6810
|
} : null;
|
|
6811
|
+
var shouldAttemptAuthRefresh = ({
|
|
6812
|
+
appType,
|
|
6813
|
+
input,
|
|
6814
|
+
init,
|
|
6815
|
+
tokenState
|
|
6816
|
+
}) => {
|
|
6817
|
+
if (!appType) return false;
|
|
6818
|
+
if (tokenState?.scope === "public") return false;
|
|
6819
|
+
if (isPublicRoutePath(normalizeRoutePath(getCurrentPathname2()))) return false;
|
|
6820
|
+
if (hasAuthorizationHeader(init?.headers)) return false;
|
|
6821
|
+
const pathname = getFetchInputPathname(input);
|
|
6822
|
+
if (!pathname) return false;
|
|
6823
|
+
if (/\/openxiangda-api\/v1\/apps\/[^/]+\/auth(?:\/|$)/.test(pathname)) {
|
|
6824
|
+
return false;
|
|
6825
|
+
}
|
|
6826
|
+
if (/\/openxiangda-api\/v1\/apps\/[^/]+\/public\/session(?:\/|$)/.test(pathname)) {
|
|
6827
|
+
return false;
|
|
6828
|
+
}
|
|
6829
|
+
if (/\/openxiangda-api\/v1\/auth(?:\/|$)/.test(pathname)) return false;
|
|
6830
|
+
if (/\/api\/auth\/logout(?:\/|$)/.test(pathname)) return false;
|
|
6831
|
+
if (/\/api\/sso(?:\/|$)/.test(pathname)) return false;
|
|
6832
|
+
return true;
|
|
6833
|
+
};
|
|
6834
|
+
var isUnauthenticatedResponse = async (response) => {
|
|
6835
|
+
if (response.status === 401) return true;
|
|
6836
|
+
const payload = await readJsonPayload(response.clone());
|
|
6837
|
+
const code = getRecordValue3(payload, "code");
|
|
6838
|
+
return classifyRuntimeError(response.status, code) === "unauthenticated";
|
|
6839
|
+
};
|
|
6840
|
+
var hasAuthorizationHeader = (headers) => {
|
|
6841
|
+
if (!headers) return false;
|
|
6842
|
+
const normalized = new Headers(headers);
|
|
6843
|
+
return normalized.has("authorization");
|
|
6844
|
+
};
|
|
6845
|
+
var getFetchInputPathname = (input) => {
|
|
6846
|
+
const text = typeof input === "string" ? input : input instanceof URL ? input.toString() : typeof Request !== "undefined" && input instanceof Request ? input.url : String(input || "");
|
|
6847
|
+
if (!text) return "";
|
|
6848
|
+
try {
|
|
6849
|
+
const base = typeof window !== "undefined" ? window.location.origin : "http://localhost";
|
|
6850
|
+
return new URL(text, base).pathname;
|
|
6851
|
+
} catch {
|
|
6852
|
+
return text.split(/[?#]/, 1)[0] || "";
|
|
6853
|
+
}
|
|
6854
|
+
};
|
|
6616
6855
|
var resolveAccessTokenForCurrentRoute = (accessToken) => {
|
|
6617
6856
|
if (accessToken.scope !== "public") return accessToken.token;
|
|
6618
6857
|
const scopedPath = normalizeRoutePath(accessToken.path);
|
|
@@ -6797,6 +7036,31 @@ var getRecordString = (value, key) => {
|
|
|
6797
7036
|
const result = getRecordValue3(value, key);
|
|
6798
7037
|
return typeof result === "string" ? result : void 0;
|
|
6799
7038
|
};
|
|
7039
|
+
var getRecordNumber = (value, key) => {
|
|
7040
|
+
const result = getRecordValue3(value, key);
|
|
7041
|
+
const numberValue = Number(result);
|
|
7042
|
+
return Number.isFinite(numberValue) ? numberValue : void 0;
|
|
7043
|
+
};
|
|
7044
|
+
var unwrapRuntimePayload = (payload) => {
|
|
7045
|
+
if (!payload || typeof payload !== "object") return payload;
|
|
7046
|
+
const record = payload;
|
|
7047
|
+
return "data" in record ? record.data : payload;
|
|
7048
|
+
};
|
|
7049
|
+
var isAuthenticatedBootstrap = (value) => {
|
|
7050
|
+
if (!value || typeof value !== "object") return false;
|
|
7051
|
+
const user = toRuntimeRecord(getRecordValue3(value, "user"));
|
|
7052
|
+
if (!getRecordValue3(user, "id") && !getRecordValue3(user, "username")) {
|
|
7053
|
+
return false;
|
|
7054
|
+
}
|
|
7055
|
+
return !getRecordValue3(user, "publicAccess");
|
|
7056
|
+
};
|
|
7057
|
+
var isRuntimeAuthGuardExcluded = (path, appType, excludedPaths) => {
|
|
7058
|
+
const normalizedPath = normalizeRoutePath(path);
|
|
7059
|
+
if (isPublicRoutePath(normalizedPath)) return true;
|
|
7060
|
+
const loginPath = normalizeRoutePath(`/view/${encodeURIComponent(appType)}/login`);
|
|
7061
|
+
if (appType && normalizedPath === loginPath) return true;
|
|
7062
|
+
return excludedPaths.map((item) => normalizeRoutePath(item)).some((item) => item && normalizedPath === item);
|
|
7063
|
+
};
|
|
6800
7064
|
var resolveAppTypeFromLocation = () => {
|
|
6801
7065
|
if (typeof window === "undefined") return "";
|
|
6802
7066
|
const segments = window.location.pathname.split("/").filter(Boolean);
|
|
@@ -17230,7 +17494,7 @@ async function fetchRuntimeFormData(api, appType, params) {
|
|
|
17230
17494
|
order: order ? JSON.stringify(order) : void 0
|
|
17231
17495
|
}
|
|
17232
17496
|
});
|
|
17233
|
-
const payload =
|
|
17497
|
+
const payload = unwrapRuntimePayload2(response);
|
|
17234
17498
|
const data = Array.isArray(payload?.data) ? payload.data : Array.isArray(payload) ? payload : [];
|
|
17235
17499
|
return {
|
|
17236
17500
|
data,
|
|
@@ -17287,7 +17551,7 @@ function FormProvider({
|
|
|
17287
17551
|
let cancelled = false;
|
|
17288
17552
|
api.getUserById("current").then((payload) => {
|
|
17289
17553
|
if (cancelled || !payload) return;
|
|
17290
|
-
const currentUser = normalizeUser(
|
|
17554
|
+
const currentUser = normalizeUser(unwrapRuntimePayload2(payload));
|
|
17291
17555
|
const departments = normalizeDepartmentArray(currentUser.departments);
|
|
17292
17556
|
const currentDepartment = departments[0];
|
|
17293
17557
|
const currentUserManagers = normalizeUserArray(
|
|
@@ -17684,7 +17948,7 @@ function needsCurrentUserRuntime(shortcutType) {
|
|
|
17684
17948
|
].includes(shortcutType)
|
|
17685
17949
|
);
|
|
17686
17950
|
}
|
|
17687
|
-
function
|
|
17951
|
+
function unwrapRuntimePayload2(payload) {
|
|
17688
17952
|
return payload?.data || payload?.result || payload?.user || payload;
|
|
17689
17953
|
}
|
|
17690
17954
|
function isBlankFormValue(value) {
|
|
@@ -19639,7 +19903,7 @@ var DraftManager = ({
|
|
|
19639
19903
|
// packages/sdk/src/components/templates/FormSubmitTemplate.tsx
|
|
19640
19904
|
import { Fragment as Fragment14, jsx as jsx96, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
19641
19905
|
var SUPERVISOR_APPROVER_TYPE = "ext_target_approval_department_supervisor";
|
|
19642
|
-
var
|
|
19906
|
+
var unwrapRuntimePayload3 = (value) => value?.data ?? value?.result ?? value;
|
|
19643
19907
|
var normalizeSubmitFormType = (value) => {
|
|
19644
19908
|
const raw = String(value || "").toLowerCase();
|
|
19645
19909
|
return raw === "process" || raw === "flow" ? "process" : "form";
|
|
@@ -19836,7 +20100,7 @@ var InnerFormContent = ({
|
|
|
19836
20100
|
return departmentId;
|
|
19837
20101
|
}
|
|
19838
20102
|
const runtimeUser = schema.runtime?.currentUser;
|
|
19839
|
-
const loadedUser = runtimeUser ||
|
|
20103
|
+
const loadedUser = runtimeUser || unwrapRuntimePayload3(await api.getUserById("current"));
|
|
19840
20104
|
const departments = normalizeDepartmentOptions(loadedUser?.departments);
|
|
19841
20105
|
if (departments.length === 0) {
|
|
19842
20106
|
message4.error("\u5F53\u524D\u8D26\u53F7\u672A\u5206\u914D\u90E8\u95E8\uFF0C\u65E0\u6CD5\u53D1\u8D77\u4E3B\u7BA1\u5BA1\u6279\u6D41\u7A0B");
|
|
@@ -22815,7 +23079,7 @@ var downloadBlobResponse = async (response, fallbackName) => {
|
|
|
22815
23079
|
anchor.remove();
|
|
22816
23080
|
window.URL.revokeObjectURL(url);
|
|
22817
23081
|
};
|
|
22818
|
-
var
|
|
23082
|
+
var unwrapRuntimePayload4 = (payload) => {
|
|
22819
23083
|
const data = payload?.data?.result ?? payload?.result ?? payload?.data ?? payload;
|
|
22820
23084
|
return data?.items || data?.list || data?.data || data?.records || data || [];
|
|
22821
23085
|
};
|
|
@@ -22914,14 +23178,14 @@ function AsyncEntityFilterSelect({
|
|
|
22914
23178
|
method: "get",
|
|
22915
23179
|
params: keyword ? { keyword, pageSize: 20 } : { pageSize: 20 }
|
|
22916
23180
|
});
|
|
22917
|
-
rows =
|
|
23181
|
+
rows = unwrapRuntimePayload4(response);
|
|
22918
23182
|
}
|
|
22919
23183
|
} else {
|
|
22920
23184
|
const response = await api.request({
|
|
22921
23185
|
url: keyword ? "/department/list" : "/department/root",
|
|
22922
23186
|
method: "get"
|
|
22923
23187
|
});
|
|
22924
|
-
rows =
|
|
23188
|
+
rows = unwrapRuntimePayload4(response);
|
|
22925
23189
|
if (keyword) {
|
|
22926
23190
|
const normalizedKeyword = keyword.toLowerCase();
|
|
22927
23191
|
rows = rows.filter(
|
|
@@ -24707,7 +24971,7 @@ var getDetailBasePath = (appType, formUuid, formType) => {
|
|
|
24707
24971
|
const detailType = isProcessKind("data-manage-list", formType) ? "processDetail" : "formDetail";
|
|
24708
24972
|
return `/view/${appType}/${detailType}/${formUuid}`;
|
|
24709
24973
|
};
|
|
24710
|
-
var
|
|
24974
|
+
var unwrapRuntimePayload5 = (payload) => payload?.data ?? payload?.result ?? payload;
|
|
24711
24975
|
var formatFileSize2 = (size) => {
|
|
24712
24976
|
const value = Number(size || 0);
|
|
24713
24977
|
if (!value) return "0 B";
|
|
@@ -24788,7 +25052,7 @@ var OnlyOfficePreview = ({
|
|
|
24788
25052
|
url: configUrl || `/file/onlyoffice/config/${encodeURIComponent(ticket)}`,
|
|
24789
25053
|
method: "get"
|
|
24790
25054
|
});
|
|
24791
|
-
const payload =
|
|
25055
|
+
const payload = unwrapRuntimePayload5(response);
|
|
24792
25056
|
const scriptUrl = `${String(payload.documentServerUrl || "").replace(
|
|
24793
25057
|
/\/+$/,
|
|
24794
25058
|
""
|
|
@@ -24846,7 +25110,7 @@ var BuiltinFilePreview = ({
|
|
|
24846
25110
|
method: "get"
|
|
24847
25111
|
});
|
|
24848
25112
|
if (!disposed) {
|
|
24849
|
-
setMetadata(
|
|
25113
|
+
setMetadata(unwrapRuntimePayload5(response));
|
|
24850
25114
|
}
|
|
24851
25115
|
} catch (currentError) {
|
|
24852
25116
|
if (!disposed) {
|
|
@@ -24886,7 +25150,7 @@ var BuiltinFilePreview = ({
|
|
|
24886
25150
|
try {
|
|
24887
25151
|
const response = await request({ url, method: "get" });
|
|
24888
25152
|
if (!disposed) {
|
|
24889
|
-
setPayload(
|
|
25153
|
+
setPayload(unwrapRuntimePayload5(response));
|
|
24890
25154
|
}
|
|
24891
25155
|
} catch (currentError) {
|
|
24892
25156
|
if (!disposed) {
|
|
@@ -25264,6 +25528,7 @@ export {
|
|
|
25264
25528
|
ProcessTimeline,
|
|
25265
25529
|
PublicAccessClientError,
|
|
25266
25530
|
PublicAccessGate,
|
|
25531
|
+
RuntimeAuthGuard,
|
|
25267
25532
|
createAuthClient,
|
|
25268
25533
|
createBrowserPageBridge,
|
|
25269
25534
|
createBrowserPageContext,
|