@kevisual/oss 0.0.16 → 0.0.18

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/src/core/type.ts DELETED
@@ -1,87 +0,0 @@
1
- import { ItemBucketMetadata, Client } from 'minio';
2
- export type UploadedObjectInfo = {
3
- etag: string;
4
- lastModified?: Date;
5
- size?: number;
6
- versionId: string;
7
- metadata?: ItemBucketMetadata;
8
- };
9
- export type StatObjectResult = {
10
- size: number;
11
- etag: string;
12
- lastModified: Date;
13
- metaData: ItemBucketMetadata;
14
- versionId?: string | null;
15
- };
16
- export type ListFileObject = {
17
- name: string;
18
- size: number;
19
- lastModified: Date;
20
- etag: string;
21
- };
22
- export type ListDirectoryObject = {
23
- prefix: string;
24
- size: number;
25
- };
26
- export type ListObjectResult = ListFileObject | ListDirectoryObject;
27
- export interface OssBaseOperation {
28
- prefix: string;
29
- setPrefix(prefix: string): void;
30
- /**
31
- * 获取对象
32
- * @param objectName 对象名
33
- */
34
- getObject(objectName: string): Promise<any>;
35
- /**
36
- * 上传对象
37
- * @param objectName 对象名
38
- * @param data 数据
39
- */
40
- putObject(objectName: string, data: Buffer | string, metaData?: ItemBucketMetadata): Promise<UploadedObjectInfo>;
41
- /**
42
- * 上传文件
43
- * @param objectName 对象名
44
- * @param filePath 文件路径
45
- */
46
- fPutObject(objectName: string, filePath: string, metaData?: ItemBucketMetadata): Promise<UploadedObjectInfo>;
47
- /**
48
- * 获取对象信息
49
- * @param objectName 对象名
50
- */
51
- statObject(objectName: string): Promise<StatObjectResult>;
52
- /**
53
- * 删除对象
54
- * @param objectName 对象名
55
- */
56
- deleteObject(objectName: string): Promise<any>;
57
- /**
58
- * 列出对象
59
- * @param objectName 对象名
60
- * @param opts 选项
61
- * @param opts.recursive 是否递归
62
- * @param opts.startAfter 开始位置
63
- */
64
- listObjects(
65
- objectName: string,
66
- opts?: {
67
- /**
68
- * 是否递归
69
- */
70
- recursive?: boolean;
71
- /**
72
- * 开始位置
73
- */
74
- startAfter?: string;
75
- },
76
- ): Promise<ListObjectResult[]>;
77
- /**
78
- * 复制对象
79
- * @param sourceObject 源对象
80
- * @param targetObject 目标对象
81
- */
82
- copyObject: Client['copyObject'];
83
- }
84
-
85
- export interface OssService extends OssBaseOperation {
86
- owner: string;
87
- }