@aws-amplify/storage 6.7.16-unstable.81afde8.0 → 6.7.16-unstable.980e3f8.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/CanceledError.js.map +1 -1
- package/dist/cjs/errors/IntegrityError.js.map +1 -1
- package/dist/cjs/errors/StorageError.js.map +1 -1
- package/dist/cjs/errors/constants.js.map +1 -1
- package/dist/cjs/errors/types/validation.js.map +1 -1
- package/dist/cjs/errors/utils/assertValidationError.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internals/apis/copy.js.map +1 -1
- package/dist/cjs/internals/apis/downloadData.js.map +1 -1
- package/dist/cjs/internals/apis/getDataAccess.js.map +1 -1
- package/dist/cjs/internals/apis/getProperties.js.map +1 -1
- package/dist/cjs/internals/apis/getUrl.js.map +1 -1
- package/dist/cjs/internals/apis/list.js.map +1 -1
- package/dist/cjs/internals/apis/listCallerAccessGrants.js.map +1 -1
- package/dist/cjs/internals/apis/listPaths/getHighestPrecedenceUserGroup.js.map +1 -1
- package/dist/cjs/internals/apis/listPaths/index.js.map +1 -1
- package/dist/cjs/internals/apis/listPaths/listPaths.js.map +1 -1
- package/dist/cjs/internals/apis/listPaths/resolveLocationsForCurrentSession.js.map +1 -1
- package/dist/cjs/internals/apis/remove.js.map +1 -1
- package/dist/cjs/internals/apis/uploadData.js.map +1 -1
- package/dist/cjs/internals/index.js.map +1 -1
- package/dist/cjs/internals/utils/constants.js.map +1 -1
- package/dist/cjs/providers/s3/apis/copy.js.map +1 -1
- package/dist/cjs/providers/s3/apis/downloadData.js.map +1 -1
- package/dist/cjs/providers/s3/apis/getProperties.js.map +1 -1
- package/dist/cjs/providers/s3/apis/getUrl.js.map +1 -1
- package/dist/cjs/providers/s3/apis/index.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/copy.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/downloadData.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/getProperties.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/getUrl.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/remove.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/byteLength.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/index.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/calculatePartSize.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/getDataChunker.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/index.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/initialUpload.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/progressTracker.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadCache.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/uploadData/putObjectJob.js.map +1 -1
- package/dist/cjs/providers/s3/apis/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/remove.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/copy.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/getProperties.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/getUrl.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/index.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/server/remove.js.map +1 -1
- package/dist/cjs/providers/s3/apis/uploadData.js.map +1 -1
- package/dist/cjs/providers/s3/index.js.map +1 -1
- package/dist/cjs/providers/s3/server.js.map +1 -1
- 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.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/constants.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/contentSha256middleware.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/index.browser.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/index.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/index.native.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/fetch.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/xhr.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/xhrTransferHandler.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/dom.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/pureJs.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3control/base.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3control/getDataAccess.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3control/index.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3control/listCallerAccessGrants.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/abortMultipartUpload.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/base.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/completeMultipartUpload.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/copyObject.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/createMultipartUpload.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/deleteObject.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/getObject.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/headObject.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/index.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/listObjectsV2.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/listParts.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/putObject.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/s3data/uploadPart.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/createRetryDecider.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/index.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/integrityHelpers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/serializeHelpers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/constants.js.map +1 -1
- package/dist/cjs/providers/s3/utils/constructContentDisposition.js.map +1 -1
- package/dist/cjs/providers/s3/utils/crc32.js.map +1 -1
- package/dist/cjs/providers/s3/utils/getCombinedCrc32.js.map +1 -1
- package/dist/cjs/providers/s3/utils/getCombinedCrc32.native.js.map +1 -1
- package/dist/cjs/providers/s3/utils/hexUtils.js.map +1 -1
- package/dist/cjs/providers/s3/utils/index.js.map +1 -1
- package/dist/cjs/providers/s3/utils/isInputWithPath.js.map +1 -1
- package/dist/cjs/providers/s3/utils/md5.js.map +1 -1
- package/dist/cjs/providers/s3/utils/readFile.js.map +1 -1
- package/dist/cjs/providers/s3/utils/readFile.native.js.map +1 -1
- package/dist/cjs/providers/s3/utils/resolveIdentityId.js.map +1 -1
- package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js.map +1 -1
- package/dist/cjs/providers/s3/utils/transferTask.js.map +1 -1
- package/dist/cjs/providers/s3/utils/urlDecoder.js.map +1 -1
- package/dist/cjs/providers/s3/utils/userAgent.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateBucketOwnerID.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateMultipartUploadXML.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateObjectUrl.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateStorageOperationInput.js.map +1 -1
- package/dist/cjs/providers/s3/utils/validateStorageOperationInputWithPrefix.js.map +1 -1
- package/dist/cjs/server.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/logger.js.map +1 -1
- package/dist/cjs/utils/resolvePrefix.js.map +1 -1
- package/dist/esm/errors/CanceledError.mjs.map +1 -1
- package/dist/esm/errors/IntegrityError.mjs.map +1 -1
- package/dist/esm/errors/StorageError.mjs.map +1 -1
- package/dist/esm/errors/types/validation.mjs.map +1 -1
- package/dist/esm/errors/utils/assertValidationError.mjs.map +1 -1
- package/dist/esm/internals/apis/getDataAccess.mjs.map +1 -1
- package/dist/esm/internals/apis/list.mjs.map +1 -1
- package/dist/esm/internals/apis/listCallerAccessGrants.mjs.map +1 -1
- package/dist/esm/internals/apis/listPaths/getHighestPrecedenceUserGroup.mjs.map +1 -1
- package/dist/esm/internals/apis/listPaths/listPaths.mjs.map +1 -1
- package/dist/esm/internals/apis/listPaths/resolveLocationsForCurrentSession.mjs.map +1 -1
- package/dist/esm/internals/apis/uploadData.mjs.map +1 -1
- package/dist/esm/internals/utils/constants.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/copy.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/downloadData.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/getProperties.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/getUrl.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/copy.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/downloadData.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/getProperties.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/getUrl.mjs +1 -1
- package/dist/esm/providers/s3/apis/internal/getUrl.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/list.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/remove.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/byteLength.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/index.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/calculatePartSize.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/getDataChunker.mjs +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/getDataChunker.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/initialUpload.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/progressTracker.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.mjs +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/putObjectJob.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/list.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/remove.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/server/copy.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/server/getProperties.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/server/getUrl.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/server/list.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/server/remove.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/uploadData.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/constants.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3control/base.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3control/getDataAccess.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3control/listCallerAccessGrants.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/abortMultipartUpload.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/base.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/completeMultipartUpload.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/copyObject.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/copyObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/deleteObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/getObject.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/getObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/headObject.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/headObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/listParts.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/putObject.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/putObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/s3data/uploadPart.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/createRetryDecider.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/integrityHelpers.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/serializeHelpers.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/constants.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/constructContentDisposition.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/crc32.mjs +1 -1
- package/dist/esm/providers/s3/utils/crc32.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/getCombinedCrc32.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/getCombinedCrc32.native.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/hexUtils.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/isInputWithPath.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/md5.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/readFile.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/readFile.native.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/resolveIdentityId.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/transferTask.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/urlDecoder.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/userAgent.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/validateBucketOwnerID.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/validateMultipartUploadXML.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/validateObjectUrl.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/validateStorageOperationInput.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/validateStorageOperationInputWithPrefix.mjs.map +1 -1
- package/dist/esm/utils/resolvePrefix.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crc32.js","sources":["../../../../../src/providers/s3/utils/crc32.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.calculateContentCRC32 = void 0;\nconst tslib_1 = require(\"tslib\");\nconst crc_32_1 = tslib_1.__importDefault(require(\"crc-32\"));\nconst hexUtils_1 = require(\"./hexUtils\");\nconst readFile_1 = require(\"./readFile\");\nconst CHUNK_SIZE = 1024 * 1024; // 1MB chunks\nconst calculateContentCRC32 = async (content, seed = 0) => {\n let internalSeed = seed;\n if (content instanceof ArrayBuffer || ArrayBuffer.isView(content)) {\n let uint8Array;\n if (content instanceof ArrayBuffer) {\n uint8Array = new Uint8Array(content);\n }\n else {\n uint8Array = new Uint8Array(content.buffer, content.byteOffset, content.byteLength);\n }\n let offset = 0;\n while (offset < uint8Array.length) {\n const end = Math.min(offset + CHUNK_SIZE, uint8Array.length);\n const chunk = uint8Array.slice(offset, end);\n internalSeed = crc_32_1.default.buf(chunk, internalSeed) >>> 0;\n offset = end;\n }\n }\n else {\n let blob;\n if (content instanceof Blob) {\n blob = content;\n }\n else {\n blob = new Blob([content]);\n }\n let offset = 0;\n while (offset < blob.size) {\n const end = Math.min(offset + CHUNK_SIZE, blob.size);\n const chunk = blob.slice(offset, end);\n const arrayBuffer = await (0, readFile_1.readFile)(chunk);\n const uint8Array = new Uint8Array(arrayBuffer);\n internalSeed = crc_32_1.default.buf(uint8Array, internalSeed) >>> 0;\n offset = end;\n }\n }\n const hex = internalSeed.toString(16).padStart(8, '0');\n return {\n checksumArrayBuffer: (0, hexUtils_1.hexToArrayBuffer)(hex),\n checksum: (0, hexUtils_1.hexToBase64)(hex),\n seed: internalSeed,\n };\n};\nexports.calculateContentCRC32 = calculateContentCRC32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"crc32.js","sources":["../../../../../src/providers/s3/utils/crc32.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.calculateContentCRC32 = void 0;\nconst tslib_1 = require(\"tslib\");\nconst crc_32_1 = tslib_1.__importDefault(require(\"crc-32\"));\nconst hexUtils_1 = require(\"./hexUtils\");\nconst readFile_1 = require(\"./readFile\");\nconst CHUNK_SIZE = 1024 * 1024; // 1MB chunks\nconst calculateContentCRC32 = async (content, seed = 0) => {\n let internalSeed = seed;\n if (content instanceof ArrayBuffer || ArrayBuffer.isView(content)) {\n let uint8Array;\n if (content instanceof ArrayBuffer) {\n uint8Array = new Uint8Array(content);\n }\n else {\n uint8Array = new Uint8Array(content.buffer, content.byteOffset, content.byteLength);\n }\n let offset = 0;\n while (offset < uint8Array.length) {\n const end = Math.min(offset + CHUNK_SIZE, uint8Array.length);\n const chunk = uint8Array.slice(offset, end);\n internalSeed = crc_32_1.default.buf(chunk, internalSeed) >>> 0;\n offset = end;\n }\n }\n else {\n let blob;\n if (content instanceof Blob) {\n blob = content;\n }\n else {\n blob = new Blob([content]);\n }\n let offset = 0;\n while (offset < blob.size) {\n const end = Math.min(offset + CHUNK_SIZE, blob.size);\n const chunk = blob.slice(offset, end);\n const arrayBuffer = await (0, readFile_1.readFile)(chunk);\n const uint8Array = new Uint8Array(arrayBuffer);\n internalSeed = crc_32_1.default.buf(uint8Array, internalSeed) >>> 0;\n offset = end;\n }\n }\n const hex = internalSeed.toString(16).padStart(8, '0');\n return {\n checksumArrayBuffer: (0, hexUtils_1.hexToArrayBuffer)(hex),\n checksum: (0, hexUtils_1.hexToBase64)(hex),\n seed: internalSeed,\n };\n};\nexports.calculateContentCRC32 = calculateContentCRC32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,E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"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.getCombinedCrc32 = void 0;\nconst getDataChunker_1 = require(\"../apis/internal/uploadData/multipart/getDataChunker\");\nconst crc32_1 = require(\"./crc32\");\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nconst getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = (0, getDataChunker_1.getDataChunker)(data, size);\n for (const { data: checkData } of dataChunker) {\n const { checksumArrayBuffer } = await (0, crc32_1.calculateContentCRC32)(checkData);\n crc32List.push(checksumArrayBuffer);\n }\n return `${(await (0, crc32_1.calculateContentCRC32)(new Blob(crc32List))).checksum}-${crc32List.length}`;\n};\nexports.getCombinedCrc32 = getCombinedCrc32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"getCombinedCrc32.js","sources":["../../../../../src/providers/s3/utils/getCombinedCrc32.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.getCombinedCrc32 = void 0;\nconst getDataChunker_1 = require(\"../apis/internal/uploadData/multipart/getDataChunker\");\nconst crc32_1 = require(\"./crc32\");\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nconst getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = (0, getDataChunker_1.getDataChunker)(data, size);\n for (const { data: checkData } of dataChunker) {\n const { checksumArrayBuffer } = await (0, crc32_1.calculateContentCRC32)(checkData);\n crc32List.push(checksumArrayBuffer);\n }\n return `${(await (0, crc32_1.calculateContentCRC32)(new Blob(crc32List))).checksum}-${crc32List.length}`;\n};\nexports.getCombinedCrc32 = getCombinedCrc32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,gBAAgB,GAAG,OAAO,CAAC,sDAAsD,CAAC;AACxF,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK;AAC/C,IAAI,MAAM,SAAS,GAAG,EAAE;AACxB,IAAI,MAAM,WAAW,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;AACxE,IAAI,KAAK,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,WAAW,EAAE;AACnD,QAAQ,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,qBAAqB,EAAE,SAAS,CAAC;AAC3F,QAAQ,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC;AAC3C;AACA,IAAI,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,OAAO,CAAC,qBAAqB,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AAC5G,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCombinedCrc32.native.js","sources":["../../../../../src/providers/s3/utils/getCombinedCrc32.native.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.getCombinedCrc32 = void 0;\nconst getDataChunker_1 = require(\"../apis/internal/uploadData/multipart/getDataChunker\");\nconst crc32_1 = require(\"./crc32\");\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nconst getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = (0, getDataChunker_1.getDataChunker)(data, size);\n let totalLength = 0;\n for (const { data: checkData } of dataChunker) {\n const checksum = new Uint8Array((await (0, crc32_1.calculateContentCRC32)(checkData)).checksumArrayBuffer);\n totalLength += checksum.length;\n crc32List.push(checksum);\n }\n // Combine all Uint8Arrays into a single Uint8Array\n const combinedArray = new Uint8Array(totalLength);\n let offset = 0;\n for (const crc32Hash of crc32List) {\n combinedArray.set(crc32Hash, offset);\n offset += crc32Hash.length;\n }\n return `${(await (0, crc32_1.calculateContentCRC32)(combinedArray.buffer)).checksum}-${crc32List.length}`;\n};\nexports.getCombinedCrc32 = getCombinedCrc32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"getCombinedCrc32.native.js","sources":["../../../../../src/providers/s3/utils/getCombinedCrc32.native.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.getCombinedCrc32 = void 0;\nconst getDataChunker_1 = require(\"../apis/internal/uploadData/multipart/getDataChunker\");\nconst crc32_1 = require(\"./crc32\");\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nconst getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = (0, getDataChunker_1.getDataChunker)(data, size);\n let totalLength = 0;\n for (const { data: checkData } of dataChunker) {\n const checksum = new Uint8Array((await (0, crc32_1.calculateContentCRC32)(checkData)).checksumArrayBuffer);\n totalLength += checksum.length;\n crc32List.push(checksum);\n }\n // Combine all Uint8Arrays into a single Uint8Array\n const combinedArray = new Uint8Array(totalLength);\n let offset = 0;\n for (const crc32Hash of crc32List) {\n combinedArray.set(crc32Hash, offset);\n offset += crc32Hash.length;\n }\n return `${(await (0, crc32_1.calculateContentCRC32)(combinedArray.buffer)).checksum}-${crc32List.length}`;\n};\nexports.getCombinedCrc32 = getCombinedCrc32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG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s3/utils/hexUtils.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.hexToBase64 = exports.hexToArrayBuffer = exports.hexToUint8Array = void 0;\nconst runtime_1 = require(\"./client/runtime\");\nconst hexToUint8Array = (hexString) => new Uint8Array((hexString.match(/\\w{2}/g) ?? []).map(h => parseInt(h, 16)));\nexports.hexToUint8Array = hexToUint8Array;\nconst hexToArrayBuffer = (hexString) => (0, exports.hexToUint8Array)(hexString).buffer;\nexports.hexToArrayBuffer = hexToArrayBuffer;\nconst hexToBase64 = (hexString) => (0, runtime_1.toBase64)((0, exports.hexToUint8Array)(hexString));\nexports.hexToBase64 = hexToBase64;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"hexUtils.js","sources":["../../../../../src/providers/s3/utils/hexUtils.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.hexToBase64 = exports.hexToArrayBuffer = exports.hexToUint8Array = void 0;\nconst runtime_1 = require(\"./client/runtime\");\nconst hexToUint8Array = (hexString) => new Uint8Array((hexString.match(/\\w{2}/g) ?? []).map(h => parseInt(h, 16)));\nexports.hexToUint8Array = hexToUint8Array;\nconst hexToArrayBuffer = (hexString) => (0, exports.hexToUint8Array)(hexString).buffer;\nexports.hexToArrayBuffer = hexToArrayBuffer;\nconst hexToBase64 = (hexString) => (0, runtime_1.toBase64)((0, exports.hexToUint8Array)(hexString));\nexports.hexToBase64 = hexToBase64;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,GAAG,MAAM;AACjF,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAC7C,MAAM,eAAe,GAAG,CAAC,SAAS,KAAK,IAAI,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClH,OAAO,CAAC,eAAe,GAAG,eAAe;AACzC,MAAM,gBAAgB,GAAG,CAAC,SAAS,KAAK,IAAI,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM;AACtF,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;AAC3C,MAAM,WAAW,GAAG,CAAC,SAAS,KAAK,IAAI,SAAS,CAAC,QAAQ,EAAE,IAAI,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;AACnG,OAAO,CAAC,WAAW,GAAG,WAAW;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/providers/s3/utils/index.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.urlDecode = exports.isInputWithPath = exports.validateStorageOperationInputWithPrefix = exports.validateStorageOperationInput = exports.validateBucketOwnerID = exports.createUploadTask = exports.createDownloadTask = exports.resolveS3ConfigAndInput = exports.calculateContentMd5 = void 0;\nvar md5_1 = require(\"./md5\");\nObject.defineProperty(exports, \"calculateContentMd5\", { enumerable: true, get: function () { return md5_1.calculateContentMd5; } });\nvar resolveS3ConfigAndInput_1 = require(\"./resolveS3ConfigAndInput\");\nObject.defineProperty(exports, \"resolveS3ConfigAndInput\", { enumerable: true, get: function () { return resolveS3ConfigAndInput_1.resolveS3ConfigAndInput; } });\nvar transferTask_1 = require(\"./transferTask\");\nObject.defineProperty(exports, \"createDownloadTask\", { enumerable: true, get: function () { return transferTask_1.createDownloadTask; } });\nObject.defineProperty(exports, \"createUploadTask\", { enumerable: true, get: function () { return transferTask_1.createUploadTask; } });\nvar validateBucketOwnerID_1 = require(\"./validateBucketOwnerID\");\nObject.defineProperty(exports, \"validateBucketOwnerID\", { enumerable: true, get: function () { return validateBucketOwnerID_1.validateBucketOwnerID; } });\nvar validateStorageOperationInput_1 = require(\"./validateStorageOperationInput\");\nObject.defineProperty(exports, \"validateStorageOperationInput\", { enumerable: true, get: function () { return validateStorageOperationInput_1.validateStorageOperationInput; } });\nvar validateStorageOperationInputWithPrefix_1 = require(\"./validateStorageOperationInputWithPrefix\");\nObject.defineProperty(exports, \"validateStorageOperationInputWithPrefix\", { enumerable: true, get: function () { return validateStorageOperationInputWithPrefix_1.validateStorageOperationInputWithPrefix; } });\nvar isInputWithPath_1 = require(\"./isInputWithPath\");\nObject.defineProperty(exports, \"isInputWithPath\", { enumerable: true, get: function () { return isInputWithPath_1.isInputWithPath; } });\nvar urlDecoder_1 = require(\"./urlDecoder\");\nObject.defineProperty(exports, \"urlDecode\", { enumerable: true, get: function () { return urlDecoder_1.urlDecode; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/providers/s3/utils/index.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.urlDecode = exports.isInputWithPath = exports.validateStorageOperationInputWithPrefix = exports.validateStorageOperationInput = exports.validateBucketOwnerID = exports.createUploadTask = exports.createDownloadTask = exports.resolveS3ConfigAndInput = exports.calculateContentMd5 = void 0;\nvar md5_1 = require(\"./md5\");\nObject.defineProperty(exports, \"calculateContentMd5\", { enumerable: true, get: function () { return md5_1.calculateContentMd5; } });\nvar resolveS3ConfigAndInput_1 = require(\"./resolveS3ConfigAndInput\");\nObject.defineProperty(exports, \"resolveS3ConfigAndInput\", { enumerable: true, get: function () { return resolveS3ConfigAndInput_1.resolveS3ConfigAndInput; } });\nvar transferTask_1 = require(\"./transferTask\");\nObject.defineProperty(exports, \"createDownloadTask\", { enumerable: true, get: function () { return transferTask_1.createDownloadTask; } });\nObject.defineProperty(exports, \"createUploadTask\", { enumerable: true, get: function () { return transferTask_1.createUploadTask; } });\nvar validateBucketOwnerID_1 = require(\"./validateBucketOwnerID\");\nObject.defineProperty(exports, \"validateBucketOwnerID\", { enumerable: true, get: function () { return validateBucketOwnerID_1.validateBucketOwnerID; } });\nvar validateStorageOperationInput_1 = require(\"./validateStorageOperationInput\");\nObject.defineProperty(exports, \"validateStorageOperationInput\", { enumerable: true, get: function () { return validateStorageOperationInput_1.validateStorageOperationInput; } });\nvar validateStorageOperationInputWithPrefix_1 = require(\"./validateStorageOperationInputWithPrefix\");\nObject.defineProperty(exports, \"validateStorageOperationInputWithPrefix\", { enumerable: true, get: function () { return validateStorageOperationInputWithPrefix_1.validateStorageOperationInputWithPrefix; } });\nvar isInputWithPath_1 = require(\"./isInputWithPath\");\nObject.defineProperty(exports, \"isInputWithPath\", { enumerable: true, get: function () { return isInputWithPath_1.isInputWithPath; } });\nvar urlDecoder_1 = require(\"./urlDecoder\");\nObject.defineProperty(exports, \"urlDecode\", { enumerable: true, get: function () { return urlDecoder_1.urlDecode; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,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,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAChF,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,+BAA+B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,+BAA+B,CAAC,6BAA6B,CAAC,EAAE,EAAE,CAAC;AACjL,IAAI,yCAAyC,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yCAAyC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,yCAAyC,CAAC,uCAAuC,CAAC,EAAE,EAAE,CAAC;AAC/M,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AACvI,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInputWithPath.js","sources":["../../../../../src/providers/s3/utils/isInputWithPath.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.isInputWithPath = void 0;\nconst isInputWithPath = (input) => {\n return input.path !== undefined;\n};\nexports.isInputWithPath = isInputWithPath;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"isInputWithPath.js","sources":["../../../../../src/providers/s3/utils/isInputWithPath.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.isInputWithPath = void 0;\nconst isInputWithPath = (input) => {\n return input.path !== undefined;\n};\nexports.isInputWithPath = isInputWithPath;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,eAAe,GAAG,CAAC,KAAK,KAAK;AACnC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS;AACnC,CAAC;AACD,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"md5.js","sources":["../../../../../src/providers/s3/utils/md5.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.calculateContentMd5 = void 0;\nconst md5_js_1 = require(\"@smithy/md5-js\");\nconst utils_1 = require(\"./client/utils\");\nconst readFile_1 = require(\"./readFile\");\nconst calculateContentMd5 = async (content) => {\n const hasher = new md5_js_1.Md5();\n const buffer = content instanceof Blob ? await (0, readFile_1.readFile)(content) : content;\n hasher.update(buffer);\n const digest = await hasher.digest();\n return (0, utils_1.toBase64)(digest);\n};\nexports.calculateContentMd5 = calculateContentMd5;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"md5.js","sources":["../../../../../src/providers/s3/utils/md5.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.calculateContentMd5 = void 0;\nconst md5_js_1 = require(\"@smithy/md5-js\");\nconst utils_1 = require(\"./client/utils\");\nconst readFile_1 = require(\"./readFile\");\nconst calculateContentMd5 = async (content) => {\n const hasher = new md5_js_1.Md5();\n const buffer = content instanceof Blob ? await (0, readFile_1.readFile)(content) : content;\n hasher.update(buffer);\n const digest = await hasher.digest();\n return (0, utils_1.toBase64)(digest);\n};\nexports.calculateContentMd5 = calculateContentMd5;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;AACxC,MAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK;AAC/C,IAAI,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE;AACrC,IAAI,MAAM,MAAM,GAAG,OAAO,YAAY,IAAI,GAAG,MAAM,IAAI,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,OAAO;AAC9F,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AACzB,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE;AACxC,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;AACxC,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readFile.js","sources":["../../../../../src/providers/s3/utils/readFile.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.readFile = void 0;\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsArrayBuffer(file);\n});\nexports.readFile = readFile;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"readFile.js","sources":["../../../../../src/providers/s3/utils/readFile.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.readFile = void 0;\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsArrayBuffer(file);\n});\nexports.readFile = readFile;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,QAAQ,GAAG,MAAM;AACzB,MAAM,QAAQ,GAAG,CAAC,IAAI,KAAK,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5D,IAAI,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE;AACnC,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM;AAC1B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC9B,KAAK;AACL,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;AACzC,KAAK;AACL,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC;AAClC,CAAC,CAAC;AACF,OAAO,CAAC,QAAQ,GAAG,QAAQ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readFile.native.js","sources":["../../../../../src/providers/s3/utils/readFile.native.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.readFile = void 0;\nconst buffer_1 = require(\"buffer\");\n// The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accommodates this\n// by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.\n// TODO: This file should be removable when we drop support for React Native 0.71\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n try {\n reader.readAsArrayBuffer(file);\n }\n catch (e) {\n reader.onload = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n const [, base64Data] = reader.result.split(',');\n const arrayBuffer = buffer_1.Buffer.from(base64Data, 'base64');\n resolve(arrayBuffer);\n };\n reader.readAsDataURL(file);\n }\n});\nexports.readFile = readFile;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"readFile.native.js","sources":["../../../../../src/providers/s3/utils/readFile.native.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.readFile = void 0;\nconst buffer_1 = require(\"buffer\");\n// The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accommodates this\n// by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.\n// TODO: This file should be removable when we drop support for React Native 0.71\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n try {\n reader.readAsArrayBuffer(file);\n }\n catch (e) {\n reader.onload = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n const [, base64Data] = reader.result.split(',');\n const arrayBuffer = buffer_1.Buffer.from(base64Data, 'base64');\n resolve(arrayBuffer);\n };\n reader.readAsDataURL(file);\n }\n});\nexports.readFile = readFile;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,QAAQ,GAAG,MAAM;AACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AAClC;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,IAAI,KAAK,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5D,IAAI,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE;AACnC,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM;AAC1B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC9B,KAAK;AACL,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;AACzC,KAAK;AACL,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5B,KAAK;AACL,IAAI,IAAI;AACR,QAAQ,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC;AACtC;AACA,IAAI,OAAO,CAAC,EAAE;AACd,QAAQ,MAAM,CAAC,MAAM,GAAG,MAAM;AAC9B;AACA;AACA,YAAY,MAAM,GAAG,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAC3D,YAAY,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC1E,YAAY,OAAO,CAAC,WAAW,CAAC;AAChC,SAAS;AACT,QAAQ,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC;AAClC;AACA,CAAC,CAAC;AACF,OAAO,CAAC,QAAQ,GAAG,QAAQ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveIdentityId.js","sources":["../../../../../src/providers/s3/utils/resolveIdentityId.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.resolveIdentityId = void 0;\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst resolveIdentityId = (identityId) => {\n (0, assertValidationError_1.assertValidationError)(!!identityId, validation_1.StorageValidationErrorCode.NoIdentityId);\n return identityId;\n};\nexports.resolveIdentityId = resolveIdentityId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"resolveIdentityId.js","sources":["../../../../../src/providers/s3/utils/resolveIdentityId.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.resolveIdentityId = void 0;\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst resolveIdentityId = (identityId) => {\n (0, assertValidationError_1.assertValidationError)(!!identityId, validation_1.StorageValidationErrorCode.NoIdentityId);\n return identityId;\n};\nexports.resolveIdentityId = resolveIdentityId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,MAAM;AAClC,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,iBAAiB,GAAG,CAAC,UAAU,KAAK;AAC1C,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,0BAA0B,CAAC,YAAY,CAAC;AAC1H,IAAI,OAAO,UAAU;AACrB,CAAC;AACD,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveS3ConfigAndInput.js","sources":["../../../../../src/providers/s3/utils/resolveS3ConfigAndInput.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.resolveS3ConfigAndInput = void 0;\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst resolvePrefix_1 = require(\"../../../utils/resolvePrefix\");\nconst StorageError_1 = require(\"../../../errors/StorageError\");\nconst constants_1 = require(\"../../../errors/constants\");\nconst constants_2 = require(\"./constants\");\n/**\n * resolve the common input options for S3 API handlers from Amplify configuration and library options.\n *\n * @param {AmplifyClassV6} amplify The Amplify instance.\n * @param {S3ApiOptions} apiOptions The input options for S3 provider.\n * @returns {Promise<ResolvedS3ConfigAndInput>} The resolved common input options for S3 API handlers.\n * @throws A `StorageError` with `error.name` from `StorageValidationErrorCode` indicating invalid\n * configurations or Amplify library options.\n *\n * @internal\n */\nconst resolveS3ConfigAndInput = async (amplify, apiInput) => {\n const { options: apiOptions } = apiInput ?? {};\n /**\n * IdentityId is always cached in memory so we can safely make calls here. It\n * should be stable even for unauthenticated users, regardless of credentials.\n */\n const { identityId } = await amplify.Auth.fetchAuthSession();\n /**\n * A credentials provider function instead of a static credentials object is\n * used because the long-running tasks like multipart upload may span over the\n * credentials expiry. Auth.fetchAuthSession() automatically refreshes the\n * credentials if they are expired.\n *\n * The optional forceRefresh option is set when the S3 service returns expired\n * tokens error in the previous API call attempt.\n */\n const credentialsProvider = async (options) => {\n if (isLocationCredentialsProvider(apiOptions)) {\n assertStorageInput(apiInput);\n }\n // TODO: forceRefresh option of fetchAuthSession would refresh both tokens and\n // AWS credentials. So we do not support forceRefreshing from the Auth until\n // we support refreshing only the credentials.\n const { credentials } = isLocationCredentialsProvider(apiOptions)\n ? await apiOptions.locationCredentialsProvider(options)\n : await amplify.Auth.fetchAuthSession();\n (0, assertValidationError_1.assertValidationError)(!!credentials, validation_1.StorageValidationErrorCode.NoCredentials);\n return credentials;\n };\n const { bucket: defaultBucket, region: defaultRegion, dangerouslyConnectToHttpEndpointForTesting, buckets, } = amplify.getConfig()?.Storage?.S3 ?? {};\n const { bucket = defaultBucket, region = defaultRegion } = (apiOptions?.bucket && resolveBucketConfig(apiOptions, buckets)) || {};\n (0, assertValidationError_1.assertValidationError)(!!bucket, validation_1.StorageValidationErrorCode.NoBucket);\n (0, assertValidationError_1.assertValidationError)(!!region, validation_1.StorageValidationErrorCode.NoRegion);\n const { defaultAccessLevel, prefixResolver = resolvePrefix_1.resolvePrefix, isObjectLockEnabled, } = amplify.libraryOptions?.Storage?.S3 ?? {};\n const accessLevel = apiOptions?.accessLevel ?? defaultAccessLevel ?? constants_2.DEFAULT_ACCESS_LEVEL;\n const targetIdentityId = accessLevel === 'protected'\n ? (apiOptions?.targetIdentityId ?? identityId)\n : identityId;\n const keyPrefix = await prefixResolver({ accessLevel, targetIdentityId });\n return {\n s3Config: {\n credentials: credentialsProvider,\n region,\n useAccelerateEndpoint: apiOptions?.useAccelerateEndpoint,\n ...(apiOptions?.customEndpoint\n ? { customEndpoint: apiOptions.customEndpoint }\n : {}),\n ...(dangerouslyConnectToHttpEndpointForTesting\n ? {\n customEndpoint: constants_2.LOCAL_TESTING_S3_ENDPOINT,\n forcePathStyle: true,\n }\n : {}),\n },\n bucket,\n keyPrefix,\n identityId,\n isObjectLockEnabled,\n };\n};\nexports.resolveS3ConfigAndInput = resolveS3ConfigAndInput;\nconst isLocationCredentialsProvider = (options) => {\n return !!options?.locationCredentialsProvider;\n};\nconst isInputWithCallbackPath = (input) => {\n return ((input?.path &&\n typeof input.path === 'function') ||\n (input?.destination?.path &&\n typeof input.destination?.path === 'function') ||\n (input?.source?.path &&\n typeof input.source?.path === 'function'));\n};\nconst isDeprecatedInput = (input) => {\n return (isInputWithKey(input) ||\n isInputWithPrefix(input) ||\n isInputWithCopySourceOrDestination(input));\n};\nconst assertStorageInput = (input) => {\n if (isDeprecatedInput(input) || isInputWithCallbackPath(input)) {\n throw new StorageError_1.StorageError({\n name: constants_1.INVALID_STORAGE_INPUT,\n message: 'The input needs to have a path as a string value.',\n recoverySuggestion: 'Please provide a valid path as a string value for the input.',\n });\n }\n};\nconst isInputWithKey = (input) => {\n return !!(typeof input.key === 'string');\n};\nconst isInputWithPrefix = (input) => {\n return !!(typeof input.prefix === 'string');\n};\nconst isInputWithCopySourceOrDestination = (input) => {\n return !!(typeof input.source?.key === 'string' ||\n typeof input.destination?.key === 'string');\n};\nconst resolveBucketConfig = (apiOptions, buckets) => {\n if (typeof apiOptions.bucket === 'string') {\n const bucketConfig = buckets?.[apiOptions.bucket];\n (0, assertValidationError_1.assertValidationError)(!!bucketConfig, validation_1.StorageValidationErrorCode.InvalidStorageBucket);\n return { bucket: bucketConfig.bucketName, region: bucketConfig.region };\n }\n if (typeof apiOptions.bucket === 'object') {\n return {\n bucket: apiOptions.bucket.bucketName,\n region: apiOptions.bucket.region,\n };\n }\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACzC,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC,CAAC;AACvF,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACjE,MAAM,eAAe,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAChE,MAAM,cAAc,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC/D,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACzD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,uBAAuB,GAAG,OAAO,OAAO,EAAE,QAAQ,KAAK;AAC7D,IAAI,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAC;AACnD;AACA;AACA;AACA;AACA,IAAI,MA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E,GAAG,KAAK,QAAQ;AACnD,QAAQ,OAAO,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC;AACF,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,OAAO,KAAK;AACrD,IAAI,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,EAAE;AAC/C,QAAQ,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1D,QAAQ,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,0BAA0B,CAAC,oBAAoB,CAAC,CAAC;AACzI,QAAQ,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC;AAChF,KAAK;AACL,IAAI,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,EAAE;AAC/C,QAAQ,OAAO;AACf,YAAY,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU;AAChD,YAAY,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM;AAC5C,SAAS,CAAC;AACV,KAAK;AACL,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"resolveS3ConfigAndInput.js","sources":["../../../../../src/providers/s3/utils/resolveS3ConfigAndInput.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.resolveS3ConfigAndInput = void 0;\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst resolvePrefix_1 = require(\"../../../utils/resolvePrefix\");\nconst StorageError_1 = require(\"../../../errors/StorageError\");\nconst constants_1 = require(\"../../../errors/constants\");\nconst constants_2 = require(\"./constants\");\n/**\n * resolve the common input options for S3 API handlers from Amplify configuration and library options.\n *\n * @param {AmplifyClassV6} amplify The Amplify instance.\n * @param {S3ApiOptions} apiOptions The input options for S3 provider.\n * @returns {Promise<ResolvedS3ConfigAndInput>} The resolved common input options for S3 API handlers.\n * @throws A `StorageError` with `error.name` from `StorageValidationErrorCode` indicating invalid\n * configurations or Amplify library options.\n *\n * @internal\n */\nconst resolveS3ConfigAndInput = async (amplify, apiInput) => {\n const { options: apiOptions } = apiInput ?? {};\n /**\n * IdentityId is always cached in memory so we can safely make calls here. It\n * should be stable even for unauthenticated users, regardless of credentials.\n */\n const { identityId } = await amplify.Auth.fetchAuthSession();\n /**\n * A credentials provider function instead of a static credentials object is\n * used because the long-running tasks like multipart upload may span over the\n * credentials expiry. Auth.fetchAuthSession() automatically refreshes the\n * credentials if they are expired.\n *\n * The optional forceRefresh option is set when the S3 service returns expired\n * tokens error in the previous API call attempt.\n */\n const credentialsProvider = async (options) => {\n if (isLocationCredentialsProvider(apiOptions)) {\n assertStorageInput(apiInput);\n }\n // TODO: forceRefresh option of fetchAuthSession would refresh both tokens and\n // AWS credentials. So we do not support forceRefreshing from the Auth until\n // we support refreshing only the credentials.\n const { credentials } = isLocationCredentialsProvider(apiOptions)\n ? await apiOptions.locationCredentialsProvider(options)\n : await amplify.Auth.fetchAuthSession();\n (0, assertValidationError_1.assertValidationError)(!!credentials, validation_1.StorageValidationErrorCode.NoCredentials);\n return credentials;\n };\n const { bucket: defaultBucket, region: defaultRegion, dangerouslyConnectToHttpEndpointForTesting, buckets, } = amplify.getConfig()?.Storage?.S3 ?? {};\n const { bucket = defaultBucket, region = defaultRegion } = (apiOptions?.bucket && resolveBucketConfig(apiOptions, buckets)) || {};\n (0, assertValidationError_1.assertValidationError)(!!bucket, validation_1.StorageValidationErrorCode.NoBucket);\n (0, assertValidationError_1.assertValidationError)(!!region, validation_1.StorageValidationErrorCode.NoRegion);\n const { defaultAccessLevel, prefixResolver = resolvePrefix_1.resolvePrefix, isObjectLockEnabled, } = amplify.libraryOptions?.Storage?.S3 ?? {};\n const accessLevel = apiOptions?.accessLevel ?? defaultAccessLevel ?? constants_2.DEFAULT_ACCESS_LEVEL;\n const targetIdentityId = accessLevel === 'protected'\n ? (apiOptions?.targetIdentityId ?? identityId)\n : identityId;\n const keyPrefix = await prefixResolver({ accessLevel, targetIdentityId });\n return {\n s3Config: {\n credentials: credentialsProvider,\n region,\n useAccelerateEndpoint: apiOptions?.useAccelerateEndpoint,\n ...(apiOptions?.customEndpoint\n ? { customEndpoint: apiOptions.customEndpoint }\n : {}),\n ...(dangerouslyConnectToHttpEndpointForTesting\n ? {\n customEndpoint: constants_2.LOCAL_TESTING_S3_ENDPOINT,\n forcePathStyle: true,\n }\n : {}),\n },\n bucket,\n keyPrefix,\n identityId,\n isObjectLockEnabled,\n };\n};\nexports.resolveS3ConfigAndInput = resolveS3ConfigAndInput;\nconst isLocationCredentialsProvider = (options) => {\n return !!options?.locationCredentialsProvider;\n};\nconst isInputWithCallbackPath = (input) => {\n return ((input?.path &&\n typeof input.path === 'function') ||\n (input?.destination?.path &&\n typeof input.destination?.path === 'function') ||\n (input?.source?.path &&\n typeof input.source?.path === 'function'));\n};\nconst isDeprecatedInput = (input) => {\n return (isInputWithKey(input) ||\n isInputWithPrefix(input) ||\n isInputWithCopySourceOrDestination(input));\n};\nconst assertStorageInput = (input) => {\n if (isDeprecatedInput(input) || isInputWithCallbackPath(input)) {\n throw new StorageError_1.StorageError({\n name: constants_1.INVALID_STORAGE_INPUT,\n message: 'The input needs to have a path as a string value.',\n recoverySuggestion: 'Please provide a valid path as a string value for the input.',\n });\n }\n};\nconst isInputWithKey = (input) => {\n return !!(typeof input.key === 'string');\n};\nconst isInputWithPrefix = (input) => {\n return !!(typeof input.prefix === 'string');\n};\nconst isInputWithCopySourceOrDestination = (input) => {\n return !!(typeof input.source?.key === 'string' ||\n typeof input.destination?.key === 'string');\n};\nconst resolveBucketConfig = (apiOptions, buckets) => {\n if (typeof apiOptions.bucket === 'string') {\n const bucketConfig = buckets?.[apiOptions.bucket];\n (0, assertValidationError_1.assertValidationError)(!!bucketConfig, validation_1.StorageValidationErrorCode.InvalidStorageBucket);\n return { bucket: bucketConfig.bucketName, region: bucketConfig.region };\n }\n if (typeof apiOptions.bucket === 'object') {\n return {\n bucket: apiOptions.bucket.bucketName,\n region: apiOptions.bucket.region,\n };\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,uBAAuB,GAAG,MAAM;AACxC,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,eAAe,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC/D,MAAM,cAAc,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,uBAAuB,GAAG,OAAO,OAAO,EAAE,QAAQ,KAAK;AAC7D,IAAI,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,IAAI,EAAE;AAClD;AACA;AACA;AACA;AACA,IAAI,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK;AACnD,QAAQ,IAAI,6BAA6B,CAAC,UAAU,CAAC,EAAE;AACvD,YAAY,kBAAkB,CAAC,QAAQ,CAAC;AACxC;AACA;AACA;AACA;AACA,QAAQ,MAAM,EAAE,WAAW,EAAE,GAAG,6BAA6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AE;AAC/C,QAAQ,OAAO;AACf,YAAY,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU;AAChD,YAAY,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM;AAC5C,SAAS;AACT;AACA,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferTask.js","sources":["../../../../../src/providers/s3/utils/transferTask.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.createUploadTask = exports.createDownloadTask = void 0;\nconst CanceledError_1 = require(\"../../../errors/CanceledError\");\nconst utils_1 = require(\"../../../utils\");\nconst createCancellableTask = ({ job, onCancel, }) => {\n const state = 'IN_PROGRESS';\n let canceledErrorMessage;\n const cancelableTask = {\n cancel: (message) => {\n const { state: taskState } = cancelableTask;\n if (taskState === 'CANCELED' ||\n taskState === 'ERROR' ||\n taskState === 'SUCCESS') {\n utils_1.logger.debug(`This task cannot be canceled. State: ${taskState}`);\n return;\n }\n cancelableTask.state = 'CANCELED';\n canceledErrorMessage = message;\n onCancel(canceledErrorMessage);\n },\n state,\n };\n const wrappedJobPromise = (async () => {\n try {\n const result = await job();\n cancelableTask.state = 'SUCCESS';\n return result;\n }\n catch (e) {\n if ((0, CanceledError_1.isCancelError)(e)) {\n cancelableTask.state = 'CANCELED';\n e.message = canceledErrorMessage ?? e.message;\n }\n cancelableTask.state = 'ERROR';\n throw e;\n }\n })();\n return Object.assign(cancelableTask, {\n result: wrappedJobPromise,\n });\n};\nexports.createDownloadTask = createCancellableTask;\nconst createUploadTask = ({ job, onCancel, onResume, onPause, isMultipartUpload, }) => {\n const cancellableTask = createCancellableTask({\n job,\n onCancel,\n });\n const uploadTask = Object.assign(cancellableTask, {\n pause: () => {\n const { state } = uploadTask;\n if (!isMultipartUpload || state !== 'IN_PROGRESS') {\n utils_1.logger.debug(`This task cannot be paused. State: ${state}`);\n return;\n }\n // TODO(eslint): remove this linter suppression.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n uploadTask.state = 'PAUSED';\n onPause?.();\n },\n resume: () => {\n const { state } = uploadTask;\n if (!isMultipartUpload || state !== 'PAUSED') {\n utils_1.logger.debug(`This task cannot be resumed. State: ${state}`);\n return;\n }\n // TODO(eslint): remove this linter suppression.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n uploadTask.state = 'IN_PROGRESS';\n onResume?.();\n },\n });\n return uploadTask;\n};\nexports.createUploadTask = createUploadTask;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"transferTask.js","sources":["../../../../../src/providers/s3/utils/transferTask.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.createUploadTask = exports.createDownloadTask = void 0;\nconst CanceledError_1 = require(\"../../../errors/CanceledError\");\nconst utils_1 = require(\"../../../utils\");\nconst createCancellableTask = ({ job, onCancel, }) => {\n const state = 'IN_PROGRESS';\n let canceledErrorMessage;\n const cancelableTask = {\n cancel: (message) => {\n const { state: taskState } = cancelableTask;\n if (taskState === 'CANCELED' ||\n taskState === 'ERROR' ||\n taskState === 'SUCCESS') {\n utils_1.logger.debug(`This task cannot be canceled. State: ${taskState}`);\n return;\n }\n cancelableTask.state = 'CANCELED';\n canceledErrorMessage = message;\n onCancel(canceledErrorMessage);\n },\n state,\n };\n const wrappedJobPromise = (async () => {\n try {\n const result = await job();\n cancelableTask.state = 'SUCCESS';\n return result;\n }\n catch (e) {\n if ((0, CanceledError_1.isCancelError)(e)) {\n cancelableTask.state = 'CANCELED';\n e.message = canceledErrorMessage ?? e.message;\n }\n cancelableTask.state = 'ERROR';\n throw e;\n }\n })();\n return Object.assign(cancelableTask, {\n result: wrappedJobPromise,\n });\n};\nexports.createDownloadTask = createCancellableTask;\nconst createUploadTask = ({ job, onCancel, onResume, onPause, isMultipartUpload, }) => {\n const cancellableTask = createCancellableTask({\n job,\n onCancel,\n });\n const uploadTask = Object.assign(cancellableTask, {\n pause: () => {\n const { state } = uploadTask;\n if (!isMultipartUpload || state !== 'IN_PROGRESS') {\n utils_1.logger.debug(`This task cannot be paused. State: ${state}`);\n return;\n }\n // TODO(eslint): remove this linter suppression.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n uploadTask.state = 'PAUSED';\n onPause?.();\n },\n resume: () => {\n const { state } = uploadTask;\n if (!isMultipartUpload || state !== 'PAUSED') {\n utils_1.logger.debug(`This task cannot be resumed. State: ${state}`);\n return;\n }\n // TODO(eslint): remove this linter suppression.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n uploadTask.state = 'IN_PROGRESS';\n onResume?.();\n },\n });\n return uploadTask;\n};\nexports.createUploadTask = createUploadTask;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,GAAG,MAAM;AAC9D,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC;AAChE,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,qBAAqB,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,KAAK;AACtD,IAAI,MAAM,KAAK,GAAG,aAAa;AAC/B,IAAI,IAAI,oBAAoB;AAC5B,IAAI,MAAM,cAAc,GAAG;AAC3B,QAAQ,MAAM,EAAE,CAAC,OAAO,KAAK;AAC7B,YAAY,MAAM,EAAE,KA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AG;AACX,QAAQ,QAAQ;AAChB,KAAK,CAAC;AACN,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;AACtD,QAAQ,KAAK,EAAE,MAAM;AACrB,YAAY,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU;AACxC,YAAY,IAAI,CAAC,iBAAiB,IAAI,KAAK,KAAK,aAAa,EAAE;AAC/D,gBAAgB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC,CAAC;AACnF,gBAAgB;AAChB;AACA;AACA;AACA;AACA,YAAY,UAAU,CAAC,KAAK,GAAG,QAAQ;AACvC,YAAY,OAAO,IAAI;AACvB,SAAS;AACT,QAAQ,MAAM,EAAE,MAAM;AACtB,YAAY,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU;AACxC,YAAY,IAAI,CAAC,iBAAiB,IAAI,KAAK,KAAK,QAAQ,EAAE;AAC1D,gBAAgB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC,CAAC;AACpF,gBAAgB;AAChB;AACA;AACA;AACA;AACA,YAAY,UAAU,CAAC,KAAK,GAAG,aAAa;AAC5C,YAAY,QAAQ,IAAI;AACxB,SAAS;AACT,KAAK,CAAC;AACN,IAAI,OAAO,UAAU;AACrB,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlDecoder.js","sources":["../../../../../src/providers/s3/utils/urlDecoder.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.urlDecode = void 0;\n/**\n * Decodes a URL-encoded string by replacing '+' characters with spaces and applying `decodeURIComponent`.\n * Reference:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#decoding_query_parameters_from_a_url\n * @param {string} value - The URL-encoded string to decode.\n * @returns {string} The decoded string.\n */\nconst urlDecode = (value) => {\n return decodeURIComponent(value.replace(/\\+/g, ' '));\n};\nexports.urlDecode = urlDecode;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"urlDecoder.js","sources":["../../../../../src/providers/s3/utils/urlDecoder.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.urlDecode = void 0;\n/**\n * Decodes a URL-encoded string by replacing '+' characters with spaces and applying `decodeURIComponent`.\n * Reference:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#decoding_query_parameters_from_a_url\n * @param {string} value - The URL-encoded string to decode.\n * @returns {string} The decoded string.\n */\nconst urlDecode = (value) => {\n return decodeURIComponent(value.replace(/\\+/g, ' '));\n};\nexports.urlDecode = urlDecode;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,CAAC,KAAK,KAAK;AAC7B,IAAI,OAAO,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AACD,OAAO,CAAC,SAAS,GAAG,SAAS;;"}
|
|
@@ -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 = void 0;\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}\nexports.getStorageUserAgentValue = getStorageUserAgentValue;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"userAgent.js","sources":["../../../../../src/providers/s3/utils/userAgent.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getStorageUserAgentValue = void 0;\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}\nexports.getStorageUserAgentValue = getStorageUserAgentValue;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACzC;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;AACA,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateBucketOwnerID.js","sources":["../../../../../src/providers/s3/utils/validateBucketOwnerID.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.validateBucketOwnerID = void 0;\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst VALID_AWS_ACCOUNT_ID_PATTERN = /^\\d{12}/;\nconst validateBucketOwnerID = (accountID) => {\n if (accountID === undefined) {\n return;\n }\n (0, assertValidationError_1.assertValidationError)(VALID_AWS_ACCOUNT_ID_PATTERN.test(accountID), validation_1.StorageValidationErrorCode.InvalidAWSAccountID);\n};\nexports.validateBucketOwnerID = validateBucketOwnerID;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"validateBucketOwnerID.js","sources":["../../../../../src/providers/s3/utils/validateBucketOwnerID.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.validateBucketOwnerID = void 0;\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst VALID_AWS_ACCOUNT_ID_PATTERN = /^\\d{12}/;\nconst validateBucketOwnerID = (accountID) => {\n if (accountID === undefined) {\n return;\n }\n (0, assertValidationError_1.assertValidationError)(VALID_AWS_ACCOUNT_ID_PATTERN.test(accountID), validation_1.StorageValidationErrorCode.InvalidAWSAccountID);\n};\nexports.validateBucketOwnerID = validateBucketOwnerID;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,MAAM;AACtC,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,4BAA4B,GAAG,SAAS;AAC9C,MAAM,qBAAqB,GAAG,CAAC,SAAS,KAAK;AAC7C,IAAI,IAAI,SAAS,KAAK,SAAS,EAAE;AACjC,QAAQ;AACR;AACA,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,4BAA4B,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,0BAA0B,CAAC,mBAAmB,CAAC;AACjK,CAAC;AACD,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
|
|
@@ -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 = void 0;\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}\nexports.validateMultipartUploadXML = validateMultipartUploadXML;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
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 = void 0;\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}\nexports.validateMultipartUploadXML = validateMultipartUploadXML;\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,MAAM;AAC3C,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;AACA,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;;"}
|
|
@@ -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 = void 0;\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}\nexports.validateObjectUrl = validateObjectUrl;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
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 = void 0;\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}\nexports.validateObjectUrl = validateObjectUrl;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,MAAM;AAClC,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,gBAAgB,GAAG,OAAO,CAAC,gCAAgC,CAAC;AAClE,SAAS,iBAAiB,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,GAAG,EAAE;AAC5D,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE;AAC3C,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD;AACA,IAAI,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACnD,IAAI,MAAM,iBAAiB,GAAG,IAAI,kBAAkB,CAAC,0BAA0B,EAAE,UAAU,CAAC;AAC5F,IAAI,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAClG,IAAI,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACvF,IAAI,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACjF,QAAQ,SAAS,CAAC,QAAQ,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,IAAI,EAAE,cAAc,KAAK,CAAC,cAAc,IAAI,cAAc,CAAC,CAAC,EAAE;AAClE,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD;AACA;AACA,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateStorageOperationInput.js","sources":["../../../../../src/providers/s3/utils/validateStorageOperationInput.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.validateStorageOperationInput = void 0;\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst isInputWithPath_1 = require(\"./isInputWithPath\");\nconst constants_1 = require(\"./constants\");\nconst resolveIdentityId_1 = require(\"./resolveIdentityId\");\nconst validateStorageOperationInput = (input, identityId) => {\n (0, assertValidationError_1.assertValidationError)(\n // Key present without a path\n (!!input.key && !input.path) ||\n // Path present without a key\n (!input.key && !!input.path), validation_1.StorageValidationErrorCode.InvalidStorageOperationInput);\n if ((0, isInputWithPath_1.isInputWithPath)(input)) {\n const { path } = input;\n const objectKey = typeof path === 'string'\n ? path\n : path({ identityId: (0, resolveIdentityId_1.resolveIdentityId)(identityId) });\n (0, assertValidationError_1.assertValidationError)(!objectKey.startsWith('/'), validation_1.StorageValidationErrorCode.InvalidStoragePathInput);\n return {\n inputType: constants_1.STORAGE_INPUT_PATH,\n objectKey,\n };\n }\n else {\n return { inputType: constants_1.STORAGE_INPUT_KEY, objectKey: input.key };\n }\n};\nexports.validateStorageOperationInput = validateStorageOperationInput;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"validateStorageOperationInput.js","sources":["../../../../../src/providers/s3/utils/validateStorageOperationInput.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.validateStorageOperationInput = void 0;\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst isInputWithPath_1 = require(\"./isInputWithPath\");\nconst constants_1 = require(\"./constants\");\nconst resolveIdentityId_1 = require(\"./resolveIdentityId\");\nconst validateStorageOperationInput = (input, identityId) => {\n (0, assertValidationError_1.assertValidationError)(\n // Key present without a path\n (!!input.key && !input.path) ||\n // Path present without a key\n (!input.key && !!input.path), validation_1.StorageValidationErrorCode.InvalidStorageOperationInput);\n if ((0, isInputWithPath_1.isInputWithPath)(input)) {\n const { path } = input;\n const objectKey = typeof path === 'string'\n ? path\n : path({ identityId: (0, resolveIdentityId_1.resolveIdentityId)(identityId) });\n (0, assertValidationError_1.assertValidationError)(!objectKey.startsWith('/'), validation_1.StorageValidationErrorCode.InvalidStoragePathInput);\n return {\n inputType: constants_1.STORAGE_INPUT_PATH,\n objectKey,\n };\n }\n else {\n return { inputType: constants_1.STORAGE_INPUT_KEY, objectKey: input.key };\n }\n};\nexports.validateStorageOperationInput = validateStorageOperationInput;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,6BAA6B,GAAG,MAAM;AAC9C,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC1D,MAAM,6BAA6B,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK;AAC7D,IAAI,IAAI,uBAAuB,CAAC,qBAAqB;AACrD;AACA,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI;AAC/B;AACA,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,0BAA0B,CAAC,4BAA4B,CAAC;AAC3G,IAAI,IAAI,IAAI,iBAAiB,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE;AACvD,QAAQ,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK;AAC9B,QAAQ,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK;AAC1C,cAAc;AACd,cAAc,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,UAAU,CAAC,EAAE,CAAC;AAC1F,QAAQ,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,0BAA0B,CAAC,uBAAuB,CAAC;AACvJ,QAAQ,OAAO;AACf,YAAY,SAAS,EAAE,WAAW,CAAC,kBAAkB;AACrD,YAAY,SAAS;AACrB,SAAS;AACT;AACA,SAAS;AACT,QAAQ,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,iBAAiB,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,EAAE;AACjF;AACA,CAAC;AACD,OAAO,CAAC,6BAA6B,GAAG,6BAA6B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateStorageOperationInputWithPrefix.js","sources":["../../../../../src/providers/s3/utils/validateStorageOperationInputWithPrefix.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.validateStorageOperationInputWithPrefix = void 0;\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst constants_1 = require(\"./constants\");\nconst resolveIdentityId_1 = require(\"./resolveIdentityId\");\n// Local assertion function with StorageOperationInputWithPrefixPath as Input\nconst _isInputWithPath = (input) => {\n return input.path !== undefined;\n};\nconst validateStorageOperationInputWithPrefix = (input, identityId) => {\n // Validate prefix & path not present at the same time\n (0, assertValidationError_1.assertValidationError)(!(input.prefix && input.path), validation_1.StorageValidationErrorCode.InvalidStorageOperationPrefixInput);\n if (_isInputWithPath(input)) {\n const { path } = input;\n const objectKey = typeof path === 'string'\n ? path\n : path({ identityId: (0, resolveIdentityId_1.resolveIdentityId)(identityId) });\n // Assert on no leading slash in the path parameter\n (0, assertValidationError_1.assertValidationError)(!objectKey.startsWith('/'), validation_1.StorageValidationErrorCode.InvalidStoragePathInput);\n return {\n inputType: constants_1.STORAGE_INPUT_PATH,\n objectKey,\n };\n }\n else {\n return { inputType: constants_1.STORAGE_INPUT_PREFIX, objectKey: input.prefix ?? '' };\n }\n};\nexports.validateStorageOperationInputWithPrefix = validateStorageOperationInputWithPrefix;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"validateStorageOperationInputWithPrefix.js","sources":["../../../../../src/providers/s3/utils/validateStorageOperationInputWithPrefix.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.validateStorageOperationInputWithPrefix = void 0;\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst constants_1 = require(\"./constants\");\nconst resolveIdentityId_1 = require(\"./resolveIdentityId\");\n// Local assertion function with StorageOperationInputWithPrefixPath as Input\nconst _isInputWithPath = (input) => {\n return input.path !== undefined;\n};\nconst validateStorageOperationInputWithPrefix = (input, identityId) => {\n // Validate prefix & path not present at the same time\n (0, assertValidationError_1.assertValidationError)(!(input.prefix && input.path), validation_1.StorageValidationErrorCode.InvalidStorageOperationPrefixInput);\n if (_isInputWithPath(input)) {\n const { path } = input;\n const objectKey = typeof path === 'string'\n ? path\n : path({ identityId: (0, resolveIdentityId_1.resolveIdentityId)(identityId) });\n // Assert on no leading slash in the path parameter\n (0, assertValidationError_1.assertValidationError)(!objectKey.startsWith('/'), validation_1.StorageValidationErrorCode.InvalidStoragePathInput);\n return {\n inputType: constants_1.STORAGE_INPUT_PATH,\n objectKey,\n };\n }\n else {\n return { inputType: constants_1.STORAGE_INPUT_PREFIX, objectKey: input.prefix ?? '' };\n }\n};\nexports.validateStorageOperationInputWithPrefix = validateStorageOperationInputWithPrefix;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uCAAuC,GAAG,MAAM;AACxD,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC1D;AACA,MAAM,gBAAgB,GAAG,CAAC,KAAK,KAAK;AACpC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS;AACnC,CAAC;AACD,MAAM,uCAAuC,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK;AACvE;AACA,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,EAAE,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,0BAA0B,CAAC,kCAAkC,CAAC;AACjK,IAAI,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;AACjC,QAAQ,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK;AAC9B,QAAQ,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK;AAC1C,cAAc;AACd,cAAc,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,UAAU,CAAC,EAAE,CAAC;AAC1F;AACA,QAAQ,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,0BAA0B,CAAC,uBAAuB,CAAC;AACvJ,QAAQ,OAAO;AACf,YAAY,SAAS,EAAE,WAAW,CAAC,kBAAkB;AACrD,YAAY,SAAS;AACrB,SAAS;AACT;AACA,SAAS;AACT,QAAQ,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,oBAAoB,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE;AAC7F;AACA,CAAC;AACD,OAAO,CAAC,uCAAuC,GAAG,uCAAuC;;"}
|
package/dist/cjs/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sources":["../../src/server.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 });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./providers/s3/apis/server\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"server.js","sources":["../../src/server.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 });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./providers/s3/apis/server\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/utils/index.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.logger = exports.resolvePrefix = void 0;\nvar resolvePrefix_1 = require(\"./resolvePrefix\");\nObject.defineProperty(exports, \"resolvePrefix\", { enumerable: true, get: function () { return resolvePrefix_1.resolvePrefix; } });\nvar logger_1 = require(\"./logger\");\nObject.defineProperty(exports, \"logger\", { enumerable: true, get: function () { return logger_1.logger; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/utils/index.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.logger = exports.resolvePrefix = void 0;\nvar resolvePrefix_1 = require(\"./resolvePrefix\");\nObject.defineProperty(exports, \"resolvePrefix\", { enumerable: true, get: function () { return resolvePrefix_1.resolvePrefix; } });\nvar logger_1 = require(\"./logger\");\nObject.defineProperty(exports, \"logger\", { enumerable: true, get: function () { return logger_1.logger; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AAC/C,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACjI,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["../../../src/utils/logger.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.logger = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nexports.logger = new core_1.ConsoleLogger('Storage');\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../../src/utils/logger.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.logger = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nexports.logger = new core_1.ConsoleLogger('Storage');\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,MAAM,GAAG,MAAM;AACvB,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,OAAO,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvePrefix.js","sources":["../../../src/utils/resolvePrefix.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.resolvePrefix = void 0;\nconst assertValidationError_1 = require(\"../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../errors/types/validation\");\nconst resolvePrefix = ({ accessLevel, targetIdentityId, }) => {\n if (accessLevel === 'private') {\n (0, assertValidationError_1.assertValidationError)(!!targetIdentityId, validation_1.StorageValidationErrorCode.NoIdentityId);\n return `private/${targetIdentityId}/`;\n }\n else if (accessLevel === 'protected') {\n (0, assertValidationError_1.assertValidationError)(!!targetIdentityId, validation_1.StorageValidationErrorCode.NoIdentityId);\n return `protected/${targetIdentityId}/`;\n }\n else {\n return 'public/';\n }\n};\nexports.resolvePrefix = resolvePrefix;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"resolvePrefix.js","sources":["../../../src/utils/resolvePrefix.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.resolvePrefix = void 0;\nconst assertValidationError_1 = require(\"../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../errors/types/validation\");\nconst resolvePrefix = ({ accessLevel, targetIdentityId, }) => {\n if (accessLevel === 'private') {\n (0, assertValidationError_1.assertValidationError)(!!targetIdentityId, validation_1.StorageValidationErrorCode.NoIdentityId);\n return `private/${targetIdentityId}/`;\n }\n else if (accessLevel === 'protected') {\n (0, assertValidationError_1.assertValidationError)(!!targetIdentityId, validation_1.StorageValidationErrorCode.NoIdentityId);\n return `protected/${targetIdentityId}/`;\n }\n else {\n return 'public/';\n }\n};\nexports.resolvePrefix = resolvePrefix;\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,uBAAuB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AAChF,MAAM,YAAY,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC1D,MAAM,aAAa,GAAG,CAAC,EAAE,WAAW,EAAE,gBAAgB,GAAG,KAAK;AAC9D,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;AACnC,QAAQ,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,CAAC,CAAC,gBAAgB,EAAE,YAAY,CAAC,0BAA0B,CAAC,YAAY,CAAC;AACpI,QAAQ,OAAO,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC7C;AACA,SAAS,IAAI,WAAW,KAAK,WAAW,EAAE;AAC1C,QAAQ,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,CAAC,CAAC,gBAAgB,EAAE,YAAY,CAAC,0BAA0B,CAAC,YAAY,CAAC;AACpI,QAAQ,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC/C;AACA,SAAS;AACT,QAAQ,OAAO,SAAS;AACxB;AACA,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanceledError.mjs","sources":["../../../src/errors/CanceledError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageError } from './StorageError';\n/**\n * Internal-only class for CanceledError thrown by XHR handler or multipart upload when cancellation is invoked\n * without overwriting behavior.\n *\n * @internal\n */\nexport class CanceledError extends StorageError {\n constructor(params = {}) {\n super({\n name: 'CanceledError',\n message: 'Upload is canceled by user',\n ...params,\n });\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = CanceledError;\n Object.setPrototypeOf(this, CanceledError.prototype);\n }\n}\n/**\n * Check if an error is caused by user calling `cancel()` on a upload/download task. If an overwriting error is\n * supplied to `task.cancel(errorOverwrite)`, this function will return `false`.\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\n */\nexport const isCancelError = (error) => !!error && error instanceof CanceledError;\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,SAAS,YAAY,CAAC;AAChD,IAAI,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE;AAC7B,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,eAAe;AACjC,YAAY,OAAO,EAAE,4BAA4B;AACjD,YAAY,GAAG,MAAM;AACrB,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"CanceledError.mjs","sources":["../../../src/errors/CanceledError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageError } from './StorageError';\n/**\n * Internal-only class for CanceledError thrown by XHR handler or multipart upload when cancellation is invoked\n * without overwriting behavior.\n *\n * @internal\n */\nexport class CanceledError extends StorageError {\n constructor(params = {}) {\n super({\n name: 'CanceledError',\n message: 'Upload is canceled by user',\n ...params,\n });\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = CanceledError;\n Object.setPrototypeOf(this, CanceledError.prototype);\n }\n}\n/**\n * Check if an error is caused by user calling `cancel()` on a upload/download task. If an overwriting error is\n * supplied to `task.cancel(errorOverwrite)`, this function will return `false`.\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\n */\nexport const isCancelError = (error) => !!error && error instanceof CanceledError;\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,SAAS,YAAY,CAAC;AAChD,IAAI,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE;AAC7B,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,eAAe;AACjC,YAAY,OAAO,EAAE,4BAA4B;AACjD,YAAY,GAAG,MAAM;AACrB,SAAS,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,aAAa;AACxC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrityError.mjs","sources":["../../../src/errors/IntegrityError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyErrorCode, } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from './StorageError';\nexport class IntegrityError extends StorageError {\n constructor(params = {\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n recoverySuggestion: 'This may be a bug. Please reach out to library authors.',\n }) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = IntegrityError;\n Object.setPrototypeOf(this, IntegrityError.prototype);\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGO,MAAM,cAAc,SAAS,YAAY,CAAC;AACjD,IAAI,WAAW,CAAC,MAAM,GAAG;AACzB,QAAQ,IAAI,EAAE,gBAAgB,CAAC,OAAO;AACtC,QAAQ,OAAO,EAAE,gCAAgC;AACjD,QAAQ,kBAAkB,EAAE,yDAAyD;AACrF,KAAK,EAAE;AACP,QAAQ,KAAK,CAAC,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"IntegrityError.mjs","sources":["../../../src/errors/IntegrityError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyErrorCode, } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from './StorageError';\nexport class IntegrityError extends StorageError {\n constructor(params = {\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n recoverySuggestion: 'This may be a bug. Please reach out to library authors.',\n }) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = IntegrityError;\n Object.setPrototypeOf(this, IntegrityError.prototype);\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGO,MAAM,cAAc,SAAS,YAAY,CAAC;AACjD,IAAI,WAAW,CAAC,MAAM,GAAG;AACzB,QAAQ,IAAI,EAAE,gBAAgB,CAAC,OAAO;AACtC,QAAQ,OAAO,EAAE,gCAAgC;AACjD,QAAQ,kBAAkB,EAAE,yDAAyD;AACrF,KAAK,EAAE;AACP,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,cAAc;AACzC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC;AAC7D;AACA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageError.mjs","sources":["../../../src/errors/StorageError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyError, } from '@aws-amplify/core/internals/utils';\nexport class StorageError extends AmplifyError {\n constructor(params) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = StorageError;\n Object.setPrototypeOf(this, StorageError.prototype);\n }\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,YAAY,SAAS,YAAY,CAAC;AAC/C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"StorageError.mjs","sources":["../../../src/errors/StorageError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyError, } from '@aws-amplify/core/internals/utils';\nexport class StorageError extends AmplifyError {\n constructor(params) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = StorageError;\n Object.setPrototypeOf(this, StorageError.prototype);\n }\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,YAAY,SAAS,YAAY,CAAC;AAC/C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY;AACvC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;AAC3D;AACA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.mjs","sources":["../../../../src/errors/types/validation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var StorageValidationErrorCode;\n(function (StorageValidationErrorCode) {\n StorageValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n StorageValidationErrorCode[\"NoIdentityId\"] = \"NoIdentityId\";\n StorageValidationErrorCode[\"NoKey\"] = \"NoKey\";\n StorageValidationErrorCode[\"NoSourceKey\"] = \"NoSourceKey\";\n StorageValidationErrorCode[\"NoDestinationKey\"] = \"NoDestinationKey\";\n StorageValidationErrorCode[\"NoSourcePath\"] = \"NoSourcePath\";\n StorageValidationErrorCode[\"NoDestinationPath\"] = \"NoDestinationPath\";\n StorageValidationErrorCode[\"NoBucket\"] = \"NoBucket\";\n StorageValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n StorageValidationErrorCode[\"InvalidStorageBucket\"] = \"InvalidStorageBucket\";\n StorageValidationErrorCode[\"InvalidCopyOperationStorageBucket\"] = \"InvalidCopyOperationStorageBucket\";\n StorageValidationErrorCode[\"InvalidStorageOperationPrefixInput\"] = \"InvalidStorageOperationPrefixInput\";\n StorageValidationErrorCode[\"InvalidStorageOperationInput\"] = \"InvalidStorageOperationInput\";\n StorageValidationErrorCode[\"InvalidAWSAccountID\"] = \"InvalidAWSAccountID\";\n StorageValidationErrorCode[\"InvalidStoragePathInput\"] = \"InvalidStoragePathInput\";\n StorageValidationErrorCode[\"InvalidUploadSource\"] = \"InvalidUploadSource\";\n StorageValidationErrorCode[\"ObjectIsTooLarge\"] = \"ObjectIsTooLarge\";\n StorageValidationErrorCode[\"UrlExpirationMaxLimitExceed\"] = \"UrlExpirationMaxLimitExceed\";\n StorageValidationErrorCode[\"InvalidLocationCredentialsCacheSize\"] = \"InvalidLocationCredentialsCacheSize\";\n StorageValidationErrorCode[\"LocationCredentialsStoreDestroyed\"] = \"LocationCredentialsStoreDestroyed\";\n StorageValidationErrorCode[\"InvalidS3Uri\"] = \"InvalidS3Uri\";\n StorageValidationErrorCode[\"InvalidCustomEndpoint\"] = \"InvalidCustomEndpoint\";\n StorageValidationErrorCode[\"ForcePathStyleEndpointNotSupported\"] = \"ForcePathStyleEndpointNotSupported\";\n StorageValidationErrorCode[\"DnsIncompatibleBucketName\"] = \"DnsIncompatibleBucketName\";\n})(StorageValidationErrorCode || (StorageValidationErrorCode = {}));\nexport const validationErrorMap = {\n [StorageValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [StorageValidationErrorCode.NoIdentityId]: {\n message: 'Missing identity ID when accessing objects in protected or private access level.',\n },\n [StorageValidationErrorCode.NoKey]: {\n message: 'Missing key in api call.',\n },\n [StorageValidationErrorCode.NoSourceKey]: {\n message: 'Missing source key in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationKey]: {\n message: 'Missing destination key in copy api call.',\n },\n [StorageValidationErrorCode.NoSourcePath]: {\n message: 'Missing source path in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationPath]: {\n message: 'Missing destination path in copy api call.',\n },\n [StorageValidationErrorCode.NoBucket]: {\n message: 'Missing bucket name while accessing object.',\n },\n [StorageValidationErrorCode.NoRegion]: {\n message: 'Missing region while accessing object.',\n },\n [StorageValidationErrorCode.UrlExpirationMaxLimitExceed]: {\n message: 'Url Expiration can not be greater than 7 Days.',\n },\n [StorageValidationErrorCode.ObjectIsTooLarge]: {\n message: 'Object size cannot not be greater than 5TB.',\n },\n [StorageValidationErrorCode.InvalidUploadSource]: {\n message: 'Upload source type can only be a `Blob`, `File`, `ArrayBuffer`, or `string`.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationInput]: {\n message: 'Path or key parameter must be specified in the input. Both can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidAWSAccountID]: {\n message: 'Invalid AWS account ID was provided.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationPrefixInput]: {\n message: 'Both path and prefix can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidStoragePathInput]: {\n message: 'Input `path` does not allow a leading slash (/).',\n },\n [StorageValidationErrorCode.InvalidLocationCredentialsCacheSize]: {\n message: 'locationCredentialsCacheSize must be a positive integer.',\n },\n [StorageValidationErrorCode.LocationCredentialsStoreDestroyed]: {\n message: `Location-specific credentials store has been destroyed.`,\n },\n [StorageValidationErrorCode.InvalidS3Uri]: {\n message: 'Invalid S3 URI.',\n },\n [StorageValidationErrorCode.InvalidStorageBucket]: {\n message: 'Unable to lookup bucket from provided name in Amplify configuration.',\n },\n [StorageValidationErrorCode.InvalidCopyOperationStorageBucket]: {\n message: 'Missing bucket option in either source or destination.',\n },\n [StorageValidationErrorCode.InvalidCustomEndpoint]: {\n message: 'Invalid S3 custom endpoint.',\n },\n [StorageValidationErrorCode.ForcePathStyleEndpointNotSupported]: {\n message: 'Path style URLs are not supported with S3 Transfer Acceleration.',\n },\n [StorageValidationErrorCode.DnsIncompatibleBucketName]: {\n message: `The bucket name isn't DNS compatible.`,\n },\n};\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC
|
|
1
|
+
{"version":3,"file":"validation.mjs","sources":["../../../../src/errors/types/validation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var StorageValidationErrorCode;\n(function (StorageValidationErrorCode) {\n StorageValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n StorageValidationErrorCode[\"NoIdentityId\"] = \"NoIdentityId\";\n StorageValidationErrorCode[\"NoKey\"] = \"NoKey\";\n StorageValidationErrorCode[\"NoSourceKey\"] = \"NoSourceKey\";\n StorageValidationErrorCode[\"NoDestinationKey\"] = \"NoDestinationKey\";\n StorageValidationErrorCode[\"NoSourcePath\"] = \"NoSourcePath\";\n StorageValidationErrorCode[\"NoDestinationPath\"] = \"NoDestinationPath\";\n StorageValidationErrorCode[\"NoBucket\"] = \"NoBucket\";\n StorageValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n StorageValidationErrorCode[\"InvalidStorageBucket\"] = \"InvalidStorageBucket\";\n StorageValidationErrorCode[\"InvalidCopyOperationStorageBucket\"] = \"InvalidCopyOperationStorageBucket\";\n StorageValidationErrorCode[\"InvalidStorageOperationPrefixInput\"] = \"InvalidStorageOperationPrefixInput\";\n StorageValidationErrorCode[\"InvalidStorageOperationInput\"] = \"InvalidStorageOperationInput\";\n StorageValidationErrorCode[\"InvalidAWSAccountID\"] = \"InvalidAWSAccountID\";\n StorageValidationErrorCode[\"InvalidStoragePathInput\"] = \"InvalidStoragePathInput\";\n StorageValidationErrorCode[\"InvalidUploadSource\"] = \"InvalidUploadSource\";\n StorageValidationErrorCode[\"ObjectIsTooLarge\"] = \"ObjectIsTooLarge\";\n StorageValidationErrorCode[\"UrlExpirationMaxLimitExceed\"] = \"UrlExpirationMaxLimitExceed\";\n StorageValidationErrorCode[\"InvalidLocationCredentialsCacheSize\"] = \"InvalidLocationCredentialsCacheSize\";\n StorageValidationErrorCode[\"LocationCredentialsStoreDestroyed\"] = \"LocationCredentialsStoreDestroyed\";\n StorageValidationErrorCode[\"InvalidS3Uri\"] = \"InvalidS3Uri\";\n StorageValidationErrorCode[\"InvalidCustomEndpoint\"] = \"InvalidCustomEndpoint\";\n StorageValidationErrorCode[\"ForcePathStyleEndpointNotSupported\"] = \"ForcePathStyleEndpointNotSupported\";\n StorageValidationErrorCode[\"DnsIncompatibleBucketName\"] = \"DnsIncompatibleBucketName\";\n})(StorageValidationErrorCode || (StorageValidationErrorCode = {}));\nexport const validationErrorMap = {\n [StorageValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [StorageValidationErrorCode.NoIdentityId]: {\n message: 'Missing identity ID when accessing objects in protected or private access level.',\n },\n [StorageValidationErrorCode.NoKey]: {\n message: 'Missing key in api call.',\n },\n [StorageValidationErrorCode.NoSourceKey]: {\n message: 'Missing source key in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationKey]: {\n message: 'Missing destination key in copy api call.',\n },\n [StorageValidationErrorCode.NoSourcePath]: {\n message: 'Missing source path in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationPath]: {\n message: 'Missing destination path in copy api call.',\n },\n [StorageValidationErrorCode.NoBucket]: {\n message: 'Missing bucket name while accessing object.',\n },\n [StorageValidationErrorCode.NoRegion]: {\n message: 'Missing region while accessing object.',\n },\n [StorageValidationErrorCode.UrlExpirationMaxLimitExceed]: {\n message: 'Url Expiration can not be greater than 7 Days.',\n },\n [StorageValidationErrorCode.ObjectIsTooLarge]: {\n message: 'Object size cannot not be greater than 5TB.',\n },\n [StorageValidationErrorCode.InvalidUploadSource]: {\n message: 'Upload source type can only be a `Blob`, `File`, `ArrayBuffer`, or `string`.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationInput]: {\n message: 'Path or key parameter must be specified in the input. Both can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidAWSAccountID]: {\n message: 'Invalid AWS account ID was provided.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationPrefixInput]: {\n message: 'Both path and prefix can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidStoragePathInput]: {\n message: 'Input `path` does not allow a leading slash (/).',\n },\n [StorageValidationErrorCode.InvalidLocationCredentialsCacheSize]: {\n message: 'locationCredentialsCacheSize must be a positive integer.',\n },\n [StorageValidationErrorCode.LocationCredentialsStoreDestroyed]: {\n message: `Location-specific credentials store has been destroyed.`,\n },\n [StorageValidationErrorCode.InvalidS3Uri]: {\n message: 'Invalid S3 URI.',\n },\n [StorageValidationErrorCode.InvalidStorageBucket]: {\n message: 'Unable to lookup bucket from provided name in Amplify configuration.',\n },\n [StorageValidationErrorCode.InvalidCopyOperationStorageBucket]: {\n message: 'Missing bucket option in either source or destination.',\n },\n [StorageValidationErrorCode.InvalidCustomEndpoint]: {\n message: 'Invalid S3 custom endpoint.',\n },\n [StorageValidationErrorCode.ForcePathStyleEndpointNotSupported]: {\n message: 'Path style URLs are not supported with S3 Transfer Acceleration.',\n },\n [StorageValidationErrorCode.DnsIncompatibleBucketName]: {\n message: `The bucket name isn't DNS compatible.`,\n },\n};\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC;AACX,CAAC,UAAU,0BAA0B,EAAE;AACvC,IAAI,0BAA0B,CAAC,eAAe,CAAC,GAAG,eAAe;AACjE,IAAI,0BAA0B,CAAC,cAAc,CAAC,GAAG,cAAc;AAC/D,IAAI,0BAA0B,CAAC,OAAO,CAAC,GAAG,OAAO;AACjD,IAAI,0BAA0B,CAAC,aAAa,CAAC,GAAG,aAAa;AAC7D,IAAI,0BAA0B,CAAC,kBAAkB,CAAC,GAAG,kBAAkB;AACvE,IAAI,0BAA0B,CAAC,cAAc,CAAC,GAAG,cAAc;AAC/D,IAAI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,0BAA0B,CAAC,uBAAuB,GAAG;AAC1D,QAAQ,OAAO,EAAE,kDAAkD;AACnE,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,mCAAmC,GAAG;AACtE,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,iCAAiC,GAAG;AACpE,QAAQ,OAAO,EAAE,CAAC,uDAAuD,CAAC;AAC1E,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,YAAY,GAAG;AAC/C,QAAQ,OAAO,EAAE,iBAAiB;AAClC,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,oBAAoB,GAAG;AACvD,QAAQ,OAAO,EAAE,sEAAsE;AACvF,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,iCAAiC,GAAG;AACpE,QAAQ,OAAO,EAAE,wDAAwD;AACzE,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,qBAAqB,GAAG;AACxD,QAAQ,OAAO,EAAE,6BAA6B;AAC9C,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,kCAAkC,GAAG;AACrE,QAAQ,OAAO,EAAE,kEAAkE;AACnF,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,yBAAyB,GAAG;AAC5D,QAAQ,OAAO,EAAE,CAAC,qCAAqC,CAAC;AACxD,KAAK;AACL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertValidationError.mjs","sources":["../../../../src/errors/utils/assertValidationError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { validationErrorMap, } from '../types/validation';\nimport { StorageError } from '../StorageError';\nexport function assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new StorageError({ name, message, recoverySuggestion });\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGO,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AACvD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"assertValidationError.mjs","sources":["../../../../src/errors/utils/assertValidationError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { validationErrorMap, } from '../types/validation';\nimport { StorageError } from '../StorageError';\nexport function assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new StorageError({ name, message, recoverySuggestion });\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGO,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AACvD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC;AACpE,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACrE;AACA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDataAccess.mjs","sources":["../../../../src/internals/apis/getDataAccess.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyErrorCode, StorageAction, } from '@aws-amplify/core/internals/utils';\nimport { getStorageUserAgentValue } from '../../providers/s3/utils/userAgent';\nimport { getDataAccess as getDataAccessClient } from '../../providers/s3/utils/client/s3control';\nimport { StorageError } from '../../errors/StorageError';\nimport { logger } from '../../utils';\nimport { DEFAULT_CRED_TTL } from '../utils/constants';\n/**\n * @internal\n */\nexport const getDataAccess = async (input) => {\n const targetType = input.scope.endsWith('*') ? undefined : 'Object';\n const clientCredentialsProvider = async (options) => {\n const { credentials } = await input.credentialsProvider(options);\n return credentials;\n };\n const result = await getDataAccessClient({\n credentials: clientCredentialsProvider,\n customEndpoint: input.customEndpoint,\n region: input.region,\n userAgentValue: getStorageUserAgentValue(StorageAction.GetDataAccess),\n }, {\n AccountId: input.accountId,\n Target: input.scope,\n Permission: input.permission,\n TargetType: targetType,\n DurationSeconds: DEFAULT_CRED_TTL,\n });\n const grantCredentials = result.Credentials;\n // Ensure that S3 returned credentials (this shouldn't happen)\n if (!grantCredentials ||\n !grantCredentials.AccessKeyId ||\n !grantCredentials.SecretAccessKey ||\n !grantCredentials.SessionToken ||\n !grantCredentials.Expiration) {\n throw new StorageError({\n name: AmplifyErrorCode.Unknown,\n message: 'Service did not return valid temporary credentials.',\n });\n }\n else {\n logger.debug(`Retrieved credentials for: ${result.MatchedGrantTarget}`);\n }\n const { AccessKeyId: accessKeyId, SecretAccessKey: secretAccessKey, SessionToken: sessionToken, Expiration: expiration, } = grantCredentials;\n return {\n credentials: {\n accessKeyId,\n secretAccessKey,\n sessionToken,\n expiration,\n },\n scope: result.MatchedGrantTarget,\n };\n};\n"],"names":["getDataAccessClient"],"mappings":";;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACY,MAAC,aAAa,GAAG,OAAO,KAAK,KAAK;AAC9C,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,QAAQ
|
|
1
|
+
{"version":3,"file":"getDataAccess.mjs","sources":["../../../../src/internals/apis/getDataAccess.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyErrorCode, StorageAction, } from '@aws-amplify/core/internals/utils';\nimport { getStorageUserAgentValue } from '../../providers/s3/utils/userAgent';\nimport { getDataAccess as getDataAccessClient } from '../../providers/s3/utils/client/s3control';\nimport { StorageError } from '../../errors/StorageError';\nimport { logger } from '../../utils';\nimport { DEFAULT_CRED_TTL } from '../utils/constants';\n/**\n * @internal\n */\nexport const getDataAccess = async (input) => {\n const targetType = input.scope.endsWith('*') ? undefined : 'Object';\n const clientCredentialsProvider = async (options) => {\n const { credentials } = await input.credentialsProvider(options);\n return credentials;\n };\n const result = await getDataAccessClient({\n credentials: clientCredentialsProvider,\n customEndpoint: input.customEndpoint,\n region: input.region,\n userAgentValue: getStorageUserAgentValue(StorageAction.GetDataAccess),\n }, {\n AccountId: input.accountId,\n Target: input.scope,\n Permission: input.permission,\n TargetType: targetType,\n DurationSeconds: DEFAULT_CRED_TTL,\n });\n const grantCredentials = result.Credentials;\n // Ensure that S3 returned credentials (this shouldn't happen)\n if (!grantCredentials ||\n !grantCredentials.AccessKeyId ||\n !grantCredentials.SecretAccessKey ||\n !grantCredentials.SessionToken ||\n !grantCredentials.Expiration) {\n throw new StorageError({\n name: AmplifyErrorCode.Unknown,\n message: 'Service did not return valid temporary credentials.',\n });\n }\n else {\n logger.debug(`Retrieved credentials for: ${result.MatchedGrantTarget}`);\n }\n const { AccessKeyId: accessKeyId, SecretAccessKey: secretAccessKey, SessionToken: sessionToken, Expiration: expiration, } = grantCredentials;\n return {\n credentials: {\n accessKeyId,\n secretAccessKey,\n sessionToken,\n expiration,\n },\n scope: result.MatchedGrantTarget,\n };\n};\n"],"names":["getDataAccessClient"],"mappings":";;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACY,MAAC,aAAa,GAAG,OAAO,KAAK,KAAK;AAC9C,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,QAAQ;AACvE,IAAI,MAAM,yBAAyB,GAAG,OAAO,OAAO,KAAK;AACzD,QAAQ,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC;AACxE,QAAQ,OAAO,WAAW;AAC1B,KAAK;AACL,IAAI,MAAM,MAAM,GAAG,MAAMA,eAAmB,CAAC;AAC7C,QAAQ,WAAW,EAAE,yBAAy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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","sources":["../../../../src/internals/apis/list.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { list as listInternal } from '../../providers/s3/apis/internal/list';\n/**\n * @internal\n */\nexport function list(input) {\n return listInternal(Amplify, {\n path: input.path,\n options: {\n bucket: input.options?.bucket,\n subpathStrategy: input.options?.subpathStrategy,\n useAccelerateEndpoint: input.options?.useAccelerateEndpoint,\n listAll: input.options?.listAll,\n expectedBucketOwner: input.options?.expectedBucketOwner,\n // Pagination options\n nextToken: input.options?.nextToken,\n pageSize: input.options?.pageSize,\n // Advanced options\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n customEndpoint: input?.options?.customEndpoint,\n },\n // Type casting is necessary because `listInternal` supports both Gen1 and Gen2 signatures, but here\n // given in input can only be Gen2 signature, the return can only ben Gen2 signature.\n });\n}\n"],"names":["listInternal"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACO,SAAS,IAAI,CAAC,KAAK,EAAE;AAC5B,IAAI,OAAOA,MAAY,CAAC,OAAO,EAAE;AACjC,QAAQ,IAAI,EAAE,KAAK,CAAC,IAAI;AACxB,QAAQ,OAAO,EAAE;AACjB,YAAY,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM;AACzC,YAAY,eAAe,EAAE,KAAK,CAAC,OAAO,EAAE,eAAe;AAC3D,YAAY,qBAAqB,EAAE,KAAK,CAAC,OAAO,EAAE,qBAAqB;AACvE,YAAY,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO;AAC3C,YAAY,mBAAmB,EAAE,KAAK,CAAC,OAAO,EAAE,mBAAmB;AACnE;AACA,YAAY,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS;AAC/C,YAAY,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ;AAC7C;AACA,YAAY,2BAA2B,EAAE,KAAK,CAAC,OAAO,EAAE,2BAA2B;AACnF,YAAY,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc;AAC1D,SAAS;AACT;AACA;AACA,KAAK,CAAC
|
|
1
|
+
{"version":3,"file":"list.mjs","sources":["../../../../src/internals/apis/list.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { list as listInternal } from '../../providers/s3/apis/internal/list';\n/**\n * @internal\n */\nexport function list(input) {\n return listInternal(Amplify, {\n path: input.path,\n options: {\n bucket: input.options?.bucket,\n subpathStrategy: input.options?.subpathStrategy,\n useAccelerateEndpoint: input.options?.useAccelerateEndpoint,\n listAll: input.options?.listAll,\n expectedBucketOwner: input.options?.expectedBucketOwner,\n // Pagination options\n nextToken: input.options?.nextToken,\n pageSize: input.options?.pageSize,\n // Advanced options\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n customEndpoint: input?.options?.customEndpoint,\n },\n // Type casting is necessary because `listInternal` supports both Gen1 and Gen2 signatures, but here\n // given in input can only be Gen2 signature, the return can only ben Gen2 signature.\n });\n}\n"],"names":["listInternal"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACO,SAAS,IAAI,CAAC,KAAK,EAAE;AAC5B,IAAI,OAAOA,MAAY,CAAC,OAAO,EAAE;AACjC,QAAQ,IAAI,EAAE,KAAK,CAAC,IAAI;AACxB,QAAQ,OAAO,EAAE;AACjB,YAAY,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM;AACzC,YAAY,eAAe,EAAE,KAAK,CAAC,OAAO,EAAE,eAAe;AAC3D,YAAY,qBAAqB,EAAE,KAAK,CAAC,OAAO,EAAE,qBAAqB;AACvE,YAAY,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO;AAC3C,YAAY,mBAAmB,EAAE,KAAK,CAAC,OAAO,EAAE,mBAAmB;AACnE;AACA,YAAY,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS;AAC/C,YAAY,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ;AAC7C;AACA,YAAY,2BAA2B,EAAE,KAAK,CAAC,OAAO,EAAE,2BAA2B;AACnF,YAAY,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc;AAC1D,SAAS;AACT;AACA;AACA,KAAK,CAAC;AACN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCallerAccessGrants.mjs","sources":["../../../../src/internals/apis/listCallerAccessGrants.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 { logger } from '../../utils';\nimport { listCallerAccessGrants as listCallerAccessGrantsClient } from '../../providers/s3/utils/client/s3control';\nimport { StorageError } from '../../errors/StorageError';\nimport { getStorageUserAgentValue } from '../../providers/s3/utils/userAgent';\nimport { MAX_PAGE_SIZE } from '../utils/constants';\n/**\n * @internal\n */\nexport const listCallerAccessGrants = async (input) => {\n const { credentialsProvider, accountId, region, nextToken, pageSize, customEndpoint, } = input;\n logger.debug(`listing available locations from account ${input.accountId}`);\n if (!!pageSize && pageSize > MAX_PAGE_SIZE) {\n logger.debug(`defaulting pageSize to ${MAX_PAGE_SIZE}.`);\n }\n const clientCredentialsProvider = async (options) => {\n const { credentials } = await credentialsProvider(options);\n return credentials;\n };\n const { CallerAccessGrantsList, NextToken } = await listCallerAccessGrantsClient({\n credentials: clientCredentialsProvider,\n customEndpoint,\n region,\n userAgentValue: getStorageUserAgentValue(StorageAction.ListCallerAccessGrants),\n }, {\n AccountId: accountId,\n NextToken: nextToken,\n MaxResults: pageSize ?? MAX_PAGE_SIZE,\n AllowedByApplication: true,\n });\n const accessGrants = CallerAccessGrantsList?.map(grant => {\n assertGrantScope(grant.GrantScope);\n return {\n scope: grant.GrantScope,\n permission: grant.Permission,\n type: parseGrantType(grant.GrantScope),\n };\n }) ?? [];\n return {\n locations: accessGrants,\n nextToken: NextToken,\n };\n};\nconst parseGrantType = (grantScope) => {\n const bucketScopeReg = /^s3:\\/\\/(.*)\\/\\*$/;\n const possibleBucketName = grantScope.match(bucketScopeReg)?.[1];\n if (!grantScope.endsWith('*')) {\n return 'OBJECT';\n }\n else if (grantScope.endsWith('/*') &&\n possibleBucketName &&\n possibleBucketName.indexOf('/') === -1) {\n return 'BUCKET';\n }\n else {\n return 'PREFIX';\n }\n};\nfunction assertGrantScope(value) {\n if (typeof value !== 'string' || !value.startsWith('s3://')) {\n throw new StorageError({\n name: 'InvalidGrantScope',\n message: `Expected a valid grant scope, got ${value}`,\n });\n }\n}\n"],"names":["listCallerAccessGrantsClient"],"mappings":";;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACY,MAAC,sBAAsB,GAAG,OAAO,KAAK,KAAK;AACvD,IAAI,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,GAAG,KAAK
|
|
1
|
+
{"version":3,"file":"listCallerAccessGrants.mjs","sources":["../../../../src/internals/apis/listCallerAccessGrants.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 { logger } from '../../utils';\nimport { listCallerAccessGrants as listCallerAccessGrantsClient } from '../../providers/s3/utils/client/s3control';\nimport { StorageError } from '../../errors/StorageError';\nimport { getStorageUserAgentValue } from '../../providers/s3/utils/userAgent';\nimport { MAX_PAGE_SIZE } from '../utils/constants';\n/**\n * @internal\n */\nexport const listCallerAccessGrants = async (input) => {\n const { credentialsProvider, accountId, region, nextToken, pageSize, customEndpoint, } = input;\n logger.debug(`listing available locations from account ${input.accountId}`);\n if (!!pageSize && pageSize > MAX_PAGE_SIZE) {\n logger.debug(`defaulting pageSize to ${MAX_PAGE_SIZE}.`);\n }\n const clientCredentialsProvider = async (options) => {\n const { credentials } = await credentialsProvider(options);\n return credentials;\n };\n const { CallerAccessGrantsList, NextToken } = await listCallerAccessGrantsClient({\n credentials: clientCredentialsProvider,\n customEndpoint,\n region,\n userAgentValue: getStorageUserAgentValue(StorageAction.ListCallerAccessGrants),\n }, {\n AccountId: accountId,\n NextToken: nextToken,\n MaxResults: pageSize ?? MAX_PAGE_SIZE,\n AllowedByApplication: true,\n });\n const accessGrants = CallerAccessGrantsList?.map(grant => {\n assertGrantScope(grant.GrantScope);\n return {\n scope: grant.GrantScope,\n permission: grant.Permission,\n type: parseGrantType(grant.GrantScope),\n };\n }) ?? [];\n return {\n locations: accessGrants,\n nextToken: NextToken,\n };\n};\nconst parseGrantType = (grantScope) => {\n const bucketScopeReg = /^s3:\\/\\/(.*)\\/\\*$/;\n const possibleBucketName = grantScope.match(bucketScopeReg)?.[1];\n if (!grantScope.endsWith('*')) {\n return 'OBJECT';\n }\n else if (grantScope.endsWith('/*') &&\n possibleBucketName &&\n possibleBucketName.indexOf('/') === -1) {\n return 'BUCKET';\n }\n else {\n return 'PREFIX';\n }\n};\nfunction assertGrantScope(value) {\n if (typeof value !== 'string' || !value.startsWith('s3://')) {\n throw new StorageError({\n name: 'InvalidGrantScope',\n message: `Expected a valid grant scope, got ${value}`,\n });\n }\n}\n"],"names":["listCallerAccessGrantsClient"],"mappings":";;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACY,MAAC,sBAAsB,GAAG,OAAO,KAAK,KAAK;AACvD,IAAI,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,GAAG,KAAK;AAClG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,yCAAyC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAC/E,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,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