@aws-amplify/storage 6.8.4-unstable.893d9cf.0 → 6.8.5-unstable.3c4d29e.0
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/dist/cjs/errors/types/validation.js +1 -1
- package/dist/cjs/errors/types/validation.js.map +1 -1
- package/dist/cjs/errors/utils/assertValidationError.js +1 -2
- package/dist/cjs/errors/utils/assertValidationError.js.map +1 -1
- package/dist/cjs/internals/apis/list.js +1 -2
- package/dist/cjs/internals/apis/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/copy.js +1 -2
- package/dist/cjs/providers/s3/apis/copy.js.map +1 -1
- package/dist/cjs/providers/s3/apis/downloadData.js +1 -2
- package/dist/cjs/providers/s3/apis/downloadData.js.map +1 -1
- package/dist/cjs/providers/s3/apis/getProperties.js +1 -2
- package/dist/cjs/providers/s3/apis/getProperties.js.map +1 -1
- package/dist/cjs/providers/s3/apis/getUrl.js +1 -2
- package/dist/cjs/providers/s3/apis/getUrl.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/copy.js +1 -1
- package/dist/cjs/providers/s3/apis/internal/copy.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadCache.js +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadCache.js.map +1 -1
- package/dist/cjs/providers/s3/apis/list.js +1 -2
- package/dist/cjs/providers/s3/apis/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/remove.js +1 -2
- package/dist/cjs/providers/s3/apis/remove.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/copy.js +1 -2
- package/dist/cjs/providers/s3/apis/server/copy.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/getProperties.js +1 -2
- package/dist/cjs/providers/s3/apis/server/getProperties.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/getUrl.js +1 -2
- package/dist/cjs/providers/s3/apis/server/getUrl.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/list.js +1 -2
- package/dist/cjs/providers/s3/apis/server/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/remove.js +1 -2
- package/dist/cjs/providers/s3/apis/server/remove.js.map +1 -1
- package/dist/cjs/providers/s3/apis/uploadData.js +1 -2
- package/dist/cjs/providers/s3/apis/uploadData.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/base64/index.browser.js +1 -2
- package/dist/cjs/providers/s3/utils/client/runtime/base64/index.browser.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js +1 -2
- package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/deleteObject.js +5 -1
- package/dist/cjs/providers/s3/utils/client/s3data/deleteObject.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/listObjectsV2.js +4 -3
- package/dist/cjs/providers/s3/utils/client/s3data/listObjectsV2.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js +15 -1
- package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/serializeHelpers.js +2 -2
- package/dist/cjs/providers/s3/utils/client/utils/serializeHelpers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/userAgent.js +1 -2
- package/dist/cjs/providers/s3/utils/userAgent.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateMultipartUploadXML.js +1 -2
- package/dist/cjs/providers/s3/utils/validateMultipartUploadXML.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateObjectUrl.js +1 -2
- package/dist/cjs/providers/s3/utils/validateObjectUrl.js.map +1 -1
- package/dist/esm/internals/apis/copy.d.ts +2 -1
- package/dist/esm/internals/apis/getUrl.d.ts +2 -1
- package/dist/esm/internals/apis/listPaths/resolveLocationsForCurrentSession.d.ts +2 -2
- package/dist/esm/internals/apis/uploadData.d.ts +2 -1
- package/dist/esm/providers/s3/apis/internal/copy.mjs +1 -1
- package/dist/esm/providers/s3/apis/internal/copy.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/downloadData.d.ts +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.d.ts +2 -2
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.mjs +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3control/getDataAccess.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/s3control/listCallerAccessGrants.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/s3data/abortMultipartUpload.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/completeMultipartUpload.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/copyObject.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.d.ts +5 -5
- package/dist/esm/providers/s3/utils/client/s3data/deleteObject.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/deleteObject.mjs +5 -2
- package/dist/esm/providers/s3/utils/client/s3data/deleteObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/getObject.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/headObject.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.d.ts +5 -5
- package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.mjs +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/listParts.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/putObject.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/s3data/types.d.ts +3473 -907
- package/dist/esm/providers/s3/utils/client/s3data/uploadPart.d.ts +4 -4
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.d.ts +16 -3
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs +14 -1
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/integrityHelpers.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/utils/parsePayload.d.ts +1 -1
- package/dist/esm/providers/s3/utils/hexUtils.d.ts +2 -2
- package/package.json +8 -9
- package/s3/package.json +1 -1
- package/src/providers/s3/apis/internal/list.ts +1 -1
- package/src/providers/s3/utils/client/s3data/deleteObject.ts +6 -1
- package/src/providers/s3/utils/client/s3data/listObjectsV2.ts +6 -3
- package/src/providers/s3/utils/client/s3data/types.ts +3470 -908
- package/src/providers/s3/utils/client/utils/deserializeHelpers.ts +17 -2
|
@@ -9,6 +9,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
9
9
|
const composers_1 = require("@aws-amplify/core/internals/aws-client-utils/composers");
|
|
10
10
|
const utils_2 = require("../utils");
|
|
11
11
|
const validateObjectUrl_1 = require("../../validateObjectUrl");
|
|
12
|
+
const deserializeHelpers_1 = require("../utils/deserializeHelpers");
|
|
12
13
|
const base_1 = require("./base");
|
|
13
14
|
const deleteObjectSerializer = (input, endpoint) => {
|
|
14
15
|
const url = new utils_1.AmplifyUrl(endpoint.url.toString());
|
|
@@ -40,7 +41,10 @@ const deleteObjectDeserializer = async (response) => {
|
|
|
40
41
|
const content = (0, utils_2.map)(response.headers, {
|
|
41
42
|
DeleteMarker: ['x-amz-delete-marker', utils_2.deserializeBoolean],
|
|
42
43
|
VersionId: 'x-amz-version-id',
|
|
43
|
-
RequestCharged:
|
|
44
|
+
RequestCharged: [
|
|
45
|
+
'x-amz-request-charged',
|
|
46
|
+
(deserializeHelpers_1.deserializeStringTag),
|
|
47
|
+
],
|
|
44
48
|
});
|
|
45
49
|
return {
|
|
46
50
|
...content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteObject.js","sources":["../../../../../../../src/providers/s3/utils/client/s3data/deleteObject.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteObject = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst utils_2 = require(\"../utils\");\nconst validateObjectUrl_1 = require(\"../../validateObjectUrl\");\nconst base_1 = require(\"./base\");\nconst deleteObjectSerializer = (input, endpoint) => {\n const url = new utils_1.AmplifyUrl(endpoint.url.toString());\n (0, utils_2.validateS3RequiredParameter)(!!input.Key, 'Key');\n url.pathname = (0, utils_2.serializePathnameObjectKey)(url, input.Key);\n url.search = new utils_1.AmplifyUrlSearchParams({\n 'x-id': 'DeleteObject',\n }).toString();\n (0, validateObjectUrl_1.validateObjectUrl)({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const headers = (0, utils_2.assignStringVariables)({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n return {\n method: 'DELETE',\n headers,\n url,\n };\n};\nconst deleteObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw (0, utils_2.buildStorageServiceError)((await (0, base_1.parseXmlError)(response)));\n }\n else {\n const content = (0, utils_2.map)(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', utils_2.deserializeBoolean],\n VersionId: 'x-amz-version-id',\n RequestCharged: 'x-amz-request-charged',\n });\n return {\n ...content,\n $metadata: (0, aws_client_utils_1.parseMetadata)(response),\n };\n }\n};\nexports.deleteObject = (0, composers_1.composeServiceApi)(utils_2.s3TransferHandler, deleteObjectSerializer, deleteObjectDeserializer, { ...base_1.defaultConfig, responseType: 'text' });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,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AE,QAAQ;AACxB,QAAQ,OAAO;AACf,QAAQ,GAAG;AACX,KAAK;AACL,CAAC;AACD,MAAM,wBAAwB,GAAG,OAAO,QAAQ,KAAK;AACrD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC;AACA,QAAQ,MAAM,IAAI,OAAO,CAAC,wBAAwB,GAAG,MAAM,IAAI,MAAM,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE;AAChG;AACA,SAAS;AACT,QAAQ,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAE;AAC3D,YAAY,YAAY,EAAE,CAAC,qBAAqB,EAAE,OAAO,CAAC,kBAAkB,CAAC;AAC7E,YAAY,SAAS,EAAE,kBAAkB;AACzC,YAAY,cAAc,EAAE,uBAAuB;
|
|
1
|
+
{"version":3,"file":"deleteObject.js","sources":["../../../../../../../src/providers/s3/utils/client/s3data/deleteObject.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteObject = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst utils_2 = require(\"../utils\");\nconst validateObjectUrl_1 = require(\"../../validateObjectUrl\");\nconst deserializeHelpers_1 = require(\"../utils/deserializeHelpers\");\nconst base_1 = require(\"./base\");\nconst deleteObjectSerializer = (input, endpoint) => {\n const url = new utils_1.AmplifyUrl(endpoint.url.toString());\n (0, utils_2.validateS3RequiredParameter)(!!input.Key, 'Key');\n url.pathname = (0, utils_2.serializePathnameObjectKey)(url, input.Key);\n url.search = new utils_1.AmplifyUrlSearchParams({\n 'x-id': 'DeleteObject',\n }).toString();\n (0, validateObjectUrl_1.validateObjectUrl)({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const headers = (0, utils_2.assignStringVariables)({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n return {\n method: 'DELETE',\n headers,\n url,\n };\n};\nconst deleteObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw (0, utils_2.buildStorageServiceError)((await (0, base_1.parseXmlError)(response)));\n }\n else {\n const content = (0, utils_2.map)(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', utils_2.deserializeBoolean],\n VersionId: 'x-amz-version-id',\n RequestCharged: [\n 'x-amz-request-charged',\n (deserializeHelpers_1.deserializeStringTag),\n ],\n });\n return {\n ...content,\n $metadata: (0, aws_client_utils_1.parseMetadata)(response),\n };\n }\n};\nexports.deleteObject = (0, composers_1.composeServiceApi)(utils_2.s3TransferHandler, deleteObjectSerializer, deleteObjectDeserializer, { ...base_1.defaultConfig, responseType: 'text' });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,wDAAwD,CAAC;AACrF,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC9D,MAAM,oBAAoB,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACnE,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AACpD,IAAI,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,C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,YAAY,cAAc,EAAE;AAC5B,gBAAgB,uBAAuB;AACvC,iBAAiB,oBAAoB,CAAC,oBAAoB;AAC1D,aAAa;AACb,SAAS,CAAC;AACV,QAAQ,OAAO;AACf,YAAY,GAAG,OAAO;AACtB,YAAY,SAAS,EAAE,IAAI,kBAAkB,CAAC,aAAa,EAAE,QAAQ,CAAC;AACtE,SAAS;AACT;AACA,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,EAAE,GAAG,MAAM,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;;"}
|
|
@@ -9,6 +9,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
9
9
|
const composers_1 = require("@aws-amplify/core/internals/aws-client-utils/composers");
|
|
10
10
|
const utils_2 = require("../utils");
|
|
11
11
|
const IntegrityError_1 = require("../../../../../errors/IntegrityError");
|
|
12
|
+
const deserializeHelpers_1 = require("../utils/deserializeHelpers");
|
|
12
13
|
const base_1 = require("./base");
|
|
13
14
|
const listObjectsV2Serializer = (input, endpoint) => {
|
|
14
15
|
const headers = (0, utils_2.assignStringVariables)({
|
|
@@ -51,7 +52,7 @@ const listObjectsV2Deserializer = async (response) => {
|
|
|
51
52
|
],
|
|
52
53
|
ContinuationToken: 'ContinuationToken',
|
|
53
54
|
Delimiter: 'Delimiter',
|
|
54
|
-
EncodingType: 'EncodingType',
|
|
55
|
+
EncodingType: ['EncodingType', (deserializeHelpers_1.deserializeStringTag)],
|
|
55
56
|
IsTruncated: ['IsTruncated', utils_2.deserializeBoolean],
|
|
56
57
|
KeyCount: ['KeyCount', utils_2.deserializeNumber],
|
|
57
58
|
MaxKeys: ['MaxKeys', utils_2.deserializeNumber],
|
|
@@ -82,10 +83,10 @@ const deserializeObject = (output) => (0, utils_2.map)(output, {
|
|
|
82
83
|
value => (0, utils_2.emptyArrayGuard)(value, deserializeChecksumAlgorithmList),
|
|
83
84
|
],
|
|
84
85
|
Size: ['Size', utils_2.deserializeNumber],
|
|
85
|
-
StorageClass: 'StorageClass',
|
|
86
|
+
StorageClass: ['StorageClass', (deserializeHelpers_1.deserializeStringTag)],
|
|
86
87
|
Owner: ['Owner', deserializeOwner],
|
|
87
88
|
});
|
|
88
|
-
const deserializeChecksumAlgorithmList = (output) => output.map(
|
|
89
|
+
const deserializeChecksumAlgorithmList = (output) => output.map((deserializeHelpers_1.deserializeStringTag));
|
|
89
90
|
const deserializeOwner = (output) => (0, utils_2.map)(output, { DisplayName: 'DisplayName', ID: 'ID' });
|
|
90
91
|
const validateCorroboratingElements = (response) => {
|
|
91
92
|
const { IsTruncated, KeyCount, Contents = [], CommonPrefixes = [], NextContinuationToken, } = response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listObjectsV2.js","sources":["../../../../../../../src/providers/s3/utils/client/s3data/listObjectsV2.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.listObjectsV2 = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst utils_2 = require(\"../utils\");\nconst IntegrityError_1 = require(\"../../../../../errors/IntegrityError\");\nconst base_1 = require(\"./base\");\nconst listObjectsV2Serializer = (input, endpoint) => {\n const headers = (0, utils_2.assignStringVariables)({\n 'x-amz-request-payer': input.RequestPayer,\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n const query = (0, utils_2.assignStringVariables)({\n 'list-type': '2',\n 'continuation-token': input.ContinuationToken,\n delimiter: input.Delimiter,\n 'encoding-type': input.EncodingType,\n 'fetch-owner': input.FetchOwner,\n 'max-keys': input.MaxKeys,\n prefix: input.Prefix,\n 'start-after': input.StartAfter,\n });\n const url = new utils_1.AmplifyUrl(endpoint.url.toString());\n url.search = new utils_1.AmplifyUrlSearchParams(query).toString();\n return {\n method: 'GET',\n headers,\n url,\n };\n};\nconst listObjectsV2Deserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw (0, utils_2.buildStorageServiceError)((await (0, base_1.parseXmlError)(response)));\n }\n else {\n const parsed = await (0, utils_2.parseXmlBody)(response);\n const contents = (0, utils_2.map)(parsed, {\n CommonPrefixes: [\n 'CommonPrefixes',\n value => (0, utils_2.emptyArrayGuard)(value, deserializeCommonPrefixList),\n ],\n Contents: [\n 'Contents',\n value => (0, utils_2.emptyArrayGuard)(value, deserializeObjectList),\n ],\n ContinuationToken: 'ContinuationToken',\n Delimiter: 'Delimiter',\n EncodingType: 'EncodingType',\n IsTruncated: ['IsTruncated', utils_2.deserializeBoolean],\n KeyCount: ['KeyCount', utils_2.deserializeNumber],\n MaxKeys: ['MaxKeys', utils_2.deserializeNumber],\n Name: 'Name',\n NextContinuationToken: 'NextContinuationToken',\n Prefix: 'Prefix',\n StartAfter: 'StartAfter',\n });\n const output = {\n $metadata: (0, aws_client_utils_1.parseMetadata)(response),\n ...contents,\n };\n validateCorroboratingElements(output);\n return output;\n }\n};\nconst deserializeCommonPrefixList = (output) => output.map(deserializeCommonPrefix);\nconst deserializeCommonPrefix = (output) => (0, utils_2.map)(output, {\n Prefix: 'Prefix',\n});\nconst deserializeObjectList = (output) => output.map(deserializeObject);\nconst deserializeObject = (output) => (0, utils_2.map)(output, {\n Key: 'Key',\n LastModified: ['LastModified', utils_2.deserializeTimestamp],\n ETag: 'ETag',\n ChecksumAlgorithm: [\n 'ChecksumAlgorithm',\n value => (0, utils_2.emptyArrayGuard)(value, deserializeChecksumAlgorithmList),\n ],\n Size: ['Size', utils_2.deserializeNumber],\n StorageClass: 'StorageClass',\n Owner: ['Owner', deserializeOwner],\n});\nconst deserializeChecksumAlgorithmList = (output) => output.map(
|
|
1
|
+
{"version":3,"file":"listObjectsV2.js","sources":["../../../../../../../src/providers/s3/utils/client/s3data/listObjectsV2.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.listObjectsV2 = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst utils_2 = require(\"../utils\");\nconst IntegrityError_1 = require(\"../../../../../errors/IntegrityError\");\nconst deserializeHelpers_1 = require(\"../utils/deserializeHelpers\");\nconst base_1 = require(\"./base\");\nconst listObjectsV2Serializer = (input, endpoint) => {\n const headers = (0, utils_2.assignStringVariables)({\n 'x-amz-request-payer': input.RequestPayer,\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n const query = (0, utils_2.assignStringVariables)({\n 'list-type': '2',\n 'continuation-token': input.ContinuationToken,\n delimiter: input.Delimiter,\n 'encoding-type': input.EncodingType,\n 'fetch-owner': input.FetchOwner,\n 'max-keys': input.MaxKeys,\n prefix: input.Prefix,\n 'start-after': input.StartAfter,\n });\n const url = new utils_1.AmplifyUrl(endpoint.url.toString());\n url.search = new utils_1.AmplifyUrlSearchParams(query).toString();\n return {\n method: 'GET',\n headers,\n url,\n };\n};\nconst listObjectsV2Deserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw (0, utils_2.buildStorageServiceError)((await (0, base_1.parseXmlError)(response)));\n }\n else {\n const parsed = await (0, utils_2.parseXmlBody)(response);\n const contents = (0, utils_2.map)(parsed, {\n CommonPrefixes: [\n 'CommonPrefixes',\n value => (0, utils_2.emptyArrayGuard)(value, deserializeCommonPrefixList),\n ],\n Contents: [\n 'Contents',\n value => (0, utils_2.emptyArrayGuard)(value, deserializeObjectList),\n ],\n ContinuationToken: 'ContinuationToken',\n Delimiter: 'Delimiter',\n EncodingType: ['EncodingType', (deserializeHelpers_1.deserializeStringTag)],\n IsTruncated: ['IsTruncated', utils_2.deserializeBoolean],\n KeyCount: ['KeyCount', utils_2.deserializeNumber],\n MaxKeys: ['MaxKeys', utils_2.deserializeNumber],\n Name: 'Name',\n NextContinuationToken: 'NextContinuationToken',\n Prefix: 'Prefix',\n StartAfter: 'StartAfter',\n });\n const output = {\n $metadata: (0, aws_client_utils_1.parseMetadata)(response),\n ...contents,\n };\n validateCorroboratingElements(output);\n return output;\n }\n};\nconst deserializeCommonPrefixList = (output) => output.map(deserializeCommonPrefix);\nconst deserializeCommonPrefix = (output) => (0, utils_2.map)(output, {\n Prefix: 'Prefix',\n});\nconst deserializeObjectList = (output) => output.map(deserializeObject);\nconst deserializeObject = (output) => (0, utils_2.map)(output, {\n Key: 'Key',\n LastModified: ['LastModified', utils_2.deserializeTimestamp],\n ETag: 'ETag',\n ChecksumAlgorithm: [\n 'ChecksumAlgorithm',\n value => (0, utils_2.emptyArrayGuard)(value, deserializeChecksumAlgorithmList),\n ],\n Size: ['Size', utils_2.deserializeNumber],\n StorageClass: ['StorageClass', (deserializeHelpers_1.deserializeStringTag)],\n Owner: ['Owner', deserializeOwner],\n});\nconst deserializeChecksumAlgorithmList = (output) => output.map((deserializeHelpers_1.deserializeStringTag));\nconst deserializeOwner = (output) => (0, utils_2.map)(output, { DisplayName: 'DisplayName', ID: 'ID' });\nconst validateCorroboratingElements = (response) => {\n const { IsTruncated, KeyCount, Contents = [], CommonPrefixes = [], NextContinuationToken, } = response;\n const validTruncation = (IsTruncated && !!NextContinuationToken) ||\n (!IsTruncated && !NextContinuationToken);\n const validNumberOfKeysReturned = KeyCount === Contents.length + CommonPrefixes.length;\n if (!validTruncation || !validNumberOfKeysReturned) {\n throw new IntegrityError_1.IntegrityError({ metadata: response.$metadata });\n }\n};\nexports.listObjectsV2 = (0, composers_1.composeServiceApi)(utils_2.s3TransferHandler, listObjectsV2Serializer, listObjectsV2Deserializer, { ...base_1.defaultConfig, responseType: 'text' });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,wDAAwD,CAAC;AACrF,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,gBAAgB,GAAG,OAAO,CAAC,sCAAsC,CAAC;AACxE,MAAM,oBAAoB,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACnE,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AACrD,IAAI,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,qBAAqB,EAAE;AACvD,QAAQ,qBAAqB,EAAE,KAAK,CAAC,YAAY;AACjD,QAAQ,6BAA6B,EAAE,KAAK,CAAC,mBAAmB;AAChE,KAAK,CAAC;AACN,IAAI,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,qBAAqB,EAAE;AACrD,QAAQ,WAAW,EAAE,GAAG;AACxB,QAAQ,oBAAoB,EAAE,KAAK,CAAC,iBAAiB;AACrD,QAAQ,SAAS,EAAE,KAAK,CAAC,SAAS;AAClC,QAAQ,eAAe,EAAE,KAAK,CAAC,YAAY;AAC3C,QAAQ,aAAa,EAAE,KAAK,CAAC,UAAU;AACvC,QAAQ,UAAU,EAAE,KAAK,CAAC,OAAO;AACjC,QAAQ,MAAM,EAAE,KAAK,CAAC,MAAM;AAC5B,QAAQ,aAAa,EAAE,KAAK,C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|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.deserializeCompletedPartList = exports.buildStorageServiceError = exports.deserializeMetadata = exports.emptyArrayGuard = exports.createStringEnumDeserializer = exports.deserializeTimestamp = exports.deserializeBoolean = exports.deserializeNumber = exports.map = void 0;
|
|
6
|
+
exports.deserializeCompletedPartList = exports.buildStorageServiceError = exports.deserializeMetadata = exports.emptyArrayGuard = exports.deserializeStringTag = exports.createStringEnumDeserializer = exports.deserializeTimestamp = exports.deserializeBoolean = exports.deserializeNumber = exports.map = void 0;
|
|
7
7
|
const StorageError_1 = require("../../../../../errors/StorageError");
|
|
8
8
|
/**
|
|
9
9
|
* Maps an object to a new object using the provided instructions.
|
|
@@ -90,6 +90,9 @@ exports.deserializeTimestamp = deserializeTimestamp;
|
|
|
90
90
|
* Create a function deserializing a string to an enum value. If the string is not a valid enum value, it throws a
|
|
91
91
|
* StorageError.
|
|
92
92
|
*
|
|
93
|
+
* This utility is ONLY preferred if the enum value is critical. Since the enum values are hard-coded, new enum values
|
|
94
|
+
* returned from service would break the library.
|
|
95
|
+
*
|
|
93
96
|
* @example
|
|
94
97
|
* ```typescript
|
|
95
98
|
* const deserializeStringEnum = createStringEnumDeserializer(['a', 'b', 'c'] as const, 'FieldName');
|
|
@@ -119,6 +122,17 @@ const createStringEnumDeserializer = (enumValues, fieldName) => {
|
|
|
119
122
|
return deserializeStringEnum;
|
|
120
123
|
};
|
|
121
124
|
exports.createStringEnumDeserializer = createStringEnumDeserializer;
|
|
125
|
+
/**
|
|
126
|
+
* Deserializes a string to a string tag type. The function simply casts the parsed string into a given string tag type.
|
|
127
|
+
* It does NOT validate the string value against the string tag. This behavior is the same to AWS SDK parsing logic of
|
|
128
|
+
* string tag types.
|
|
129
|
+
*
|
|
130
|
+
* If you need to verify the string value, you must use {@link createStringEnumDeserializer} instead.
|
|
131
|
+
*
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
const deserializeStringTag = (value) => String(value);
|
|
135
|
+
exports.deserializeStringTag = deserializeStringTag;
|
|
122
136
|
/**
|
|
123
137
|
* Function that makes sure the deserializer receives non-empty array.
|
|
124
138
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deserializeHelpers.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/deserializeHelpers.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deserializeCompletedPartList = exports.buildStorageServiceError = exports.deserializeMetadata = exports.emptyArrayGuard = exports.createStringEnumDeserializer = exports.deserializeTimestamp = exports.deserializeBoolean = exports.deserializeNumber = exports.map = void 0;\nconst StorageError_1 = require(\"../../../../../errors/StorageError\");\n/**\n * Maps an object to a new object using the provided instructions.\n * The instructions are a map of the returning mapped object's property names to a single instruction of how to map the\n * value from the original object to the new object. There are two types of instructions:\n *\n * 1. A string representing the property name of the original object to map to the new object. The value mapped from\n * the original object will be the same as the value in the new object, and it can ONLY be string.\n *\n * 2. An array of two elements. The first element is the property name of the original object to map to the new object.\n * The second element is a function that takes the value from the original object and returns the value to be mapped to\n * the new object. The function can return any type.\n *\n * Example:\n * ```typescript\n * const input = {\n * Foo: 'foo',\n * BarList: [{value: 'bar1'}, {value: 'bar2'}]\n * }\n * const output = map(input, {\n * someFoo: 'Foo',\n * bar: ['BarList', (barList) => barList.map(bar => bar.value)]\n * baz: 'Baz' // Baz does not exist in input, so it will not be in the output.\n * });\n * // output = { someFoo: 'foo', bar: ['bar1', 'bar2'] }\n * ```\n *\n * @param obj The object containing the data to compose mapped object.\n * @param instructions The instructions mapping the object values to the new object.\n * @returns A new object with the mapped values.\n *\n * @internal\n */\nconst map = (obj, instructions) => {\n const result = {};\n for (const [key, instruction] of Object.entries(instructions)) {\n const [accessor, deserializer] = Array.isArray(instruction)\n ? instruction\n : [instruction];\n if (Object.prototype.hasOwnProperty.call(obj, accessor)) {\n result[key] = deserializer\n ? deserializer(obj[accessor])\n : String(obj[accessor]);\n }\n }\n return result;\n};\nexports.map = map;\n/**\n * Deserializes a string to a number. Returns undefined if input is undefined.\n *\n * @internal\n */\nconst deserializeNumber = (value) => value ? Number(value) : undefined;\nexports.deserializeNumber = deserializeNumber;\n/**\n * Deserializes a string to a boolean. Returns undefined if input is undefined. Returns true if input is 'true',\n * otherwise false.\n *\n * @internal\n */\nconst deserializeBoolean = (value) => {\n return value ? value === 'true' : undefined;\n};\nexports.deserializeBoolean = deserializeBoolean;\n/**\n * Deserializes a string to a Date. Returns undefined if input is undefined.\n * It supports epoch timestamp; rfc3339(cannot have a UTC, fractional precision supported); rfc7231(section 7.1.1.1)\n *\n * @see https://www.epoch101.com/\n * @see https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6\n * @see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1\n *\n * @note For bundle size consideration, we use Date constructor to parse the timestamp string. There might be slight\n * difference among browsers.\n *\n * @internal\n */\nconst deserializeTimestamp = (value) => {\n return value ? new Date(value) : undefined;\n};\nexports.deserializeTimestamp = deserializeTimestamp;\n/**\n * Create a function deserializing a string to an enum value. If the string is not a valid enum value, it throws a\n * StorageError.\n *\n * @example\n * ```typescript\n * const deserializeStringEnum = createStringEnumDeserializer(['a', 'b', 'c'] as const, 'FieldName');\n * const deserializedArray = ['a', 'b', 'c'].map(deserializeStringEnum);\n * // deserializedArray = ['a', 'b', 'c']\n *\n * const invalidValue = deserializeStringEnum('d');\n * // Throws InvalidFieldName: Invalid FieldName: d\n * ```\n *\n * @internal\n */\nconst createStringEnumDeserializer = (enumValues, fieldName) => {\n const deserializeStringEnum = (value) => {\n const parsedEnumValue = value\n ? enumValues.find(enumValue => enumValue === value)\n : undefined;\n if (!parsedEnumValue) {\n throw new StorageError_1.StorageError({\n name: `Invalid${fieldName}`,\n message: `Invalid ${fieldName}: ${value}`,\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n return parsedEnumValue;\n };\n return deserializeStringEnum;\n};\nexports.createStringEnumDeserializer = createStringEnumDeserializer;\n/**\n * Function that makes sure the deserializer receives non-empty array.\n *\n * @internal\n */\nconst emptyArrayGuard = (value, deserializer) => {\n if (value === '') {\n return [];\n }\n const valueArray = (Array.isArray(value) ? value : [value]).filter(e => e != null);\n return deserializer(valueArray);\n};\nexports.emptyArrayGuard = emptyArrayGuard;\n/**\n * @internal\n */\nconst deserializeMetadata = (headers) => {\n const objectMetadataHeaderPrefix = 'x-amz-meta-';\n const deserialized = Object.keys(headers)\n .filter(header => header.startsWith(objectMetadataHeaderPrefix))\n .reduce((acc, header) => {\n acc[header.replace(objectMetadataHeaderPrefix, '')] = headers[header];\n return acc;\n }, {});\n return Object.keys(deserialized).length > 0 ? deserialized : undefined;\n};\nexports.deserializeMetadata = deserializeMetadata;\n/**\n * Internal-only method to create a new StorageError from a service error with AWS SDK-compatible interfaces\n * @param error - The output of a service error parser, with AWS SDK-compatible interface(e.g. $metadata)\n * @returns A new StorageError.\n *\n * @internal\n */\nconst buildStorageServiceError = (error) => new StorageError_1.StorageError({\n name: error.name,\n message: error.message,\n metadata: error.$metadata,\n});\nexports.buildStorageServiceError = buildStorageServiceError;\n/**\n * Internal-only method used for deserializing the parts of a multipart upload.\n *\n * @internal\n */\nconst deserializeCompletedPartList = (input) => input.map(item => (0, exports.map)(item, {\n PartNumber: ['PartNumber', exports.deserializeNumber],\n ETag: 'ETag',\n ChecksumCRC32: 'ChecksumCRC32',\n}));\nexports.deserializeCompletedPartList = deserializeCompletedPartList;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,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,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE;AACzF,IAAI,UAAU,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,iBAAiB,CAAC;AACzD,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,aAAa,EAAE,eAAe;AAClC,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,4BAA4B,GAAG,4BAA4B;;"}
|
|
1
|
+
{"version":3,"file":"deserializeHelpers.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/deserializeHelpers.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deserializeCompletedPartList = exports.buildStorageServiceError = exports.deserializeMetadata = exports.emptyArrayGuard = exports.deserializeStringTag = exports.createStringEnumDeserializer = exports.deserializeTimestamp = exports.deserializeBoolean = exports.deserializeNumber = exports.map = void 0;\nconst StorageError_1 = require(\"../../../../../errors/StorageError\");\n/**\n * Maps an object to a new object using the provided instructions.\n * The instructions are a map of the returning mapped object's property names to a single instruction of how to map the\n * value from the original object to the new object. There are two types of instructions:\n *\n * 1. A string representing the property name of the original object to map to the new object. The value mapped from\n * the original object will be the same as the value in the new object, and it can ONLY be string.\n *\n * 2. An array of two elements. The first element is the property name of the original object to map to the new object.\n * The second element is a function that takes the value from the original object and returns the value to be mapped to\n * the new object. The function can return any type.\n *\n * Example:\n * ```typescript\n * const input = {\n * Foo: 'foo',\n * BarList: [{value: 'bar1'}, {value: 'bar2'}]\n * }\n * const output = map(input, {\n * someFoo: 'Foo',\n * bar: ['BarList', (barList) => barList.map(bar => bar.value)]\n * baz: 'Baz' // Baz does not exist in input, so it will not be in the output.\n * });\n * // output = { someFoo: 'foo', bar: ['bar1', 'bar2'] }\n * ```\n *\n * @param obj The object containing the data to compose mapped object.\n * @param instructions The instructions mapping the object values to the new object.\n * @returns A new object with the mapped values.\n *\n * @internal\n */\nconst map = (obj, instructions) => {\n const result = {};\n for (const [key, instruction] of Object.entries(instructions)) {\n const [accessor, deserializer] = Array.isArray(instruction)\n ? instruction\n : [instruction];\n if (Object.prototype.hasOwnProperty.call(obj, accessor)) {\n result[key] = deserializer\n ? deserializer(obj[accessor])\n : String(obj[accessor]);\n }\n }\n return result;\n};\nexports.map = map;\n/**\n * Deserializes a string to a number. Returns undefined if input is undefined.\n *\n * @internal\n */\nconst deserializeNumber = (value) => value ? Number(value) : undefined;\nexports.deserializeNumber = deserializeNumber;\n/**\n * Deserializes a string to a boolean. Returns undefined if input is undefined. Returns true if input is 'true',\n * otherwise false.\n *\n * @internal\n */\nconst deserializeBoolean = (value) => {\n return value ? value === 'true' : undefined;\n};\nexports.deserializeBoolean = deserializeBoolean;\n/**\n * Deserializes a string to a Date. Returns undefined if input is undefined.\n * It supports epoch timestamp; rfc3339(cannot have a UTC, fractional precision supported); rfc7231(section 7.1.1.1)\n *\n * @see https://www.epoch101.com/\n * @see https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6\n * @see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1\n *\n * @note For bundle size consideration, we use Date constructor to parse the timestamp string. There might be slight\n * difference among browsers.\n *\n * @internal\n */\nconst deserializeTimestamp = (value) => {\n return value ? new Date(value) : undefined;\n};\nexports.deserializeTimestamp = deserializeTimestamp;\n/**\n * Create a function deserializing a string to an enum value. If the string is not a valid enum value, it throws a\n * StorageError.\n *\n * This utility is ONLY preferred if the enum value is critical. Since the enum values are hard-coded, new enum values\n * returned from service would break the library.\n *\n * @example\n * ```typescript\n * const deserializeStringEnum = createStringEnumDeserializer(['a', 'b', 'c'] as const, 'FieldName');\n * const deserializedArray = ['a', 'b', 'c'].map(deserializeStringEnum);\n * // deserializedArray = ['a', 'b', 'c']\n *\n * const invalidValue = deserializeStringEnum('d');\n * // Throws InvalidFieldName: Invalid FieldName: d\n * ```\n *\n * @internal\n */\nconst createStringEnumDeserializer = (enumValues, fieldName) => {\n const deserializeStringEnum = (value) => {\n const parsedEnumValue = value\n ? enumValues.find(enumValue => enumValue === value)\n : undefined;\n if (!parsedEnumValue) {\n throw new StorageError_1.StorageError({\n name: `Invalid${fieldName}`,\n message: `Invalid ${fieldName}: ${value}`,\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n return parsedEnumValue;\n };\n return deserializeStringEnum;\n};\nexports.createStringEnumDeserializer = createStringEnumDeserializer;\n/**\n * Deserializes a string to a string tag type. The function simply casts the parsed string into a given string tag type.\n * It does NOT validate the string value against the string tag. This behavior is the same to AWS SDK parsing logic of\n * string tag types.\n *\n * If you need to verify the string value, you must use {@link createStringEnumDeserializer} instead.\n *\n * @internal\n */\nconst deserializeStringTag = (value) => String(value);\nexports.deserializeStringTag = deserializeStringTag;\n/**\n * Function that makes sure the deserializer receives non-empty array.\n *\n * @internal\n */\nconst emptyArrayGuard = (value, deserializer) => {\n if (value === '') {\n return [];\n }\n const valueArray = (Array.isArray(value) ? value : [value]).filter(e => e != null);\n return deserializer(valueArray);\n};\nexports.emptyArrayGuard = emptyArrayGuard;\n/**\n * @internal\n */\nconst deserializeMetadata = (headers) => {\n const objectMetadataHeaderPrefix = 'x-amz-meta-';\n const deserialized = Object.keys(headers)\n .filter(header => header.startsWith(objectMetadataHeaderPrefix))\n .reduce((acc, header) => {\n acc[header.replace(objectMetadataHeaderPrefix, '')] = headers[header];\n return acc;\n }, {});\n return Object.keys(deserialized).length > 0 ? deserialized : undefined;\n};\nexports.deserializeMetadata = deserializeMetadata;\n/**\n * Internal-only method to create a new StorageError from a service error with AWS SDK-compatible interfaces\n * @param error - The output of a service error parser, with AWS SDK-compatible interface(e.g. $metadata)\n * @returns A new StorageError.\n *\n * @internal\n */\nconst buildStorageServiceError = (error) => new StorageError_1.StorageError({\n name: error.name,\n message: error.message,\n metadata: error.$metadata,\n});\nexports.buildStorageServiceError = buildStorageServiceError;\n/**\n * Internal-only method used for deserializing the parts of a multipart upload.\n *\n * @internal\n */\nconst deserializeCompletedPartList = (input) => input.map(item => (0, exports.map)(item, {\n PartNumber: ['PartNumber', exports.deserializeNumber],\n ETag: 'ETag',\n ChecksumCRC32: 'ChecksumCRC32',\n}));\nexports.deserializeCompletedPartList = deserializeCompletedPartList;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,GAAG,GAAG,MAAM;AACpT,MAAM,cAAc,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK;AACnC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACnE,QAAQ,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW;AAClE,cAAc;AACd,cAAc,CAAC,WAAW,CAAC;AAC3B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;AACjE,YAAY,MAAM,CAAC,GAAG,CAAC,GAAG;AAC1B,kBAAkB,Y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AAClB,KAAK,EAAE,EAAE,CAAC;AACV,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,YAAY,GAAG,SAAS;AAC1E,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,CAAC,KAAK,KAAK,IAAI,cAAc,CAAC,YAAY,CAAC;AAC5E,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO;AAC1B,IAAI,QAAQ,EAAE,KAAK,CAAC,SAAS;AAC7B,CAAC,CAAC;AACF,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA,MAAM,4BAA4B,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE;AACzF,IAAI,UAAU,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,iBAAiB,CAAC;AACzD,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,aAAa,EAAE,eAAe;AAClC,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,4BAA4B,GAAG,4BAA4B;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = void 0;
|
|
5
|
+
exports.validateS3RequiredParameter = validateS3RequiredParameter;
|
|
5
6
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
8
|
const aws_client_utils_1 = require("@aws-amplify/core/internals/aws-client-utils");
|
|
@@ -65,5 +66,4 @@ function validateS3RequiredParameter(assertion, paramName) {
|
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
exports.validateS3RequiredParameter = validateS3RequiredParameter;
|
|
69
69
|
//# sourceMappingURL=serializeHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeHelpers.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/serializeHelpers.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.
|
|
1
|
+
{"version":3,"file":"serializeHelpers.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/serializeHelpers.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = void 0;\nexports.validateS3RequiredParameter = validateS3RequiredParameter;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst StorageError_1 = require(\"../../../../../errors/StorageError\");\n/**\n * @internal\n */\nconst assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\nexports.assignStringVariables = assignStringVariables;\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nconst serializeObjectConfigsToHeaders = async (input) => ({\n ...(0, exports.assignStringVariables)({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nexports.serializeObjectConfigsToHeaders = serializeObjectConfigsToHeaders;\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nconst serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(aws_client_utils_1.extendedEncodeURIComponent).join('/')}`);\n};\nexports.serializePathnameObjectKey = serializePathnameObjectKey;\nfunction validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError_1.StorageError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,+BAA+B,GAAG,OAAO,CAAC,qBAAqB,GAAG,MAAM;AACrH,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;AACjE;AACA;AACA,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACpE;AACA;AACA;AACA,MAAM,qBAAqB,GAAG,CAAC,MAAM,KAAK;AAC1C,IAAI,MAAM,WAAW,GAAG,EAAE;AAC1B,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OA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CAAC,GAAG,EAAE,GAAG,KAAK;AACjD,IAAI,QAAQ,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAC3C,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACzF,CAAC;AACD,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D,SAAS,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE;AAC3D,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC;AAC9C,YAAY,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO;AAClD,YAAY,OAAO,EAAE,gCAAgC;AACrD,YAAY,eAAe,EAAE,IAAI,SAAS,CAAC,CAAC,2CAA2C,EAAE,SAAS,CAAC,CAAC,CAAC;AACrG,YAAY,kBAAkB,EAAE,kEAAkE;AAClG,SAAS,CAAC;AACV;AACA;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getStorageUserAgentValue =
|
|
4
|
+
exports.getStorageUserAgentValue = getStorageUserAgentValue;
|
|
5
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
@@ -11,5 +11,4 @@ function getStorageUserAgentValue(action) {
|
|
|
11
11
|
action,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
exports.getStorageUserAgentValue = getStorageUserAgentValue;
|
|
15
14
|
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","sources":["../../../../../src/providers/s3/utils/userAgent.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getStorageUserAgentValue =
|
|
1
|
+
{"version":3,"file":"userAgent.js","sources":["../../../../../src/providers/s3/utils/userAgent.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getStorageUserAgentValue = getStorageUserAgentValue;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nfunction getStorageUserAgentValue(action) {\n return (0, utils_1.getAmplifyUserAgent)({\n category: utils_1.Category.Storage,\n action,\n });\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;AAC3D;AACA;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,SAAS,wBAAwB,CAAC,MAAM,EAAE;AAC1C,IAAI,OAAO,IAAI,OAAO,CAAC,mBAAmB,EAAE;AAC5C,QAAQ,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO;AAC1C,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateMultipartUploadXML =
|
|
6
|
+
exports.validateMultipartUploadXML = validateMultipartUploadXML;
|
|
7
7
|
const IntegrityError_1 = require("../../../errors/IntegrityError");
|
|
8
8
|
const runtime_1 = require("./client/runtime");
|
|
9
9
|
const utils_1 = require("./client/utils");
|
|
@@ -23,5 +23,4 @@ function validateMultipartUploadXML(input, xml) {
|
|
|
23
23
|
throw new IntegrityError_1.IntegrityError();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
exports.validateMultipartUploadXML = validateMultipartUploadXML;
|
|
27
26
|
//# sourceMappingURL=validateMultipartUploadXML.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateMultipartUploadXML.js","sources":["../../../../../src/providers/s3/utils/validateMultipartUploadXML.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateMultipartUploadXML =
|
|
1
|
+
{"version":3,"file":"validateMultipartUploadXML.js","sources":["../../../../../src/providers/s3/utils/validateMultipartUploadXML.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateMultipartUploadXML = validateMultipartUploadXML;\nconst IntegrityError_1 = require(\"../../../errors/IntegrityError\");\nconst runtime_1 = require(\"./client/runtime\");\nconst utils_1 = require(\"./client/utils\");\nconst integrityHelpers_1 = require(\"./client/utils/integrityHelpers\");\nfunction validateMultipartUploadXML(input, xml) {\n if (!input.Parts) {\n throw new IntegrityError_1.IntegrityError();\n }\n const parsedXML = runtime_1.parser.parse(xml);\n const mappedCompletedMultipartUpload = (0, utils_1.map)(parsedXML, {\n Parts: [\n 'Part',\n value => (0, utils_1.emptyArrayGuard)(value, utils_1.deserializeCompletedPartList),\n ],\n });\n if (!(0, integrityHelpers_1.isEqual)(input, mappedCompletedMultipartUpload)) {\n throw new IntegrityError_1.IntegrityError();\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D,MAAM,gBAAgB,GAAG,OAAO,CAAC,gCAAgC,CAAC;AAClE,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,kBAAkB,GAAG,OAAO,CAAC,iCAAiC,CAAC;AACrE,SAAS,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE;AAChD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AACtB,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD;AACA,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AACjD,IAAI,MAAM,8BAA8B,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE;AACvE,QAAQ,KAAK,EAAE;AACf,YAAY,MAAM;AAClB,YAAY,KAAK,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,OAAO,CAAC,4BAA4B,CAAC;AAC9F,SAAS;AACT,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,IAAI,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,8BAA8B,CAAC,EAAE;AACjF,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD;AACA;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateObjectUrl =
|
|
6
|
+
exports.validateObjectUrl = validateObjectUrl;
|
|
7
7
|
const aws_client_utils_1 = require("@aws-amplify/core/internals/aws-client-utils");
|
|
8
8
|
const IntegrityError_1 = require("../../../errors/IntegrityError");
|
|
9
9
|
function validateObjectUrl({ bucketName, key, objectURL, }) {
|
|
@@ -20,5 +20,4 @@ function validateObjectUrl({ bucketName, key, objectURL, }) {
|
|
|
20
20
|
throw new IntegrityError_1.IntegrityError();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
exports.validateObjectUrl = validateObjectUrl;
|
|
24
23
|
//# sourceMappingURL=validateObjectUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateObjectUrl.js","sources":["../../../../../src/providers/s3/utils/validateObjectUrl.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateObjectUrl =
|
|
1
|
+
{"version":3,"file":"validateObjectUrl.js","sources":["../../../../../src/providers/s3/utils/validateObjectUrl.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateObjectUrl = validateObjectUrl;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst IntegrityError_1 = require(\"../../../errors/IntegrityError\");\nfunction validateObjectUrl({ bucketName, key, objectURL, }) {\n if (!bucketName || !key || !objectURL) {\n throw new IntegrityError_1.IntegrityError();\n }\n const bucketWithDots = bucketName.includes('.');\n const encodedBucketName = (0, aws_client_utils_1.extendedEncodeURIComponent)(bucketName);\n const encodedKey = key.split('/').map(aws_client_utils_1.extendedEncodeURIComponent).join('/');\n const isPathStyleUrl = objectURL.pathname === `/${encodedBucketName}/${encodedKey}`;\n const isSubdomainUrl = objectURL.hostname.startsWith(`${encodedBucketName}.`) &&\n objectURL.pathname === `/${encodedKey}`;\n if (!(isPathStyleUrl || (!bucketWithDots && isSubdomainUrl))) {\n throw new IntegrityError_1.IntegrityError();\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,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
+
import { CopyOutput } from '../types/outputs';
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
4
5
|
*/
|
|
5
|
-
export declare const copy: (input: CopyInput) => Promise<
|
|
6
|
+
export declare const copy: (input: CopyInput) => Promise<CopyOutput>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GetUrlInput } from '../types/inputs';
|
|
2
|
+
import { GetUrlOutput } from '../types/outputs';
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
4
5
|
*/
|
|
5
|
-
export declare const getUrl: (input: GetUrlInput) => Promise<
|
|
6
|
+
export declare const getUrl: (input: GetUrlInput) => Promise<GetUrlOutput>;
|
|
@@ -3,6 +3,6 @@ import { BucketInfo } from '../../../providers/s3/types/options';
|
|
|
3
3
|
export declare const resolveLocationsForCurrentSession: ({ buckets, isAuthenticated, identityId, userGroup, }: {
|
|
4
4
|
buckets: Record<string, BucketInfo>;
|
|
5
5
|
isAuthenticated: boolean;
|
|
6
|
-
identityId?: string
|
|
7
|
-
userGroup?: string
|
|
6
|
+
identityId?: string;
|
|
7
|
+
userGroup?: string;
|
|
8
8
|
}) => PathAccess[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UploadDataInput } from '../types/inputs';
|
|
2
|
+
import { UploadDataOutput } from '../types/outputs';
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
4
5
|
*/
|
|
5
|
-
export declare const uploadData: (input: UploadDataInput) =>
|
|
6
|
+
export declare const uploadData: (input: UploadDataInput) => UploadDataOutput;
|
|
@@ -139,7 +139,7 @@ const serviceCopy = async ({ source, destination, bucket, s3Config, notModifiedS
|
|
|
139
139
|
Bucket: bucket,
|
|
140
140
|
CopySource: source,
|
|
141
141
|
Key: destination,
|
|
142
|
-
MetadataDirective: 'COPY',
|
|
142
|
+
MetadataDirective: 'COPY', // Copies over metadata like contentType as well
|
|
143
143
|
CopySourceIfMatch: eTag,
|
|
144
144
|
CopySourceIfUnmodifiedSince: notModifiedSince,
|
|
145
145
|
ExpectedSourceBucketOwner: expectedSourceBucketOwner,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.mjs","sources":["../../../../../../src/providers/s3/apis/internal/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { isInputWithPath, resolveS3ConfigAndInput, validateBucketOwnerID, validateStorageOperationInput, } from '../../utils';\nimport { StorageValidationErrorCode } from '../../../../errors/types/validation';\nimport { assertValidationError } from '../../../../errors/utils/assertValidationError';\nimport { copyObject } from '../../utils/client/s3data';\nimport { getStorageUserAgentValue } from '../../utils/userAgent';\nimport { logger } from '../../../../utils';\nconst isCopyInputWithPath = (input) => isInputWithPath(input.source);\nconst storageBucketAssertion = (sourceBucket, destBucket) => {\n /** For multi-bucket, both source and destination bucket needs to be passed in\n * or both can be undefined and we fallback to singleton's default value\n */\n assertValidationError(\n // Both src & dest bucket option is present is acceptable\n (sourceBucket !== undefined && destBucket !== undefined) ||\n // or both are undefined is also acceptable\n (!destBucket && !sourceBucket), StorageValidationErrorCode.InvalidCopyOperationStorageBucket);\n};\nexport const copy = async (amplify, input) => {\n return isCopyInputWithPath(input)\n ? copyWithPath(amplify, input)\n : copyWithKey(amplify, input);\n};\nconst copyWithPath = async (amplify, input) => {\n const { source, destination } = input;\n storageBucketAssertion(source.bucket, destination.bucket);\n const { bucket: sourceBucket } = await resolveS3ConfigAndInput(amplify, {\n path: input.source.path,\n options: {\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n ...input.source,\n },\n });\n // The bucket, region, credentials of s3 client are resolved from destination.\n // Whereas the source bucket and path are a input parameter of S3 copy operation.\n const { s3Config, bucket: destBucket, identityId, } = await resolveS3ConfigAndInput(amplify, {\n path: input.destination.path,\n options: {\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n customEndpoint: input.options?.customEndpoint,\n ...input.destination,\n },\n }); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.\n assertValidationError(!!source.path, StorageValidationErrorCode.NoSourcePath);\n assertValidationError(!!destination.path, StorageValidationErrorCode.NoDestinationPath);\n const { objectKey: sourcePath } = validateStorageOperationInput(source, identityId);\n const { objectKey: destinationPath } = validateStorageOperationInput(destination, identityId);\n validateBucketOwnerID(source.expectedBucketOwner);\n validateBucketOwnerID(destination.expectedBucketOwner);\n const finalCopySource = `${sourceBucket}/${sourcePath}`;\n const finalCopyDestination = destinationPath;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await serviceCopy({\n source: finalCopySource,\n destination: finalCopyDestination,\n bucket: destBucket,\n s3Config,\n notModifiedSince: input.source.notModifiedSince,\n eTag: input.source.eTag,\n expectedSourceBucketOwner: input.source?.expectedBucketOwner,\n expectedBucketOwner: input.destination?.expectedBucketOwner,\n });\n return { path: finalCopyDestination };\n};\n/** @deprecated Use {@link copyWithPath} instead. */\nexport const copyWithKey = async (amplify, input) => {\n const { source, destination } = input;\n storageBucketAssertion(source.bucket, destination.bucket);\n assertValidationError(!!source.key, StorageValidationErrorCode.NoSourceKey);\n assertValidationError(!!destination.key, StorageValidationErrorCode.NoDestinationKey);\n validateBucketOwnerID(source.expectedBucketOwner);\n validateBucketOwnerID(destination.expectedBucketOwner);\n const { bucket: sourceBucket, keyPrefix: sourceKeyPrefix } = await resolveS3ConfigAndInput(amplify, {\n ...input,\n options: {\n // @ts-expect-error: 'options' does not exist on type 'CopyInput'. In case of JS users set the location\n // credentials provider option, resolveS3ConfigAndInput will throw validation error.\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n ...input.source,\n },\n });\n // The bucket, region, credentials of s3 client are resolved from destination.\n // Whereas the source bucket and path are a input parameter of S3 copy operation.\n const { s3Config, bucket: destBucket, keyPrefix: destinationKeyPrefix, } = await resolveS3ConfigAndInput(amplify, {\n ...input,\n options: {\n // @ts-expect-error: 'options' does not exist on type 'CopyInput'. In case of JS users set the location\n // credentials provider option, resolveS3ConfigAndInput will throw validation error.\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n ...input.destination,\n },\n }); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.\n // TODO(ashwinkumar6) V6-logger: warn `You may copy files from another user if the source level is \"protected\", currently it's ${srcLevel}`\n const finalCopySource = `${sourceBucket}/${sourceKeyPrefix}${source.key}`;\n const finalCopyDestination = `${destinationKeyPrefix}${destination.key}`;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await serviceCopy({\n source: finalCopySource,\n destination: finalCopyDestination,\n bucket: destBucket,\n s3Config,\n notModifiedSince: input.source.notModifiedSince,\n eTag: input.source.eTag,\n expectedSourceBucketOwner: input.source?.expectedBucketOwner,\n expectedBucketOwner: input.destination?.expectedBucketOwner,\n });\n return {\n key: destination.key,\n };\n};\nconst serviceCopy = async ({ source, destination, bucket, s3Config, notModifiedSince, eTag, expectedSourceBucketOwner, expectedBucketOwner, }) => {\n await copyObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(StorageAction.Copy),\n }, {\n Bucket: bucket,\n CopySource: source,\n Key: destination,\n MetadataDirective: 'COPY',\n CopySourceIfMatch: eTag,\n CopySourceIfUnmodifiedSince: notModifiedSince,\n ExpectedSourceBucketOwner: expectedSourceBucketOwner,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAQA,MAAM,mBAAmB,GAAG,CAAC,KAAK,KAAK,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC;AACpE,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,UAAU,KAAK;AAC7D;AACA;AACA;AACA,IAAI,qBAAqB;AACzB;AACA,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS;AAC3D;AACA,SAAS,CAAC,UAAU,IAAI,CAAC,YAAY,CAAC,EAAE,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,CAAC;AAC9E,IAAI,MAAM,WAAW,CAAC;AACtB,QAAQ,MAAM,EAAE,eAAe;AAC/B,QAAQ,WAAW,EAAE,oBAAoB;AACzC,QAAQ,MAAM,EAAE,UAAU;AAC1B,QAAQ,QAAQ;AAChB,QAAQ,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB;AACvD,QAAQ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;AAC/B,QAAQ,yBAAyB,EAAE,KAAK,CAAC,MAAM,EAAE,mBAAmB;AACpE,QAAQ,mBAAmB,EAAE,KAAK,CAAC,WAAW,EAAE,mBAAmB;AACnE,KAAK,CAAC;AACN,IAAI,OAAO;AACX,QAAQ,GAAG,EAAE,WAAW,CAAC,GAAG;AAC5B,KAAK;AACL;AACA,MAAM,WAAW,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,yBAAyB,EAAE,mBAAmB,GAAG,KAAK;AAClJ,IAAI,MAAM,UAAU,CAAC;AACrB,QAAQ,GAAG,QAAQ;AACnB,QAAQ,cAAc,EAAE,wBAAwB,CAAC,aAAa,CAAC,IAAI,CAAC;AACpE,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,UAAU,EAAE,MAAM;AAC1B,QAAQ,GAAG,EAAE,WAAW;AACxB,QAAQ,iBAAiB,EAAE,MAAM;AACjC,QAAQ,iBAAiB,EAAE,IAAI;AAC/B,QAAQ,2BAA2B,EAAE,gBAAgB;AACrD,QAAQ,yBAAyB,EAAE,yBAAyB;AAC5D,QAAQ,mBAAmB,EAAE,mBAAmB;AAChD,KAAK,CAAC;AACN,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"copy.mjs","sources":["../../../../../../src/providers/s3/apis/internal/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { isInputWithPath, resolveS3ConfigAndInput, validateBucketOwnerID, validateStorageOperationInput, } from '../../utils';\nimport { StorageValidationErrorCode } from '../../../../errors/types/validation';\nimport { assertValidationError } from '../../../../errors/utils/assertValidationError';\nimport { copyObject } from '../../utils/client/s3data';\nimport { getStorageUserAgentValue } from '../../utils/userAgent';\nimport { logger } from '../../../../utils';\nconst isCopyInputWithPath = (input) => isInputWithPath(input.source);\nconst storageBucketAssertion = (sourceBucket, destBucket) => {\n /** For multi-bucket, both source and destination bucket needs to be passed in\n * or both can be undefined and we fallback to singleton's default value\n */\n assertValidationError(\n // Both src & dest bucket option is present is acceptable\n (sourceBucket !== undefined && destBucket !== undefined) ||\n // or both are undefined is also acceptable\n (!destBucket && !sourceBucket), StorageValidationErrorCode.InvalidCopyOperationStorageBucket);\n};\nexport const copy = async (amplify, input) => {\n return isCopyInputWithPath(input)\n ? copyWithPath(amplify, input)\n : copyWithKey(amplify, input);\n};\nconst copyWithPath = async (amplify, input) => {\n const { source, destination } = input;\n storageBucketAssertion(source.bucket, destination.bucket);\n const { bucket: sourceBucket } = await resolveS3ConfigAndInput(amplify, {\n path: input.source.path,\n options: {\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n ...input.source,\n },\n });\n // The bucket, region, credentials of s3 client are resolved from destination.\n // Whereas the source bucket and path are a input parameter of S3 copy operation.\n const { s3Config, bucket: destBucket, identityId, } = await resolveS3ConfigAndInput(amplify, {\n path: input.destination.path,\n options: {\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n customEndpoint: input.options?.customEndpoint,\n ...input.destination,\n },\n }); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.\n assertValidationError(!!source.path, StorageValidationErrorCode.NoSourcePath);\n assertValidationError(!!destination.path, StorageValidationErrorCode.NoDestinationPath);\n const { objectKey: sourcePath } = validateStorageOperationInput(source, identityId);\n const { objectKey: destinationPath } = validateStorageOperationInput(destination, identityId);\n validateBucketOwnerID(source.expectedBucketOwner);\n validateBucketOwnerID(destination.expectedBucketOwner);\n const finalCopySource = `${sourceBucket}/${sourcePath}`;\n const finalCopyDestination = destinationPath;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await serviceCopy({\n source: finalCopySource,\n destination: finalCopyDestination,\n bucket: destBucket,\n s3Config,\n notModifiedSince: input.source.notModifiedSince,\n eTag: input.source.eTag,\n expectedSourceBucketOwner: input.source?.expectedBucketOwner,\n expectedBucketOwner: input.destination?.expectedBucketOwner,\n });\n return { path: finalCopyDestination };\n};\n/** @deprecated Use {@link copyWithPath} instead. */\nexport const copyWithKey = async (amplify, input) => {\n const { source, destination } = input;\n storageBucketAssertion(source.bucket, destination.bucket);\n assertValidationError(!!source.key, StorageValidationErrorCode.NoSourceKey);\n assertValidationError(!!destination.key, StorageValidationErrorCode.NoDestinationKey);\n validateBucketOwnerID(source.expectedBucketOwner);\n validateBucketOwnerID(destination.expectedBucketOwner);\n const { bucket: sourceBucket, keyPrefix: sourceKeyPrefix } = await resolveS3ConfigAndInput(amplify, {\n ...input,\n options: {\n // @ts-expect-error: 'options' does not exist on type 'CopyInput'. In case of JS users set the location\n // credentials provider option, resolveS3ConfigAndInput will throw validation error.\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n ...input.source,\n },\n });\n // The bucket, region, credentials of s3 client are resolved from destination.\n // Whereas the source bucket and path are a input parameter of S3 copy operation.\n const { s3Config, bucket: destBucket, keyPrefix: destinationKeyPrefix, } = await resolveS3ConfigAndInput(amplify, {\n ...input,\n options: {\n // @ts-expect-error: 'options' does not exist on type 'CopyInput'. In case of JS users set the location\n // credentials provider option, resolveS3ConfigAndInput will throw validation error.\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n ...input.destination,\n },\n }); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.\n // TODO(ashwinkumar6) V6-logger: warn `You may copy files from another user if the source level is \"protected\", currently it's ${srcLevel}`\n const finalCopySource = `${sourceBucket}/${sourceKeyPrefix}${source.key}`;\n const finalCopyDestination = `${destinationKeyPrefix}${destination.key}`;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await serviceCopy({\n source: finalCopySource,\n destination: finalCopyDestination,\n bucket: destBucket,\n s3Config,\n notModifiedSince: input.source.notModifiedSince,\n eTag: input.source.eTag,\n expectedSourceBucketOwner: input.source?.expectedBucketOwner,\n expectedBucketOwner: input.destination?.expectedBucketOwner,\n });\n return {\n key: destination.key,\n };\n};\nconst serviceCopy = async ({ source, destination, bucket, s3Config, notModifiedSince, eTag, expectedSourceBucketOwner, expectedBucketOwner, }) => {\n await copyObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(StorageAction.Copy),\n }, {\n Bucket: bucket,\n CopySource: source,\n Key: destination,\n MetadataDirective: 'COPY', // Copies over metadata like contentType as well\n CopySourceIfMatch: eTag,\n CopySourceIfUnmodifiedSince: notModifiedSince,\n ExpectedSourceBucketOwner: expectedSourceBucketOwner,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAQA,MAAM,mBAAmB,GAAG,CAAC,KAAK,KAAK,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC;AACpE,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,UAAU,KAAK;AAC7D;AACA;AACA;AACA,IAAI,qBAAqB;AACzB;AACA,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS;AAC3D;AACA,SAAS,CAAC,UAAU,IAAI,CAAC,YAAY,CAAC,EAAE,0BAA0B,CAAC,iCAAiC,CAAC;AACrG,CAAC;AACW,MAAC,IAAI,GAAG,OAAO,OAAO,EAAE,KAAK,KAAK;AAC9C,IAAI,OAAO,mBAAmB,CAAC,KAAK;AACpC,UAAU,YAAY,CAAC,OAAO,EAAE,KAAK;AACrC,UAAU,WAAW,CAAC,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AM,CAAC,gBAAgB;AACvD,QAAQ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;AAC/B,QAAQ,yBAAyB,EAAE,KAAK,CAAC,MAAM,EAAE,mBAAmB;AACpE,QAAQ,mBAAmB,EAAE,KAAK,CAAC,WAAW,EAAE,mBAAmB;AACnE,KAAK,CAAC;AACN,IAAI,OAAO;AACX,QAAQ,GAAG,EAAE,WAAW,CAAC,GAAG;AAC5B,KAAK;AACL;AACA,MAAM,WAAW,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,yBAAyB,EAAE,mBAAmB,GAAG,KAAK;AAClJ,IAAI,MAAM,UAAU,CAAC;AACrB,QAAQ,GAAG,QAAQ;AACnB,QAAQ,cAAc,EAAE,wBAAwB,CAAC,aAAa,CAAC,IAAI,CAAC;AACpE,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,UAAU,EAAE,MAAM;AAC1B,QAAQ,GAAG,EAAE,WAAW;AACxB,QAAQ,iBAAiB,EAAE,MAAM;AACjC,QAAQ,iBAAiB,EAAE,IAAI;AAC/B,QAAQ,2BAA2B,EAAE,gBAAgB;AACrD,QAAQ,yBAAyB,EAAE,yBAAyB;AAC5D,QAAQ,mBAAmB,EAAE,mBAAmB;AAChD,KAAK,CAAC;AACN,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import { DownloadDataInput } from '../../types';
|
|
|
2
2
|
import { StorageDownloadDataOutput, StorageItemWithKey, StorageItemWithPath } from '../../../../types';
|
|
3
3
|
import { DownloadDataInput as DownloadDataWithPathInputWithAdvancedOptions } from '../../../../internals/types/inputs';
|
|
4
4
|
export declare const downloadData: (input: DownloadDataInput | DownloadDataWithPathInputWithAdvancedOptions) => {
|
|
5
|
-
cancel: (message?: string
|
|
5
|
+
cancel: (message?: string) => void;
|
|
6
6
|
readonly state: import("../../../../types").TransferTaskState;
|
|
7
7
|
result: Promise<StorageDownloadDataOutput<StorageItemWithKey | StorageItemWithPath>>;
|
|
8
8
|
};
|
|
@@ -29,7 +29,7 @@ interface FileMetadata {
|
|
|
29
29
|
/**
|
|
30
30
|
* Serialize the uploadData API options to string so it can be hashed.
|
|
31
31
|
*/
|
|
32
|
-
export declare const serializeUploadOptions: (options?: UploadDataWithPathInputWithAdvancedOptions[
|
|
32
|
+
export declare const serializeUploadOptions: (options?: UploadDataWithPathInputWithAdvancedOptions["options"] & {
|
|
33
33
|
resumableUploadsCache?: KeyValueStorageInterface;
|
|
34
34
|
}) => string;
|
|
35
35
|
interface UploadsCacheKeyOptions {
|
|
@@ -47,6 +47,6 @@ interface UploadsCacheKeyOptions {
|
|
|
47
47
|
* So the library always created a new multipart upload if the file is modified.
|
|
48
48
|
*/
|
|
49
49
|
export declare const getUploadsCacheKey: ({ file, size, contentType, bucket, accessLevel, key, optionsHash, }: UploadsCacheKeyOptions) => string;
|
|
50
|
-
export declare const cacheMultipartUpload: (resumableUploadsCache: KeyValueStorageInterface, cacheKey: string, fileMetadata: Omit<FileMetadata,
|
|
50
|
+
export declare const cacheMultipartUpload: (resumableUploadsCache: KeyValueStorageInterface, cacheKey: string, fileMetadata: Omit<FileMetadata, "lastTouched">) => Promise<void>;
|
|
51
51
|
export declare const removeCachedUpload: (resumableUploadsCache: KeyValueStorageInterface, cacheKey: string) => Promise<void>;
|
|
52
52
|
export {};
|
|
@@ -65,7 +65,7 @@ const listCachedUploadTasks = async (resumableUploadsCache) => {
|
|
|
65
65
|
const serializeUploadOptions = (options = {}) => {
|
|
66
66
|
const unserializableOptionProperties = [
|
|
67
67
|
'onProgress',
|
|
68
|
-
'resumableUploadsCache',
|
|
68
|
+
'resumableUploadsCache', // Internally injected implementation not set by customers
|
|
69
69
|
'locationCredentialsProvider', // Internally injected implementation not set by customers
|
|
70
70
|
];
|
|
71
71
|
const serializableOptions = Object.fromEntries(Object.entries(options).filter(([key]) => !unserializableOptionProperties.includes(key)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadCache.mjs","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/uploadCache.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { UPLOADS_STORAGE_KEY } from '../../../../utils/constants';\nimport { listParts } from '../../../../utils/client/s3data';\nimport { logger } from '../../../../../../utils';\nconst ONE_HOUR = 1000 * 60 * 60;\n/**\n * Find the cached multipart upload id and get the parts that have been uploaded\n * with ListParts API. If the cached upload is expired(1 hour), return null.\n */\nexport const findCachedUploadParts = async ({ resumableUploadsCache, cacheKey, s3Config, bucket, finalKey, }) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n if (!cachedUploads[cacheKey] ||\n cachedUploads[cacheKey].lastTouched < Date.now() - ONE_HOUR // Uploads are cached for 1 hour\n ) {\n return null;\n }\n const cachedUpload = cachedUploads[cacheKey];\n cachedUpload.lastTouched = Date.now();\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n try {\n const { Parts = [] } = await listParts(s3Config, {\n Bucket: bucket,\n Key: finalKey,\n UploadId: cachedUpload.uploadId,\n });\n return {\n parts: Parts,\n uploadId: cachedUpload.uploadId,\n finalCrc32: cachedUpload.finalCrc32,\n };\n }\n catch (e) {\n logger.debug('failed to list cached parts, removing cached upload.');\n await removeCachedUpload(resumableUploadsCache, cacheKey);\n return null;\n }\n};\nconst listCachedUploadTasks = async (resumableUploadsCache) => {\n try {\n return JSON.parse((await resumableUploadsCache.getItem(UPLOADS_STORAGE_KEY)) ?? '{}');\n }\n catch (e) {\n logger.debug('failed to parse cached uploads record.');\n return {};\n }\n};\n/**\n * Serialize the uploadData API options to string so it can be hashed.\n */\nexport const serializeUploadOptions = (options = {}) => {\n const unserializableOptionProperties = [\n 'onProgress',\n 'resumableUploadsCache'
|
|
1
|
+
{"version":3,"file":"uploadCache.mjs","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/uploadCache.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { UPLOADS_STORAGE_KEY } from '../../../../utils/constants';\nimport { listParts } from '../../../../utils/client/s3data';\nimport { logger } from '../../../../../../utils';\nconst ONE_HOUR = 1000 * 60 * 60;\n/**\n * Find the cached multipart upload id and get the parts that have been uploaded\n * with ListParts API. If the cached upload is expired(1 hour), return null.\n */\nexport const findCachedUploadParts = async ({ resumableUploadsCache, cacheKey, s3Config, bucket, finalKey, }) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n if (!cachedUploads[cacheKey] ||\n cachedUploads[cacheKey].lastTouched < Date.now() - ONE_HOUR // Uploads are cached for 1 hour\n ) {\n return null;\n }\n const cachedUpload = cachedUploads[cacheKey];\n cachedUpload.lastTouched = Date.now();\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n try {\n const { Parts = [] } = await listParts(s3Config, {\n Bucket: bucket,\n Key: finalKey,\n UploadId: cachedUpload.uploadId,\n });\n return {\n parts: Parts,\n uploadId: cachedUpload.uploadId,\n finalCrc32: cachedUpload.finalCrc32,\n };\n }\n catch (e) {\n logger.debug('failed to list cached parts, removing cached upload.');\n await removeCachedUpload(resumableUploadsCache, cacheKey);\n return null;\n }\n};\nconst listCachedUploadTasks = async (resumableUploadsCache) => {\n try {\n return JSON.parse((await resumableUploadsCache.getItem(UPLOADS_STORAGE_KEY)) ?? '{}');\n }\n catch (e) {\n logger.debug('failed to parse cached uploads record.');\n return {};\n }\n};\n/**\n * Serialize the uploadData API options to string so it can be hashed.\n */\nexport const serializeUploadOptions = (options = {}) => {\n const unserializableOptionProperties = [\n 'onProgress',\n 'resumableUploadsCache', // Internally injected implementation not set by customers\n 'locationCredentialsProvider', // Internally injected implementation not set by customers\n ];\n const serializableOptions = Object.fromEntries(Object.entries(options).filter(([key]) => !unserializableOptionProperties.includes(key)));\n return JSON.stringify(serializableOptions);\n};\n/**\n * Get the cache key of a multipart upload. Data source cached by different: size, content type, bucket, access level,\n * key. If the data source is a File instance, the upload is additionally indexed by file name and last modified time.\n * So the library always created a new multipart upload if the file is modified.\n */\nexport const getUploadsCacheKey = ({ file, size, contentType, bucket, accessLevel, key, optionsHash, }) => {\n let levelStr;\n const resolvedContentType = contentType ?? file?.type ?? 'application/octet-stream';\n // If no access level is defined, we're using custom gen2 access rules\n if (accessLevel === undefined) {\n levelStr = 'custom';\n }\n else {\n levelStr = accessLevel === 'guest' ? 'public' : accessLevel;\n }\n const baseId = `${optionsHash}_${size}_${resolvedContentType}_${bucket}_${levelStr}_${key}`;\n if (file) {\n return `${file.name}_${file.lastModified}_${baseId}`;\n }\n else {\n return baseId;\n }\n};\nexport const cacheMultipartUpload = async (resumableUploadsCache, cacheKey, fileMetadata) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n cachedUploads[cacheKey] = {\n ...fileMetadata,\n lastTouched: Date.now(),\n };\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n};\nexport const removeCachedUpload = async (resumableUploadsCache, cacheKey) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n delete cachedUploads[cacheKey];\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AAIA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE;AAC/B;AACA;AACA;AACA;AACY,MAAC,qBAAqB,GAAG,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,KAAK;AACjH,IAAI,MAAM,aAAa,GAAG,MAAM,qBAAqB,CAAC,qBAAqB,CAAC;AAC5E,IAAI,IAAI,CAAC,aAAa,CAAC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AAQ,OAAO,MAAM;AACrB;AACA;AACY,MAAC,oBAAoB,GAAG,OAAO,qBAAqB,EAAE,QAAQ,EAAE,YAAY,KAAK;AAC7F,IAAI,MAAM,aAAa,GAAG,MAAM,qBAAqB,CAAC,qBAAqB,CAAC;AAC5E,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG;AAC9B,QAAQ,GAAG,YAAY;AACvB,QAAQ,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;AAC/B,KAAK;AACL,IAAI,MAAM,qBAAqB,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AAC3F;AACY,MAAC,kBAAkB,GAAG,OAAO,qBAAqB,EAAE,QAAQ,KAAK;AAC7E,IAAI,MAAM,aAAa,GAAG,MAAM,qBAAqB,CAAC,qBAAqB,CAAC;AAC5E,IAAI,OAAO,aAAa,CAAC,QAAQ,CAAC;AAClC,IAAI,MAAM,qBAAqB,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AAC3F;;;;"}
|
|
@@ -10,12 +10,12 @@ export declare const getDataAccess: (config: {
|
|
|
10
10
|
}) => {
|
|
11
11
|
url: URL;
|
|
12
12
|
})) | undefined;
|
|
13
|
-
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext
|
|
13
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & import("../utils/createRetryDecider").RetryDecider) | undefined;
|
|
14
14
|
computeDelay?: ((attempt: number) => number) | undefined;
|
|
15
15
|
userAgentValue?: string | undefined;
|
|
16
16
|
uriEscapePath?: boolean | undefined;
|
|
17
17
|
} & {
|
|
18
|
-
credentials: import("@aws-amplify/core/internals/aws-client-utils").Credentials | ((options?: import("@aws-amplify/core/internals/aws-client-utils").CredentialsProviderOptions
|
|
18
|
+
credentials: import("@aws-amplify/core/internals/aws-client-utils").Credentials | ((options?: import("@aws-amplify/core/internals/aws-client-utils").CredentialsProviderOptions) => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
19
19
|
region: string;
|
|
20
20
|
onDownloadProgress?: ((event: import("../../../../..").TransferProgressEvent) => void) | undefined;
|
|
21
21
|
onUploadProgress?: ((event: import("../../../../..").TransferProgressEvent) => void) | undefined;
|
|
@@ -10,12 +10,12 @@ export declare const listCallerAccessGrants: (config: {
|
|
|
10
10
|
}) => {
|
|
11
11
|
url: URL;
|
|
12
12
|
})) | undefined;
|
|
13
|
-
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext
|
|
13
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & import("../utils/createRetryDecider").RetryDecider) | undefined;
|
|
14
14
|
computeDelay?: ((attempt: number) => number) | undefined;
|
|
15
15
|
userAgentValue?: string | undefined;
|
|
16
16
|
uriEscapePath?: boolean | undefined;
|
|
17
17
|
} & {
|
|
18
|
-
credentials: import("@aws-amplify/core/internals/aws-client-utils").Credentials | ((options?: import("@aws-amplify/core/internals/aws-client-utils").CredentialsProviderOptions
|
|
18
|
+
credentials: import("@aws-amplify/core/internals/aws-client-utils").Credentials | ((options?: import("@aws-amplify/core/internals/aws-client-utils").CredentialsProviderOptions) => Promise<import("@aws-amplify/core/internals/aws-client-utils").Credentials>);
|
|
19
19
|
region: string;
|
|
20
20
|
onDownloadProgress?: ((event: import("../../../../..").TransferProgressEvent) => void) | undefined;
|
|
21
21
|
onUploadProgress?: ((event: import("../../../../..").TransferProgressEvent) => void) | undefined;
|
|
@@ -7,17 +7,17 @@ export declare const abortMultipartUpload: (config: {
|
|
|
7
7
|
responseType?: "blob" | "text" | undefined;
|
|
8
8
|
service?: string | undefined;
|
|
9
9
|
endpointResolver?: (((options: import("@aws-amplify/core/internals/aws-client-utils").EndpointResolverOptions, input?: any) => Endpoint) & ((options: import("./base").S3EndpointResolverOptions, apiInput?: {
|
|
10
|
-
Bucket?: string
|
|
11
|
-
}
|
|
10
|
+
Bucket?: string;
|
|
11
|
+
}) => {
|
|
12
12
|
url: URL;
|
|
13
13
|
})) | undefined;
|
|
14
|
-
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext
|
|
14
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & import("../utils/createRetryDecider").RetryDecider) | undefined;
|
|
15
15
|
computeDelay?: ((attempt: number) => number) | undefined;
|
|
16
16
|
userAgentValue?: string | undefined;
|
|
17
17
|
useAccelerateEndpoint?: boolean | undefined;
|
|
18
18
|
uriEscapePath?: boolean | undefined;
|
|
19
19
|
} & {
|
|
20
|
-
credentials: import("@aws-sdk/types").AwsCredentialIdentity | ((options?: import("@aws-amplify/core/internals/aws-client-utils").CredentialsProviderOptions
|
|
20
|
+
credentials: import("@aws-sdk/types").AwsCredentialIdentity | ((options?: import("@aws-amplify/core/internals/aws-client-utils").CredentialsProviderOptions) => Promise<import("@aws-sdk/types").AwsCredentialIdentity>);
|
|
21
21
|
region: string;
|
|
22
22
|
onDownloadProgress?: ((event: import("../../../../..").TransferProgressEvent) => void) | undefined;
|
|
23
23
|
onUploadProgress?: ((event: import("../../../../..").TransferProgressEvent) => void) | undefined;
|