builder-util-runtime
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -128,2 +128,7 @@ export declare type PublishProvider = "github" | "bintray" | "s3" | "spaces" | "generic"; | ||
readonly storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null; | ||
/** | ||
* The endpoint URI to send requests to. The default endpoint is built from the configured region. | ||
* The endpoint should be a string like `https://{service}.{region}.amazonaws.com`. | ||
*/ | ||
readonly endpoint?: string | null; | ||
} | ||
@@ -130,0 +135,0 @@ /** |
@@ -24,14 +24,18 @@ "use strict"; | ||
let url; | ||
if (!options.bucket.includes(".")) { | ||
if (options.region === "cn-north-1") { | ||
url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`; | ||
if (options.endpoint != null) { | ||
url = `${options.endpoint}/${options.bucket}`; | ||
} else { | ||
if (!options.bucket.includes(".")) { | ||
if (options.region === "cn-north-1") { | ||
url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`; | ||
} else { | ||
url = `https://${options.bucket}.s3.amazonaws.com`; | ||
} | ||
} else { | ||
url = `https://${options.bucket}.s3.amazonaws.com`; | ||
if (options.region == null) { | ||
throw new Error(`Bucket name "${options.bucket}" includes a dot, but S3 region is missing`); | ||
} | ||
// special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro | ||
url = options.region === "us-east-1" ? `https://s3.amazonaws.com/${options.bucket}` : `https://s3-${options.region}.amazonaws.com/${options.bucket}`; | ||
} | ||
} else { | ||
if (options.region == null) { | ||
throw new Error(`Bucket name "${options.bucket}" includes a dot, but S3 region is missing`); | ||
} | ||
// special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro | ||
url = options.region === "us-east-1" ? `https://s3.amazonaws.com/${options.bucket}` : `https://s3-${options.region}.amazonaws.com/${options.bucket}`; | ||
} | ||
@@ -38,0 +42,0 @@ if (options.path != null) { |
{ | ||
"name": "builder-util-runtime", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"main": "out/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Vladimir Krivosheev", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145513
1660