in tools/botskills/src/utils/validationUtils.ts [75:114]
export function manifestV2Validation(skillManifest: ISkillManifestV2, logger: ILogger, endpointName?: string): void {
if (skillManifest.$schema === undefined || skillManifest.$schema === '') {
logger.error(`Missing property '$schema' of the manifest`);
}
if (skillManifest.$id === undefined || skillManifest.$id === '') {
logger.error(`Missing property '$id' of the manifest`);
} else if (skillManifest.$id.match(/^\d|[^\w]/g) !== null) {
logger.error(`The '$id' of the manifest contains some characters not allowed. Make sure the '$id' contains only letters, numbers and underscores, but doesn't start with number.`);
}
if (skillManifest.endpoints === undefined || skillManifest.endpoints.length === 0) {
logger.error(`Missing property 'endpoints' of the manifest`);
} else {
let currentEndpoint = skillManifest.endpoints.find((endpoint): boolean => endpoint.name == endpointName) || skillManifest.endpoints[0];
if (currentEndpoint.name === undefined || currentEndpoint.name === ''){
logger.error(`Missing property 'name' at the selected endpoint. If you didn't select any endpoint, the first one is taken by default`);
}
if (currentEndpoint.msAppId === undefined || currentEndpoint.msAppId === ''){
logger.error(`Missing property 'msAppId' at the selected endpoint. If you didn't select any endpoint, the first one is taken by default`);
} else if (currentEndpoint.msAppId.match(/^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$/g) === null) {
logger.error(`The 'msAppId' property of the selected endpoint contains invalid characters or does not comply with the GUID format. If you didn't select any endpoint, the first one is taken by default.`);
}
if (currentEndpoint.endpointUrl === undefined || currentEndpoint.endpointUrl === ''){
logger.error(`Missing property 'endpointUrl' at the selected endpoint. If you didn't select any endpoint, the first one is taken by default`);
} else if (currentEndpoint.endpointUrl.match(/^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$/g) === null) {
logger.error(`The 'endpointUrl' property of the selected endpoint contains invalid characters or does not comply with the URL format. If you didn't select any endpoint, the first one is taken by default.`);
}
}
if (skillManifest.dispatchModels === undefined || Object.keys(skillManifest.dispatchModels).length === 0) {
logger.error(`Missing property 'dispatchModels' of the manifest`);
}
if (!skillManifest.activities || Object.keys(skillManifest.activities).length === 0) {
logger.error(`Missing property 'activities' of the manifest`);
}
}