/// /// import { Criterion, CriterionV3 } from '../kunlun/operator/impl/logic'; import { Stream } from 'stream'; import { ExecutionInfo, ExecutionResult, RevokeExecutionOptions } from '@byted-apaas/server-common-node/context/workflow/workflow'; import { AppCtx } from '../application/application'; import { Order } from '../context/db/impl/order'; import { IApprovalInstance, IApprovalInstanceList, IApprovalInstanceListOptions, IGetApprovalInstanceOptions } from "./structs"; export declare function GetHttpInstance(): IInnerAPIRequest; export declare function GetInstance(): IInnerAPIRequest; export declare function GetFaaSInfraInstance(): IFaaSInfraRequest; export type UploadFileResp = { id: string; token: string; size: bigint; mime_type: string; name: string; }; export type OrderV2 = { field: string; direction: string; type: string; }; export type OpenSDKGetRecordsReq = { limit: number; offset: number; fields: string[]; quickSearch?: string; filter: any[]; sort: OrderV2[]; count: boolean; }; export type AppAccessToken = { expire: number; appAccessToken: string; appId: string; }; export type TenantAccessToken = { expire: number; tenantAccessToken: string; appId: string; }; export interface IInnerAPIRequest extends IInnerAPIBaseRequest, IInnerAPIOpenSDKRequest { } export interface IInnerAPIBaseRequest { createRecordBySync: (objectApiName: string, record: object, authType: string) => any; createRecordBySyncV3: (objectApiName: string, record: object, authType: string) => any; updateRecordBySync: (objectApiName: string, recordID: number, record: object, authType: string) => any; updateRecordBySyncV3: (objectApiName: string, recordID: string, record: object, authType: string) => any; deleteRecordBySync: (objectApiName: string, recordID: number, authType: string) => any; deleteRecordBySyncV3: (objectApiName: string, recordID: string, authType: string) => any; createRecordsByAsync: (objectApiName: string, records: object[], authType: string) => any; updateRecordsByAsync: (objectApiName: string, recordMap: Record, authType: string) => any; deleteRecordsByAsync: (objectApiName: string, recordIDs: number[], authType: string) => any; createRecordsBySync: (objectApiName: string, records: object[], authType: string) => any; createRecordsBySyncV3: (objectApiName: string, records: object[], authType: string) => any; updateRecordsBySync: (objectApiName: string, recordMap: Record, authType: string) => Promise>; updateRecordsBySyncV3: (objectApiName: string, recordMap: object[], authType: string) => Promise>; deleteRecordsBySync: (objectApiName: string, recordIDs: number[], authType: string) => Promise>; deleteRecordsBySyncV3: (objectApiName: string, recordIDs: string[], authType: string) => Promise>; getRecordsOrCountByCriterion: (objectApiName: string, criterion: string | Criterion, fuzzySearch: any, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string) => any; getRecordsV3OrCounByCriterion: (objectApiName: string, criterion: string | CriterionV3, quickQuery: string, quickQueryFields: string[], order: Order[], fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string) => any; updateWorkflowVariables: (ctx: any, instanceId: number, variables: object, variableTypes: object) => Promise; uploadFile: (data: Stream, expire: number, fileName?: string) => Promise; downloadFileByID: (fileID: string, filePath?: string) => Promise; downloadFileByToken: (fileToken: string, filePath?: string) => Promise; createMessage: (msg: any) => Promise; updateMessage: (msgId: number, msg: any) => Promise; getFields: (objectApiName: string) => Promise; getField: (objectApiName: string, fieldApiName: string) => Promise; terminateWorkflowInstance: (workflowInstanceId: number, operator: number, reason: string) => Promise; modifyRecordsWithTransaction: (placeholders: Record, operations: object[], authType: string, version: string) => Promise>; getGlobalConfigByKey: (key: string) => Promise; oql: (oql: string, args: any[], namedArgs: Record, authType: string) => Promise; invokeFuncSync: (idOrName: { APIId?: string; APIName?: string; isInvokeByAPIName: boolean; }, params: any) => Promise; createAsyncTaskV1: (idOrName: { APIId?: string; APIName?: string; isInvokeByAPIName: boolean; }, params: any) => Promise; createAsyncTaskV2: (name: string, params: any) => Promise; getExecutionUserTaskInfo: (executionId: bigint) => Promise; executeFlow: (APIName: string, options: any, async: any) => Promise; revokeExecution: (executionId: number, revokeOptions: RevokeExecutionOptions) => Promise; getExecutionInfo: (executionId: number) => Promise; getTenantInfo: (appCtx: AppCtx) => Promise; mGetFileToken: (ids: string[]) => Promise; getIntegrationAppAccessToken: (apiName: string) => Promise; getIntegrationTenantAccessToken: (apiName: string) => Promise; getDefaultIntegrationAppAccessToken: () => Promise; getDefaultIntegrationTenantAccessToken: () => Promise; getApprovalInstanceList: (options?: IApprovalInstanceListOptions) => Promise; getApprovalInstance: (options: IGetApprovalInstanceOptions) => Promise; } export interface IInnerAPIOpenSDKRequest { openSDKCreateRecordBySync: (objectApiName: string, record: object) => any; openSDKUpdateRecordBySync: (objectApiName: string, recordID: number, record: object) => any; openSDKDeleteRecordBySync: (objectApiName: string, recordID: number) => any; openSDKCreateRecordsBySync: (objectApiName: string, records: object[]) => any; openSDKUpdateRecordsBySync: (objectApiName: string, recordMap: Record) => any; openSDKDeleteRecordsBySync: (objectApiName: string, recordIDs: number[]) => any; openSDKGetRecords: (objectApiName: string, param: OpenSDKGetRecordsReq) => any; openSDKUploadFile: (fileName: string, data: Buffer) => any; openSDKUploadAvatar: (fileName: string, data: Buffer) => any; openSDKDownloadAvatar: (imageID: string) => any; invokeFuncWithAuth: (idOrName: { APIId?: string; APIName?: string; isInvokeByAPIName: boolean; }, params: any) => Promise; } export interface IFaaSInfraRequest { createDistributeTaskV1: (dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any) => Promise; createDistributeTaskV2: (dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any) => Promise; invokeMicroserviceSync: (apiName: string, path: string, method: string, body: any) => Promise; invokeMicroserviceAsync: (apiName: string, path: string, method: string, body: any) => Promise; }