/** * 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. */ type RequestNameValue = { name: string; value: unknown; }; export type CustomRequestRecord = { options?: Record; roles?: unknown[]; }; export type CustomRequestConfigParams = { key?: string; method?: string; url?: string; headers?: Array<{ name?: string; value?: string; }>; params?: Array<{ name?: string; value?: string; }>; data?: unknown; timeout?: number; responseType?: 'json' | 'stream'; variablePaths?: string[]; roles?: string[]; }; export type ExecuteCustomRequestOptions = { throwOnError?: boolean; }; export declare function makeRequestKey(): string; export declare function normalizeNameValueArray(arr: any): RequestNameValue[]; export declare const DEFAULT_CUSTOM_REQUEST_SETTINGS: CustomRequestConfigParams; export declare const normalizeRoleNames: (roles: unknown) => string[]; export declare const normalizeBodyData: (input: unknown) => any; export declare const toCustomRequestConfigurationInitialValues: (record?: CustomRequestRecord) => { [x: string]: any; }; export declare const loadCustomRequestRecord: (ctx: any, key?: string) => Promise; export declare const getDownloadFilename: (contentDisposition: string) => string | undefined; export declare const buildCustomRequestOptions: (ctx: any, params: CustomRequestConfigParams) => { method: string; url: string; headers: RequestNameValue[]; params: RequestNameValue[]; data: any; timeout: number; responseType: "json" | "stream"; }; export declare const saveCustomRequestConfig: (ctx: any, key: string, params: CustomRequestConfigParams) => Promise; export declare const handleCustomRequestStreamResponse: (response: any) => { filename: string; data: any; }; export declare const walkAndCollectVariablePaths: (input: unknown, output: Set) => void; export declare const extractVariablePaths: (params: any) => string[]; export declare const resolveCustomRequestVars: (ctx: any, variablePaths?: string[]) => Promise>; export declare const buildCustomRequestSendData: (ctx: any, variablePaths?: string[]) => Promise<{ vars: Record; }>; export declare const executeCustomRequest: (ctx: any, params?: CustomRequestConfigParams, options?: ExecuteCustomRequestOptions) => Promise; export {};