UNPKG

@microsoft/omnichannel-chat-sdk

Version:
47 lines 1.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCoreServicesOrgUrl = exports.createCoreServicesOrgUrl = exports.getCoreServicesGeoName = exports.nonProductionDynamicsLocationCode = exports.unqOrgUrlPattern = exports.coreServicesOrgUrlPrefix = exports.CoreServicesGeoNamesMapping = void 0; exports.CoreServicesGeoNamesMapping = { "crm": "us", // NAM "crm2": "br", // SAM "crm3": "ca", // CAN "crm4": "eu", // EUR "crm5": "as", // APJ "crm6": "au", // OCE "crm7": "jp", // JPN "crm8": "in", // IND "crm9": "gov", // GCC "crm10": "preprod", // PREPROD "crm11": "uk", // GBR "crm12": "fr", // FRA "crm14": "za", // ZAF "crm15": "ae", // UAE "crm16": "de", // GER "crm17": "ch", // CHE "crm19": "no", // NOR "crm20": "sg", // SGP "crm21": "kr", // KOR "crm22": "se", // SWE "crmtest": "test" // TEST }; exports.coreServicesOrgUrlPrefix = "https://m-"; exports.unqOrgUrlPattern = /http[s]*:\/\/[\w-]*-(crmtest|crm[\d]*).[\w.]*/; exports.nonProductionDynamicsLocationCode = ["crm10", "crmtest"]; var getCoreServicesGeoName = function (dynamicsLocationCode) { var _a; return (_a = exports.CoreServicesGeoNamesMapping[dynamicsLocationCode]) !== null && _a !== void 0 ? _a : ""; }; exports.getCoreServicesGeoName = getCoreServicesGeoName; var createCoreServicesOrgUrl = function (orgId, geoName) { var domainName = "omnichannelengagementhub.com"; if (geoName === "gov") { domainName = "omnichannelengagementhub.us"; } return "https://m-".concat(orgId, ".").concat(geoName, ".").concat(domainName); }; exports.createCoreServicesOrgUrl = createCoreServicesOrgUrl; var isCoreServicesOrgUrl = function (orgUrl) { return orgUrl.startsWith(exports.coreServicesOrgUrlPrefix); }; exports.isCoreServicesOrgUrl = isCoreServicesOrgUrl; //# sourceMappingURL=CoreServicesUtils.js.map