UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

1 lines 1.29 kB
{"version":3,"file":"uploadData.mjs","sources":["../../../../src/server/apis/uploadData.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getAmplifyServerContext, } from '@aws-amplify/core/internals/adapter-core';\nimport { readFile } from '../utils/readFile';\nimport { toBase64 } from '../utils/toBase64';\nimport { uploadData as uploadDataInternal } from '../../providers/s3/apis/internal/uploadData';\nexport function uploadData(contextSpec, input) {\n // The internal uploadData returns an UploadTask which has pause/resume. On\n // the server path we intentionally hide pause/resume from the type because\n // they are not supported across isolated server requests. The runtime\n // object still exposes them as no-ops (delegated to createUploadTask).\n return uploadDataInternal({\n amplify: getAmplifyServerContext(contextSpec).amplify,\n readFile,\n toBase64,\n }, input);\n}\n"],"names":["uploadDataInternal"],"mappings":";;;;;AAAA;AACA;AAKO,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;AAC/C;AACA;AACA;AACA;AACA,IAAI,OAAOA,YAAkB,CAAC;AAC9B,QAAQ,OAAO,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC,OAAO;AAC7D,QAAQ,QAAQ;AAChB,QAAQ,QAAQ;AAChB,KAAK,EAAE,KAAK,CAAC;AACb;;;;"}