@mintlify/common 1.0.473 → 1.0.474
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/services/aws.d.ts
CHANGED
package/dist/services/aws.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
+
export const getS3BaseUrl = (opts = {}) => {
|
|
3
|
+
return `https://${opts.bucketName ? opts.bucketName : 'mintlify'}.s3.${opts.region ? opts.region : 'us-west-1'}.amazonaws.com`;
|
|
4
|
+
};
|
|
2
5
|
export const getS3URI = (subdomain, resourcePath, opts = {}) => {
|
|
3
6
|
if (resourcePath.startsWith('http://') || resourcePath.startsWith('https://'))
|
|
4
7
|
return resourcePath;
|
|
5
8
|
const subpath = path.join(subdomain, resourcePath);
|
|
6
|
-
const baseUrl = new URL(
|
|
9
|
+
const baseUrl = new URL(getS3BaseUrl(opts));
|
|
7
10
|
return new URL(subpath, baseUrl).toString();
|
|
8
11
|
};
|