openxiangda 1.0.134 → 1.0.136
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 +6 -0
- package/lib/cli.js +947 -16
- package/lib/design-gates.js +40 -10
- package/lib/sdd.js +777 -0
- package/lib/workspace-init.js +3 -0
- package/openxiangda-skills/SKILL.md +11 -1
- package/openxiangda-skills/references/best-practices.md +32 -5
- package/openxiangda-skills/references/openxiangda-api.md +32 -6
- package/openxiangda-skills/references/pages/page-sdk.md +3 -0
- package/openxiangda-skills/references/pages/publish-flow.md +16 -0
- package/openxiangda-skills/references/permission-design-patterns.md +216 -0
- package/openxiangda-skills/references/permissions-settings.md +58 -0
- package/openxiangda-skills/references/platform-data-model.md +19 -4
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +32 -1
- package/openxiangda-skills/skills/openxiangda-architecture-design/SKILL.md +8 -0
- package/openxiangda-skills/skills/openxiangda-core/SKILL.md +2 -0
- package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +38 -1
- package/package.json +2 -1
- package/packages/sdk/dist/{ProcessPreview-Dfc4-wIq.d.mts → ProcessPreview-Ci8_UsbN.d.mts} +4 -0
- package/packages/sdk/dist/{ProcessPreview-Dfc4-wIq.d.ts → ProcessPreview-Ci8_UsbN.d.ts} +4 -0
- package/packages/sdk/dist/build/index.cjs.map +1 -1
- package/packages/sdk/dist/build/index.d.mts +7 -0
- package/packages/sdk/dist/build/index.d.ts +7 -0
- package/packages/sdk/dist/build/index.mjs.map +1 -1
- package/packages/sdk/dist/components/index.cjs +32 -4
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.d.mts +8 -2
- package/packages/sdk/dist/components/index.d.ts +8 -2
- package/packages/sdk/dist/components/index.mjs +32 -4
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +181 -28
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +2 -2
- package/packages/sdk/dist/runtime/index.d.ts +2 -2
- package/packages/sdk/dist/runtime/index.mjs +181 -28
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +152 -25
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +57 -4
- package/packages/sdk/dist/runtime/react.d.ts +57 -4
- package/packages/sdk/dist/runtime/react.mjs +152 -25
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +8 -1
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +8 -1
- package/templates/openxiangda-react-spa/AGENTS.md +9 -1
- package/templates/openxiangda-react-spa/app-workspace.config.ts +14 -0
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +5 -1
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +7 -1
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +6 -0
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +7 -1
- package/templates/sy-lowcode-app-workspace/AGENTS.md +10 -1
- package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +14 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +3 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/access-governance.md +239 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +6 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +25 -1
- package/templates/sy-lowcode-app-workspace/src/types/app-workspace.types.ts +12 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { Dispatch, SetStateAction, CSSProperties } from 'react';
|
|
2
|
-
import { a as FormRuntimeApi, o as InitiatorSelectRequirement, I as InitiatorSelectCandidate, b0 as ProcessPreviewProps, ai as ApprovalTimelineProps } from '../ProcessPreview-
|
|
2
|
+
import { a as FormRuntimeApi, o as InitiatorSelectRequirement, I as InitiatorSelectCandidate, b0 as ProcessPreviewProps, ai as ApprovalTimelineProps } from '../ProcessPreview-Ci8_UsbN.mjs';
|
|
3
3
|
|
|
4
4
|
type PageQueryValue = string | string[];
|
|
5
5
|
type PageHttpMethod = "get" | "post" | "put" | "delete" | "patch";
|
|
@@ -409,10 +409,56 @@ interface PageApiResponse<TResult = unknown, TRaw = TResult> {
|
|
|
409
409
|
message?: string;
|
|
410
410
|
formInstId?: string;
|
|
411
411
|
formInstanceId?: string;
|
|
412
|
+
processInstanceId?: string;
|
|
413
|
+
serialNumber?: string;
|
|
414
|
+
serialNumbers?: Record<string, string>;
|
|
412
415
|
result: TResult | null;
|
|
413
416
|
data?: TRaw;
|
|
414
417
|
raw?: unknown;
|
|
415
418
|
}
|
|
419
|
+
interface ApiEnvelope<T = unknown> {
|
|
420
|
+
code: number | string;
|
|
421
|
+
success?: boolean;
|
|
422
|
+
message?: string;
|
|
423
|
+
data?: T;
|
|
424
|
+
result?: T;
|
|
425
|
+
error?: string;
|
|
426
|
+
errorMessage?: string;
|
|
427
|
+
}
|
|
428
|
+
interface FormInstanceIdentifierResult {
|
|
429
|
+
formInstId: string;
|
|
430
|
+
formInstanceId: string;
|
|
431
|
+
processInstanceId?: string;
|
|
432
|
+
serialNumber?: string;
|
|
433
|
+
serialNumbers?: Record<string, string>;
|
|
434
|
+
instanceId?: string;
|
|
435
|
+
result?: string;
|
|
436
|
+
success?: boolean;
|
|
437
|
+
code?: number | string;
|
|
438
|
+
[key: string]: unknown;
|
|
439
|
+
}
|
|
440
|
+
interface FormCreateResult extends FormInstanceIdentifierResult {
|
|
441
|
+
}
|
|
442
|
+
interface FormUpdateResult {
|
|
443
|
+
formInstId: string;
|
|
444
|
+
formInstanceId: string;
|
|
445
|
+
result?: string;
|
|
446
|
+
success?: boolean;
|
|
447
|
+
code?: number | string;
|
|
448
|
+
[key: string]: unknown;
|
|
449
|
+
}
|
|
450
|
+
interface FormDetailResult<TData = Record<string, unknown>> {
|
|
451
|
+
formInstId?: string;
|
|
452
|
+
formInstanceId?: string;
|
|
453
|
+
data: TData;
|
|
454
|
+
[key: string]: unknown;
|
|
455
|
+
}
|
|
456
|
+
interface FieldOptionValue {
|
|
457
|
+
label: string;
|
|
458
|
+
value: string;
|
|
459
|
+
[key: string]: unknown;
|
|
460
|
+
}
|
|
461
|
+
type FormFieldValue = string | number | boolean | null | FieldOptionValue | FieldOptionValue[] | Record<string, unknown> | Array<Record<string, unknown>>;
|
|
416
462
|
interface PageBinaryResponse {
|
|
417
463
|
blob: Blob;
|
|
418
464
|
fileName?: string;
|
|
@@ -454,6 +500,9 @@ interface PageRequestOptions<TQuery = Record<string, unknown>, TBody = unknown>
|
|
|
454
500
|
query?: TQuery;
|
|
455
501
|
body?: TBody;
|
|
456
502
|
headers?: Record<string, string>;
|
|
503
|
+
dedupe?: boolean;
|
|
504
|
+
trace?: boolean;
|
|
505
|
+
traceLabel?: string;
|
|
457
506
|
}
|
|
458
507
|
interface PageTransportRequestPayload<TBody = unknown> {
|
|
459
508
|
path: string;
|
|
@@ -490,7 +539,11 @@ interface FormCreateParams {
|
|
|
490
539
|
startProcess?: boolean;
|
|
491
540
|
autoStartProcess?: boolean;
|
|
492
541
|
processStartMode?: 'auto' | 'manual' | 'draft' | 'delayed' | 'none' | string;
|
|
493
|
-
|
|
542
|
+
/**
|
|
543
|
+
* Legacy compatibility only. New code should not infer a created row by
|
|
544
|
+
* submitted field values; the save API returns identifiers, not full row data.
|
|
545
|
+
*/
|
|
546
|
+
lookupAfterCreate?: boolean | 'legacy';
|
|
494
547
|
lookupFields?: string[];
|
|
495
548
|
}
|
|
496
549
|
interface FormUpdateParams {
|
|
@@ -1408,7 +1461,7 @@ interface PageSdk {
|
|
|
1408
1461
|
};
|
|
1409
1462
|
form: {
|
|
1410
1463
|
getDetail<T = unknown>(params: FormGetDetailParams): Promise<PageApiResponse<T>>;
|
|
1411
|
-
create<T =
|
|
1464
|
+
create<T = FormCreateResult, TRaw = unknown>(params: FormCreateParams): Promise<PageApiResponse<T, TRaw>>;
|
|
1412
1465
|
update<T = unknown, TRaw = unknown>(params: FormUpdateParams): Promise<PageApiResponse<T, TRaw>>;
|
|
1413
1466
|
remove<T = unknown, TRaw = unknown>(params: FormRemoveParams): Promise<PageApiResponse<T, TRaw>>;
|
|
1414
1467
|
getChangeRecords<T = unknown>(params: FormChangeRecordParams): Promise<PageApiResponse<T>>;
|
|
@@ -2197,4 +2250,4 @@ interface PublicAccessGateProps extends UsePublicAccessOptions {
|
|
|
2197
2250
|
}
|
|
2198
2251
|
declare const PublicAccessGate: React__default.FC<PublicAccessGateProps>;
|
|
2199
2252
|
|
|
2200
|
-
export { type ApiPermissionListParams, type AppAuthClient, type AppFunctionConnectorApi, type AppFunctionContext, type AppFunctionDataViewApi, type AppFunctionFormApi, type AppFunctionFormGetByIdParams, type AppFunctionFormQueryParams, type AppFunctionFormWriteParams, type AppFunctionNotificationApi, type AppFunctionOperatorInfo, type AppFunctionOrganizationApi, type AppFunctionPermissionContext, type AppFunctionRuntimeContext, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type AuthChallengePayload, AuthClientError, type AuthClientErrorOptions, type AuthClientOptions, type AuthErrorExtra, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeOrganizationAccountPasswordParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreateOrganizationAccountParams, type CreateOrganizationDepartmentParams, 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 DingTalkNotificationCapabilities, type DingTalkNotificationCardConfig, type DingTalkNotificationCardField, type DingTalkNotificationCardMode, type DingTalkNotificationCardPreview, type DingTalkNotificationChannelConfig, type DingTalkNotificationDeliveryMode, type DingTalkNotificationPreviewResult, type ExecuteProcessOperationInput, 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, InitiatorApproverSelector, type InstanceStatus, type ListNotificationInboxParams, type ListWorkCenterItemsParams, type LoginLogGetParams, type LoginLogListParams, type LoginLogRecord, type LoginLogStats, type LoginLogStatsParams, type LoginLogStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type MarkAllNotificationReadResult, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationInboxListResult, type NotificationInboxMessage, type NotificationInboxReadStatus, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type NotificationUnreadCountResult, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type OrganizationAccountListParams, type OrganizationCapabilities, type OrganizationListResult, 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 PreviewDingTalkNotificationParams, type PreviewNotificationTemplateParams, ProcessActionBar, type ProcessActionBarProps, type ProcessApproveAction, type ProcessCapabilities, type ProcessCapabilityOperation, type ProcessInstanceLookupParams, ProcessPreviewPanel, type ProcessPreviewPanelProps, ProcessTimeline, type ProcessTimelineProps, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResetOrganizationAccountPasswordParams, type ResolveLoginUrlInput, type ResolveProcessCapabilitiesParams, 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 UpdateOrganizationAccountParams, type UpdateOrganizationDepartmentParams, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UseProcessActionsOptions, type UseProcessActionsReturn, type UseProcessCapabilitiesOptions, type UseProcessCapabilitiesReturn, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, type WorkCenterBoxType, type WorkCenterGroupedStat, type WorkCenterItem, type WorkCenterListResult, type WorkCenterStats, type WorkCenterStatsParams, type WorkflowApproveParams, type WorkflowCapabilityActionKey, type WorkflowDefinitionByFormParams, type WorkflowInitiatorSelectCandidatesParams, type WorkflowInitiatorSelectRequirementsParams, type WorkflowPreviewParams, type WorkflowResubmitInitiatorSelectRequirementsParams, type WorkflowResubmitParams, type WorkflowReturnParams, type WorkflowSaveTaskParams, type WorkflowStartFromExistingInstanceParams, type WorkflowTaskParams, type WorkflowTransferParams, type 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 };
|
|
2253
|
+
export { type ApiEnvelope, type ApiPermissionListParams, type AppAuthClient, type AppFunctionConnectorApi, type AppFunctionContext, type AppFunctionDataViewApi, type AppFunctionFormApi, type AppFunctionFormGetByIdParams, type AppFunctionFormQueryParams, type AppFunctionFormWriteParams, type AppFunctionNotificationApi, type AppFunctionOperatorInfo, type AppFunctionOrganizationApi, type AppFunctionPermissionContext, type AppFunctionRuntimeContext, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type AuthChallengePayload, AuthClientError, type AuthClientErrorOptions, type AuthClientOptions, type AuthErrorExtra, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeOrganizationAccountPasswordParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreateOrganizationAccountParams, type CreateOrganizationDepartmentParams, 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 DingTalkNotificationCapabilities, type DingTalkNotificationCardConfig, type DingTalkNotificationCardField, type DingTalkNotificationCardMode, type DingTalkNotificationCardPreview, type DingTalkNotificationChannelConfig, type DingTalkNotificationDeliveryMode, type DingTalkNotificationPreviewResult, type ExecuteProcessOperationInput, type FieldAccessLevel, type FieldAccessPolicyDto, type FieldAccessPolicyItemDto, type FieldOptionValue, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormCreateResult, type FormDetailResult, type FormExportParams, type FormFieldValue, type FormGetDetailParams, type FormImportParams, type FormInstanceIdentifierResult, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type FormUpdateResult, type FunctionInvokeParams, type FunctionInvokeResult, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type GuestLoginInput, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, InitiatorApproverSelector, type InstanceStatus, type ListNotificationInboxParams, type ListWorkCenterItemsParams, type LoginLogGetParams, type LoginLogListParams, type LoginLogRecord, type LoginLogStats, type LoginLogStatsParams, type LoginLogStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type MarkAllNotificationReadResult, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationInboxListResult, type NotificationInboxMessage, type NotificationInboxReadStatus, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type NotificationUnreadCountResult, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type OrganizationAccountListParams, type OrganizationCapabilities, type OrganizationListResult, 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 PreviewDingTalkNotificationParams, type PreviewNotificationTemplateParams, ProcessActionBar, type ProcessActionBarProps, type ProcessApproveAction, type ProcessCapabilities, type ProcessCapabilityOperation, type ProcessInstanceLookupParams, ProcessPreviewPanel, type ProcessPreviewPanelProps, ProcessTimeline, type ProcessTimelineProps, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResetOrganizationAccountPasswordParams, type ResolveLoginUrlInput, type ResolveProcessCapabilitiesParams, 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 UpdateOrganizationAccountParams, type UpdateOrganizationDepartmentParams, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UseProcessActionsOptions, type UseProcessActionsReturn, type UseProcessCapabilitiesOptions, type UseProcessCapabilitiesReturn, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, type WorkCenterBoxType, type WorkCenterGroupedStat, type WorkCenterItem, type WorkCenterListResult, type WorkCenterStats, type WorkCenterStatsParams, type WorkflowApproveParams, type WorkflowCapabilityActionKey, type WorkflowDefinitionByFormParams, type WorkflowInitiatorSelectCandidatesParams, type WorkflowInitiatorSelectRequirementsParams, type WorkflowPreviewParams, type WorkflowResubmitInitiatorSelectRequirementsParams, type WorkflowResubmitParams, type WorkflowReturnParams, type WorkflowSaveTaskParams, type WorkflowStartFromExistingInstanceParams, type WorkflowTaskParams, type WorkflowTransferParams, type 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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { Dispatch, SetStateAction, CSSProperties } from 'react';
|
|
2
|
-
import { a as FormRuntimeApi, o as InitiatorSelectRequirement, I as InitiatorSelectCandidate, b0 as ProcessPreviewProps, ai as ApprovalTimelineProps } from '../ProcessPreview-
|
|
2
|
+
import { a as FormRuntimeApi, o as InitiatorSelectRequirement, I as InitiatorSelectCandidate, b0 as ProcessPreviewProps, ai as ApprovalTimelineProps } from '../ProcessPreview-Ci8_UsbN.js';
|
|
3
3
|
|
|
4
4
|
type PageQueryValue = string | string[];
|
|
5
5
|
type PageHttpMethod = "get" | "post" | "put" | "delete" | "patch";
|
|
@@ -409,10 +409,56 @@ interface PageApiResponse<TResult = unknown, TRaw = TResult> {
|
|
|
409
409
|
message?: string;
|
|
410
410
|
formInstId?: string;
|
|
411
411
|
formInstanceId?: string;
|
|
412
|
+
processInstanceId?: string;
|
|
413
|
+
serialNumber?: string;
|
|
414
|
+
serialNumbers?: Record<string, string>;
|
|
412
415
|
result: TResult | null;
|
|
413
416
|
data?: TRaw;
|
|
414
417
|
raw?: unknown;
|
|
415
418
|
}
|
|
419
|
+
interface ApiEnvelope<T = unknown> {
|
|
420
|
+
code: number | string;
|
|
421
|
+
success?: boolean;
|
|
422
|
+
message?: string;
|
|
423
|
+
data?: T;
|
|
424
|
+
result?: T;
|
|
425
|
+
error?: string;
|
|
426
|
+
errorMessage?: string;
|
|
427
|
+
}
|
|
428
|
+
interface FormInstanceIdentifierResult {
|
|
429
|
+
formInstId: string;
|
|
430
|
+
formInstanceId: string;
|
|
431
|
+
processInstanceId?: string;
|
|
432
|
+
serialNumber?: string;
|
|
433
|
+
serialNumbers?: Record<string, string>;
|
|
434
|
+
instanceId?: string;
|
|
435
|
+
result?: string;
|
|
436
|
+
success?: boolean;
|
|
437
|
+
code?: number | string;
|
|
438
|
+
[key: string]: unknown;
|
|
439
|
+
}
|
|
440
|
+
interface FormCreateResult extends FormInstanceIdentifierResult {
|
|
441
|
+
}
|
|
442
|
+
interface FormUpdateResult {
|
|
443
|
+
formInstId: string;
|
|
444
|
+
formInstanceId: string;
|
|
445
|
+
result?: string;
|
|
446
|
+
success?: boolean;
|
|
447
|
+
code?: number | string;
|
|
448
|
+
[key: string]: unknown;
|
|
449
|
+
}
|
|
450
|
+
interface FormDetailResult<TData = Record<string, unknown>> {
|
|
451
|
+
formInstId?: string;
|
|
452
|
+
formInstanceId?: string;
|
|
453
|
+
data: TData;
|
|
454
|
+
[key: string]: unknown;
|
|
455
|
+
}
|
|
456
|
+
interface FieldOptionValue {
|
|
457
|
+
label: string;
|
|
458
|
+
value: string;
|
|
459
|
+
[key: string]: unknown;
|
|
460
|
+
}
|
|
461
|
+
type FormFieldValue = string | number | boolean | null | FieldOptionValue | FieldOptionValue[] | Record<string, unknown> | Array<Record<string, unknown>>;
|
|
416
462
|
interface PageBinaryResponse {
|
|
417
463
|
blob: Blob;
|
|
418
464
|
fileName?: string;
|
|
@@ -454,6 +500,9 @@ interface PageRequestOptions<TQuery = Record<string, unknown>, TBody = unknown>
|
|
|
454
500
|
query?: TQuery;
|
|
455
501
|
body?: TBody;
|
|
456
502
|
headers?: Record<string, string>;
|
|
503
|
+
dedupe?: boolean;
|
|
504
|
+
trace?: boolean;
|
|
505
|
+
traceLabel?: string;
|
|
457
506
|
}
|
|
458
507
|
interface PageTransportRequestPayload<TBody = unknown> {
|
|
459
508
|
path: string;
|
|
@@ -490,7 +539,11 @@ interface FormCreateParams {
|
|
|
490
539
|
startProcess?: boolean;
|
|
491
540
|
autoStartProcess?: boolean;
|
|
492
541
|
processStartMode?: 'auto' | 'manual' | 'draft' | 'delayed' | 'none' | string;
|
|
493
|
-
|
|
542
|
+
/**
|
|
543
|
+
* Legacy compatibility only. New code should not infer a created row by
|
|
544
|
+
* submitted field values; the save API returns identifiers, not full row data.
|
|
545
|
+
*/
|
|
546
|
+
lookupAfterCreate?: boolean | 'legacy';
|
|
494
547
|
lookupFields?: string[];
|
|
495
548
|
}
|
|
496
549
|
interface FormUpdateParams {
|
|
@@ -1408,7 +1461,7 @@ interface PageSdk {
|
|
|
1408
1461
|
};
|
|
1409
1462
|
form: {
|
|
1410
1463
|
getDetail<T = unknown>(params: FormGetDetailParams): Promise<PageApiResponse<T>>;
|
|
1411
|
-
create<T =
|
|
1464
|
+
create<T = FormCreateResult, TRaw = unknown>(params: FormCreateParams): Promise<PageApiResponse<T, TRaw>>;
|
|
1412
1465
|
update<T = unknown, TRaw = unknown>(params: FormUpdateParams): Promise<PageApiResponse<T, TRaw>>;
|
|
1413
1466
|
remove<T = unknown, TRaw = unknown>(params: FormRemoveParams): Promise<PageApiResponse<T, TRaw>>;
|
|
1414
1467
|
getChangeRecords<T = unknown>(params: FormChangeRecordParams): Promise<PageApiResponse<T>>;
|
|
@@ -2197,4 +2250,4 @@ interface PublicAccessGateProps extends UsePublicAccessOptions {
|
|
|
2197
2250
|
}
|
|
2198
2251
|
declare const PublicAccessGate: React__default.FC<PublicAccessGateProps>;
|
|
2199
2252
|
|
|
2200
|
-
export { type ApiPermissionListParams, type AppAuthClient, type AppFunctionConnectorApi, type AppFunctionContext, type AppFunctionDataViewApi, type AppFunctionFormApi, type AppFunctionFormGetByIdParams, type AppFunctionFormQueryParams, type AppFunctionFormWriteParams, type AppFunctionNotificationApi, type AppFunctionOperatorInfo, type AppFunctionOrganizationApi, type AppFunctionPermissionContext, type AppFunctionRuntimeContext, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type AuthChallengePayload, AuthClientError, type AuthClientErrorOptions, type AuthClientOptions, type AuthErrorExtra, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeOrganizationAccountPasswordParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreateOrganizationAccountParams, type CreateOrganizationDepartmentParams, 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 DingTalkNotificationCapabilities, type DingTalkNotificationCardConfig, type DingTalkNotificationCardField, type DingTalkNotificationCardMode, type DingTalkNotificationCardPreview, type DingTalkNotificationChannelConfig, type DingTalkNotificationDeliveryMode, type DingTalkNotificationPreviewResult, type ExecuteProcessOperationInput, 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, InitiatorApproverSelector, type InstanceStatus, type ListNotificationInboxParams, type ListWorkCenterItemsParams, type LoginLogGetParams, type LoginLogListParams, type LoginLogRecord, type LoginLogStats, type LoginLogStatsParams, type LoginLogStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type MarkAllNotificationReadResult, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationInboxListResult, type NotificationInboxMessage, type NotificationInboxReadStatus, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type NotificationUnreadCountResult, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type OrganizationAccountListParams, type OrganizationCapabilities, type OrganizationListResult, 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 PreviewDingTalkNotificationParams, type PreviewNotificationTemplateParams, ProcessActionBar, type ProcessActionBarProps, type ProcessApproveAction, type ProcessCapabilities, type ProcessCapabilityOperation, type ProcessInstanceLookupParams, ProcessPreviewPanel, type ProcessPreviewPanelProps, ProcessTimeline, type ProcessTimelineProps, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResetOrganizationAccountPasswordParams, type ResolveLoginUrlInput, type ResolveProcessCapabilitiesParams, 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 UpdateOrganizationAccountParams, type UpdateOrganizationDepartmentParams, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UseProcessActionsOptions, type UseProcessActionsReturn, type UseProcessCapabilitiesOptions, type UseProcessCapabilitiesReturn, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, type WorkCenterBoxType, type WorkCenterGroupedStat, type WorkCenterItem, type WorkCenterListResult, type WorkCenterStats, type WorkCenterStatsParams, type WorkflowApproveParams, type WorkflowCapabilityActionKey, type WorkflowDefinitionByFormParams, type WorkflowInitiatorSelectCandidatesParams, type WorkflowInitiatorSelectRequirementsParams, type WorkflowPreviewParams, type WorkflowResubmitInitiatorSelectRequirementsParams, type WorkflowResubmitParams, type WorkflowReturnParams, type WorkflowSaveTaskParams, type WorkflowStartFromExistingInstanceParams, type WorkflowTaskParams, type WorkflowTransferParams, type 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 };
|
|
2253
|
+
export { type ApiEnvelope, type ApiPermissionListParams, type AppAuthClient, type AppFunctionConnectorApi, type AppFunctionContext, type AppFunctionDataViewApi, type AppFunctionFormApi, type AppFunctionFormGetByIdParams, type AppFunctionFormQueryParams, type AppFunctionFormWriteParams, type AppFunctionNotificationApi, type AppFunctionOperatorInfo, type AppFunctionOrganizationApi, type AppFunctionPermissionContext, type AppFunctionRuntimeContext, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type AuthChallengePayload, AuthClientError, type AuthClientErrorOptions, type AuthClientOptions, type AuthErrorExtra, type AuthLogoutRedirectOptions, type AuthMethod, type AuthMethodType, type AuthTokenData, type AuthUser, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeOrganizationAccountPasswordParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreateOrganizationAccountParams, type CreateOrganizationDepartmentParams, 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 DingTalkNotificationCapabilities, type DingTalkNotificationCardConfig, type DingTalkNotificationCardField, type DingTalkNotificationCardMode, type DingTalkNotificationCardPreview, type DingTalkNotificationChannelConfig, type DingTalkNotificationDeliveryMode, type DingTalkNotificationPreviewResult, type ExecuteProcessOperationInput, type FieldAccessLevel, type FieldAccessPolicyDto, type FieldAccessPolicyItemDto, type FieldOptionValue, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormCreateResult, type FormDetailResult, type FormExportParams, type FormFieldValue, type FormGetDetailParams, type FormImportParams, type FormInstanceIdentifierResult, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type FormUpdateResult, type FunctionInvokeParams, type FunctionInvokeResult, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type GuestLoginInput, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, InitiatorApproverSelector, type InstanceStatus, type ListNotificationInboxParams, type ListWorkCenterItemsParams, type LoginLogGetParams, type LoginLogListParams, type LoginLogRecord, type LoginLogStats, type LoginLogStatsParams, type LoginLogStatus, type LoginMethodsResult, LoginPage, type LoginPageProps, type MarkAllNotificationReadResult, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationInboxListResult, type NotificationInboxMessage, type NotificationInboxReadStatus, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type NotificationUnreadCountResult, OpenXiangdaPageProvider, type OpenXiangdaPageProviderProps, OpenXiangdaProvider, type OpenXiangdaProviderProps, type OrganizationAccountListParams, type OrganizationCapabilities, type OrganizationListResult, 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 PreviewDingTalkNotificationParams, type PreviewNotificationTemplateParams, ProcessActionBar, type ProcessActionBarProps, type ProcessApproveAction, type ProcessCapabilities, type ProcessCapabilityOperation, type ProcessInstanceLookupParams, ProcessPreviewPanel, type ProcessPreviewPanelProps, ProcessTimeline, type ProcessTimelineProps, type PublicAccessClaim, type PublicAccessClient, PublicAccessClientError, type PublicAccessClientOptions, PublicAccessGate, type PublicAccessGateProps, type PublicAccessSessionData, type PublicAccessSessionInput, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RefreshInput, type ResetOrganizationAccountPasswordParams, type ResolveLoginUrlInput, type ResolveProcessCapabilitiesParams, 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 UpdateOrganizationAccountParams, type UpdateOrganizationDepartmentParams, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UseAuthOptions, type UseCanAccessRouteInput, type UseLoginMethodsState, type UseProcessActionsOptions, type UseProcessActionsReturn, type UseProcessCapabilitiesOptions, type UseProcessCapabilitiesReturn, type UsePublicAccessOptions, type UsePublicAccessState, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, type WorkCenterBoxType, type WorkCenterGroupedStat, type WorkCenterItem, type WorkCenterListResult, type WorkCenterStats, type WorkCenterStatsParams, type WorkflowApproveParams, type WorkflowCapabilityActionKey, type WorkflowDefinitionByFormParams, type WorkflowInitiatorSelectCandidatesParams, type WorkflowInitiatorSelectRequirementsParams, type WorkflowPreviewParams, type WorkflowResubmitInitiatorSelectRequirementsParams, type WorkflowResubmitParams, type WorkflowReturnParams, type WorkflowSaveTaskParams, type WorkflowStartFromExistingInstanceParams, type WorkflowTaskParams, type WorkflowTransferParams, type 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 };
|
|
@@ -25,6 +25,7 @@ var usePageSdkStore = () => {
|
|
|
25
25
|
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26
26
|
var isSearchRuleLike = (value) => isRecord(value) && typeof value.key === "string" && (value.componentName === void 0 || typeof value.componentName === "string");
|
|
27
27
|
var isBlobLike = (value) => typeof Blob !== "undefined" && value instanceof Blob;
|
|
28
|
+
var nowMs = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
28
29
|
var normalizeMethod = (value) => {
|
|
29
30
|
const method = String(value || "get").toLowerCase();
|
|
30
31
|
if (method === "get" || method === "post" || method === "put" || method === "delete" || method === "patch") {
|
|
@@ -283,6 +284,26 @@ var normalizeJsonResponse = (rawResponse) => {
|
|
|
283
284
|
raw: rawResponse
|
|
284
285
|
};
|
|
285
286
|
};
|
|
287
|
+
var createMissingFormInstanceIdError = (response) => {
|
|
288
|
+
const error = new Error(
|
|
289
|
+
"\u4FDD\u5B58\u63A5\u53E3\u672A\u8FD4\u56DE formInstId/formInstanceId\u3002\u4FDD\u5B58\u63A5\u53E3\u53EA\u627F\u8BFA\u8FD4\u56DE\u5B9E\u4F8B\u6807\u8BC6\u548C\u5DF2\u751F\u6210\u7684\u6D41\u6C34\u53F7\uFF1B\u5982\u9700\u5B8C\u6574\u884C\u6570\u636E\u3001\u516C\u5F0F\u56DE\u586B\u6216\u5176\u4ED6\u670D\u52A1\u7AEF\u5B57\u6BB5\uFF0C\u8BF7\u5728\u4FDD\u5B58\u6210\u529F\u540E\u663E\u5F0F\u8C03\u7528 sdk.form.getDetail\u3002"
|
|
290
|
+
);
|
|
291
|
+
error.response = response;
|
|
292
|
+
error.raw = response.raw;
|
|
293
|
+
return error;
|
|
294
|
+
};
|
|
295
|
+
var isRequestTracingEnabled = (context, options) => {
|
|
296
|
+
if (options.trace) return true;
|
|
297
|
+
const env = context.env || {};
|
|
298
|
+
const value = env.OPENXIANGDA_REQUEST_TRACE ?? env.openxiangdaRequestTrace ?? env.requestTrace;
|
|
299
|
+
return value === true || value === "true" || value === "1";
|
|
300
|
+
};
|
|
301
|
+
var buildRequestDedupeKey = (payload) => JSON.stringify({
|
|
302
|
+
path: payload.path,
|
|
303
|
+
method: payload.method,
|
|
304
|
+
query: payload.query || "",
|
|
305
|
+
headers: payload.headers || {}
|
|
306
|
+
});
|
|
286
307
|
var normalizeBinaryResponse = (rawResponse) => {
|
|
287
308
|
if (isRecord(rawResponse) && isBlobLike(rawResponse.blob)) {
|
|
288
309
|
return rawResponse;
|
|
@@ -354,12 +375,90 @@ var pickCreatedFormInstanceId = (value) => {
|
|
|
354
375
|
return text || void 0;
|
|
355
376
|
}
|
|
356
377
|
if (!isRecord(value)) return void 0;
|
|
357
|
-
const direct = value.formInstId || value.formInstanceId || value.instanceId || value.id
|
|
358
|
-
if (direct !== value) {
|
|
359
|
-
|
|
378
|
+
const direct = value.formInstId || value.formInstanceId || value.instanceId || value.id;
|
|
379
|
+
if (direct !== value && direct !== void 0 && direct !== null) {
|
|
380
|
+
const picked = pickCreatedFormInstanceId(direct);
|
|
381
|
+
if (picked) return picked;
|
|
382
|
+
}
|
|
383
|
+
for (const candidate of [value.result, value.data, value.raw]) {
|
|
384
|
+
const picked = pickCreatedFormInstanceId(candidate);
|
|
385
|
+
if (picked) return picked;
|
|
386
|
+
}
|
|
387
|
+
return void 0;
|
|
388
|
+
};
|
|
389
|
+
var pickCreatedProcessInstanceId = (value) => {
|
|
390
|
+
if (!value || typeof value === "string") return void 0;
|
|
391
|
+
if (!isRecord(value)) return void 0;
|
|
392
|
+
const direct = value.processInstanceId || value.processInstId;
|
|
393
|
+
if (typeof direct === "string" && direct.trim()) return direct.trim();
|
|
394
|
+
for (const candidate of [value.result, value.data, value.raw]) {
|
|
395
|
+
const picked = pickCreatedProcessInstanceId(candidate);
|
|
396
|
+
if (picked) return picked;
|
|
397
|
+
}
|
|
398
|
+
return void 0;
|
|
399
|
+
};
|
|
400
|
+
var pickSerialNumbers = (value) => {
|
|
401
|
+
if (!value || typeof value === "string" || !isRecord(value)) return void 0;
|
|
402
|
+
const direct = value.serialNumbers;
|
|
403
|
+
if (isRecord(direct)) {
|
|
404
|
+
const entries = Object.entries(direct).map(([key, item]) => [key, String(item ?? "").trim()]).filter(([, item]) => Boolean(item));
|
|
405
|
+
if (entries.length > 0) return Object.fromEntries(entries);
|
|
406
|
+
}
|
|
407
|
+
for (const candidate of [value.result, value.data, value.raw]) {
|
|
408
|
+
const picked = pickSerialNumbers(candidate);
|
|
409
|
+
if (picked) return picked;
|
|
410
|
+
}
|
|
411
|
+
return void 0;
|
|
412
|
+
};
|
|
413
|
+
var pickSerialNumber = (value) => {
|
|
414
|
+
if (!value || typeof value === "string") return void 0;
|
|
415
|
+
if (!isRecord(value)) return void 0;
|
|
416
|
+
const direct = value.serialNumber || value.serialNo || value.sequenceNo;
|
|
417
|
+
if (typeof direct === "string" && direct.trim()) return direct.trim();
|
|
418
|
+
const serialNumbers = pickSerialNumbers(value);
|
|
419
|
+
if (serialNumbers) {
|
|
420
|
+
const first = Object.values(serialNumbers)[0];
|
|
421
|
+
if (first) return first;
|
|
422
|
+
}
|
|
423
|
+
for (const candidate of [value.result, value.data, value.raw]) {
|
|
424
|
+
const picked = pickSerialNumber(candidate);
|
|
425
|
+
if (picked) return picked;
|
|
360
426
|
}
|
|
361
427
|
return void 0;
|
|
362
428
|
};
|
|
429
|
+
var normalizeFormCreateResponse = (response, formInstanceId) => {
|
|
430
|
+
const processInstanceId = pickCreatedProcessInstanceId(response);
|
|
431
|
+
const serialNumbers = pickSerialNumbers(response);
|
|
432
|
+
const serialNumber = pickSerialNumber(response);
|
|
433
|
+
const sourceResult = isRecord(response.result) ? response.result : {};
|
|
434
|
+
const normalizedResult = {
|
|
435
|
+
...sourceResult,
|
|
436
|
+
formInstId: formInstanceId,
|
|
437
|
+
formInstanceId,
|
|
438
|
+
result: typeof response.result === "string" && response.result.trim() ? response.result.trim() : sourceResult.result || formInstanceId,
|
|
439
|
+
...processInstanceId ? { processInstanceId } : {},
|
|
440
|
+
...serialNumber ? { serialNumber } : {},
|
|
441
|
+
...serialNumbers ? { serialNumbers } : {}
|
|
442
|
+
};
|
|
443
|
+
const normalizedData = isRecord(response.data) ? {
|
|
444
|
+
...response.data,
|
|
445
|
+
formInstId: response.data.formInstId || formInstanceId,
|
|
446
|
+
formInstanceId: response.data.formInstanceId || formInstanceId,
|
|
447
|
+
...processInstanceId ? { processInstanceId } : {},
|
|
448
|
+
...serialNumber ? { serialNumber } : {},
|
|
449
|
+
...serialNumbers ? { serialNumbers } : {}
|
|
450
|
+
} : response.data;
|
|
451
|
+
return {
|
|
452
|
+
...response,
|
|
453
|
+
formInstId: formInstanceId,
|
|
454
|
+
formInstanceId,
|
|
455
|
+
...processInstanceId ? { processInstanceId } : {},
|
|
456
|
+
...serialNumber ? { serialNumber } : {},
|
|
457
|
+
...serialNumbers ? { serialNumbers } : {},
|
|
458
|
+
result: normalizedResult,
|
|
459
|
+
data: normalizedData
|
|
460
|
+
};
|
|
461
|
+
};
|
|
363
462
|
var isStableCreateLookupValue = (value) => {
|
|
364
463
|
if (value === void 0 || value === null || value === "") return false;
|
|
365
464
|
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
@@ -394,20 +493,6 @@ var firstListItem = (value) => {
|
|
|
394
493
|
}
|
|
395
494
|
return void 0;
|
|
396
495
|
};
|
|
397
|
-
var attachFormInstanceId = (response, formInstanceId) => {
|
|
398
|
-
const withIds = (value) => isRecord(value) ? {
|
|
399
|
-
...value,
|
|
400
|
-
formInstId: value.formInstId || formInstanceId,
|
|
401
|
-
formInstanceId: value.formInstanceId || formInstanceId
|
|
402
|
-
} : value;
|
|
403
|
-
return {
|
|
404
|
-
...response,
|
|
405
|
-
formInstId: formInstanceId,
|
|
406
|
-
formInstanceId,
|
|
407
|
-
result: response.result === null || response.result === void 0 ? formInstanceId : withIds(response.result),
|
|
408
|
-
data: response.data === void 0 ? response.data : withIds(response.data)
|
|
409
|
-
};
|
|
410
|
-
};
|
|
411
496
|
var withDefaultAppType = (context, params) => {
|
|
412
497
|
if (!params) {
|
|
413
498
|
return params;
|
|
@@ -527,6 +612,8 @@ var redirectAfterLogout = (context, options) => {
|
|
|
527
612
|
);
|
|
528
613
|
};
|
|
529
614
|
var createPageSdk = (context) => {
|
|
615
|
+
const inFlightGetRequests = /* @__PURE__ */ new Map();
|
|
616
|
+
const recentRequestStats = /* @__PURE__ */ new Map();
|
|
530
617
|
const request = async (options) => {
|
|
531
618
|
const payload = {
|
|
532
619
|
path: options.path,
|
|
@@ -535,17 +622,54 @@ var createPageSdk = (context) => {
|
|
|
535
622
|
body: options.body,
|
|
536
623
|
headers: options.headers
|
|
537
624
|
};
|
|
538
|
-
|
|
625
|
+
const traceEnabled = isRequestTracingEnabled(context, options);
|
|
626
|
+
const traceLabel = options.traceLabel || `${payload.method.toUpperCase()} ${payload.path}`;
|
|
627
|
+
const dedupeKey = options.dedupe !== false && payload.method === "get" ? buildRequestDedupeKey(payload) : void 0;
|
|
628
|
+
if (traceEnabled && dedupeKey) {
|
|
629
|
+
const currentAt = nowMs();
|
|
630
|
+
const previous = recentRequestStats.get(dedupeKey);
|
|
631
|
+
const nextCount = previous && currentAt - previous.lastAt < 500 ? previous.count + 1 : 1;
|
|
632
|
+
recentRequestStats.set(dedupeKey, { count: nextCount, lastAt: currentAt });
|
|
633
|
+
if (nextCount > 1) {
|
|
634
|
+
console.warn(
|
|
635
|
+
`[OpenXiangda SDK] repeated request within 500ms (${nextCount}): ${traceLabel}`
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if (dedupeKey && inFlightGetRequests.has(dedupeKey)) {
|
|
640
|
+
if (traceEnabled) {
|
|
641
|
+
console.debug(`[OpenXiangda SDK] deduped in-flight request: ${traceLabel}`);
|
|
642
|
+
}
|
|
643
|
+
return inFlightGetRequests.get(dedupeKey);
|
|
644
|
+
}
|
|
645
|
+
const task = (async () => {
|
|
646
|
+
const startedAt = nowMs();
|
|
539
647
|
const rawResponse = await context.bridge.invoke(
|
|
540
648
|
"transport.request",
|
|
541
649
|
payload
|
|
542
650
|
);
|
|
543
|
-
|
|
651
|
+
const normalized = ensureSuccess(
|
|
544
652
|
normalizeJsonResponse(rawResponse),
|
|
545
653
|
payload
|
|
546
654
|
);
|
|
655
|
+
if (traceEnabled) {
|
|
656
|
+
console.debug(
|
|
657
|
+
`[OpenXiangda SDK] ${traceLabel} ${Math.round(nowMs() - startedAt)}ms`
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
return normalized;
|
|
661
|
+
})();
|
|
662
|
+
if (dedupeKey) {
|
|
663
|
+
inFlightGetRequests.set(dedupeKey, task);
|
|
664
|
+
}
|
|
665
|
+
try {
|
|
666
|
+
return await task;
|
|
547
667
|
} catch (error) {
|
|
548
668
|
throw toSdkError(error, payload);
|
|
669
|
+
} finally {
|
|
670
|
+
if (dedupeKey && inFlightGetRequests.get(dedupeKey) === task) {
|
|
671
|
+
inFlightGetRequests.delete(dedupeKey);
|
|
672
|
+
}
|
|
549
673
|
}
|
|
550
674
|
};
|
|
551
675
|
const download = async (options) => {
|
|
@@ -663,16 +787,17 @@ var createPageSdk = (context) => {
|
|
|
663
787
|
processStartMode: params.processStartMode
|
|
664
788
|
}
|
|
665
789
|
});
|
|
666
|
-
if (params.lookupAfterCreate === false) {
|
|
667
|
-
return response;
|
|
668
|
-
}
|
|
669
790
|
const directId = pickCreatedFormInstanceId(response);
|
|
670
791
|
if (directId) {
|
|
671
|
-
return
|
|
792
|
+
return normalizeFormCreateResponse(response, directId);
|
|
793
|
+
}
|
|
794
|
+
if (!params.lookupAfterCreate) {
|
|
795
|
+
throw createMissingFormInstanceIdError(response);
|
|
672
796
|
}
|
|
673
797
|
const filters = buildCreateLookupFilters(params.data || {}, params.lookupFields);
|
|
674
798
|
if (!filters) {
|
|
675
|
-
return response;
|
|
799
|
+
if (params.lookupAfterCreate === "legacy") return response;
|
|
800
|
+
throw createMissingFormInstanceIdError(response);
|
|
676
801
|
}
|
|
677
802
|
const lookupResponse = await request({
|
|
678
803
|
path: buildAppPath(
|
|
@@ -690,7 +815,9 @@ var createPageSdk = (context) => {
|
|
|
690
815
|
}
|
|
691
816
|
});
|
|
692
817
|
const lookupId = pickCreatedFormInstanceId(firstListItem(lookupResponse));
|
|
693
|
-
|
|
818
|
+
if (lookupId) return normalizeFormCreateResponse(response, lookupId);
|
|
819
|
+
if (params.lookupAfterCreate === "legacy") return response;
|
|
820
|
+
throw createMissingFormInstanceIdError(response);
|
|
694
821
|
},
|
|
695
822
|
update: (params) => request({
|
|
696
823
|
path: buildAppPath(
|