persona-community-5/.pnpm-store/v3/files/e2/e0b330537e6e0e3b28ff4b26d8ee0833c997bab41aa470b9226a0870423db5ab58a9e845cefa7494491ef1cedf52146ab48c7acf66c5bb1d011b2ecd20570b
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

42 lines
1.3 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AVAILABLE_REGIONS = exports.DOMAINS = exports.DEFAULT_REGION = void 0;
exports.getDomains = getDomains;
exports.setRedoclyDomain = setRedoclyDomain;
exports.getRedoclyDomain = getRedoclyDomain;
exports.isRedoclyRegistryURL = isRedoclyRegistryURL;
let redoclyDomain = 'redocly.com';
exports.DEFAULT_REGION = 'us';
exports.DOMAINS = getDomains();
exports.AVAILABLE_REGIONS = Object.keys(exports.DOMAINS);
function getDomains() {
const domains = {
us: 'redocly.com',
eu: 'eu.redocly.com',
};
// FIXME: temporary fix for our lab environments
const domain = redoclyDomain;
if (domain?.endsWith('.redocly.host')) {
domains[domain.split('.')[0]] = domain;
}
if (domain === 'redoc.online') {
domains[domain] = domain;
}
return domains;
}
function setRedoclyDomain(domain) {
redoclyDomain = domain;
}
function getRedoclyDomain() {
return redoclyDomain;
}
function isRedoclyRegistryURL(link) {
const domain = getRedoclyDomain() || exports.DOMAINS[exports.DEFAULT_REGION];
const legacyDomain = domain === 'redocly.com' ? 'redoc.ly' : domain;
if (!link.startsWith(`https://api.${domain}/registry/`) &&
!link.startsWith(`https://api.${legacyDomain}/registry/`)) {
return false;
}
return true;
}