@aws-amplify/storage
Version:
Storage category of aws-amplify
1 lines • 2.7 kB
Source Map (JSON)
{"version":3,"file":"uploadData.mjs","sources":["../../../../src/internals/apis/uploadData.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getGlobalContext, isAmplifyContext, } from '@aws-amplify/core';\nimport { readFile } from '../../client/utils/readFile';\nimport { toBase64 } from '../../client/utils/toBase64';\nimport { uploadData as uploadDataInternal } from '../../providers/s3/apis/internal/uploadData';\nexport function uploadData(ctxOrInput, maybeInput) {\n // Resolve the optional leading context. The global context is resolved at\n // CALL time (never cached) so single-arg callers follow live configuration.\n const [ctx, input] = isAmplifyContext(ctxOrInput)\n ? [ctxOrInput, maybeInput]\n : [getGlobalContext(), ctxOrInput];\n const { data, path, options } = input;\n return uploadDataInternal({ amplify: ctx, readFile, toBase64 }, {\n path,\n data,\n options: {\n useAccelerateEndpoint: options?.useAccelerateEndpoint,\n bucket: options?.bucket,\n onProgress: options?.onProgress,\n contentDisposition: options?.contentDisposition,\n contentEncoding: options?.contentEncoding,\n contentType: options?.contentType,\n metadata: options?.metadata,\n preventOverwrite: options?.preventOverwrite,\n expectedBucketOwner: options?.expectedBucketOwner,\n checksumAlgorithm: options?.checksumAlgorithm,\n // Advanced options\n locationCredentialsProvider: options?.locationCredentialsProvider,\n customEndpoint: options?.customEndpoint,\n },\n });\n}\n"],"names":["uploadDataInternal"],"mappings":";;;;;AAAA;AACA;AAKO,SAAS,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE;AACnD;AACA;AACA,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,UAAU;AACpD,UAAU,CAAC,UAAU,EAAE,UAAU;AACjC,UAAU,CAAC,gBAAgB,EAAE,EAAE,UAAU,CAAC;AAC1C,IAAI,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK;AACzC,IAAI,OAAOA,YAAkB,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;AACpE,QAAQ,IAAI;AACZ,QAAQ,IAAI;AACZ,QAAQ,OAAO,EAAE;AACjB,YAAY,qBAAqB,EAAE,OAAO,EAAE,qBAAqB;AACjE,YAAY,MAAM,EAAE,OAAO,EAAE,MAAM;AACnC,YAAY,UAAU,EAAE,OAAO,EAAE,UAAU;AAC3C,YAAY,kBAAkB,EAAE,OAAO,EAAE,kBAAkB;AAC3D,YAAY,eAAe,EAAE,OAAO,EAAE,eAAe;AACrD,YAAY,WAAW,EAAE,OAAO,EAAE,WAAW;AAC7C,YAAY,QAAQ,EAAE,OAAO,EAAE,QAAQ;AACvC,YAAY,gBAAgB,EAAE,OAAO,EAAE,gBAAgB;AACvD,YAAY,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;AAC7D,YAAY,iBAAiB,EAAE,OAAO,EAAE,iBAAiB;AACzD;AACA,YAAY,2BAA2B,EAAE,OAAO,EAAE,2BAA2B;AAC7E,YAAY,cAAc,EAAE,OAAO,EAAE,cAAc;AACnD,SAAS;AACT,KAAK,CAAC;AACN;;;;"}