diff --git a/package-lock.json b/package-lock.json index c7730164e..31845f778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,103 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@azure/arm-cosmosdb": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@azure/arm-cosmosdb/-/arm-cosmosdb-3.0.0.tgz", + "integrity": "sha512-cyFVcdNRMXG/n0grej1VFl68D4zsnLJQGX3+X54vzvEb6TlCPID8u/btS+JXK3yH7YITWCIzJXC00msiuFsmsg==", + "requires": { + "@azure/ms-rest-azure-js": "^1.3.2", + "@azure/ms-rest-js": "^1.8.1", + "tslib": "^1.9.3" + } + }, + "@azure/arm-resources": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/arm-resources/-/arm-resources-1.0.1.tgz", + "integrity": "sha512-wIUJmtFoxPJiyyVmVstoWU31ffNLL9+fU6MtD4SH7nFk1ikSt2lTHE3clYX51jHhKcyFwdBo6Z3IQgrOwc1jcw==", + "requires": { + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", + "tslib": "^1.9.3" + } + }, + "@azure/arm-storage": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@azure/arm-storage/-/arm-storage-8.1.0.tgz", + "integrity": "sha512-Rsy8X92aUfmsz5Yv3VrxVMEdpcEWcHan7vnJxKKQo+qMugA1+h4xtj1M4mxoSfaTH13hPyUSoFHEWhemqtNqMw==", + "requires": { + "@azure/ms-rest-azure-js": "^1.3.2", + "@azure/ms-rest-js": "^1.8.1", + "tslib": "^1.9.3" + } + }, + "@azure/arm-subscriptions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/arm-subscriptions/-/arm-subscriptions-1.0.0.tgz", + "integrity": "sha512-DoZFcF+ePkGhrxQ4X/LxBoWipqpkZIt9g+itXJ4HaQNExn0hNO27Cs6kNZYpIdCs5Zu+2DbjRs2i8OqG3QbE9w==", + "requires": { + "@azure/ms-rest-azure-js": "^1.1.0", + "@azure/ms-rest-js": "^1.1.0", + "tslib": "^1.9.3" + } + }, + "@azure/ms-rest-azure-env": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-azure-env/-/ms-rest-azure-env-1.1.2.tgz", + "integrity": "sha512-l7z0DPCi2Hp88w12JhDTtx5d0Y3+vhfE7JKJb9O7sEz71Cwp053N8piTtTnnk/tUor9oZHgEKi/p3tQQmLPjvA==" + }, + "@azure/ms-rest-azure-js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-azure-js/-/ms-rest-azure-js-1.3.5.tgz", + "integrity": "sha512-gk6RdpSEblvYEJhK+WjDDJnMLVNrjb/53qINyXXbgY5bs0UbRNFCJwRKsfRGoUB8WgHkQj5mtztR4V1PNAB9Eg==", + "requires": { + "@azure/ms-rest-js": "^1.8.1", + "tslib": "^1.9.2" + } + }, + "@azure/ms-rest-browserauth": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-browserauth/-/ms-rest-browserauth-0.1.4.tgz", + "integrity": "sha512-yV7B+dQzvuHwWpS2KJuu+wU56CdPIUBCJQVG8iidCPXp1zCqGSH5HcbmxHzESMSieDrMeybtPeLx/PNA6Y7YYA==", + "requires": { + "@azure/ms-rest-azure-env": "^1.1.0", + "@azure/ms-rest-js": "^1.8.1", + "adal-angular": "^1.0.17", + "tslib": "^1.9.3" + } + }, + "@azure/ms-rest-js": { + "version": "1.8.7", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-1.8.7.tgz", + "integrity": "sha512-JTVf4hu+/TnOQW1bprK+wxCBgJdZR6aC3oeAW35CfbxL4NVVgwEQ4+c1JOG8ph0WHGEL8bfyDF2vIjV/RuHkdg==", + "requires": { + "@types/tunnel": "0.0.0", + "axios": "^0.18.0", + "form-data": "^2.3.2", + "tough-cookie": "^2.4.3", + "tslib": "^1.9.2", + "tunnel": "0.0.6", + "uuid": "^3.2.1", + "xml2js": "^0.4.19" + }, + "dependencies": { + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + } + } + }, + "@azure/ms-rest-nodeauth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-2.0.1.tgz", + "integrity": "sha512-iBhdBC6uN1YapRZeCYdeK87gvQN6mqADqD9H5eGiT8YDtyabd7vc6fTY1VvJ4XOZbI3bJDLlkDTQAjaPbyoGTQ==", + "requires": { + "@azure/ms-rest-azure-env": "^1.1.2", + "@azure/ms-rest-js": "^1.8.7", + "adal-node": "^0.1.28" + } + }, "@types/bson": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@types/bson/-/bson-1.0.11.tgz", @@ -346,8 +443,7 @@ "@types/node": { "version": "6.14.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.14.2.tgz", - "integrity": "sha512-JWB3xaVfsfnFY8Ofc9rTB/op0fqqTSqy4vBcVk1LuRJvta7KTX+D//fCkiTMeLGhdr2EbFZzQjC97gvmPilk9Q==", - "dev": true + "integrity": "sha512-JWB3xaVfsfnFY8Ofc9rTB/op0fqqTSqy4vBcVk1LuRJvta7KTX+D//fCkiTMeLGhdr2EbFZzQjC97gvmPilk9Q==" }, "@types/socket.io": { "version": "1.4.40", @@ -364,6 +460,14 @@ "integrity": "sha512-Vs55Kq8F+OWvy1RLA31rT+cAyemzgm0EWNeax6BWF8H7QiiOYMJIdcwSDdm5LVgfEkoepsWkS+40+WNb7BUMbg==", "dev": true }, + "@types/tunnel": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.0.tgz", + "integrity": "sha512-FGDp0iBRiBdPjOgjJmn1NH0KDLN+Z8fRmo+9J7XGBhubq1DPrGrbmG4UTlGzrpbCpesMqD0sWkzi27EYkOMHyg==", + "requires": { + "@types/node": "*" + } + }, "@webassemblyjs/ast": { "version": "1.7.11", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz", @@ -581,6 +685,11 @@ "acorn": "^5.0.0" } }, + "adal-angular": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/adal-angular/-/adal-angular-1.0.17.tgz", + "integrity": "sha1-bpNuDkH5HTsqiOf/ypwvb29WLMQ=" + }, "adal-node": { "version": "0.1.28", "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", @@ -1092,31 +1201,13 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, - "azure-arm-cosmosdb": { - "version": "1.1.2", - "resolved": "http://registry.npmjs.org/azure-arm-cosmosdb/-/azure-arm-cosmosdb-1.1.2.tgz", - "integrity": "sha512-NdjUeSoNzV2Ljajomy7mQW8WrbysGg6jPpTGztlpyLgGCBFMO9llvzKCoRTNMs9Van50lrJrmcbhbJNFn3PPjw==", - "requires": { - "ms-rest": "^2.3.2", - "ms-rest-azure": "^2.5.5" - } - }, - "azure-arm-resource": { - "version": "3.0.0-preview", - "resolved": "https://registry.npmjs.org/azure-arm-resource/-/azure-arm-resource-3.0.0-preview.tgz", - "integrity": "sha512-5AxK9Nnk9hRDtyiXkaqvHV2BvII12JpPpTTHL8p9ZKgkwy67mWk+repoe9PnjxwG2Rm1RadutonccynJ+VHVAw==", - "requires": { - "ms-rest": "^2.0.0", - "ms-rest-azure": "^2.0.0" - } - }, - "azure-arm-storage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/azure-arm-storage/-/azure-arm-storage-3.2.0.tgz", - "integrity": "sha512-jrew8qgqCiJ66QyjAhQis7AXhK6hp5soypvcxio3g/b1mNJr7RsQ6vD5zBRebcvM+QBGzvv7COiXy/xzibyOgA==", + "axios": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "requires": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" } }, "babel-code-frame": { @@ -3414,6 +3505,24 @@ "readable-stream": "^2.0.4" } }, + "follow-redirects": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", + "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", + "requires": { + "debug": "^3.2.6" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -5271,7 +5380,8 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true }, "is-typedarray": { "version": "1.0.0", @@ -6309,34 +6419,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" }, - "ms-rest": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/ms-rest/-/ms-rest-2.3.8.tgz", - "integrity": "sha512-8kaerSPk0Z9W6z8VnJXjKOHDaGGXbsGyO22X4DFtlllzbYLryWo0Dor+jnIKpgvUOzQKSoLW2fel81piG3LnHQ==", - "requires": { - "duplexer": "^0.1.1", - "is-buffer": "^1.1.6", - "is-stream": "^1.1.0", - "moment": "^2.21.0", - "request": "^2.88.0", - "through": "^2.3.8", - "tunnel": "0.0.5", - "uuid": "^3.2.1" - } - }, - "ms-rest-azure": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.9.tgz", - "integrity": "sha512-qonobzWLS7Jl6qwgTuA/SfyCtnv7olvCRKrcF8nzXSj68ds4Oj3K64ntzgQajroKa0hKVMcPUFbTk1IYMGvu8w==", - "requires": { - "adal-node": "^0.1.28", - "async": "2.6.0", - "moment": "^2.22.2", - "ms-rest": "^2.3.2", - "request": "^2.88.0", - "uuid": "^3.2.1" - } - }, "multimatch": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", @@ -7655,6 +7737,11 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, "schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -8881,8 +8968,7 @@ "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, "tslint": { "version": "5.12.0", @@ -9878,16 +9964,17 @@ } }, "vscode-azureextensionui": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/vscode-azureextensionui/-/vscode-azureextensionui-0.25.0.tgz", - "integrity": "sha512-uyCBLPn79MGroHV/nQJI3BrYTABpNrEnYjVZFf7MJK3xo9vsAyIUCwycarNm3Rzw1jOOLa4jMWbsszoH2odVPA==", - "requires": { - "azure-arm-resource": "^3.0.0-preview", - "azure-arm-storage": "^3.1.0", + "version": "file:../vscode-azuretools/ui/vscode-azureextensionui-0.26.0.tgz", + "integrity": "sha512-IEg1nz60OusnH7RRs1375KTr3pt3gBUUTQL7vzsZUDEwHXxw+8ddwTIt4LdWzyKfdoJ98dV9Tk7IH/AgFwLaLw==", + "requires": { + "@azure/arm-resources": "^1.0.1", + "@azure/arm-storage": "^8.1.0", + "@azure/arm-subscriptions": "^1.0.0", + "@azure/ms-rest-azure-js": "^1.3.5", + "@azure/ms-rest-js": "^1.8.7", + "@azure/ms-rest-nodeauth": "^2.0.0", "fs-extra": "^4.0.3", "html-to-text": "^4.0.0", - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.4.4", "opn": "^6.0.0", "semver": "^5.6.0", "vscode-extension-telemetry": "^0.1.0", @@ -10376,6 +10463,20 @@ "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", "dev": true }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + }, "xmldom": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", diff --git a/package.json b/package.json index 882070dd7..2ff51ddd4 100644 --- a/package.json +++ b/package.json @@ -909,22 +909,25 @@ "webpack-cli": "^3.1.2" }, "dependencies": { + "@azure/arm-cosmosdb": "^3.0.0", + "@azure/ms-rest-azure-js": "^1.3.5", + "@azure/ms-rest-browserauth": "^0.1.4", + "@azure/ms-rest-js": "^1.8.7", + "@azure/ms-rest-nodeauth": "^2.0.0", "antlr4ts": "^0.4.1-alpha.0", - "azure-arm-cosmosdb": "^1.1.2", - "azure-arm-resource": "^3.0.0-preview", "d3": "^3.0.0", "documentdb": "^1.14.2", "event-stream": "3.3.4", "fs-extra": "^4.0.2", "gremlin": "^2.6.0", + "html-to-text": "^4.0.0", "mongodb": "^2.2.25", "mongodb-extended-json": "^1.10.0", - "ms-rest": "^2.2.1", "node-uuid": "1.4.8", "socket.io": "^1.7.3", "socket.io-client": "^1.7.3", "underscore": "^1.8.3", - "vscode-azureextensionui": "^0.25.0", + "vscode-azureextensionui": "file:../vscode-azuretools/ui/vscode-azureextensionui-0.26.0.tgz", "vscode-json-languageservice": "^3.0.8", "vscode-languageclient": "^4.4.0", "vscode-languageserver": "^4.4.0", diff --git a/src/commands/deleteCosmosDBAccount.ts b/src/commands/deleteCosmosDBAccount.ts index 64b9ba5eb..336abf2fa 100644 --- a/src/commands/deleteCosmosDBAccount.ts +++ b/src/commands/deleteCosmosDBAccount.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CosmosDBManagementClient } from 'azure-arm-cosmosdb'; +import { CosmosDBManagementClient } from '@azure/arm-cosmosdb'; import * as vscode from 'vscode'; import { AzureTreeItem, createAzureClient, DialogResponses } from 'vscode-azureextensionui'; import { UserCancelledError } from 'vscode-azureextensionui'; diff --git a/src/docdb/tree/DocDBAccountTreeItemBase.ts b/src/docdb/tree/DocDBAccountTreeItemBase.ts index cd45c687e..bc00e617a 100644 --- a/src/docdb/tree/DocDBAccountTreeItemBase.ts +++ b/src/docdb/tree/DocDBAccountTreeItemBase.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DatabaseAccount } from 'azure-arm-cosmosdb/lib/models'; +import { CosmosDBManagementModels as CosmosModels } from '@azure/arm-cosmosdb'; import { DatabaseMeta, DocumentClient, FeedOptions, QueryIterator } from 'documentdb'; import * as path from 'path'; import * as vscode from 'vscode'; @@ -26,7 +26,7 @@ export abstract class DocDBAccountTreeItemBase extends DocDBTreeItemBaseJSON.parse((<{ body?: string }>response).body); + let body = <{ properties: { gremlinEndpoint: string } }>JSON.parse((<{ bodyAsText?: string }>response).bodyAsText); let endpointUri = body.properties.gremlinEndpoint; if (endpointUri) { resolve(parseEndpointUrl(endpointUri)); diff --git a/src/graph/tree/GraphAccountTreeItem.ts b/src/graph/tree/GraphAccountTreeItem.ts index 24f3a5ab2..9d38ef216 100644 --- a/src/graph/tree/GraphAccountTreeItem.ts +++ b/src/graph/tree/GraphAccountTreeItem.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DatabaseAccount } from 'azure-arm-cosmosdb/lib/models'; +import { CosmosDBManagementModels as CosmosModels } from '@azure/arm-cosmosdb'; import { DatabaseMeta } from 'documentdb'; import { AzureParentTreeItem } from 'vscode-azureextensionui'; import { DocDBAccountTreeItemBase } from '../../docdb/tree/DocDBAccountTreeItemBase'; @@ -18,7 +18,7 @@ export class GraphAccountTreeItem extends DocDBAccountTreeItemBase { public static contextValue: string = "cosmosDBGraphAccount"; public contextValue: string = GraphAccountTreeItem.contextValue; - constructor(parent: AzureParentTreeItem, id: string, label: string, documentEndpoint: string, private _gremlinEndpoint: IGremlinEndpoint | undefined, masterKey: string, isEmulator: boolean, readonly databaseAccount?: DatabaseAccount) { + constructor(parent: AzureParentTreeItem, id: string, label: string, documentEndpoint: string, private _gremlinEndpoint: IGremlinEndpoint | undefined, masterKey: string, isEmulator: boolean, readonly databaseAccount?: CosmosModels.DatabaseAccount) { super(parent, id, label, documentEndpoint, masterKey, isEmulator, databaseAccount); } diff --git a/src/mongo/tree/MongoAccountTreeItem.ts b/src/mongo/tree/MongoAccountTreeItem.ts index 20aa305ac..88b51a40f 100644 --- a/src/mongo/tree/MongoAccountTreeItem.ts +++ b/src/mongo/tree/MongoAccountTreeItem.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DatabaseAccount } from 'azure-arm-cosmosdb/lib/models'; +import { CosmosDBManagementModels as CosmosModels } from '@azure/arm-cosmosdb'; import { Db } from 'mongodb'; import * as path from 'path'; import * as vscode from 'vscode'; @@ -28,7 +28,7 @@ export class MongoAccountTreeItem extends AzureParentTreeItem { private _root: IMongoTreeRoot; - constructor(parent: AzureParentTreeItem, id: string, label: string, connectionString: string, isEmulator: boolean, readonly databaseAccount?: DatabaseAccount) { + constructor(parent: AzureParentTreeItem, id: string, label: string, connectionString: string, isEmulator: boolean, readonly databaseAccount?: CosmosModels.DatabaseAccount) { super(parent); this.id = id; this.label = label; diff --git a/src/tree/AttachedAccountsTreeItem.ts b/src/tree/AttachedAccountsTreeItem.ts index 01a831928..4a597c0eb 100644 --- a/src/tree/AttachedAccountsTreeItem.ts +++ b/src/tree/AttachedAccountsTreeItem.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ServiceClientCredentials } from 'ms-rest'; -import { AzureEnvironment } from 'ms-rest-azure'; +import { Environment } from '@azure/ms-rest-azure-env'; +import { ServiceClientCredentials } from "@azure/ms-rest-js"; import * as path from 'path'; import * as vscode from 'vscode'; import { appendExtensionUserAgent, AzExtParentTreeItem, AzExtTreeItem, AzureParentTreeItem, AzureTreeItem, GenericTreeItem, ISubscriptionContext, UserCancelledError } from 'vscode-azureextensionui'; @@ -373,7 +373,7 @@ class AttachedAccountRoot implements ISubscriptionContext { throw this._error; } - public get environment(): AzureEnvironment { + public get environment(): Environment { throw this._error; } } diff --git a/src/tree/CosmosDBAccountWizard/CosmosDBAccountCreateStep.ts b/src/tree/CosmosDBAccountWizard/CosmosDBAccountCreateStep.ts index 023f6e841..989c6b9bd 100644 --- a/src/tree/CosmosDBAccountWizard/CosmosDBAccountCreateStep.ts +++ b/src/tree/CosmosDBAccountWizard/CosmosDBAccountCreateStep.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CosmosDBManagementClient } from 'azure-arm-cosmosdb'; -import { Capability } from 'azure-arm-cosmosdb/lib/models'; +import { CosmosDBManagementClient, CosmosDBManagementModels as CosmosModels } from '@azure/arm-cosmosdb'; import { Progress } from 'vscode'; import { AzureWizardExecuteStep, createAzureClient } from 'vscode-azureextensionui'; import { ext } from '../../extensionVariables'; @@ -27,7 +26,7 @@ export class CosmosDBAccountCreateStep extends AzureWizardExecuteStep{ name: wizardContext.defaultExperience.capability }); + options.capabilities.push({ name: wizardContext.defaultExperience.capability }); } wizardContext.databaseAccount = await client.databaseAccounts.createOrUpdate(wizardContext.resourceGroup.name, wizardContext.accountName, options); diff --git a/src/tree/CosmosDBAccountWizard/CosmosDBAccountNameStep.ts b/src/tree/CosmosDBAccountWizard/CosmosDBAccountNameStep.ts index fb6ab811c..791096574 100644 --- a/src/tree/CosmosDBAccountWizard/CosmosDBAccountNameStep.ts +++ b/src/tree/CosmosDBAccountWizard/CosmosDBAccountNameStep.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CosmosDBManagementClient } from 'azure-arm-cosmosdb'; +import { CosmosDBManagementClient } from '@azure/arm-cosmosdb'; import { AzureNameStep, createAzureClient, ResourceGroupListStep, resourceGroupNamingRules } from 'vscode-azureextensionui'; import { ext } from '../../extensionVariables'; import { ICosmosDBWizardContext } from './ICosmosDBWizardContext'; diff --git a/src/tree/CosmosDBAccountWizard/ICosmosDBWizardContext.ts b/src/tree/CosmosDBAccountWizard/ICosmosDBWizardContext.ts index 74653941b..969f811b0 100644 --- a/src/tree/CosmosDBAccountWizard/ICosmosDBWizardContext.ts +++ b/src/tree/CosmosDBAccountWizard/ICosmosDBWizardContext.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DatabaseAccount } from 'azure-arm-cosmosdb/lib/models'; +import { CosmosDBManagementModels as CosmosModels } from '@azure/arm-cosmosdb'; import { IResourceGroupWizardContext } from 'vscode-azureextensionui'; import { Experience } from '../../experiences'; @@ -18,7 +18,7 @@ export interface ICosmosDBWizardContext extends IResourceGroupWizardContext { * The newly created Cosmos DB account * This will be defined after `CosmosDBAccountStep.execute` occurs. */ - databaseAccount?: DatabaseAccount; + databaseAccount?: CosmosModels.DatabaseAccount; /** * The defaultExperience to use diff --git a/src/tree/SubscriptionTreeItem.ts b/src/tree/SubscriptionTreeItem.ts index be0a2a15a..fc3ebe9ed 100644 --- a/src/tree/SubscriptionTreeItem.ts +++ b/src/tree/SubscriptionTreeItem.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CosmosDBManagementClient } from 'azure-arm-cosmosdb'; -import { DatabaseAccount, DatabaseAccountListKeysResult, DatabaseAccountsListResult } from 'azure-arm-cosmosdb/lib/models'; +import { CosmosDBManagementClient, CosmosDBManagementModels as CosmosModels } from '@azure/arm-cosmosdb'; import * as vscode from 'vscode'; import { AzExtTreeItem, AzureTreeItem, AzureWizard, createAzureClient, ICreateChildImplContext, LocationListStep, ResourceGroupListStep, SubscriptionTreeItemBase } from 'vscode-azureextensionui'; import { DocDBAccountTreeItem } from "../docdb/tree/DocDBAccountTreeItem"; @@ -28,12 +27,12 @@ export class SubscriptionTreeItem extends SubscriptionTreeItemBase { public async loadMoreChildrenImpl(_clearCache: boolean): Promise { const client: CosmosDBManagementClient = createAzureClient(this.root, CosmosDBManagementClient); - const accounts: DatabaseAccountsListResult = await client.databaseAccounts.list(); + const accounts: CosmosModels.DatabaseAccountsListResult = await client.databaseAccounts.list(); return await this.createTreeItemsWithErrorHandling( accounts, 'invalidCosmosDBAccount', - async (db: DatabaseAccount) => await this.initChild(client, db), - (db: DatabaseAccount) => db.name + async (db: CosmosModels.DatabaseAccount) => await this.initChild(client, db), + (db: CosmosModels.DatabaseAccount) => db.name ); } @@ -65,7 +64,7 @@ export class SubscriptionTreeItem extends SubscriptionTreeItemBase { return await this.initChild(client, wizardContext.databaseAccount); } - private async initChild(client: CosmosDBManagementClient, databaseAccount: DatabaseAccount): Promise { + private async initChild(client: CosmosDBManagementClient, databaseAccount: CosmosModels.DatabaseAccount): Promise { const experience = tryGetExperience(databaseAccount); const resourceGroup: string = azureUtils.getResourceGroupFromId(databaseAccount.id); const accountKindLabel = getExperienceLabel(databaseAccount); @@ -77,7 +76,7 @@ export class SubscriptionTreeItem extends SubscriptionTreeItemBase { // Use the default connection string return new MongoAccountTreeItem(this, databaseAccount.id, label, result.connectionStrings[0].connectionString, isEmulator, databaseAccount); } else { - const keyResult: DatabaseAccountListKeysResult = await client.databaseAccounts.listKeys(resourceGroup, databaseAccount.name); + const keyResult: CosmosModels.DatabaseAccountListKeysResult = await client.databaseAccounts.listKeys(resourceGroup, databaseAccount.name); switch (experience && experience.api) { case "Table": return new TableAccountTreeItem(this, databaseAccount.id, label, databaseAccount.documentEndpoint, keyResult.primaryMasterKey, isEmulator, databaseAccount);