@aws-amplify/storage 5.6.3 → 5.6.4-api-v6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AwsClients/S3/abortMultipartUpload.d.ts +21 -0
- package/lib/AwsClients/S3/abortMultipartUpload.js +85 -0
- package/lib/AwsClients/S3/base.d.ts +54 -0
- package/lib/AwsClients/S3/base.js +75 -0
- package/lib/AwsClients/S3/completeMultipartUpload.d.ts +20 -0
- package/lib/AwsClients/S3/completeMultipartUpload.js +162 -0
- package/lib/AwsClients/S3/copyObject.d.ts +24 -0
- package/lib/AwsClients/S3/copyObject.js +98 -0
- package/lib/AwsClients/S3/createMultipartUpload.d.ts +21 -0
- package/lib/AwsClients/S3/createMultipartUpload.js +95 -0
- package/lib/AwsClients/S3/deleteObject.d.ts +20 -0
- package/lib/AwsClients/S3/deleteObject.js +86 -0
- package/lib/AwsClients/S3/getObject.d.ts +27 -0
- package/lib/AwsClients/S3/getObject.js +216 -0
- package/lib/AwsClients/S3/headObject.d.ts +20 -0
- package/lib/AwsClients/S3/headObject.js +96 -0
- package/lib/AwsClients/S3/index.d.ts +13 -0
- package/lib/AwsClients/S3/index.js +30 -0
- package/lib/AwsClients/S3/index.native.d.ts +14 -0
- package/lib/AwsClients/S3/index.native.js +31 -0
- package/lib/AwsClients/S3/listObjectsV2.d.ts +20 -0
- package/lib/AwsClients/S3/listObjectsV2.js +146 -0
- package/lib/AwsClients/S3/listParts.d.ts +20 -0
- package/lib/AwsClients/S3/listParts.js +110 -0
- package/lib/AwsClients/S3/putObject.d.ts +23 -0
- package/lib/AwsClients/S3/putObject.js +93 -0
- package/lib/AwsClients/S3/runtime/base64/index.browser.d.ts +2 -0
- package/lib/AwsClients/S3/runtime/base64/index.browser.js +20 -0
- package/lib/AwsClients/S3/runtime/base64/index.native.d.ts +2 -0
- package/lib/AwsClients/S3/runtime/base64/index.native.js +17 -0
- package/lib/AwsClients/S3/runtime/constants.d.ts +9 -0
- package/lib/AwsClients/S3/runtime/constants.js +14 -0
- package/lib/AwsClients/S3/runtime/contentSha256middleware.d.ts +9 -0
- package/lib/AwsClients/S3/runtime/contentSha256middleware.js +70 -0
- package/lib/AwsClients/S3/runtime/index.browser.d.ts +5 -0
- package/lib/AwsClients/S3/runtime/index.browser.js +20 -0
- package/lib/AwsClients/S3/runtime/index.d.ts +5 -0
- package/lib/AwsClients/S3/runtime/index.js +21 -0
- package/lib/AwsClients/S3/runtime/index.native.d.ts +5 -0
- package/lib/AwsClients/S3/runtime/index.native.js +20 -0
- package/lib/AwsClients/S3/runtime/s3TransferHandler/fetch.d.ts +8 -0
- package/lib/AwsClients/S3/runtime/s3TransferHandler/fetch.js +15 -0
- package/lib/AwsClients/S3/runtime/s3TransferHandler/xhr.d.ts +8 -0
- package/lib/AwsClients/S3/runtime/s3TransferHandler/xhr.js +21 -0
- package/lib/AwsClients/S3/runtime/xhrTransferHandler.d.ts +22 -0
- package/lib/AwsClients/S3/runtime/xhrTransferHandler.js +201 -0
- package/lib/AwsClients/S3/runtime/xmlParser/dom.d.ts +8 -0
- package/lib/AwsClients/S3/runtime/xmlParser/dom.js +92 -0
- package/lib/AwsClients/S3/runtime/xmlParser/pureJs.d.ts +10 -0
- package/lib/AwsClients/S3/runtime/xmlParser/pureJs.js +57 -0
- package/lib/AwsClients/S3/types.d.ts +2857 -0
- package/lib/AwsClients/S3/types.js +4 -0
- package/lib/AwsClients/S3/uploadPart.d.ts +20 -0
- package/lib/AwsClients/S3/uploadPart.js +96 -0
- package/lib/AwsClients/S3/utils/deserializeHelpers.d.ts +78 -0
- package/lib/AwsClients/S3/utils/deserializeHelpers.js +153 -0
- package/lib/AwsClients/S3/utils/index.d.ts +5 -0
- package/lib/AwsClients/S3/utils/index.js +30 -0
- package/lib/AwsClients/S3/utils/parsePayload.d.ts +3 -0
- package/lib/AwsClients/S3/utils/parsePayload.js +96 -0
- package/lib/AwsClients/S3/utils/serializeHelpers.d.ts +42 -0
- package/lib/AwsClients/S3/utils/serializeHelpers.js +183 -0
- package/lib/Storage.d.ts +5 -5
- package/lib/Storage.js +60 -31
- package/lib/common/S3ClientUtils.d.ts +24 -15
- package/lib/common/S3ClientUtils.js +83 -95
- package/lib/common/StorageConstants.d.ts +0 -1
- package/lib/common/StorageConstants.js +3 -2
- package/lib/common/StorageErrorStrings.js +3 -1
- package/lib/common/StorageUtils.js +12 -6
- package/lib/index.js +19 -4
- package/lib/providers/AWSS3Provider.d.ts +4 -8
- package/lib/providers/AWSS3Provider.js +210 -139
- package/lib/providers/AWSS3ProviderManagedUpload.d.ts +7 -7
- package/lib/providers/AWSS3ProviderManagedUpload.js +184 -98
- package/lib/providers/AWSS3UploadTask.d.ts +8 -8
- package/lib/providers/AWSS3UploadTask.js +226 -129
- package/lib/providers/index.js +4 -2
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/AWSS3Provider.d.ts +62 -62
- package/lib/types/AWSS3Provider.js +0 -1
- package/lib/types/Provider.d.ts +1 -1
- package/lib/types/Provider.js +2 -1
- package/lib/types/Storage.d.ts +23 -23
- package/lib/types/Storage.js +0 -1
- package/lib/types/index.js +17 -1
- package/lib-esm/AwsClients/S3/abortMultipartUpload.d.ts +21 -0
- package/lib-esm/AwsClients/S3/abortMultipartUpload.js +82 -0
- package/lib-esm/AwsClients/S3/base.d.ts +54 -0
- package/lib-esm/AwsClients/S3/base.js +71 -0
- package/lib-esm/AwsClients/S3/completeMultipartUpload.d.ts +20 -0
- package/lib-esm/AwsClients/S3/completeMultipartUpload.js +159 -0
- package/lib-esm/AwsClients/S3/copyObject.d.ts +24 -0
- package/lib-esm/AwsClients/S3/copyObject.js +95 -0
- package/lib-esm/AwsClients/S3/createMultipartUpload.d.ts +21 -0
- package/lib-esm/AwsClients/S3/createMultipartUpload.js +92 -0
- package/lib-esm/AwsClients/S3/deleteObject.d.ts +20 -0
- package/lib-esm/AwsClients/S3/deleteObject.js +83 -0
- package/lib-esm/AwsClients/S3/getObject.d.ts +27 -0
- package/lib-esm/AwsClients/S3/getObject.js +212 -0
- package/lib-esm/AwsClients/S3/headObject.d.ts +20 -0
- package/lib-esm/AwsClients/S3/headObject.js +93 -0
- package/lib-esm/AwsClients/S3/index.d.ts +13 -0
- package/lib-esm/AwsClients/S3/index.js +14 -0
- package/lib-esm/AwsClients/S3/index.native.d.ts +14 -0
- package/lib-esm/AwsClients/S3/index.native.js +15 -0
- package/lib-esm/AwsClients/S3/listObjectsV2.d.ts +20 -0
- package/lib-esm/AwsClients/S3/listObjectsV2.js +143 -0
- package/lib-esm/AwsClients/S3/listParts.d.ts +20 -0
- package/lib-esm/AwsClients/S3/listParts.js +107 -0
- package/lib-esm/AwsClients/S3/putObject.d.ts +23 -0
- package/lib-esm/AwsClients/S3/putObject.js +90 -0
- package/lib-esm/AwsClients/S3/runtime/base64/index.browser.d.ts +2 -0
- package/lib-esm/AwsClients/S3/runtime/base64/index.browser.js +15 -0
- package/lib-esm/AwsClients/S3/runtime/base64/index.native.d.ts +2 -0
- package/lib-esm/AwsClients/S3/runtime/base64/index.native.js +12 -0
- package/lib-esm/AwsClients/S3/runtime/constants.d.ts +9 -0
- package/lib-esm/AwsClients/S3/runtime/constants.js +11 -0
- package/lib-esm/AwsClients/S3/runtime/contentSha256middleware.d.ts +9 -0
- package/lib-esm/AwsClients/S3/runtime/contentSha256middleware.js +66 -0
- package/lib-esm/AwsClients/S3/runtime/index.browser.d.ts +5 -0
- package/lib-esm/AwsClients/S3/runtime/index.browser.js +8 -0
- package/lib-esm/AwsClients/S3/runtime/index.d.ts +5 -0
- package/lib-esm/AwsClients/S3/runtime/index.js +9 -0
- package/lib-esm/AwsClients/S3/runtime/index.native.d.ts +5 -0
- package/lib-esm/AwsClients/S3/runtime/index.native.js +8 -0
- package/lib-esm/AwsClients/S3/runtime/s3TransferHandler/fetch.d.ts +8 -0
- package/lib-esm/AwsClients/S3/runtime/s3TransferHandler/fetch.js +12 -0
- package/lib-esm/AwsClients/S3/runtime/s3TransferHandler/xhr.d.ts +8 -0
- package/lib-esm/AwsClients/S3/runtime/s3TransferHandler/xhr.js +18 -0
- package/lib-esm/AwsClients/S3/runtime/xhrTransferHandler.d.ts +22 -0
- package/lib-esm/AwsClients/S3/runtime/xhrTransferHandler.js +196 -0
- package/lib-esm/AwsClients/S3/runtime/xmlParser/dom.d.ts +8 -0
- package/lib-esm/AwsClients/S3/runtime/xmlParser/dom.js +89 -0
- package/lib-esm/AwsClients/S3/runtime/xmlParser/pureJs.d.ts +10 -0
- package/lib-esm/AwsClients/S3/runtime/xmlParser/pureJs.js +54 -0
- package/lib-esm/AwsClients/S3/types.d.ts +2857 -0
- package/lib-esm/AwsClients/S3/types.js +3 -0
- package/lib-esm/AwsClients/S3/uploadPart.d.ts +20 -0
- package/lib-esm/AwsClients/S3/uploadPart.js +93 -0
- package/lib-esm/AwsClients/S3/utils/deserializeHelpers.d.ts +78 -0
- package/lib-esm/AwsClients/S3/utils/deserializeHelpers.js +144 -0
- package/lib-esm/AwsClients/S3/utils/index.d.ts +5 -0
- package/lib-esm/AwsClients/S3/utils/index.js +7 -0
- package/lib-esm/AwsClients/S3/utils/parsePayload.d.ts +3 -0
- package/lib-esm/AwsClients/S3/utils/parsePayload.js +91 -0
- package/lib-esm/AwsClients/S3/utils/serializeHelpers.d.ts +42 -0
- package/lib-esm/AwsClients/S3/utils/serializeHelpers.js +176 -0
- package/lib-esm/Storage.d.ts +5 -5
- package/lib-esm/Storage.js +53 -25
- package/lib-esm/common/S3ClientUtils.d.ts +24 -15
- package/lib-esm/common/S3ClientUtils.js +76 -93
- package/lib-esm/common/StorageConstants.d.ts +0 -1
- package/lib-esm/common/StorageConstants.js +2 -2
- package/lib-esm/common/StorageErrorStrings.js +2 -1
- package/lib-esm/common/StorageUtils.js +2 -1
- package/lib-esm/index.js +1 -1
- package/lib-esm/providers/AWSS3Provider.d.ts +4 -8
- package/lib-esm/providers/AWSS3Provider.js +162 -115
- package/lib-esm/providers/AWSS3ProviderManagedUpload.d.ts +7 -7
- package/lib-esm/providers/AWSS3ProviderManagedUpload.js +172 -87
- package/lib-esm/providers/AWSS3UploadTask.d.ts +8 -8
- package/lib-esm/providers/AWSS3UploadTask.js +202 -106
- package/lib-esm/providers/index.js +2 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/types/AWSS3Provider.d.ts +62 -62
- package/lib-esm/types/AWSS3Provider.js +1 -1
- package/lib-esm/types/Provider.d.ts +1 -1
- package/lib-esm/types/Provider.js +3 -1
- package/lib-esm/types/Storage.d.ts +23 -23
- package/lib-esm/types/Storage.js +1 -1
- package/lib-esm/types/index.js +3 -1
- package/package.json +21 -26
- package/src/AwsClients/S3/abortMultipartUpload.ts +62 -0
- package/src/AwsClients/S3/base.ts +109 -0
- package/src/AwsClients/S3/completeMultipartUpload.ts +154 -0
- package/src/AwsClients/S3/copyObject.ts +90 -0
- package/src/AwsClients/S3/createMultipartUpload.ts +75 -0
- package/src/AwsClients/S3/deleteObject.ts +69 -0
- package/src/AwsClients/S3/getObject.ts +173 -0
- package/src/AwsClients/S3/headObject.ts +91 -0
- package/src/AwsClients/S3/index.native.ts +42 -0
- package/src/AwsClients/S3/index.ts +41 -0
- package/src/AwsClients/S3/listObjectsV2.ts +130 -0
- package/src/AwsClients/S3/listParts.ts +97 -0
- package/src/AwsClients/S3/putObject.ts +94 -0
- package/src/AwsClients/S3/runtime/base64/index.browser.ts +21 -0
- package/src/AwsClients/S3/runtime/base64/index.native.ts +16 -0
- package/src/AwsClients/S3/runtime/constants.ts +16 -0
- package/src/AwsClients/S3/runtime/contentSha256middleware.ts +29 -0
- package/src/AwsClients/S3/runtime/index.browser.ts +14 -0
- package/src/AwsClients/S3/runtime/index.native.ts +14 -0
- package/src/AwsClients/S3/runtime/index.ts +15 -0
- package/src/AwsClients/S3/runtime/s3TransferHandler/fetch.ts +23 -0
- package/src/AwsClients/S3/runtime/s3TransferHandler/xhr.ts +35 -0
- package/src/AwsClients/S3/runtime/xhrTransferHandler.ts +254 -0
- package/src/AwsClients/S3/runtime/xmlParser/dom.ts +92 -0
- package/src/AwsClients/S3/runtime/xmlParser/pureJs.ts +55 -0
- package/src/AwsClients/S3/types.ts +2877 -0
- package/src/AwsClients/S3/uploadPart.ts +83 -0
- package/src/AwsClients/S3/utils/deserializeHelpers.ts +136 -0
- package/src/AwsClients/S3/utils/index.ts +27 -0
- package/src/AwsClients/S3/utils/parsePayload.ts +45 -0
- package/src/AwsClients/S3/utils/serializeHelpers.ts +112 -0
- package/src/Storage.ts +30 -27
- package/src/common/S3ClientUtils.ts +57 -113
- package/src/common/StorageConstants.ts +2 -2
- package/src/common/StorageErrorStrings.ts +2 -0
- package/src/common/StorageUtils.ts +2 -0
- package/src/providers/AWSS3Provider.ts +80 -100
- package/src/providers/AWSS3ProviderManagedUpload.ts +56 -63
- package/src/providers/AWSS3UploadTask.ts +86 -87
- package/src/providers/index.ts +2 -0
- package/src/types/AWSS3Provider.ts +55 -49
- package/src/types/Provider.ts +7 -2
- package/lib/.tsbuildinfo +0 -3
- package/lib/Storage.js.map +0 -1
- package/lib/common/S3ClientUtils.js.map +0 -1
- package/lib/common/StorageConstants.js.map +0 -1
- package/lib/common/StorageErrorStrings.js.map +0 -1
- package/lib/common/StorageUtils.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/providers/AWSS3Provider.js.map +0 -1
- package/lib/providers/AWSS3ProviderManagedUpload.js.map +0 -1
- package/lib/providers/AWSS3UploadTask.js.map +0 -1
- package/lib/providers/axios-http-handler.d.ts +0 -40
- package/lib/providers/axios-http-handler.js +0 -193
- package/lib/providers/axios-http-handler.js.map +0 -1
- package/lib/providers/index.js.map +0 -1
- package/lib/types/AWSS3Provider.js.map +0 -1
- package/lib/types/Provider.js.map +0 -1
- package/lib/types/Storage.js.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/Storage.js.map +0 -1
- package/lib-esm/common/S3ClientUtils.js.map +0 -1
- package/lib-esm/common/StorageConstants.js.map +0 -1
- package/lib-esm/common/StorageErrorStrings.js.map +0 -1
- package/lib-esm/common/StorageUtils.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/providers/AWSS3Provider.js.map +0 -1
- package/lib-esm/providers/AWSS3ProviderManagedUpload.js.map +0 -1
- package/lib-esm/providers/AWSS3UploadTask.js.map +0 -1
- package/lib-esm/providers/axios-http-handler.d.ts +0 -40
- package/lib-esm/providers/axios-http-handler.js +0 -191
- package/lib-esm/providers/axios-http-handler.js.map +0 -1
- package/lib-esm/providers/index.js.map +0 -1
- package/lib-esm/types/AWSS3Provider.js.map +0 -1
- package/lib-esm/types/Provider.js.map +0 -1
- package/lib-esm/types/Storage.js.map +0 -1
- package/lib-esm/types/index.js.map +0 -1
- package/src/providers/axios-http-handler.ts +0 -242
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Endpoint, HttpResponse } from '@aws-amplify/core/internals/aws-client-utils';
|
|
3
|
+
import type { UploadPartCommandInput, UploadPartCommandOutput } from './types';
|
|
4
|
+
export type UploadPartInput = Pick<UploadPartCommandInput, 'PartNumber' | 'Body' | 'UploadId' | 'Bucket' | 'Key' | 'SSECustomerAlgorithm' | 'SSECustomerKey' | 'SSECustomerKeyMD5'>;
|
|
5
|
+
export type UploadPartOutput = Pick<UploadPartCommandOutput, '$metadata' | 'ETag'>;
|
|
6
|
+
export declare const uploadPart: (config: Omit<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions & Partial<import("@aws-amplify/core/internals/aws-client-utils").UserAgentOptions & import("@aws-amplify/core/internals/aws-client-utils").RetryOptions<HttpResponse> & import("@aws-amplify/core/internals/aws-client-utils").SigningOptions & import("./runtime/xhrTransferHandler").XhrTransferHandlerOptions & import("@aws-amplify/core/internals/aws-client-utils").ServiceClientOptions>, "region" | "maxAttempts" | "credentials" | "retryDecider" | "computeDelay" | "abortSignal" | "service" | "uriEscapePath" | "endpointResolver" | "emitter" | "responseType" | "userAgentHeader" | "userAgentValue"> & {
|
|
7
|
+
region?: string;
|
|
8
|
+
maxAttempts?: number;
|
|
9
|
+
credentials?: import("@aws-sdk/types/types/credentials").Credentials | (() => Promise<import("@aws-sdk/types/types/credentials").Credentials>);
|
|
10
|
+
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
11
|
+
computeDelay?: (attempt: number) => number;
|
|
12
|
+
abortSignal?: AbortSignal;
|
|
13
|
+
service?: string;
|
|
14
|
+
uriEscapePath?: boolean;
|
|
15
|
+
endpointResolver?: (options: import("@aws-amplify/core/internals/aws-client-utils").EndpointResolverOptions, input?: any) => Endpoint;
|
|
16
|
+
emitter?: import("events").EventEmitter;
|
|
17
|
+
responseType?: "blob" | "text";
|
|
18
|
+
userAgentHeader?: string;
|
|
19
|
+
userAgentValue?: string;
|
|
20
|
+
}, input: UploadPartInput) => Promise<UploadPartOutput>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
+
function step(op) {
|
|
28
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
30
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
+
switch (op[0]) {
|
|
33
|
+
case 0: case 1: t = op; break;
|
|
34
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
+
default:
|
|
38
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
+
if (t[2]) _.ops.pop();
|
|
43
|
+
_.trys.pop(); continue;
|
|
44
|
+
}
|
|
45
|
+
op = body.call(thisArg, _);
|
|
46
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
import { parseMetadata, } from '@aws-amplify/core/internals/aws-client-utils';
|
|
51
|
+
import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
52
|
+
import { defaultConfig } from './base';
|
|
53
|
+
import { map, parseXmlError, s3TransferHandler, serializeObjectSsecOptionsToHeaders, serializePathnameObjectKey, } from './utils';
|
|
54
|
+
var uploadPartSerializer = function (input, endpoint) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
+
var headers, url;
|
|
56
|
+
return __generator(this, function (_a) {
|
|
57
|
+
switch (_a.label) {
|
|
58
|
+
case 0: return [4 /*yield*/, serializeObjectSsecOptionsToHeaders(input)];
|
|
59
|
+
case 1:
|
|
60
|
+
headers = _a.sent();
|
|
61
|
+
headers['content-type'] = 'application/octet-stream';
|
|
62
|
+
url = new URL(endpoint.url.toString());
|
|
63
|
+
url.pathname = serializePathnameObjectKey(url, input.Key);
|
|
64
|
+
url.search = new URLSearchParams({
|
|
65
|
+
partNumber: input.PartNumber + '',
|
|
66
|
+
uploadId: input.UploadId,
|
|
67
|
+
}).toString();
|
|
68
|
+
return [2 /*return*/, {
|
|
69
|
+
method: 'PUT',
|
|
70
|
+
headers: headers,
|
|
71
|
+
url: url,
|
|
72
|
+
body: input.Body,
|
|
73
|
+
}];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}); };
|
|
77
|
+
var uploadPartDeserializer = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
+
var error;
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0:
|
|
82
|
+
if (!(response.statusCode >= 300)) return [3 /*break*/, 2];
|
|
83
|
+
return [4 /*yield*/, parseXmlError(response)];
|
|
84
|
+
case 1:
|
|
85
|
+
error = _a.sent();
|
|
86
|
+
throw error;
|
|
87
|
+
case 2: return [2 /*return*/, __assign(__assign({}, map(response.headers, {
|
|
88
|
+
ETag: 'etag',
|
|
89
|
+
})), { $metadata: parseMetadata(response) })];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}); };
|
|
93
|
+
export var uploadPart = composeServiceApi(s3TransferHandler, uploadPartSerializer, uploadPartDeserializer, __assign(__assign({}, defaultConfig), { responseType: 'text' }));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Headers } from '@aws-amplify/core/internals/aws-client-utils';
|
|
2
|
+
type PropertyNameWithStringValue = string;
|
|
3
|
+
type PropertyNameWithSubsequentDeserializer<T> = [string, (any: any) => T];
|
|
4
|
+
type Instruction<T> = PropertyNameWithStringValue | PropertyNameWithSubsequentDeserializer<T>;
|
|
5
|
+
type InferInstructionResultType<T extends Instruction<any>> = (T extends PropertyNameWithSubsequentDeserializer<infer R> ? R : string) | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Maps an object to a new object using the provided instructions.
|
|
8
|
+
* The instructions are a map of the returning mapped object's property names to a single instruction of how to map the
|
|
9
|
+
* value from the original object to the new object. There are two types of instructions:
|
|
10
|
+
*
|
|
11
|
+
* 1. A string representing the property name of the original object to map to the new object. The value mapped from
|
|
12
|
+
* the original object will be the same as the value in the new object, and it can ONLY be string.
|
|
13
|
+
*
|
|
14
|
+
* 2. An array of two elements. The first element is the property name of the original object to map to the new object.
|
|
15
|
+
* The second element is a function that takes the value from the original object and returns the value to be mapped to
|
|
16
|
+
* the new object. The function can return any type.
|
|
17
|
+
*
|
|
18
|
+
* Example:
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const input = {
|
|
21
|
+
* Foo: 'foo',
|
|
22
|
+
* BarList: [{value: 'bar1'}, {value: 'bar2'}]
|
|
23
|
+
* }
|
|
24
|
+
* const output = map(input, {
|
|
25
|
+
* someFoo: 'Foo',
|
|
26
|
+
* bar: ['BarList', (barList) => barList.map(bar => bar.value)]
|
|
27
|
+
* baz: 'Baz' // Baz does not exist in input, so it will not be in the output.
|
|
28
|
+
* });
|
|
29
|
+
* // output = { someFoo: 'foo', bar: ['bar1', 'bar2'] }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param obj The object containing the data to compose mapped object.
|
|
33
|
+
* @param instructions The instructions mapping the object values to the new object.
|
|
34
|
+
* @returns A new object with the mapped values.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare const map: <Instructions extends {
|
|
39
|
+
[key: string]: Instruction<any>;
|
|
40
|
+
}>(obj: Record<string, any>, instructions: Instructions) => { [K in keyof Instructions]: Instructions[K] extends infer T ? T extends Instructions[K] ? T extends PropertyNameWithSubsequentDeserializer<infer R> ? R : string : never : never; };
|
|
41
|
+
/**
|
|
42
|
+
* Deserializes a string to a number. Returns undefined if input is undefined.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export declare const deserializeNumber: (value?: string) => number;
|
|
47
|
+
/**
|
|
48
|
+
* Deserializes a string to a boolean. Returns undefined if input is undefined. Returns true if input is 'true',
|
|
49
|
+
* otherwise false.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare const deserializeBoolean: (value?: string) => boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Deserializes a string to a Date. Returns undefined if input is undefined.
|
|
56
|
+
* It supports epoch timestamp; rfc3339(cannot have a UTC, fractional precision supported); rfc7231(section 7.1.1.1)
|
|
57
|
+
*
|
|
58
|
+
* @see https://www.epoch101.com/
|
|
59
|
+
* @see https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6
|
|
60
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1
|
|
61
|
+
*
|
|
62
|
+
* @note For bundle size consideration, we use Date constructor to parse the timestamp string. There might be slight
|
|
63
|
+
* difference among browsers.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export declare const deserializeTimestamp: (value: string) => Date | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Function that makes sure the deserializer receives non-empty array.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export declare const emptyArrayGuard: <T extends any[]>(value: any, deserializer: (value: any[]) => T) => T;
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
export declare const deserializeMetadata: (headers: Headers) => Record<string, string>;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __values = (this && this.__values) || function(o) {
|
|
4
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
5
|
+
if (m) return m.call(o);
|
|
6
|
+
if (o && typeof o.length === "number") return {
|
|
7
|
+
next: function () {
|
|
8
|
+
if (o && i >= o.length) o = void 0;
|
|
9
|
+
return { value: o && o[i++], done: !o };
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
13
|
+
};
|
|
14
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
15
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
16
|
+
if (!m) return o;
|
|
17
|
+
var i = m.call(o), r, ar = [], e;
|
|
18
|
+
try {
|
|
19
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
20
|
+
}
|
|
21
|
+
catch (error) { e = { error: error }; }
|
|
22
|
+
finally {
|
|
23
|
+
try {
|
|
24
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
25
|
+
}
|
|
26
|
+
finally { if (e) throw e.error; }
|
|
27
|
+
}
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Maps an object to a new object using the provided instructions.
|
|
32
|
+
* The instructions are a map of the returning mapped object's property names to a single instruction of how to map the
|
|
33
|
+
* value from the original object to the new object. There are two types of instructions:
|
|
34
|
+
*
|
|
35
|
+
* 1. A string representing the property name of the original object to map to the new object. The value mapped from
|
|
36
|
+
* the original object will be the same as the value in the new object, and it can ONLY be string.
|
|
37
|
+
*
|
|
38
|
+
* 2. An array of two elements. The first element is the property name of the original object to map to the new object.
|
|
39
|
+
* The second element is a function that takes the value from the original object and returns the value to be mapped to
|
|
40
|
+
* the new object. The function can return any type.
|
|
41
|
+
*
|
|
42
|
+
* Example:
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const input = {
|
|
45
|
+
* Foo: 'foo',
|
|
46
|
+
* BarList: [{value: 'bar1'}, {value: 'bar2'}]
|
|
47
|
+
* }
|
|
48
|
+
* const output = map(input, {
|
|
49
|
+
* someFoo: 'Foo',
|
|
50
|
+
* bar: ['BarList', (barList) => barList.map(bar => bar.value)]
|
|
51
|
+
* baz: 'Baz' // Baz does not exist in input, so it will not be in the output.
|
|
52
|
+
* });
|
|
53
|
+
* // output = { someFoo: 'foo', bar: ['bar1', 'bar2'] }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param obj The object containing the data to compose mapped object.
|
|
57
|
+
* @param instructions The instructions mapping the object values to the new object.
|
|
58
|
+
* @returns A new object with the mapped values.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export var map = function (obj, instructions) {
|
|
63
|
+
var e_1, _a;
|
|
64
|
+
var result = {};
|
|
65
|
+
try {
|
|
66
|
+
for (var _b = __values(Object.entries(instructions)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
67
|
+
var _d = __read(_c.value, 2), key = _d[0], instruction = _d[1];
|
|
68
|
+
var _e = __read(Array.isArray(instruction)
|
|
69
|
+
? instruction
|
|
70
|
+
: [instruction], 2), accessor = _e[0], deserializer = _e[1];
|
|
71
|
+
if (obj.hasOwnProperty(accessor)) {
|
|
72
|
+
result[key] = deserializer
|
|
73
|
+
? deserializer(obj[accessor])
|
|
74
|
+
: String(obj[accessor]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
79
|
+
finally {
|
|
80
|
+
try {
|
|
81
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
82
|
+
}
|
|
83
|
+
finally { if (e_1) throw e_1.error; }
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Deserializes a string to a number. Returns undefined if input is undefined.
|
|
89
|
+
*
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export var deserializeNumber = function (value) {
|
|
93
|
+
return value ? Number(value) : undefined;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Deserializes a string to a boolean. Returns undefined if input is undefined. Returns true if input is 'true',
|
|
97
|
+
* otherwise false.
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export var deserializeBoolean = function (value) {
|
|
102
|
+
return value ? value === 'true' : undefined;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Deserializes a string to a Date. Returns undefined if input is undefined.
|
|
106
|
+
* It supports epoch timestamp; rfc3339(cannot have a UTC, fractional precision supported); rfc7231(section 7.1.1.1)
|
|
107
|
+
*
|
|
108
|
+
* @see https://www.epoch101.com/
|
|
109
|
+
* @see https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6
|
|
110
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1
|
|
111
|
+
*
|
|
112
|
+
* @note For bundle size consideration, we use Date constructor to parse the timestamp string. There might be slight
|
|
113
|
+
* difference among browsers.
|
|
114
|
+
*
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
export var deserializeTimestamp = function (value) {
|
|
118
|
+
return value ? new Date(value) : undefined;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Function that makes sure the deserializer receives non-empty array.
|
|
122
|
+
*
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
export var emptyArrayGuard = function (value, deserializer) {
|
|
126
|
+
if (value === '') {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
var valueArray = (Array.isArray(value) ? value : [value]).filter(function (e) { return e != null; });
|
|
130
|
+
return deserializer(valueArray);
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
135
|
+
export var deserializeMetadata = function (headers) {
|
|
136
|
+
var objectMetadataHeaderPrefix = 'x-amz-meta-';
|
|
137
|
+
var deserialized = Object.keys(headers)
|
|
138
|
+
.filter(function (header) { return header.startsWith(objectMetadataHeaderPrefix); })
|
|
139
|
+
.reduce(function (acc, header) {
|
|
140
|
+
acc[header.replace(objectMetadataHeaderPrefix, '')] = headers[header];
|
|
141
|
+
return acc;
|
|
142
|
+
}, {});
|
|
143
|
+
return Object.keys(deserialized).length > 0 ? deserialized : undefined;
|
|
144
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { parseXmlBody, parseXmlError } from './parsePayload';
|
|
2
|
+
export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, s3TransferHandler, CANCELED_ERROR_MESSAGE, isCancelError, CONTENT_SHA256_HEADER, } from '../runtime';
|
|
3
|
+
export { deserializeBoolean, deserializeMetadata, deserializeNumber, deserializeTimestamp, emptyArrayGuard, map, } from './deserializeHelpers';
|
|
4
|
+
export { assignStringVariables, serializeObjectConfigsToHeaders, serializePathnameObjectKey, serializeObjectSsecOptionsToHeaders, } from './serializeHelpers';
|
|
5
|
+
export { toBase64, utf8Encode } from '../runtime';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export { parseXmlBody, parseXmlError } from './parsePayload';
|
|
4
|
+
export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, s3TransferHandler, CANCELED_ERROR_MESSAGE, isCancelError, CONTENT_SHA256_HEADER, } from '../runtime';
|
|
5
|
+
export { deserializeBoolean, deserializeMetadata, deserializeNumber, deserializeTimestamp, emptyArrayGuard, map, } from './deserializeHelpers';
|
|
6
|
+
export { assignStringVariables, serializeObjectConfigsToHeaders, serializePathnameObjectKey, serializeObjectSsecOptionsToHeaders, } from './serializeHelpers';
|
|
7
|
+
export { toBase64, utf8Encode } from '../runtime';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
import { parseMetadata, } from '@aws-amplify/core/internals/aws-client-utils';
|
|
40
|
+
import { parser } from '../runtime';
|
|
41
|
+
export var parseXmlError = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var statusCode, body, code, message, error;
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return __generator(this, function (_c) {
|
|
45
|
+
switch (_c.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
if (!response || response.statusCode < 300) {
|
|
48
|
+
return [2 /*return*/];
|
|
49
|
+
}
|
|
50
|
+
statusCode = response.statusCode;
|
|
51
|
+
return [4 /*yield*/, parseXmlBody(response)];
|
|
52
|
+
case 1:
|
|
53
|
+
body = _c.sent();
|
|
54
|
+
code = (body === null || body === void 0 ? void 0 : body['Code'])
|
|
55
|
+
? body.Code
|
|
56
|
+
: statusCode === 404
|
|
57
|
+
? 'NotFound'
|
|
58
|
+
: statusCode.toString();
|
|
59
|
+
message = (_b = (_a = body === null || body === void 0 ? void 0 : body['message']) !== null && _a !== void 0 ? _a : body === null || body === void 0 ? void 0 : body['Message']) !== null && _b !== void 0 ? _b : code;
|
|
60
|
+
error = new Error(message);
|
|
61
|
+
return [2 /*return*/, Object.assign(error, {
|
|
62
|
+
name: code,
|
|
63
|
+
$metadata: parseMetadata(response),
|
|
64
|
+
})];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}); };
|
|
68
|
+
export var parseXmlBody = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
+
var data;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
if (!response.body) {
|
|
74
|
+
// S3 can return 200 without a body indicating failure.
|
|
75
|
+
throw new Error('S3 aborted request.');
|
|
76
|
+
}
|
|
77
|
+
return [4 /*yield*/, response.body.text()];
|
|
78
|
+
case 1:
|
|
79
|
+
data = _a.sent();
|
|
80
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
|
81
|
+
try {
|
|
82
|
+
return [2 /*return*/, parser.parse(data)];
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw new Error('Failed to parse XML response.');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return [2 /*return*/, {}];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}); };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare const assignStringVariables: (values: Record<string, {
|
|
5
|
+
toString: () => string;
|
|
6
|
+
} | undefined>) => Record<string, string>;
|
|
7
|
+
interface ObjectSsecOptions {
|
|
8
|
+
SSECustomerAlgorithm?: string;
|
|
9
|
+
SSECustomerKey?: string;
|
|
10
|
+
SSECustomerKeyMD5?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const serializeObjectSsecOptionsToHeaders: (input: ObjectSsecOptions) => Promise<Record<string, string>>;
|
|
13
|
+
interface ObjectConfigs extends ObjectSsecOptions {
|
|
14
|
+
ServerSideEncryption?: string;
|
|
15
|
+
SSEKMSKeyId?: string;
|
|
16
|
+
ACL?: string;
|
|
17
|
+
CacheControl?: string;
|
|
18
|
+
ContentDisposition?: string;
|
|
19
|
+
ContentEncoding?: string;
|
|
20
|
+
ContentLanguage?: string;
|
|
21
|
+
ContentType?: string;
|
|
22
|
+
Expires?: Date;
|
|
23
|
+
Tagging?: string;
|
|
24
|
+
Metadata?: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Serailize the parameters for configuring the S3 object. Currently used by
|
|
28
|
+
* `putObject` and `createMultipartUpload` API.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare const serializeObjectConfigsToHeaders: (input: ObjectConfigs) => Promise<{
|
|
33
|
+
[x: string]: string;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Serialize the object key to a URL pathname.
|
|
37
|
+
* @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare const serializePathnameObjectKey: (url: URL, key: string) => string;
|
|
42
|
+
export {};
|