@kevisual/oss 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -111,7 +111,7 @@ export declare class OssBase implements OssBaseOperation {
111
111
  hash: (str: string | Buffer | Object) => string;
112
112
  constructor(opts: OssBaseOptions);
113
113
  setPrefix(prefix: string): void;
114
- getObject(objectName: string): Promise<import("stream").Readable>;
114
+ getObject(objectName: string): Promise<import("node:stream").Readable>;
115
115
  getJson(objectName: string): Promise<Record<string, any>>;
116
116
  /**
117
117
  * 上传文件, 当是流的时候,中断之后的etag会变,所以传递的时候不要嵌套async await,例如 busboy 监听文件流内部的时候,不要用check
@@ -204,7 +204,7 @@ export declare const NotFoundFile: (res: ServerResponse, msg?: string, code?: nu
204
204
  export declare const sendObject: ({ res, objectName, client, isDownload }: SendObjectOptions) => Promise<void>;
205
205
  export declare const downloadObject: ({ objectName, client, filePath }: Pick<SendObjectOptions, "objectName" | "client"> & {
206
206
  filePath: string;
207
- }) => Promise<import("stream").Readable>;
207
+ }) => Promise<import("node:stream").Readable>;
208
208
  /**
209
209
  * 计算字符串的md5值
210
210
  * @param str
@@ -213,5 +213,23 @@ export declare const downloadObject: ({ objectName, client, filePath }: Pick<Sen
213
213
  export declare const hash: (str: string | Buffer | Object) => string;
214
214
  export declare const hashSringify: (str: Object) => string;
215
215
  export declare const getContentType: (filePath: string) => any;
216
+ export declare const standardHeaderKeys: string[];
217
+ export type StandardHeaders = {
218
+ ContentType?: string;
219
+ CacheControl?: string;
220
+ ContentDisposition?: string;
221
+ ContentEncoding?: string;
222
+ ContentLanguage?: string;
223
+ Expires?: Date;
224
+ };
225
+ /**
226
+ * 从元数据中提取标准头部和自定义元数据
227
+ * @param metaData 原始元数据
228
+ * @returns 标准头部和自定义元数据
229
+ */
230
+ export declare function extractStandardHeaders(metaData: Record<string, string>): {
231
+ standardHeaders: StandardHeaders;
232
+ customMetadata: Record<string, string>;
233
+ };
216
234
 
217
235
  export {};