@aws-amplify/storage 6.0.5 → 6.0.6-unstable.8ca7c15.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/providers/s3/utils/client/utils/serializeHelpers.js +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/serializeHelpers.js.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/serializeHelpers.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/utils/serializeHelpers.mjs.map +1 -1
- package/package.json +110 -163
- package/src/providers/s3/utils/client/utils/parsePayload.ts +2 -2
- package/src/providers/s3/utils/client/utils/serializeHelpers.ts +1 -1
- package/src/types/inputs.ts +2 -2
|
@@ -59,7 +59,7 @@ function validateS3RequiredParameter(assertion, paramName) {
|
|
|
59
59
|
if (!assertion) {
|
|
60
60
|
throw new StorageError_1.StorageError({
|
|
61
61
|
name: utils_1.AmplifyErrorCode.Unknown,
|
|
62
|
-
message: 'An unknown error has
|
|
62
|
+
message: 'An unknown error has occurred.',
|
|
63
63
|
underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),
|
|
64
64
|
recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',
|
|
65
65
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeHelpers.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/serializeHelpers.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateS3RequiredParameter = exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst StorageError_1 = require(\"../../../../../errors/StorageError\");\n/**\n * @internal\n */\nconst assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\nexports.assignStringVariables = assignStringVariables;\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nconst serializeObjectConfigsToHeaders = async (input) => ({\n ...(0, exports.assignStringVariables)({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nexports.serializeObjectConfigsToHeaders = serializeObjectConfigsToHeaders;\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nconst serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(aws_client_utils_1.extendedEncodeURIComponent).join('/')}`);\n};\nexports.serializePathnameObjectKey = serializePathnameObjectKey;\nfunction validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError_1.StorageError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has
|
|
1
|
+
{"version":3,"file":"serializeHelpers.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/serializeHelpers.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateS3RequiredParameter = exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst StorageError_1 = require(\"../../../../../errors/StorageError\");\n/**\n * @internal\n */\nconst assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\nexports.assignStringVariables = assignStringVariables;\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nconst serializeObjectConfigsToHeaders = async (input) => ({\n ...(0, exports.assignStringVariables)({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nexports.serializeObjectConfigsToHeaders = serializeObjectConfigsToHeaders;\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nconst serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(aws_client_utils_1.extendedEncodeURIComponent).join('/')}`);\n};\nexports.serializePathnameObjectKey = serializePathnameObjectKey;\nfunction validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError_1.StorageError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n}\nexports.validateS3RequiredParameter = validateS3RequiredParameter;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,+BAA+B,GAAG,OAAO,CAAC,qBAAqB,GAAG,KAAK,CAAC,CAAC;AAC5J;AACA;AACA,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;AACnF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,cAAc,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AACrE;AACA;AACA;AACA,MAAM,qBAAqB,GAAG,CAAC,MAAM,KAAK;AAC1C,IAAI,MAAM,WAAW,GAAG,EAAE,CAAC;AAC3B,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACvD,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;AAChD,SAAS;AACT,KAAK;AACL,IAAI,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AACF,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,+BAA+B,GAAG,OAAO,KAAK,MAAM;AAC1D,IAAI,GAAG,IAAI,OAAO,CAAC,qBAAqB,EAAE;AAC1C,QAAQ,WAAW,EAAE,KAAK,CAAC,GAAG;AAC9B,QAAQ,eAAe,EAAE,KAAK,CAAC,YAAY;AAC3C,QAAQ,qBAAqB,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,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC;AAC9C,YAAY,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO;AAClD,YAAY,OAAO,EAAE,gCAAgC;AACrD,YAAY,eAAe,EAAE,IAAI,SAAS,CAAC,CAAC,2CAA2C,EAAE,SAAS,CAAC,CAAC,CAAC;AACrG,YAAY,kBAAkB,EAAE,kEAAkE;AAClG,SAAS,CAAC,CAAC;AACX,KAAK;AACL,CAAC;AACD,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;;"}
|
|
@@ -53,7 +53,7 @@ function validateS3RequiredParameter(assertion, paramName) {
|
|
|
53
53
|
if (!assertion) {
|
|
54
54
|
throw new StorageError({
|
|
55
55
|
name: AmplifyErrorCode.Unknown,
|
|
56
|
-
message: 'An unknown error has
|
|
56
|
+
message: 'An unknown error has occurred.',
|
|
57
57
|
underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),
|
|
58
58
|
recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',
|
|
59
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeHelpers.mjs","sources":["../../../../../../../src/providers/s3/utils/client/utils/serializeHelpers.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { extendedEncodeURIComponent } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from '../../../../../errors/StorageError';\n/**\n * @internal\n */\nexport const assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nexport const serializeObjectConfigsToHeaders = async (input) => ({\n ...assignStringVariables({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nexport const serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(extendedEncodeURIComponent).join('/')}`);\n};\nexport function validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError({\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has
|
|
1
|
+
{"version":3,"file":"serializeHelpers.mjs","sources":["../../../../../../../src/providers/s3/utils/client/utils/serializeHelpers.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { extendedEncodeURIComponent } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from '../../../../../errors/StorageError';\n/**\n * @internal\n */\nexport const assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nexport const serializeObjectConfigsToHeaders = async (input) => ({\n ...assignStringVariables({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nexport const serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(extendedEncodeURIComponent).join('/')}`);\n};\nexport function validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError({\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIA;AACA;AACA;AACY,MAAC,qBAAqB,GAAG,CAAC,MAAM,KAAK;AACjD,IAAI,MAAM,WAAW,GAAG,EAAE,CAAC;AAC3B,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACvD,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;AAChD,SAAS;AACT,KAAK;AACL,IAAI,OAAO,WAAW,CAAC;AACvB,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,+BAA+B,GAAG,OAAO,KAAK,MAAM;AACjE,IAAI,GAAG,qBAAqB,CAAC;AAC7B,QAA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78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"globals": {
|
|
113
|
-
"ts-jest": {
|
|
114
|
-
"diagnostics": {
|
|
115
|
-
"pathRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$"
|
|
116
|
-
},
|
|
117
|
-
"tsConfig": {
|
|
118
|
-
"downlevelIteration": true,
|
|
119
|
-
"allowJs": true,
|
|
120
|
-
"types": [
|
|
121
|
-
"@types/jest"
|
|
122
|
-
],
|
|
123
|
-
"outDir": "./tsconfig.json",
|
|
124
|
-
"noEmitOnError": false,
|
|
125
|
-
"noImplicitAny": false,
|
|
126
|
-
"skipLibCheck": true
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"transform": {
|
|
131
|
-
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
|
|
132
|
-
},
|
|
133
|
-
"testRegex": "(/__tests__/.*|\\.test|spec)\\.(tsx?|jsx?)$",
|
|
134
|
-
"testPathIgnorePatterns": [
|
|
135
|
-
"xmlParser-fixture.ts",
|
|
136
|
-
"testUtils",
|
|
137
|
-
"cases"
|
|
138
|
-
],
|
|
139
|
-
"modulePathIgnorePatterns": [
|
|
140
|
-
"dist"
|
|
141
|
-
],
|
|
142
|
-
"moduleFileExtensions": [
|
|
143
|
-
"ts",
|
|
144
|
-
"tsx",
|
|
145
|
-
"js",
|
|
146
|
-
"json",
|
|
147
|
-
"jsx"
|
|
148
|
-
],
|
|
149
|
-
"testEnvironment": "jsdom",
|
|
150
|
-
"testURL": "http://localhost/",
|
|
151
|
-
"coverageThreshold": {
|
|
152
|
-
"global": {
|
|
153
|
-
"branches": 0,
|
|
154
|
-
"functions": 0,
|
|
155
|
-
"lines": 0,
|
|
156
|
-
"statements": 0
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
"coveragePathIgnorePatterns": [
|
|
160
|
-
"/node_modules/",
|
|
161
|
-
"dist"
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
"gitHead": "1c545f4a0c111245a66d489aeb01a0c0f78cf7cb"
|
|
2
|
+
"name": "@aws-amplify/storage",
|
|
3
|
+
"version": "6.0.6-unstable.8ca7c15.0+8ca7c15",
|
|
4
|
+
"description": "Storage category of aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"react-native": {
|
|
8
|
+
"./dist/cjs/index": "./src/index.ts",
|
|
9
|
+
"fast-xml-parser": "fast-xml-parser",
|
|
10
|
+
"buffer": "buffer"
|
|
11
|
+
},
|
|
12
|
+
"typings": "./dist/esm/index.d.ts",
|
|
13
|
+
"browser": {
|
|
14
|
+
"./dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs": "./dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs",
|
|
15
|
+
"./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs": "./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs",
|
|
16
|
+
"./dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs": "./dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs",
|
|
17
|
+
"fast-xml-parser": false,
|
|
18
|
+
"buffer": false
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "npm run lint && jest -w 1 --coverage",
|
|
26
|
+
"build-with-test": "npm test && npm run build",
|
|
27
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
28
|
+
"build:esm-cjs": "rollup -c rollup.config.mjs",
|
|
29
|
+
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
|
|
30
|
+
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
|
|
31
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
32
|
+
"clean": "npm run clean:size && rimraf lib-esm lib dist",
|
|
33
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
34
|
+
"format": "echo \"Not implemented\"",
|
|
35
|
+
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
|
|
36
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
|
|
37
|
+
},
|
|
38
|
+
"typesVersions": {
|
|
39
|
+
">=4.2": {
|
|
40
|
+
"s3": [
|
|
41
|
+
"./dist/esm/providers/s3/index.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"server": [
|
|
44
|
+
"./dist/esm/server.d.ts"
|
|
45
|
+
],
|
|
46
|
+
"s3/server": [
|
|
47
|
+
"./dist/esm/providers/s3/server.d.ts"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
54
|
+
},
|
|
55
|
+
"author": "Amazon Web Services",
|
|
56
|
+
"license": "Apache-2.0",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
61
|
+
"files": [
|
|
62
|
+
"dist/cjs",
|
|
63
|
+
"dist/esm",
|
|
64
|
+
"src",
|
|
65
|
+
"server",
|
|
66
|
+
"s3"
|
|
67
|
+
],
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@aws-sdk/types": "3.398.0",
|
|
70
|
+
"@smithy/md5-js": "2.0.7",
|
|
71
|
+
"buffer": "4.9.2",
|
|
72
|
+
"fast-xml-parser": "^4.2.5",
|
|
73
|
+
"tslib": "^2.5.0"
|
|
74
|
+
},
|
|
75
|
+
"exports": {
|
|
76
|
+
".": {
|
|
77
|
+
"types": "./dist/esm/index.d.ts",
|
|
78
|
+
"import": "./dist/esm/index.mjs",
|
|
79
|
+
"require": "./dist/cjs/index.js",
|
|
80
|
+
"react-native": "./src/index.ts"
|
|
81
|
+
},
|
|
82
|
+
"./server": {
|
|
83
|
+
"types": "./dist/esm/server.d.ts",
|
|
84
|
+
"import": "./dist/esm/server.mjs",
|
|
85
|
+
"require": "./dist/cjs/server.js"
|
|
86
|
+
},
|
|
87
|
+
"./s3": {
|
|
88
|
+
"types": "./dist/esm/providers/s3/index.d.ts",
|
|
89
|
+
"import": "./dist/esm/providers/s3/index.mjs",
|
|
90
|
+
"require": "./dist/cjs/providers/s3/index.js",
|
|
91
|
+
"react-native": "./src/providers/s3/index.ts"
|
|
92
|
+
},
|
|
93
|
+
"./s3/server": {
|
|
94
|
+
"types": "./dist/esm/providers/s3/server.d.ts",
|
|
95
|
+
"import": "./dist/esm/providers/s3/server.mjs",
|
|
96
|
+
"require": "./dist/cjs/providers/s3/server.js"
|
|
97
|
+
},
|
|
98
|
+
"./package.json": "./package.json"
|
|
99
|
+
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@aws-amplify/core": "6.0.6-unstable.8ca7c15.0+8ca7c15"
|
|
102
|
+
},
|
|
103
|
+
"devDependencies": {
|
|
104
|
+
"@aws-amplify/core": "6.0.6-unstable.8ca7c15.0+8ca7c15",
|
|
105
|
+
"@aws-amplify/react-native": "1.0.6-unstable.8ca7c15.0+8ca7c15",
|
|
106
|
+
"@rollup/plugin-json": "6.0.1",
|
|
107
|
+
"@rollup/plugin-typescript": "11.1.5",
|
|
108
|
+
"rollup": "3.29.4",
|
|
109
|
+
"typescript": "5.0.2"
|
|
110
|
+
},
|
|
111
|
+
"gitHead": "8ca7c15fe7f425b2a43821ea46778328d9860188"
|
|
165
112
|
}
|
|
@@ -18,8 +18,8 @@ export const parseXmlError: ErrorParser = async (response?: HttpResponse) => {
|
|
|
18
18
|
const code = body?.['Code']
|
|
19
19
|
? (body.Code as string)
|
|
20
20
|
: statusCode === 404
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
? 'NotFound'
|
|
22
|
+
: statusCode.toString();
|
|
23
23
|
const message = body?.['message'] ?? body?.['Message'] ?? code;
|
|
24
24
|
const error = new Error(message);
|
|
25
25
|
return Object.assign(error, {
|
|
@@ -82,7 +82,7 @@ export function validateS3RequiredParameter(
|
|
|
82
82
|
if (!assertion) {
|
|
83
83
|
throw new StorageError({
|
|
84
84
|
name: AmplifyErrorCode.Unknown,
|
|
85
|
-
message: 'An unknown error has
|
|
85
|
+
message: 'An unknown error has occurred.',
|
|
86
86
|
underlyingError: new TypeError(
|
|
87
87
|
`Expected a non-null value for S3 parameter ${paramName}`
|
|
88
88
|
),
|
package/src/types/inputs.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type StorageRemoveInput<Options extends StorageOptions> = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export type StorageListInput<
|
|
24
|
-
Options extends StorageListAllOptions | StorageListPaginateOptions
|
|
24
|
+
Options extends StorageListAllOptions | StorageListPaginateOptions,
|
|
25
25
|
> = {
|
|
26
26
|
prefix?: string;
|
|
27
27
|
options?: Options;
|
|
@@ -40,7 +40,7 @@ export type StorageUploadDataInput<Options extends StorageOptions> =
|
|
|
40
40
|
|
|
41
41
|
export type StorageCopyInput<
|
|
42
42
|
SourceOptions extends StorageOptions,
|
|
43
|
-
DestinationOptions extends StorageOptions
|
|
43
|
+
DestinationOptions extends StorageOptions,
|
|
44
44
|
> = {
|
|
45
45
|
source: SourceOptions;
|
|
46
46
|
destination: DestinationOptions;
|