Update typings for getAzureFunctions request (#19556)

This commit is contained in:
Charles Gagnon
2022-05-31 10:20:31 -07:00
committed by GitHub
parent 1e4ff85ed7
commit ccd458b876
2 changed files with 16 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined):
}
// get all the Azure functions in the file
const azureFunctions = getAzureFunctionsResult.azureFunctions;
const azureFunctions = getAzureFunctionsResult.azureFunctions.map(af => typeof (af) === 'string' ? af : af.name);
if (azureFunctions.length === 0) {
void vscode.window.showErrorMessage(constants.noAzureFunctionsInFile);

View File

@@ -121,14 +121,26 @@ declare module 'sql-bindings' {
filePath: string;
}
export interface AzureFunction {
/**
* The name of the function
*/
name: string;
/**
* The route of the function if it has an HTTP trigger with a route specified
*/
route?: string | undefined;
}
/**
* Result from a get Azure Functions request
*/
export interface GetAzureFunctionsResult extends ResultStatus {
export interface GetAzureFunctionsResult {
/**
* Array of names of Azure Functions in the file
* Array of Azure Functions in the file
* Note : The string list response will eventually be deprecated and replaced completely with the AzureFunction list
*/
azureFunctions: string[];
azureFunctions: string[] | AzureFunction[];
}
/**