@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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -2049
- package/dist/services/config.d.ts +1 -1
- package/dist/services/config.js +36 -2049
- package/dist/services/index.d.ts +20 -2
- package/dist/services/index.js +38 -2049
- package/package.json +11 -12
- package/src/core/copy-object.ts +26 -0
- package/src/core/type.ts +87 -0
- package/src/index.ts +244 -0
- package/src/s3/copy-object.ts +46 -0
- package/src/s3/core.ts +425 -0
- package/src/s3/type.ts +157 -0
- package/src/services/config.ts +67 -0
- package/src/services/index.ts +9 -0
- package/src/test/common.ts +103 -0
- package/src/test/config-admin.ts +84 -0
- package/src/test/test-s3.ts +23 -0
- package/src/util/download.ts +73 -0
- package/src/util/extract-standard-headers.ts +44 -0
- package/src/util/get-content-type.ts +49 -0
- package/src/util/hash.ts +26 -0
- package/src/util/index.ts +5 -0
package/dist/services/index.d.ts
CHANGED
|
@@ -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 {};
|