UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

1 lines 1.49 kB
{"version":3,"file":"uploadData.mjs","sources":["../../../../src/client/apis/uploadData.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { defaultStorage } from '@aws-amplify/core';\nimport { resolveCtxArgs } from '@aws-amplify/core/internals/utils';\nimport { readFile } from '../utils/readFile';\nimport { toBase64 } from '../utils/toBase64';\nimport { uploadData as uploadDataInternal } from '../../providers/s3/apis/internal/uploadData';\n// Overload signatures above are the public contract; the impl is intentionally untyped and shape is enforced by resolveCtxArgs.\nexport function uploadData(...args) {\n const [ctx, input] = resolveCtxArgs(args);\n return uploadDataInternal({ amplify: ctx, readFile, toBase64 }, {\n ...input,\n options: {\n ...input?.options,\n // This option enables caching in-progress multipart uploads.\n // It's ONLY needed for client-side API.\n resumableUploadsCache: defaultStorage,\n },\n });\n}\n"],"names":["uploadDataInternal"],"mappings":";;;;;;AAAA;AACA;AAMA;AACO,SAAS,UAAU,CAAC,GAAG,IAAI,EAAE;AACpC,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC;AAC7C,IAAI,OAAOA,YAAkB,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;AACpE,QAAQ,GAAG,KAAK;AAChB,QAAQ,OAAO,EAAE;AACjB,YAAY,GAAG,KAAK,EAAE,OAAO;AAC7B;AACA;AACA,YAAY,qBAAqB,EAAE,cAAc;AACjD,SAAS;AACT,KAAK,CAAC;AACN;;;;"}