@hanzo/s3 0.6.3 → 8.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.
- package/LICENSE +202 -0
- package/MAINTAINERS.md +62 -0
- package/README.md +262 -0
- package/README_zh_CN.md +192 -0
- package/dist/esm/AssumeRoleProvider.d.mts +86 -0
- package/dist/esm/AssumeRoleProvider.mjs +183 -0
- package/dist/esm/CredentialProvider.d.mts +22 -0
- package/dist/esm/CredentialProvider.mjs +48 -0
- package/dist/esm/Credentials.d.mts +22 -0
- package/dist/esm/Credentials.mjs +38 -0
- package/dist/esm/IamAwsProvider.d.mts +27 -0
- package/dist/esm/IamAwsProvider.mjs +189 -0
- package/dist/esm/errors.d.mts +82 -0
- package/dist/esm/errors.mjs +117 -0
- package/dist/esm/helpers.d.mts +156 -0
- package/dist/esm/helpers.mjs +218 -0
- package/dist/esm/internal/async.d.mts +9 -0
- package/dist/esm/internal/async.mjs +14 -0
- package/dist/esm/internal/callbackify.d.mts +1 -0
- package/dist/esm/internal/callbackify.mjs +15 -0
- package/dist/esm/internal/client.d.mts +394 -0
- package/dist/esm/internal/client.mjs +3007 -0
- package/dist/esm/internal/copy-conditions.d.mts +10 -0
- package/dist/esm/internal/copy-conditions.mjs +25 -0
- package/dist/esm/internal/extensions.d.mts +18 -0
- package/dist/esm/internal/extensions.mjs +114 -0
- package/dist/esm/internal/helper.d.mts +177 -0
- package/dist/esm/internal/helper.mjs +552 -0
- package/dist/esm/internal/join-host-port.d.mts +11 -0
- package/dist/esm/internal/join-host-port.mjs +23 -0
- package/dist/esm/internal/post-policy.d.mts +17 -0
- package/dist/esm/internal/post-policy.mjs +98 -0
- package/dist/esm/internal/request.d.mts +11 -0
- package/dist/esm/internal/request.mjs +75 -0
- package/dist/esm/internal/response.d.mts +8 -0
- package/dist/esm/internal/response.mjs +16 -0
- package/dist/esm/internal/s3-endpoints.d.mts +38 -0
- package/dist/esm/internal/s3-endpoints.mjs +68 -0
- package/dist/esm/internal/type.d.mts +482 -0
- package/dist/esm/internal/type.mjs +30 -0
- package/dist/esm/internal/xml-parser.d.mts +93 -0
- package/dist/esm/internal/xml-parser.mjs +819 -0
- package/dist/esm/notification.d.mts +58 -0
- package/dist/esm/notification.mjs +209 -0
- package/dist/esm/s3.d.mts +40 -0
- package/dist/esm/s3.mjs +86 -0
- package/dist/esm/signing.d.mts +5 -0
- package/dist/esm/signing.mjs +258 -0
- package/dist/main/AssumeRoleProvider.d.ts +86 -0
- package/dist/main/AssumeRoleProvider.js +191 -0
- package/dist/main/CredentialProvider.d.ts +22 -0
- package/dist/main/CredentialProvider.js +55 -0
- package/dist/main/Credentials.d.ts +22 -0
- package/dist/main/Credentials.js +45 -0
- package/dist/main/IamAwsProvider.d.ts +27 -0
- package/dist/main/IamAwsProvider.js +198 -0
- package/dist/main/errors.d.ts +82 -0
- package/dist/main/errors.js +138 -0
- package/dist/main/helpers.d.ts +156 -0
- package/dist/main/helpers.js +233 -0
- package/dist/main/internal/async.d.ts +9 -0
- package/dist/main/internal/async.js +24 -0
- package/dist/main/internal/callbackify.d.ts +1 -0
- package/dist/main/internal/callbackify.js +21 -0
- package/dist/main/internal/client.d.ts +394 -0
- package/dist/main/internal/client.js +3014 -0
- package/dist/main/internal/copy-conditions.d.ts +10 -0
- package/dist/main/internal/copy-conditions.js +31 -0
- package/dist/main/internal/extensions.d.ts +18 -0
- package/dist/main/internal/extensions.js +122 -0
- package/dist/main/internal/helper.d.ts +177 -0
- package/dist/main/internal/helper.js +608 -0
- package/dist/main/internal/join-host-port.d.ts +11 -0
- package/dist/main/internal/join-host-port.js +29 -0
- package/dist/main/internal/post-policy.d.ts +17 -0
- package/dist/main/internal/post-policy.js +107 -0
- package/dist/main/internal/request.d.ts +11 -0
- package/dist/main/internal/request.js +83 -0
- package/dist/main/internal/response.d.ts +8 -0
- package/dist/main/internal/response.js +24 -0
- package/dist/main/internal/s3-endpoints.d.ts +38 -0
- package/dist/main/internal/s3-endpoints.js +73 -0
- package/dist/main/internal/type.d.ts +482 -0
- package/dist/main/internal/type.js +42 -0
- package/dist/main/internal/xml-parser.d.ts +93 -0
- package/dist/main/internal/xml-parser.js +849 -0
- package/dist/main/notification.d.ts +58 -0
- package/dist/main/notification.js +230 -0
- package/dist/main/s3.d.ts +40 -0
- package/dist/main/s3.js +117 -0
- package/dist/main/signing.d.ts +5 -0
- package/dist/main/signing.js +269 -0
- package/package.json +146 -39
- package/src/AssumeRoleProvider.ts +262 -0
- package/src/CredentialProvider.ts +54 -0
- package/src/Credentials.ts +44 -0
- package/src/IamAwsProvider.ts +234 -0
- package/src/errors.ts +120 -0
- package/src/helpers.ts +354 -0
- package/src/internal/async.ts +14 -0
- package/src/internal/callbackify.ts +19 -0
- package/src/internal/client.ts +3412 -0
- package/src/internal/copy-conditions.ts +30 -0
- package/src/internal/extensions.ts +140 -0
- package/src/internal/helper.ts +606 -0
- package/src/internal/join-host-port.ts +23 -0
- package/src/internal/post-policy.ts +99 -0
- package/src/internal/request.ts +102 -0
- package/src/internal/response.ts +26 -0
- package/src/internal/s3-endpoints.ts +70 -0
- package/src/internal/type.ts +577 -0
- package/src/internal/xml-parser.ts +871 -0
- package/src/notification.ts +254 -0
- package/src/s3.ts +155 -0
- package/src/signing.ts +325 -0
- package/lib/index.js +0 -450
- package/lib/index.js.map +0 -7
- package/lib/perfTest.js +0 -91
- package/lib/perfTest.js.map +0 -7
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import * as http from 'node:http';
|
|
6
|
+
import * as https from 'node:https';
|
|
7
|
+
import * as stream from 'node:stream';
|
|
8
|
+
import { CredentialProvider } from "../CredentialProvider.mjs";
|
|
9
|
+
import type { SelectResults } from "../helpers.mjs";
|
|
10
|
+
import { CopyDestinationOptions, CopySourceOptions, LEGAL_HOLD_STATUS } from "../helpers.mjs";
|
|
11
|
+
import type { NotificationEvent } from "../notification.mjs";
|
|
12
|
+
import { NotificationConfig, NotificationPoller } from "../notification.mjs";
|
|
13
|
+
import { CopyConditions } from "./copy-conditions.mjs";
|
|
14
|
+
import { Extensions } from "./extensions.mjs";
|
|
15
|
+
import { PostPolicy } from "./post-policy.mjs";
|
|
16
|
+
import type { Region } from "./s3-endpoints.mjs";
|
|
17
|
+
import type { Binary, BucketItem, BucketItemFromList, BucketItemStat, BucketStream, BucketVersioningConfiguration, CopyObjectResult, EncryptionConfig, GetObjectLegalHoldOptions, GetObjectOpts, GetObjectRetentionOpts, IncompleteUploadedBucketItem, IRequest, ItemBucketMetadata, LifecycleConfig, LifeCycleConfigParam, ListObjectQueryOpts, ListObjectV2Res, NotificationConfigResult, ObjectInfo, ObjectLockInfo, ObjectMetaData, ObjectRetentionInfo, PostPolicyResult, PreSignRequestParams, PutObjectLegalHoldOptions, RemoveObjectsParam, RemoveObjectsResponse, ReplicationConfig, ReplicationConfigOpts, RequestHeaders, ResultCallback, Retention, SelectOptions, StatObjectOpts, Tag, TaggingOpts, Tags, Transport, UploadedObjectInfo } from "./type.mjs";
|
|
18
|
+
import type { ListMultipartResult, UploadedPart } from "./xml-parser.mjs";
|
|
19
|
+
declare const requestOptionProperties: readonly ["agent", "ca", "cert", "ciphers", "clientCertEngine", "crl", "dhparam", "ecdhCurve", "family", "honorCipherOrder", "key", "passphrase", "pfx", "rejectUnauthorized", "secureOptions", "secureProtocol", "servername", "sessionIdContext"];
|
|
20
|
+
export interface RetryOptions {
|
|
21
|
+
/**
|
|
22
|
+
* If this set to true, it will take precedence over all other retry options.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disableRetry?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The maximum amount of retries for a request.
|
|
28
|
+
* @default 1
|
|
29
|
+
*/
|
|
30
|
+
maximumRetryCount?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The minimum duration (in milliseconds) for the exponential backoff algorithm.
|
|
33
|
+
* @default 100
|
|
34
|
+
*/
|
|
35
|
+
baseDelayMs?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The maximum duration (in milliseconds) for the exponential backoff algorithm.
|
|
38
|
+
* @default 60000
|
|
39
|
+
*/
|
|
40
|
+
maximumDelayMs?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ClientOptions {
|
|
43
|
+
endPoint: string;
|
|
44
|
+
accessKey?: string;
|
|
45
|
+
secretKey?: string;
|
|
46
|
+
useSSL?: boolean;
|
|
47
|
+
port?: number;
|
|
48
|
+
region?: Region;
|
|
49
|
+
transport?: Transport;
|
|
50
|
+
sessionToken?: string;
|
|
51
|
+
partSize?: number;
|
|
52
|
+
pathStyle?: boolean;
|
|
53
|
+
credentialsProvider?: CredentialProvider;
|
|
54
|
+
s3AccelerateEndpoint?: string;
|
|
55
|
+
transportAgent?: http.Agent;
|
|
56
|
+
retryOptions?: RetryOptions;
|
|
57
|
+
}
|
|
58
|
+
export type RequestOption = Partial<IRequest> & {
|
|
59
|
+
method: string;
|
|
60
|
+
bucketName?: string;
|
|
61
|
+
objectName?: string;
|
|
62
|
+
query?: string;
|
|
63
|
+
pathStyle?: boolean;
|
|
64
|
+
};
|
|
65
|
+
export type NoResultCallback = (error: unknown) => void;
|
|
66
|
+
export interface MakeBucketOpt {
|
|
67
|
+
ObjectLocking?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface RemoveOptions {
|
|
70
|
+
versionId?: string;
|
|
71
|
+
governanceBypass?: boolean;
|
|
72
|
+
forceDelete?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export declare class TypedClient {
|
|
75
|
+
protected transport: Transport;
|
|
76
|
+
protected host: string;
|
|
77
|
+
protected port: number;
|
|
78
|
+
protected protocol: string;
|
|
79
|
+
protected accessKey: string;
|
|
80
|
+
protected secretKey: string;
|
|
81
|
+
protected sessionToken?: string;
|
|
82
|
+
protected userAgent: string;
|
|
83
|
+
protected anonymous: boolean;
|
|
84
|
+
protected pathStyle: boolean;
|
|
85
|
+
protected regionMap: Record<string, string>;
|
|
86
|
+
region?: string;
|
|
87
|
+
protected credentialsProvider?: CredentialProvider;
|
|
88
|
+
partSize: number;
|
|
89
|
+
protected overRidePartSize?: boolean;
|
|
90
|
+
protected retryOptions: RetryOptions;
|
|
91
|
+
protected maximumPartSize: number;
|
|
92
|
+
protected maxObjectSize: number;
|
|
93
|
+
enableSHA256: boolean;
|
|
94
|
+
protected s3AccelerateEndpoint?: string;
|
|
95
|
+
protected reqOptions: Record<string, unknown>;
|
|
96
|
+
protected transportAgent: http.Agent;
|
|
97
|
+
private readonly clientExtensions;
|
|
98
|
+
constructor(params: ClientOptions);
|
|
99
|
+
/**
|
|
100
|
+
* S3 extensions that aren't necessarily present for Amazon S3 compatible storage servers
|
|
101
|
+
*/
|
|
102
|
+
get extensions(): Extensions;
|
|
103
|
+
/**
|
|
104
|
+
* @param endPoint - valid S3 acceleration end point
|
|
105
|
+
*/
|
|
106
|
+
setS3TransferAccelerate(endPoint: string): void;
|
|
107
|
+
/**
|
|
108
|
+
* Sets the supported request options.
|
|
109
|
+
*/
|
|
110
|
+
setRequestOptions(options: Pick<https.RequestOptions, (typeof requestOptionProperties)[number]>): void;
|
|
111
|
+
/**
|
|
112
|
+
* This is s3 Specific and does not hold validity in any other Object storage.
|
|
113
|
+
*/
|
|
114
|
+
private getAccelerateEndPointIfSet;
|
|
115
|
+
/**
|
|
116
|
+
* Set application specific information.
|
|
117
|
+
* Generates User-Agent in the following style.
|
|
118
|
+
* HanzoS3 (OS; ARCH) LIB/VER APP/VER
|
|
119
|
+
*/
|
|
120
|
+
setAppInfo(appName: string, appVersion: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* returns options object that can be used with http.request()
|
|
123
|
+
* Takes care of constructing virtual-host-style or path-style hostname
|
|
124
|
+
*/
|
|
125
|
+
protected getRequestOptions(opts: RequestOption & {
|
|
126
|
+
region: string;
|
|
127
|
+
}): IRequest & {
|
|
128
|
+
host: string;
|
|
129
|
+
headers: Record<string, string>;
|
|
130
|
+
};
|
|
131
|
+
setCredentialsProvider(credentialsProvider: CredentialProvider): Promise<void>;
|
|
132
|
+
private checkAndRefreshCreds;
|
|
133
|
+
private logStream?;
|
|
134
|
+
/**
|
|
135
|
+
* log the request, response, error
|
|
136
|
+
*/
|
|
137
|
+
private logHTTP;
|
|
138
|
+
/**
|
|
139
|
+
* Enable tracing
|
|
140
|
+
*/
|
|
141
|
+
traceOn(stream?: stream.Writable): void;
|
|
142
|
+
/**
|
|
143
|
+
* Disable tracing
|
|
144
|
+
*/
|
|
145
|
+
traceOff(): void;
|
|
146
|
+
/**
|
|
147
|
+
* makeRequest is the primitive used by the apis for making S3 requests.
|
|
148
|
+
* payload can be empty string in case of no payload.
|
|
149
|
+
* statusCode is the expected statusCode. If response.statusCode does not match
|
|
150
|
+
* we parse the XML error and call the callback with the error message.
|
|
151
|
+
*
|
|
152
|
+
* A valid region is passed by the calls - listBuckets, makeBucket and getBucketRegion.
|
|
153
|
+
*
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
makeRequestAsync(options: RequestOption, payload?: Binary, expectedCodes?: number[], region?: string): Promise<http.IncomingMessage>;
|
|
157
|
+
/**
|
|
158
|
+
* new request with promise
|
|
159
|
+
*
|
|
160
|
+
* No need to drain response, response body is not valid
|
|
161
|
+
*/
|
|
162
|
+
makeRequestAsyncOmit(options: RequestOption, payload?: Binary, statusCodes?: number[], region?: string): Promise<Omit<http.IncomingMessage, 'on'>>;
|
|
163
|
+
/**
|
|
164
|
+
* makeRequestStream will be used directly instead of makeRequest in case the payload
|
|
165
|
+
* is available as a stream. for ex. putObject
|
|
166
|
+
*
|
|
167
|
+
* @internal
|
|
168
|
+
*/
|
|
169
|
+
makeRequestStreamAsync(options: RequestOption, body: stream.Readable | Binary, sha256sum: string, statusCodes: number[], region: string): Promise<http.IncomingMessage>;
|
|
170
|
+
/**
|
|
171
|
+
* gets the region of the bucket
|
|
172
|
+
*
|
|
173
|
+
* @param bucketName
|
|
174
|
+
*
|
|
175
|
+
*/
|
|
176
|
+
getBucketRegionAsync(bucketName: string): Promise<string>;
|
|
177
|
+
/**
|
|
178
|
+
* makeRequest is the primitive used by the apis for making S3 requests.
|
|
179
|
+
* payload can be empty string in case of no payload.
|
|
180
|
+
* statusCode is the expected statusCode. If response.statusCode does not match
|
|
181
|
+
* we parse the XML error and call the callback with the error message.
|
|
182
|
+
* A valid region is passed by the calls - listBuckets, makeBucket and
|
|
183
|
+
* getBucketRegion.
|
|
184
|
+
*
|
|
185
|
+
* @deprecated use `makeRequestAsync` instead
|
|
186
|
+
*/
|
|
187
|
+
makeRequest(options: RequestOption, payload: Binary | undefined, expectedCodes: number[] | undefined, region: string | undefined, returnResponse: boolean, cb: (cb: unknown, result: http.IncomingMessage) => void): void;
|
|
188
|
+
/**
|
|
189
|
+
* makeRequestStream will be used directly instead of makeRequest in case the payload
|
|
190
|
+
* is available as a stream. for ex. putObject
|
|
191
|
+
*
|
|
192
|
+
* @deprecated use `makeRequestStreamAsync` instead
|
|
193
|
+
*/
|
|
194
|
+
makeRequestStream(options: RequestOption, stream: stream.Readable | Buffer, sha256sum: string, statusCodes: number[], region: string, returnResponse: boolean, cb: (cb: unknown, result: http.IncomingMessage) => void): void;
|
|
195
|
+
/**
|
|
196
|
+
* @deprecated use `getBucketRegionAsync` instead
|
|
197
|
+
*/
|
|
198
|
+
getBucketRegion(bucketName: string, cb: (err: unknown, region: string) => void): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Creates the bucket `bucketName`.
|
|
201
|
+
*
|
|
202
|
+
*/
|
|
203
|
+
makeBucket(bucketName: string, region?: Region, makeOpts?: MakeBucketOpt): Promise<void>;
|
|
204
|
+
/**
|
|
205
|
+
* To check if a bucket already exists.
|
|
206
|
+
*/
|
|
207
|
+
bucketExists(bucketName: string): Promise<boolean>;
|
|
208
|
+
removeBucket(bucketName: string): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* @deprecated use promise style API
|
|
211
|
+
*/
|
|
212
|
+
removeBucket(bucketName: string, callback: NoResultCallback): void;
|
|
213
|
+
/**
|
|
214
|
+
* Callback is called with readable stream of the object content.
|
|
215
|
+
*/
|
|
216
|
+
getObject(bucketName: string, objectName: string, getOpts?: GetObjectOpts): Promise<stream.Readable>;
|
|
217
|
+
/**
|
|
218
|
+
* Callback is called with readable stream of the partial object content.
|
|
219
|
+
* @param bucketName
|
|
220
|
+
* @param objectName
|
|
221
|
+
* @param offset
|
|
222
|
+
* @param length - length of the object that will be read in the stream (optional, if not specified we read the rest of the file from the offset)
|
|
223
|
+
* @param getOpts
|
|
224
|
+
*/
|
|
225
|
+
getPartialObject(bucketName: string, objectName: string, offset: number, length?: number, getOpts?: GetObjectOpts): Promise<stream.Readable>;
|
|
226
|
+
/**
|
|
227
|
+
* download object content to a file.
|
|
228
|
+
* This method will create a temp file named `${filename}.${base64(etag)}.part.s3` when downloading.
|
|
229
|
+
*
|
|
230
|
+
* @param bucketName - name of the bucket
|
|
231
|
+
* @param objectName - name of the object
|
|
232
|
+
* @param filePath - path to which the object data will be written to
|
|
233
|
+
* @param getOpts - Optional object get option
|
|
234
|
+
*/
|
|
235
|
+
fGetObject(bucketName: string, objectName: string, filePath: string, getOpts?: GetObjectOpts): Promise<void>;
|
|
236
|
+
/**
|
|
237
|
+
* Stat information of the object.
|
|
238
|
+
*/
|
|
239
|
+
statObject(bucketName: string, objectName: string, statOpts?: StatObjectOpts): Promise<BucketItemStat>;
|
|
240
|
+
removeObject(bucketName: string, objectName: string, removeOpts?: RemoveOptions): Promise<void>;
|
|
241
|
+
listIncompleteUploads(bucket: string, prefix: string, recursive: boolean): BucketStream<IncompleteUploadedBucketItem>;
|
|
242
|
+
/**
|
|
243
|
+
* Called by listIncompleteUploads to fetch a batch of incomplete uploads.
|
|
244
|
+
*/
|
|
245
|
+
listIncompleteUploadsQuery(bucketName: string, prefix: string, keyMarker: string, uploadIdMarker: string, delimiter: string): Promise<ListMultipartResult>;
|
|
246
|
+
/**
|
|
247
|
+
* Initiate a new multipart upload.
|
|
248
|
+
* @internal
|
|
249
|
+
*/
|
|
250
|
+
initiateNewMultipartUpload(bucketName: string, objectName: string, headers: RequestHeaders): Promise<string>;
|
|
251
|
+
/**
|
|
252
|
+
* Internal Method to abort a multipart upload request in case of any errors.
|
|
253
|
+
*
|
|
254
|
+
* @param bucketName - Bucket Name
|
|
255
|
+
* @param objectName - Object Name
|
|
256
|
+
* @param uploadId - id of a multipart upload to cancel during compose object sequence.
|
|
257
|
+
*/
|
|
258
|
+
abortMultipartUpload(bucketName: string, objectName: string, uploadId: string): Promise<void>;
|
|
259
|
+
findUploadId(bucketName: string, objectName: string): Promise<string | undefined>;
|
|
260
|
+
/**
|
|
261
|
+
* this call will aggregate the parts on the server into a single object.
|
|
262
|
+
*/
|
|
263
|
+
completeMultipartUpload(bucketName: string, objectName: string, uploadId: string, etags: {
|
|
264
|
+
part: number;
|
|
265
|
+
etag?: string;
|
|
266
|
+
}[]): Promise<{
|
|
267
|
+
etag: string;
|
|
268
|
+
versionId: string | null;
|
|
269
|
+
}>;
|
|
270
|
+
/**
|
|
271
|
+
* Get part-info of all parts of an incomplete upload specified by uploadId.
|
|
272
|
+
*/
|
|
273
|
+
protected listParts(bucketName: string, objectName: string, uploadId: string): Promise<UploadedPart[]>;
|
|
274
|
+
/**
|
|
275
|
+
* Called by listParts to fetch a batch of part-info
|
|
276
|
+
*/
|
|
277
|
+
private listPartsQuery;
|
|
278
|
+
listBuckets(): Promise<BucketItemFromList[]>;
|
|
279
|
+
/**
|
|
280
|
+
* Calculate part size given the object size. Part size will be atleast this.partSize
|
|
281
|
+
*/
|
|
282
|
+
calculatePartSize(size: number): number;
|
|
283
|
+
/**
|
|
284
|
+
* Uploads the object using contents from a file
|
|
285
|
+
*/
|
|
286
|
+
fPutObject(bucketName: string, objectName: string, filePath: string, metaData?: ObjectMetaData): Promise<UploadedObjectInfo>;
|
|
287
|
+
/**
|
|
288
|
+
* Uploading a stream, "Buffer" or "string".
|
|
289
|
+
* It's recommended to pass `size` argument with stream.
|
|
290
|
+
*/
|
|
291
|
+
putObject(bucketName: string, objectName: string, stream: stream.Readable | Buffer | string, size?: number, metaData?: ItemBucketMetadata): Promise<UploadedObjectInfo>;
|
|
292
|
+
/**
|
|
293
|
+
* method to upload buffer in one call
|
|
294
|
+
* @private
|
|
295
|
+
*/
|
|
296
|
+
private uploadBuffer;
|
|
297
|
+
/**
|
|
298
|
+
* upload stream with MultipartUpload
|
|
299
|
+
* @private
|
|
300
|
+
*/
|
|
301
|
+
private uploadStream;
|
|
302
|
+
removeBucketReplication(bucketName: string): Promise<void>;
|
|
303
|
+
removeBucketReplication(bucketName: string, callback: NoResultCallback): void;
|
|
304
|
+
setBucketReplication(bucketName: string, replicationConfig: ReplicationConfigOpts): void;
|
|
305
|
+
setBucketReplication(bucketName: string, replicationConfig: ReplicationConfigOpts): Promise<void>;
|
|
306
|
+
getBucketReplication(bucketName: string): void;
|
|
307
|
+
getBucketReplication(bucketName: string): Promise<ReplicationConfig>;
|
|
308
|
+
getObjectLegalHold(bucketName: string, objectName: string, getOpts?: GetObjectLegalHoldOptions, callback?: ResultCallback<LEGAL_HOLD_STATUS>): Promise<LEGAL_HOLD_STATUS>;
|
|
309
|
+
setObjectLegalHold(bucketName: string, objectName: string, setOpts?: PutObjectLegalHoldOptions): void;
|
|
310
|
+
/**
|
|
311
|
+
* Get Tags associated with a Bucket
|
|
312
|
+
*/
|
|
313
|
+
getBucketTagging(bucketName: string): Promise<Tag[]>;
|
|
314
|
+
/**
|
|
315
|
+
* Get the tags associated with a bucket OR an object
|
|
316
|
+
*/
|
|
317
|
+
getObjectTagging(bucketName: string, objectName: string, getOpts?: GetObjectOpts): Promise<Tag[]>;
|
|
318
|
+
/**
|
|
319
|
+
* Set the policy on a bucket or an object prefix.
|
|
320
|
+
*/
|
|
321
|
+
setBucketPolicy(bucketName: string, policy: string): Promise<void>;
|
|
322
|
+
/**
|
|
323
|
+
* Get the policy on a bucket or an object prefix.
|
|
324
|
+
*/
|
|
325
|
+
getBucketPolicy(bucketName: string): Promise<string>;
|
|
326
|
+
putObjectRetention(bucketName: string, objectName: string, retentionOpts?: Retention): Promise<void>;
|
|
327
|
+
getObjectLockConfig(bucketName: string, callback: ResultCallback<ObjectLockInfo>): void;
|
|
328
|
+
getObjectLockConfig(bucketName: string): void;
|
|
329
|
+
getObjectLockConfig(bucketName: string): Promise<ObjectLockInfo>;
|
|
330
|
+
setObjectLockConfig(bucketName: string, lockConfigOpts: Omit<ObjectLockInfo, 'objectLockEnabled'>): void;
|
|
331
|
+
setObjectLockConfig(bucketName: string, lockConfigOpts: Omit<ObjectLockInfo, 'objectLockEnabled'>): Promise<void>;
|
|
332
|
+
getBucketVersioning(bucketName: string): Promise<BucketVersioningConfiguration>;
|
|
333
|
+
setBucketVersioning(bucketName: string, versionConfig: BucketVersioningConfiguration): Promise<void>;
|
|
334
|
+
private setTagging;
|
|
335
|
+
private removeTagging;
|
|
336
|
+
setBucketTagging(bucketName: string, tags: Tags): Promise<void>;
|
|
337
|
+
removeBucketTagging(bucketName: string): Promise<void>;
|
|
338
|
+
setObjectTagging(bucketName: string, objectName: string, tags: Tags, putOpts?: TaggingOpts): Promise<void>;
|
|
339
|
+
removeObjectTagging(bucketName: string, objectName: string, removeOpts: TaggingOpts): Promise<void>;
|
|
340
|
+
selectObjectContent(bucketName: string, objectName: string, selectOpts: SelectOptions): Promise<SelectResults | undefined>;
|
|
341
|
+
private applyBucketLifecycle;
|
|
342
|
+
removeBucketLifecycle(bucketName: string): Promise<void>;
|
|
343
|
+
setBucketLifecycle(bucketName: string, lifeCycleConfig: LifeCycleConfigParam): Promise<void>;
|
|
344
|
+
getBucketLifecycle(bucketName: string): Promise<LifecycleConfig | null>;
|
|
345
|
+
setBucketEncryption(bucketName: string, encryptionConfig?: EncryptionConfig): Promise<void>;
|
|
346
|
+
getBucketEncryption(bucketName: string): Promise<any>;
|
|
347
|
+
removeBucketEncryption(bucketName: string): Promise<void>;
|
|
348
|
+
getObjectRetention(bucketName: string, objectName: string, getOpts?: GetObjectRetentionOpts): Promise<ObjectRetentionInfo | null | undefined>;
|
|
349
|
+
removeObjects(bucketName: string, objectsList: RemoveObjectsParam): Promise<RemoveObjectsResponse[]>;
|
|
350
|
+
removeIncompleteUpload(bucketName: string, objectName: string): Promise<void>;
|
|
351
|
+
private copyObjectV1;
|
|
352
|
+
private copyObjectV2;
|
|
353
|
+
copyObject(source: CopySourceOptions, dest: CopyDestinationOptions): Promise<CopyObjectResult>;
|
|
354
|
+
copyObject(targetBucketName: string, targetObjectName: string, sourceBucketNameAndObjectName: string, conditions?: CopyConditions): Promise<CopyObjectResult>;
|
|
355
|
+
uploadPart(partConfig: {
|
|
356
|
+
bucketName: string;
|
|
357
|
+
objectName: string;
|
|
358
|
+
uploadID: string;
|
|
359
|
+
partNumber: number;
|
|
360
|
+
headers: RequestHeaders;
|
|
361
|
+
}, payload?: Binary): Promise<{
|
|
362
|
+
etag: string;
|
|
363
|
+
key: string;
|
|
364
|
+
part: number;
|
|
365
|
+
}>;
|
|
366
|
+
composeObject(destObjConfig: CopyDestinationOptions, sourceObjList: CopySourceOptions[], {
|
|
367
|
+
maxConcurrency
|
|
368
|
+
}?: {
|
|
369
|
+
maxConcurrency?: number | undefined;
|
|
370
|
+
}): Promise<boolean | {
|
|
371
|
+
etag: string;
|
|
372
|
+
versionId: string | null;
|
|
373
|
+
} | Promise<void> | CopyObjectResult>;
|
|
374
|
+
presignedUrl(method: string, bucketName: string, objectName: string, expires?: number | PreSignRequestParams | undefined, reqParams?: PreSignRequestParams | Date, requestDate?: Date): Promise<string>;
|
|
375
|
+
presignedGetObject(bucketName: string, objectName: string, expires?: number, respHeaders?: PreSignRequestParams | Date, requestDate?: Date): Promise<string>;
|
|
376
|
+
presignedPutObject(bucketName: string, objectName: string, expires?: number): Promise<string>;
|
|
377
|
+
newPostPolicy(): PostPolicy;
|
|
378
|
+
presignedPostPolicy(postPolicy: PostPolicy): Promise<PostPolicyResult>;
|
|
379
|
+
listObjectsQuery(bucketName: string, prefix?: string, marker?: string, listQueryOpts?: ListObjectQueryOpts): Promise<{
|
|
380
|
+
objects: ObjectInfo[];
|
|
381
|
+
isTruncated?: boolean | undefined;
|
|
382
|
+
nextMarker?: string | undefined;
|
|
383
|
+
versionIdMarker?: string | undefined;
|
|
384
|
+
keyMarker?: string | undefined;
|
|
385
|
+
}>;
|
|
386
|
+
listObjects(bucketName: string, prefix?: string, recursive?: boolean, listOpts?: ListObjectQueryOpts | undefined): BucketStream<ObjectInfo>;
|
|
387
|
+
listObjectsV2Query(bucketName: string, prefix: string, continuationToken: string, delimiter: string, maxKeys: number, startAfter: string): Promise<ListObjectV2Res>;
|
|
388
|
+
listObjectsV2(bucketName: string, prefix?: string, recursive?: boolean, startAfter?: string): BucketStream<BucketItem>;
|
|
389
|
+
setBucketNotification(bucketName: string, config: NotificationConfig): Promise<void>;
|
|
390
|
+
removeAllBucketNotification(bucketName: string): Promise<void>;
|
|
391
|
+
getBucketNotification(bucketName: string): Promise<NotificationConfigResult>;
|
|
392
|
+
listenBucketNotification(bucketName: string, prefix: string, suffix: string, events: NotificationEvent[]): NotificationPoller;
|
|
393
|
+
}
|
|
394
|
+
export {};
|