@microsoft/vscode-azext-azureappservice
Advanced tools
Comparing version 0.7.7 to 0.8.0
@@ -0,4 +1,4 @@ | ||
import { AzExtLocation } from '@microsoft/vscode-azext-azureutils'; | ||
import { AzureWizardPromptStep } from '@microsoft/vscode-azext-utils'; | ||
import { IAppServiceWizardContext } from './IAppServiceWizardContext'; | ||
import { AzExtLocation } from '@microsoft/vscode-azext-azureutils'; | ||
interface AppServiceWizardContext extends IAppServiceWizardContext { | ||
@@ -5,0 +5,0 @@ _location: AzExtLocation; |
@@ -59,3 +59,3 @@ "use strict"; | ||
]; | ||
return allowedServicePlan.includes(family); | ||
return !!family && allowedServicePlan.includes(family); | ||
} | ||
@@ -62,0 +62,0 @@ shouldPrompt(context) { |
@@ -17,3 +17,2 @@ "use strict"; | ||
exports.delayFirstWebAppDeploy = void 0; | ||
const createKuduClient_1 = require("../createKuduClient"); | ||
function delayFirstWebAppDeploy(context, site, aspPromise) { | ||
@@ -36,4 +35,4 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, site); | ||
const deployments = (yield kuduClient.deployment.getDeployResults()).length; | ||
const kuduClient = yield site.createClient(context); | ||
const deployments = (yield kuduClient.getDeployResults(context)).length; | ||
if (deployments > 1) { | ||
@@ -40,0 +39,0 @@ resolve(); |
@@ -19,3 +19,2 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
const createKuduClient_1 = require("../createKuduClient"); | ||
const localize_1 = require("../localize"); | ||
@@ -29,4 +28,4 @@ const pathUtils_1 = require("../utils/pathUtils"); | ||
} | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, site); | ||
yield kuduClient.pushDeployment.warPushDeploy(() => fs.createReadStream(fsPath), { | ||
const kuduClient = yield site.createClient(context); | ||
yield kuduClient.warPushDeploy(context, () => fs.createReadStream(fsPath), { | ||
isAsync: true, | ||
@@ -33,0 +32,0 @@ author: constants_1.publisherName, |
@@ -18,3 +18,2 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
const createKuduClient_1 = require("../createKuduClient"); | ||
const delayFirstWebAppDeploy_1 = require("./delayFirstWebAppDeploy"); | ||
@@ -25,10 +24,10 @@ const runWithZipStream_1 = require("./runWithZipStream"); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, site); | ||
const kuduClient = yield site.createClient(context); | ||
const response = yield (0, runWithZipStream_1.runWithZipStream)(context, { | ||
fsPath, site, pathFileMap, | ||
callback: (zipStream) => __awaiter(this, void 0, void 0, function* () { | ||
return yield kuduClient.pushDeployment.zipPushDeploy(() => zipStream, { | ||
isAsync: true, | ||
return yield kuduClient.zipPushDeploy(context, () => zipStream, { | ||
author: constants_1.publisherName, | ||
deployer: constants_1.publisherName, | ||
isAsync: true, | ||
trackDeploymentId: true | ||
@@ -41,4 +40,4 @@ }); | ||
if (response) { | ||
context.telemetry.properties.deploymentId = response._response.headers.get('scm-deployment-id'); | ||
locationUrl = response._response.headers.get('location'); | ||
context.telemetry.properties.deploymentId = response.headers.get('scm-deployment-id'); | ||
locationUrl = response.headers.get('location'); | ||
} | ||
@@ -45,0 +44,0 @@ } |
/// <reference types="node" /> | ||
import { RestResponse } from '@azure/ms-rest-js'; | ||
import { HttpOperationResponse } from '@azure/ms-rest-js'; | ||
import { IActionContext } from '@microsoft/vscode-azext-utils'; | ||
@@ -10,3 +10,3 @@ import { Readable } from 'stream'; | ||
pathFileMap?: Map<string, string>; | ||
callback: (zipStream: Readable) => Promise<RestResponse | void>; | ||
}): Promise<RestResponse | void>; | ||
callback: (zipStream: Readable) => Promise<HttpOperationResponse | void>; | ||
}): Promise<HttpOperationResponse | void>; |
@@ -20,3 +20,2 @@ "use strict"; | ||
const vscode_1 = require("vscode"); | ||
const createKuduClient_1 = require("../createKuduClient"); | ||
const extensionVariables_1 = require("../extensionVariables"); | ||
@@ -37,3 +36,3 @@ const localize_1 = require("../localize"); | ||
const maxTimeToWaitForExpectedId = Date.now() + 60 * 1000; | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, site); | ||
const kuduClient = yield site.createClient(context); | ||
const { expectedId, token, locationUrl } = options; | ||
@@ -68,3 +67,3 @@ const pollingInterval = (_a = options.pollingInterval) !== null && _a !== void 0 ? _a : 5000; | ||
yield (0, kuduUtils_1.ignore404Error)(context, () => __awaiter(this, void 0, void 0, function* () { | ||
logEntries = (yield kuduClient.deployment.getLogEntry(deploymentId)).reverse(); | ||
logEntries = (yield kuduClient.getLogEntry(context, deploymentId)).reverse(); | ||
})); | ||
@@ -90,3 +89,3 @@ })); | ||
if (newEntry.id && newEntry.detailsUrl) { | ||
const details = yield kuduClient.deployment.getLogEntryDetails(deploymentId, newEntry.id); | ||
const details = yield kuduClient.getLogEntryDetails(context, deploymentId, newEntry.id); | ||
logEntries.push(...cleanDetails(details)); | ||
@@ -135,4 +134,3 @@ } | ||
deployment = yield (0, kuduUtils_1.retryKuduCall)(context, 'getResult', () => __awaiter(this, void 0, void 0, function* () { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return yield kuduClient.deployment.getResult(permanentId); | ||
return yield kuduClient.getDeployResult(context, (0, vscode_azext_utils_1.nonNullValue)(permanentId)); | ||
})); | ||
@@ -144,3 +142,3 @@ } | ||
const latestDeployment = yield (0, kuduUtils_1.retryKuduCall)(context, 'getResult', () => __awaiter(this, void 0, void 0, function* () { | ||
return yield kuduClient.deployment.getResult('latest'); | ||
return yield kuduClient.getDeployResult(context, 'latest'); | ||
})); | ||
@@ -167,3 +165,3 @@ // if the latest deployment is temp, then a deployment has triggered so we should watch it even if it doesn't match the expectedId | ||
const deployments = yield (0, kuduUtils_1.retryKuduCall)(context, 'getDeployResults', () => __awaiter(this, void 0, void 0, function* () { | ||
return yield kuduClient.deployment.getDeployResults(); | ||
return yield kuduClient.getDeployResults(context); | ||
})); | ||
@@ -184,3 +182,3 @@ deployment = deployments | ||
deployment = yield (0, kuduUtils_1.retryKuduCall)(context, 'getResult', () => __awaiter(this, void 0, void 0, function* () { | ||
return yield kuduClient.deployment.getResult('latest'); | ||
return yield kuduClient.getDeployResult(context, 'latest'); | ||
})); | ||
@@ -187,0 +185,0 @@ } |
@@ -0,1 +1,4 @@ | ||
export * from './IAppSettingsClient'; | ||
export * from './SiteClient'; | ||
export * from './TunnelProxy'; | ||
export * from './confirmOverwriteSettings'; | ||
@@ -11,13 +14,15 @@ export * from './createAppService/AppInsightsCreateStep'; | ||
export * from './createAppService/LogAnalyticsCreateStep'; | ||
export * from './createAppService/setLocationsTask'; | ||
export * from './createAppService/SiteNameStep'; | ||
export * from './createAppService/SiteOSStep'; | ||
export * from './createKuduClient'; | ||
export * from './createAppService/setLocationsTask'; | ||
export * from './createSlot'; | ||
export * from './deleteSite/DeleteLastServicePlanStep'; | ||
export * from './deleteSite/DeleteSiteStep'; | ||
export * from './deleteSite/IDeleteSiteWizardContext'; | ||
export * from './deploy/IDeployContext'; | ||
export * from './deploy/deploy'; | ||
export * from './deploy/getDeployFsPath'; | ||
export * from './deploy/getDeployNode'; | ||
export * from './deploy/IDeployContext'; | ||
export * from './deploy/localGitDeploy'; | ||
export { handleFailedPreDeployTask, IPreDeployTaskResult, runPreDeployTask, tryRunPreDeployTask } from './deploy/runDeployTask'; | ||
export { IPreDeployTaskResult, handleFailedPreDeployTask, runPreDeployTask, tryRunPreDeployTask } from './deploy/runDeployTask'; | ||
export * from './deploy/showDeployConfirmation'; | ||
@@ -28,3 +33,2 @@ export { disconnectRepo } from './disconnectRepo'; | ||
export { IConnectToGitHubWizardContext } from './github/IConnectToGitHubWizardContext'; | ||
export * from './IAppSettingsClient'; | ||
export * from './pingFunctionApp'; | ||
@@ -34,10 +38,9 @@ export * from './registerSiteCommand'; | ||
export * from './remoteDebug/startRemoteDebug'; | ||
export * from './SiteClient'; | ||
export * from './siteFiles'; | ||
export * from './startStreamingLogs'; | ||
export * from './swapSlot'; | ||
export * from './tree/AppSettingTreeItem'; | ||
export * from './tree/AppSettingsTreeItem'; | ||
export * from './tree/AppSettingTreeItem'; | ||
export * from './tree/DeploymentTreeItem'; | ||
export * from './tree/DeploymentsTreeItem'; | ||
export * from './tree/DeploymentTreeItem'; | ||
export * from './tree/FileTreeItem'; | ||
@@ -48,6 +51,2 @@ export * from './tree/FolderTreeItem'; | ||
export * from './tryGetSiteResource'; | ||
export * from './TunnelProxy'; | ||
export * from './deleteSite/IDeleteSiteWizardContext'; | ||
export * from './deleteSite/DeleteLastServicePlanStep'; | ||
export * from './deleteSite/DeleteSiteStep'; | ||
export * from './utils/azureClients'; |
@@ -22,2 +22,5 @@ "use strict"; | ||
exports.registerAppServiceExtensionVariables = exports.disconnectRepo = exports.tryRunPreDeployTask = exports.runPreDeployTask = exports.handleFailedPreDeployTask = exports.WebsiteOS = exports.AppKind = void 0; | ||
__exportStar(require("./IAppSettingsClient"), exports); | ||
__exportStar(require("./SiteClient"), exports); | ||
__exportStar(require("./TunnelProxy"), exports); | ||
__exportStar(require("./confirmOverwriteSettings"), exports); | ||
@@ -35,11 +38,13 @@ __exportStar(require("./createAppService/AppInsightsCreateStep"), exports); | ||
__exportStar(require("./createAppService/LogAnalyticsCreateStep"), exports); | ||
__exportStar(require("./createAppService/setLocationsTask"), exports); | ||
__exportStar(require("./createAppService/SiteNameStep"), exports); | ||
__exportStar(require("./createAppService/SiteOSStep"), exports); | ||
__exportStar(require("./createKuduClient"), exports); | ||
__exportStar(require("./createAppService/setLocationsTask"), exports); | ||
__exportStar(require("./createSlot"), exports); | ||
__exportStar(require("./deleteSite/DeleteLastServicePlanStep"), exports); | ||
__exportStar(require("./deleteSite/DeleteSiteStep"), exports); | ||
__exportStar(require("./deleteSite/IDeleteSiteWizardContext"), exports); | ||
__exportStar(require("./deploy/IDeployContext"), exports); | ||
__exportStar(require("./deploy/deploy"), exports); | ||
__exportStar(require("./deploy/getDeployFsPath"), exports); | ||
__exportStar(require("./deploy/getDeployNode"), exports); | ||
__exportStar(require("./deploy/IDeployContext"), exports); | ||
__exportStar(require("./deploy/localGitDeploy"), exports); | ||
@@ -56,3 +61,2 @@ var runDeployTask_1 = require("./deploy/runDeployTask"); | ||
Object.defineProperty(exports, "registerAppServiceExtensionVariables", { enumerable: true, get: function () { return extensionVariables_1.registerAppServiceExtensionVariables; } }); | ||
__exportStar(require("./IAppSettingsClient"), exports); | ||
__exportStar(require("./pingFunctionApp"), exports); | ||
@@ -62,10 +66,9 @@ __exportStar(require("./registerSiteCommand"), exports); | ||
__exportStar(require("./remoteDebug/startRemoteDebug"), exports); | ||
__exportStar(require("./SiteClient"), exports); | ||
__exportStar(require("./siteFiles"), exports); | ||
__exportStar(require("./startStreamingLogs"), exports); | ||
__exportStar(require("./swapSlot"), exports); | ||
__exportStar(require("./tree/AppSettingTreeItem"), exports); | ||
__exportStar(require("./tree/AppSettingsTreeItem"), exports); | ||
__exportStar(require("./tree/AppSettingTreeItem"), exports); | ||
__exportStar(require("./tree/DeploymentTreeItem"), exports); | ||
__exportStar(require("./tree/DeploymentsTreeItem"), exports); | ||
__exportStar(require("./tree/DeploymentTreeItem"), exports); | ||
__exportStar(require("./tree/FileTreeItem"), exports); | ||
@@ -76,7 +79,3 @@ __exportStar(require("./tree/FolderTreeItem"), exports); | ||
__exportStar(require("./tryGetSiteResource"), exports); | ||
__exportStar(require("./TunnelProxy"), exports); | ||
__exportStar(require("./deleteSite/IDeleteSiteWizardContext"), exports); | ||
__exportStar(require("./deleteSite/DeleteLastServicePlanStep"), exports); | ||
__exportStar(require("./deleteSite/DeleteSiteStep"), exports); | ||
__exportStar(require("./utils/azureClients"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,5 @@ | ||
import type { AppServicePlan, SiteLogsConfig, Site, WebSiteManagementClient, User, SiteConfigResource, FunctionSecrets, FunctionEnvelope, SlotConfigNamesResource, StringDictionary, SiteSourceControl, HostKeys, WebAppsListFunctionKeysResponse, SourceControl, WebJob, WebSiteInstanceStatus } from '@azure/arm-appservice'; | ||
import type { AppServicePlan, FunctionEnvelope, FunctionSecrets, HostKeys, Site, SiteConfigResource, SiteLogsConfig, SiteSourceControl, SlotConfigNamesResource, SourceControl, StringDictionary, User, WebAppsListFunctionKeysResponse, WebJob, WebSiteInstanceStatus, WebSiteManagementClient } from '@azure/arm-appservice'; | ||
import type { HttpOperationResponse, HttpRequestBody, HttpResponse } from '@azure/ms-rest-js'; | ||
import { IActionContext, ISubscriptionContext } from '@microsoft/vscode-azext-utils'; | ||
import { KuduModels } from 'vscode-azurekudu'; | ||
import { AppSettingsClientProvider, IAppSettingsClient } from './IAppSettingsClient'; | ||
@@ -89,2 +91,11 @@ export declare class ParsedSite implements AppSettingsClientProvider { | ||
listFunctionKeys(functionName: string): Promise<IFunctionKeys>; | ||
zipPushDeploy(context: IActionContext, file: HttpRequestBody, queryParameters: KuduModels.PushDeploymentZipPushDeployOptionalParams): Promise<HttpOperationResponse>; | ||
warPushDeploy(context: IActionContext, file: HttpRequestBody, queryParameters: KuduModels.PushDeploymentWarPushDeployOptionalParams): Promise<HttpOperationResponse>; | ||
deploy(context: IActionContext, id: string): Promise<HttpOperationResponse>; | ||
getDeployResults(context: IActionContext): Promise<KuduModels.DeployResult[]>; | ||
getDeployResult(context: IActionContext, deployId: string): Promise<KuduModels.DeployResult>; | ||
getLogEntry(context: IActionContext, deployId: string): Promise<KuduModels.LogEntry[]>; | ||
getLogEntryDetails(context: IActionContext, deployId: string, logId: string): Promise<KuduModels.LogEntry[]>; | ||
vfsGetItem(context: IActionContext, path: string): Promise<HttpResponse>; | ||
vfsPutItem(context: IActionContext, data: string | ArrayBuffer, path: string, options?: {}): Promise<HttpResponse>; | ||
/** | ||
@@ -91,0 +102,0 @@ * Temporary workaround because the azure sdk doesn't return the full site object from Azure |
@@ -22,2 +22,3 @@ "use strict"; | ||
const azureClients_1 = require("./utils/azureClients"); | ||
const kuduUtils_1 = require("./utils/kuduUtils"); | ||
class ParsedSite { | ||
@@ -306,2 +307,120 @@ constructor(site, subscription) { | ||
} | ||
zipPushDeploy(context, file, queryParameters) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const options = { | ||
method: 'POST', | ||
url: `${this._site.kuduUrl}/api/zipdeploy`, | ||
body: file, | ||
bodyIsStream: true, | ||
queryParameters: (0, kuduUtils_1.convertQueryParamsValuesToString)(queryParameters) | ||
}; | ||
return yield client.sendRequest(options); | ||
}); | ||
} | ||
warPushDeploy(context, file, queryParameters) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
return yield client.sendRequest({ | ||
method: 'POST', | ||
url: `${this._site.kuduUrl}/api/wardeploy`, | ||
body: file, | ||
queryParameters: (0, kuduUtils_1.convertQueryParamsValuesToString)(queryParameters) | ||
}); | ||
}); | ||
} | ||
deploy(context, id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
return yield client.sendRequest({ | ||
method: 'PUT', | ||
url: `${this._site.kuduUrl}/api/deployments/${id}` | ||
}); | ||
}); | ||
} | ||
// the ARM call doesn't give all of the metadata we require so ping the scm directly | ||
getDeployResults(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const response = yield client.sendRequest({ | ||
method: 'GET', | ||
url: `${this._site.kuduUrl}/api/deployments` | ||
}); | ||
const results = response.parsedBody; | ||
// old kuduClient parsed recived_time: string as receivedTime: Date so we need to do the same | ||
return results.map(r => { | ||
const dr = Object.assign({}, r); | ||
dr.receivedTime = new Date(r.received_time); | ||
return dr; | ||
}); | ||
}); | ||
} | ||
// the ARM call doesn't give all of the metadata we require so ping the scm directly | ||
getDeployResult(context, deployId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const response = yield client.sendRequest({ | ||
method: 'GET', | ||
url: `${this._site.kuduUrl}/api/deployments/${deployId}` | ||
}); | ||
return response.parsedBody; | ||
}); | ||
} | ||
// no equivalent ARM call | ||
getLogEntry(context, deployId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const response = yield client.sendRequest({ | ||
method: 'GET', | ||
url: `${this._site.kuduUrl}/api/deployments/${deployId}/log` | ||
}); | ||
const entries = response.parsedBody; | ||
// old kuduClient parsed log_time: string as logTime: Date so we need to do the same | ||
return entries.map(obj => { | ||
const le = Object.assign({}, obj); | ||
le.logTime = new Date(obj.log_time); | ||
le.detailsUrl = obj.details_url; | ||
return le; | ||
}); | ||
}); | ||
} | ||
// no equivalent ARM call | ||
getLogEntryDetails(context, deployId, logId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const response = yield client.sendRequest({ | ||
method: 'GET', | ||
url: `${this._site.kuduUrl}/api/deployments/${deployId}/log/${logId}` | ||
}); | ||
const entries = response.parsedBody; | ||
return entries.map(e => { | ||
const le = Object.assign({}, e); | ||
le.logTime = new Date(e.log_time); | ||
le.detailsUrl = e.details_url; | ||
return le; | ||
}); | ||
}); | ||
} | ||
vfsGetItem(context, path) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const response = yield client.sendRequest({ | ||
method: 'GET', | ||
url: `${this._site.id}/vfs/${path}/?api-version=2022-03-01`, | ||
}); | ||
return response.parsedBody; | ||
}); | ||
} | ||
vfsPutItem(context, data, path, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = yield (0, vscode_azext_azureutils_1.createGenericClient)(context, this._site.subscription); | ||
const response = yield client.sendRequest({ | ||
method: 'PUT', | ||
url: `${this._site.id}/vfs/${path}/?api-version=2022-03-01`, | ||
body: data, | ||
headers: options | ||
}); | ||
return response.parsedBody; | ||
}); | ||
} | ||
/** | ||
@@ -308,0 +427,0 @@ * Temporary workaround because the azure sdk doesn't return the full site object from Azure |
@@ -22,3 +22,2 @@ "use strict"; | ||
const path = require("path"); | ||
const createKuduClient_1 = require("./createKuduClient"); | ||
function getFile(context, site, filePath) { | ||
@@ -59,4 +58,4 @@ var _a; | ||
const options = etag ? { customHeaders: { ['If-Match']: etag } } : {}; | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, site); | ||
const result = (yield kuduClient.vfs.putItem(data, filePath, options))._response; | ||
const kuduClient = yield site.createClient(context); | ||
const result = (yield kuduClient.vfsPutItem(context, data, filePath, options)); | ||
return result.headers.get('etag'); | ||
@@ -90,3 +89,3 @@ }); | ||
method: 'GET', | ||
url: `${site.id}/hostruntime/admin/vfs/${filePath}/?api-version=2018-11-01` | ||
url: `${site.id}/hostruntime/admin/vfs/${filePath}/?api-version=2022-03-01` | ||
}); | ||
@@ -104,4 +103,4 @@ } | ||
else { | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, site); | ||
return (yield kuduClient.vfs.getItem(filePath))._response; | ||
const kuduClient = yield site.createClient(context); | ||
return yield kuduClient.vfsGetItem(context, filePath); | ||
} | ||
@@ -108,0 +107,0 @@ } |
@@ -19,6 +19,5 @@ "use strict"; | ||
const vscode_1 = require("vscode"); | ||
const createKuduClient_1 = require("../createKuduClient"); | ||
const ScmType_1 = require("../ScmType"); | ||
const extensionVariables_1 = require("../extensionVariables"); | ||
const localize_1 = require("../localize"); | ||
const ScmType_1 = require("../ScmType"); | ||
const kuduUtils_1 = require("../utils/kuduUtils"); | ||
@@ -65,5 +64,4 @@ const DeploymentTreeItem_1 = require("./DeploymentTreeItem"); | ||
const siteConfig = yield client.getSiteConfig(); | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, this.site); | ||
const deployments = yield (0, kuduUtils_1.retryKuduCall)(context, 'getDeployResults', () => __awaiter(this, void 0, void 0, function* () { | ||
return kuduClient.deployment.getDeployResults(); | ||
return client.getDeployResults(context); | ||
})); | ||
@@ -70,0 +68,0 @@ const children = yield this.createTreeItemsWithErrorHandling(deployments, 'invalidDeployment', dr => { |
import { AzExtTreeItem, IActionContext, TreeItemIconPath } from '@microsoft/vscode-azext-utils'; | ||
import { KuduModels } from 'vscode-azurekudu'; | ||
import type { KuduModels } from 'vscode-azurekudu'; | ||
import { DeploymentsTreeItem } from './DeploymentsTreeItem'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -20,3 +20,2 @@ "use strict"; | ||
const vscode_1 = require("vscode"); | ||
const createKuduClient_1 = require("../createKuduClient"); | ||
const waitForDeploymentToComplete_1 = require("../deploy/waitForDeploymentToComplete"); | ||
@@ -55,4 +54,3 @@ const extensionVariables_1 = require("../extensionVariables"); | ||
get id() { | ||
this._deployResult.id = (0, vscode_azext_utils_1.nonNullProp)(this._deployResult, 'id'); | ||
return this._deployResult.id; | ||
return (0, vscode_azext_utils_1.nonNullProp)(this._deployResult, 'id'); | ||
} | ||
@@ -92,4 +90,4 @@ get commandId() { | ||
extensionVariables_1.ext.outputChannel.appendLog((0, localize_1.localize)('reployingOutput', 'Redeploying commit "{0}" to "{1}"...', this.id, this.parent.site.fullName), { resourceName: this.parent.site.fullName }); | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, this.parent.site); | ||
void kuduClient.deployment.deploy(this.id); | ||
const kuduClient = yield this.parent.site.createClient(context); | ||
void kuduClient.deploy(context, this.id); | ||
// eslint-disable-next-line @typescript-eslint/no-misused-promises | ||
@@ -111,7 +109,7 @@ const refreshingInteveral = setInterval(() => __awaiter(this, void 0, void 0, function* () { yield this.refresh(context); }), 1000); /* the status of the label changes during deployment so poll for that*/ | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, this.parent.site); | ||
const kuduClient = yield this.parent.site.createClient(context); | ||
let logEntries = []; | ||
yield (0, kuduUtils_1.retryKuduCall)(context, 'getLogEntry', () => __awaiter(this, void 0, void 0, function* () { | ||
yield (0, kuduUtils_1.ignore404Error)(context, () => __awaiter(this, void 0, void 0, function* () { | ||
logEntries = yield kuduClient.deployment.getLogEntry(this.id); | ||
logEntries = yield kuduClient.getLogEntry(context, this.id); | ||
})); | ||
@@ -126,3 +124,3 @@ })); | ||
if (logEntry.detailsUrl && logEntry.id) { | ||
detailedLogEntries = yield kuduClient.deployment.getLogEntryDetails(this.id, logEntry.id); | ||
detailedLogEntries = yield kuduClient.getLogEntryDetails(context, this.id, logEntry.id); | ||
} | ||
@@ -162,4 +160,4 @@ })); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const kuduClient = yield (0, createKuduClient_1.createKuduClient)(context, this.parent.site); | ||
this._deployResult = yield kuduClient.deployment.getResult(this.id); | ||
const kuduClient = yield this.parent.site.createClient(context); | ||
this._deployResult = yield kuduClient.getDeployResult(context, this.id); | ||
}); | ||
@@ -166,0 +164,0 @@ } |
@@ -11,1 +11,6 @@ import { IActionContext } from '@microsoft/vscode-azext-utils'; | ||
export declare function ignore404Error(context: IActionContext, callback: () => Promise<void>): Promise<void>; | ||
export declare function convertQueryParamsValuesToString(queryParams: { | ||
[key: string]: any; | ||
}): { | ||
[key: string]: string; | ||
}; |
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ignore404Error = exports.retryKuduCall = void 0; | ||
exports.convertQueryParamsValuesToString = exports.ignore404Error = exports.retryKuduCall = void 0; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
@@ -58,2 +58,16 @@ const retry = require("p-retry"); | ||
exports.ignore404Error = ignore404Error; | ||
// typings of queryParamsOptions allows booleans, but the ServiceClient only parses strings | ||
function convertQueryParamsValuesToString(queryParams) { | ||
const keys = Object.keys(queryParams); | ||
for (const key of keys) { | ||
if (typeof queryParams[key] === 'object') { | ||
// skip objects, the ServiceClient will handle them | ||
} | ||
else { | ||
queryParams[key] = String(queryParams[key]); | ||
} | ||
} | ||
return queryParams; | ||
} | ||
exports.convertQueryParamsValuesToString = convertQueryParamsValuesToString; | ||
//# sourceMappingURL=kuduUtils.js.map |
{ | ||
"name": "@microsoft/vscode-azext-azureappservice", | ||
"author": "Microsoft Corporation", | ||
"version": "0.7.7", | ||
"version": "0.8.0", | ||
"description": "Common tools for developing Azure App Service extensions for VS Code", | ||
@@ -37,3 +37,3 @@ "tags": [ | ||
"@azure/arm-appinsights": "^5.0.0-beta.4", | ||
"@azure/arm-appservice": "^11.0.0", | ||
"@azure/arm-appservice": "^13.0.2", | ||
"@azure/arm-operationalinsights": "^8.0.1", | ||
@@ -55,3 +55,2 @@ "@azure/arm-resourcegraph": "^4.0.0", | ||
"simple-git": "^3.5.0", | ||
"vscode-azurekudu": "^0.2.3", | ||
"vscode-nls": "^5.0.1", | ||
@@ -78,4 +77,5 @@ "ws": "^8.5.0", | ||
"mocha-multi-reporters": "^1.1.7", | ||
"typescript": "^4.9.4" | ||
"typescript": "^4.9.4", | ||
"vscode-azurekudu": "^0.2.3" | ||
} | ||
} |
402808
22
7193
18
159
+ Added@azure/arm-appservice@13.0.3(transitive)
- Removedvscode-azurekudu@^0.2.3
- Removed@azure/arm-appservice@11.0.0(transitive)
- Removedvscode-azurekudu@0.2.3(transitive)