@aws-amplify/storage
Version:
Storage category of aws-amplify
25 lines (22 loc) • 1.03 kB
JavaScript
import { defaultStorage } from '@aws-amplify/core';
import { resolveCtxArgs } from '@aws-amplify/core/internals/utils';
import { readFile } from '../utils/readFile.mjs';
import { toBase64 } from '../utils/toBase64.mjs';
import { uploadData as uploadData$1 } from '../../providers/s3/apis/internal/uploadData/index.mjs';
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Overload signatures above are the public contract; the impl is intentionally untyped and shape is enforced by resolveCtxArgs.
function uploadData(...args) {
const [ctx, input] = resolveCtxArgs(args);
return uploadData$1({ amplify: ctx, readFile, toBase64 }, {
...input,
options: {
...input?.options,
// This option enables caching in-progress multipart uploads.
// It's ONLY needed for client-side API.
resumableUploadsCache: defaultStorage,
},
});
}
export { uploadData };
//# sourceMappingURL=uploadData.mjs.map