File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ const generateFileUrl = async (file: string, conn: Connection): Promise<string>
176176 const typeName = components [ 0 ] ?. type ?. name ;
177177
178178 switch ( typeName ) {
179+ case 'Bot' :
180+ return `AiCopilot/copilotStudio.app#/copilot/builder?copilotId=${ await botFileNameToId ( conn , file ) } ` ;
179181 case 'ApexPage' :
180182 return `/apex/${ path . basename ( file ) . replace ( '.page-meta.xml' , '' ) . replace ( '.page' , '' ) } ` ;
181183 case 'Flow' :
@@ -193,6 +195,13 @@ const generateFileUrl = async (file: string, conn: Connection): Promise<string>
193195 }
194196} ;
195197
198+ const botFileNameToId = async ( conn : Connection , filePath : string ) : Promise < string > =>
199+ (
200+ await conn . singleRecordQuery < { Id : string } > (
201+ `SELECT id FROM BotDefinition WHERE DeveloperName='${ path . basename ( filePath , '.bot-meta.xml' ) } '`
202+ )
203+ ) . Id ;
204+
196205/** query flexipage via toolingPAI to get its ID (starts with 0M0) */
197206const flexiPageFilenameToId = async ( conn : Connection , filePath : string ) : Promise < string > =>
198207 (
@@ -228,7 +237,7 @@ const getFileContents = (
228237 <body onload="document.body.firstElementChild.submit()">
229238 <form method="POST" action="${ instanceUrl } /secur/frontdoor.jsp">
230239 <input type="hidden" name="sid" value="${ authToken } " />
231- <input type="hidden" name="retURL" value="${ retUrl } " />
240+ <input type="hidden" name="retURL" value="${ retUrl } " />
232241 </form>
233242 </body>
234243</html>` ;
You can’t perform that action at this time.
0 commit comments