UNPKG

1.25 kBJavaScriptView Raw
1import { Amplify } from '@aws-amplify/core';
2import { getUrl as getUrl$1 } from './internal/getUrl.mjs';
3
4// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5// SPDX-License-Identifier: Apache-2.0
6/**
7 * Get a temporary presigned URL to download the specified S3 object.
8 * The presigned URL expires when the associated role used to sign the request expires or
9 * the option `expiresIn` is reached. The `expiresAt` property in the output object indicates when the URL MAY expire.
10 *
11 * By default, it will not validate the object that exists in S3. If you set the `options.validateObjectExistence`
12 * to true, this method will verify the given object already exists in S3 before returning a presigned
13 * URL, and will throw {@link StorageError} if the object does not exist.
14 *
15 * @param input - The GetUrlInput object.
16 * @returns Presigned URL and timestamp when the URL MAY expire.
17 * @throws service: {@link S3Exception} - thrown when checking for existence of the object
18 * @throws validation: {@link StorageValidationErrorCode } - Validation errors
19 * thrown either username or key are not defined.
20 *
21 */
22const getUrl = (input) => {
23 return getUrl$1(Amplify, input);
24};
25
26export { getUrl };
27//# sourceMappingURL=getUrl.mjs.map