///
///
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