import type { ApplicationAgentTransport } from './agent-protocol'; import type { WorkflowDelegationAdministration, WorkflowDelegationCatalog, WorkflowDelegationCandidatePage, WorkflowDelegationCandidateQuery, WorkflowDelegationListQuery, WorkflowDelegationPage, WorkflowDelegationMutationPreview, WorkflowDelegationMutationReceipt, WorkflowDelegationMutationRequest } from 'openxiangda-contracts/browser'; import { type DataAuditPage, type DataAggregatePage, type DataAggregateQuery, type DataBatchQueryOperation, type DataBatchQueryResult, type DataFilePreview, type DataFileRef, type DataFieldSourcePage, type DataFieldSourceQuery, type WorkflowTaskSourceBinding, type DataFieldUserCandidateQuery, type WorkflowTaskUserCandidateQuery, type UserCandidatePage, type DataWhere, type DataRecordPrint, type DataResourceSurface, type DataFormDraftStateSchema, type DataTransactionOperation, type DataTransactionResult, type DirectoryEntryPage, type PlatformOrganizationMembership, type PlatformOrganizationSwitchReceipt, type DirectoryRoleFactPage, type RuntimeRoleSummary, type SubjectProfile, type ApplicationOperationReceiptV2, type ApplicationFileIntentV2, type ApplicationOperationSurfaceCatalogV2, type ApplicationOperationSurfaceV2, type SubjectReadSurfaceResultV2, type WorkflowCommand, type WorkflowCommandInput, type WorkflowCommandResult, type WorkflowDetailSurfaceV2, type WorkflowLaunchSurface, type WorkflowRecordCorrectionSurface, type WorkflowNamedOperationLaunchIntent, type WorkflowSurface, type WorkflowWorkCenterItem, type WorkflowTimeline, type ApplicationTodoCenterPageV2, type ApplicationTodoInteractionResultV2, type ApplicationTodoViewV2, type NotificationMessageDetailV2, type NotificationReadReceiptV2, type ApplicationLoginPublicSurfaceV2, type ApplicationLoginTransactionReceiptV2, type ApplicationLoginRedirectReceiptV2, type ApplicationLoginReceiptV2, type ApplicationLogoutReceiptV2, type BusinessProcessAnswer, type BusinessProcessCommand, type BusinessProcessCommandQuery, type BusinessProcessCommandList, type BusinessProcessPoll, type BusinessProcessReceipt, type BusinessProcessResolution, type BusinessProcessResolutionQuery, type BusinessProcessRetry, type ProcessCommandSurface, type StandardProcessCommit, type NativeAuthorizationManagementCatalog, type NativeAuthorizationMutationReceipt, type NativeRoleManagementAction, type NativeRoleManagementGrantMutationResult, type NativeRoleManagementGrantPage, type NativeRoleMembershipMutationResult, type NativeRoleMembershipPage, type NativeRoleMembershipBatchInput, type NativeRoleMembershipBatchResult, type NativeScopeGrant } from 'openxiangda-contracts/browser'; import type { ManagedConcurrencyClient } from './managed-command'; import { type GenericResourceQuery } from './components/platform-fields/resource-query'; export type { GenericResourceQuery } from './components/platform-fields/resource-query'; export declare class OpenXiangdaPlatformRequestError extends Error { readonly code: string; readonly status: number; readonly retryable?: boolean; readonly retryAfterMs?: number; readonly data: unknown; readonly request?: Readonly; constructor(input: { code: string; status: number; message: string; retryable?: boolean; retryAfterMs?: number; data?: unknown; request?: PlatformRequestContext; }); } /** * Convert platform read failures into copy that is safe and useful for a user. * Internal error codes remain available on the error object for diagnostics, * but generated resource pages should not expose them as the primary message. */ export declare function platformReadErrorMessage(error: unknown, fallback?: string): string; export interface PlatformRequestContext { requestId: string | null; method: string; path: string; observedAt: string; appCode: string | null; environmentKey: string | null; } /** A support copy contains no request body, response data, credentials or free-text message. */ export declare function platformRequestDiagnostic(error: unknown): { requestId: string | null; method: string; path: string; observedAt: string; appCode: string | null; environmentKey: string | null; schemaVersion: "openxiangda.request-diagnostic/v1"; code: string; status: number; } | null; export declare function useGlobalRequestLoading(): boolean; export declare function requestApplicationApi(path: string, init?: RequestInit): Promise; export interface RuntimeIdentity { /** Platform-verified working organization; absent in traditional tenants. */ activeOrganizationId?: string; userId: string; roleCodes: string[]; capabilityCodes: string[]; isAppSuperAdmin: boolean; identityScope: string; subjectProfile: SubjectProfile; roles: RuntimeRoleSummary[]; environment: { id: string; key: 'preproduction' | 'production'; activeAppVersionId?: string; headRevision?: number; authzRevisionId?: string; authzVersion?: number; scopeDataVersion?: string; activeOrganizationId?: string; }; } export interface RuntimeAuthorization { state: 'active' | 'unassigned'; identity: RuntimeIdentity | null; } export declare function subscribePlatformOrganizationInvalidation(listener: () => void): () => void; export declare function subscribePlatformSessionInvalidation(listener: () => void): () => void; export declare function isApplicationUnauthenticatedError(error: unknown): boolean; export declare function loadApplicationLoginSurface(input: { device: 'desktop' | 'mobile'; returnTo: string; }): Promise; export declare function createApplicationLoginTransaction(input: { device: 'desktop' | 'mobile'; returnTo: string; }): Promise; export declare function passwordLoginApplication(input: { transactionId: string; methodCode: string; username: string; password: string; rememberAccount?: boolean; challengeId?: string; challengeAnswer?: string; }): Promise; export declare function startApplicationSso(input: { transactionId: string; methodCode: string; }): Promise; export declare function startApplicationDingTalk(input: { transactionId: string; methodCode: string; jsapiAvailable?: boolean; }): Promise; export declare function completeApplicationDingTalkJsapi(input: { transactionId: string; methodCode: string; code: string; }): Promise; export declare function isRuntimeAuthorizationIdentityRejection(error: unknown): boolean; export declare function loadRuntimeAuthorization(options?: { refresh?: boolean; signal?: AbortSignal; }): Promise; export declare function loadCurrentOrganizationMemberships(options?: { signal?: AbortSignal; }): Promise; export declare function loadCurrentDirectoryRoleFacts(options?: { limit?: number; after?: string; signal?: AbortSignal; }): Promise; /** Cookies remain owned by the platform; receipt excludes authentication tokens. */ export declare function switchCurrentOrganization(organizationId: string): Promise; export declare function logoutCurrentUser(): Promise; export declare function uploadCurrentUserAvatar(file: File): Promise; /** Internal transport for the app facade; identity and login remain platform-owned. */ export declare function createApplicationAgentTransport(): ApplicationAgentTransport; /** Uses the same authenticated transport and identity owner as ordinary Native data. */ export declare function createManagedConcurrencyClient(): ManagedConcurrencyClient; export interface AnonymousPublicDraft { schemaVersion: 'openxiangda.anonymous-public-draft/v2'; revision: number; data: Record; progress: { completed: number; total: number; percentage: number | null; }; expiresAt: string; } export interface AnonymousPublicRecord { schemaVersion: 'openxiangda.anonymous-public-record/v2'; resourceCode: string; data: Record; } export declare function createAnonymousPublicClient(input: { routeCode: string; policyCode?: string; }): { bootstrap(): Promise; currentDraft(): Promise; saveDraft(expectedRevision: number, data: Record): Promise; validate(code: string, data: Record): Promise<{ schemaVersion: "openxiangda.anonymous-public-validation/v2"; code: string; result: "available" | "duplicate"; }>; submit(expectedRevision: number, idempotencyKey: string): Promise<{ schemaVersion: "openxiangda.anonymous-public-submission/v2"; state: "submitted"; recordId: string; submittedAt: string; idempotentReplay: boolean; generated?: Record; }>; listOwn(options?: { cursor?: string; pageSize?: number; }): Promise<{ schemaVersion: "openxiangda.anonymous-public-record-page/v2"; items: AnonymousPublicRecord[]; nextCursor: string | null; }>; getOwn(recordId: string): Promise; listPublic(options?: { cursor?: string; pageSize?: number; }): Promise<{ schemaVersion: "openxiangda.anonymous-public-record-page/v2"; items: AnonymousPublicRecord[]; nextCursor: string | null; }>; getPublic(recordId: string): Promise; upload(fieldCode: string, file: File): Promise; fileContentUrl(fileId: string, disposition?: "attachment" | "inline", variant?: "thumbnail", resourceCode?: string, parentFieldCode?: string): string; }; export type DirectoryKind = 'user' | 'department'; export interface ChinaDivisionListItem { adcode: string; citycode?: string; name: string; level?: string; center?: string; parentAdcode?: string; hasChildren: boolean; } export declare function loadChinaDivisions(parentAdcode?: string): Promise; export declare function searchDirectory(kind: DirectoryKind, options: { keyword: string; cursor?: string; purpose?: 'filter'; }): Promise; export declare function browseDepartmentTree(options: { parentId?: string; cursor?: string; }): Promise; export declare function browseDepartmentUsers(departmentId: string, page?: number): Promise; export declare function resolveDirectory(kind: DirectoryKind, ids: string[]): Promise; export declare function searchResource(resourceCode: string, fieldCode: string, options: { operation: DataFieldSourceQuery['operation']; record?: DataFieldSourceQuery['record']; keyword: string; cursor?: string; bindings?: Record; launch?: DataFieldSourceQuery['launch']; action?: DataFieldSourceQuery['action']; task?: WorkflowTaskSourceBinding; }): Promise; export declare function queryFieldUserCandidates(resourceCode: string, fieldCode: string, input: DataFieldUserCandidateQuery): Promise; export declare function queryWorkflowTaskUserCandidates(taskId: string, fieldCode: string, input: WorkflowTaskUserCandidateQuery): Promise; export interface NativeResourceBatchListOperation { key: string; resourceCode: string; surface: DataResourceSurface; query: GenericResourceQuery; } export type NativeResourceBatchListResult = { key: string; resourceCode: string; ok: true; page: { rows: Record[]; total: number; }; } | { key: string; resourceCode: string; ok: false; error: { code: string; status: number; retryable: boolean; }; }; export interface NativeResourceBatchAggregateOperation { key: string; resourceCode: string; aggregate: DataAggregateQuery; } export type NativeResourceBatchAggregateResult = Record> = { key: string; resourceCode: string; ok: true; aggregate: DataAggregatePage; } | { key: string; resourceCode: string; ok: false; error: { code: string; status: number; retryable: boolean; }; }; export declare function batchQueryNativeData = Record>(operations: DataBatchQueryOperation[]): Promise>; export declare function batchListNativeResources(operations: NativeResourceBatchListOperation[]): Promise; export declare function batchAggregateNativeResources = Record>(operations: NativeResourceBatchAggregateOperation[]): Promise[]>; export declare function loadNativeRecordPrint(code: string, recordId: string, options?: { viewCode?: string; }): Promise; /** Comment reads retain current Perspective; writes/recovery use Native current-user authority. */ export declare function loadNativeRecordComments(code: string, recordId: string, options?: { limit?: number; cursor?: string; }): Promise; /** Fix the mutation before sending; never generate a replacement key for an unknown result. */ export declare function createNativeRecordComment(code: string, recordId: string, input: import('openxiangda-contracts/browser').DataRecordCommentMutation): Promise; /** Author-only original-key recovery is re-authorized, even after a new application Head. */ export declare function loadNativeRecordCommentReceipt(code: string, recordId: string, idempotencyKey: string): Promise; /** Maintenance uses the current user role union, independent of read Perspective. */ export declare function previewNativeRecordDeletion(code: string, recordId: string): Promise; export declare function deleteNativeRecordWithPreview(code: string, recordId: string, input: import('openxiangda-contracts/browser').DataRecordDeletionMutation): Promise; /** Read the original owner receipt; never replace the pending request with a new key. */ export declare function recoverNativeRecordDeletion(code: string, recordId: string, input: import('openxiangda-contracts/browser').DataRecordDeletionMutation): Promise; export declare function createNativeResourceClient(code: string, surface: DataResourceSurface): { previewDeletion: (recordId: string) => Promise; deleteWithPreview: (recordId: string, input: import("openxiangda-contracts/browser").DataRecordDeletionMutation) => Promise; deletionReceipt: (recordId: string, input: import("openxiangda-contracts/browser").DataRecordDeletionMutation) => Promise; list(query: GenericResourceQuery): Promise<{ rows: Record[]; total: number; }>; exportCsv(query: GenericResourceQuery, select: string[]): Promise<{ blob: Blob; fileName: string | undefined; rowLimit: number; }>; get(id: string): Promise>; audit(id: string): Promise; create(data: Record): Promise>; update(id: string, expectedRevision: number, data: Record): Promise>; remove(id: string, expectedRevision: number): Promise>; upload(fieldCode: string, file: File, recordId?: string): Promise; }; export declare function transactNativeData(operations: DataTransactionOperation[], idempotencyKey?: string): Promise; /** * Authorizes a managed upload through the active Named Action contract. Once * complete, the result is an ordinary durable DataFileRef; later data writes * persist that JSON value without replaying the action or upload intent. */ export declare function uploadOperationManagedFile(input: { operationCode: string; resourceCode: string; fieldCode: string; intent: 'create' | 'update'; file: File; recordId?: string; }): Promise; /** * Loads one bounded relationship projection after the platform proves normal * read access to the parent record. Callers never provide child resource * fields, filters, sorting, or limits; those stay frozen in the AppVersion. */ export declare function loadSubjectReadSurface = Record>(subjectResourceCode: string, surfaceCode: string, subjectId: string, options?: { signal?: AbortSignal; }): Promise>; /** Lists only active-version operations exposed to the current role union. */ export declare function loadApplicationOperationSurfaces(options?: { signal?: AbortSignal; }): Promise; /** * Executes the exact immutable operation surface returned by the catalog. * The caller never supplies a runtime path, capability, or subject resource. */ export declare function executeApplicationOperation = Record>(operationSurface: ApplicationOperationSurfaceV2, input: Record, options?: { idempotencyKey?: string; signal?: AbortSignal; }): Promise>; /** Issues a short-lived, current-user-bound intent for one declared external file. */ export declare function issueApplicationFileIntent(operationSurface: ApplicationOperationSurfaceV2, input: Record, purpose: 'preview' | 'download', options?: { signal?: AbortSignal; }): Promise; /** Returns the same-origin content URL from a platform-issued opaque intent. */ export declare function applicationFileIntentUrl(intent: ApplicationFileIntentV2): string; export interface ResourceListPreference { version: 1; columns: Array<{ key: string; visible: boolean; fixed?: 'left'; }>; filters: { keyword?: string; values?: Record; where?: DataWhere; }; sorts: Array<{ field: string; direction: 'ascend' | 'descend'; }>; density: 'small' | 'middle' | 'large'; pageSize: number; updatedAt?: string; } export declare function loadResourceListPreference(listKey: string): Promise; export declare function saveResourceListPreference(listKey: string, preference: ResourceListPreference): Promise; export declare function resetResourceListPreference(listKey: string): Promise; export declare function loadRoleManagementCatalog(): Promise; export declare function listRoleManagementScopeValues(dimensionCode: string, input?: { keyword?: string; limit?: number; offset?: number; }): Promise; export declare function listRoleMemberships(input?: { status?: 'active' | 'revoked' | 'expired'; userId?: string; roleCode?: string; keyword?: string; dimensionCode?: string; scopeValue?: string; limit?: number; offset?: number; }): Promise; /** Each item is independent; retain its operationId when recovering an unknown result. */ export declare function previewRoleMembershipBatch(input: Pick): Promise; export declare function executeRoleMembershipBatch(input: Pick): Promise; /** Potential versioned nodes, authorized by the existing workflow management reader. */ export declare function loadWorkflowRoleReferences(roleCode: string, input?: { keyword?: string; limit?: number; offset?: number; }): Promise; export declare function searchRoleManagementUsers(input: { keyword: string; cursor?: string; limit?: number; }): Promise; export interface CreateRoleMembershipInput { operationId: string; reason: string; userId: string; roleCode: string; scopeGrants?: NativeScopeGrant[]; validFrom?: string | null; validTo?: string | null; } export declare function createRoleMembership(input: CreateRoleMembershipInput): Promise; export interface UpdateRoleMembershipInput { operationId: string; reason: string; expectedRevision: number; scopeGrants?: NativeScopeGrant[]; validFrom?: string | null; validTo?: string | null; } export declare function updateRoleMembership(membershipId: string, input: UpdateRoleMembershipInput): Promise; export declare function revokeRoleMembership(membershipId: string, input: { operationId: string; reason: string; expectedRevision: number; }): Promise; export declare function listRoleManagementGrants(input?: { status?: 'active' | 'revoked'; subjectRoleCode?: string; limit?: number; offset?: number; }): Promise; export interface SetRoleManagementGrantInput { operationId: string; reason: string; subjectRoleCode: string; manageAllRoles: boolean; managedRoleCodes: string[]; actions: NativeRoleManagementAction[]; } export declare function createRoleManagementGrant(input: SetRoleManagementGrantInput): Promise; export declare function updateRoleManagementGrant(grantId: string, input: SetRoleManagementGrantInput & { expectedRevision: number; }): Promise; export declare function revokeRoleManagementGrant(grantId: string, input: { operationId: string; reason: string; expectedRevision: number; }): Promise; export declare function loadAuthorizationMutationReceipt(operationId: string): Promise; export declare function dataFileContentUrl(resource: string, fileId: string, disposition?: 'attachment' | 'inline', variant?: 'thumbnail'): string; export declare function dataRichTextImageSource(resource: string, fileId: string): string; export declare function loadDataFilePreview(resource: string, fileId: string): Promise; export declare function fetchDataFileBlob(resource: string, fileId: string, variant?: 'thumbnail'): Promise; export declare function downloadDataFile(resource: string, fileId: string, fileName: string): Promise; export type WorkflowFileBinding = ({ instanceId: string; taskId?: never; } | { taskId: string; instanceId?: never; }) & { resourceCode: string; recordId: string; fieldCode: string; }; export declare function workflowDataFileContentUrl(binding: WorkflowFileBinding, fileId: string, disposition?: 'attachment' | 'inline', variant?: 'thumbnail'): string; export declare function loadWorkflowDataFilePreview(binding: WorkflowFileBinding, fileId: string): Promise; export declare function fetchWorkflowDataFileBlob(binding: WorkflowFileBinding, fileId: string, variant?: 'thumbnail'): Promise; export declare function downloadWorkflowDataFile(binding: WorkflowFileBinding, fileId: string, fileName: string): Promise; export declare function loadWorkflowDelegationCatalog(): Promise; export declare function listWorkflowDelegations(input?: WorkflowDelegationListQuery): Promise; export declare function loadWorkflowDelegation(id: string): Promise; export declare function listWorkflowDelegationCandidates(input: WorkflowDelegationCandidateQuery): Promise; export declare function loadWorkflowDelegationMutationReceipt(operationId: string): Promise; export declare function previewWorkflowDelegationMutation(input: WorkflowDelegationMutationRequest): Promise; export declare function executeWorkflowDelegationMutation(input: WorkflowDelegationMutationRequest): Promise; export interface WorkflowWorkCenterPage { engineVersion: '2.0'; authorizationMode: 'current_user_role_union'; authorizationDigest: string; status?: 'pending' | 'completed'; view: import('openxiangda-contracts/browser').WorkflowWorkCenterView; counts: Record; total: number; limit: number; offset: number; items: WorkflowWorkCenterItem[]; } export declare function loadWorkflowLaunchSurface(workflowCode: string): Promise; /** Executes the exact application Named Action sealed into a Workflow launch Surface. */ export declare function executeWorkflowLaunchNamedOperation = Record>(intent: WorkflowNamedOperationLaunchIntent, input: Record): Promise; export type StandardProcessCommitInput = Omit & { processOperationCode: string; }; export declare function commitStandardProcess(input: StandardProcessCommitInput): Promise; /** Find readable original commands when entering from a subject record. */ export declare function listBusinessProcessCommands(input: Omit, signal?: AbortSignal): Promise; export declare function loadBusinessProcessCommand(commandId: string): Promise; /** Read-only lookup: not_observed is never permission to repeat the write with a new key. */ export declare function resolveBusinessProcessOriginal(input: Omit, signal?: AbortSignal): Promise; /** Read the durable idempotency receipt without creating or replaying a command. */ export declare function loadBusinessProcessReceipt(commandId: string): Promise; /** Read command progress with a revision cursor; the platform owns all state transitions. */ export declare function pollBusinessProcessCommand(commandId: string, afterRevision?: number): Promise; export declare function loadProcessCommandSurface(commandId: string, signal?: AbortSignal): Promise; export declare function answerBusinessProcessCommand(commandId: string, input: Omit): Promise; export declare function retryBusinessProcessCommand(commandId: string, input: Omit): Promise; export declare function loadWorkflowWorkCenter(input: { status?: 'pending' | 'completed'; view?: import('openxiangda-contracts/browser').WorkflowWorkCenterView; limit?: number; offset?: number; keyword?: string; instanceStatus?: 'running' | 'approved' | 'rejected' | 'withdrawn' | 'terminated'; }): Promise; export declare function loadWorkflowTaskSurface(taskId: string): Promise; /** Private values remain scoped to the current user and fixed actionable task. */ export declare function loadWorkflowTaskDrafts(taskId: string): Promise; export declare function saveWorkflowTaskDraft(taskId: string, input: import('openxiangda-contracts/browser').WorkflowTaskDraftSave): Promise; export declare function removeWorkflowTaskDraft(taskId: string, input: import('openxiangda-contracts/browser').WorkflowTaskDraftReference): Promise<{ deleted: true; }>; /** Fix the upload ID before this call. Retrying uses the same intent and task. */ export declare function initiateWorkflowTaskFileUpload(taskId: string, input: import('openxiangda-contracts/browser').WorkflowTaskFileUpload): Promise; export declare function loadWorkflowTaskFileUploadPlan(taskId: string, fileId: string): Promise; export declare function completeWorkflowTaskFileUpload(taskId: string, fileId: string): Promise; export declare function loadWorkflowInstanceSurface(instanceId: string): Promise; /** Current record read/RLS plus explicit history policy, without handling authority. */ export declare function loadWorkflowRecordHistory(resourceCode: string, recordId: string, options?: { instanceId?: string; limit?: number; offset?: number; }): Promise; export declare function loadWorkflowTimeline(instanceId: string): Promise; /** Requires the same workflow management authority as the platform console. */ export declare function loadWorkflowDefinitionGraph(workflowCode: string, version: number): Promise; export declare function loadWorkflowInstanceGraph(instanceId: string): Promise; export declare function loadApplicationAdministrationContext(): Promise; /** Same administrator authority as the console; does not grant ordinary users repair access. */ export declare function loadWorkflowBusinessStepRecovery(instanceId: string): Promise; export declare function previewWorkflowBusinessStepRecovery(instanceId: string, selection?: { executionId?: string; recovery?: 'continue' | 'recompute' | 'apply_stored'; }): Promise; /** Keep this exact token/input/key until the outcome is known. Only an explicit pure recomputation creates a new execution. */ export declare function executeWorkflowBusinessStepRecovery(instanceId: string, input: { commandToken: string; idempotencyKey: string; input: { reason: string; }; }): Promise; export declare function loadWorkflowNodeConfigurations(workflowCode: string): Promise; /** Retain the same operationId and exact input while the write result is unknown. */ export declare function saveWorkflowNodeConfiguration(workflowCode: string, nodeId: string, input: import('openxiangda-contracts/browser').WorkflowNodeConfigurationMutation): Promise; export declare function loadWorkflowAssignmentRoutingCatalog(input?: { keyword?: string; limit?: number; offset?: number; }): Promise; export declare function loadWorkflowAssignmentRoutingConfiguration(policyCode: string): Promise; export declare function loadWorkflowAssignmentRoutingHistory(policyCode: string, input?: { limit?: number; offset?: number; }): Promise; /** Keep the exact mutation and operationId to recover an unknown write result. */ export declare function saveWorkflowAssignmentRoutingConfiguration(policyCode: string, input: import('openxiangda-contracts/browser').WorkflowAssignmentRoutingMutation): Promise; export declare function loadWorkflowTaskDetail(taskId: string): Promise; export declare function loadWorkflowInstanceDetail(instanceId: string): Promise; export declare function loadWorkflowRecordDetail(resourceCode: string, recordId: string): Promise; export declare function loadWorkflowDataAudit(instanceId: string): Promise; export declare function getNotificationMessage(messageId: string): Promise; export declare function getDingTalkCardReadReceipt(messageId: string, deliveryId: string): Promise; export declare function refreshDingTalkCardReadReceipt(messageId: string, deliveryId: string): Promise; export declare function loadApplicationTodos(input: { view: ApplicationTodoViewV2; unread?: boolean; keyword?: string; limit?: number; offset?: number; }): Promise; export declare function recordApplicationTodoInteraction(messageId: string, kind: 'read' | 'click'): Promise; export declare function executeWorkflowTaskCommand(taskId: string, command: WorkflowCommand | string, input: WorkflowCommandInput): Promise; export declare function executeWorkflowInstanceCommand(instanceId: string, command: 'withdraw' | 'terminate', input: WorkflowCommandInput): Promise; /** A read does not consume a token or imply that an unobserved command failed. */ export declare function loadWorkflowTaskCommandReceipt(taskId: string, idempotencyKey: string, tokenDigest?: string): Promise; /** Execute a server-issued Workflow operation without task/instance branching. */ export declare function executeWorkflowOperation(surface: WorkflowSurface, operation: WorkflowSurface['operations'][number], input?: Record, options?: { idempotencyKey?: string; }): Promise; export interface ResourceFormDraftWorkflowScope { workflowCode: string; operationCode: string; } export interface ResourceFormDraft { workflowCode?: string; operationCode?: string; viewCode?: string; id: string; revision: number; mode: 'create' | 'update'; recordId?: string; recordRevision?: number; values: Record; state: Record; stateSchemaVersion?: number; stateSchemaDigest?: string; updatedAt: string; expiresAt: string; } export interface ResourceFormDraftStateSchema extends DataFormDraftStateSchema { schemaVersion: 'openxiangda.form-draft-state-schema/v2'; digest: string; } /** Authenticated drafts use the same current user/environment as Native CRUD. */ export declare function createResourceFormDraftClient(resourceCode: string, mode: 'create' | 'update', recordId?: string, viewCode?: string, workflowScope?: ResourceFormDraftWorkflowScope): { list(): Promise<{ items: ResourceFormDraft[]; limit: number; retentionDays: number; stateSchema?: ResourceFormDraftStateSchema; }>; save(input: { id: string; expectedRevision: number; recordRevision?: number; values: Record; state?: Record; }): Promise; remove(draft: Pick): Promise<{ deleted: boolean; }>; submit(draft: Pick, operations: DataTransactionOperation[]): Promise; }; /** Private drafting for one published named workflow intent; submit through BusinessProcess. */ export declare function createWorkflowFormDraftClient(resourceCode: string, scope: ResourceFormDraftWorkflowScope): { list: () => Promise<{ items: ResourceFormDraft[]; limit: number; retentionDays: number; stateSchema?: ResourceFormDraftStateSchema; }>; save: (input: { id: string; expectedRevision: number; recordRevision?: number; values: Record; state?: Record; }) => Promise; remove: (draft: Pick) => Promise<{ deleted: boolean; }>; }; export declare function loadWorkflowRecordCorrection(resourceCode: string, recordId: string): Promise; export declare function correctWorkflowRecord(surface: WorkflowRecordCorrectionSurface, resourceCode: string, operations: DataTransactionOperation[], idempotencyKey: string): Promise; export declare function loadWorkflowDesignerRead(workflowCode: string): Promise; export declare function saveWorkflowDesignerDraft(workflowCode: string, input: import('openxiangda-contracts/browser').WorkflowDesignerSave): Promise; export declare function previewWorkflowDesignerPublication(workflowCode: string, input: { expectedRevision: number; holds?: import('openxiangda-contracts/browser').WorkflowPublicationHold[]; }): Promise; export declare function publishWorkflowDesigner(workflowCode: string, input: import('openxiangda-contracts/browser').WorkflowDesignerPublish): Promise; export declare function loadWorkflowDesignerPublication(workflowCode: string, publicationId: string): Promise; }>; export declare function listWorkflowDesignerPublications(workflowCode: string): Promise<(import("openxiangda-contracts").WorkflowPublicationReceipt & { reason: string; createdAt: string; })[]>; export declare function controlWorkflowDesignerPublication(workflowCode: string, publicationId: string, input: { expectedHeadRevision: number; operationId: string; action: 'pause' | 'resume' | 'retry_failed' | 'release_holds'; reason: string; instanceIds?: string[]; }): Promise; export declare function restoreWorkflowDesignerVersion(workflowCode: string, input: { version: number; expectedRevision: number; expectedHeadRevision: number; operationId: string; }): Promise; export interface WorkflowDesignerAiProposal { proposalId: string; sourceRevision: number; status: string; summary?: string; error?: string; definition?: import('openxiangda-contracts/browser').WorkflowDefinition; changes?: Array<{ nodeTitle: string; kind: string; fields: string[]; }>; } export declare function requestWorkflowDesignerProposal(workflowCode: string, input: { operationId: string; expectedRevision: number; prompt: string; }): Promise; export declare function loadWorkflowDesignerProposal(workflowCode: string, proposalId: string): Promise; export declare function applyWorkflowDesignerProposal(workflowCode: string, proposalId: string, input: { operationId: string; }): Promise; export declare function cancelWorkflowDesignerProposal(workflowCode: string, proposalId: string): Promise<{ cancelled: true; }>; export declare function searchWorkflowDesignerHoldCandidates(workflowCode: string, keyword?: string): Promise<{ instanceId: string; businessKey: string; nodeTitle: string; fromVersion: number; }[]>; /** Legacy convenience only returns an actual draft; no invented revision for read-only callers. */ export declare function loadWorkflowDesignerDraft(workflowCode: string): Promise; export declare function loadWorkflowDesignerOriginalOutcome(workflowCode: string, operationId: string): Promise; //# sourceMappingURL=platform-client.d.ts.map