@bedelightful/upload-sdk 0.0.7

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.
Files changed (239) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +132 -0
  3. package/dist/es/Exception/BaseException.js +14 -0
  4. package/dist/es/Exception/BaseException.js.map +1 -0
  5. package/dist/es/Exception/DownloadException.js +40 -0
  6. package/dist/es/Exception/DownloadException.js.map +1 -0
  7. package/dist/es/Exception/HttpException.js +50 -0
  8. package/dist/es/Exception/HttpException.js.map +1 -0
  9. package/dist/es/Exception/InitException.js +49 -0
  10. package/dist/es/Exception/InitException.js.map +1 -0
  11. package/dist/es/Exception/UploadException.js +50 -0
  12. package/dist/es/Exception/UploadException.js.map +1 -0
  13. package/dist/es/index.d.ts +867 -0
  14. package/dist/es/index.js +162 -0
  15. package/dist/es/index.js.map +1 -0
  16. package/dist/es/modules/Kodo/defaultUpload.js +38 -0
  17. package/dist/es/modules/Kodo/defaultUpload.js.map +1 -0
  18. package/dist/es/modules/Kodo/index.js +8 -0
  19. package/dist/es/modules/Kodo/index.js.map +1 -0
  20. package/dist/es/modules/Local/index.js +31 -0
  21. package/dist/es/modules/Local/index.js.map +1 -0
  22. package/dist/es/modules/MinIO/MultipartUpload.js +335 -0
  23. package/dist/es/modules/MinIO/MultipartUpload.js.map +1 -0
  24. package/dist/es/modules/MinIO/STSUpload.js +10 -0
  25. package/dist/es/modules/MinIO/STSUpload.js.map +1 -0
  26. package/dist/es/modules/MinIO/defaultUpload.js +124 -0
  27. package/dist/es/modules/MinIO/defaultUpload.js.map +1 -0
  28. package/dist/es/modules/MinIO/index.js +16 -0
  29. package/dist/es/modules/MinIO/index.js.map +1 -0
  30. package/dist/es/modules/OBS/MultipartUpload.js +269 -0
  31. package/dist/es/modules/OBS/MultipartUpload.js.map +1 -0
  32. package/dist/es/modules/OBS/STSUpload.js +71 -0
  33. package/dist/es/modules/OBS/STSUpload.js.map +1 -0
  34. package/dist/es/modules/OBS/defaultUpload.js +59 -0
  35. package/dist/es/modules/OBS/defaultUpload.js.map +1 -0
  36. package/dist/es/modules/OBS/index.js +16 -0
  37. package/dist/es/modules/OBS/index.js.map +1 -0
  38. package/dist/es/modules/OBS/utils/index.js +25 -0
  39. package/dist/es/modules/OBS/utils/index.js.map +1 -0
  40. package/dist/es/modules/OSS/MultipartUpload.js +232 -0
  41. package/dist/es/modules/OSS/MultipartUpload.js.map +1 -0
  42. package/dist/es/modules/OSS/STSUpload.js +48 -0
  43. package/dist/es/modules/OSS/STSUpload.js.map +1 -0
  44. package/dist/es/modules/OSS/defaultUpload.js +53 -0
  45. package/dist/es/modules/OSS/defaultUpload.js.map +1 -0
  46. package/dist/es/modules/OSS/index.js +16 -0
  47. package/dist/es/modules/OSS/index.js.map +1 -0
  48. package/dist/es/modules/OSS/utils/helper.js +137 -0
  49. package/dist/es/modules/OSS/utils/helper.js.map +1 -0
  50. package/dist/es/modules/OSS/utils/signature.js +96 -0
  51. package/dist/es/modules/OSS/utils/signature.js.map +1 -0
  52. package/dist/es/modules/TOS/MultipartUpload.js +288 -0
  53. package/dist/es/modules/TOS/MultipartUpload.js.map +1 -0
  54. package/dist/es/modules/TOS/STSUpload.js +92 -0
  55. package/dist/es/modules/TOS/STSUpload.js.map +1 -0
  56. package/dist/es/modules/TOS/defaultUpload.js +65 -0
  57. package/dist/es/modules/TOS/defaultUpload.js.map +1 -0
  58. package/dist/es/modules/TOS/index.js +16 -0
  59. package/dist/es/modules/TOS/index.js.map +1 -0
  60. package/dist/es/modules/TOS/utils/TosClientError.js +15 -0
  61. package/dist/es/modules/TOS/utils/TosClientError.js.map +1 -0
  62. package/dist/es/modules/TOS/utils/index.js +38 -0
  63. package/dist/es/modules/TOS/utils/index.js.map +1 -0
  64. package/dist/es/modules/TOS/utils/signatureV4.js +269 -0
  65. package/dist/es/modules/TOS/utils/signatureV4.js.map +1 -0
  66. package/dist/es/modules/TOS/utils/signatureV4Credentials.js +21 -0
  67. package/dist/es/modules/TOS/utils/signatureV4Credentials.js.map +1 -0
  68. package/dist/es/modules/TOS/utils/universal/crypto.browser.js +56 -0
  69. package/dist/es/modules/TOS/utils/universal/crypto.browser.js.map +1 -0
  70. package/dist/es/modules/TOS/utils/utils.js +18 -0
  71. package/dist/es/modules/TOS/utils/utils.js.map +1 -0
  72. package/dist/es/modules/index.js +20 -0
  73. package/dist/es/modules/index.js.map +1 -0
  74. package/dist/es/types/Kodo.js +1 -0
  75. package/dist/es/types/Kodo.js.map +1 -0
  76. package/dist/es/types/Local.js +1 -0
  77. package/dist/es/types/Local.js.map +1 -0
  78. package/dist/es/types/MinIO.js +1 -0
  79. package/dist/es/types/MinIO.js.map +1 -0
  80. package/dist/es/types/OBS.js +8 -0
  81. package/dist/es/types/OBS.js.map +1 -0
  82. package/dist/es/types/OSS.js +1 -0
  83. package/dist/es/types/OSS.js.map +1 -0
  84. package/dist/es/types/TOS.js +1 -0
  85. package/dist/es/types/TOS.js.map +1 -0
  86. package/dist/es/types/error.js +1 -0
  87. package/dist/es/types/error.js.map +1 -0
  88. package/dist/es/types/index.js +13 -0
  89. package/dist/es/types/index.js.map +1 -0
  90. package/dist/es/types/log.js +1 -0
  91. package/dist/es/types/log.js.map +1 -0
  92. package/dist/es/types/request.js +1 -0
  93. package/dist/es/types/request.js.map +1 -0
  94. package/dist/es/utils/EventEmitter.js +32 -0
  95. package/dist/es/utils/EventEmitter.js.map +1 -0
  96. package/dist/es/utils/UploadManger.js +276 -0
  97. package/dist/es/utils/UploadManger.js.map +1 -0
  98. package/dist/es/utils/UploadTask.js +13 -0
  99. package/dist/es/utils/UploadTask.js.map +1 -0
  100. package/dist/es/utils/checkDataFormat.js +41 -0
  101. package/dist/es/utils/checkDataFormat.js.map +1 -0
  102. package/dist/es/utils/global.js +83 -0
  103. package/dist/es/utils/global.js.map +1 -0
  104. package/dist/es/utils/index.js +20 -0
  105. package/dist/es/utils/index.js.map +1 -0
  106. package/dist/es/utils/logPubSub.js +59 -0
  107. package/dist/es/utils/logPubSub.js.map +1 -0
  108. package/dist/es/utils/multipart.js +159 -0
  109. package/dist/es/utils/multipart.js.map +1 -0
  110. package/dist/es/utils/nanoid.js +10 -0
  111. package/dist/es/utils/nanoid.js.map +1 -0
  112. package/dist/es/utils/regExpUtil.js +21 -0
  113. package/dist/es/utils/regExpUtil.js.map +1 -0
  114. package/dist/es/utils/request.js +234 -0
  115. package/dist/es/utils/request.js.map +1 -0
  116. package/dist/es/utils/response.js +20 -0
  117. package/dist/es/utils/response.js.map +1 -0
  118. package/dist/index.d.ts +867 -0
  119. package/dist/index.js +60913 -0
  120. package/dist/index.js.map +1 -0
  121. package/dist/index.min.js +130 -0
  122. package/dist/index.min.js.map +1 -0
  123. package/dist/lib/Exception/BaseException.js +37 -0
  124. package/dist/lib/Exception/BaseException.js.map +1 -0
  125. package/dist/lib/Exception/DownloadException.js +65 -0
  126. package/dist/lib/Exception/DownloadException.js.map +1 -0
  127. package/dist/lib/Exception/HttpException.js +75 -0
  128. package/dist/lib/Exception/HttpException.js.map +1 -0
  129. package/dist/lib/Exception/InitException.js +73 -0
  130. package/dist/lib/Exception/InitException.js.map +1 -0
  131. package/dist/lib/Exception/UploadException.js +75 -0
  132. package/dist/lib/Exception/UploadException.js.map +1 -0
  133. package/dist/lib/index.d.cts +867 -0
  134. package/dist/lib/index.js +203 -0
  135. package/dist/lib/index.js.map +1 -0
  136. package/dist/lib/modules/Kodo/defaultUpload.js +61 -0
  137. package/dist/lib/modules/Kodo/defaultUpload.js.map +1 -0
  138. package/dist/lib/modules/Kodo/index.js +28 -0
  139. package/dist/lib/modules/Kodo/index.js.map +1 -0
  140. package/dist/lib/modules/Local/index.js +50 -0
  141. package/dist/lib/modules/Local/index.js.map +1 -0
  142. package/dist/lib/modules/MinIO/MultipartUpload.js +357 -0
  143. package/dist/lib/modules/MinIO/MultipartUpload.js.map +1 -0
  144. package/dist/lib/modules/MinIO/STSUpload.js +33 -0
  145. package/dist/lib/modules/MinIO/STSUpload.js.map +1 -0
  146. package/dist/lib/modules/MinIO/defaultUpload.js +158 -0
  147. package/dist/lib/modules/MinIO/defaultUpload.js.map +1 -0
  148. package/dist/lib/modules/MinIO/index.js +35 -0
  149. package/dist/lib/modules/MinIO/index.js.map +1 -0
  150. package/dist/lib/modules/OBS/MultipartUpload.js +296 -0
  151. package/dist/lib/modules/OBS/MultipartUpload.js.map +1 -0
  152. package/dist/lib/modules/OBS/STSUpload.js +104 -0
  153. package/dist/lib/modules/OBS/STSUpload.js.map +1 -0
  154. package/dist/lib/modules/OBS/defaultUpload.js +88 -0
  155. package/dist/lib/modules/OBS/defaultUpload.js.map +1 -0
  156. package/dist/lib/modules/OBS/index.js +45 -0
  157. package/dist/lib/modules/OBS/index.js.map +1 -0
  158. package/dist/lib/modules/OBS/utils/index.js +49 -0
  159. package/dist/lib/modules/OBS/utils/index.js.map +1 -0
  160. package/dist/lib/modules/OSS/MultipartUpload.js +259 -0
  161. package/dist/lib/modules/OSS/MultipartUpload.js.map +1 -0
  162. package/dist/lib/modules/OSS/STSUpload.js +71 -0
  163. package/dist/lib/modules/OSS/STSUpload.js.map +1 -0
  164. package/dist/lib/modules/OSS/defaultUpload.js +76 -0
  165. package/dist/lib/modules/OSS/defaultUpload.js.map +1 -0
  166. package/dist/lib/modules/OSS/index.js +35 -0
  167. package/dist/lib/modules/OSS/index.js.map +1 -0
  168. package/dist/lib/modules/OSS/utils/helper.js +173 -0
  169. package/dist/lib/modules/OSS/utils/helper.js.map +1 -0
  170. package/dist/lib/modules/OSS/utils/signature.js +132 -0
  171. package/dist/lib/modules/OSS/utils/signature.js.map +1 -0
  172. package/dist/lib/modules/TOS/MultipartUpload.js +315 -0
  173. package/dist/lib/modules/TOS/MultipartUpload.js.map +1 -0
  174. package/dist/lib/modules/TOS/STSUpload.js +125 -0
  175. package/dist/lib/modules/TOS/STSUpload.js.map +1 -0
  176. package/dist/lib/modules/TOS/defaultUpload.js +94 -0
  177. package/dist/lib/modules/TOS/defaultUpload.js.map +1 -0
  178. package/dist/lib/modules/TOS/index.js +45 -0
  179. package/dist/lib/modules/TOS/index.js.map +1 -0
  180. package/dist/lib/modules/TOS/utils/TosClientError.js +34 -0
  181. package/dist/lib/modules/TOS/utils/TosClientError.js.map +1 -0
  182. package/dist/lib/modules/TOS/utils/index.js +64 -0
  183. package/dist/lib/modules/TOS/utils/index.js.map +1 -0
  184. package/dist/lib/modules/TOS/utils/signatureV4.js +294 -0
  185. package/dist/lib/modules/TOS/utils/signatureV4.js.map +1 -0
  186. package/dist/lib/modules/TOS/utils/signatureV4Credentials.js +44 -0
  187. package/dist/lib/modules/TOS/utils/signatureV4Credentials.js.map +1 -0
  188. package/dist/lib/modules/TOS/utils/universal/crypto.browser.js +93 -0
  189. package/dist/lib/modules/TOS/utils/universal/crypto.browser.js.map +1 -0
  190. package/dist/lib/modules/TOS/utils/utils.js +42 -0
  191. package/dist/lib/modules/TOS/utils/utils.js.map +1 -0
  192. package/dist/lib/modules/index.js +50 -0
  193. package/dist/lib/modules/index.js.map +1 -0
  194. package/dist/lib/types/Kodo.js +17 -0
  195. package/dist/lib/types/Kodo.js.map +1 -0
  196. package/dist/lib/types/Local.js +17 -0
  197. package/dist/lib/types/Local.js.map +1 -0
  198. package/dist/lib/types/MinIO.js +17 -0
  199. package/dist/lib/types/MinIO.js.map +1 -0
  200. package/dist/lib/types/OBS.js +32 -0
  201. package/dist/lib/types/OBS.js.map +1 -0
  202. package/dist/lib/types/OSS.js +17 -0
  203. package/dist/lib/types/OSS.js.map +1 -0
  204. package/dist/lib/types/TOS.js +17 -0
  205. package/dist/lib/types/TOS.js.map +1 -0
  206. package/dist/lib/types/error.js +17 -0
  207. package/dist/lib/types/error.js.map +1 -0
  208. package/dist/lib/types/index.js +37 -0
  209. package/dist/lib/types/index.js.map +1 -0
  210. package/dist/lib/types/log.js +17 -0
  211. package/dist/lib/types/log.js.map +1 -0
  212. package/dist/lib/types/request.js +17 -0
  213. package/dist/lib/types/request.js.map +1 -0
  214. package/dist/lib/utils/EventEmitter.js +51 -0
  215. package/dist/lib/utils/EventEmitter.js.map +1 -0
  216. package/dist/lib/utils/UploadManger.js +309 -0
  217. package/dist/lib/utils/UploadManger.js.map +1 -0
  218. package/dist/lib/utils/UploadTask.js +32 -0
  219. package/dist/lib/utils/UploadTask.js.map +1 -0
  220. package/dist/lib/utils/checkDataFormat.js +70 -0
  221. package/dist/lib/utils/checkDataFormat.js.map +1 -0
  222. package/dist/lib/utils/global.js +106 -0
  223. package/dist/lib/utils/global.js.map +1 -0
  224. package/dist/lib/utils/index.js +44 -0
  225. package/dist/lib/utils/index.js.map +1 -0
  226. package/dist/lib/utils/logPubSub.js +78 -0
  227. package/dist/lib/utils/logPubSub.js.map +1 -0
  228. package/dist/lib/utils/multipart.js +197 -0
  229. package/dist/lib/utils/multipart.js.map +1 -0
  230. package/dist/lib/utils/nanoid.js +33 -0
  231. package/dist/lib/utils/nanoid.js.map +1 -0
  232. package/dist/lib/utils/regExpUtil.js +44 -0
  233. package/dist/lib/utils/regExpUtil.js.map +1 -0
  234. package/dist/lib/utils/request.js +264 -0
  235. package/dist/lib/utils/request.js.map +1 -0
  236. package/dist/lib/utils/response.js +43 -0
  237. package/dist/lib/utils/response.js.map +1 -0
  238. package/dist/package.json +120 -0
  239. package/package.json +120 -0
@@ -0,0 +1,867 @@
1
+ /**
2
+ * Error type namespace
3
+ * */
4
+ declare namespace ErrorType {
5
+ interface BaseException {
6
+ /** Error message */
7
+ message: string;
8
+ }
9
+ interface BaseExceptionWithStatus extends BaseException {
10
+ /** Error code */
11
+ status: number;
12
+ }
13
+ interface UploadError extends Error {
14
+ status?: number;
15
+ }
16
+ interface UploadPartException extends BaseExceptionWithStatus {
17
+ name: string;
18
+ stack: string;
19
+ partNum: number;
20
+ }
21
+ }
22
+
23
+ type Method = "get" | "GET" | "post" | "POST" | "delete" | "DELETE" | "head" | "HEAD" | "options" | "OPTIONS" | "put" | "PUT" | "patch" | "PATCH";
24
+ interface Result<T> {
25
+ code?: number;
26
+ data: T;
27
+ message?: string;
28
+ headers: Record<string, string>;
29
+ }
30
+ interface DataWrapperWithHeaders<T> {
31
+ data: T;
32
+ headers: Record<string, string>;
33
+ }
34
+
35
+ /**
36
+ * Aliyun Object Storage
37
+ */
38
+ declare namespace OSS {
39
+ export interface Option {
40
+ /** access secret you create */
41
+ accessKeyId: string;
42
+ /** access secret you create */
43
+ accessKeySecret: string;
44
+ /** used by temporary authorization */
45
+ stsToken?: string | undefined;
46
+ /** the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. */
47
+ bucket?: string | undefined;
48
+ /** oss region domain. It takes priority over region. */
49
+ endpoint?: string | undefined;
50
+ /** the bucket data region location, please see Data Regions, default is oss-cn-hangzhou. */
51
+ region?: string | undefined;
52
+ /** access OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set true to save lot of money. */
53
+ internal?: boolean | undefined;
54
+ /** instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol. */
55
+ secure?: boolean | undefined;
56
+ /** instance level timeout for all operations, default is 60s */
57
+ timeout?: string | number | undefined;
58
+ /** use custom domain name */
59
+ cname?: boolean | undefined;
60
+ /** use time (ms) of refresh STSToken interval it should be less than sts info expire interval, default is 300000ms(5min) when sts info expires. */
61
+ refreshSTSTokenInterval?: number;
62
+ /** used by auto set stsToken、accessKeyId、accessKeySecret when sts info expires. return value must be object contains stsToken、accessKeyId、accessKeySecret */
63
+ refreshSTSToken?: () => Promise<{
64
+ accessKeyId: string;
65
+ accessKeySecret: string;
66
+ stsToken: string;
67
+ }>;
68
+ }
69
+ export interface Headers {
70
+ [propName: string]: any;
71
+ "x-oss-date": string;
72
+ "x-oss-user-agent"?: string;
73
+ }
74
+ /** Credential fields returned by backend for Aliyun */
75
+ export interface AuthParams {
76
+ policy: string;
77
+ accessid: string;
78
+ signature: string;
79
+ host: string;
80
+ dir: string;
81
+ callback: string;
82
+ }
83
+ /** Credential fields returned by backend when STS is enabled */
84
+ export interface STSAuthParams {
85
+ region: string;
86
+ bucket: string;
87
+ dir: string;
88
+ access_key_secret: string;
89
+ access_key_id: string;
90
+ sts_token: string;
91
+ callback: string;
92
+ }
93
+ export interface DonePart {
94
+ number: number;
95
+ etag: string;
96
+ }
97
+ export interface Checkpoint {
98
+ /** The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings */
99
+ file: any;
100
+ /** object key */
101
+ name: string;
102
+ fileSize: number;
103
+ partSize: number;
104
+ UploadId: string;
105
+ doneParts: DonePart[];
106
+ }
107
+ export interface InitMultipartUploadOption {
108
+ headers?: Record<string, string>;
109
+ mime?: string | null;
110
+ }
111
+ export interface MultipartUploadParams {
112
+ bucket: string;
113
+ region: string;
114
+ object: string;
115
+ accessKeyId: string;
116
+ accessKeySecret: string;
117
+ stsToken: string;
118
+ callback: string;
119
+ taskId?: TaskId;
120
+ xmlResponse?: boolean;
121
+ }
122
+ /** Multipart upload interface */
123
+ export interface MultipartUploadOption {
124
+ /** the number of parts to be uploaded in parallel */
125
+ parallel?: number;
126
+ /** the suggested size for each part */
127
+ partSize?: number;
128
+ /** the checkpoint to resume upload, if this is provided, it will continue the upload from where interrupted, otherwise a new multipart upload will be created. */
129
+ checkpoint?: Checkpoint;
130
+ mime?: string | null;
131
+ headers?: Record<string, string>;
132
+ }
133
+ export interface CompleteMultipartUploadOptions {
134
+ partSize: number;
135
+ callback?: string;
136
+ headers?: Record<string, string> | undefined;
137
+ progress?: Progress;
138
+ }
139
+ export interface ResumeMultipartOption extends MultipartUploadOption {
140
+ progress?: Progress;
141
+ }
142
+ export interface CreateRequestParams extends MultipartUploadParams {
143
+ method: Method;
144
+ subRes: string | Record<string, any>;
145
+ xmlResponse?: boolean | undefined;
146
+ query?: Record<string, string>;
147
+ content?: File | Blob | string | ArrayBuffer | Buffer;
148
+ }
149
+ export interface UploadPartError extends Error {
150
+ name: string;
151
+ message: string;
152
+ stack: string;
153
+ partNum: number;
154
+ }
155
+ export interface PartInfo {
156
+ content: string | ArrayBuffer | File | Blob | Buffer;
157
+ size: number;
158
+ }
159
+ interface OriginResponseData {
160
+ platform: PlatformType.OSS;
161
+ file_code: string;
162
+ path: string;
163
+ url: string;
164
+ expires: number;
165
+ }
166
+ export type PostResponse = Result<OriginResponseData>;
167
+ export type PutResponse = Result<OriginResponseData>;
168
+ /** Multipart upload init response */
169
+ export type InitMultipartUploadResponse = DataWrapperWithHeaders<{
170
+ InitiateMultipartUploadResult: {
171
+ Bucket: string;
172
+ Key: string;
173
+ UploadId: string;
174
+ };
175
+ }>;
176
+ export type UploadPartResponse = DataWrapperWithHeaders<null>;
177
+ export type CompleteMultipartUploadResponse = Result<OriginResponseData>;
178
+ export { };
179
+ }
180
+
181
+ /**
182
+ * Qiniu cloud namespace
183
+ */
184
+ declare namespace Kodo {
185
+ /** Backend return - Qiniu cloud credential fields */
186
+ type AuthParams = {
187
+ token: string;
188
+ dir: string;
189
+ };
190
+ }
191
+
192
+ /**
193
+ * Internal network upload
194
+ */
195
+ declare namespace Local {
196
+ interface AuthParams {
197
+ dir: string;
198
+ host: string;
199
+ credential: string;
200
+ }
201
+ }
202
+
203
+ interface ISign {
204
+ signature(opt: ISigOptions, expiredAt: number, credentials?: ISigCredentials): string;
205
+ signatureHeader(opt: ISigOptions, expiredAt?: number, credentials?: ISigCredentials): Map<string, string>;
206
+ getSignatureQuery(opt: ISigOptions, expiredAt: number): {
207
+ [key: string]: any;
208
+ };
209
+ }
210
+ interface ISigCredentials {
211
+ GetSecretKey(): string;
212
+ GetAccessKey(): string;
213
+ }
214
+ interface ISigPolicyQuery {
215
+ policy: {
216
+ conditions: (string[] | {
217
+ bucket: string;
218
+ } | {
219
+ key: string;
220
+ })[];
221
+ };
222
+ datetime?: string;
223
+ query?: string;
224
+ path?: string;
225
+ method?: string;
226
+ headers?: {
227
+ [key: string]: string | undefined;
228
+ };
229
+ }
230
+ interface ISigOptions {
231
+ sigName?: string;
232
+ endpoints?: string;
233
+ bucket?: string;
234
+ headers?: {
235
+ [key: string]: string | undefined;
236
+ };
237
+ region?: string;
238
+ serviceName?: string;
239
+ algorithm?: string;
240
+ path: string;
241
+ method: string;
242
+ query?: string | Record<string, any>;
243
+ datetime?: string;
244
+ host?: string;
245
+ port?: number;
246
+ }
247
+ interface ISignV4Opt {
248
+ algorithm?: string;
249
+ region?: string;
250
+ serviceName?: string;
251
+ securityToken?: string;
252
+ bucket: string;
253
+ }
254
+ /**
255
+ * @api private
256
+ */
257
+ declare class SignersV4 implements ISign {
258
+ private options;
259
+ private credentials;
260
+ constructor(opt: ISignV4Opt, credentials: ISigCredentials);
261
+ /**
262
+ * normal v4 signature
263
+ * */
264
+ signature: (opt: ISigOptions, expiredAt: number, credentials?: ISigCredentials) => string;
265
+ signatureHeader: (opt: ISigOptions, expiredAt?: number, credentials?: ISigCredentials) => Map<string, string>;
266
+ getSignatureQuery: (opt: ISigOptions, expiredAt: number) => {
267
+ [key: string]: any;
268
+ };
269
+ getSignaturePolicyQuery: (opt: ISigPolicyQuery, expiredAt: number) => {
270
+ [key: string]: any;
271
+ };
272
+ static hexEncodedBodyHash: () => string;
273
+ private authorization;
274
+ static getDateTime: () => string;
275
+ private credentialString;
276
+ static createScope: (date: string, region?: string, serviceName?: string) => string;
277
+ private getSigningKey;
278
+ private stringToSign;
279
+ static hexEncodedHash: (string: string) => string;
280
+ static canonicalString: (opt: ISigOptions) => string;
281
+ static canonicalStringPolicy: (opt: ISigOptions) => string;
282
+ static canonicalHeaders: (opt: ISigOptions) => string;
283
+ static canonicalHeaderValues: (values: string) => string;
284
+ static signedHeaders: (opt: ISigOptions) => string;
285
+ /**
286
+ * ! * ' () aren't transformed by encodeUrl, so they need be handled
287
+ */
288
+ static getEncodePath(path: string, encodeAll?: boolean): string;
289
+ }
290
+
291
+ declare namespace TOS {
292
+ interface VolcEnginePlatformSimpleUploadOption extends PlatformSimpleUploadOption {
293
+ tosCallbackParams: {
294
+ tenant_id: string;
295
+ organization_code: string;
296
+ };
297
+ }
298
+ interface VolcEnginePlatformMultipartUploadOption extends PlatformMultipartUploadOption {
299
+ }
300
+ interface CallbackResponse {
301
+ platform: "tos";
302
+ file_code: string;
303
+ path: string;
304
+ url: string;
305
+ expires: number;
306
+ }
307
+ interface AuthParams {
308
+ host: string;
309
+ "x-tos-algorithm": "TOS4-HMAC-SHA256";
310
+ "x-tos-date": string;
311
+ "x-tos-credential": string;
312
+ "x-tos-signature": string;
313
+ policy: string;
314
+ expires: number;
315
+ content_type: string;
316
+ dir: string;
317
+ "x-tos-callback": string;
318
+ }
319
+ type Headers = Record<string, string>;
320
+ interface STSAuthParams {
321
+ bucket: string;
322
+ callback: string;
323
+ credentials: {
324
+ AccessKeyId: string;
325
+ CurrentTime: string;
326
+ ExpiredTime: string;
327
+ SecretAccessKey: string;
328
+ SessionToken: string;
329
+ };
330
+ dir: string;
331
+ endpoint: string;
332
+ host: string;
333
+ expires: number;
334
+ region: string;
335
+ }
336
+ interface CreateRequestParams extends STSAuthParams {
337
+ }
338
+ interface InitMultipartUploadOption extends MultipartUploadOption {
339
+ headers: Headers;
340
+ mime?: string | null;
341
+ }
342
+ type DonePart = {
343
+ number: number;
344
+ etag: string;
345
+ };
346
+ interface Checkpoint {
347
+ /** The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings */
348
+ file: any;
349
+ /** object key */
350
+ name: string;
351
+ fileSize: number;
352
+ partSize: number;
353
+ UploadId: string;
354
+ doneParts: DonePart[];
355
+ }
356
+ interface PartInfo {
357
+ content: Buffer;
358
+ size: Number;
359
+ }
360
+ interface MultipartUploadOption extends PlatformMultipartUploadOption {
361
+ signers: SignersV4;
362
+ }
363
+ interface CompleteMultipartUploadOptions extends MultipartUploadOption {
364
+ }
365
+ interface InitMultipartUploadResponse {
366
+ Bucket: string;
367
+ Key: string;
368
+ UploadId: string;
369
+ }
370
+ interface CompleteMultipartUploadResponse {
371
+ Location: string;
372
+ Bucket: string;
373
+ Key: string;
374
+ ETag: string;
375
+ headers: Record<string, string>;
376
+ }
377
+ type UploadPartResponse = DataWrapperWithHeaders<null>;
378
+ type PostResponse = DataWrapperWithHeaders<null>;
379
+ type PutResponse = DataWrapperWithHeaders<null>;
380
+ }
381
+
382
+ declare const enum OBSUploadFileEventType {
383
+ initiateMultipartUploadSucceed = "initiateMultipartUploadSucceed"
384
+ }
385
+ declare namespace OBS {
386
+ interface UploadFileEventResponse {
387
+ [OBSUploadFileEventType.initiateMultipartUploadSucceed]: InitMultipartUploadResponse;
388
+ }
389
+ interface AuthParams {
390
+ AccessKeyId: string;
391
+ host: string;
392
+ policy: string;
393
+ signature: string;
394
+ dir: string;
395
+ "content-type": string;
396
+ }
397
+ interface STSAuthParams {
398
+ host: string;
399
+ region: string;
400
+ endpoint: string;
401
+ credentials: {
402
+ access: string;
403
+ secret: string;
404
+ security_token: string;
405
+ expires_at: string;
406
+ };
407
+ bucket: string;
408
+ dir: string;
409
+ expires: number;
410
+ callback: string;
411
+ }
412
+ interface PartInfo {
413
+ content: Buffer;
414
+ size: number;
415
+ }
416
+ interface InitMultipartUploadOption extends PlatformMultipartUploadOption {
417
+ mime?: string | null;
418
+ }
419
+ interface CommonResponse<I> {
420
+ CommonMsg: {
421
+ Status: number;
422
+ Code: string;
423
+ Message: string;
424
+ HostId: string;
425
+ RequestId: string;
426
+ InterfaceResult: null;
427
+ Id2: string;
428
+ };
429
+ InterfaceResult: I;
430
+ }
431
+ interface InitMultipartUploadResponse {
432
+ InitiateMultipartUploadResult: {
433
+ Bucket: string;
434
+ Key: string;
435
+ UploadId: string;
436
+ };
437
+ }
438
+ interface InitMultipartUploadResult {
439
+ res: unknown;
440
+ bucket: string;
441
+ name: string;
442
+ UploadId: string;
443
+ }
444
+ type UploadPartResponse = DataWrapperWithHeaders<null>;
445
+ interface UploadPartResult {
446
+ name: string;
447
+ etag: string;
448
+ res: UploadPartResponse;
449
+ }
450
+ type CompleteMultipartUploadResponse = CommonResponse<{
451
+ ContentLength: string;
452
+ Date: string;
453
+ RequestId: string;
454
+ Id2: string;
455
+ Location: string;
456
+ Bucket: string;
457
+ Key: string;
458
+ ETag: string;
459
+ }>;
460
+ type UploadPart = DonePart;
461
+ type PutResponseData = CommonResponse<{
462
+ ContentLength: "0";
463
+ RequestId: "0000018C63BA1641B01B419F482B8B1E";
464
+ ETag: '"e00ca89591de6668570981e97c9663ea"';
465
+ }>;
466
+ }
467
+
468
+ /**
469
+ * AWS S3 / MinIO Object Storage
470
+ */
471
+ declare namespace MinIO {
472
+ /** Simple upload using pre-signed URL */
473
+ export interface AuthParams {
474
+ url: string;
475
+ host: string;
476
+ method: string;
477
+ fields: Record<string, string>;
478
+ dir: string;
479
+ expires: number;
480
+ }
481
+ /** Credentials for MinIO/S3 authentication */
482
+ export interface Credentials {
483
+ access_key_id: string;
484
+ secret_access_key: string;
485
+ session_token: string;
486
+ expiration: string;
487
+ }
488
+ /** Upload using AccessKey/SecretKey with Signature V4 */
489
+ export interface STSAuthParams {
490
+ region: string;
491
+ endpoint: string;
492
+ bucket: string;
493
+ credentials: Credentials;
494
+ expires: number;
495
+ dir: string;
496
+ }
497
+ export type Headers = Record<string, string>;
498
+ export interface DonePart {
499
+ number: number;
500
+ etag: string;
501
+ }
502
+ export interface Checkpoint {
503
+ /** The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings */
504
+ file: any;
505
+ /** object key */
506
+ name: string;
507
+ fileSize: number;
508
+ partSize: number;
509
+ UploadId: string;
510
+ doneParts: DonePart[];
511
+ }
512
+ export interface InitMultipartUploadOption extends PlatformMultipartUploadOption {
513
+ headers?: Headers;
514
+ mime?: string | null;
515
+ }
516
+ export interface MultipartUploadOption extends PlatformMultipartUploadOption {
517
+ headers?: Record<string, string>;
518
+ }
519
+ export interface CompleteMultipartUploadOptions extends MultipartUploadOption {
520
+ partSize: number;
521
+ }
522
+ export interface PartInfo {
523
+ content: Buffer | Blob | ArrayBuffer;
524
+ size: number;
525
+ }
526
+ export interface InitMultipartUploadResponse {
527
+ InitiateMultipartUploadResult: {
528
+ Bucket: string;
529
+ Key: string;
530
+ UploadId: string;
531
+ };
532
+ }
533
+ export interface CompleteMultipartUploadResponse {
534
+ CompleteMultipartUploadResult: {
535
+ Location: string;
536
+ Bucket: string;
537
+ Key: string;
538
+ ETag: string;
539
+ };
540
+ }
541
+ interface OriginResponseData {
542
+ platform: PlatformType.Minio;
543
+ file_code?: string;
544
+ path: string;
545
+ url?: string;
546
+ expires?: number;
547
+ }
548
+ export type PostResponse = Result<OriginResponseData>;
549
+ export type PutResponse = DataWrapperWithHeaders<null>;
550
+ export type InitMultipartUploadResponseType = DataWrapperWithHeaders<InitMultipartUploadResponse>;
551
+ export type UploadPartResponse = DataWrapperWithHeaders<null>;
552
+ export type CompleteMultipartUploadResponseType = Result<OriginResponseData>;
553
+ export { };
554
+ }
555
+
556
+ /**
557
+ * @description Unified success response
558
+ * @param code 1000 for successful request
559
+ * @param message Request status information
560
+ * @param data Return data payload
561
+ */
562
+ interface NormalSuccessResponse {
563
+ code: number;
564
+ message: string;
565
+ headers: Record<string, string>;
566
+ data: {
567
+ platform: PlatformType;
568
+ path: string;
569
+ };
570
+ }
571
+ /**
572
+ * @param url Request URL
573
+ * @param method Request method
574
+ * @param headers Request headers
575
+ * @param body Request body
576
+ */
577
+ interface Request {
578
+ url: string;
579
+ method: Method;
580
+ headers?: Record<string, string>;
581
+ body?: any;
582
+ }
583
+ /**
584
+ * @description: Image processing configuration
585
+ * @param type // Image processing type, e.g.: resize, watermark
586
+ * @param params Image processing parameters, refer to: https://help.aliyun.com/document_detail/144582.html
587
+ */
588
+ interface TransformImageConfig {
589
+ type: "resize" | "watermark" | "crop" | "quality" | "format" | "auto-orient" | "circle" | "indexcrop" | "rounded-corners" | "blur" | "rotate" | "interlace" | "bright" | "sharpen" | "contrast";
590
+ params: Record<string, any>;
591
+ }
592
+ /**
593
+ * @description: Download configuration
594
+ * @param url Request URL
595
+ * @param method Request method
596
+ * @param headers Request headers
597
+ * @param body Request body
598
+ */
599
+ interface DownloadConfig extends Request {
600
+ option?: {
601
+ image?: TransformImageConfig[];
602
+ };
603
+ }
604
+ type UploadConfigOption = UploadCommonOption & PlatformSimpleUploadOption & PlatformMultipartUploadOption;
605
+ /**
606
+ * @description: Common upload configuration
607
+ * @param rewriteFileName Whether to rename the file
608
+ */
609
+ interface UploadCommonOption {
610
+ rewriteFileName?: boolean;
611
+ }
612
+ /**
613
+ * @description: Custom upload credential configuration
614
+ * @param platform Platform type
615
+ * @param credentials Credential information
616
+ * @param expire Expiration timestamp (optional)
617
+ */
618
+ interface CustomCredentials {
619
+ platform: PlatformType;
620
+ temporary_credential: PlatformParams;
621
+ expire?: number;
622
+ }
623
+ /**
624
+ * @description: Upload configuration, requires developers to configure upload credential request, SDK handles upload request internally
625
+ * @param url Request upload credential - URL (optional when using custom credentials)
626
+ * @param method Request upload credential - request method (optional when using custom credentials)
627
+ * @param headers Request upload credential - request headers (optional when using custom credentials)
628
+ * @param body Request upload credential - request body (optional when using custom credentials)
629
+ * @param {File | Blob} file File to be uploaded
630
+ * @param fileName File name
631
+ * @param option Optional upload configuration
632
+ * @param customCredentials Custom upload credentials (optional, will skip credential request when provided)
633
+ */
634
+ interface UploadConfig {
635
+ url?: string;
636
+ method?: Method;
637
+ headers?: Record<string, string>;
638
+ body?: any;
639
+ file: File | Blob;
640
+ fileName: string;
641
+ option?: UploadConfigOption;
642
+ customCredentials?: CustomCredentials;
643
+ }
644
+ /** Upload callback */
645
+ interface UploadCallBack extends TaskCallBack {
646
+ }
647
+ type DonePart = {
648
+ number: number;
649
+ etag: string;
650
+ };
651
+ interface Checkpoint {
652
+ /** The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings */
653
+ file: any;
654
+ /** object key */
655
+ name: string;
656
+ fileSize: number;
657
+ partSize: number;
658
+ UploadId: string;
659
+ doneParts: DonePart[];
660
+ }
661
+ /** percent: percentage progress loaded: bytes uploaded total: total bytes checkpoint: upload checkpoint information */
662
+ type Progress = (percent: number, loaded: number, total: number, checkpoint: Checkpoint | null) => void;
663
+ /** PlatformType cloud storage provider enum type */
664
+ declare enum PlatformType {
665
+ OSS = "aliyun",
666
+ Kodo = "qiniu",
667
+ TOS = "tos",
668
+ OBS = "obs",
669
+ Local = "local",
670
+ Minio = "minio"
671
+ }
672
+ /** Aggregated platform parameters */
673
+ type PlatformParams = OSS.AuthParams | OSS.STSAuthParams | Kodo.AuthParams | Local.AuthParams | TOS.AuthParams | TOS.STSAuthParams | OBS.AuthParams | OBS.STSAuthParams | MinIO.AuthParams | MinIO.STSAuthParams;
674
+ /** Object storage platform base Option */
675
+ interface PlatformOption {
676
+ headers?: Record<string, string>;
677
+ taskId?: TaskId;
678
+ progress?: Progress;
679
+ reUploadedCount?: number;
680
+ }
681
+ /** Multipart upload Option optional fields */
682
+ interface PlatformMultipartUploadOption extends PlatformOption {
683
+ parallel?: number;
684
+ partSize?: number;
685
+ checkpoint?: OSS.Checkpoint;
686
+ mime?: string | null;
687
+ }
688
+ /** Simple upload Option optional fields */
689
+ interface PlatformSimpleUploadOption extends PlatformOption {
690
+ }
691
+ /** Upload file implementation interface for different object storage platforms */
692
+ type PlatformRequest<P, O> = (file: File | Blob, key: string, params: P, option: O) => Promise<NormalSuccessResponse>;
693
+ /** A TaskId is generated when a file upload starts */
694
+ type TaskId = string;
695
+ /** Upload progress callback parameters */
696
+ interface ProgressCallbackProps {
697
+ percent?: number;
698
+ loaded?: number;
699
+ total?: number;
700
+ checkpoint?: OSS.Checkpoint | null;
701
+ }
702
+ /** Success hook callback */
703
+ type SuccessCallback = (response?: NormalSuccessResponse) => void;
704
+ /** Failure hook callback */
705
+ type FailCallback = (err?: ErrorType.UploadError) => void;
706
+ /** Progress hook callback */
707
+ type ProgressCallback = (percent?: ProgressCallbackProps["percent"], loaded?: ProgressCallbackProps["loaded"], total?: ProgressCallbackProps["total"], checkpoint?: ProgressCallbackProps["checkpoint"]) => void;
708
+ /** Upload task callbacks */
709
+ interface TaskCallBack {
710
+ success?: (callback: SuccessCallback) => void;
711
+ fail?: (callback: FailCallback) => void;
712
+ progress?: (callback: ProgressCallback) => void;
713
+ cancel?: () => void;
714
+ pause?: () => void;
715
+ resume?: () => void;
716
+ }
717
+
718
+ declare const PlatformModules: Record<PlatformType, Record<string, PlatformRequest<OSS.AuthParams, PlatformSimpleUploadOption> | PlatformRequest<OSS.STSAuthParams, PlatformMultipartUploadOption> | PlatformRequest<Kodo.AuthParams, PlatformSimpleUploadOption> | PlatformRequest<TOS.AuthParams, PlatformMultipartUploadOption> | PlatformRequest<TOS.STSAuthParams, PlatformMultipartUploadOption> | PlatformRequest<OBS.STSAuthParams, PlatformMultipartUploadOption> | PlatformRequest<OBS.AuthParams, PlatformMultipartUploadOption> | PlatformRequest<Local.AuthParams, PlatformSimpleUploadOption> | PlatformRequest<MinIO.AuthParams, PlatformSimpleUploadOption> | PlatformRequest<MinIO.STSAuthParams, PlatformMultipartUploadOption>>>;
719
+
720
+ /**
721
+ * Log module namespace
722
+ * */
723
+ declare namespace LogModule {
724
+ type LogType = "SUCCESS" | "ERROR" | "WARN" | "DEBUG";
725
+ type CallBack = (log: any) => void;
726
+ type LogEventType = "upload" | "download";
727
+ type CreateLogConfig = {
728
+ type: LogType;
729
+ /** Event name */
730
+ eventName: LogEventType;
731
+ /** Event parameters */
732
+ eventParams?: any;
733
+ /** Event response */
734
+ eventResponse?: any;
735
+ error?: ErrorType.UploadError;
736
+ /** Additional content */
737
+ extra?: string;
738
+ };
739
+ /**
740
+ * Log data structure
741
+ */
742
+ interface LogData {
743
+ /** Status type */
744
+ type: LogType;
745
+ /** Event name */
746
+ event_name: LogEventType;
747
+ /** Event parameters */
748
+ event_params: any;
749
+ /** Event response */
750
+ event_response: any;
751
+ /** Exception type */
752
+ exception_type: string;
753
+ /** Exception message */
754
+ exception_message: string;
755
+ /** File where exception was triggered */
756
+ exception_file: string;
757
+ /** Line number where exception was triggered */
758
+ exception_line: string;
759
+ /** Column number where exception was triggered */
760
+ exception_row: string;
761
+ /** Additional content */
762
+ extra?: string;
763
+ /** Record time */
764
+ time: Date;
765
+ /** SDK name and version */
766
+ version: string;
767
+ }
768
+ }
769
+
770
+ declare class UploadManger {
771
+ private tasks;
772
+ private detach;
773
+ private notifySuccess;
774
+ private notifyError;
775
+ private notifyProgress;
776
+ createTask(file: File | Blob, key: string, uploadConfig: UploadConfig, option: PlatformMultipartUploadOption | PlatformSimpleUploadOption): TaskCallBack;
777
+ private upload;
778
+ pauseAllTask(): void;
779
+ resumeAllTask(): void;
780
+ cancelAllTask(): void;
781
+ }
782
+
783
+ declare function STSUpload$1(file: File | Blob, key: string, params: TOS.STSAuthParams, option: PlatformSimpleUploadOption | PlatformMultipartUploadOption): Promise<NormalSuccessResponse>;
784
+
785
+ declare const _default$5: {
786
+ upload: PlatformRequest<TOS.AuthParams | TOS.STSAuthParams, PlatformSimpleUploadOption | PlatformMultipartUploadOption>;
787
+ defaultUpload: PlatformRequest<TOS.AuthParams, PlatformSimpleUploadOption>;
788
+ MultipartUpload: PlatformRequest<TOS.STSAuthParams, PlatformMultipartUploadOption>;
789
+ STSUpload: typeof STSUpload$1;
790
+ };
791
+
792
+ declare const _default$4: {
793
+ upload: PlatformRequest<OSS.AuthParams | OSS.STSAuthParams, PlatformSimpleUploadOption | PlatformMultipartUploadOption>;
794
+ defaultUpload: PlatformRequest<OSS.AuthParams, PlatformSimpleUploadOption>;
795
+ MultipartUpload: PlatformRequest<OSS.STSAuthParams, PlatformMultipartUploadOption>;
796
+ STSUpload: PlatformRequest<OSS.STSAuthParams, PlatformMultipartUploadOption>;
797
+ };
798
+
799
+ /**
800
+ * Huawei Cloud PUT upload
801
+ * @param file File
802
+ * @param key File name
803
+ * @param params Upload credential parameters
804
+ * @param option Upload configuration
805
+ * @returns
806
+ */
807
+ declare function STSUpload(file: File | Blob, key: string, params: OBS.STSAuthParams, option: PlatformSimpleUploadOption | PlatformMultipartUploadOption): Promise<NormalSuccessResponse>;
808
+
809
+ declare const _default$3: {
810
+ upload: PlatformRequest<OBS.AuthParams | OBS.STSAuthParams, PlatformSimpleUploadOption | PlatformMultipartUploadOption>;
811
+ defaultUpload: PlatformRequest<OBS.AuthParams, PlatformSimpleUploadOption>;
812
+ MultipartUpload: PlatformRequest<OBS.STSAuthParams, PlatformMultipartUploadOption>;
813
+ STSUpload: typeof STSUpload;
814
+ };
815
+
816
+ declare const _default$2: {
817
+ upload: PlatformRequest<Kodo.AuthParams, PlatformSimpleUploadOption>;
818
+ };
819
+
820
+ declare const _default$1: {
821
+ upload: PlatformRequest<Local.AuthParams, PlatformSimpleUploadOption>;
822
+ };
823
+
824
+ declare const _default: {
825
+ upload: PlatformRequest<MinIO.AuthParams | MinIO.STSAuthParams, PlatformSimpleUploadOption | PlatformMultipartUploadOption>;
826
+ defaultUpload: PlatformRequest<MinIO.AuthParams, PlatformSimpleUploadOption>;
827
+ signedUpload: PlatformRequest<MinIO.STSAuthParams, PlatformSimpleUploadOption>;
828
+ MultipartUpload: PlatformRequest<MinIO.STSAuthParams, PlatformMultipartUploadOption>;
829
+ STSUpload: PlatformRequest<MinIO.STSAuthParams, PlatformSimpleUploadOption>;
830
+ };
831
+
832
+ declare class Upload {
833
+ /** Package version */
834
+ static version: string;
835
+ uploadManger: UploadManger;
836
+ constructor();
837
+ /**
838
+ * @description: Generate temporary URL for file download/preview
839
+ * @param {DownloadConfig} downloadConfig
840
+ * @return Promise<any>
841
+ */
842
+ static download(downloadConfig: DownloadConfig): Promise<any>;
843
+ /**
844
+ * @description: File upload interface, including simple upload/multipart upload/resumable upload, will select the corresponding platform and upload method based on upload credential information
845
+ * @param {UploadConfig} uploadConfig Upload configuration
846
+ * @return {UploadCallBack} uploadCallBack Upload callback
847
+ */
848
+ upload(uploadConfig: UploadConfig): UploadCallBack;
849
+ /**
850
+ * @description: Pause all file uploads (multipart upload)
851
+ */
852
+ pause(): void;
853
+ /**
854
+ * @description: Resume all file uploads (multipart upload)
855
+ */
856
+ resume(): void;
857
+ /**
858
+ * @description: Cancel all file uploads (multipart upload)
859
+ */
860
+ cancel(): void;
861
+ /**
862
+ * @description: Pass in callback function to subscribe to log content
863
+ */
864
+ static subscribeLogs(callback: LogModule.CallBack): void;
865
+ }
866
+
867
+ export { type DownloadConfig, _default$2 as Kodo, _default$1 as Local, _default as MinIO, _default$3 as OBS, _default$4 as OSS, PlatformModules, PlatformType, _default$5 as TOS, Upload, type UploadCallBack, type UploadConfig };