UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

26 lines (24 loc) 1.16 kB
'use strict'; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.uploadData = uploadData; const core_1 = require("@aws-amplify/core"); const utils_1 = require("@aws-amplify/core/internals/utils"); const readFile_1 = require("../utils/readFile"); const toBase64_1 = require("../utils/toBase64"); const uploadData_1 = require("../../providers/s3/apis/internal/uploadData"); // Overload signatures above are the public contract; the impl is intentionally untyped and shape is enforced by resolveCtxArgs. function uploadData(...args) { const [ctx, input] = (0, utils_1.resolveCtxArgs)(args); return (0, uploadData_1.uploadData)({ amplify: ctx, readFile: readFile_1.readFile, toBase64: toBase64_1.toBase64 }, { ...input, options: { ...input?.options, // This option enables caching in-progress multipart uploads. // It's ONLY needed for client-side API. resumableUploadsCache: core_1.defaultStorage, }, }); } //# sourceMappingURL=uploadData.js.map