@hanzo/s3 0.6.4 → 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,254 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hanzo S3 Javascript Library for Amazon S3 Compatible Cloud Storage, (C) 2016 Hanzo AI, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { EventEmitter } from 'eventemitter3'
|
|
18
|
+
import jsonLineParser from 'stream-json/jsonl/Parser.js'
|
|
19
|
+
|
|
20
|
+
import { DEFAULT_REGION } from './helpers.ts'
|
|
21
|
+
import type { TypedClient } from './internal/client.ts'
|
|
22
|
+
import { pipesetup, uriEscape } from './internal/helper.ts'
|
|
23
|
+
|
|
24
|
+
// TODO: type this
|
|
25
|
+
|
|
26
|
+
type Event = unknown
|
|
27
|
+
|
|
28
|
+
// Base class for three supported configs.
|
|
29
|
+
export class TargetConfig {
|
|
30
|
+
private Filter?: { S3Key: { FilterRule: { Name: string; Value: string }[] } }
|
|
31
|
+
private Event?: Event[]
|
|
32
|
+
private Id: unknown
|
|
33
|
+
|
|
34
|
+
setId(id: unknown) {
|
|
35
|
+
this.Id = id
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
addEvent(newevent: Event) {
|
|
39
|
+
if (!this.Event) {
|
|
40
|
+
this.Event = []
|
|
41
|
+
}
|
|
42
|
+
this.Event.push(newevent)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
addFilterSuffix(suffix: string) {
|
|
46
|
+
if (!this.Filter) {
|
|
47
|
+
this.Filter = { S3Key: { FilterRule: [] } }
|
|
48
|
+
}
|
|
49
|
+
this.Filter.S3Key.FilterRule.push({ Name: 'suffix', Value: suffix })
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
addFilterPrefix(prefix: string) {
|
|
53
|
+
if (!this.Filter) {
|
|
54
|
+
this.Filter = { S3Key: { FilterRule: [] } }
|
|
55
|
+
}
|
|
56
|
+
this.Filter.S3Key.FilterRule.push({ Name: 'prefix', Value: prefix })
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 1. Topic (simple notification service)
|
|
61
|
+
export class TopicConfig extends TargetConfig {
|
|
62
|
+
private Topic: string
|
|
63
|
+
|
|
64
|
+
constructor(arn: string) {
|
|
65
|
+
super()
|
|
66
|
+
this.Topic = arn
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 2. Queue (simple queue service)
|
|
71
|
+
export class QueueConfig extends TargetConfig {
|
|
72
|
+
private Queue: string
|
|
73
|
+
|
|
74
|
+
constructor(arn: string) {
|
|
75
|
+
super()
|
|
76
|
+
this.Queue = arn
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 3. CloudFront (lambda function)
|
|
81
|
+
export class CloudFunctionConfig extends TargetConfig {
|
|
82
|
+
private CloudFunction: string
|
|
83
|
+
|
|
84
|
+
constructor(arn: string) {
|
|
85
|
+
super()
|
|
86
|
+
this.CloudFunction = arn
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Notification config - array of target configs.
|
|
91
|
+
// Target configs can be
|
|
92
|
+
// 1. Topic (simple notification service)
|
|
93
|
+
// 2. Queue (simple queue service)
|
|
94
|
+
// 3. CloudFront (lambda function)
|
|
95
|
+
export class NotificationConfig {
|
|
96
|
+
private TopicConfiguration?: TargetConfig[]
|
|
97
|
+
private CloudFunctionConfiguration?: TargetConfig[]
|
|
98
|
+
private QueueConfiguration?: TargetConfig[]
|
|
99
|
+
|
|
100
|
+
add(target: TargetConfig) {
|
|
101
|
+
let instance: TargetConfig[] | undefined
|
|
102
|
+
if (target instanceof TopicConfig) {
|
|
103
|
+
instance = this.TopicConfiguration ??= []
|
|
104
|
+
}
|
|
105
|
+
if (target instanceof QueueConfig) {
|
|
106
|
+
instance = this.QueueConfiguration ??= []
|
|
107
|
+
}
|
|
108
|
+
if (target instanceof CloudFunctionConfig) {
|
|
109
|
+
instance = this.CloudFunctionConfiguration ??= []
|
|
110
|
+
}
|
|
111
|
+
if (instance) {
|
|
112
|
+
instance.push(target)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const buildARN = (partition: string, service: string, region: string, accountId: string, resource: string) => {
|
|
118
|
+
return 'arn:' + partition + ':' + service + ':' + region + ':' + accountId + ':' + resource
|
|
119
|
+
}
|
|
120
|
+
export const ObjectCreatedAll = 's3:ObjectCreated:*'
|
|
121
|
+
export const ObjectCreatedPut = 's3:ObjectCreated:Put'
|
|
122
|
+
export const ObjectCreatedPost = 's3:ObjectCreated:Post'
|
|
123
|
+
export const ObjectCreatedCopy = 's3:ObjectCreated:Copy'
|
|
124
|
+
export const ObjectCreatedCompleteMultipartUpload = 's3:ObjectCreated:CompleteMultipartUpload'
|
|
125
|
+
export const ObjectRemovedAll = 's3:ObjectRemoved:*'
|
|
126
|
+
export const ObjectRemovedDelete = 's3:ObjectRemoved:Delete'
|
|
127
|
+
export const ObjectRemovedDeleteMarkerCreated = 's3:ObjectRemoved:DeleteMarkerCreated'
|
|
128
|
+
export const ObjectReducedRedundancyLostObject = 's3:ReducedRedundancyLostObject'
|
|
129
|
+
export type NotificationEvent =
|
|
130
|
+
| 's3:ObjectCreated:*'
|
|
131
|
+
| 's3:ObjectCreated:Put'
|
|
132
|
+
| 's3:ObjectCreated:Post'
|
|
133
|
+
| 's3:ObjectCreated:Copy'
|
|
134
|
+
| 's3:ObjectCreated:CompleteMultipartUpload'
|
|
135
|
+
| 's3:ObjectRemoved:*'
|
|
136
|
+
| 's3:ObjectRemoved:Delete'
|
|
137
|
+
| 's3:ObjectRemoved:DeleteMarkerCreated'
|
|
138
|
+
| 's3:ReducedRedundancyLostObject'
|
|
139
|
+
| 's3:TestEvent'
|
|
140
|
+
| 's3:ObjectRestore:Post'
|
|
141
|
+
| 's3:ObjectRestore:Completed'
|
|
142
|
+
| 's3:Replication:OperationFailedReplication'
|
|
143
|
+
| 's3:Replication:OperationMissedThreshold'
|
|
144
|
+
| 's3:Replication:OperationReplicatedAfterThreshold'
|
|
145
|
+
| 's3:Replication:OperationNotTracked'
|
|
146
|
+
| string // put string at least so auto-complete could work
|
|
147
|
+
|
|
148
|
+
// TODO: type this
|
|
149
|
+
export type NotificationRecord = unknown
|
|
150
|
+
// Poll for notifications, used in #listenBucketNotification.
|
|
151
|
+
// Listening constitutes repeatedly requesting s3 whether or not any
|
|
152
|
+
// changes have occurred.
|
|
153
|
+
export class NotificationPoller extends EventEmitter<{
|
|
154
|
+
notification: (event: NotificationRecord) => void
|
|
155
|
+
error: (error: unknown) => void
|
|
156
|
+
}> {
|
|
157
|
+
private client: TypedClient
|
|
158
|
+
private bucketName: string
|
|
159
|
+
private prefix: string
|
|
160
|
+
private suffix: string
|
|
161
|
+
private events: NotificationEvent[]
|
|
162
|
+
private ending: boolean
|
|
163
|
+
|
|
164
|
+
constructor(client: TypedClient, bucketName: string, prefix: string, suffix: string, events: NotificationEvent[]) {
|
|
165
|
+
super()
|
|
166
|
+
|
|
167
|
+
this.client = client
|
|
168
|
+
this.bucketName = bucketName
|
|
169
|
+
this.prefix = prefix
|
|
170
|
+
this.suffix = suffix
|
|
171
|
+
this.events = events
|
|
172
|
+
|
|
173
|
+
this.ending = false
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Starts the polling.
|
|
177
|
+
start() {
|
|
178
|
+
this.ending = false
|
|
179
|
+
|
|
180
|
+
process.nextTick(() => {
|
|
181
|
+
this.checkForChanges()
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Stops the polling.
|
|
186
|
+
stop() {
|
|
187
|
+
this.ending = true
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
checkForChanges() {
|
|
191
|
+
// Don't continue if we're looping again but are cancelled.
|
|
192
|
+
if (this.ending) {
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const method = 'GET'
|
|
197
|
+
const queries = []
|
|
198
|
+
if (this.prefix) {
|
|
199
|
+
const prefix = uriEscape(this.prefix)
|
|
200
|
+
queries.push(`prefix=${prefix}`)
|
|
201
|
+
}
|
|
202
|
+
if (this.suffix) {
|
|
203
|
+
const suffix = uriEscape(this.suffix)
|
|
204
|
+
queries.push(`suffix=${suffix}`)
|
|
205
|
+
}
|
|
206
|
+
if (this.events) {
|
|
207
|
+
this.events.forEach((s3event) => queries.push('events=' + uriEscape(s3event)))
|
|
208
|
+
}
|
|
209
|
+
queries.sort()
|
|
210
|
+
|
|
211
|
+
let query = ''
|
|
212
|
+
if (queries.length > 0) {
|
|
213
|
+
query = `${queries.join('&')}`
|
|
214
|
+
}
|
|
215
|
+
const region = this.client.region || DEFAULT_REGION
|
|
216
|
+
|
|
217
|
+
this.client.makeRequestAsync({ method, bucketName: this.bucketName, query }, '', [200], region).then(
|
|
218
|
+
(response) => {
|
|
219
|
+
const asm = jsonLineParser.make()
|
|
220
|
+
|
|
221
|
+
pipesetup(response, asm)
|
|
222
|
+
.on('data', (data) => {
|
|
223
|
+
// Data is flushed periodically (every 5 seconds), so we should
|
|
224
|
+
// handle it after flushing from the JSON parser.
|
|
225
|
+
let records = data.value.Records
|
|
226
|
+
// If null (= no records), change to an empty array.
|
|
227
|
+
if (!records) {
|
|
228
|
+
records = []
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Iterate over the notifications and emit them individually.
|
|
232
|
+
records.forEach((record: NotificationRecord) => {
|
|
233
|
+
this.emit('notification', record)
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
// If we're done, stop.
|
|
237
|
+
if (this.ending) {
|
|
238
|
+
response?.destroy()
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
.on('error', (e) => this.emit('error', e))
|
|
242
|
+
.on('end', () => {
|
|
243
|
+
// Do it again, if we haven't cancelled yet.
|
|
244
|
+
process.nextTick(() => {
|
|
245
|
+
this.checkForChanges()
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
},
|
|
249
|
+
(e) => {
|
|
250
|
+
return this.emit('error', e)
|
|
251
|
+
},
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
}
|
package/src/s3.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hanzo S3 Javascript Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Hanzo AI, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { LEGAL_HOLD_STATUS, RETENTION_MODES, RETENTION_VALIDITY_UNITS } from './helpers.ts'
|
|
18
|
+
import { callbackify } from './internal/callbackify.ts'
|
|
19
|
+
import { TypedClient } from './internal/client.ts'
|
|
20
|
+
import { CopyConditions } from './internal/copy-conditions.ts'
|
|
21
|
+
import { PostPolicy } from './internal/post-policy.ts'
|
|
22
|
+
|
|
23
|
+
export * from './errors.ts'
|
|
24
|
+
export * from './helpers.ts'
|
|
25
|
+
export * from './notification.ts'
|
|
26
|
+
export { CopyConditions, PostPolicy }
|
|
27
|
+
export { IamAwsProvider } from './IamAwsProvider.ts'
|
|
28
|
+
export type { MakeBucketOpt } from './internal/client.ts'
|
|
29
|
+
export type { ClientOptions, NoResultCallback, RemoveOptions } from './internal/client.ts'
|
|
30
|
+
export type { Region } from './internal/s3-endpoints.ts'
|
|
31
|
+
export type {
|
|
32
|
+
BucketItem,
|
|
33
|
+
BucketItemCopy,
|
|
34
|
+
BucketItemFromList,
|
|
35
|
+
BucketItemStat,
|
|
36
|
+
BucketItemWithMetadata,
|
|
37
|
+
BucketStream,
|
|
38
|
+
EmptyObject,
|
|
39
|
+
ExistingObjectReplication,
|
|
40
|
+
GetObjectLegalHoldOptions,
|
|
41
|
+
IncompleteUploadedBucketItem,
|
|
42
|
+
InputSerialization,
|
|
43
|
+
IsoDate,
|
|
44
|
+
ItemBucketMetadata,
|
|
45
|
+
ItemBucketMetadataList,
|
|
46
|
+
LegalHoldStatus,
|
|
47
|
+
LifecycleConfig,
|
|
48
|
+
LifecycleRule,
|
|
49
|
+
MetadataItem,
|
|
50
|
+
ObjectLockInfo,
|
|
51
|
+
OutputSerialization,
|
|
52
|
+
PostPolicyResult,
|
|
53
|
+
PutObjectLegalHoldOptions,
|
|
54
|
+
ReplicaModifications,
|
|
55
|
+
ReplicationConfig,
|
|
56
|
+
ReplicationConfigOpts,
|
|
57
|
+
ReplicationRule,
|
|
58
|
+
ReplicationRuleAnd,
|
|
59
|
+
ReplicationRuleDestination,
|
|
60
|
+
ReplicationRuleFilter,
|
|
61
|
+
ReplicationRuleStatus,
|
|
62
|
+
Retention,
|
|
63
|
+
RetentionOptions,
|
|
64
|
+
ScanRange,
|
|
65
|
+
SelectOptions,
|
|
66
|
+
SelectProgress,
|
|
67
|
+
SourceSelectionCriteria,
|
|
68
|
+
Tag,
|
|
69
|
+
} from './internal/type.ts'
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated keep for backward compatible, use `RETENTION_MODES` instead
|
|
73
|
+
*/
|
|
74
|
+
export type Mode = RETENTION_MODES
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated keep for backward compatible
|
|
78
|
+
*/
|
|
79
|
+
export type LockUnit = RETENTION_VALIDITY_UNITS
|
|
80
|
+
|
|
81
|
+
export type VersioningConfig = Record<string | number | symbol, unknown>
|
|
82
|
+
export type TagList = Record<string, string>
|
|
83
|
+
|
|
84
|
+
export interface LockConfig {
|
|
85
|
+
mode: RETENTION_MODES
|
|
86
|
+
unit: RETENTION_VALIDITY_UNITS
|
|
87
|
+
validity: number
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface LegalHoldOptions {
|
|
91
|
+
versionId: string
|
|
92
|
+
status: LEGAL_HOLD_STATUS
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface SourceObjectStats {
|
|
96
|
+
size: number
|
|
97
|
+
metaData: string
|
|
98
|
+
lastModicied: Date
|
|
99
|
+
versionId: string
|
|
100
|
+
etag: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export class Client extends TypedClient {}
|
|
104
|
+
|
|
105
|
+
// refactored API use promise internally
|
|
106
|
+
Client.prototype.makeBucket = callbackify(Client.prototype.makeBucket)
|
|
107
|
+
Client.prototype.bucketExists = callbackify(Client.prototype.bucketExists)
|
|
108
|
+
Client.prototype.removeBucket = callbackify(Client.prototype.removeBucket)
|
|
109
|
+
Client.prototype.listBuckets = callbackify(Client.prototype.listBuckets)
|
|
110
|
+
|
|
111
|
+
Client.prototype.getObject = callbackify(Client.prototype.getObject)
|
|
112
|
+
Client.prototype.fGetObject = callbackify(Client.prototype.fGetObject)
|
|
113
|
+
Client.prototype.getPartialObject = callbackify(Client.prototype.getPartialObject)
|
|
114
|
+
Client.prototype.statObject = callbackify(Client.prototype.statObject)
|
|
115
|
+
Client.prototype.putObjectRetention = callbackify(Client.prototype.putObjectRetention)
|
|
116
|
+
Client.prototype.putObject = callbackify(Client.prototype.putObject)
|
|
117
|
+
Client.prototype.fPutObject = callbackify(Client.prototype.fPutObject)
|
|
118
|
+
Client.prototype.removeObject = callbackify(Client.prototype.removeObject)
|
|
119
|
+
|
|
120
|
+
Client.prototype.removeBucketReplication = callbackify(Client.prototype.removeBucketReplication)
|
|
121
|
+
Client.prototype.setBucketReplication = callbackify(Client.prototype.setBucketReplication)
|
|
122
|
+
Client.prototype.getBucketReplication = callbackify(Client.prototype.getBucketReplication)
|
|
123
|
+
Client.prototype.getObjectLegalHold = callbackify(Client.prototype.getObjectLegalHold)
|
|
124
|
+
Client.prototype.setObjectLegalHold = callbackify(Client.prototype.setObjectLegalHold)
|
|
125
|
+
Client.prototype.setObjectLockConfig = callbackify(Client.prototype.setObjectLockConfig)
|
|
126
|
+
Client.prototype.getObjectLockConfig = callbackify(Client.prototype.getObjectLockConfig)
|
|
127
|
+
Client.prototype.getBucketPolicy = callbackify(Client.prototype.getBucketPolicy)
|
|
128
|
+
Client.prototype.setBucketPolicy = callbackify(Client.prototype.setBucketPolicy)
|
|
129
|
+
Client.prototype.getBucketTagging = callbackify(Client.prototype.getBucketTagging)
|
|
130
|
+
Client.prototype.getObjectTagging = callbackify(Client.prototype.getObjectTagging)
|
|
131
|
+
Client.prototype.setBucketTagging = callbackify(Client.prototype.setBucketTagging)
|
|
132
|
+
Client.prototype.removeBucketTagging = callbackify(Client.prototype.removeBucketTagging)
|
|
133
|
+
Client.prototype.setObjectTagging = callbackify(Client.prototype.setObjectTagging)
|
|
134
|
+
Client.prototype.removeObjectTagging = callbackify(Client.prototype.removeObjectTagging)
|
|
135
|
+
Client.prototype.getBucketVersioning = callbackify(Client.prototype.getBucketVersioning)
|
|
136
|
+
Client.prototype.setBucketVersioning = callbackify(Client.prototype.setBucketVersioning)
|
|
137
|
+
Client.prototype.selectObjectContent = callbackify(Client.prototype.selectObjectContent)
|
|
138
|
+
Client.prototype.setBucketLifecycle = callbackify(Client.prototype.setBucketLifecycle)
|
|
139
|
+
Client.prototype.getBucketLifecycle = callbackify(Client.prototype.getBucketLifecycle)
|
|
140
|
+
Client.prototype.removeBucketLifecycle = callbackify(Client.prototype.removeBucketLifecycle)
|
|
141
|
+
Client.prototype.setBucketEncryption = callbackify(Client.prototype.setBucketEncryption)
|
|
142
|
+
Client.prototype.getBucketEncryption = callbackify(Client.prototype.getBucketEncryption)
|
|
143
|
+
Client.prototype.removeBucketEncryption = callbackify(Client.prototype.removeBucketEncryption)
|
|
144
|
+
Client.prototype.getObjectRetention = callbackify(Client.prototype.getObjectRetention)
|
|
145
|
+
Client.prototype.removeObjects = callbackify(Client.prototype.removeObjects)
|
|
146
|
+
Client.prototype.removeIncompleteUpload = callbackify(Client.prototype.removeIncompleteUpload)
|
|
147
|
+
Client.prototype.copyObject = callbackify(Client.prototype.copyObject)
|
|
148
|
+
Client.prototype.composeObject = callbackify(Client.prototype.composeObject)
|
|
149
|
+
Client.prototype.presignedUrl = callbackify(Client.prototype.presignedUrl)
|
|
150
|
+
Client.prototype.presignedGetObject = callbackify(Client.prototype.presignedGetObject)
|
|
151
|
+
Client.prototype.presignedPutObject = callbackify(Client.prototype.presignedPutObject)
|
|
152
|
+
Client.prototype.presignedPostPolicy = callbackify(Client.prototype.presignedPostPolicy)
|
|
153
|
+
Client.prototype.setBucketNotification = callbackify(Client.prototype.setBucketNotification)
|
|
154
|
+
Client.prototype.getBucketNotification = callbackify(Client.prototype.getBucketNotification)
|
|
155
|
+
Client.prototype.removeAllBucketNotification = callbackify(Client.prototype.removeAllBucketNotification)
|