@aws-amplify/storage 5.9.23 → 5.9.24
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/lib/Storage.d.ts +8 -0
- package/lib/Storage.js +8 -0
- package/lib/providers/AWSS3Provider.d.ts +3 -0
- package/lib/providers/AWSS3Provider.js +3 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/AWSS3Provider.d.ts +101 -0
- package/lib/types/Provider.d.ts +25 -0
- package/lib/types/Storage.d.ts +93 -0
- package/lib-esm/Storage.d.ts +8 -0
- package/lib-esm/Storage.js +8 -0
- package/lib-esm/providers/AWSS3Provider.d.ts +3 -0
- package/lib-esm/providers/AWSS3Provider.js +3 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/AWSS3Provider.d.ts +101 -0
- package/lib-esm/types/Provider.d.ts +25 -0
- package/lib-esm/types/Storage.d.ts +93 -0
- package/package.json +3 -3
- package/src/Storage.ts +8 -0
- package/src/providers/AWSS3Provider.ts +3 -0
- package/src/types/AWSS3Provider.ts +101 -0
- package/src/types/Provider.ts +25 -0
- package/src/types/Storage.ts +93 -0
package/src/types/Provider.ts
CHANGED
|
@@ -10,6 +10,11 @@ import {
|
|
|
10
10
|
// CAUTION: The StorageProvider interface is publicly available and allows customers to implement their own custom
|
|
11
11
|
// storage providers. Exercise caution when modifying this class as additive changes to this interface can break
|
|
12
12
|
// customers when not marked as optional.
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
15
|
+
* See the migration guide:
|
|
16
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
17
|
+
*/
|
|
13
18
|
export interface StorageProvider {
|
|
14
19
|
// you need to implement those methods
|
|
15
20
|
|
|
@@ -48,6 +53,11 @@ export interface StorageProvider {
|
|
|
48
53
|
getProviderName(): string;
|
|
49
54
|
}
|
|
50
55
|
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
58
|
+
* See the migration guide:
|
|
59
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
60
|
+
*/
|
|
51
61
|
export interface UploadTask {
|
|
52
62
|
resume(): any;
|
|
53
63
|
pause(): any;
|
|
@@ -55,6 +65,11 @@ export interface UploadTask {
|
|
|
55
65
|
isInProgress: boolean;
|
|
56
66
|
}
|
|
57
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
70
|
+
* See the migration guide:
|
|
71
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
72
|
+
*/
|
|
58
73
|
export interface StorageProviderWithCopy extends StorageProvider {
|
|
59
74
|
// copy object from src to dest
|
|
60
75
|
copy(
|
|
@@ -64,10 +79,20 @@ export interface StorageProviderWithCopy extends StorageProvider {
|
|
|
64
79
|
): Promise<any>;
|
|
65
80
|
}
|
|
66
81
|
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
84
|
+
* See the migration guide:
|
|
85
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
86
|
+
*/
|
|
67
87
|
export interface StorageProviderWithGetProperties extends StorageProvider {
|
|
68
88
|
getProperties(key: string, options?): Promise<Object>;
|
|
69
89
|
}
|
|
70
90
|
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
93
|
+
* See the migration guide:
|
|
94
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
95
|
+
*/
|
|
71
96
|
export type StorageProviderApi =
|
|
72
97
|
| 'copy'
|
|
73
98
|
| 'get'
|
package/src/types/Storage.ts
CHANGED
|
@@ -31,6 +31,11 @@ type Last<T extends any[]> = T[Exclude<keyof T, keyof Tail<T>>];
|
|
|
31
31
|
// Utility type to extract the last parameter type of a function
|
|
32
32
|
type LastParameter<F extends (...args: any) => any> = Last<Parameters<F>>;
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
36
|
+
* See the migration guide:
|
|
37
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
38
|
+
*/
|
|
34
39
|
export interface StorageOptions {
|
|
35
40
|
credentials?: ICredentials;
|
|
36
41
|
region?: string;
|
|
@@ -50,20 +55,45 @@ export interface StorageOptions {
|
|
|
50
55
|
dangerouslyConnectToHttpEndpointForTesting?: boolean;
|
|
51
56
|
}
|
|
52
57
|
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
60
|
+
* See the migration guide:
|
|
61
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
62
|
+
*/
|
|
53
63
|
export type StorageAccessLevel = 'public' | 'protected' | 'private';
|
|
54
64
|
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
67
|
+
* See the migration guide:
|
|
68
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
69
|
+
*/
|
|
55
70
|
export type CustomPrefix = {
|
|
56
71
|
[key in StorageAccessLevel]?: string;
|
|
57
72
|
};
|
|
58
73
|
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
76
|
+
* See the migration guide:
|
|
77
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
78
|
+
*/
|
|
59
79
|
export type StorageCopyTarget = {
|
|
60
80
|
key: string;
|
|
61
81
|
level?: string;
|
|
62
82
|
identityId?: string;
|
|
63
83
|
};
|
|
64
84
|
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
87
|
+
* See the migration guide:
|
|
88
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
89
|
+
*/
|
|
65
90
|
export type StorageCopySource = StorageCopyTarget;
|
|
66
91
|
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
94
|
+
* See the migration guide:
|
|
95
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
96
|
+
*/
|
|
67
97
|
export type StorageCopyDestination = Omit<StorageCopyTarget, 'identityId'>;
|
|
68
98
|
|
|
69
99
|
/**
|
|
@@ -94,6 +124,11 @@ type StorageOperationConfig<
|
|
|
94
124
|
provider: ReturnType<T['getProviderName']>;
|
|
95
125
|
};
|
|
96
126
|
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
129
|
+
* See the migration guide:
|
|
130
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
131
|
+
*/
|
|
97
132
|
export type StorageGetConfig<T extends Record<string, any>> =
|
|
98
133
|
T extends StorageProvider
|
|
99
134
|
? StorageOperationConfig<T, 'get'>
|
|
@@ -102,6 +137,11 @@ export type StorageGetConfig<T extends Record<string, any>> =
|
|
|
102
137
|
T
|
|
103
138
|
>;
|
|
104
139
|
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
142
|
+
* See the migration guide:
|
|
143
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
144
|
+
*/
|
|
105
145
|
export type StorageGetPropertiesConfig<T extends Record<string, any>> =
|
|
106
146
|
T extends StorageProviderWithGetProperties
|
|
107
147
|
? StorageOperationConfig<T, 'getProperties'>
|
|
@@ -110,6 +150,11 @@ export type StorageGetPropertiesConfig<T extends Record<string, any>> =
|
|
|
110
150
|
T
|
|
111
151
|
>;
|
|
112
152
|
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
155
|
+
* See the migration guide:
|
|
156
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
157
|
+
*/
|
|
113
158
|
export type StoragePutConfig<T extends Record<string, any>> =
|
|
114
159
|
T extends StorageProvider
|
|
115
160
|
? StorageOperationConfig<T, 'put'>
|
|
@@ -118,6 +163,11 @@ export type StoragePutConfig<T extends Record<string, any>> =
|
|
|
118
163
|
T
|
|
119
164
|
>;
|
|
120
165
|
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
168
|
+
* See the migration guide:
|
|
169
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
170
|
+
*/
|
|
121
171
|
export type StorageRemoveConfig<T extends Record<string, any>> =
|
|
122
172
|
T extends StorageProvider
|
|
123
173
|
? StorageOperationConfig<T, 'remove'>
|
|
@@ -126,6 +176,11 @@ export type StorageRemoveConfig<T extends Record<string, any>> =
|
|
|
126
176
|
T
|
|
127
177
|
>;
|
|
128
178
|
|
|
179
|
+
/**
|
|
180
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
181
|
+
* See the migration guide:
|
|
182
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
183
|
+
*/
|
|
129
184
|
export type StorageListConfig<T extends Record<string, any>> =
|
|
130
185
|
T extends StorageProvider
|
|
131
186
|
? StorageOperationConfig<T, 'list'>
|
|
@@ -134,6 +189,11 @@ export type StorageListConfig<T extends Record<string, any>> =
|
|
|
134
189
|
T
|
|
135
190
|
>;
|
|
136
191
|
|
|
192
|
+
/**
|
|
193
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
194
|
+
* See the migration guide:
|
|
195
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
196
|
+
*/
|
|
137
197
|
export type StorageCopyConfig<T extends Record<string, any>> =
|
|
138
198
|
T extends StorageProviderWithCopy
|
|
139
199
|
? StorageOperationConfig<T, 'copy'>
|
|
@@ -168,33 +228,63 @@ type PickProviderOutput<
|
|
|
168
228
|
: Promise<any>
|
|
169
229
|
: DefaultOutput;
|
|
170
230
|
|
|
231
|
+
/**
|
|
232
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
233
|
+
* See the migration guide:
|
|
234
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
235
|
+
*/
|
|
171
236
|
export type StorageGetOutput<T extends StorageProvider | Record<string, any>> =
|
|
172
237
|
PickProviderOutput<Promise<S3ProviderGetOuput<T>>, T, 'get'>;
|
|
173
238
|
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
241
|
+
* See the migration guide:
|
|
242
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
243
|
+
*/
|
|
174
244
|
export type StoragePutOutput<T> = PickProviderOutput<
|
|
175
245
|
S3ProviderPutOutput<T>,
|
|
176
246
|
T,
|
|
177
247
|
'put'
|
|
178
248
|
>;
|
|
179
249
|
|
|
250
|
+
/**
|
|
251
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
252
|
+
* See the migration guide:
|
|
253
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
254
|
+
*/
|
|
180
255
|
export type StorageRemoveOutput<T> = PickProviderOutput<
|
|
181
256
|
Promise<S3ProviderRemoveOutput>,
|
|
182
257
|
T,
|
|
183
258
|
'remove'
|
|
184
259
|
>;
|
|
185
260
|
|
|
261
|
+
/**
|
|
262
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
263
|
+
* See the migration guide:
|
|
264
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
265
|
+
*/
|
|
186
266
|
export type StorageListOutput<T> = PickProviderOutput<
|
|
187
267
|
Promise<S3ProviderListOutput>,
|
|
188
268
|
T,
|
|
189
269
|
'list'
|
|
190
270
|
>;
|
|
191
271
|
|
|
272
|
+
/**
|
|
273
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
274
|
+
* See the migration guide:
|
|
275
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
276
|
+
*/
|
|
192
277
|
export type StorageCopyOutput<T> = PickProviderOutput<
|
|
193
278
|
Promise<S3ProviderCopyOutput>,
|
|
194
279
|
T,
|
|
195
280
|
'copy'
|
|
196
281
|
>;
|
|
197
282
|
|
|
283
|
+
/**
|
|
284
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
285
|
+
* See the migration guide:
|
|
286
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
287
|
+
*/
|
|
198
288
|
export type StorageGetPropertiesOutput<T> = PickProviderOutput<
|
|
199
289
|
Promise<S3ProviderGetPropertiesOutput>,
|
|
200
290
|
T,
|
|
@@ -204,6 +294,9 @@ export type StorageGetPropertiesOutput<T> = PickProviderOutput<
|
|
|
204
294
|
/**
|
|
205
295
|
* Utility type to allow custom provider to use any config keys, if provider is set to AWSS3 then it should use
|
|
206
296
|
* AWSS3Provider's config.
|
|
297
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
298
|
+
* See the migration guide:
|
|
299
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
207
300
|
*/
|
|
208
301
|
export type StorageOperationConfigMap<
|
|
209
302
|
Default,
|