UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

1 lines 2.58 kB
{"version":3,"file":"getUrl.mjs","sources":["../../../../src/internals/apis/getUrl.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 { getUrl as getUrlInternal } from '../../providers/s3/apis/internal/getUrl';\nexport function getUrl(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 return getUrlInternal(ctx, {\n path: input.path,\n options: {\n useAccelerateEndpoint: input?.options?.useAccelerateEndpoint,\n bucket: input?.options?.bucket,\n validateObjectExistence: input?.options?.validateObjectExistence,\n expiresIn: input?.options?.expiresIn,\n contentDisposition: input?.options?.contentDisposition,\n contentType: input?.options?.contentType,\n expectedBucketOwner: input?.options?.expectedBucketOwner,\n // Advanced options\n locationCredentialsProvider: input?.options?.locationCredentialsProvider,\n customEndpoint: input?.options?.customEndpoint,\n method: input?.options?.method,\n },\n // Type casting is necessary because `getPropertiesInternal` supports both Gen1 and Gen2 signatures, but here\n // given in input can only be Gen2 signature, the return can only ben Gen2 signature.\n });\n}\n"],"names":["getUrlInternal"],"mappings":";;;AAAA;AACA;AAGO,SAAS,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE;AAC/C;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,OAAOA,QAAc,CAAC,GAAG,EAAE;AAC/B,QAAQ,IAAI,EAAE,KAAK,CAAC,IAAI;AACxB,QAAQ,OAAO,EAAE;AACjB,YAAY,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,qBAAqB;AACxE,YAAY,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM;AAC1C,YAAY,uBAAuB,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAuB;AAC5E,YAAY,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS;AAChD,YAAY,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB;AAClE,YAAY,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW;AACpD,YAAY,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB;AACpE;AACA,YAAY,2BAA2B,EAAE,KAAK,EAAE,OAAO,EAAE,2BAA2B;AACpF,YAAY,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc;AAC1D,YAAY,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM;AAC1C,SAAS;AACT;AACA;AACA,KAAK,CAAC;AACN;;;;"}