/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import _ from 'lodash'; import type FlowModelRepository from '../../repository'; type FlowSurfaceApprovalBlueprintBindingResource = 'workflows' | 'flow_nodes'; type ApprovalBlueprintServiceDeps = { contractGuard: { validateNodeTreeAgainstContract: (node: Record) => void; }; db: { getRepository: (resourceName: string) => { findOne: (options: Record) => Promise; update: (options: Record) => Promise; }; }; hasDataSource: (dataSourceKey: string) => boolean; repository: Pick; setNodeAsyncFlag: (uid: string, asyncFlag: boolean, transaction?: any) => Promise; removeNodeTreeWithBindings: (uid: string, transaction?: any) => Promise; surfaceContext: { resolveGridNode: (uid: string, transaction?: any) => Promise; }; compose: (values: Record, options: { transaction?: any; }) => Promise; addField: (values: Record, options: { transaction?: any; }) => Promise; setLayout: (values: Record, options: { transaction?: any; }) => Promise; get: (values: Record, options: { transaction?: any; }) => Promise; buildComposeLayoutPayload: (input: { layout: any; createdByKey: Record; finalItems: any[]; }) => Record; syncApprovalRuntimeConfigForSurfaceRoot: (root: any, transaction?: any) => Promise; }; export declare class FlowSurfaceApprovalBlueprintService { private readonly deps; constructor(deps: ApprovalBlueprintServiceDeps); private parseApprovalBlueprintCollection; private resolveApprovalBlueprintBindingContext; private buildApprovalBlueprintSurfaceRootTree; private buildApprovalBlueprintPageSurfaceRootTree; private getApprovalBlueprintExpectedTabUse; private getApprovalBlueprintExpectedGridUse; private findApprovalBlueprintSurfaceRoot; private createApprovalBlueprintSurfaceRoot; private ensureApprovalBlueprintPageSurfaceStructure; private ensureApprovalBlueprintTaskCardSurfaceStructure; private syncApprovalBlueprintSurfaceAsyncShape; private syncApprovalBlueprintSurfaceRoot; private ensureApprovalBlueprintSurfaceRoot; private persistApprovalBlueprintBinding; private applyApprovalBlueprintPageSurface; private applyApprovalBlueprintTaskCardSurface; applyApprovalBlueprint(values: Record, options?: { transaction?: any; }): Promise<{ version: string; mode: "replace"; surfaceType: "initiator" | "approver" | "taskCard"; target: _.Dictionary; binding: { resourceName: FlowSurfaceApprovalBlueprintBindingResource; filterByTk: string | number; configPath: string; }; surface: any; }>; } export {};