@outreach/client-addon-sdk
Advanced tools
Comparing version 0.1.52 to 0.1.53
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validate = void 0; | ||
exports.urlValidation = exports.validate = void 0; | ||
var AddonStore_1 = require("../store/AddonStore"); | ||
@@ -34,4 +34,5 @@ var AddonType_1 = require("../store/AddonType"); | ||
} | ||
if (!urlValidation(manifest.api.token)) { | ||
issues.push('Manifest Api section needs to have a valid token endpoint url. Value: ' + manifest.api.token); | ||
if (!exports.urlValidation(manifest.api.token)) { | ||
issues.push('Manifest Api section needs to have a valid token endpoint url. Value: ' + | ||
manifest.api.token); | ||
} | ||
@@ -41,7 +42,7 @@ if (!manifest.api.applicationId) { | ||
} | ||
if (!urlValidation(manifest.api.redirectUri)) { | ||
if (!exports.urlValidation(manifest.api.redirectUri)) { | ||
issues.push('Manifest Api section needs to have a valid redirect url. Value: ' + | ||
manifest.api.redirectUri); | ||
} | ||
if (!urlValidation(manifest.api.connect)) { | ||
if (!exports.urlValidation(manifest.api.connect)) { | ||
issues.push('Manifest Api section needs to have a valid connect endpoint url. Value: ' + | ||
@@ -55,11 +56,11 @@ manifest.api.connect); | ||
else { | ||
if (!urlValidation(manifest.author.websiteUrl)) { | ||
if (!exports.urlValidation(manifest.author.websiteUrl)) { | ||
issues.push('Author website url is invalid url. Value: ' + | ||
manifest.author.websiteUrl); | ||
} | ||
if (!urlValidation(manifest.author.privacyUrl)) { | ||
if (!exports.urlValidation(manifest.author.privacyUrl)) { | ||
issues.push('Author privacy url is invalid url. Value: ' + | ||
manifest.author.privacyUrl); | ||
} | ||
if (!urlValidation(manifest.author.termsOfUseUrl)) { | ||
if (!exports.urlValidation(manifest.author.termsOfUseUrl)) { | ||
issues.push('Author terms of use url is invalid url. Value: ' + | ||
@@ -100,3 +101,3 @@ manifest.author.termsOfUseUrl); | ||
else { | ||
if (!urlValidation(manifest.host.icon)) { | ||
if (!exports.urlValidation(manifest.host.icon)) { | ||
issues.push('Host icon definition is invalid url. Value: ' + manifest.host.icon); | ||
@@ -156,4 +157,13 @@ } | ||
try { | ||
var validatedUrl = new URL(url); | ||
return validatedUrl.toString() === url; | ||
var validatedUrl = new URL(url).toString(); | ||
if (validatedUrl === url) { | ||
return true; | ||
} | ||
if (validatedUrl.endsWith('/')) { | ||
var trimmedUrl = validatedUrl.substring(0, validatedUrl.length - 1); | ||
if (trimmedUrl === url) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
@@ -164,2 +174,3 @@ catch (e) { | ||
}; | ||
exports.urlValidation = urlValidation; | ||
//# sourceMappingURL=Validator.js.map |
{ | ||
"name": "@outreach/client-addon-sdk", | ||
"license": "MIT", | ||
"version": "0.1.52", | ||
"version": "0.1.53", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "contributors": [ |
Sorry, the diff of this file is too big to display
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
419125
7184