UNPKG

powerplatform-review-tool

Version:

Evaluate Power Platform solution zip files based on best practice patterns

818 lines (817 loc) 54.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReviewSchema = void 0; class ReviewSchema { static getReviewSchema() { return { ReviewResults: { $schema: "http://json-schema.org/draft-04/schema#", type: "object", properties: { Copilot: { type: "object", properties: { items: { type: "array", items: { type: "object", properties: { name: { type: "string" }, displayName: { type: "string" }, result: { type: "array", items: { type: "object", properties: { patternName: { type: "string" }, patternID: { type: "string" }, status: { type: "string" }, instanceValue: { type: "array", items: { type: "object", properties: { Topic: { type: "array", items: { type: "object", properties: { TopicName: { type: "string" }, InvalidTriggerQueries: { type: "array", items: { type: "string" }, }, }, }, }, Flows: { type: "array", items: { type: "string" }, }, KnowledgeSource: { type: "array", items: { type: "string" }, }, Entity: { type: "object", properties: { RegexEntity: { type: "array", items: { type: "object", properties: { name: { type: "string" }, pattern: { type: "string" }, matchingPatternEntityList: { type: "array", items: { type: "string" }, }, }, }, }, }, }, }, }, }, failureReason: { type: "string" }, recommendation: { type: "string" }, docLinks: { type: "string", format: "uri" }, category: { type: "string" }, description: { type: "string" }, severity: { type: "string" }, }, }, }, score: { type: "string" }, }, }, }, totalBots: { type: "integer" }, totalScore: { type: "string" }, }, }, PowerAutomate: { type: "object", properties: { items: { type: "array", items: { type: "object", properties: { name: { type: "string" }, displayName: { type: "string" }, result: { type: "array", items: { type: "object", properties: { patternName: { type: "string" }, patternID: { type: "string" }, status: { type: "string" }, instanceValue: { type: "array", items: { type: "string" }, }, failureReason: { type: "string" }, recommendation: { type: "string" }, docLinks: { type: "string", format: "uri" }, category: { type: "string" }, description: { type: "string" }, severity: { type: "string" }, }, }, }, score: { type: "string" }, }, }, }, totalFlows: { type: "integer" }, totalScore: { type: "string" }, }, }, PowerApps: { type: "object", properties: { items: { type: "array", items: { type: "object", properties: { name: { type: "string" }, displayName: { type: "string" }, totalScreens: { type: "integer" }, totalCanvasComponents: { type: "integer" }, totalCodeComponents: { type: "integer" }, result: { type: "array", items: { type: "object", properties: { patternName: { type: "string" }, patternID: { type: "string" }, status: { type: "string" }, instanceValue: { type: "array", items: { type: "object", properties: { ScreenName: { type: "string" }, ControlName: { type: "string" }, PropertyName: { type: "string" }, Code: { type: "string" }, PatternName: { type: "string" }, ControlType: { type: "string" }, FailedPowerFxCode: { type: "string" }, FailureReason: { type: "string" }, }, }, }, failureReason: { type: "string" }, recommendation: { type: "string" }, docLinks: { type: "string", format: "uri" }, category: { type: "string" }, description: { type: "string" }, severity: { type: "string" }, }, }, }, score: { type: "string" }, }, }, }, totalApps: { type: "integer" }, totalScore: { type: "string" }, }, }, SolutionScore: { type: "string", }, }, }, SolutionDetails: { $schema: "http://json-schema.org/draft-04/schema#", type: "object", properties: { solutionOverview: { type: "object", properties: { displayName: { type: "string" }, uniqueName: { type: "string" }, description: { type: "string" }, version: { type: "string" }, solutionType: { type: "string" }, }, required: ["displayName", "uniqueName", "version"], }, canvasApps: { type: "array", items: { type: "object", properties: { appName: { type: "string" }, appDescription: { type: "string" }, screens: { type: "array", items: { type: "object", properties: { screenName: { type: "string" }, screenYaml: { type: "string" }, }, required: ["screenName", "screenYaml"], }, }, sarifLog: { type: "object", properties: { runs: { type: "array", items: { type: "object", properties: { tool: { type: "object", properties: { driver: { type: "object", properties: { name: { type: "string" }, rules: { type: "array", items: { type: "object", properties: { id: { type: "string" }, properties: { type: "object", properties: { howToFix: { type: "string" }, whyFix: { type: "string" }, primaryCategory: { type: "string" }, }, additionalProperties: true, }, messageStrings: { type: "object", properties: { issue: { type: "object", properties: { text: { type: "string" }, }, }, }, }, }, required: ["id"], }, }, }, required: ["name", "rules"], }, }, required: ["driver"], }, results: { type: "array", items: { type: "object", properties: { ruleId: { type: "string" }, messageStrings: { type: "object", properties: { issue: { type: "object", properties: { text: { type: "string" }, }, }, }, }, locations: { type: "array", items: { type: "object", properties: { physicalLocation: { type: "object", properties: { address: { type: "object", properties: { fullyQualifiedName: { type: "string" }, }, }, }, }, }, }, }, properties: { type: "object", properties: { level: { type: "string" }, }, additionalProperties: true, }, }, required: ["ruleId"], }, }, }, required: ["tool", "results"], }, }, }, required: ["runs"], }, }, required: ["appName", "appDescription", "screens", "sarifLog"], }, }, tables: { type: "array", items: { type: "object", properties: { DisplayName: { type: "string" }, SchemaName: { type: "string" }, Description: { type: "string" }, Fields: { type: "array", items: { type: "object", properties: { Name: { type: "string" }, SchemaName: { type: "string" }, DataType: { type: "string" }, }, required: ["Name", "SchemaName", "DataType"], }, }, Relationships: { type: "object", properties: { OneToMany: { type: "array", items: { type: "object", properties: { SchemaName: { type: "string" }, ReferencingEntity: { type: "string" }, ReferencingAttribute: { type: "string" }, ReferencedEntity: { type: "string" }, }, required: ["SchemaName", "ReferencingEntity", "ReferencingAttribute", "ReferencedEntity"], }, }, ManyToOne: { type: "array", items: { type: "object" }, }, ManyToMany: { type: "array", items: { type: "object", properties: { SchemaName: { type: "string" }, Entity1LogicalName: { type: "string" }, Entity2LogicalName: { type: "string" }, }, required: ["SchemaName", "Entity1LogicalName", "Entity2LogicalName"], }, }, }, }, }, required: ["DisplayName", "SchemaName", "Fields", "Relationships"], }, }, workflows: { type: "array", items: { type: "object", properties: { name: { type: "string" }, primaryEntity: { type: "string" }, category: { type: "string" }, json: { type: "string" }, }, required: ["name", "primaryEntity", "category"], }, }, codeComponents: { type: "array", items: { type: "object", properties: { displayName: { type: "string" }, description: { type: "string" }, type: { type: "string" }, version: { type: "string" }, }, required: ["displayName", "description", "type", "version"], }, }, customApis: { type: "array", items: { type: "object", properties: { displayName: { type: "string" }, description: { type: "string" }, isPrivate: { type: "boolean" }, isFunction: { type: "boolean" }, }, required: ["displayName", "description", "isPrivate", "isFunction"], }, }, environmentVariables: { type: "array", items: { type: "object", properties: { displayName: { type: "string" }, description: { type: "string" }, type: { type: "string" }, }, required: ["displayName", "description", "type"], }, }, securityRoles: { type: "array", items: { type: "object", properties: { name: { type: "string" }, }, }, }, plugins: { type: "array", items: { type: "object", properties: { Name: { type: "string" }, }, }, }, mermaidERDiagramExpression: { type: "string", }, mermaidSolutionOverviewExpression: { type: "string", }, mermaidSolutionArchitectureExpressions: { type: "array", items: { type: "string", }, }, connectionReferences: { type: "array", items: { type: "object", properties: { LogicalName: { type: "string" }, DisplayName: { type: "string" }, ConnectorID: { type: "string" }, }, }, }, aiModels: { type: "array", items: { type: "object", properties: { Name: { type: "string" }, Model: { type: "string" }, }, }, }, missingDependencies: { type: "array", items: { type: "object", properties: { Required: { type: "object", properties: { Type: { type: "string" }, SchemaName: { type: "string" }, DisplayName: { type: "string" }, Solution: { type: "string" }, }, }, Dependent: { type: "object", properties: { Type: { type: "string" }, SchemaName: { type: "string" }, DisplayName: { type: "string" }, }, }, }, }, }, agents: { type: "array", items: { type: "object", properties: { botLogicalName: { type: "string" }, botDisplayName: { type: "string" }, botXml: { type: "string" }, botConfig: { type: "object" }, authenticationmode: { type: "string" }, isGenModeEnabled: { type: "boolean" }, /* Flattened component list – avoids nested dictionaries */ botComponents: { type: "array", items: { type: "object", properties: { componentType: { type: "string" }, name: { type: "string" }, botComponentXml: { type: "string" }, data: { type: "object" }, description: { type: "string" }, isEnabled: { type: "boolean" }, }, required: ["componentType", "name"], }, }, /* -------- topic subset only for now -------------------- */ topics: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, modelDescription: { type: "string" }, description: { type: "string" }, triggerQueries: { type: "array", items: { type: "string" }, }, inputType: { type: "array", items: { type: "object", properties: { variableName: { type: "string" }, displayName: { type: "string" }, description: { type: "string" }, type: { type: "string" }, }, required: ["variableName"], }, }, outputType: { type: "array", items: { type: "object", properties: { variableName: { type: "string" }, displayName: { type: "string" }, description: { type: "string" }, type: { type: "string" }, }, required: ["variableName"], }, }, isEnabled: { type: "boolean" }, }, required: ["name", "isEnabled"], }, }, entities: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, description: { type: "string" }, kind: { type: "string" }, pattern: { type: "string" }, items: { type: "array", items: { type: "object", properties: { displayName: { type: "string" }, synonyms: { type: "array", items: { type: "string" }, }, }, required: ["displayName"], }, }, isEnabled: { type: "boolean" }, }, required: ["name", "kind"], }, }, knowledge: { type: "array", items: { type: "object", properties: { name: { type: "string" }, description: { type: "string" }, isEnabled: { type: "boolean" }, kind: { type: "string" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, siteSearchKind: { type: "string" }, site: { type: "string" }, skillConfiguration: { type: "string" }, }, required: ["name", "isEnabled"], }, }, fileAttachments: { type: "array", items: { type: "object", properties: { name: { type: "string" }, description: { type: "string" }, isEnabled: { type: "boolean" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, // may be null }, required: ["name", "isEnabled"], }, }, globalVariables: { type: "array", items: { type: "object", properties: { name: { type: "string" }, description: { type: "string" }, isEnabled: { type: "boolean" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, isExternalInitializationAllowed: { type: "boolean" }, scope: { type: "string" }, aIVisibility: { type: "string" }, initializationTimeoutInMilliseconds: { type: "integer" }, }, required: ["name", "isEnabled"], }, }, /* Inside agents → items → properties (same level as `globalVariables`) */ actions: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, description: { type: "string" }, modelDisplayName: { type: "string" }, modelDescription: { type: "string" }, actionKind: { type: "string" }, outputMode: { type: "string" }, isEnabled: { type: "boolean" }, inputs: { type: "array", items: { type: "object", properties: { kind: { type: "string" }, propertyName: { type: "string" }, name: { type: "string" }, description: { type: "string" }, value: { type: "string" }, entity: { type: "string" }, shouldPromptUser: { type: "boolean" }, }, required: ["kind", "propertyName"], }, }, outputs: { type: "array", items: { type: "object", properties: { propertyName: { type: "string" }, description: { type: "string" }, }, required: ["propertyName"], }, }, }, required: ["name", "isEnabled"], }, }, externalTriggers: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, description: { type: "string" }, isEnabled: { type: "boolean" }, externalTriggerSourceKind: { type: "string" }, flowId: { type: "string" }, flowName: { type: "string" }, flowUrl: { type: "string" }, triggerConnectionType: { type: "string" }, }, required: ["name", "isEnabled"], }, }, customGPT: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rawXml: { type: "string" }, rawYamlData: { type: "string" }, description: { type: "string" }, isEnabled: { type: "boolean" }, instructions: { type: "string" }, conversationStarters: { type: "array", items: { type: "object", properties: { title: { type: "string" }, text: { type: "string" }, }, required: ["title", "text"], }, }, }, required: ["name", "isEnabled"], }, }, //customGPT: { type: "array", items: { type: "object" } }, //externalTriggers: { type: "array", items: { type: "object" } }, }, required: ["botLogicalName", "botDisplayName"], }, }, }, required: [ "solutionOverview", "canvasApps", "tables", "workflows", "codeComponents", "customApis", "environmentVariables", "securityRoles", "plugins", "connectionReferences", "aiModels", "missingDependencies", ], }, SARIFLog: { $schema: "http://json-schema.org/draft-04/schema#", type: "object", properties: { version: { type: "string" }, runs: { type: "array", items: { type: "object", properties: { tool: { type: "object", properties: { driver: { type: "object", properties: { name: { type: "string" }, informationUri: { type: "string", format: "uri" }, rules: { type: "array", items: { type: "object", properties: { id: { type: "string" }, name: { type: "string" }, fullDescription: { type: "object", properties: { text: { type: "string" }, }, }, help: { type: "object",