@aws-amplify/storage 6.9.4-unstable.e5a8569.0 → 6.9.5-unstable.2212704.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/utils/assertValidationError.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internals/apis/getDataAccess.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/index.js.map +1 -1
- package/dist/cjs/providers/s3/apis/index.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/downloadData.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/server/index.js.map +1 -1
- package/dist/cjs/providers/s3/index.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/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/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/crc32.js.map +1 -1
- package/dist/cjs/providers/s3/utils/index.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/resolveS3ConfigAndInput.js.map +1 -1
- package/dist/cjs/providers/s3/utils/transferTask.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/utils/index.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/utils/assertValidationError.mjs.map +1 -1
- package/dist/esm/internals/apis/getDataAccess.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/providers/s3/apis/internal/downloadData.mjs.map +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.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.map +1 -1
- package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.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/contentSha256middleware.mjs.map +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.map +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.map +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.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.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/crc32.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/resolveS3ConfigAndInput.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/transferTask.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":"CanceledError.js","sources":["../../../src/errors/CanceledError.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.isCancelError = exports.CanceledError = void 0;\nconst StorageError_1 = require(\"./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 */\nclass CanceledError extends StorageError_1.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}\nexports.CanceledError = CanceledError;\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 */\nconst isCancelError = (error) => !!error && error instanceof CanceledError;\nexports.isCancelError = isCancelError;\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,OAAO,CAAC,aAAa,GAAG,MAAM;AACtD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,SAAS,cAAc,CAAC,YAAY,CAAC;AACxD,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;
|
|
1
|
+
{"version":3,"file":"CanceledError.js","sources":["../../../src/errors/CanceledError.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.isCancelError = exports.CanceledError = void 0;\nconst StorageError_1 = require(\"./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 */\nclass CanceledError extends StorageError_1.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}\nexports.CanceledError = CanceledError;\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 */\nconst isCancelError = (error) => !!error && error instanceof CanceledError;\nexports.isCancelError = isCancelError;\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,OAAO,CAAC,aAAa,GAAG,MAAM;AACtD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,SAAS,cAAc,CAAC,YAAY,CAAC;AACxD,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,IAAI;AACJ;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY,aAAa;AAC1E,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrityError.js","sources":["../../../src/errors/IntegrityError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IntegrityError = 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\");\nconst StorageError_1 = require(\"./StorageError\");\nclass IntegrityError extends StorageError_1.StorageError {\n constructor(params) {\n super({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n recoverySuggestion: 'This may be a bug. Please reach out to library authors.',\n metadata: params?.metadata,\n });\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}\nexports.IntegrityError = IntegrityError;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B;AACA;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,cAAc,SAAS,cAAc,CAAC,YAAY,CAAC;AACzD,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO;AAClD,YAAY,OAAO,EAAE,gCAAgC;AACrD,YAAY,kBAAkB,EAAE,yDAAyD;AACzF,YAAY,QAAQ,EAAE,MAAM,EAAE,QAAQ;AACtC,SAAS,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,cAAc;AACzC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC;AAC7D;
|
|
1
|
+
{"version":3,"file":"IntegrityError.js","sources":["../../../src/errors/IntegrityError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IntegrityError = 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\");\nconst StorageError_1 = require(\"./StorageError\");\nclass IntegrityError extends StorageError_1.StorageError {\n constructor(params) {\n super({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n recoverySuggestion: 'This may be a bug. Please reach out to library authors.',\n metadata: params?.metadata,\n });\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}\nexports.IntegrityError = IntegrityError;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B;AACA;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,cAAc,SAAS,cAAc,CAAC,YAAY,CAAC;AACzD,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO;AAClD,YAAY,OAAO,EAAE,gCAAgC;AACrD,YAAY,kBAAkB,EAAE,yDAAyD;AACzF,YAAY,QAAQ,EAAE,MAAM,EAAE,QAAQ;AACtC,SAAS,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,cAAc;AACzC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC;AAC7D,IAAI;AACJ;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageError.js","sources":["../../../src/errors/StorageError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageError = 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\");\nclass StorageError extends utils_1.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}\nexports.StorageError = StorageError;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B;AACA;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,SAAS,OAAO,CAAC,YAAY,CAAC;AAChD,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;
|
|
1
|
+
{"version":3,"file":"StorageError.js","sources":["../../../src/errors/StorageError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageError = 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\");\nclass StorageError extends utils_1.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}\nexports.StorageError = StorageError;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B;AACA;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,SAAS,OAAO,CAAC,YAAY,CAAC;AAChD,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,IAAI;AACJ;AACA,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertValidationError.js","sources":["../../../../src/errors/utils/assertValidationError.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.assertValidationError = assertValidationError;\nconst validation_1 = require(\"../types/validation\");\nconst StorageError_1 = require(\"../StorageError\");\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validation_1.validationErrorMap[name];\n if (!assertion) {\n throw new StorageError_1.StorageError({ name, message, recoverySuggestion });\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,qBAAqB,GAAG,qBAAqB;AACrD,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACnD,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;AACjD,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AAChD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC;AACjF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACpF;
|
|
1
|
+
{"version":3,"file":"assertValidationError.js","sources":["../../../../src/errors/utils/assertValidationError.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.assertValidationError = assertValidationError;\nconst validation_1 = require(\"../types/validation\");\nconst StorageError_1 = require(\"../StorageError\");\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validation_1.validationErrorMap[name];\n if (!assertion) {\n throw new StorageError_1.StorageError({ name, message, recoverySuggestion });\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,qBAAqB,GAAG,qBAAqB;AACrD,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACnD,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;AACjD,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AAChD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC;AACjF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACpF,IAAI;AACJ;;"}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/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.DEFAULT_PART_SIZE = exports.StorageError = exports.isCancelError = exports.getUrl = exports.copy = exports.getProperties = exports.list = exports.remove = exports.downloadData = exports.uploadData = void 0;\nvar s3_1 = require(\"./providers/s3\");\nObject.defineProperty(exports, \"uploadData\", { enumerable: true, get: function () { return s3_1.uploadData; } });\nObject.defineProperty(exports, \"downloadData\", { enumerable: true, get: function () { return s3_1.downloadData; } });\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return s3_1.remove; } });\nObject.defineProperty(exports, \"list\", { enumerable: true, get: function () { return s3_1.list; } });\nObject.defineProperty(exports, \"getProperties\", { enumerable: true, get: function () { return s3_1.getProperties; } });\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return s3_1.copy; } });\nObject.defineProperty(exports, \"getUrl\", { enumerable: true, get: function () { return s3_1.getUrl; } });\nvar CanceledError_1 = require(\"./errors/CanceledError\");\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return CanceledError_1.isCancelError; } });\nvar StorageError_1 = require(\"./errors/StorageError\");\nObject.defineProperty(exports, \"StorageError\", { enumerable: true, get: function () { return StorageError_1.StorageError; } });\nvar constants_1 = require(\"./providers/s3/utils/constants\");\nObject.defineProperty(exports, \"DEFAULT_PART_SIZE\", { enumerable: true, get: function () { return constants_1.DEFAULT_PART_SIZE; } });\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,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM;AACrN,IAAI,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,IAAI,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/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.DEFAULT_PART_SIZE = exports.StorageError = exports.isCancelError = exports.getUrl = exports.copy = exports.getProperties = exports.list = exports.remove = exports.downloadData = exports.uploadData = void 0;\nvar s3_1 = require(\"./providers/s3\");\nObject.defineProperty(exports, \"uploadData\", { enumerable: true, get: function () { return s3_1.uploadData; } });\nObject.defineProperty(exports, \"downloadData\", { enumerable: true, get: function () { return s3_1.downloadData; } });\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return s3_1.remove; } });\nObject.defineProperty(exports, \"list\", { enumerable: true, get: function () { return s3_1.list; } });\nObject.defineProperty(exports, \"getProperties\", { enumerable: true, get: function () { return s3_1.getProperties; } });\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return s3_1.copy; } });\nObject.defineProperty(exports, \"getUrl\", { enumerable: true, get: function () { return s3_1.getUrl; } });\nvar CanceledError_1 = require(\"./errors/CanceledError\");\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return CanceledError_1.isCancelError; } });\nvar StorageError_1 = require(\"./errors/StorageError\");\nObject.defineProperty(exports, \"StorageError\", { enumerable: true, get: function () { return StorageError_1.StorageError; } });\nvar constants_1 = require(\"./providers/s3/utils/constants\");\nObject.defineProperty(exports, \"DEFAULT_PART_SIZE\", { enumerable: true, get: function () { return constants_1.DEFAULT_PART_SIZE; } });\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,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM;AACrN,IAAI,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACpC,MAAM,CA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AE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACrD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9H,IAAI,WAAW,GAAG,OAAO,CAAC,gCAAgC,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDataAccess.js","sources":["../../../../src/internals/apis/getDataAccess.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.getDataAccess = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst userAgent_1 = require(\"../../providers/s3/utils/userAgent\");\nconst s3control_1 = require(\"../../providers/s3/utils/client/s3control\");\nconst StorageError_1 = require(\"../../errors/StorageError\");\nconst utils_2 = require(\"../../utils\");\nconst constants_1 = require(\"../utils/constants\");\n/**\n * @internal\n */\nconst 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 (0, s3control_1.getDataAccess)({\n credentials: clientCredentialsProvider,\n customEndpoint: input.customEndpoint,\n region: input.region,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.GetDataAccess),\n }, {\n AccountId: input.accountId,\n Target: input.scope,\n Permission: input.permission,\n TargetType: targetType,\n DurationSeconds: constants_1.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_1.StorageError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'Service did not return valid temporary credentials.',\n metadata: result.$metadata,\n });\n }\n else {\n utils_2.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};\nexports.getDataAccess = getDataAccess;\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,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACjE,MAAM,WAAW,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACxE,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACjD;AACA;AACA;AACA,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK;AACvC,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,
|
|
1
|
+
{"version":3,"file":"getDataAccess.js","sources":["../../../../src/internals/apis/getDataAccess.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.getDataAccess = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst userAgent_1 = require(\"../../providers/s3/utils/userAgent\");\nconst s3control_1 = require(\"../../providers/s3/utils/client/s3control\");\nconst StorageError_1 = require(\"../../errors/StorageError\");\nconst utils_2 = require(\"../../utils\");\nconst constants_1 = require(\"../utils/constants\");\n/**\n * @internal\n */\nconst 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 (0, s3control_1.getDataAccess)({\n credentials: clientCredentialsProvider,\n customEndpoint: input.customEndpoint,\n region: input.region,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.GetDataAccess),\n }, {\n AccountId: input.accountId,\n Target: input.scope,\n Permission: input.permission,\n TargetType: targetType,\n DurationSeconds: constants_1.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_1.StorageError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'Service did not return valid temporary credentials.',\n metadata: result.$metadata,\n });\n }\n else {\n utils_2.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};\nexports.getDataAccess = getDataAccess;\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,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACjE,MAAM,WAAW,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACxE,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACjD;AACA;AACA;AACA,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK;AACvC,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,IAAI,CAAC;AACL,IAAI,MAAM,MAAM,GAAG,MAAM,IAAI,WAAW,CAAC,aAAa,EAAE;AACxD,QAAQ,WAAW,EAAE,yBAAyB;AAC9C,QAAQ,cAAc,EAAE,KAAK,CAAC,cAAc;AAC5C,QAAQ,MAAM,EAAE,KAAK,CAAC,MAAM;AAC5B,QAAQ,cAAc,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AK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCallerAccessGrants.js","sources":["../../../../src/internals/apis/listCallerAccessGrants.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.listCallerAccessGrants = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../../utils\");\nconst s3control_1 = require(\"../../providers/s3/utils/client/s3control\");\nconst StorageError_1 = require(\"../../errors/StorageError\");\nconst userAgent_1 = require(\"../../providers/s3/utils/userAgent\");\nconst constants_1 = require(\"../utils/constants\");\n/**\n * @internal\n */\nconst listCallerAccessGrants = async (input) => {\n const { credentialsProvider, accountId, region, nextToken, pageSize, customEndpoint, } = input;\n utils_2.logger.debug(`listing available locations from account ${input.accountId}`);\n if (!!pageSize && pageSize > constants_1.MAX_PAGE_SIZE) {\n utils_2.logger.debug(`defaulting pageSize to ${constants_1.MAX_PAGE_SIZE}.`);\n }\n const clientCredentialsProvider = async (options) => {\n const { credentials } = await credentialsProvider(options);\n return credentials;\n };\n const { CallerAccessGrantsList, NextToken, $metadata } = await (0, s3control_1.listCallerAccessGrants)({\n credentials: clientCredentialsProvider,\n customEndpoint,\n region,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.ListCallerAccessGrants),\n }, {\n AccountId: accountId,\n NextToken: nextToken,\n MaxResults: pageSize ?? constants_1.MAX_PAGE_SIZE,\n AllowedByApplication: true,\n });\n const accessGrants = CallerAccessGrantsList?.map(grant => {\n assertGrantScope(grant.GrantScope, $metadata);\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};\nexports.listCallerAccessGrants = listCallerAccessGrants;\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, responseMetadata) {\n if (typeof value !== 'string' || !value.startsWith('s3://')) {\n throw new StorageError_1.StorageError({\n name: 'InvalidGrantScope',\n message: `Expected a valid grant scope, got ${value}`,\n metadata: responseMetadata,\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,sBAAsB,GAAG,MAAM;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACxE,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACjE,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACjD;AACA;AACA;AACA,MAAM,sBAAsB,GAAG,OAAO,KAAK,KAAK;AAChD,IAAI,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,GAAG,KAAK;AAClG,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,yCAAyC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACvF,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,GAAG,WAAW,CAAC,aAAa,EAAE;AAC5D,QAAQ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACpF;
|
|
1
|
+
{"version":3,"file":"listCallerAccessGrants.js","sources":["../../../../src/internals/apis/listCallerAccessGrants.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.listCallerAccessGrants = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../../utils\");\nconst s3control_1 = require(\"../../providers/s3/utils/client/s3control\");\nconst StorageError_1 = require(\"../../errors/StorageError\");\nconst userAgent_1 = require(\"../../providers/s3/utils/userAgent\");\nconst constants_1 = require(\"../utils/constants\");\n/**\n * @internal\n */\nconst listCallerAccessGrants = async (input) => {\n const { credentialsProvider, accountId, region, nextToken, pageSize, customEndpoint, } = input;\n utils_2.logger.debug(`listing available locations from account ${input.accountId}`);\n if (!!pageSize && pageSize > constants_1.MAX_PAGE_SIZE) {\n utils_2.logger.debug(`defaulting pageSize to ${constants_1.MAX_PAGE_SIZE}.`);\n }\n const clientCredentialsProvider = async (options) => {\n const { credentials } = await credentialsProvider(options);\n return credentials;\n };\n const { CallerAccessGrantsList, NextToken, $metadata } = await (0, s3control_1.listCallerAccessGrants)({\n credentials: clientCredentialsProvider,\n customEndpoint,\n region,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.ListCallerAccessGrants),\n }, {\n AccountId: accountId,\n NextToken: nextToken,\n MaxResults: pageSize ?? constants_1.MAX_PAGE_SIZE,\n AllowedByApplication: true,\n });\n const accessGrants = CallerAccessGrantsList?.map(grant => {\n assertGrantScope(grant.GrantScope, $metadata);\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};\nexports.listCallerAccessGrants = listCallerAccessGrants;\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, responseMetadata) {\n if (typeof value !== 'string' || !value.startsWith('s3://')) {\n throw new StorageError_1.StorageError({\n name: 'InvalidGrantScope',\n message: `Expected a valid grant scope, got ${value}`,\n metadata: responseMetadata,\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,sBAAsB,GAAG,MAAM;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACxE,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACjE,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACjD;AACA;AACA;AACA,MAAM,sBAAsB,GAAG,OAAO,KAAK,KAAK;AAChD,IAAI,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,GAAG,KAAK;AAClG,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,yCAAyC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACvF,IAAI,IAAI,C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S,EAAE,SAAS;AAC5B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;AACvD,MAAM,cAAc,GAAG,CAAC,UAAU,KAAK;AACvC,IAAI,MAAM,cAAc,GAAG,mBAAmB;AAC9C,IAAI,MAAM,kBAAkB,GAAG,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACpE,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACnC,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;AACtC,QAAQ,kBAAkB;AAC1B,QAAQ,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;AAChD,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,SAAS;AACT,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,CAAC;AACD,SAAS,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE;AACnD,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AACjE,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC;AAC9C,YAAY,IAAI,EAAE,mBAAmB;AACrC,YAAY,OAAO,EAAE,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;AACjE,YAAY,QAAQ,EAAE,gBAAgB;AACtC,SAAS,CAAC;AACV,IAAI;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHighestPrecedenceUserGroup.js","sources":["../../../../../src/internals/apis/listPaths/getHighestPrecedenceUserGroup.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.getHighestPrecedenceUserGroup = void 0;\n/**\n * Given the Cognito user groups associated to current user session\n * and all the user group configurations defined by backend.\n * This function returns the user group with the highest precedence.\n * Reference: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-user-groups.html#assigning-precedence-values-to-groups\n *\n * @param {UserGroupConfig} userGroupsFromConfig - User groups with their precedence values based on Amplify outputs.\n * @param {string[]} currentUserGroups - The list of current user's groups.\n * @returns {string | undefined} - The user group with the highest precedence (0), or undefined if no matching group is found.\n */\nconst getHighestPrecedenceUserGroup = (userGroupsFromConfig, currentUserGroups) => {\n if (userGroupsFromConfig && currentUserGroups) {\n const precedenceMap = userGroupsFromConfig.reduce((acc, group) => {\n Object.entries(group).forEach(([key, value]) => {\n acc[key] = value.precedence;\n });\n return acc;\n }, {});\n const sortedUserGroup = currentUserGroups\n .filter(group => Object.prototype.hasOwnProperty.call(precedenceMap, group))\n .sort((a, b) => precedenceMap[a] - precedenceMap[b]);\n return sortedUserGroup[0];\n }\n return undefined;\n};\nexports.getHighestPrecedenceUserGroup = getHighestPrecedenceUserGroup;\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,6BAA6B,GAAG,CAAC,oBAAoB,EAAE,iBAAiB,KAAK;AACnF,IAAI,IAAI,oBAAoB,IAAI,iBAAiB,EAAE;AACnD,QAAQ,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK;AAC1E,YAAY,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AAC5D,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU;AAC3C,
|
|
1
|
+
{"version":3,"file":"getHighestPrecedenceUserGroup.js","sources":["../../../../../src/internals/apis/listPaths/getHighestPrecedenceUserGroup.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.getHighestPrecedenceUserGroup = void 0;\n/**\n * Given the Cognito user groups associated to current user session\n * and all the user group configurations defined by backend.\n * This function returns the user group with the highest precedence.\n * Reference: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-user-groups.html#assigning-precedence-values-to-groups\n *\n * @param {UserGroupConfig} userGroupsFromConfig - User groups with their precedence values based on Amplify outputs.\n * @param {string[]} currentUserGroups - The list of current user's groups.\n * @returns {string | undefined} - The user group with the highest precedence (0), or undefined if no matching group is found.\n */\nconst getHighestPrecedenceUserGroup = (userGroupsFromConfig, currentUserGroups) => {\n if (userGroupsFromConfig && currentUserGroups) {\n const precedenceMap = userGroupsFromConfig.reduce((acc, group) => {\n Object.entries(group).forEach(([key, value]) => {\n acc[key] = value.precedence;\n });\n return acc;\n }, {});\n const sortedUserGroup = currentUserGroups\n .filter(group => Object.prototype.hasOwnProperty.call(precedenceMap, group))\n .sort((a, b) => precedenceMap[a] - precedenceMap[b]);\n return sortedUserGroup[0];\n }\n return undefined;\n};\nexports.getHighestPrecedenceUserGroup = getHighestPrecedenceUserGroup;\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,6BAA6B,GAAG,CAAC,oBAAoB,EAAE,iBAAiB,KAAK;AACnF,IAAI,IAAI,oBAAoB,IAAI,iBAAiB,EAAE;AACnD,QAAQ,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK;AAC1E,YAAY,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AAC5D,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU;AAC3C,YAAY,CAAC,CAAC;AACd,YAAY,OAAO,GAAG;AACtB,QAAQ,CAAC,EAAE,EAAE,CAAC;AACd,QAAQ,MAAM,eAAe,GAAG;AAChC,aAAa,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC;AACvF,aAAa,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAChE,QAAQ,OAAO,eAAe,CAAC,CAAC,CAAC;AACjC,IAAI;AACJ,IAAI,OAAO,SAAS;AACpB,CAAC;AACD,OAAO,CAAC,6BAA6B,GAAG,6BAA6B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/internals/apis/listPaths/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.listPaths = void 0;\nvar listPaths_1 = require(\"./listPaths\");\nObject.defineProperty(exports, \"listPaths\", { enumerable: true, get: function () { return listPaths_1.listPaths; } });\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,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/internals/apis/listPaths/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.listPaths = void 0;\nvar listPaths_1 = require(\"./listPaths\");\nObject.defineProperty(exports, \"listPaths\", { enumerable: true, get: function () { return listPaths_1.listPaths; } });\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,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listPaths.js","sources":["../../../../../src/internals/apis/listPaths/listPaths.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.listPaths = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst resolveLocationsForCurrentSession_1 = require(\"./resolveLocationsForCurrentSession\");\nconst getHighestPrecedenceUserGroup_1 = require(\"./getHighestPrecedenceUserGroup\");\nconst listPaths = async () => {\n const { buckets } = core_1.Amplify.getConfig().Storage.S3;\n const { groups } = core_1.Amplify.getConfig().Auth.Cognito;\n if (!buckets) {\n return { locations: [] };\n }\n const { tokens, identityId } = await (0, core_1.fetchAuthSession)();\n const currentUserGroups = tokens?.accessToken.payload['cognito:groups'];\n const userGroupToUse = (0, getHighestPrecedenceUserGroup_1.getHighestPrecedenceUserGroup)(groups, currentUserGroups);\n const locations = (0, resolveLocationsForCurrentSession_1.resolveLocationsForCurrentSession)({\n buckets,\n isAuthenticated: !!tokens,\n identityId,\n userGroup: userGroupToUse,\n });\n return { locations };\n};\nexports.listPaths = listPaths;\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,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,mCAAmC,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC1F,MAAM,+BAA+B,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAClF,MAAM,SAAS,GAAG,YAAY;AAC9B,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE;AAC7D,IAAI,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO;AAC9D,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;AAChC;
|
|
1
|
+
{"version":3,"file":"listPaths.js","sources":["../../../../../src/internals/apis/listPaths/listPaths.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.listPaths = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst resolveLocationsForCurrentSession_1 = require(\"./resolveLocationsForCurrentSession\");\nconst getHighestPrecedenceUserGroup_1 = require(\"./getHighestPrecedenceUserGroup\");\nconst listPaths = async () => {\n const { buckets } = core_1.Amplify.getConfig().Storage.S3;\n const { groups } = core_1.Amplify.getConfig().Auth.Cognito;\n if (!buckets) {\n return { locations: [] };\n }\n const { tokens, identityId } = await (0, core_1.fetchAuthSession)();\n const currentUserGroups = tokens?.accessToken.payload['cognito:groups'];\n const userGroupToUse = (0, getHighestPrecedenceUserGroup_1.getHighestPrecedenceUserGroup)(groups, currentUserGroups);\n const locations = (0, resolveLocationsForCurrentSession_1.resolveLocationsForCurrentSession)({\n buckets,\n isAuthenticated: !!tokens,\n identityId,\n userGroup: userGroupToUse,\n });\n return { locations };\n};\nexports.listPaths = listPaths;\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,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,mCAAmC,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC1F,MAAM,+BAA+B,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAClF,MAAM,SAAS,GAAG,YAAY;AAC9B,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE;AAC7D,IAAI,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO;AAC9D,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;AAChC,IAAI;AACJ,IAAI,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,MAAM,CAAC,gBAAgB,GAAG;AACvE,IAAI,MAAM,iBAAiB,GAAG,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC;AAC3E,IAAI,MAAM,cAAc,GAAG,IAAI,+BAA+B,CAAC,6BAA6B,EAAE,MAAM,EAAE,iBAAiB,CAAC;AACxH,IAAI,MAAM,SAAS,GAAG,IAAI,mCAAmC,CAAC,iCAAiC,EAAE;AACjG,QAAQ,OAAO;AACf,QAAQ,eAAe,EAAE,CAAC,CAAC,MAAM;AACjC,QAAQ,UAAU;AAClB,QAAQ,SAAS,EAAE,cAAc;AACjC,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,SAAS,EAAE;AACxB,CAAC;AACD,OAAO,CAAC,SAAS,GAAG,SAAS;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveLocationsForCurrentSession.js","sources":["../../../../../src/internals/apis/listPaths/resolveLocationsForCurrentSession.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveLocationsForCurrentSession = void 0;\nconst constants_1 = require(\"../../utils/constants\");\nconst resolvePermissions = (accessRule, isAuthenticated, groups) => {\n if (!isAuthenticated) {\n return {\n permission: accessRule.guest,\n };\n }\n if (groups) {\n const selectedKey = Object.keys(accessRule).find(access => access.includes(groups));\n return {\n permission: selectedKey ? accessRule[selectedKey] : undefined,\n };\n }\n return {\n permission: accessRule.authenticated,\n };\n};\nconst resolveLocationsForCurrentSession = ({ buckets, isAuthenticated, identityId, userGroup, }) => {\n const locations = [];\n for (const [, bucketInfo] of Object.entries(buckets)) {\n const { bucketName, paths } = bucketInfo;\n if (!paths) {\n continue;\n }\n for (const [path, accessRules] of Object.entries(paths)) {\n const shouldIncludeEntityIdPath = !userGroup &&\n path.includes(constants_1.ENTITY_IDENTITY_URL) &&\n isAuthenticated &&\n identityId;\n if (shouldIncludeEntityIdPath) {\n locations.push({\n type: 'PREFIX',\n permission: accessRules.entityidentity,\n bucket: bucketName,\n prefix: path.replace(constants_1.ENTITY_IDENTITY_URL, identityId),\n });\n }\n const location = {\n type: 'PREFIX',\n ...resolvePermissions(accessRules, isAuthenticated, userGroup),\n bucket: bucketName,\n prefix: path,\n };\n if (location.permission)\n locations.push(location);\n }\n }\n return locations;\n};\nexports.resolveLocationsForCurrentSession = resolveLocationsForCurrentSession;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iCAAiC,GAAG,MAAM;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,KAAK;AACpE,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,UAAU,CAAC,KAAK;AACxC,SAAS;AACT;
|
|
1
|
+
{"version":3,"file":"resolveLocationsForCurrentSession.js","sources":["../../../../../src/internals/apis/listPaths/resolveLocationsForCurrentSession.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveLocationsForCurrentSession = void 0;\nconst constants_1 = require(\"../../utils/constants\");\nconst resolvePermissions = (accessRule, isAuthenticated, groups) => {\n if (!isAuthenticated) {\n return {\n permission: accessRule.guest,\n };\n }\n if (groups) {\n const selectedKey = Object.keys(accessRule).find(access => access.includes(groups));\n return {\n permission: selectedKey ? accessRule[selectedKey] : undefined,\n };\n }\n return {\n permission: accessRule.authenticated,\n };\n};\nconst resolveLocationsForCurrentSession = ({ buckets, isAuthenticated, identityId, userGroup, }) => {\n const locations = [];\n for (const [, bucketInfo] of Object.entries(buckets)) {\n const { bucketName, paths } = bucketInfo;\n if (!paths) {\n continue;\n }\n for (const [path, accessRules] of Object.entries(paths)) {\n const shouldIncludeEntityIdPath = !userGroup &&\n path.includes(constants_1.ENTITY_IDENTITY_URL) &&\n isAuthenticated &&\n identityId;\n if (shouldIncludeEntityIdPath) {\n locations.push({\n type: 'PREFIX',\n permission: accessRules.entityidentity,\n bucket: bucketName,\n prefix: path.replace(constants_1.ENTITY_IDENTITY_URL, identityId),\n });\n }\n const location = {\n type: 'PREFIX',\n ...resolvePermissions(accessRules, isAuthenticated, userGroup),\n bucket: bucketName,\n prefix: path,\n };\n if (location.permission)\n locations.push(location);\n }\n }\n return locations;\n};\nexports.resolveLocationsForCurrentSession = resolveLocationsForCurrentSession;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iCAAiC,GAAG,MAAM;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,KAAK;AACpE,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,UAAU,CAAC,KAAK;AACxC,SAAS;AACT,IAAI;AACJ,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3F,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,SAAS;AACzE,SAAS;AACT,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,UAAU,EAAE,UAAU,CAAC,aAAa;AAC5C,KAAK;AACL,CAAC;AACD,MAAM,iCAAiC,GAAG,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,GAAG,KAAK;AACpG,IAAI,MAAM,SAAS,GAAG,EAAE;AACxB,IAAI,KAAK,MAAM,GAAG,UAAU,C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ent":["\"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.validationErrorMap = exports.StorageValidationErrorCode = exports.assertValidationError = exports.listPaths = exports.copy = exports.downloadData = exports.uploadData = exports.remove = exports.getUrl = exports.getProperties = exports.list = exports.listCallerAccessGrants = exports.getDataAccess = void 0;\nvar getDataAccess_1 = require(\"./apis/getDataAccess\");\nObject.defineProperty(exports, \"getDataAccess\", { enumerable: true, get: function () { return getDataAccess_1.getDataAccess; } });\nvar listCallerAccessGrants_1 = require(\"./apis/listCallerAccessGrants\");\nObject.defineProperty(exports, \"listCallerAccessGrants\", { enumerable: true, get: function () { return listCallerAccessGrants_1.listCallerAccessGrants; } });\nvar list_1 = require(\"./apis/list\");\nObject.defineProperty(exports, \"list\", { enumerable: true, get: function () { return list_1.list; } });\nvar getProperties_1 = require(\"./apis/getProperties\");\nObject.defineProperty(exports, \"getProperties\", { enumerable: true, get: function () { return getProperties_1.getProperties; } });\nvar getUrl_1 = require(\"./apis/getUrl\");\nObject.defineProperty(exports, \"getUrl\", { enumerable: true, get: function () { return getUrl_1.getUrl; } });\nvar remove_1 = require(\"./apis/remove\");\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return remove_1.remove; } });\nvar uploadData_1 = require(\"./apis/uploadData\");\nObject.defineProperty(exports, \"uploadData\", { enumerable: true, get: function () { return uploadData_1.uploadData; } });\nvar downloadData_1 = require(\"./apis/downloadData\");\nObject.defineProperty(exports, \"downloadData\", { enumerable: true, get: function () { return downloadData_1.downloadData; } });\nvar copy_1 = require(\"./apis/copy\");\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return copy_1.copy; } });\n/** Default Auth exports */\nvar listPaths_1 = require(\"./apis/listPaths\");\nObject.defineProperty(exports, \"listPaths\", { enumerable: true, get: function () { return listPaths_1.listPaths; } });\n/**\n * Internal util functions\n */\nvar assertValidationError_1 = require(\"../errors/utils/assertValidationError\");\nObject.defineProperty(exports, \"assertValidationError\", { enumerable: true, get: function () { return assertValidationError_1.assertValidationError; } });\n/**\n * Utility types\n */\nvar validation_1 = require(\"../errors/types/validation\");\nObject.defineProperty(exports, \"StorageValidationErrorCode\", { enumerable: true, get: function () { return validation_1.StorageValidationErrorCode; } });\nObject.defineProperty(exports, \"validationErrorMap\", { enumerable: true, get: function () { return validation_1.validationErrorMap; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AACzT,IAAI,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;AACrD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/internals/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.validationErrorMap = exports.StorageValidationErrorCode = exports.assertValidationError = exports.listPaths = exports.copy = exports.downloadData = exports.uploadData = exports.remove = exports.getUrl = exports.getProperties = exports.list = exports.listCallerAccessGrants = exports.getDataAccess = void 0;\nvar getDataAccess_1 = require(\"./apis/getDataAccess\");\nObject.defineProperty(exports, \"getDataAccess\", { enumerable: true, get: function () { return getDataAccess_1.getDataAccess; } });\nvar listCallerAccessGrants_1 = require(\"./apis/listCallerAccessGrants\");\nObject.defineProperty(exports, \"listCallerAccessGrants\", { enumerable: true, get: function () { return listCallerAccessGrants_1.listCallerAccessGrants; } });\nvar list_1 = require(\"./apis/list\");\nObject.defineProperty(exports, \"list\", { enumerable: true, get: function () { return list_1.list; } });\nvar getProperties_1 = require(\"./apis/getProperties\");\nObject.defineProperty(exports, \"getProperties\", { enumerable: true, get: function () { return getProperties_1.getProperties; } });\nvar getUrl_1 = require(\"./apis/getUrl\");\nObject.defineProperty(exports, \"getUrl\", { enumerable: true, get: function () { return getUrl_1.getUrl; } });\nvar remove_1 = require(\"./apis/remove\");\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return remove_1.remove; } });\nvar uploadData_1 = require(\"./apis/uploadData\");\nObject.defineProperty(exports, \"uploadData\", { enumerable: true, get: function () { return uploadData_1.uploadData; } });\nvar downloadData_1 = require(\"./apis/downloadData\");\nObject.defineProperty(exports, \"downloadData\", { enumerable: true, get: function () { return downloadData_1.downloadData; } });\nvar copy_1 = require(\"./apis/copy\");\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return copy_1.copy; } });\n/** Default Auth exports */\nvar listPaths_1 = require(\"./apis/listPaths\");\nObject.defineProperty(exports, \"listPaths\", { enumerable: true, get: function () { return listPaths_1.listPaths; } });\n/**\n * Internal util functions\n */\nvar assertValidationError_1 = require(\"../errors/utils/assertValidationError\");\nObject.defineProperty(exports, \"assertValidationError\", { enumerable: true, get: function () { return assertValidationError_1.assertValidationError; } });\n/**\n * Utility types\n */\nvar validation_1 = require(\"../errors/types/validation\");\nObject.defineProperty(exports, \"StorageValidationErrorCode\", { enumerable: true, get: function () { return validation_1.StorageValidationErrorCode; } });\nObject.defineProperty(exports, \"validationErrorMap\", { enumerable: true, get: function () { return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MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AACrH;AACA;AACA;AACA,IAAI,uBAAuB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AAC9E,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,uBAAuB,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC;AACzJ;AACA;AACA;AACA,IAAI,YAAY,GAAG,OAAO,CAAC,4BAA4B,CAAC;AACxD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;AACxJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/providers/s3/apis/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.getUrl = exports.copy = exports.getProperties = exports.list = exports.remove = exports.downloadData = exports.uploadData = void 0;\nvar uploadData_1 = require(\"./uploadData\");\nObject.defineProperty(exports, \"uploadData\", { enumerable: true, get: function () { return uploadData_1.uploadData; } });\nvar downloadData_1 = require(\"./downloadData\");\nObject.defineProperty(exports, \"downloadData\", { enumerable: true, get: function () { return downloadData_1.downloadData; } });\nvar remove_1 = require(\"./remove\");\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return remove_1.remove; } });\nvar list_1 = require(\"./list\");\nObject.defineProperty(exports, \"list\", { enumerable: true, get: function () { return list_1.list; } });\nvar getProperties_1 = require(\"./getProperties\");\nObject.defineProperty(exports, \"getProperties\", { enumerable: true, get: function () { return getProperties_1.getProperties; } });\nvar copy_1 = require(\"./copy\");\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return copy_1.copy; } });\nvar getUrl_1 = require(\"./getUrl\");\nObject.defineProperty(exports, \"getUrl\", { enumerable: true, get: function () { return getUrl_1.getUrl; } });\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,IAAI,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM;AAC1I,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/providers/s3/apis/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.getUrl = exports.copy = exports.getProperties = exports.list = exports.remove = exports.downloadData = exports.uploadData = void 0;\nvar uploadData_1 = require(\"./uploadData\");\nObject.defineProperty(exports, \"uploadData\", { enumerable: true, get: function () { return uploadData_1.uploadData; } });\nvar downloadData_1 = require(\"./downloadData\");\nObject.defineProperty(exports, \"downloadData\", { enumerable: true, get: function () { return downloadData_1.downloadData; } });\nvar remove_1 = require(\"./remove\");\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return remove_1.remove; } });\nvar list_1 = require(\"./list\");\nObject.defineProperty(exports, \"list\", { enumerable: true, get: function () { return list_1.list; } });\nvar getProperties_1 = require(\"./getProperties\");\nObject.defineProperty(exports, \"getProperties\", { enumerable: true, get: function () { return getProperties_1.getProperties; } });\nvar copy_1 = require(\"./copy\");\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return copy_1.copy; } });\nvar getUrl_1 = require(\"./getUrl\");\nObject.defineProperty(exports, \"getUrl\", { enumerable: true, get: function () { return getUrl_1.getUrl; } });\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,IAAI,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM;AAC1I,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;AACxH,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAC9C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9H,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,CAAC,CAAC,EAAE,CAAC;AAC5G,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,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,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,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,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadData.js","sources":["../../../../../../src/providers/s3/apis/internal/downloadData.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.downloadData = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst resolveS3ConfigAndInput_1 = require(\"../../utils/resolveS3ConfigAndInput\");\nconst utils_2 = require(\"../../utils\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst userAgent_1 = require(\"../../utils/userAgent\");\nconst utils_3 = require(\"../../../../utils\");\nconst constants_1 = require(\"../../utils/constants\");\nconst downloadData = (input) => {\n const abortController = new AbortController();\n const downloadTask = (0, utils_2.createDownloadTask)({\n job: downloadDataJob(input, abortController.signal),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n return downloadTask;\n};\nexports.downloadData = downloadData;\nconst downloadDataJob = (downloadDataInput, abortSignal) => async () => {\n const { options: downloadDataOptions } = downloadDataInput;\n const { bucket, keyPrefix, s3Config, identityId } = await (0, resolveS3ConfigAndInput_1.resolveS3ConfigAndInput)(core_1.Amplify, downloadDataInput);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInput)(downloadDataInput, identityId);\n (0, utils_2.validateBucketOwnerID)(downloadDataOptions?.expectedBucketOwner);\n const finalKey = inputType === constants_1.STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n utils_3.logger.debug(`download ${objectKey} from ${finalKey}.`);\n const { Body: body, LastModified: lastModified, ContentLength: size, ETag: eTag, Metadata: metadata, VersionId: versionId, ContentType: contentType, } = await (0, s3data_1.getObject)({\n ...s3Config,\n abortSignal,\n onDownloadProgress: downloadDataOptions?.onProgress,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.DownloadData),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(downloadDataOptions?.bytesRange && {\n Range: `bytes=${downloadDataOptions.bytesRange.start}-${downloadDataOptions.bytesRange.end}`,\n }),\n ExpectedBucketOwner: downloadDataOptions?.expectedBucketOwner,\n });\n const result = {\n body,\n lastModified,\n size,\n contentType,\n eTag,\n metadata,\n versionId,\n };\n return inputType === constants_1.STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,yBAAyB,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAChF,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACrD,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAChC,IAAI,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE;AACjD,IAAI,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE;AACzD,QAAQ,GAAG,EAAE,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC;AAC3D,QAAQ,QAAQ,EAAE,CAAC,OAAO,KAAK;AAC/B,YAAY,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC;AAC1C,
|
|
1
|
+
{"version":3,"file":"downloadData.js","sources":["../../../../../../src/providers/s3/apis/internal/downloadData.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.downloadData = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst resolveS3ConfigAndInput_1 = require(\"../../utils/resolveS3ConfigAndInput\");\nconst utils_2 = require(\"../../utils\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst userAgent_1 = require(\"../../utils/userAgent\");\nconst utils_3 = require(\"../../../../utils\");\nconst constants_1 = require(\"../../utils/constants\");\nconst downloadData = (input) => {\n const abortController = new AbortController();\n const downloadTask = (0, utils_2.createDownloadTask)({\n job: downloadDataJob(input, abortController.signal),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n return downloadTask;\n};\nexports.downloadData = downloadData;\nconst downloadDataJob = (downloadDataInput, abortSignal) => async () => {\n const { options: downloadDataOptions } = downloadDataInput;\n const { bucket, keyPrefix, s3Config, identityId } = await (0, resolveS3ConfigAndInput_1.resolveS3ConfigAndInput)(core_1.Amplify, downloadDataInput);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInput)(downloadDataInput, identityId);\n (0, utils_2.validateBucketOwnerID)(downloadDataOptions?.expectedBucketOwner);\n const finalKey = inputType === constants_1.STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n utils_3.logger.debug(`download ${objectKey} from ${finalKey}.`);\n const { Body: body, LastModified: lastModified, ContentLength: size, ETag: eTag, Metadata: metadata, VersionId: versionId, ContentType: contentType, } = await (0, s3data_1.getObject)({\n ...s3Config,\n abortSignal,\n onDownloadProgress: downloadDataOptions?.onProgress,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.DownloadData),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(downloadDataOptions?.bytesRange && {\n Range: `bytes=${downloadDataOptions.bytesRange.start}-${downloadDataOptions.bytesRange.end}`,\n }),\n ExpectedBucketOwner: downloadDataOptions?.expectedBucketOwner,\n });\n const result = {\n body,\n lastModified,\n size,\n contentType,\n eTag,\n metadata,\n versionId,\n };\n return inputType === constants_1.STORAGE_INPUT_KEY\n ? { key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BAAmB,EAAE,mBAAmB;AACrE,KAAK,CAAC;AACN,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,IAAI;AACZ,QAAQ,YAAY;AACpB,QAAQ,IAAI;AACZ,QAAQ,WAAW;AACnB,QAAQ,IAAI;AACZ,QAAQ,QAAQ;AAChB,QAAQ,SAAS;AACjB,KAAK;AACL,IAAI,OAAO,SAAS,KAAK,WAAW,CAAC;AACrC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM;AACrC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE;AACxC,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUrl.js","sources":["../../../../../../src/providers/s3/apis/internal/getUrl.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.getUrl = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst validation_1 = require(\"../../../../errors/types/validation\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst utils_2 = require(\"../../utils\");\nconst assertValidationError_1 = require(\"../../../../errors/utils/assertValidationError\");\nconst constants_1 = require(\"../../utils/constants\");\nconst constructContentDisposition_1 = require(\"../../utils/constructContentDisposition\");\nconst getProperties_1 = require(\"./getProperties\");\nconst getUrl = async (amplify, input) => {\n const { options: getUrlOptions } = input;\n const { s3Config, keyPrefix, bucket, identityId } = await (0, utils_2.resolveS3ConfigAndInput)(amplify, input);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInput)(input, identityId);\n (0, utils_2.validateBucketOwnerID)(getUrlOptions?.expectedBucketOwner);\n const finalKey = inputType === constants_1.STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n if (getUrlOptions?.validateObjectExistence) {\n await (0, getProperties_1.getProperties)(amplify, input, utils_1.StorageAction.GetUrl);\n }\n let urlExpirationInSec = getUrlOptions?.expiresIn ?? constants_1.DEFAULT_PRESIGN_EXPIRATION;\n const resolvedCredential = typeof s3Config.credentials === 'function'\n ? await s3Config.credentials()\n : s3Config.credentials;\n const awsCredExpiration = resolvedCredential.expiration;\n if (awsCredExpiration) {\n const awsCredExpirationInSec = Math.floor((awsCredExpiration.getTime() - Date.now()) / 1000);\n urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);\n }\n const maxUrlExpirationInSec = constants_1.MAX_URL_EXPIRATION / 1000;\n (0, assertValidationError_1.assertValidationError)(urlExpirationInSec <= maxUrlExpirationInSec, validation_1.StorageValidationErrorCode.UrlExpirationMaxLimitExceed);\n // expiresAt is the minimum of credential expiration and url expiration\n return {\n url: await (0, s3data_1.getPresignedGetObjectUrl)({\n ...s3Config,\n credentials: resolvedCredential,\n expiration: urlExpirationInSec,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(getUrlOptions?.contentDisposition && {\n ResponseContentDisposition: (0, constructContentDisposition_1.constructContentDisposition)(getUrlOptions.contentDisposition),\n }),\n ...(getUrlOptions?.contentType && {\n ResponseContentType: getUrlOptions.contentType,\n }),\n ExpectedBucketOwner: getUrlOptions?.expectedBucketOwner,\n }),\n expiresAt: new Date(Date.now() + urlExpirationInSec * 1000),\n };\n};\nexports.getUrl = getUrl;\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,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,GAAG,OAAO,CAAC,qCAAqC,CAAC;AACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACrD,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,uBAAuB,GAAG,OAAO,CAAC,gDAAgD,CAAC;AACzF,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,6BAA6B,GAAG,OAAO,CAAC,yCAAyC,CAAC;AACxF,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,OAAO,EAAE,KAAK,KAAK;AACzC,IAAI,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,KAAK;AAC5C,IAAI,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC;AAClH,IAAI,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,OAAO,CAAC,6BAA6B,EAAE,KAAK,EAAE,UAAU,CAAC;AAClG,IAAI,IAAI,OAAO,CAAC,qBAAqB,EAAE,aAAa,EAAE,mBAAmB,CAAC;AAC1E,IAAI,MAAM,QAAQ,GAAG,SAAS,KAAK,WAAW,CAAC,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS;AACpG,IAAI,IAAI,aAAa,EAAE,uBAAuB,EAAE;AAChD,QAAQ,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC;AAC9F;
|
|
1
|
+
{"version":3,"file":"getUrl.js","sources":["../../../../../../src/providers/s3/apis/internal/getUrl.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.getUrl = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst validation_1 = require(\"../../../../errors/types/validation\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst utils_2 = require(\"../../utils\");\nconst assertValidationError_1 = require(\"../../../../errors/utils/assertValidationError\");\nconst constants_1 = require(\"../../utils/constants\");\nconst constructContentDisposition_1 = require(\"../../utils/constructContentDisposition\");\nconst getProperties_1 = require(\"./getProperties\");\nconst getUrl = async (amplify, input) => {\n const { options: getUrlOptions } = input;\n const { s3Config, keyPrefix, bucket, identityId } = await (0, utils_2.resolveS3ConfigAndInput)(amplify, input);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInput)(input, identityId);\n (0, utils_2.validateBucketOwnerID)(getUrlOptions?.expectedBucketOwner);\n const finalKey = inputType === constants_1.STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n if (getUrlOptions?.validateObjectExistence) {\n await (0, getProperties_1.getProperties)(amplify, input, utils_1.StorageAction.GetUrl);\n }\n let urlExpirationInSec = getUrlOptions?.expiresIn ?? constants_1.DEFAULT_PRESIGN_EXPIRATION;\n const resolvedCredential = typeof s3Config.credentials === 'function'\n ? await s3Config.credentials()\n : s3Config.credentials;\n const awsCredExpiration = resolvedCredential.expiration;\n if (awsCredExpiration) {\n const awsCredExpirationInSec = Math.floor((awsCredExpiration.getTime() - Date.now()) / 1000);\n urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);\n }\n const maxUrlExpirationInSec = constants_1.MAX_URL_EXPIRATION / 1000;\n (0, assertValidationError_1.assertValidationError)(urlExpirationInSec <= maxUrlExpirationInSec, validation_1.StorageValidationErrorCode.UrlExpirationMaxLimitExceed);\n // expiresAt is the minimum of credential expiration and url expiration\n return {\n url: await (0, s3data_1.getPresignedGetObjectUrl)({\n ...s3Config,\n credentials: resolvedCredential,\n expiration: urlExpirationInSec,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(getUrlOptions?.contentDisposition && {\n ResponseContentDisposition: (0, constructContentDisposition_1.constructContentDisposition)(getUrlOptions.contentDisposition),\n }),\n ...(getUrlOptions?.contentType && {\n ResponseContentType: getUrlOptions.contentType,\n }),\n ExpectedBucketOwner: getUrlOptions?.expectedBucketOwner,\n }),\n exp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YAAY,IAAI,aAAa,EAAE,WAAW,IAAI;AAC9C,gBAAgB,mBAAmB,EAAE,aAAa,CAAC,WAAW;AAC9D,aAAa,CAAC;AACd,YAAY,mBAAmB,EAAE,aAAa,EAAE,mBAAmB;AACnE,SAAS,CAAC;AACV,QAAQ,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,kBAAkB,GAAG,IAAI,CAAC;AACnE,KAAK;AACL,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../../../../../src/providers/s3/apis/internal/list.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.list = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../../utils\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst userAgent_1 = require(\"../../utils/userAgent\");\nconst utils_3 = require(\"../../../../utils\");\nconst constants_1 = require(\"../../utils/constants\");\nconst IntegrityError_1 = require(\"../../../../errors/IntegrityError\");\nconst MAX_PAGE_SIZE = 1000;\nconst list = async (amplify, input) => {\n const { options = {} } = input;\n const { s3Config, bucket, keyPrefix: generatedPrefix, identityId, } = await (0, utils_2.resolveS3ConfigAndInput)(amplify, input);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInputWithPrefix)(input, identityId);\n (0, utils_2.validateBucketOwnerID)(options.expectedBucketOwner);\n const isInputWithPrefix = inputType === constants_1.STORAGE_INPUT_PREFIX;\n // @ts-expect-error pageSize and nextToken should not coexist with listAll\n if (options?.listAll && (options?.pageSize || options?.nextToken)) {\n const anyOptions = options;\n utils_3.logger.debug(`listAll is set to true, ignoring ${anyOptions?.pageSize ? `pageSize: ${anyOptions?.pageSize}` : ''} ${anyOptions?.nextToken ? `nextToken: ${anyOptions?.nextToken}` : ''}.`);\n }\n const listParams = {\n Bucket: bucket,\n Prefix: isInputWithPrefix ? `${generatedPrefix}${objectKey}` : objectKey,\n MaxKeys: options?.listAll ? undefined : options?.pageSize,\n ContinuationToken: options?.listAll ? undefined : options?.nextToken,\n Delimiter: getDelimiter(options),\n ExpectedBucketOwner: options?.expectedBucketOwner,\n EncodingType: 'url',\n };\n utils_3.logger.debug(`listing items from \"${listParams.Prefix}\"`);\n const listInputArgs = {\n s3Config,\n listParams,\n };\n if (options.listAll) {\n if (isInputWithPrefix) {\n return _listAllWithPrefix({\n ...listInputArgs,\n generatedPrefix,\n });\n }\n else {\n return _listAllWithPath(listInputArgs);\n }\n }\n else {\n if (isInputWithPrefix) {\n return _listWithPrefix({ ...listInputArgs, generatedPrefix });\n }\n else {\n return _listWithPath(listInputArgs);\n }\n }\n};\nexports.list = list;\n/** @deprecated Use {@link _listAllWithPath} instead. */\nconst _listAllWithPrefix = async ({ s3Config, listParams, generatedPrefix, }) => {\n const listResult = [];\n let continuationToken = listParams.ContinuationToken;\n do {\n const { items: pageResults, nextToken: pageNextToken } = await _listWithPrefix({\n generatedPrefix,\n s3Config,\n listParams: {\n ...listParams,\n ContinuationToken: continuationToken,\n MaxKeys: MAX_PAGE_SIZE,\n },\n });\n listResult.push(...pageResults);\n continuationToken = pageNextToken;\n } while (continuationToken);\n return {\n items: listResult,\n };\n};\n/** @deprecated Use {@link _listWithPath} instead. */\nconst _listWithPrefix = async ({ s3Config, listParams, generatedPrefix, }) => {\n const listParamsClone = { ...listParams };\n if (!listParamsClone.MaxKeys || listParamsClone.MaxKeys > MAX_PAGE_SIZE) {\n utils_3.logger.debug(`defaulting pageSize to ${MAX_PAGE_SIZE}.`);\n listParamsClone.MaxKeys = MAX_PAGE_SIZE;\n }\n const response = await (0, s3data_1.listObjectsV2)({\n ...s3Config,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.List),\n }, listParamsClone);\n const listOutput = decodeEncodedElements(response);\n validateEchoedElements(listParamsClone, listOutput);\n if (!listOutput?.Contents) {\n return {\n items: [],\n };\n }\n return {\n items: listOutput.Contents.map(item => ({\n key: generatedPrefix\n ? item.Key.substring(generatedPrefix.length)\n : item.Key,\n eTag: item.ETag,\n lastModified: item.LastModified,\n size: item.Size,\n })),\n nextToken: listOutput.NextContinuationToken,\n };\n};\nconst _listAllWithPath = async ({ s3Config, listParams, }) => {\n const listResult = [];\n const excludedSubpaths = [];\n let continuationToken = listParams.ContinuationToken;\n do {\n const { items: pageResults, excludedSubpaths: pageExcludedSubpaths, nextToken: pageNextToken, } = await _listWithPath({\n s3Config,\n listParams: {\n ...listParams,\n ContinuationToken: continuationToken,\n MaxKeys: MAX_PAGE_SIZE,\n },\n });\n listResult.push(...pageResults);\n excludedSubpaths.push(...(pageExcludedSubpaths ?? []));\n continuationToken = pageNextToken;\n } while (continuationToken);\n return {\n items: listResult,\n excludedSubpaths,\n };\n};\nconst _listWithPath = async ({ s3Config, listParams, }) => {\n const listParamsClone = { ...listParams };\n if (!listParamsClone.MaxKeys || listParamsClone.MaxKeys > MAX_PAGE_SIZE) {\n utils_3.logger.debug(`defaulting pageSize to ${MAX_PAGE_SIZE}.`);\n listParamsClone.MaxKeys = MAX_PAGE_SIZE;\n }\n const response = await (0, s3data_1.listObjectsV2)({\n ...s3Config,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.List),\n }, listParamsClone);\n const listOutput = decodeEncodedElements(response);\n validateEchoedElements(listParamsClone, listOutput);\n const { Contents: contents, NextContinuationToken: nextContinuationToken, CommonPrefixes: commonPrefixes, } = listOutput;\n const excludedSubpaths = commonPrefixes && mapCommonPrefixesToExcludedSubpaths(commonPrefixes);\n if (!contents) {\n return {\n items: [],\n nextToken: nextContinuationToken,\n excludedSubpaths,\n };\n }\n return {\n items: contents.map(item => ({\n path: item.Key,\n eTag: item.ETag,\n lastModified: item.LastModified,\n size: item.Size,\n })),\n nextToken: nextContinuationToken,\n excludedSubpaths,\n };\n};\nconst mapCommonPrefixesToExcludedSubpaths = (commonPrefixes) => {\n return commonPrefixes.reduce((mappedSubpaths, { Prefix }) => {\n if (Prefix) {\n mappedSubpaths.push(Prefix);\n }\n return mappedSubpaths;\n }, []);\n};\nconst getDelimiter = (options) => {\n if (options?.subpathStrategy?.strategy === 'exclude') {\n return options?.subpathStrategy?.delimiter ?? constants_1.DEFAULT_DELIMITER;\n }\n};\nconst validateEchoedElements = (listInput, listOutput) => {\n const validEchoedParameters = listInput.Bucket === listOutput.Name &&\n listInput.Delimiter === listOutput.Delimiter &&\n listInput.MaxKeys === listOutput.MaxKeys &&\n listInput.Prefix === listOutput.Prefix &&\n listInput.ContinuationToken === listOutput.ContinuationToken;\n if (!validEchoedParameters) {\n throw new IntegrityError_1.IntegrityError({ metadata: listOutput.$metadata });\n }\n};\n/**\n * Decodes URL-encoded elements in the S3 `ListObjectsV2Output` response when `EncodingType` is `'url'`.\n * Applies to values for 'Delimiter', 'Prefix', 'StartAfter' and 'Key' in the response.\n */\nconst decodeEncodedElements = (listOutput) => {\n if (listOutput.EncodingType !== 'url') {\n return listOutput;\n }\n const decodedListOutput = { ...listOutput };\n // Decode top-level properties\n ['Delimiter', 'Prefix', 'StartAfter'].forEach(prop => {\n const value = listOutput[prop];\n if (typeof value === 'string') {\n decodedListOutput[prop] = (0, utils_2.urlDecode)(value);\n }\n });\n // Decode 'Key' in each item of 'Contents', if it exists\n if (listOutput.Contents) {\n decodedListOutput.Contents = listOutput.Contents.map(content => ({\n ...content,\n Key: content.Key ? (0, utils_2.urlDecode)(content.Key) : content.Key,\n }));\n }\n // Decode 'Prefix' in each item of 'CommonPrefixes', if it exists\n if (listOutput.CommonPrefixes) {\n decodedListOutput.CommonPrefixes = listOutput.CommonPrefixes.map(content => ({\n ...content,\n Prefix: content.Prefix ? (0, utils_2.urlDecode)(content.Prefix) : content.Prefix,\n }));\n }\n return decodedListOutput;\n};\n"],"names":[],"mappings":";;AAC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,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,KAAK;AACrF,YAAY,GAAG,OAAO;AACtB,YAAY,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM;AAC5F,SAAS,CAAC,CAAC;AACX;AACA,IAAI,OAAO,iBAAiB;AAC5B,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"list.js","sources":["../../../../../../src/providers/s3/apis/internal/list.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.list = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../../utils\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst userAgent_1 = require(\"../../utils/userAgent\");\nconst utils_3 = require(\"../../../../utils\");\nconst constants_1 = require(\"../../utils/constants\");\nconst IntegrityError_1 = require(\"../../../../errors/IntegrityError\");\nconst MAX_PAGE_SIZE = 1000;\nconst list = async (amplify, input) => {\n const { options = {} } = input;\n const { s3Config, bucket, keyPrefix: generatedPrefix, identityId, } = await (0, utils_2.resolveS3ConfigAndInput)(amplify, input);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInputWithPrefix)(input, identityId);\n (0, utils_2.validateBucketOwnerID)(options.expectedBucketOwner);\n const isInputWithPrefix = inputType === constants_1.STORAGE_INPUT_PREFIX;\n // @ts-expect-error pageSize and nextToken should not coexist with listAll\n if (options?.listAll && (options?.pageSize || options?.nextToken)) {\n const anyOptions = options;\n utils_3.logger.debug(`listAll is set to true, ignoring ${anyOptions?.pageSize ? `pageSize: ${anyOptions?.pageSize}` : ''} ${anyOptions?.nextToken ? `nextToken: ${anyOptions?.nextToken}` : ''}.`);\n }\n const listParams = {\n Bucket: bucket,\n Prefix: isInputWithPrefix ? `${generatedPrefix}${objectKey}` : objectKey,\n MaxKeys: options?.listAll ? undefined : options?.pageSize,\n ContinuationToken: options?.listAll ? undefined : options?.nextToken,\n Delimiter: getDelimiter(options),\n ExpectedBucketOwner: options?.expectedBucketOwner,\n EncodingType: 'url',\n };\n utils_3.logger.debug(`listing items from \"${listParams.Prefix}\"`);\n const listInputArgs = {\n s3Config,\n listParams,\n };\n if (options.listAll) {\n if (isInputWithPrefix) {\n return _listAllWithPrefix({\n ...listInputArgs,\n generatedPrefix,\n });\n }\n else {\n return _listAllWithPath(listInputArgs);\n }\n }\n else {\n if (isInputWithPrefix) {\n return _listWithPrefix({ ...listInputArgs, generatedPrefix });\n }\n else {\n return _listWithPath(listInputArgs);\n }\n }\n};\nexports.list = list;\n/** @deprecated Use {@link _listAllWithPath} instead. */\nconst _listAllWithPrefix = async ({ s3Config, listParams, generatedPrefix, }) => {\n const listResult = [];\n let continuationToken = listParams.ContinuationToken;\n do {\n const { items: pageResults, nextToken: pageNextToken } = await _listWithPrefix({\n generatedPrefix,\n s3Config,\n listParams: {\n ...listParams,\n ContinuationToken: continuationToken,\n MaxKeys: MAX_PAGE_SIZE,\n },\n });\n listResult.push(...pageResults);\n continuationToken = pageNextToken;\n } while (continuationToken);\n return {\n items: listResult,\n };\n};\n/** @deprecated Use {@link _listWithPath} instead. */\nconst _listWithPrefix = async ({ s3Config, listParams, generatedPrefix, }) => {\n const listParamsClone = { ...listParams };\n if (!listParamsClone.MaxKeys || listParamsClone.MaxKeys > MAX_PAGE_SIZE) {\n utils_3.logger.debug(`defaulting pageSize to ${MAX_PAGE_SIZE}.`);\n listParamsClone.MaxKeys = MAX_PAGE_SIZE;\n }\n const response = await (0, s3data_1.listObjectsV2)({\n ...s3Config,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.List),\n }, listParamsClone);\n const listOutput = decodeEncodedElements(response);\n validateEchoedElements(listParamsClone, listOutput);\n if (!listOutput?.Contents) {\n return {\n items: [],\n };\n }\n return {\n items: listOutput.Contents.map(item => ({\n key: generatedPrefix\n ? item.Key.substring(generatedPrefix.length)\n : item.Key,\n eTag: item.ETag,\n lastModified: item.LastModified,\n size: item.Size,\n })),\n nextToken: listOutput.NextContinuationToken,\n };\n};\nconst _listAllWithPath = async ({ s3Config, listParams, }) => {\n const listResult = [];\n const excludedSubpaths = [];\n let continuationToken = listParams.ContinuationToken;\n do {\n const { items: pageResults, excludedSubpaths: pageExcludedSubpaths, nextToken: pageNextToken, } = await _listWithPath({\n s3Config,\n listParams: {\n ...listParams,\n ContinuationToken: continuationToken,\n MaxKeys: MAX_PAGE_SIZE,\n },\n });\n listResult.push(...pageResults);\n excludedSubpaths.push(...(pageExcludedSubpaths ?? []));\n continuationToken = pageNextToken;\n } while (continuationToken);\n return {\n items: listResult,\n excludedSubpaths,\n };\n};\nconst _listWithPath = async ({ s3Config, listParams, }) => {\n const listParamsClone = { ...listParams };\n if (!listParamsClone.MaxKeys || listParamsClone.MaxKeys > MAX_PAGE_SIZE) {\n utils_3.logger.debug(`defaulting pageSize to ${MAX_PAGE_SIZE}.`);\n listParamsClone.MaxKeys = MAX_PAGE_SIZE;\n }\n const response = await (0, s3data_1.listObjectsV2)({\n ...s3Config,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.List),\n }, listParamsClone);\n const listOutput = decodeEncodedElements(response);\n validateEchoedElements(listParamsClone, listOutput);\n const { Contents: contents, NextContinuationToken: nextContinuationToken, CommonPrefixes: commonPrefixes, } = listOutput;\n const excludedSubpaths = commonPrefixes && mapCommonPrefixesToExcludedSubpaths(commonPrefixes);\n if (!contents) {\n return {\n items: [],\n nextToken: nextContinuationToken,\n excludedSubpaths,\n };\n }\n return {\n items: contents.map(item => ({\n path: item.Key,\n eTag: item.ETag,\n lastModified: item.LastModified,\n size: item.Size,\n })),\n nextToken: nextContinuationToken,\n excludedSubpaths,\n };\n};\nconst mapCommonPrefixesToExcludedSubpaths = (commonPrefixes) => {\n return commonPrefixes.reduce((mappedSubpaths, { Prefix }) => {\n if (Prefix) {\n mappedSubpaths.push(Prefix);\n }\n return mappedSubpaths;\n }, []);\n};\nconst getDelimiter = (options) => {\n if (options?.subpathStrategy?.strategy === 'exclude') {\n return options?.subpathStrategy?.delimiter ?? constants_1.DEFAULT_DELIMITER;\n }\n};\nconst validateEchoedElements = (listInput, listOutput) => {\n const validEchoedParameters = listInput.Bucket === listOutput.Name &&\n listInput.Delimiter === listOutput.Delimiter &&\n listInput.MaxKeys === listOutput.MaxKeys &&\n listInput.Prefix === listOutput.Prefix &&\n listInput.ContinuationToken === listOutput.ContinuationToken;\n if (!validEchoedParameters) {\n throw new IntegrityError_1.IntegrityError({ metadata: listOutput.$metadata });\n }\n};\n/**\n * Decodes URL-encoded elements in the S3 `ListObjectsV2Output` response when `EncodingType` is `'url'`.\n * Applies to values for 'Delimiter', 'Prefix', 'StartAfter' and 'Key' in the response.\n */\nconst decodeEncodedElements = (listOutput) => {\n if (listOutput.EncodingType !== 'url') {\n return listOutput;\n }\n const decodedListOutput = { ...listOutput };\n // Decode top-level properties\n ['Delimiter', 'Prefix', 'StartAfter'].forEach(prop => {\n const value = listOutput[prop];\n if (typeof value === 'string') {\n decodedListOutput[prop] = (0, utils_2.urlDecode)(value);\n }\n });\n // Decode 'Key' in each item of 'Contents', if it exists\n if (listOutput.Contents) {\n decodedListOutput.Contents = listOutput.Contents.map(content => ({\n ...content,\n Key: content.Key ? (0, utils_2.urlDecode)(content.Key) : content.Key,\n }));\n }\n // Decode 'Prefix' in each item of 'CommonPrefixes', if it exists\n if (listOutput.CommonPrefixes) {\n decodedListOutput.CommonPrefixes = listOutput.CommonPrefixes.map(content => ({\n ...content,\n Prefix: content.Prefix ? (0, utils_2.urlDecode)(content.Prefix) : content.Prefix,\n }));\n }\n return decodedListOutput;\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE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,IAAI,UAAU,CAAC,cAAc,EAAE;AACnC,QAAQ,iBAAiB,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,KAAK;AACrF,YAAY,GAAG,OAAO;AACtB,YAAY,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM;AAC5F,SAAS,CAAC,CAAC;AACX,IAAI;AACJ,IAAI,OAAO,iBAAiB;AAC5B,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","sources":["../../../../../../src/providers/s3/apis/internal/remove.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.remove = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../../utils\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst userAgent_1 = require(\"../../utils/userAgent\");\nconst utils_3 = require(\"../../../../utils\");\nconst constants_1 = require(\"../../utils/constants\");\nconst remove = async (amplify, input) => {\n const { s3Config, keyPrefix, bucket, identityId } = await (0, utils_2.resolveS3ConfigAndInput)(amplify, input);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInput)(input, identityId);\n (0, utils_2.validateBucketOwnerID)(input.options?.expectedBucketOwner);\n let finalKey;\n if (inputType === constants_1.STORAGE_INPUT_KEY) {\n finalKey = `${keyPrefix}${objectKey}`;\n utils_3.logger.debug(`remove \"${objectKey}\" from \"${finalKey}\".`);\n }\n else {\n finalKey = objectKey;\n utils_3.logger.debug(`removing object in path \"${finalKey}\"`);\n }\n await (0, s3data_1.deleteObject)({\n ...s3Config,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.Remove),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ExpectedBucketOwner: input.options?.expectedBucketOwner,\n });\n return inputType === constants_1.STORAGE_INPUT_KEY\n ? {\n key: objectKey,\n }\n : {\n path: objectKey,\n };\n};\nexports.remove = remove;\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,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACrD,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACpD,MAAM,MAAM,GAAG,OAAO,OAAO,EAAE,KAAK,KAAK;AACzC,IAAI,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC;AAClH,IAAI,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,OAAO,CAAC,6BAA6B,EAAE,KAAK,EAAE,UAAU,CAAC;AAClG,IAAI,IAAI,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,OAAO,EAAE,mBAAmB,CAAC;AAC1E,IAAI,IAAI,QAAQ;AAChB,IAAI,IAAI,SAAS,KAAK,WAAW,CAAC,iBAAiB,EAAE;AACrD,QAAQ,QAAQ,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AAC7C,QAAQ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AACzE;
|
|
1
|
+
{"version":3,"file":"remove.js","sources":["../../../../../../src/providers/s3/apis/internal/remove.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.remove = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../../utils\");\nconst s3data_1 = require(\"../../utils/client/s3data\");\nconst userAgent_1 = require(\"../../utils/userAgent\");\nconst utils_3 = require(\"../../../../utils\");\nconst constants_1 = require(\"../../utils/constants\");\nconst remove = async (amplify, input) => {\n const { s3Config, keyPrefix, bucket, identityId } = await (0, utils_2.resolveS3ConfigAndInput)(amplify, input);\n const { inputType, objectKey } = (0, utils_2.validateStorageOperationInput)(input, identityId);\n (0, utils_2.validateBucketOwnerID)(input.options?.expectedBucketOwner);\n let finalKey;\n if (inputType === constants_1.STORAGE_INPUT_KEY) {\n finalKey = `${keyPrefix}${objectKey}`;\n utils_3.logger.debug(`remove \"${objectKey}\" from \"${finalKey}\".`);\n }\n else {\n finalKey = objectKey;\n utils_3.logger.debug(`removing object in path \"${finalKey}\"`);\n }\n await (0, s3data_1.deleteObject)({\n ...s3Config,\n userAgentValue: (0, userAgent_1.getStorageUserAgentValue)(utils_1.StorageAction.Remove),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ExpectedBucketOwner: input.options?.expectedBucketOwner,\n });\n return inputType === constants_1.STORAGE_INPUT_KEY\n ? {\n key: objectKey,\n }\n : {\n path: objectKey,\n };\n};\nexports.remove = remove;\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,OAAO,GAAG,OAAO,CAAC,mCAAmC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EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC;AAC/F,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,GAAG,EAAE,QAAQ;AACrB,QAAQ,mBAAmB,EAAE,KAAK,CAAC,OAAO,EAAE,mBAAmB;AAC/D,KAAK,CAAC;AACN,IAAI,OAAO,SAAS,KAAK,WAAW,CAAC;AACrC,UAAU;AACV,YAAY,GAAG,EAAE,SAAS;AAC1B;AACA,UAAU;AACV,YAAY,IAAI,EAAE,SAAS;AAC3B,SAAS;AACT,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byteLength.js","sources":["../../../../../../../src/providers/s3/apis/internal/uploadData/byteLength.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.byteLength = void 0;\n/**\n * Calculate the total size of the data to be uploaded. The total size is not required for multipart upload, as it's\n * only used in progress report.\n */\nconst byteLength = (input) => {\n if (input === null || input === undefined)\n return 0;\n if (typeof input === 'string') {\n const blob = new Blob([input]);\n return blob.size;\n }\n else if (typeof input.byteLength === 'number') {\n // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n return input.byteLength;\n }\n else if (typeof input.size === 'number') {\n // handles browser File object\n return input.size;\n }\n return undefined;\n};\nexports.byteLength = byteLength;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAC7C,QAAQ,OAAO,CAAC;AAChB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACtC,QAAQ,OAAO,IAAI,CAAC,IAAI;AACxB;
|
|
1
|
+
{"version":3,"file":"byteLength.js","sources":["../../../../../../../src/providers/s3/apis/internal/uploadData/byteLength.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.byteLength = void 0;\n/**\n * Calculate the total size of the data to be uploaded. The total size is not required for multipart upload, as it's\n * only used in progress report.\n */\nconst byteLength = (input) => {\n if (input === null || input === undefined)\n return 0;\n if (typeof input === 'string') {\n const blob = new Blob([input]);\n return blob.size;\n }\n else if (typeof input.byteLength === 'number') {\n // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n return input.byteLength;\n }\n else if (typeof input.size === 'number') {\n // handles browser File object\n return input.size;\n }\n return undefined;\n};\nexports.byteLength = byteLength;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAC7C,QAAQ,OAAO,CAAC;AAChB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACtC,QAAQ,OAAO,IAAI,CAAC,IAAI;AACxB,IAAI;AACJ,SAAS,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE;AACnD;AACA,QAAQ,OAAO,KAAK,CAAC,UAAU;AAC/B,IAAI;AACJ,SAAS,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;AAC7C;AACA,QAAQ,OAAO,KAAK,CAAC,IAAI;AACzB,IAAI;AACJ,IAAI,OAAO,SAAS;AACpB,CAAC;AACD,OAAO,CAAC,UAAU,GAAG,UAAU;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../src/providers/s3/apis/internal/uploadData/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.uploadData = void 0;\nconst utils_1 = require(\"../../../utils\");\nconst assertValidationError_1 = require(\"../../../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../../../errors/types/validation\");\nconst constants_1 = require(\"../../../utils/constants\");\nconst byteLength_1 = require(\"./byteLength\");\nconst putObjectJob_1 = require(\"./putObjectJob\");\nconst multipart_1 = require(\"./multipart\");\nconst uploadData = (input) => {\n const { data } = input;\n const dataByteLength = (0, byteLength_1.byteLength)(data);\n // Using InvalidUploadSource error code because the input data must NOT be any\n // of permitted Blob, string, ArrayBuffer(View) if byteLength could not be determined.\n (0, assertValidationError_1.assertValidationError)(dataByteLength !== undefined, validation_1.StorageValidationErrorCode.InvalidUploadSource);\n (0, assertValidationError_1.assertValidationError)(dataByteLength <= constants_1.MAX_OBJECT_SIZE, validation_1.StorageValidationErrorCode.ObjectIsTooLarge);\n if (dataByteLength <= constants_1.DEFAULT_PART_SIZE) {\n // Single part upload\n const abortController = new AbortController();\n return (0, utils_1.createUploadTask)({\n isMultipartUpload: false,\n job: (0, putObjectJob_1.putObjectJob)(input, abortController.signal, dataByteLength),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n }\n else {\n // Multipart upload\n const { multipartUploadJob, onPause, onResume, onCancel } = (0, multipart_1.getMultipartUploadHandlers)(input, dataByteLength);\n return (0, utils_1.createUploadTask)({\n isMultipartUpload: true,\n job: multipartUploadJob,\n onCancel: (message) => {\n onCancel(message);\n },\n onPause,\n onResume,\n });\n }\n};\nexports.uploadData = uploadData;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,uBAAuB,GAAG,OAAO,CAAC,mDAAmD,CAAC;AAC5F,MAAM,YAAY,GAAG,OAAO,CAAC,wCAAwC,CAAC;AACtE,MAAM,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC;AACvD,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK;AAC1B,IAAI,MAAM,cAAc,GAAG,IAAI,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC;AAC7D;AACA;AACA,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,cAAc,KAAK,SAAS,EAAE,YAAY,CAAC,0BAA0B,CAAC,mBAAmB,CAAC;AACjJ,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,cAAc,IAAI,WAAW,CAAC,eAAe,EAAE,YAAY,CAAC,0BAA0B,CAAC,gBAAgB,CAAC;AAC/J,IAAI,IAAI,cAAc,IAAI,WAAW,CAAC,iBAAiB,EAAE;AACzD;AACA,QAAQ,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE;AACrD,QAAQ,OAAO,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7C,YAAY,iBAAiB,EAAE,KAAK;AACpC,YAAY,GAAG,EAAE,IAAI,cAAc,CAAC,YAAY,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC;AAChG,YAAY,QAAQ,EAAE,CAAC,OAAO,KAAK;AACnC,gBAAgB,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../src/providers/s3/apis/internal/uploadData/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.uploadData = void 0;\nconst utils_1 = require(\"../../../utils\");\nconst assertValidationError_1 = require(\"../../../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../../../errors/types/validation\");\nconst constants_1 = require(\"../../../utils/constants\");\nconst byteLength_1 = require(\"./byteLength\");\nconst putObjectJob_1 = require(\"./putObjectJob\");\nconst multipart_1 = require(\"./multipart\");\nconst uploadData = (input) => {\n const { data } = input;\n const dataByteLength = (0, byteLength_1.byteLength)(data);\n // Using InvalidUploadSource error code because the input data must NOT be any\n // of permitted Blob, string, ArrayBuffer(View) if byteLength could not be determined.\n (0, assertValidationError_1.assertValidationError)(dataByteLength !== undefined, validation_1.StorageValidationErrorCode.InvalidUploadSource);\n (0, assertValidationError_1.assertValidationError)(dataByteLength <= constants_1.MAX_OBJECT_SIZE, validation_1.StorageValidationErrorCode.ObjectIsTooLarge);\n if (dataByteLength <= constants_1.DEFAULT_PART_SIZE) {\n // Single part upload\n const abortController = new AbortController();\n return (0, utils_1.createUploadTask)({\n isMultipartUpload: false,\n job: (0, putObjectJob_1.putObjectJob)(input, abortController.signal, dataByteLength),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n }\n else {\n // Multipart upload\n const { multipartUploadJob, onPause, onResume, onCancel } = (0, multipart_1.getMultipartUploadHandlers)(input, dataByteLength);\n return (0, utils_1.createUploadTask)({\n isMultipartUpload: true,\n job: multipartUploadJob,\n onCancel: (message) => {\n onCancel(message);\n },\n onPause,\n onResume,\n });\n }\n};\nexports.uploadData = uploadData;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,uBAAuB,GAAG,OAAO,CAAC,mDAAmD,CAAC;AAC5F,MAAM,YAAY,GAAG,OAAO,CAAC,wCAAwC,CAAC;AACtE,MAAM,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC;AACvD,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK;AAC1B,IAAI,MAAM,cAAc,GAAG,IAAI,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC;AAC7D;AACA;AACA,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,cAAc,KAAK,SAAS,EAAE,YAAY,CAAC,0BAA0B,CAAC,mBAAmB,CAAC;AACjJ,IAAI,IAAI,uBAAuB,CAAC,qBAAqB,EAAE,cAAc,IAAI,WAAW,CAAC,eAAe,EAAE,YAAY,CAAC,0BAA0B,CAAC,gBAAgB,CAAC;AAC/J,IAAI,IAAI,cAAc,IAAI,WAAW,CAAC,iBAAiB,EAAE;AACzD;AACA,QAAQ,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE;AACrD,QAAQ,OAAO,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7C,YAAY,iBAAiB,EAAE,KAAK;AACpC,YAAY,GAAG,EAAE,IAAI,cAAc,CAAC,YAAY,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC;AAChG,YAAY,QAAQ,EAAE,CAAC,OAAO,KAAK;AACnC,gBAAgB,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC;AAC9C,YAAY,CAAC;AACb,SAAS,CAAC;AACV,IAAI;AACJ,SAAS;AACT;AACA,QAAQ,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,WAAW,CAAC,0BAA0B,EAAE,KAAK,EAAE,cAAc,CAAC;AACtI,QAAQ,OAAO,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7C,YAAY,iBAAiB,EAAE,IAAI;AACnC,YAAY,GAAG,EAAE,kBAAkB;AACnC,YAAY,QAAQ,EAAE,CAAC,OAAO,KAAK;AACnC,gBAAgB,QAAQ,CAAC,OAAO,CAAC;AACjC,YAAY,CAAC;AACb,YAAY,OAAO;AACnB,YAAY,QAAQ;AACpB,SAAS,CAAC;AACV,IAAI;AACJ,CAAC;AACD,OAAO,CAAC,UAAU,GAAG,UAAU;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculatePartSize.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/calculatePartSize.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.calculatePartSize = void 0;\nconst constants_1 = require(\"../../../../utils/constants\");\nconst calculatePartSize = (totalSize) => {\n if (!totalSize) {\n return constants_1.DEFAULT_PART_SIZE;\n }\n let partSize = constants_1.DEFAULT_PART_SIZE;\n let partsCount = Math.ceil(totalSize / partSize);\n while (partsCount > constants_1.MAX_PARTS_COUNT) {\n partSize *= 2;\n partsCount = Math.ceil(totalSize / partSize);\n }\n return partSize;\n};\nexports.calculatePartSize = calculatePartSize;\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,WAAW,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC1D,MAAM,iBAAiB,GAAG,CAAC,SAAS,KAAK;AACzC,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,OAAO,WAAW,CAAC,iBAAiB;AAC5C;
|
|
1
|
+
{"version":3,"file":"calculatePartSize.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/calculatePartSize.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.calculatePartSize = void 0;\nconst constants_1 = require(\"../../../../utils/constants\");\nconst calculatePartSize = (totalSize) => {\n if (!totalSize) {\n return constants_1.DEFAULT_PART_SIZE;\n }\n let partSize = constants_1.DEFAULT_PART_SIZE;\n let partsCount = Math.ceil(totalSize / partSize);\n while (partsCount > constants_1.MAX_PARTS_COUNT) {\n partSize *= 2;\n partsCount = Math.ceil(totalSize / partSize);\n }\n return partSize;\n};\nexports.calculatePartSize = calculatePartSize;\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,WAAW,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC1D,MAAM,iBAAiB,GAAG,CAAC,SAAS,KAAK;AACzC,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,OAAO,WAAW,CAAC,iBAAiB;AAC5C,IAAI;AACJ,IAAI,IAAI,QAAQ,GAAG,WAAW,CAAC,iBAAiB;AAChD,IAAI,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;AACpD,IAAI,OAAO,UAAU,GAAG,WAAW,CAAC,eAAe,EAAE;AACrD,QAAQ,QAAQ,IAAI,CAAC;AACrB,QAAQ,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;AACpD,IAAI;AACJ,IAAI,OAAO,QAAQ;AACnB,CAAC;AACD,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDataChunker.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/getDataChunker.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.getDataChunker = void 0;\nconst validation_1 = require(\"../../../../../../errors/types/validation\");\nconst StorageError_1 = require(\"../../../../../../errors/StorageError\");\nconst calculatePartSize_1 = require(\"./calculatePartSize\");\nconst getDataChunker = (data, totalSize) => {\n const partSize = (0, calculatePartSize_1.calculatePartSize)(totalSize);\n if (data instanceof Blob) {\n return helper(data, 0, data.size, partSize);\n }\n else if (ArrayBuffer.isView(data)) {\n return helper(data.buffer, data.byteOffset, data.byteLength, partSize);\n }\n else if (data instanceof ArrayBuffer) {\n return helper(data, 0, data.byteLength, partSize);\n }\n else if (typeof data === 'string') {\n const blob = new Blob([data]);\n return (0, exports.getDataChunker)(blob, blob.size);\n }\n else {\n throw new StorageError_1.StorageError({\n name: validation_1.StorageValidationErrorCode.InvalidUploadSource,\n ...validation_1.validationErrorMap[validation_1.StorageValidationErrorCode.InvalidUploadSource],\n });\n }\n};\nexports.getDataChunker = getDataChunker;\nconst helper = function* (buffer, byteOffset, byteLength, partSize) {\n let partNumber = 1;\n let startByte = byteOffset;\n let endByte = byteOffset + Math.min(partSize, byteLength);\n while (endByte < byteLength + byteOffset) {\n yield {\n partNumber,\n data: buffer.slice(startByte, endByte),\n size: partSize,\n };\n partNumber += 1;\n startByte = endByte;\n endByte = startByte + partSize;\n }\n yield {\n partNumber,\n data: buffer.slice(startByte, byteLength + byteOffset),\n size: byteLength + byteOffset - startByte,\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,cAAc,GAAG,MAAM;AAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACzE,MAAM,cAAc,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACvE,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC1D,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK;AAC5C,IAAI,MAAM,QAAQ,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,SAAS,CAAC;AAC1E,IAAI,IAAI,IAAI,YAAY,IAAI,EAAE;AAC9B,QAAQ,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACnD;
|
|
1
|
+
{"version":3,"file":"getDataChunker.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/getDataChunker.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.getDataChunker = void 0;\nconst validation_1 = require(\"../../../../../../errors/types/validation\");\nconst StorageError_1 = require(\"../../../../../../errors/StorageError\");\nconst calculatePartSize_1 = require(\"./calculatePartSize\");\nconst getDataChunker = (data, totalSize) => {\n const partSize = (0, calculatePartSize_1.calculatePartSize)(totalSize);\n if (data instanceof Blob) {\n return helper(data, 0, data.size, partSize);\n }\n else if (ArrayBuffer.isView(data)) {\n return helper(data.buffer, data.byteOffset, data.byteLength, partSize);\n }\n else if (data instanceof ArrayBuffer) {\n return helper(data, 0, data.byteLength, partSize);\n }\n else if (typeof data === 'string') {\n const blob = new Blob([data]);\n return (0, exports.getDataChunker)(blob, blob.size);\n }\n else {\n throw new StorageError_1.StorageError({\n name: validation_1.StorageValidationErrorCode.InvalidUploadSource,\n ...validation_1.validationErrorMap[validation_1.StorageValidationErrorCode.InvalidUploadSource],\n });\n }\n};\nexports.getDataChunker = getDataChunker;\nconst helper = function* (buffer, byteOffset, byteLength, partSize) {\n let partNumber = 1;\n let startByte = byteOffset;\n let endByte = byteOffset + Math.min(partSize, byteLength);\n while (endByte < byteLength + byteOffset) {\n yield {\n partNumber,\n data: buffer.slice(startByte, endByte),\n size: partSize,\n };\n partNumber += 1;\n startByte = endByte;\n endByte = startByte + partSize;\n }\n yield {\n partNumber,\n data: buffer.slice(startByte, byteLength + byteOffset),\n size: byteLength + byteOffset - startByte,\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,cAAc,GAAG,MAAM;AAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,2CAA2C,CAAC;AACzE,MAAM,cAAc,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACvE,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC1D,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK;AAC5C,IAAI,MAAM,QAAQ,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,SAAS,CAAC;AAC1E,IAAI,IAAI,IAAI,YAAY,IAAI,EAAE;AAC9B,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AU,EAAE;AAC9C,QAAQ,MAAM;AACd,YAAY,UAAU;AACtB,YAAY,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;AAClD,YAAY,IAAI,EAAE,QAAQ;AAC1B,SAAS;AACT,QAAQ,UAAU,IAAI,CAAC;AACvB,QAAQ,SAAS,GAAG,OAAO;AAC3B,QAAQ,OAAO,GAAG,SAAS,GAAG,QAAQ;AACtC,IAAI;AACJ,IAAI,MAAM;AACV,QAAQ,UAAU;AAClB,QAAQ,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;AAC9D,QAAQ,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS;AACjD,KAAK;AACL,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/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.getMultipartUploadHandlers = void 0;\nvar uploadHandlers_1 = require(\"./uploadHandlers\");\nObject.defineProperty(exports, \"getMultipartUploadHandlers\", { enumerable: true, get: function () { return uploadHandlers_1.getMultipartUploadHandlers; } });\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,IAAI,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,gBAAgB,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/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.getMultipartUploadHandlers = void 0;\nvar uploadHandlers_1 = require(\"./uploadHandlers\");\nObject.defineProperty(exports, \"getMultipartUploadHandlers\", { enumerable: true, get: function () { return uploadHandlers_1.getMultipartUploadHandlers; } });\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,IAAI,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,gBAAgB,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialUpload.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/initialUpload.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.loadOrCreateMultipartUpload = void 0;\nconst s3data_1 = require(\"../../../../utils/client/s3data\");\nconst utils_1 = require(\"../../../../../../utils\");\nconst constructContentDisposition_1 = require(\"../../../../utils/constructContentDisposition\");\nconst constants_1 = require(\"../../../../utils/constants\");\nconst crc32_1 = require(\"../../../../utils/crc32\");\nconst uploadCache_1 = require(\"./uploadCache\");\n/**\n * Load the in-progress multipart upload from local storage or async storage(RN) if it exists, or create a new multipart\n * upload.\n *\n * @internal\n */\nconst loadOrCreateMultipartUpload = async ({ s3Config, data, size, contentType, bucket, accessLevel, keyPrefix, key, contentDisposition, contentEncoding, metadata, abortSignal, checksumAlgorithm, optionsHash, resumableUploadsCache, expectedBucketOwner, }) => {\n const finalKey = keyPrefix !== undefined ? keyPrefix + key : key;\n let cachedUpload;\n if (!resumableUploadsCache) {\n utils_1.logger.debug('uploaded cache instance cannot be determined, skipping cache.');\n cachedUpload = undefined;\n }\n else {\n const uploadCacheKey = (0, uploadCache_1.getUploadsCacheKey)({\n size,\n contentType,\n file: data instanceof File ? data : undefined,\n bucket,\n accessLevel,\n key,\n optionsHash,\n });\n const cachedUploadParts = await (0, uploadCache_1.findCachedUploadPartsAndEvictExpired)({\n s3Config,\n cacheKey: uploadCacheKey,\n bucket,\n finalKey,\n resumableUploadsCache,\n });\n cachedUpload = cachedUploadParts\n ? { ...cachedUploadParts, uploadCacheKey }\n : undefined;\n }\n if (cachedUpload) {\n return {\n uploadId: cachedUpload.uploadId,\n cachedParts: cachedUpload.parts,\n finalCrc32: cachedUpload.finalCrc32,\n };\n }\n else {\n /**\n * Note: This step reads the uploading file from beginning to end to calculate the CRC32 checksum of the entire\n * object before sending the 1st byte over the wire. This is a performance bottleneck when uploading large files.\n * The rationale to do this is S3 team wants to reduce the possibility of a file getting corrupted(on disk or in\n * memory). So we calculate the full-object checksum as soon as possible in the upload flow.\n *\n * Going forward we should re-evaluate this decision with S3 team. The alternative is calling calculateContentCRC32()\n * as we upload each part sequentially with seeds from already uploaded parts, ideally inside the data chunker.\n */\n const finalCrc32 = checksumAlgorithm === constants_1.CHECKSUM_ALGORITHM_CRC32\n ? await (0, crc32_1.calculateContentCRC32)(data)\n : undefined;\n const { UploadId } = await (0, s3data_1.createMultipartUpload)({\n ...s3Config,\n abortSignal,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ContentType: contentType,\n ContentDisposition: (0, constructContentDisposition_1.constructContentDisposition)(contentDisposition),\n ContentEncoding: contentEncoding,\n Metadata: metadata,\n ChecksumAlgorithm: finalCrc32 ? 'CRC32' : undefined,\n ChecksumType: finalCrc32 ? 'FULL_OBJECT' : undefined,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n if (resumableUploadsCache) {\n const uploadCacheKey = (0, uploadCache_1.getUploadsCacheKey)({\n size,\n contentType,\n file: data instanceof File ? data : undefined,\n bucket,\n accessLevel,\n key,\n optionsHash,\n });\n await (0, uploadCache_1.cacheMultipartUpload)(resumableUploadsCache, uploadCacheKey, {\n uploadId: UploadId,\n bucket,\n key,\n finalCrc32,\n fileName: data instanceof File ? data.name : '',\n });\n }\n return {\n uploadId: UploadId,\n cachedParts: [],\n finalCrc32,\n };\n }\n};\nexports.loadOrCreateMultipartUpload = loadOrCreateMultipartUpload;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,2BAA2B,GAAG,MAAM;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAClD,MAAM,6BAA6B,GAAG,OAAO,CAAC,+CAA+C,CAAC;AAC9F,MAAM,WAAW,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAClD,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,2BAA2B,GAAG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,mBAAmB,GAAG,KAAK;AACnQ,IAAI,MAAM,QAAQ,GAAG,SAAS,KAAK,SAAS,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG;AACpE,IAAI,IAAI,YAAY;AACpB,IAAI,IAAI,CAAC,qBAAqB,EAAE;AAChC,QAAQ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+DAA+D,CAAC;AAC7F,QAAQ,YAAY,GAAG,SAAS;AAChC;
|
|
1
|
+
{"version":3,"file":"initialUpload.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/initialUpload.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.loadOrCreateMultipartUpload = void 0;\nconst s3data_1 = require(\"../../../../utils/client/s3data\");\nconst utils_1 = require(\"../../../../../../utils\");\nconst constructContentDisposition_1 = require(\"../../../../utils/constructContentDisposition\");\nconst constants_1 = require(\"../../../../utils/constants\");\nconst crc32_1 = require(\"../../../../utils/crc32\");\nconst uploadCache_1 = require(\"./uploadCache\");\n/**\n * Load the in-progress multipart upload from local storage or async storage(RN) if it exists, or create a new multipart\n * upload.\n *\n * @internal\n */\nconst loadOrCreateMultipartUpload = async ({ s3Config, data, size, contentType, bucket, accessLevel, keyPrefix, key, contentDisposition, contentEncoding, metadata, abortSignal, checksumAlgorithm, optionsHash, resumableUploadsCache, expectedBucketOwner, }) => {\n const finalKey = keyPrefix !== undefined ? keyPrefix + key : key;\n let cachedUpload;\n if (!resumableUploadsCache) {\n utils_1.logger.debug('uploaded cache instance cannot be determined, skipping cache.');\n cachedUpload = undefined;\n }\n else {\n const uploadCacheKey = (0, uploadCache_1.getUploadsCacheKey)({\n size,\n contentType,\n file: data instanceof File ? data : undefined,\n bucket,\n accessLevel,\n key,\n optionsHash,\n });\n const cachedUploadParts = await (0, uploadCache_1.findCachedUploadPartsAndEvictExpired)({\n s3Config,\n cacheKey: uploadCacheKey,\n bucket,\n finalKey,\n resumableUploadsCache,\n });\n cachedUpload = cachedUploadParts\n ? { ...cachedUploadParts, uploadCacheKey }\n : undefined;\n }\n if (cachedUpload) {\n return {\n uploadId: cachedUpload.uploadId,\n cachedParts: cachedUpload.parts,\n finalCrc32: cachedUpload.finalCrc32,\n };\n }\n else {\n /**\n * Note: This step reads the uploading file from beginning to end to calculate the CRC32 checksum of the entire\n * object before sending the 1st byte over the wire. This is a performance bottleneck when uploading large files.\n * The rationale to do this is S3 team wants to reduce the possibility of a file getting corrupted(on disk or in\n * memory). So we calculate the full-object checksum as soon as possible in the upload flow.\n *\n * Going forward we should re-evaluate this decision with S3 team. The alternative is calling calculateContentCRC32()\n * as we upload each part sequentially with seeds from already uploaded parts, ideally inside the data chunker.\n */\n const finalCrc32 = checksumAlgorithm === constants_1.CHECKSUM_ALGORITHM_CRC32\n ? await (0, crc32_1.calculateContentCRC32)(data)\n : undefined;\n const { UploadId } = await (0, s3data_1.createMultipartUpload)({\n ...s3Config,\n abortSignal,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ContentType: contentType,\n ContentDisposition: (0, constructContentDisposition_1.constructContentDisposition)(contentDisposition),\n ContentEncoding: contentEncoding,\n Metadata: metadata,\n ChecksumAlgorithm: finalCrc32 ? 'CRC32' : undefined,\n ChecksumType: finalCrc32 ? 'FULL_OBJECT' : undefined,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n if (resumableUploadsCache) {\n const uploadCacheKey = (0, uploadCache_1.getUploadsCacheKey)({\n size,\n contentType,\n file: data instanceof File ? data : undefined,\n bucket,\n accessLevel,\n key,\n optionsHash,\n });\n await (0, uploadCache_1.cacheMultipartUpload)(resumableUploadsCache, uploadCacheKey, {\n uploadId: UploadId,\n bucket,\n key,\n finalCrc32,\n fileName: data instanceof File ? data.name : '',\n });\n }\n return {\n uploadId: UploadId,\n cachedParts: [],\n finalCrc32,\n };\n }\n};\nexports.loadOrCreateMultipartUpload = loadOrCreateMultipartUpload;\n"],"names":[],"mappings":";;AACA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,SAAS,CAAC;AACV,QAAQ,IAAI,qBAAqB,EAAE;AACnC,YAAY,MAAM,cAAc,GAAG,IAAI,aAAa,CAAC,kBAAkB,EAAE;AACzE,gBAAgB,IAAI;AACpB,gBAAgB,WAAW;AAC3B,gBAAgB,IAAI,EAAE,IAAI,YAAY,IAAI,GAAG,IAAI,GAAG,SAAS;AAC7D,gBAAgB,MAAM;AACtB,gBAAgB,WAAW;AAC3B,gBAAgB,GAAG;AACnB,gBAAgB,WAAW;AAC3B,aAAa,CAAC;AACd,YAAY,MAAM,IAAI,aAAa,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,EAAE;AACjG,gBAAgB,QAAQ,EAAE,QAAQ;AAClC,gBAAgB,MAAM;AACtB,gBAAgB,GAAG;AACnB,gBAAgB,UAAU;AAC1B,gBAAgB,QAAQ,EAAE,IAAI,YAAY,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,EAAE;AAC/D,aAAa,CAAC;AACd,QAAQ;AACR,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,QAAQ;AAC9B,YAAY,WAAW,EAAE,EAAE;AAC3B,YAAY,UAAU;AACtB,SAAS;AACT,IAAI;AACJ,CAAC;AACD,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressTracker.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/progressTracker.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.getConcurrentUploadsProgressTracker = void 0;\n/**\n * Track the progress from multiple concurrent uploads, and invoke the onProgress callback.\n *\n * @internal\n */\nconst getConcurrentUploadsProgressTracker = ({ size, onProgress, }) => {\n const transferredBytesPerListener = [];\n const getTransferredBytes = () => transferredBytesPerListener.reduce((acc, transferredBytes) => acc + transferredBytes, 0);\n return {\n getOnProgressListener: () => {\n transferredBytesPerListener.push(0);\n const listenerIndex = transferredBytesPerListener.length - 1;\n return (event) => {\n const { transferredBytes } = event;\n transferredBytesPerListener[listenerIndex] = transferredBytes;\n onProgress?.({\n transferredBytes: getTransferredBytes(),\n totalBytes: size,\n });\n };\n },\n };\n};\nexports.getConcurrentUploadsProgressTracker = getConcurrentUploadsProgressTracker;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mCAAmC,GAAG,MAAM;AACpD;AACA;AACA;AACA;AACA;AACA,MAAM,mCAAmC,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK;AACvE,IAAI,MAAM,2BAA2B,GAAG,EAAE;AAC1C,IAAI,MAAM,mBAAmB,GAAG,MAAM,2BAA2B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,GAAG,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAC9H,IAAI,OAAO;AACX,QAAQ,qBAAqB,EAAE,MAAM;AACrC,YAAY,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,YAAY,MAAM,aAAa,GAAG,2BAA2B,CAAC,MAAM,GAAG,CAAC;AACxE,YAAY,OAAO,CAAC,KAAK,KAAK;AAC9B,gBAAgB,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK;AAClD,gBAAgB,2BAA2B,CAAC,aAAa,CAAC,GAAG,gBAAgB;AAC7E,gBAAgB,UAAU,GAAG;AAC7B,oBAAoB,gBAAgB,EAAE,mBAAmB,EAAE;AAC3D,oBAAoB,UAAU,EAAE,IAAI;AACpC,iBAAiB,CAAC;AAClB,
|
|
1
|
+
{"version":3,"file":"progressTracker.js","sources":["../../../../../../../../src/providers/s3/apis/internal/uploadData/multipart/progressTracker.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.getConcurrentUploadsProgressTracker = void 0;\n/**\n * Track the progress from multiple concurrent uploads, and invoke the onProgress callback.\n *\n * @internal\n */\nconst getConcurrentUploadsProgressTracker = ({ size, onProgress, }) => {\n const transferredBytesPerListener = [];\n const getTransferredBytes = () => transferredBytesPerListener.reduce((acc, transferredBytes) => acc + transferredBytes, 0);\n return {\n getOnProgressListener: () => {\n transferredBytesPerListener.push(0);\n const listenerIndex = transferredBytesPerListener.length - 1;\n return (event) => {\n const { transferredBytes } = event;\n transferredBytesPerListener[listenerIndex] = transferredBytes;\n onProgress?.({\n transferredBytes: getTransferredBytes(),\n totalBytes: size,\n });\n };\n },\n };\n};\nexports.getConcurrentUploadsProgressTracker = getConcurrentUploadsProgressTracker;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mCAAmC,GAAG,MAAM;AACpD;AACA;AACA;AACA;AACA;AACA,MAAM,mCAAmC,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK;AACvE,IAAI,MAAM,2BAA2B,GAAG,EAAE;AAC1C,IAAI,MAAM,mBAAmB,GAAG,MAAM,2BAA2B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,GAAG,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAC9H,IAAI,OAAO;AACX,QAAQ,qBAAqB,EAAE,MAAM;AACrC,YAAY,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,YAAY,MAAM,aAAa,GAAG,2BAA2B,CAAC,MAAM,GAAG,CAAC;AACxE,YAAY,OAAO,CAAC,KAAK,KAAK;AAC9B,gBAAgB,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK;AAClD,gBAAgB,2BAA2B,CAAC,aAAa,CAAC,GAAG,gBAAgB;AAC7E,gBAAgB,UAAU,GAAG;AAC7B,oBAAoB,gBAAgB,EAAE,mBAAmB,EAAE;AAC3D,oBAAoB,UAAU,EAAE,IAAI;AACpC,iBAAiB,CAAC;AAClB,YAAY,CAAC;AACb,QAAQ,CAAC;AACT,KAAK;AACL,CAAC;AACD,OAAO,CAAC,mCAAmC,GAAG,mCAAmC;;"}
|