@microsoft/vscode-azext-azureutils
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -23,3 +23,2 @@ "use strict"; | ||
const vscode = require("vscode"); | ||
const localize_1 = require("./localize"); | ||
const parseJson_1 = require("./utils/parseJson"); | ||
@@ -236,3 +235,3 @@ function parseClientContext(clientContext) { | ||
(0, vscode_azext_utils_1.parseError)(response.parsedBody || response.bodyAsText).message : | ||
(0, localize_1.localize)('unexpectedStatusCode', 'Unexpected status code: {0}', response.status); | ||
vscode.l10n.t('Unexpected status code: {0}', response.status); | ||
throw new core_rest_pipeline_1.RestError(errorMessage, { | ||
@@ -239,0 +238,0 @@ code: response.bodyAsText || '', |
@@ -9,6 +9,6 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const localize_1 = require("./localize"); | ||
const vscode_1 = require("vscode"); | ||
class UninitializedExtensionVariables { | ||
constructor() { | ||
this._error = new Error((0, localize_1.localize)('uninitializedError', '"registerAzureUtilsExtensionVariables" must be called before using the vscode-azext-azureutilsa package.')); | ||
this._error = new Error(vscode_1.l10n.t('"registerAzureUtilsExtensionVariables" must be called before using the vscode-azext-azureutilsa package.')); | ||
} | ||
@@ -15,0 +15,0 @@ get context() { |
@@ -17,12 +17,11 @@ "use strict"; | ||
exports.AzureAccountTreeItemBase = void 0; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const semver = require("semver"); | ||
const vscode_1 = require("vscode"); | ||
const localize_1 = require("../localize"); | ||
const IconPath_1 = require("./IconPath"); | ||
const SubscriptionTreeItemBase_1 = require("./SubscriptionTreeItemBase"); | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const signInLabel = (0, localize_1.localize)('signInLabel', 'Sign in to Azure...'); | ||
const createAccountLabel = (0, localize_1.localize)('createAccountLabel', 'Create an Azure Account...'); | ||
const createStudentAccountLabel = (0, localize_1.localize)('createStudentAccount', 'Create an Azure for Students Account...'); | ||
const selectSubscriptionsLabel = (0, localize_1.localize)('noSubscriptions', 'Select Subscriptions...'); | ||
const signInLabel = vscode_1.l10n.t('Sign in to Azure...'); | ||
const createAccountLabel = vscode_1.l10n.t('Create an Azure Account...'); | ||
const createStudentAccountLabel = vscode_1.l10n.t('Create an Azure for Students Account...'); | ||
const selectSubscriptionsLabel = vscode_1.l10n.t('Select Subscriptions...'); | ||
const signInCommandId = 'azure-account.login'; | ||
@@ -40,3 +39,3 @@ const createAccountCommandId = 'azure-account.createAccount'; | ||
this.label = 'Azure'; | ||
this.childTypeLabel = (0, localize_1.localize)('subscription', 'subscription'); | ||
this.childTypeLabel = vscode_1.l10n.t('subscription'); | ||
this.autoSelectInTreeItemPicker = true; | ||
@@ -69,4 +68,4 @@ this.disposables = []; | ||
const label = azureAccount === 'notInstalled' ? | ||
(0, localize_1.localize)('installAzureAccount', 'Install Azure Account Extension...') : | ||
(0, localize_1.localize)('updateAzureAccount', 'Update Azure Account Extension to at least version "{0}"...', minAccountExtensionVersion); | ||
vscode_1.l10n.t('Install Azure Account Extension...') : | ||
vscode_1.l10n.t('Update Azure Account Extension to at least version "{0}"...', minAccountExtensionVersion); | ||
const iconPath = new vscode_1.ThemeIcon('warning'); | ||
@@ -83,3 +82,3 @@ const result = new vscode_azext_utils_1.GenericTreeItem(this, { label, commandId: extensionOpenCommand, contextValue: 'azureAccount' + azureAccount, includeInTreeItemPicker: true, iconPath }); | ||
return [new vscode_azext_utils_1.GenericTreeItem(this, { | ||
label: azureAccount.status === 'Initializing' ? (0, localize_1.localize)('loadingTreeItem', 'Loading...') : (0, localize_1.localize)('signingIn', 'Waiting for Azure sign-in...'), | ||
label: azureAccount.status === 'Initializing' ? vscode_1.l10n.t('Loading...') : vscode_1.l10n.t('Waiting for Azure sign-in...'), | ||
commandId: signInCommandId, | ||
@@ -177,3 +176,3 @@ contextValue, | ||
if (typeof azureAccount !== 'string' && (azureAccount.status === 'LoggingIn' || azureAccount.status === 'Initializing')) { | ||
const title = (0, localize_1.localize)('waitingForAzureSignin', 'Waiting for Azure sign-in...'); | ||
const title = vscode_1.l10n.t('Waiting for Azure sign-in...'); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
@@ -244,9 +243,9 @@ yield vscode_1.window.withProgress({ location: vscode_1.ProgressLocation.Notification, title }, () => __awaiter(this, void 0, void 0, function* () { return yield azureAccount.waitForSubscriptions(); })); | ||
stepName = 'requiresAzureAccount'; | ||
message = (0, localize_1.localize)('requiresAzureAccount', "This functionality requires installing the Azure Account extension."); | ||
message = vscode_1.l10n.t("This functionality requires installing the Azure Account extension."); | ||
} | ||
else { | ||
stepName = 'requiresUpdateToAzureAccount'; | ||
message = (0, localize_1.localize)('requiresUpdateToAzureAccount', 'This functionality requires updating the Azure Account extension to at least version "{0}".', minAccountExtensionVersion); | ||
message = vscode_1.l10n.t('This functionality requires updating the Azure Account extension to at least version "{0}".', minAccountExtensionVersion); | ||
} | ||
const viewInMarketplace = { title: (0, localize_1.localize)('viewInMarketplace', "View in Marketplace") }; | ||
const viewInMarketplace = { title: vscode_1.l10n.t("View in Marketplace") }; | ||
if ((yield context.ui.showWarningMessage(message, { stepName }, viewInMarketplace)) === viewInMarketplace) { | ||
@@ -253,0 +252,0 @@ yield vscode_1.commands.executeCommand(extensionOpenCommand, azureAccountExtensionId); |
@@ -8,7 +8,7 @@ "use strict"; | ||
exports.getResourceGroupFromId = exports.parseAzureResourceId = void 0; | ||
const localize_1 = require("../localize"); | ||
const vscode = require("vscode"); | ||
function parseAzureResourceId(id) { | ||
const matches = id.match(/\/subscriptions\/(.*)\/resourceGroups\/(.*)\/providers\/(.*)\/(.*)/i); | ||
if (matches === null || matches.length < 3) { | ||
throw new Error((0, localize_1.localize)('InvalidResourceId', 'Invalid Azure Resource Id')); | ||
throw new Error(vscode.l10n.t('Invalid Azure Resource Id')); | ||
} | ||
@@ -15,0 +15,0 @@ return { |
@@ -17,6 +17,6 @@ "use strict"; | ||
exports.LocationListStep = void 0; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const constants_1 = require("../constants"); | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const localize_1 = require("../localize"); | ||
const extensionVariables_1 = require("../extensionVariables"); | ||
@@ -82,3 +82,4 @@ const uiUtils_1 = require("../utils/uiUtils"); | ||
function warnAboutRelatedLocation(loc) { | ||
extensionVariables_1.ext.outputChannel.appendLog((0, localize_1.localize)('relatedLocWarning', 'WARNING: Provider "{0}" does not support location "{1}". Using "{2}" instead.', provider, location.displayName, loc.displayName)); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
extensionVariables_1.ext.outputChannel.appendLog(vscode.l10n.t('WARNING: Provider "{0}" does not support location "{1}". Using "{2}" instead.', provider, location.displayName, loc.displayName)); | ||
} | ||
@@ -96,3 +97,3 @@ if (location.type === 'EdgeZone') { | ||
wizardContext.telemetry.properties.relatedLocationSource = 'home'; | ||
extensionVariables_1.ext.outputChannel.appendLog((0, localize_1.localize)('homeLocationWarning', 'WARNING: Resource does not support extended location "{0}". Using "{1}" instead.', location.displayName, homeLocation.displayName)); | ||
extensionVariables_1.ext.outputChannel.appendLog(vscode.l10n.t('WARNING: Resource does not support extended location "{0}". Using "{1}" instead.', location.displayName, homeLocation.displayName)); | ||
location = homeLocation; | ||
@@ -154,3 +155,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const options = Object.assign({ placeHolder: (0, localize_1.localize)('selectLocation', 'Select a location for new resources.'), enableGrouping: true }, this.options); | ||
const options = Object.assign({ placeHolder: vscode.l10n.t('Select a location for new resources.'), enableGrouping: true }, this.options); | ||
wizardContext._location = (yield wizardContext.ui.showQuickPick(this.getQuickPicks(wizardContext), options)).data; | ||
@@ -219,5 +220,5 @@ wizardContext.telemetry.properties.locationType = wizardContext._location.type; | ||
constructor(provider, expectedResourceType) { | ||
super((0, localize_1.localize)('noResourceType', 'Provider "{0}" does not have resource type "{1}".', provider.id, expectedResourceType)); | ||
super(vscode.l10n.t('Provider "{0}" does not have resource type "{1}".', provider.id || 'undefined', expectedResourceType)); | ||
} | ||
} | ||
//# sourceMappingURL=LocationListStep.js.map |
@@ -18,6 +18,6 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode_1 = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const constants_1 = require("../constants"); | ||
const extensionVariables_1 = require("../extensionVariables"); | ||
const localize_1 = require("../localize"); | ||
const uiUtils_1 = require("../utils/uiUtils"); | ||
@@ -32,3 +32,2 @@ const LocationListStep_1 = require("./LocationListStep"); | ||
execute(wizardContext, progress) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -43,11 +42,11 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (rgExists) { | ||
extensionVariables_1.ext.outputChannel.appendLog((0, localize_1.localize)('existingResourceGroup', 'Using existing resource group "{0}".', newName)); | ||
extensionVariables_1.ext.outputChannel.appendLog(vscode_1.l10n.t('Using existing resource group "{0}".', newName)); | ||
wizardContext.resourceGroup = yield resourceClient.resourceGroups.get(newName); | ||
} | ||
else { | ||
const creatingMessage = (0, localize_1.localize)('creatingResourceGroup', 'Creating resource group "{0}" in location "{1}"...', newName, newLocationName); | ||
const creatingMessage = vscode_1.l10n.t('Creating resource group "{0}" in location "{1}"...', newName, newLocationName); | ||
extensionVariables_1.ext.outputChannel.appendLog(creatingMessage); | ||
progress.report({ message: creatingMessage }); | ||
wizardContext.resourceGroup = yield resourceClient.resourceGroups.createOrUpdate(newName, { location: newLocationName }); | ||
extensionVariables_1.ext.outputChannel.appendLog((0, localize_1.localize)('createdResourceGroup', 'Successfully created resource group "{0}".', newName)); | ||
extensionVariables_1.ext.outputChannel.appendLog(vscode_1.l10n.t('Successfully created resource group "{0}".', newName)); | ||
} | ||
@@ -66,8 +65,9 @@ } | ||
wizardContext.telemetry.properties.forbiddenResponse = 'SelectLearnRg'; | ||
extensionVariables_1.ext.outputChannel.appendLog((0, localize_1.localize)('usedLearnResourceGroup', 'WARNING: Cannot create resource group "{0}" because the selected subscription is a concierge subscription. Using resource group "{1}" instead.', newName, (_a = wizardContext.resourceGroup) === null || _a === void 0 ? void 0 : _a.name)); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
extensionVariables_1.ext.outputChannel.appendLog(vscode_1.l10n.t('WARNING: Cannot create resource group "{0}" because the selected subscription is a concierge subscription. Using resource group "{1}" instead.', newName, wizardContext.resourceGroup.name)); | ||
return undefined; | ||
} | ||
} | ||
const message = (0, localize_1.localize)('rgForbidden', 'You do not have permission to create a resource group in subscription "{0}".', wizardContext.subscriptionDisplayName); | ||
const selectExisting = { title: (0, localize_1.localize)('selectExisting', 'Select Existing') }; | ||
const message = vscode_1.l10n.t('You do not have permission to create a resource group in subscription "{0}".', wizardContext.subscriptionDisplayName); | ||
const selectExisting = { title: vscode_1.l10n.t('Select Existing') }; | ||
yield wizardContext.ui.showWarningMessage(message, { modal: true, stepName: 'RgNoPermissions' }, selectExisting); | ||
@@ -74,0 +74,0 @@ wizardContext.telemetry.properties.forbiddenResponse = 'SelectExistingRg'; |
@@ -18,4 +18,4 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const localize_1 = require("../localize"); | ||
const uiUtils_1 = require("../utils/uiUtils"); | ||
@@ -84,3 +84,3 @@ const LocationListStep_1 = require("./LocationListStep"); | ||
picks.push({ | ||
label: (0, localize_1.localize)('NewResourceGroup', '$(plus) Create new resource group'), | ||
label: vscode.l10n.t('$(plus) Create new resource group'), | ||
description: '', | ||
@@ -87,0 +87,0 @@ data: undefined |
@@ -17,4 +17,4 @@ "use strict"; | ||
exports.ResourceGroupNameStep = void 0; | ||
const localize_1 = require("../localize"); | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode = require("vscode"); | ||
const ResourceGroupListStep_1 = require("./ResourceGroupListStep"); | ||
@@ -40,12 +40,12 @@ class ResourceGroupNameStep extends vscode_azext_utils_1.AzureWizardPromptStep { | ||
if (name.length < ResourceGroupListStep_1.resourceGroupNamingRules.minLength || name.length > ResourceGroupListStep_1.resourceGroupNamingRules.maxLength) { | ||
return (0, localize_1.localize)('invalidLength', 'The name must be between {0} and {1} characters.', ResourceGroupListStep_1.resourceGroupNamingRules.minLength, ResourceGroupListStep_1.resourceGroupNamingRules.maxLength); | ||
return vscode.l10n.t('The name must be between {0} and {1} characters.', ResourceGroupListStep_1.resourceGroupNamingRules.minLength, ResourceGroupListStep_1.resourceGroupNamingRules.maxLength); | ||
} | ||
else if (name.match(ResourceGroupListStep_1.resourceGroupNamingRules.invalidCharsRegExp) !== null) { | ||
return (0, localize_1.localize)('invalidChars', "The name can only contain alphanumeric characters or the symbols ._-()"); | ||
return vscode.l10n.t("The name can only contain alphanumeric characters or the symbols ._-()"); | ||
} | ||
else if (name.endsWith('.')) { | ||
return (0, localize_1.localize)('invalidEndingChar', "The name cannot end in a period."); | ||
return vscode.l10n.t("The name cannot end in a period."); | ||
} | ||
else if (!(yield ResourceGroupListStep_1.ResourceGroupListStep.isNameAvailable(wizardContext, name))) { | ||
return (0, localize_1.localize)('nameAlreadyExists', 'Resource group "{0}" already exists in subscription "{1}".', name, wizardContext.subscriptionDisplayName); | ||
return vscode.l10n.t('Resource group "{0}" already exists in subscription "{1}".', name, wizardContext.subscriptionDisplayName); | ||
} | ||
@@ -52,0 +52,0 @@ else { |
@@ -18,6 +18,6 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode_1 = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const constants_1 = require("../constants"); | ||
const extensionVariables_1 = require("../extensionVariables"); | ||
const localize_1 = require("../localize"); | ||
const LocationListStep_1 = require("./LocationListStep"); | ||
@@ -36,3 +36,3 @@ class StorageAccountCreateStep extends vscode_azext_utils_1.AzureWizardExecuteStep { | ||
const newSkuName = `${this._defaults.performance}_${this._defaults.replication}`; | ||
const creatingStorageAccount = (0, localize_1.localize)('CreatingStorageAccount', 'Creating storage account "{0}" in location "{1}" with sku "{2}"...', newName, newLocation, newSkuName); | ||
const creatingStorageAccount = vscode_1.l10n.t('Creating storage account "{0}" in location "{1}" with sku "{2}"...', newName, newLocation, newSkuName); | ||
extensionVariables_1.ext.outputChannel.appendLog(creatingStorageAccount); | ||
@@ -50,3 +50,3 @@ progress.report({ message: creatingStorageAccount }); | ||
}); | ||
const createdStorageAccount = (0, localize_1.localize)('CreatedStorageAccount', 'Successfully created storage account "{0}".', newName); | ||
const createdStorageAccount = vscode_1.l10n.t('Successfully created storage account "{0}".', newName); | ||
extensionVariables_1.ext.outputChannel.appendLog(createdStorageAccount); | ||
@@ -53,0 +53,0 @@ }); |
@@ -18,5 +18,6 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const constants_1 = require("../constants"); | ||
const localize_1 = require("../localize"); | ||
const uiUtils_1 = require("../utils/uiUtils"); | ||
const LocationListStep_1 = require("./LocationListStep"); | ||
@@ -26,3 +27,2 @@ const ResourceGroupListStep_1 = require("./ResourceGroupListStep"); | ||
const StorageAccountNameStep_1 = require("./StorageAccountNameStep"); | ||
const uiUtils_1 = require("../utils/uiUtils"); | ||
exports.storageAccountNamingRules = { | ||
@@ -112,3 +112,3 @@ minLength: 3, | ||
const picks = [{ | ||
label: (0, localize_1.localize)('NewStorageAccount', '$(plus) Create new storage account'), | ||
label: vscode.l10n.t('$(plus) Create new storage account'), | ||
description: '', | ||
@@ -146,3 +146,3 @@ data: undefined | ||
picks.push({ | ||
label: (0, localize_1.localize)('hasFilteredAccountsBySku', '$(info) Some storage accounts were filtered because of their sku. Learn more...'), | ||
label: vscode.l10n.t('$(info) Some storage accounts were filtered because of their sku. Learn more...'), | ||
onPicked: () => __awaiter(this, void 0, void 0, function* () { | ||
@@ -157,3 +157,3 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
picks.push({ | ||
label: (0, localize_1.localize)('hasFilteredAccountsByLocation', '$(warning) Only storage accounts in the region "{0}" are shown.', location.displayName), | ||
label: vscode.l10n.t('$(warning) Only storage accounts in the region "{0}" are shown.', location.displayName), | ||
onPicked: () => { }, | ||
@@ -160,0 +160,0 @@ data: undefined |
@@ -18,5 +18,5 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const constants_1 = require("../constants"); | ||
const localize_1 = require("../localize"); | ||
const ResourceGroupListStep_1 = require("./ResourceGroupListStep"); | ||
@@ -52,6 +52,6 @@ const StorageAccountListStep_1 = require("./StorageAccountListStep"); | ||
if (!name || name.length < StorageAccountListStep_1.storageAccountNamingRules.minLength || name.length > StorageAccountListStep_1.storageAccountNamingRules.maxLength) { | ||
return (0, localize_1.localize)('invalidLength', 'The name must be between {0} and {1} characters.', StorageAccountListStep_1.storageAccountNamingRules.minLength, StorageAccountListStep_1.storageAccountNamingRules.maxLength); | ||
return vscode.l10n.t('The name must be between {0} and {1} characters.', StorageAccountListStep_1.storageAccountNamingRules.minLength, StorageAccountListStep_1.storageAccountNamingRules.maxLength); | ||
} | ||
else if (name.match(StorageAccountListStep_1.storageAccountNamingRules.invalidCharsRegExp) !== null) { | ||
return (0, localize_1.localize)('invalidChars', "The name can only contain lowercase letters and numbers."); | ||
return vscode.l10n.t("The name can only contain lowercase letters and numbers."); | ||
} | ||
@@ -58,0 +58,0 @@ else { |
@@ -18,4 +18,4 @@ "use strict"; | ||
const vscode_azext_utils_1 = require("@microsoft/vscode-azext-utils"); | ||
const vscode_1 = require("vscode"); | ||
const clients_1 = require("../clients"); | ||
const localize_1 = require("../localize"); | ||
const delay_1 = require("../utils/delay"); | ||
@@ -30,3 +30,3 @@ class VerifyProvidersStep extends vscode_azext_utils_1.AzureWizardExecuteStep { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
progress.report({ message: (0, localize_1.localize)('registeringProviders', 'Registering Providers...') }); | ||
progress.report({ message: vscode_1.l10n.t('Registering Providers...') }); | ||
const client = yield (0, clients_1.createResourcesClient)(context); | ||
@@ -33,0 +33,0 @@ yield Promise.all(this._providers.map((providerName) => __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@microsoft/vscode-azext-azureutils", | ||
"author": "Microsoft Corporation", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Common Azure utils for developing Azure extensions for VS Code", | ||
@@ -43,6 +43,5 @@ "tags": [ | ||
"@azure/logger": "^1.0.4", | ||
"@microsoft/vscode-azext-utils": "^1.0.0", | ||
"@microsoft/vscode-azext-utils": "^1.2.1", | ||
"semver": "^7.3.7", | ||
"uuid": "^9.0.0", | ||
"vscode-nls": "^5.0.1" | ||
"uuid": "^9.0.0" | ||
}, | ||
@@ -49,0 +48,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
129208
30
2112
- Removedvscode-nls@^5.0.1
- Removedvscode-nls@5.2.0(transitive)