/// import type { LogLevelEnum } from './loggerTypes'; import type { IObjectStorage } from '../core/storage/objectStorage'; import type { Readable as ReadableStream } from 'stream'; export interface ObjectMetadata { [key: string]: any; } export declare type ObjectItem = { name: string; lastModified: string; }; export declare type ObjectData = string | Buffer | ReadableStream; export declare enum StorageType { OSS = "oss", SUANPAN = "suanpan", MINIO = "minio" } export interface StoragePathOptions { userId?: string; appId?: string; nodeId?: string; componentId?: string; } export declare type StsToken = { Credentials: { AccessKeyId: string; AccessKeySecret: string; SecurityToken: string; Expiration?: string; }; bucket: string; region: string; }; export interface OSSConfig { bucket: string; accessKey: string; accessSecret: string; } export interface MinioConfig extends OSSConfig { host: string; port: number; useSSL: boolean; } export interface AliOSSConfig extends OSSConfig { endpoint: string; securityToken?: string; } export declare type StorageConfig = MinioConfig | AliOSSConfig; export interface IStorageConfig { type: 'oss' | 'minio'; config: StorageConfig; } export interface FlushOptions { /** * 最大条目书,等于 maxItems 时触发 flush。默认值为 1 */ maxItems?: number; /** * flush 间隔,单位 ms */ flushInterval?: number; } export interface StorageLoggerOptions extends FlushOptions { /** * 可选。默认 false,不开启 */ console?: boolean; /** * 可选。默认 LogLevelEnum.DEBUG */ level?: LogLevelEnum; /** * 可选。默认 IObjectStorage 的连接信息来自算盘环境 */ storage?: IObjectStorage; /** * TODO: unsupport */ maxClearLength?: number; context: { userId: string; appId: string; nodeId: string; }; }