UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

23 lines (21 loc) 1.08 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 adapter_core_1 = require("@aws-amplify/core/internals/adapter-core"); const readFile_1 = require("../utils/readFile"); const toBase64_1 = require("../utils/toBase64"); const uploadData_1 = require("../../providers/s3/apis/internal/uploadData"); function uploadData(contextSpec, input) { // The internal uploadData returns an UploadTask which has pause/resume. On // the server path we intentionally hide pause/resume from the type because // they are not supported across isolated server requests. The runtime // object still exposes them as no-ops (delegated to createUploadTask). return (0, uploadData_1.uploadData)({ amplify: (0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, readFile: readFile_1.readFile, toBase64: toBase64_1.toBase64, }, input); } //# sourceMappingURL=uploadData.js.map