@aws-amplify/storage 5.9.22 → 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/AwsClients/S3/abortMultipartUpload.d.ts +2 -3
- package/lib/AwsClients/S3/abortMultipartUpload.js +2 -2
- package/lib/AwsClients/S3/completeMultipartUpload.d.ts +2 -3
- package/lib/AwsClients/S3/completeMultipartUpload.js +2 -2
- package/lib/AwsClients/S3/copyObject.d.ts +2 -3
- package/lib/AwsClients/S3/copyObject.js +2 -2
- package/lib/AwsClients/S3/createMultipartUpload.d.ts +2 -3
- package/lib/AwsClients/S3/createMultipartUpload.js +2 -2
- package/lib/AwsClients/S3/deleteObject.d.ts +2 -3
- package/lib/AwsClients/S3/deleteObject.js +2 -2
- package/lib/AwsClients/S3/getObject.d.ts +2 -3
- package/lib/AwsClients/S3/getObject.js +2 -2
- package/lib/AwsClients/S3/headObject.d.ts +2 -3
- package/lib/AwsClients/S3/headObject.js +2 -2
- package/lib/AwsClients/S3/listObjectsV2.d.ts +2 -3
- package/lib/AwsClients/S3/listObjectsV2.js +2 -2
- package/lib/AwsClients/S3/listParts.d.ts +2 -3
- package/lib/AwsClients/S3/listParts.js +2 -2
- package/lib/AwsClients/S3/putObject.d.ts +2 -3
- package/lib/AwsClients/S3/putObject.js +2 -2
- package/lib/AwsClients/S3/runtime/base64/index.browser.js +2 -3
- package/lib/AwsClients/S3/runtime/base64/index.native.js +2 -3
- package/lib/AwsClients/S3/runtime/contentSha256middleware.js +2 -2
- package/lib/AwsClients/S3/runtime/xhrTransferHandler.d.ts +0 -1
- package/lib/AwsClients/S3/types.d.ts +0 -1
- package/lib/AwsClients/S3/uploadPart.d.ts +2 -3
- package/lib/AwsClients/S3/uploadPart.js +2 -2
- package/lib/AwsClients/S3/utils/deserializeHelpers.d.ts +2 -2
- package/lib/AwsClients/S3/utils/parsePayload.js +2 -2
- package/lib/AwsClients/S3/utils/serializeHelpers.js +2 -2
- package/lib/Storage.d.ts +8 -0
- package/lib/Storage.js +8 -0
- package/lib/common/MD5utils.js +2 -2
- package/lib/common/MD5utils.native.js +2 -2
- package/lib/common/S3ClientUtils.d.ts +0 -1
- package/lib/common/S3ClientUtils.js +2 -2
- package/lib/common/StorageErrorStrings.js +3 -3
- package/lib/providers/AWSS3Provider.d.ts +3 -0
- package/lib/providers/AWSS3Provider.js +39 -28
- package/lib/providers/AWSS3ProviderManagedUpload.d.ts +0 -1
- package/lib/providers/AWSS3ProviderManagedUpload.js +2 -2
- package/lib/providers/AWSS3UploadTask.d.ts +0 -1
- package/lib/providers/AWSS3UploadTask.js +14 -14
- 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/AwsClients/S3/abortMultipartUpload.d.ts +2 -3
- package/lib-esm/AwsClients/S3/abortMultipartUpload.js +2 -2
- package/lib-esm/AwsClients/S3/completeMultipartUpload.d.ts +2 -3
- package/lib-esm/AwsClients/S3/completeMultipartUpload.js +2 -2
- package/lib-esm/AwsClients/S3/copyObject.d.ts +2 -3
- package/lib-esm/AwsClients/S3/copyObject.js +2 -2
- package/lib-esm/AwsClients/S3/createMultipartUpload.d.ts +2 -3
- package/lib-esm/AwsClients/S3/createMultipartUpload.js +2 -2
- package/lib-esm/AwsClients/S3/deleteObject.d.ts +2 -3
- package/lib-esm/AwsClients/S3/deleteObject.js +2 -2
- package/lib-esm/AwsClients/S3/getObject.d.ts +2 -3
- package/lib-esm/AwsClients/S3/getObject.js +2 -2
- package/lib-esm/AwsClients/S3/headObject.d.ts +2 -3
- package/lib-esm/AwsClients/S3/headObject.js +2 -2
- package/lib-esm/AwsClients/S3/listObjectsV2.d.ts +2 -3
- package/lib-esm/AwsClients/S3/listObjectsV2.js +2 -2
- package/lib-esm/AwsClients/S3/listParts.d.ts +2 -3
- package/lib-esm/AwsClients/S3/listParts.js +2 -2
- package/lib-esm/AwsClients/S3/putObject.d.ts +2 -3
- package/lib-esm/AwsClients/S3/putObject.js +2 -2
- package/lib-esm/AwsClients/S3/runtime/contentSha256middleware.js +2 -2
- package/lib-esm/AwsClients/S3/runtime/xhrTransferHandler.d.ts +0 -1
- package/lib-esm/AwsClients/S3/types.d.ts +0 -1
- package/lib-esm/AwsClients/S3/uploadPart.d.ts +2 -3
- package/lib-esm/AwsClients/S3/uploadPart.js +2 -2
- package/lib-esm/AwsClients/S3/utils/deserializeHelpers.d.ts +2 -2
- package/lib-esm/AwsClients/S3/utils/parsePayload.js +2 -2
- package/lib-esm/AwsClients/S3/utils/serializeHelpers.js +2 -2
- package/lib-esm/Storage.d.ts +8 -0
- package/lib-esm/Storage.js +8 -0
- package/lib-esm/common/MD5utils.js +2 -2
- package/lib-esm/common/MD5utils.native.js +2 -2
- package/lib-esm/common/S3ClientUtils.d.ts +0 -1
- package/lib-esm/common/S3ClientUtils.js +2 -2
- package/lib-esm/providers/AWSS3Provider.d.ts +3 -0
- package/lib-esm/providers/AWSS3Provider.js +22 -21
- package/lib-esm/providers/AWSS3ProviderManagedUpload.d.ts +0 -1
- package/lib-esm/providers/AWSS3ProviderManagedUpload.js +2 -2
- package/lib-esm/providers/AWSS3UploadTask.d.ts +0 -1
- package/lib-esm/providers/AWSS3UploadTask.js +12 -12
- 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 +24 -14
- package/src/Storage.ts +8 -0
- package/src/providers/AWSS3Provider.ts +4 -1
- package/src/types/AWSS3Provider.ts +101 -0
- package/src/types/Provider.ts +25 -0
- package/src/types/Storage.ts +93 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Endpoint } from '@aws-amplify/core/internals/aws-client-utils';
|
|
3
2
|
import type { HeadObjectCommandInput, HeadObjectCommandOutput } from './types';
|
|
4
3
|
export type HeadObjectInput = Pick<HeadObjectCommandInput, 'Bucket' | 'Key' | 'SSECustomerKey' | 'SSECustomerKeyMD5' | 'SSECustomerAlgorithm'>;
|
|
5
4
|
export type HeadObjectOutput = Pick<HeadObjectCommandOutput, '$metadata' | 'ContentLength' | 'ContentType' | 'ETag' | 'LastModified' | 'Metadata' | 'VersionId'>;
|
|
6
5
|
export declare const headObject: (config: Omit<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<import("@aws-amplify/core/internals/aws-client-utils").HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions & Partial<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<import("@aws-amplify/core/internals/aws-client-utils").HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions>, "emitter" | "responseType" | "abortSignal" | "computeDelay" | "region" | "endpointResolver" | "userAgentHeader" | "userAgentValue" | "retryDecider" | "maxAttempts" | "credentials" | "service" | "uriEscapePath"> & {
|
|
7
|
-
emitter?: import("events")
|
|
6
|
+
emitter?: import("events")<[never]>;
|
|
8
7
|
responseType?: "text" | "blob";
|
|
9
8
|
abortSignal?: AbortSignal;
|
|
10
9
|
computeDelay?: (attempt: number) => number;
|
|
@@ -14,7 +13,7 @@ export declare const headObject: (config: Omit<import("@aws-amplify/core/interna
|
|
|
14
13
|
userAgentValue?: string;
|
|
15
14
|
retryDecider?: (response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse, error?: unknown) => Promise<boolean>;
|
|
16
15
|
maxAttempts?: number;
|
|
17
|
-
credentials?: import("@aws-
|
|
16
|
+
credentials?: import("@aws-amplify/core/internals/aws-client-utils").Credentials | (() => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
18
17
|
service?: string;
|
|
19
18
|
uriEscapePath?: boolean;
|
|
20
19
|
}, input: HeadObjectInput) => Promise<HeadObjectOutput>;
|
|
@@ -21,8 +21,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g =
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Endpoint, HttpResponse } from '@aws-amplify/core/internals/aws-client-utils';
|
|
3
2
|
import type { ListObjectsV2CommandInput, ListObjectsV2CommandOutput } from './types';
|
|
4
3
|
export type ListObjectsV2Input = ListObjectsV2CommandInput;
|
|
5
4
|
export type ListObjectsV2Output = ListObjectsV2CommandOutput;
|
|
6
5
|
export declare const listObjectsV2: (config: Omit<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions & Partial<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions>, "emitter" | "responseType" | "abortSignal" | "computeDelay" | "region" | "endpointResolver" | "userAgentHeader" | "userAgentValue" | "retryDecider" | "maxAttempts" | "credentials" | "service" | "uriEscapePath"> & {
|
|
7
|
-
emitter?: import("events")
|
|
6
|
+
emitter?: import("events")<[never]>;
|
|
8
7
|
responseType?: "text" | "blob";
|
|
9
8
|
abortSignal?: AbortSignal;
|
|
10
9
|
computeDelay?: (attempt: number) => number;
|
|
@@ -14,7 +13,7 @@ export declare const listObjectsV2: (config: Omit<import("@aws-amplify/core/inte
|
|
|
14
13
|
userAgentValue?: string;
|
|
15
14
|
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
16
15
|
maxAttempts?: number;
|
|
17
|
-
credentials?: import("@aws-
|
|
16
|
+
credentials?: import("@aws-amplify/core/internals/aws-client-utils").Credentials | (() => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
18
17
|
service?: string;
|
|
19
18
|
uriEscapePath?: boolean;
|
|
20
19
|
}, input: ListObjectsV2CommandInput) => Promise<ListObjectsV2CommandOutput>;
|
|
@@ -21,8 +21,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g =
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Endpoint, HttpResponse } from '@aws-amplify/core/internals/aws-client-utils';
|
|
3
2
|
import type { ListPartsCommandInput, ListPartsCommandOutput } from './types';
|
|
4
3
|
export type ListPartsInput = Pick<ListPartsCommandInput, 'Bucket' | 'Key' | 'UploadId' | 'SSECustomerAlgorithm' | 'SSECustomerKey' | 'SSECustomerKeyMD5'>;
|
|
5
4
|
export type ListPartsOutput = Pick<ListPartsCommandOutput, 'Parts' | 'UploadId' | '$metadata'>;
|
|
6
5
|
export declare const listParts: (config: Omit<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions & Partial<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions>, "emitter" | "responseType" | "abortSignal" | "computeDelay" | "region" | "endpointResolver" | "userAgentHeader" | "userAgentValue" | "retryDecider" | "maxAttempts" | "credentials" | "service" | "uriEscapePath"> & {
|
|
7
|
-
emitter?: import("events")
|
|
6
|
+
emitter?: import("events")<[never]>;
|
|
8
7
|
responseType?: "text" | "blob";
|
|
9
8
|
abortSignal?: AbortSignal;
|
|
10
9
|
computeDelay?: (attempt: number) => number;
|
|
@@ -14,7 +13,7 @@ export declare const listParts: (config: Omit<import("@aws-amplify/core/internal
|
|
|
14
13
|
userAgentValue?: string;
|
|
15
14
|
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
16
15
|
maxAttempts?: number;
|
|
17
|
-
credentials?: import("@aws-
|
|
16
|
+
credentials?: import("@aws-amplify/core/internals/aws-client-utils").Credentials | (() => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
18
17
|
service?: string;
|
|
19
18
|
uriEscapePath?: boolean;
|
|
20
19
|
}, input: ListPartsInput) => Promise<ListPartsOutput>;
|
|
@@ -21,8 +21,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g =
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Endpoint, HttpResponse } from '@aws-amplify/core/internals/aws-client-utils';
|
|
3
2
|
import type { PutObjectCommandInput, PutObjectCommandOutput } from './types';
|
|
4
3
|
/**
|
|
@@ -7,7 +6,7 @@ import type { PutObjectCommandInput, PutObjectCommandOutput } from './types';
|
|
|
7
6
|
export type PutObjectInput = Pick<PutObjectCommandInput, 'Bucket' | 'Key' | 'Body' | 'ServerSideEncryption' | 'SSECustomerAlgorithm' | 'SSECustomerKey' | 'SSECustomerKeyMD5' | 'SSEKMSKeyId' | 'ACL' | 'CacheControl' | 'ContentDisposition' | 'ContentEncoding' | 'ContentType' | 'ContentMD5' | 'Expires' | 'Metadata' | 'Tagging'>;
|
|
8
7
|
export type PutObjectOutput = Pick<PutObjectCommandOutput, '$metadata' | 'ETag' | 'VersionId'>;
|
|
9
8
|
export declare const putObject: (config: Omit<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions & Partial<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions>, "emitter" | "responseType" | "abortSignal" | "computeDelay" | "region" | "endpointResolver" | "userAgentHeader" | "userAgentValue" | "retryDecider" | "maxAttempts" | "credentials" | "service" | "uriEscapePath"> & {
|
|
10
|
-
emitter?: import("events")
|
|
9
|
+
emitter?: import("events")<[never]>;
|
|
11
10
|
responseType?: "text" | "blob";
|
|
12
11
|
abortSignal?: AbortSignal;
|
|
13
12
|
computeDelay?: (attempt: number) => number;
|
|
@@ -17,7 +16,7 @@ export declare const putObject: (config: Omit<import("@aws-amplify/core/internal
|
|
|
17
16
|
userAgentValue?: string;
|
|
18
17
|
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
19
18
|
maxAttempts?: number;
|
|
20
|
-
credentials?: import("@aws-
|
|
19
|
+
credentials?: import("@aws-amplify/core/internals/aws-client-utils").Credentials | (() => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
21
20
|
service?: string;
|
|
22
21
|
uriEscapePath?: boolean;
|
|
23
22
|
}, input: PutObjectInput) => Promise<PutObjectOutput>;
|
|
@@ -21,8 +21,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g =
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g =
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
14
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Endpoint, HttpResponse } from '@aws-amplify/core/internals/aws-client-utils';
|
|
3
2
|
import type { UploadPartCommandInput, UploadPartCommandOutput } from './types';
|
|
4
3
|
export type UploadPartInput = Pick<UploadPartCommandInput, 'PartNumber' | 'Body' | 'UploadId' | 'Bucket' | 'Key' | 'ContentMD5' | 'SSECustomerAlgorithm' | 'SSECustomerKey' | 'SSECustomerKeyMD5'>;
|
|
5
4
|
export type UploadPartOutput = Pick<UploadPartCommandOutput, '$metadata' | 'ETag'>;
|
|
6
5
|
export declare const uploadPart: (config: Omit<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions & Partial<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions>, "emitter" | "responseType" | "abortSignal" | "computeDelay" | "region" | "endpointResolver" | "userAgentHeader" | "userAgentValue" | "retryDecider" | "maxAttempts" | "credentials" | "service" | "uriEscapePath"> & {
|
|
7
|
-
emitter?: import("events")
|
|
6
|
+
emitter?: import("events")<[never]>;
|
|
8
7
|
responseType?: "text" | "blob";
|
|
9
8
|
abortSignal?: AbortSignal;
|
|
10
9
|
computeDelay?: (attempt: number) => number;
|
|
@@ -14,7 +13,7 @@ export declare const uploadPart: (config: Omit<import("@aws-amplify/core/interna
|
|
|
14
13
|
userAgentValue?: string;
|
|
15
14
|
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
16
15
|
maxAttempts?: number;
|
|
17
|
-
credentials?: import("@aws-
|
|
16
|
+
credentials?: import("@aws-amplify/core/internals/aws-client-utils").Credentials | (() => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
18
17
|
service?: string;
|
|
19
18
|
uriEscapePath?: boolean;
|
|
20
19
|
}, input: UploadPartInput) => Promise<UploadPartOutput>;
|
|
@@ -21,8 +21,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g =
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -37,7 +37,7 @@ type InferInstructionResultType<T extends Instruction<any>> = (T extends Propert
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const map: <Instructions extends {
|
|
39
39
|
[key: string]: Instruction<any>;
|
|
40
|
-
}>(obj: Record<string, any>, instructions: Instructions) => { [K in keyof Instructions]: Instructions[K]
|
|
40
|
+
}>(obj: Record<string, any>, instructions: Instructions) => { [K in keyof Instructions]: InferInstructionResultType<Instructions[K]>; };
|
|
41
41
|
/**
|
|
42
42
|
* Deserializes a string to a number. Returns undefined if input is undefined.
|
|
43
43
|
*
|
|
@@ -70,7 +70,7 @@ export declare const deserializeTimestamp: (value: string) => Date | undefined;
|
|
|
70
70
|
*
|
|
71
71
|
* @internal
|
|
72
72
|
*/
|
|
73
|
-
export declare const emptyArrayGuard: <T extends any
|
|
73
|
+
export declare const emptyArrayGuard: <T extends Array<any>>(value: any, deserializer: (value: any[]) => T) => T;
|
|
74
74
|
/**
|
|
75
75
|
* @internal
|
|
76
76
|
*/
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g =
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
14
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g =
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
package/lib-esm/Storage.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { StorageCopySource, StorageCopyDestination, StorageGetConfig, StorageProvider, StoragePutConfig, StorageRemoveConfig, StorageListConfig, StorageCopyConfig, StorageGetOutput, StoragePutOutput, StorageRemoveOutput, StorageListOutput, StorageCopyOutput, UploadTask, StorageGetPropertiesConfig, StorageGetPropertiesOutput } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Provide storage methods to use AWS S3
|
|
4
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
5
|
+
* See the migration guide:
|
|
6
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
4
7
|
*/
|
|
5
8
|
export declare class Storage {
|
|
6
9
|
/**
|
|
@@ -104,4 +107,9 @@ export declare class Storage {
|
|
|
104
107
|
*/
|
|
105
108
|
list<T extends Record<string, any>>(key: string, config?: StorageListConfig<T>): StorageListOutput<T>;
|
|
106
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
112
|
+
* See the migration guide:
|
|
113
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
114
|
+
*/
|
|
107
115
|
export declare const StorageInstance: Storage;
|
package/lib-esm/Storage.js
CHANGED
|
@@ -36,6 +36,9 @@ var loggerStorageInstance = new Logger('Storage'); // Logging relating to Storag
|
|
|
36
36
|
var DEFAULT_PROVIDER = 'AWSS3';
|
|
37
37
|
/**
|
|
38
38
|
* Provide storage methods to use AWS S3
|
|
39
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
40
|
+
* See the migration guide:
|
|
41
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
39
42
|
*/
|
|
40
43
|
var Storage = /** @class */ (function () {
|
|
41
44
|
/**
|
|
@@ -276,5 +279,10 @@ var getInstance = function () {
|
|
|
276
279
|
};
|
|
277
280
|
return _instance;
|
|
278
281
|
};
|
|
282
|
+
/**
|
|
283
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
284
|
+
* See the migration guide:
|
|
285
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
286
|
+
*/
|
|
279
287
|
export var StorageInstance = getInstance();
|
|
280
288
|
Amplify.register(StorageInstance);
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g =
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
14
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g =
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
14
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g =
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -2,6 +2,9 @@ import { PutObjectInput } from '../AwsClients/S3';
|
|
|
2
2
|
import { StorageOptions, StorageProvider, S3ProviderGetConfig, S3ProviderGetOuput, S3ProviderPutConfig, S3ProviderRemoveConfig, S3ProviderListConfig, S3ProviderCopyConfig, S3ProviderCopyOutput, S3CopySource, S3CopyDestination, S3ProviderRemoveOutput, S3ProviderPutOutput, S3ProviderListOutput, S3ProviderGetPropertiesConfig, S3ProviderGetPropertiesOutput } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Provide storage methods to use AWS S3
|
|
5
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
6
|
+
* See the migration guide:
|
|
7
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
5
8
|
*/
|
|
6
9
|
export declare class AWSS3Provider implements StorageProvider {
|
|
7
10
|
static readonly CATEGORY = "Storage";
|
|
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g =
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -87,8 +87,11 @@ var DEFAULT_STORAGE_LEVEL = 'public';
|
|
|
87
87
|
var DEFAULT_PRESIGN_EXPIRATION = 900;
|
|
88
88
|
/**
|
|
89
89
|
* Provide storage methods to use AWS S3
|
|
90
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
91
|
+
* See the migration guide:
|
|
92
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
90
93
|
*/
|
|
91
|
-
|
|
94
|
+
var AWSS3Provider = /** @class */ (function () {
|
|
92
95
|
/**
|
|
93
96
|
* Initialize Storage with AWS configurations
|
|
94
97
|
* @param {Object} config - Configuration object for storage
|
|
@@ -134,9 +137,8 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
134
137
|
return this._config;
|
|
135
138
|
};
|
|
136
139
|
AWSS3Provider.prototype.startResumableUpload = function (addTaskInput, config) {
|
|
137
|
-
var _a;
|
|
138
140
|
var s3Config = addTaskInput.s3Config, emitter = addTaskInput.emitter, key = addTaskInput.key, file = addTaskInput.file, params = addTaskInput.params;
|
|
139
|
-
var progressCallback = config.progressCallback, completeCallback = config.completeCallback, errorCallback = config.errorCallback,
|
|
141
|
+
var progressCallback = config.progressCallback, completeCallback = config.completeCallback, errorCallback = config.errorCallback, _a = config.track, track = _a === void 0 ? false : _a;
|
|
140
142
|
if (!(file instanceof Blob)) {
|
|
141
143
|
throw new Error(StorageErrorStrings.INVALID_BLOB);
|
|
142
144
|
}
|
|
@@ -204,8 +206,7 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
204
206
|
*/
|
|
205
207
|
AWSS3Provider.prototype.copy = function (src, dest, config) {
|
|
206
208
|
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
-
var credentialsOK, opt, acl, bucket, cacheControl, expires, track, serverSideEncryption, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, SSEKMSKeyId, srcLevel, srcIdentityId, srcKey, destLevel, destKey, srcPrefix, destPrefix, finalSrcKey, finalDestKey, params, error_1;
|
|
208
|
-
var _a, _b;
|
|
209
|
+
var credentialsOK, opt, acl, bucket, cacheControl, expires, track, serverSideEncryption, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, SSEKMSKeyId, _a, srcLevel, srcIdentityId, srcKey, _b, destLevel, destKey, srcPrefix, destPrefix, finalSrcKey, finalDestKey, params, error_1;
|
|
209
210
|
return __generator(this, function (_c) {
|
|
210
211
|
switch (_c.label) {
|
|
211
212
|
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
@@ -216,8 +217,8 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
216
217
|
}
|
|
217
218
|
opt = Object.assign({}, this._config, config);
|
|
218
219
|
acl = opt.acl, bucket = opt.bucket, cacheControl = opt.cacheControl, expires = opt.expires, track = opt.track, serverSideEncryption = opt.serverSideEncryption, SSECustomerAlgorithm = opt.SSECustomerAlgorithm, SSECustomerKey = opt.SSECustomerKey, SSECustomerKeyMD5 = opt.SSECustomerKeyMD5, SSEKMSKeyId = opt.SSEKMSKeyId;
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
_a = src.level, srcLevel = _a === void 0 ? DEFAULT_STORAGE_LEVEL : _a, srcIdentityId = src.identityId, srcKey = src.key;
|
|
221
|
+
_b = dest.level, destLevel = _b === void 0 ? DEFAULT_STORAGE_LEVEL : _b, destKey = dest.key;
|
|
221
222
|
if (!srcKey || typeof srcKey !== 'string') {
|
|
222
223
|
throw new Error(StorageErrorStrings.NO_SRC_KEY);
|
|
223
224
|
}
|
|
@@ -286,10 +287,10 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
286
287
|
});
|
|
287
288
|
};
|
|
288
289
|
AWSS3Provider.prototype.get = function (key, config) {
|
|
289
|
-
var _a;
|
|
290
290
|
return __awaiter(this, void 0, void 0, function () {
|
|
291
|
-
var credentialsOK, opt, bucket, download, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, expires, track, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, progressCallback, validateObjectExistence, prefix, final_key, emitter, s3Config, params, response, error_2, error_3, url, _b, _c, error_4;
|
|
292
|
-
var _d
|
|
291
|
+
var credentialsOK, opt, bucket, download, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, expires, track, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, progressCallback, _a, validateObjectExistence, prefix, final_key, emitter, s3Config, params, response, error_2, error_3, url, _b, _c, error_4;
|
|
292
|
+
var _d;
|
|
293
|
+
var _e;
|
|
293
294
|
return __generator(this, function (_f) {
|
|
294
295
|
switch (_f.label) {
|
|
295
296
|
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
@@ -299,7 +300,7 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
299
300
|
throw new Error(StorageErrorStrings.NO_CREDENTIALS);
|
|
300
301
|
}
|
|
301
302
|
opt = Object.assign({}, this._config, config);
|
|
302
|
-
bucket = opt.bucket, download = opt.download, cacheControl = opt.cacheControl, contentDisposition = opt.contentDisposition, contentEncoding = opt.contentEncoding, contentLanguage = opt.contentLanguage, contentType = opt.contentType, expires = opt.expires, track = opt.track, SSECustomerAlgorithm = opt.SSECustomerAlgorithm, SSECustomerKey = opt.SSECustomerKey, SSECustomerKeyMD5 = opt.SSECustomerKeyMD5, progressCallback = opt.progressCallback,
|
|
303
|
+
bucket = opt.bucket, download = opt.download, cacheControl = opt.cacheControl, contentDisposition = opt.contentDisposition, contentEncoding = opt.contentEncoding, contentLanguage = opt.contentLanguage, contentType = opt.contentType, expires = opt.expires, track = opt.track, SSECustomerAlgorithm = opt.SSECustomerAlgorithm, SSECustomerKey = opt.SSECustomerKey, SSECustomerKeyMD5 = opt.SSECustomerKeyMD5, progressCallback = opt.progressCallback, _a = opt.validateObjectExistence, validateObjectExistence = _a === void 0 ? false : _a;
|
|
303
304
|
prefix = this._prefix(opt);
|
|
304
305
|
final_key = prefix + key;
|
|
305
306
|
emitter = new events.EventEmitter();
|
|
@@ -370,7 +371,7 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
370
371
|
return [3 /*break*/, 9];
|
|
371
372
|
case 8:
|
|
372
373
|
error_3 = _f.sent();
|
|
373
|
-
if (((
|
|
374
|
+
if (((_e = error_3.$metadata) === null || _e === void 0 ? void 0 : _e.httpStatusCode) === 404) {
|
|
374
375
|
dispatchStorageEvent(track, 'getSignedUrl', {
|
|
375
376
|
method: 'get',
|
|
376
377
|
result: 'failed',
|
|
@@ -381,9 +382,9 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
381
382
|
_f.trys.push([9, 12, , 13]);
|
|
382
383
|
_b = getPresignedGetObjectUrl;
|
|
383
384
|
_c = [__assign({}, s3Config)];
|
|
384
|
-
|
|
385
|
+
_d = { expiration: expires || DEFAULT_PRESIGN_EXPIRATION };
|
|
385
386
|
return [4 /*yield*/, s3Config.credentials()];
|
|
386
|
-
case 10: return [4 /*yield*/, _b.apply(void 0, [__assign.apply(void 0, _c.concat([(
|
|
387
|
+
case 10: return [4 /*yield*/, _b.apply(void 0, [__assign.apply(void 0, _c.concat([(_d.credentials = _f.sent(), _d.signingRegion = s3Config.region, _d.signingService = S3_SERVICE_NAME, _d)])), params])];
|
|
387
388
|
case 11:
|
|
388
389
|
url = _f.sent();
|
|
389
390
|
dispatchStorageEvent(track, 'getSignedUrl', { method: 'get', result: 'success' }, null, "Signed URL: ".concat(url));
|
|
@@ -407,9 +408,8 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
407
408
|
* contentLength, eTag, lastModified, metadata
|
|
408
409
|
*/
|
|
409
410
|
AWSS3Provider.prototype.getProperties = function (key, config) {
|
|
410
|
-
var _a;
|
|
411
411
|
return __awaiter(this, void 0, void 0, function () {
|
|
412
|
-
var credentialsOK, opt, bucket, track, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, prefix, final_key, s3Config, params, response, getPropertiesResponse, error_5;
|
|
412
|
+
var credentialsOK, opt, bucket, _a, track, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, prefix, final_key, s3Config, params, response, getPropertiesResponse, error_5;
|
|
413
413
|
var _b;
|
|
414
414
|
return __generator(this, function (_c) {
|
|
415
415
|
switch (_c.label) {
|
|
@@ -420,7 +420,7 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
420
420
|
throw new Error(StorageErrorStrings.NO_CREDENTIALS);
|
|
421
421
|
}
|
|
422
422
|
opt = Object.assign({}, this._config, config);
|
|
423
|
-
bucket = opt.bucket,
|
|
423
|
+
bucket = opt.bucket, _a = opt.track, track = _a === void 0 ? false : _a, SSECustomerAlgorithm = opt.SSECustomerAlgorithm, SSECustomerKey = opt.SSECustomerKey, SSECustomerKeyMD5 = opt.SSECustomerKeyMD5;
|
|
424
424
|
prefix = this._prefix(opt);
|
|
425
425
|
final_key = prefix + key;
|
|
426
426
|
logger.debug("getProperties ".concat(key, " from ").concat(final_key));
|
|
@@ -455,7 +455,7 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
455
455
|
return [2 /*return*/, getPropertiesResponse];
|
|
456
456
|
case 4:
|
|
457
457
|
error_5 = _c.sent();
|
|
458
|
-
if (((
|
|
458
|
+
if (((_b = error_5.$metadata) === null || _b === void 0 ? void 0 : _b.httpStatusCode) === 404) {
|
|
459
459
|
dispatchStorageEvent(track, 'getProperties', {
|
|
460
460
|
method: 'getProperties',
|
|
461
461
|
result: 'failed',
|
|
@@ -702,7 +702,7 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
702
702
|
listResult = _c.sent();
|
|
703
703
|
(_b = list.results).push.apply(_b, __spreadArray([], __read(listResult.results), false));
|
|
704
704
|
list.hasNextToken = listResult.hasNextToken;
|
|
705
|
-
list.nextToken =
|
|
705
|
+
list.nextToken = listResult.nextToken;
|
|
706
706
|
_c.label = 9;
|
|
707
707
|
case 9:
|
|
708
708
|
dispatchStorageEvent(track, 'list', { method: 'list', result: 'success' }, null, "".concat(list.results.length, " items returned from list operation"));
|
|
@@ -772,3 +772,4 @@ export var AWSS3Provider = /** @class */ (function () {
|
|
|
772
772
|
AWSS3Provider.PROVIDER_NAME = 'AWSS3';
|
|
773
773
|
return AWSS3Provider;
|
|
774
774
|
}());
|
|
775
|
+
export { AWSS3Provider };
|
|
@@ -21,8 +21,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g =
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g =
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -140,20 +140,20 @@ var AWSS3UploadTask = /** @class */ (function () {
|
|
|
140
140
|
configurable: true
|
|
141
141
|
});
|
|
142
142
|
AWSS3UploadTask.prototype._listSingleFile = function (_a) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var
|
|
146
|
-
return __generator(this, function (
|
|
147
|
-
switch (
|
|
143
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
144
|
+
var objectKeyPrefix, _c, Contents, obj;
|
|
145
|
+
var key = _b.key, bucket = _b.bucket;
|
|
146
|
+
return __generator(this, function (_d) {
|
|
147
|
+
switch (_d.label) {
|
|
148
148
|
case 0: return [4 /*yield*/, this.prefixPromise];
|
|
149
149
|
case 1:
|
|
150
|
-
objectKeyPrefix =
|
|
150
|
+
objectKeyPrefix = _d.sent();
|
|
151
151
|
return [4 /*yield*/, listObjectsV2(this.s3Config, {
|
|
152
152
|
Bucket: bucket,
|
|
153
153
|
Prefix: objectKeyPrefix + key,
|
|
154
154
|
})];
|
|
155
155
|
case 2:
|
|
156
|
-
|
|
156
|
+
_c = (_d.sent()).Contents, Contents = _c === void 0 ? [] : _c;
|
|
157
157
|
obj = Contents.find(function (o) { return o.Key === "".concat(objectKeyPrefix).concat(key); });
|
|
158
158
|
return [2 /*return*/, obj];
|
|
159
159
|
}
|
|
@@ -284,9 +284,9 @@ var AWSS3UploadTask = /** @class */ (function () {
|
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
286
|
AWSS3UploadTask.prototype._onPartUploadCompletion = function (_a) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return __generator(this, function (
|
|
287
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
288
|
+
var eTag = _b.eTag, partNumber = _b.partNumber, chunk = _b.chunk;
|
|
289
|
+
return __generator(this, function (_c) {
|
|
290
290
|
this.completedParts.push({
|
|
291
291
|
ETag: eTag,
|
|
292
292
|
PartNumber: partNumber,
|