UNPKG

powerplatform-review-tool

Version:

Evaluate Power Platform solution zip files based on best practice patterns

506 lines (505 loc) 29.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.topicExclusionList = exports.PropertyExclusionList = exports.InnerFunctions = exports.OuterFunctions = exports.RelevantRuleIdsForMediaFileSize = exports.RelevantRuleIdsForUnusedElements = exports.QueryFunctions = exports.AppSettingsList = exports.MEDIA_FILE_SIZE_THRESHOLD = exports.PowerAppsPatternDetails = exports.PowerAppsPatternInfo = exports.BotPatternDetails = exports.FlowPatternDetails = exports.FlowPatternInfo = exports.BotPatternInfo = exports.customizationFileName = exports.XML_MIME_TYPE = void 0; exports.codeToLabel = codeToLabel; // Define a constant for the MIME type exports.XML_MIME_TYPE = "application/xml"; exports.customizationFileName = "customizations.xml"; var BotPatternInfo; (function (BotPatternInfo) { BotPatternInfo["TriggerPhraseCount"] = "TriggerPhraseCount"; BotPatternInfo["SingleWordPhrases"] = "SingleWordPhrases"; BotPatternInfo["LongPhrases"] = "LongPhrases"; BotPatternInfo["ConditionCount"] = "ConditionCount"; BotPatternInfo["SharePointAuthMode"] = "SharePointAuthMode"; BotPatternInfo["FlowCount"] = "FlowCount"; BotPatternInfo["UnusedTopics"] = "UnusedTopics"; BotPatternInfo["SynonymsQuality"] = "SynonymsQuality"; BotPatternInfo["DuplicateRegexEntities"] = "DuplicateRegexEntities"; BotPatternInfo["EndOfConversationReference"] = "EndOfConversationReference"; BotPatternInfo["EvaluateTopicDescription"] = "EvaluateTopicDescription"; })(BotPatternInfo || (exports.BotPatternInfo = BotPatternInfo = {})); var FlowPatternInfo; (function (FlowPatternInfo) { FlowPatternInfo["UnusedVariables"] = "UnusedVariables"; FlowPatternInfo["ActionCount"] = "ActionCount"; FlowPatternInfo["NamingConventions"] = "NamingConventions"; FlowPatternInfo["NestedLoops"] = "NestedLoops"; FlowPatternInfo["Concurrency"] = "Concurrency"; FlowPatternInfo["MultipleInitializeVariableActions"] = "MultipleInitializeVariableActions"; FlowPatternInfo["StaticVariables"] = "StaticVariables"; FlowPatternInfo["PowerAppResponse"] = "PowerAppResponse"; FlowPatternInfo["ScopeUsage"] = "ScopeUsage"; FlowPatternInfo["TriggerCondition"] = "TriggerCondition"; FlowPatternInfo["DataRetrievalParameters"] = "DataRetrievalParameters"; FlowPatternInfo["ActionNote"] = "ActionNote"; FlowPatternInfo["CreateUpdateInsideLoop"] = "CreateUpdateInsideLoop"; })(FlowPatternInfo || (exports.FlowPatternInfo = FlowPatternInfo = {})); exports.FlowPatternDetails = { [FlowPatternInfo.UnusedVariables]: { patternID: "flow-UnusedVariables", patternName: "Unused Variables", description: "Check for variables that are declared but never used.", docLink: "https://go.microsoft.com/fwlink/?linkid=2290320", recommendation: "Remove any variables that are initialized but never used.", severity: "Medium" /* Severity.Medium */, category: "Coding Standards" /* Category.CodingStandards */, }, [FlowPatternInfo.ActionCount]: { patternID: "flow-ActionCount", patternName: "Action Count", description: "Limit the number of actions to optimize flow performance. Checks if a flow exceeds 50 actions.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/create-reusable-code", recommendation: "Reduce the number of actions to improve performance.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [FlowPatternInfo.NamingConventions]: { patternID: "flow-NamingConventions", patternName: "Naming Conventions", description: "Check if trigger starts with 'Trg_' and actions start with 'Act_' prefix for flow components.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/use-consistent-naming-conventions", recommendation: "Follow consistent naming conventions (e.g., CamelCase, prefixes) for triggers, actions, and variables.", severity: "Low" /* Severity.Low */, category: "Maintainability" /* Category.Maintainability */, }, [FlowPatternInfo.NestedLoops]: { patternID: "flow-NestedLoops", patternName: "Nested Loops", description: "Avoid using nested loops for better performance.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/avoid-anti-patterns#avoid-nested-for-each-loops", recommendation: "Optimize flow logic to avoid nested loops.", severity: "High" /* Severity.High */, category: "Performance" /* Category.Performance */, }, [FlowPatternInfo.Concurrency]: { patternID: "flow-Concurrency", patternName: "Concurrency", description: "Verify loops and actions use parallel execution and concurrency settings.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/implement-parallel-execution", recommendation: "Set concurrency limits and enable parallel execution for Foreach loops where appropriate.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [FlowPatternInfo.MultipleInitializeVariableActions]: { patternID: "flow-MultipleInitializeVariableActions", patternName: "Multiple Initialize Variable Actions", description: "Check if 'Initialize Variable' actions are used more than once.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/use-data-operations#json-variables-vs-individual-variables", recommendation: "Combine multiple 'InitializeVariable' actions into a single 'InitializeVariable' action of type object or Use parallel initialization for faster execution.", severity: "Low" /* Severity.Low */, category: "Coding Standards" /* Category.CodingStandards */, }, [FlowPatternInfo.StaticVariables]: { patternID: "flow-StaticVariables", patternName: "Static Variables", description: "Identify variables that are initialized but never updated using Variable actions.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/use-data-operations#variables-vs-compose", recommendation: "Use 'Compose' actions instead of variables that are initialized but never updated.", severity: "Low" /* Severity.Low */, category: "Optimization" /* Category.Optimization */, }, [FlowPatternInfo.PowerAppResponse]: { patternID: "flow-PowerAppResponse", patternName: "PowerApp Response", description: "Check if a Respond to a Power App or flow action is present in the flow.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/asychronous-flow-pattern", recommendation: "Ensure the response is sent within 120 seconds to avoid potential failures.", severity: "Medium" /* Severity.Medium */, category: "Reliability" /* Category.Reliability */, }, [FlowPatternInfo.ScopeUsage]: { patternID: "flow-ScopeUsage", patternName: "Scope Usage", description: "Check if the flow has a lot of actions and lacks any 'Scope' action.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/create-scopes", recommendation: "Use Scopes to group actions and implement error handling (with Run After conditions) to handle failures gracefully.", severity: "Low" /* Severity.Low */, category: "Coding Standards" /* Category.CodingStandards */, }, [FlowPatternInfo.TriggerCondition]: { patternID: "flow-TriggerCondition", patternName: "Trigger Condition", description: "Check if flow triggers are configured to prevent infinite runs.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/optimize-power-automate-triggers#set-trigger-conditions", recommendation: "Define trigger conditions to avoid unnecessary flow executions. This ensures that the flow only runs when specific conditions are met.", severity: "High" /* Severity.High */, category: "Validation" /* Category.Validation */, }, [FlowPatternInfo.DataRetrievalParameters]: { patternID: "flow-DataRetrievalParameters", patternName: "Data Retrieval Parameters", description: "Check if the flow uses filter, select, top count metadata in get actions of Dataverse or Sharepoint", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/work-with-relevant-data", recommendation: "Get actions need to get only relevant data to be used in flow in terms of row and column count. Use top, filter, select parameters to retrieve only required data.", severity: "Medium" /* Severity.Medium */, category: "Optimization" /* Category.Optimization */, }, [FlowPatternInfo.ActionNote]: { patternID: "flow-ActionNote", patternName: "Action Note", description: "Ensure every action has a non-empty description.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/use-peekcode-addnotes#add-notes", recommendation: "Add meaningful notes/descriptions to all actions for better documentation and maintainability.", severity: "Low" /* Severity.Low */, category: "Mantainability" /* Category.Mantainability */, }, [FlowPatternInfo.CreateUpdateInsideLoop]: { patternID: "flow-CreateUpdateInsideLoop", patternName: "Create/Update Inside Loop", description: "Check if Create/Update actions are inside a loop action.", docLink: "https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/avoid-anti-patterns#avoid-using-for-each-loop-to-update-large-numbers-of-records", recommendation: "Avoid using Create/Update actions to create/update large number of records inside loops. Use BulkOperations APIs or batch processing for better performance.", severity: "High" /* Severity.High */, category: "Performance" /* Category.Performance */, }, }; exports.BotPatternDetails = { [BotPatternInfo.TriggerPhraseCount]: { patternID: "bot-TriggerPhraseCount", patternName: "Trigger Phrase Count", description: "This pattern ensures that each topic contains at least 5 trigger phrases, which helps bots respond to a wider variety of user queries.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/trigger-phrases-best-practices#2", recommendation: "Ensure each topic has at least 5 trigger queries.", severity: "Medium" /* Severity.Medium */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.SingleWordPhrases]: { patternID: "bot-SingleWordPhrases", patternName: "Single Word Phrases", description: "This pattern identifies single-word trigger phrases, recommending the use of multi-word phrases for more accurate and meaningful responses.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/trigger-phrases-best-practices#3", recommendation: "Ensure all trigger phrases are more than one word.", severity: "Medium" /* Severity.Medium */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.LongPhrases]: { patternID: "bot-LongPhrases", patternName: "Long Phrases", description: "This pattern flags trigger phrases that exceed 10 words in length, encouraging shorter and more concise queries for better bot performance.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/trigger-phrases-best-practices#4", recommendation: "Ensure all trigger phrases have fewer than 10 words.", severity: "Low" /* Severity.Low */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.ConditionCount]: { patternID: "bot-ConditionCount", patternName: "Condition Count", description: "Checks if topics have too many condition action branches.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance", recommendation: "Consider breaking the topic into subtopics and redirect the conversation to those subtopics to improve maintainability.", severity: "Medium" /* Severity.Medium */, category: "Maintainability" /* Category.Maintainability */, }, [BotPatternInfo.SharePointAuthMode]: { patternID: "bot-SharePointAuthMode", patternName: "SharePoint Auth Mode", description: "Checks if Agent has any SharePoint knowledge sources and is using 'No Authentication' as authentication mode.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance", recommendation: "Ensure an Agent with SharePoint sources use 'Authenticate Manually' or 'Authenticate with Microsoft' for authentication mode.", severity: "Medium" /* Severity.Medium */, category: "Security" /* Category.Security */, }, [BotPatternInfo.FlowCount]: { patternID: "bot-FlowCount", patternName: "Flow Count", description: "Checks the number of unique flowIds used in InvokeFlowAction and fails if more than 10 are found.", docLink: "https://learn.microsoft.com/en-us/power-platform", recommendation: "Reduce the usage of flows(no more than 10 flows) to optimize performance and maintainability.", severity: "Medium" /* Severity.Medium */, category: "Data" /* Category.Data */, }, [BotPatternInfo.UnusedTopics]: { patternID: "bot-UnusedTopics", patternName: "Unused Topics", description: "Checks for topics that do not have trigger phrases and are not referenced in any other topics.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance", recommendation: "Consider removing unused topics to keep the bot optimized.", severity: "Medium" /* Severity.Medium */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.SynonymsQuality]: { patternID: "bot-SynonymsQuality", patternName: "Synonyms Quality", description: "Checks synonyms in ClosedListEntity items to ensure no synonym exceeds 2 words.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance", recommendation: "Synonyms should only be keywords (no more than 2 words).", severity: "Medium" /* Severity.Medium */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.DuplicateRegexEntities]: { patternID: "bot-DuplicateRegexEntities", patternName: "Duplicate Regex Entities", description: "Checks if multiple RegexEntity entities share the exact same pattern.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance", recommendation: "Use unique regex patterns to avoid confusion or conflicts.", severity: "Medium" /* Severity.Medium */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.EndOfConversationReference]: { patternID: "bot-EndOfConversationReference", patternName: "End Of Conversation Usage", description: "Checks if there is at least one End Of Conversation topic (with CancelOtherTopics and a Resolved outcome), and at least one topic referencing it.", docLink: "https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance", recommendation: "Ensure you have an EndOfConversation topic with 'startBehavior: CancelOtherTopics' and conversationOutcome: ResolvedImplied Or conversationOutcome: ResolvedConfirmed and it is referenced by at least one topic to properly end the conversation. Without this, no analytics is collected(no CSAT).", severity: "High" /* Severity.High */, category: "Usage" /* Category.Usage */, }, [BotPatternInfo.EvaluateTopicDescription]: { patternID: "bot-ai-EvaluateTopicDescription", patternName: "Meaningful Topic Description ", description: "Checks the quality of a topic's modelDescription via AI.", recommendation: "Please add a meaningful description to the topic.", docLink: "", severity: "Medium" /* Severity.Medium */, category: "Usage" /* Category.Usage */, }, }; var PowerAppsPatternInfo; (function (PowerAppsPatternInfo) { PowerAppsPatternInfo["MediaFileSize"] = "MediaFileSize"; PowerAppsPatternInfo["AppSettings"] = "AppSettings"; PowerAppsPatternInfo["AppCheckerAccessibilityIssues"] = "AppCheckerAccessibilityIssues"; PowerAppsPatternInfo["UnusedElements"] = "UnusedElements"; PowerAppsPatternInfo["NPlusOne"] = "NPlusOne"; PowerAppsPatternInfo["ErrorHandling"] = "ErrorHandling"; PowerAppsPatternInfo["CodeReadability"] = "CodeReadability"; PowerAppsPatternInfo["InefficientDataRetrieval"] = "InefficientDataRetrieval"; PowerAppsPatternInfo["NestedFilters"] = "NestedFilters"; PowerAppsPatternInfo["PatchFormulaOptimization"] = "PatchFormulaOptimization"; PowerAppsPatternInfo["NestedAPICalls"] = "NestedAPICalls"; PowerAppsPatternInfo["NamedFormulas"] = "NamedFormulas"; PowerAppsPatternInfo["UxLayout"] = "UxLayout"; PowerAppsPatternInfo["UnusedMediaResources"] = "UnusedMediaResources"; PowerAppsPatternInfo["InefficientDelayLoading"] = "InefficientDelayLoading"; })(PowerAppsPatternInfo || (exports.PowerAppsPatternInfo = PowerAppsPatternInfo = {})); exports.PowerAppsPatternDetails = { [PowerAppsPatternInfo.MediaFileSize]: { patternID: "app-AssetOptimization", patternName: "Asset Optimization", description: "Review embedded asset compression/size optimization. Validate apps respect limitations related to media and audio asset sizes.", docLinks: "", recommendation: "Ensure that all files do not exceed 300KB file size. Please consider compressing the files using optimized file formats (e.g., SVG for icons, WebP for images), and limiting media file sizes.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.AppSettings]: { patternID: "app-AppSettings", patternName: "App Settings flags", description: "Ensure that all necessary settings are enabled for optimal performance.", docLinks: "https://www.microsoft.com/en-us/power-platform/blog/power-apps/app-checker-now-includes-performance-optimization-tips/", recommendation: "Please consider turning on the listed settings.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.AppCheckerAccessibilityIssues]: { patternID: "app-Accessibility", patternName: "Accessibility", description: "Review accessibility checker. Notes: Alternate Text labels can reveal otherwise hidden media and context to users with disabilities. Use natural language text when naming screens to optimize results from screen readers.", docLinks: "https://docs.microsoft.com/power-apps/maker/canvas-apps/accessible-apps", recommendation: "Please address the listed accessibility issues in failure reason.", severity: "High" /* Severity.High */, category: "Accessibility" /* Category.Accessibility */, }, [PowerAppsPatternInfo.UnusedElements]: { patternID: "app-UnusedVariables", patternName: "Formulas, Controls with Low/No Usage", description: "This pattern refers to any formulas, assets, or controls that might be included in the app, but are potentially unnecessary, redundant, or not used.", docLinks: "https://docs.microsoft.com/powerapps/maker/canvas-apps/performance-tips", recommendation: "Remove or reference the unused variables to optimize performance.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.NPlusOne]: { patternID: "app-CheckForNplusOneCalls", patternName: "N+1 Database or API requests", description: "N+1 query, which are used often in galleries, can trigger too many requests to servers. Optimize data retrieval to reduce the number of requests.", docLinks: "https://powerapps.microsoft.com/blog/considerations-for-optimized-performance-in-power-apps", recommendation: "Consider optimizing data retrieval to reduce the number of requests.", severity: "High" /* Severity.High */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.ErrorHandling]: { patternID: "app-ErrorHandling", patternName: "Error Handling", description: "Always ensure apps have appropriate error handling methods. It is best to use the IfError() function to manage data validation for Patch() commands and the OnSuccess/OnFail properties when submitting form data.", docLinks: "https://docs.microsoft.com/powerapps/maker/canvas-apps/functions/function-iferror", recommendation: "Implement error handling using IfError() or similar mechanisms.", severity: "Low" /* Severity.Low */, category: "Coding Standards" /* Category.CodingStandards */, }, [PowerAppsPatternInfo.CodeReadability]: { patternID: "app-CodeReadability", patternName: "Code Readability", description: "Avoid expressions or formulas that are very long as they will become hard to read. Examples include, but are not limited to nested If/Then/Else statements and nested operators such as OR or AND.", docLinks: "", recommendation: "Simplify code to improve readability.", severity: "Low" /* Severity.Low */, category: "Maintainability" /* Category.Maintainability */, }, [PowerAppsPatternInfo.InefficientDataRetrieval]: { patternID: "app-FormulaOptimization-FirstFilter", patternName: "Inefficient Data Retrieval", description: "Using Filter or Search inside First or Last functions with external data sources.", docLinks: "https://docs.microsoft.com/powerapps/maker/canvas-apps/performance-tips", recommendation: "Optimize data retrieval by avoiding inefficient use of functions.", severity: "High" /* Severity.High */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.NestedFilters]: { patternID: "app-FormulaOptimization-NestedFilter", patternName: "Nested Filters", description: "Consider simplifying nested formulas with Search() and Filter() operations. Avoiding the nesting of these two together leads to a more compact/concise formula and performance improvement.", docLinks: "", recommendation: "Simplify nested filters to improve performance.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.PatchFormulaOptimization]: { patternID: "app-FormulaOptimization-Patch", patternName: "Patch Formula Optimization", description: "Ensure the second parameter is not using a LookUp() function. It is a best practice to use ThisItem whenever patching from a gallery or { id: userid }.", docLinks: "", recommendation: "Optimize Patch formulas by avoiding unnecessary LookUp() functions.", severity: "Low" /* Severity.Low */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.NestedAPICalls]: { patternID: "app-FormulaOptimization-NestedApiCalls", patternName: "Nested API Calls", description: "Avoid making API calls within Filter() and LookUp() operations in combination.", docLinks: "", recommendation: "Avoid nesting API calls to improve performance.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.NamedFormulas]: { patternID: "app-NamedFormulas", patternName: "Named Formulas", description: "Use Named Formulas to improve performance and maintainability by defining formulas that can be reused throughout the app.", docLinks: "https://learn.microsoft.com/en-us/power-platform/power-fx/formula-reuse-named-formulas", recommendation: "Utilize Named Formulas for better code reuse and maintainability.", severity: "Low" /* Severity.Low */, category: "Maintainability" /* Category.Maintainability */, }, [PowerAppsPatternInfo.UxLayout]: { patternID: "app-UxLayout", patternName: "UX Layout", description: "Use containers to make responsive apps.", docLinks: "https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/create-responsive-layout", recommendation: "Implement responsive design using containers.", severity: "Low" /* Severity.Low */, category: "UX" /* Category.UX */, }, [PowerAppsPatternInfo.UnusedMediaResources]: { patternID: "app-UnusedMediaResources", patternName: "Unused Media Resources", description: "Checks if the app has any media resources which are not referenced/used in the app.", docLinks: "", recommendation: "Remove or reference the unused media files to optimize performance.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, [PowerAppsPatternInfo.InefficientDelayLoading]: { patternID: "app-InefficientDelayLoading", patternName: "Inefficient Delay Loading", description: "Checks if there are any delay loading issues flagged by the App Checker (ruleId: app-InefficientDelayLoading). ", docLinks: "", recommendation: "Referencing controls from other screens can impact app performance by slowing down loading and navigation. Use variables, collections, and navigation context to share state across screens.", severity: "Medium" /* Severity.Medium */, category: "Performance" /* Category.Performance */, }, }; exports.MEDIA_FILE_SIZE_THRESHOLD = 300 * 1024; // 300KB exports.AppSettingsList = [ "sharepointselectsenabled", "enableupdateifdelegation", "mobilenativerendering", "keeprecentscreensloaded", ]; exports.QueryFunctions = ["Filter", "LookUp", "Search", "CountRows", "ForAll", "Patch"]; exports.RelevantRuleIdsForUnusedElements = ["app-UnusedVariables"]; exports.RelevantRuleIdsForMediaFileSize = ["app-UnusedMediaResources"]; // New constants for the pattern exports.OuterFunctions = ["First", "Last"]; exports.InnerFunctions = ["Filter", "Search"]; exports.PropertyExclusionList = [ "X", "Y", "PaddingBottom", "PaddingTop", "PaddingLeft", "PaddingRight", "Height", "Width", "HoverBorderColor", "BorderColor", "FocusedBorderColor", "PressedFill", "HoverFill", "PressedBorderColor", "PressedColor", "Size", "DisabledBorderColor", "LoadingSpinnerColor", "DisabledFill", "Align", "Padding", "Margin", "LineHeight", "TextAlign", "VerticalAlign", "BorderStyle", "BorderRadius", "BorderThickness", "FontSize", "FontWeight", "FontStyle", "FontFamily", "LineHeight", ]; exports.topicExclusionList = [ "ConversationStart", "EndofConversation", "MultipleTopicsMatched", "OnError", "ResetConversation", "Search", "Signin", "Escalate", "Fallback", "Goodbye", "Greeting", "ThankYou", "StartOver", ]; /** Map numeric componenttype codes to readable labels used in Agents.botComponents[]. */ function codeToLabel(code, yamlKind) { switch (code) { case 9 /* BotComponentType.TopicV2 */: // if (yamlKind === "AdaptiveDialog") return "topic"; if (yamlKind === "TaskDialog") return "action"; return "topic"; /* default TopicV2 */ case 11 /* BotComponentType.BotEntityV2 */: return "entity"; case 16 /* BotComponentType.KnowledgeSource */: return "knowledge"; case 14 /* BotComponentType.BotFileAttachment */: return "fileAttachment"; case 12 /* BotComponentType.BotVariableV2 */: return "globalVariable"; case 13 /* BotComponentType.SkillV2 */: return "skill"; case 15 /* BotComponentType.CustomGPT */: return "customGPT"; case 17 /* BotComponentType.ExternalTrigger */: return "externalTrigger"; case 18 /* BotComponentType.CopilotSettings */: return "copilotSettings"; case 10 /* BotComponentType.BotTranslationsV2 */: return "translations"; default: return "UnknownComponentType"; } }