UNPKG

msbot

Version:

MSBot command line tool for manipulating Microsoft Bot Framework .bot files

309 lines 12.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Copyright(c) Microsoft Corporation.All rights reserved. * Licensed under the MIT License. */ const pkg = require('../package.json'); const intercept = require("intercept-stdout"); const getStdinInner = require("get-stdin"); const strip_bom = require('strip-bom'); async function getStdin() { var result = await getStdinInner(); return strip_bom(result); } exports.getStdin = getStdin; function uuidValidate(value) { return /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/.test(value); } exports.uuidValidate = uuidValidate; // tslint:disable-next-line:typedef const unhookIntercept = intercept((txt) => { return `${process.env.PREFIX === 'prefix' ? `[${pkg.name}] ` : ''}${txt}`; }); exports.unhook_intercept = unhookIntercept; exports.RegionCodes = { AUSTRALIAEAST: 'australiaeast', AUSTRALIACENTRAL: 'australiacentral', AUSTRALIACENTRAL2: 'australiacentral2', AUSTRALIASOUTHEAST: 'australiasoutheast', EASTASIA: 'eastasia', SOUTHEASTASIA: 'southeastasia', EASTUS: 'eastus', EASTUS2: 'eastus2', SOUTHCENTRALUS: 'southcentralus', WESTCENTRALUS: 'westcentralus', WESTUS: 'westus', WESTUS2: 'westus2', BRAZILSOUTH: 'brazilsouth', CENTRALUS: 'centralus', NORTHCENTRALUS: 'northcentralus', JAPANWEST: 'japanwest', JAPANEAST: 'japaneast', SOUTHINDIA: 'southindia', CENTRALINDIA: 'centralindia', WESTINDIA: 'westindia', CANADACENTRAL: 'canadacentral', CANADAEAST: 'canadaeast', KOREACENTRAL: 'koreacentral', KOREASOUTH: 'koreasouth', GERMANYCENTRAL: 'germanycentral', GERMANYNORTHEAST: 'germanynortheast', NORTHEUROPE: 'northeurope', WESTEUROPE: 'westeurope', UKSOUTH: 'uksouth', UKWEST: 'ukwest', FRANCECENTRAL: 'francecentral', FRANCESOUTH: 'francesouth', VIRGINIA: 'virginia', USGOVVIRGINIA: 'usgovvirginia', USGOVIOWA: 'usgoviowa', USDODEAST: 'usdodeast', USDODCENTRAL: 'usdodcentral', USGOVTEXAS: 'usgovtexas', USGOVARIZONA: 'usgovarizona' }; exports.RegionNames = { AUSTRALIAEAST: 'Australia East', AUSTRALIACENTRAL: 'Australia Central', AUSTRALIACENTRAL2: 'Australia Central 2', AUSTRALIASOUTHEAST: 'Australia Southeast', EASTASIA: 'East Asia', SOUTHEASTASIA: 'Southeast Asia', EASTUS: 'East US', EASTUS2: 'East US 2', SOUTHCENTRALUS: 'South Central US', WESTCENTRALUS: 'West Central US', WESTUS: 'West US', WESTUS2: 'West US 2', BRAZILSOUTH: 'Brazil South', CENTRALUS: 'Central US', NORTHCENTRALUS: 'North Central US', JAPANWEST: 'Japan West', JAPANEAST: 'Japan East', SOUTHINDIA: 'South India', CENTRALINDIA: 'Central India', WESTINDIA: 'West India', CANADACENTRAL: 'Canada Central', CANADAEAST: 'Canada East', KOREACENTRAL: 'Korea Central', KOREASOUTH: 'Korea South', GERMANYCENTRAL: 'Germany Central', GERMANYNORTHEAST: 'Germany Northeast', NORTHEUROPE: 'North Europe', WESTEUROPE: 'West Europe', UKSOUTH: 'UK South', UKWEST: 'UK West', FRANCECENTRAL: 'France Central', FRANCESOUTH: 'France South', VIRGINIA: 'Virginia', USGOVVIRGINIA: 'USGov Virginia', USGOVIOWA: "USGov Iowa", USDODEAST: "USDoD East", USDODCENTRAL: "USDoD Central", USGOVTEXAS: "USGov Texas", USGOVARIZONA: "USGov Arizona" }; exports.LuisAuthoringRegionCodes = { AUSTRALIAEAST: exports.RegionCodes.AUSTRALIAEAST, WESTEUROPE: exports.RegionCodes.WESTEUROPE, WESTUS: exports.RegionCodes.WESTUS, VIRGINIA: exports.RegionCodes.VIRGINIA }; exports.regionToLuisAuthoringRegionMap = { australiaeast: exports.LuisAuthoringRegionCodes.AUSTRALIAEAST, australiacentral: exports.LuisAuthoringRegionCodes.AUSTRALIAEAST, australiacentral2: exports.LuisAuthoringRegionCodes.AUSTRALIAEAST, australiasoutheast: exports.LuisAuthoringRegionCodes.AUSTRALIAEAST, eastasia: exports.LuisAuthoringRegionCodes.WESTUS, southeastasia: exports.LuisAuthoringRegionCodes.WESTUS, eastus: exports.LuisAuthoringRegionCodes.WESTUS, eastus2: exports.LuisAuthoringRegionCodes.WESTUS, southcentralus: exports.LuisAuthoringRegionCodes.WESTUS, westcentralus: exports.LuisAuthoringRegionCodes.WESTUS, westus: exports.LuisAuthoringRegionCodes.WESTUS, westus2: exports.LuisAuthoringRegionCodes.WESTUS, brazilsouth: exports.LuisAuthoringRegionCodes.WESTUS, centralus: exports.LuisAuthoringRegionCodes.WESTUS, northcentralus: exports.LuisAuthoringRegionCodes.WESTUS, japanwest: exports.LuisAuthoringRegionCodes.WESTUS, japaneast: exports.LuisAuthoringRegionCodes.WESTUS, southindia: exports.LuisAuthoringRegionCodes.WESTUS, centralindia: exports.LuisAuthoringRegionCodes.WESTUS, westindia: exports.LuisAuthoringRegionCodes.WESTUS, canadacentral: exports.LuisAuthoringRegionCodes.WESTUS, canadaeast: exports.LuisAuthoringRegionCodes.WESTUS, koreacentral: exports.LuisAuthoringRegionCodes.WESTUS, koreasouth: exports.LuisAuthoringRegionCodes.WESTUS, northeurope: exports.LuisAuthoringRegionCodes.WESTEUROPE, westeurope: exports.LuisAuthoringRegionCodes.WESTEUROPE, uksouth: exports.LuisAuthoringRegionCodes.WESTEUROPE, ukwest: exports.LuisAuthoringRegionCodes.WESTEUROPE, francecentral: exports.LuisAuthoringRegionCodes.WESTEUROPE, francesouth: exports.LuisAuthoringRegionCodes.WESTEUROPE, germanycentral: exports.LuisAuthoringRegionCodes.WESTEUROPE, germanynortheast: exports.LuisAuthoringRegionCodes.WESTEUROPE, virginia: exports.LuisAuthoringRegionCodes.VIRGINIA, usgovvirginia: exports.LuisAuthoringRegionCodes.VIRGINIA, usgoviowa: exports.LuisAuthoringRegionCodes.VIRGINIA, usdodeast: exports.LuisAuthoringRegionCodes.VIRGINIA, usdodcentral: exports.LuisAuthoringRegionCodes.VIRGINIA, usgovtexas: exports.LuisAuthoringRegionCodes.VIRGINIA, usgovarizona: exports.LuisAuthoringRegionCodes.VIRGINIA }; exports.regionToLuisPublishRegionMap = { australiaeast: exports.RegionCodes.AUSTRALIAEAST, australiacentral: exports.RegionCodes.AUSTRALIAEAST, australiacentral2: exports.RegionCodes.AUSTRALIAEAST, australiasoutheast: exports.RegionCodes.AUSTRALIAEAST, eastasia: exports.RegionCodes.SOUTHEASTASIA, southeastasia: exports.RegionCodes.SOUTHEASTASIA, eastus: exports.RegionCodes.EASTUS, eastus2: exports.RegionCodes.EASTUS2, southcentralus: exports.RegionCodes.SOUTHCENTRALUS, westcentralus: exports.RegionCodes.WESTCENTRALUS, westus: exports.RegionCodes.WESTUS, westus2: exports.RegionCodes.WESTUS2, brazilsouth: exports.RegionCodes.BRAZILSOUTH, centralus: exports.RegionCodes.SOUTHCENTRALUS, northcentralus: exports.RegionCodes.WESTCENTRALUS, japanwest: exports.RegionCodes.SOUTHEASTASIA, japaneast: exports.RegionCodes.SOUTHEASTASIA, southindia: exports.RegionCodes.SOUTHEASTASIA, centralindia: exports.RegionCodes.SOUTHEASTASIA, westindia: exports.RegionCodes.SOUTHEASTASIA, canadacentral: exports.RegionCodes.WESTCENTRALUS, canadaeast: exports.RegionCodes.EASTUS, koreacentral: exports.RegionCodes.SOUTHEASTASIA, koreasouth: exports.RegionCodes.SOUTHEASTASIA, northeurope: exports.RegionCodes.NORTHEUROPE, westeurope: exports.RegionCodes.WESTEUROPE, uksouth: exports.RegionCodes.WESTEUROPE, ukwest: exports.RegionCodes.WESTEUROPE, francecentral: exports.RegionCodes.NORTHEUROPE, francesouth: exports.RegionCodes.WESTEUROPE, germanycentral: exports.RegionCodes.WESTEUROPE, germanynortheast: exports.RegionCodes.NORTHEUROPE, virginia: exports.RegionCodes.VIRGINIA, usgovvirginia: exports.RegionCodes.VIRGINIA, usgoviowa: exports.RegionCodes.VIRGINIA, usdodeast: exports.RegionCodes.VIRGINIA, usdodcentral: exports.RegionCodes.VIRGINIA, usgovtexas: exports.RegionCodes.VIRGINIA, usgovarizona: exports.RegionCodes.VIRGINIA, }; exports.regionToAppInsightRegionNameMap = { australiaeast: exports.RegionNames.SOUTHEASTASIA, australiacentral: exports.RegionNames.SOUTHEASTASIA, australiacentral2: exports.RegionNames.SOUTHEASTASIA, australiasoutheast: exports.RegionNames.SOUTHEASTASIA, eastasia: exports.RegionNames.SOUTHEASTASIA, southeastasia: exports.RegionNames.SOUTHEASTASIA, japanwest: exports.RegionNames.SOUTHEASTASIA, japaneast: exports.RegionNames.SOUTHEASTASIA, southindia: exports.RegionNames.SOUTHEASTASIA, centralindia: exports.RegionNames.SOUTHEASTASIA, westindia: exports.RegionNames.SOUTHEASTASIA, koreacentral: exports.RegionNames.SOUTHEASTASIA, koreasouth: exports.RegionNames.SOUTHEASTASIA, eastus: exports.RegionNames.EASTUS, eastus2: exports.RegionNames.EASTUS, canadaeast: exports.RegionNames.EASTUS, southcentralus: exports.RegionNames.SOUTHCENTRALUS, brazilsouth: exports.RegionNames.SOUTHCENTRALUS, centralus: exports.RegionNames.SOUTHCENTRALUS, northcentralus: exports.RegionNames.SOUTHCENTRALUS, canadacentral: exports.RegionNames.SOUTHCENTRALUS, westcentralus: exports.RegionNames.WESTUS2, westus: exports.RegionNames.WESTUS2, westus2: exports.RegionNames.WESTUS2, northeurope: exports.RegionNames.NORTHEUROPE, westeurope: exports.RegionNames.WESTEUROPE, uksouth: exports.RegionNames.WESTEUROPE, ukwest: exports.RegionNames.WESTEUROPE, francecentral: exports.RegionNames.WESTEUROPE, francesouth: exports.RegionNames.WESTEUROPE, germanycentral: exports.RegionNames.WESTEUROPE, germanynortheast: exports.RegionNames.WESTEUROPE, }; exports.regionToSearchRegionMap = { australiaeast: exports.RegionCodes.SOUTHEASTASIA, australiacentral: exports.RegionCodes.SOUTHEASTASIA, australiacentral2: exports.RegionCodes.SOUTHEASTASIA, australiasoutheast: exports.RegionCodes.SOUTHEASTASIA, eastasia: exports.RegionCodes.SOUTHEASTASIA, southeastasia: exports.RegionCodes.SOUTHEASTASIA, eastus: exports.RegionCodes.EASTUS, eastus2: exports.RegionCodes.EASTUS2, southcentralus: exports.RegionCodes.SOUTHCENTRALUS, westcentralus: exports.RegionCodes.WESTCENTRALUS, westus: exports.RegionCodes.WESTUS, westus2: exports.RegionCodes.WESTUS2, centralus: exports.RegionCodes.WESTCENTRALUS, northcentralus: exports.RegionCodes.SOUTHCENTRALUS, canadacentral: exports.RegionCodes.SOUTHCENTRALUS, canadaeast: exports.RegionCodes.EASTUS, brazilsouth: exports.RegionCodes.BRAZILSOUTH, japanwest: exports.RegionCodes.JAPANEAST, japaneast: exports.RegionCodes.JAPANEAST, southindia: exports.RegionCodes.CENTRALINDIA, centralindia: exports.RegionCodes.CENTRALINDIA, westindia: exports.RegionCodes.CENTRALINDIA, koreacentral: exports.RegionCodes.EASTASIA, koreasouth: exports.RegionCodes.EASTASIA, northeurope: exports.RegionCodes.NORTHEUROPE, westeurope: exports.RegionCodes.WESTEUROPE, uksouth: exports.RegionCodes.UKSOUTH, ukwest: exports.RegionCodes.UKSOUTH, francecentral: exports.RegionCodes.WESTEUROPE, francesouth: exports.RegionCodes.WESTEUROPE, germanycentral: exports.RegionCodes.WESTEUROPE, germanynortheast: exports.RegionCodes.NORTHEUROPE, }; exports.luisAuthoringRegions = [ exports.RegionCodes.AUSTRALIAEAST, exports.RegionCodes.WESTEUROPE, exports.RegionCodes.WESTUS, exports.RegionCodes.VIRGINIA ]; exports.luisPublishRegions = [ exports.RegionCodes.AUSTRALIAEAST, exports.RegionCodes.NORTHEUROPE, exports.RegionCodes.WESTEUROPE, exports.RegionCodes.EASTASIA, exports.RegionCodes.SOUTHEASTASIA, exports.RegionCodes.EASTUS, exports.RegionCodes.EASTUS2, exports.RegionCodes.SOUTHCENTRALUS, exports.RegionCodes.WESTCENTRALUS, exports.RegionCodes.WESTUS, exports.RegionCodes.WESTUS2, exports.RegionCodes.BRAZILSOUTH, exports.RegionCodes.VIRGINIA ]; exports.searchRegions = [ exports.RegionCodes.NORTHEUROPE, exports.RegionCodes.WESTEUROPE, exports.RegionCodes.UKSOUTH, exports.RegionCodes.CENTRALINDIA, exports.RegionCodes.SOUTHEASTASIA, exports.RegionCodes.EASTASIA, exports.RegionCodes.JAPANEAST, exports.RegionCodes.AUSTRALIAEAST, exports.RegionCodes.BRAZILSOUTH, exports.RegionCodes.WESTUS, exports.RegionCodes.WESTUS2, exports.RegionCodes.EASTUS, exports.RegionCodes.EASTUS2, exports.RegionCodes.WESTCENTRALUS, exports.RegionCodes.SOUTHCENTRALUS, exports.RegionCodes.CANADACENTRAL ]; const appInsightRegions = [ exports.RegionCodes.SOUTHEASTASIA, exports.RegionCodes.WESTUS2, exports.RegionCodes.SOUTHCENTRALUS, exports.RegionCodes.WESTEUROPE, exports.RegionCodes.NORTHEUROPE, ]; //# sourceMappingURL=utils.js.map