Compare commits

..

73 Commits

Author SHA1 Message Date
Karl Burtram
d08d07fe39 Cleanup the copy output (#8072) (#8339)
* Cleanup the copy output

* Use helper functions and cleanup promise handling
2019-11-14 14:34:05 -08:00
Karl Burtram
7725d1f6a8 Bump ADS to 1.13.1 (#8340) 2019-11-14 14:14:10 -08:00
Udeesha Gautam
63803ea6f2 update dacpac and schema compare readme to remove preview text (#8191)
update dacpac and schema compare readme to remove preview text (#8191)
2019-11-01 18:57:59 -07:00
Charles Gagnon
cacd481bff Fix ssl config issue 2019-11-01 15:56:48 -07:00
Charles Gagnon
650ab3b800 Port ssl config fix (#8185) 2019-11-01 15:37:22 -07:00
Karl Burtram
517b375395 Bump SQL Tools to 2.0.0-release.30 to pick up SMO update 2019-11-01 14:13:16 -07:00
Chris LaFreniere
29ccbb5497 Ensure cwd matches notebook path (#8137)
* Ensure cwd matches notebook path

* add error checking

* silent, don't store history
2019-11-01 11:42:19 -07:00
Karl Burtram
ba3e92e5be Fix break in jupyterServerInstallation.ts 2019-10-31 21:06:22 -07:00
Udeesha Gautam
5013a76565 Updating SqlToolsService To Revert SqlCmd explicit handling (#8133)
Updating SqlToolsService To Revert SqlCmd explicit handling (#8133)
2019-10-31 20:55:32 -07:00
Charles Gagnon
fe896e8b1a ADS changes for new engine edition (#7695) (#8176)
* Sql on demand changes

* Formating files

* Removing features for new Engine Edition

* Fixing Restore & Backup issue. Adding support for multiple conditions per flavor

* tabifying

* Formating documents

* Work in progress

* Resolving comments

* Resolving comments.

* Fixing typo
2019-10-31 20:47:03 -07:00
Maddy
ea71c0e39c version bump books package (#8174) 2019-10-31 20:32:09 -07:00
maddydev
32acda343d refactored error method and added try for the entire method 2019-10-31 20:31:54 -07:00
Kevin Cunnane
e97e098a14 recommend datavirtualization instead of sql-vnext (#8172) 2019-10-31 20:27:47 -07:00
BranislavGrbicMDCS
b317ccde28 Adjusting context menu for SqlOnDemand (#8018) 2019-10-31 17:47:10 -07:00
BranislavGrbicMDCS
3d1d20a472 Adjusting OE and hiding nodes for sql on demand (#8087) 2019-10-31 17:46:28 -07:00
Karl Burtram
7b2ae58aa6 Package LiveShare outside core ADS (#8024) 2019-10-31 17:39:03 -07:00
Kevin Cunnane
ecedd3108d Fix #8162 Spark timeout in BDC cluster is higher than client-side, causing successful sessions to show as failed (#8164)
* Fix #8162 Spark timeout in BDC cluster is higher than client-side, causing successful sessions to show as failed
2019-10-31 17:25:25 -07:00
Charles Gagnon
6d598b1362 Fix metrics log links (#8140) 2019-10-31 15:10:15 -07:00
Kevin Cunnane
1cae74c6d3 Fix #8159 Mount HDFS broken against latest cluster (#8160)
connectWithRetry needed to pass as ... so each arg was set correctly,
instead of having 1st param be an array of the input arguments
2019-10-31 15:09:45 -07:00
Charles Gagnon
fbcd3c620c Merge BDC error fixes into release (#8145)
* Fix BDC remember password and reprompting connection (#7957)

* Fix remember password and reprompting connection

* comment

* Fix to remember password for session

* Fix floating promises

* Add error messages to BDC dashboard page (#8103)

* Add error messages to BDC dashboard page

* Remove testing code

* PR fixes
2019-10-31 13:36:14 -07:00
Alan Ren
78ec3c016b profiler icon issue (#8115) 2019-10-31 08:26:00 -07:00
Alan Ren
71a6ced5bf fix the missing icon issue of expand/collapse btn (#8132) 2019-10-31 08:24:08 -07:00
Chris LaFreniere
eee799aeef Notebooks: Improvements to Connection Profile Passing (#8105)
* Fix relative images on notebook markdown pc

* PR feedback around replace ordering

* update databaseName when it's set to master

* usinng query as example
2019-10-31 08:22:58 -07:00
Alan Ren
3ffef2fb02 use addtionalEnvironmentVariables (#8123) 2019-10-31 08:20:15 -07:00
Alan Ren
c7d7faa167 notebook background execution 2019-10-30 10:54:51 -07:00
Maddy
64e95edc96 added openLocalizedook action that opens up the link to localized books. (#8025)
* initial commit

* addressed the tslint floating promise errors

* updated the command name with PM's feedback
2019-10-30 00:03:39 -07:00
Chris LaFreniere
761e3d1692 Notebooks: Fix relative images not rendering on PC for Markdown Cells (#8091)
* Fix relative images on notebook markdown pc

* PR feedback around replace ordering
2019-10-30 00:03:30 -07:00
Kim Santiago
c1fb00b3f2 Bump dacpac and schema compare extension versions and remove preview (#8095)
* bump dacpac and schema compare extension versions and remove preview

* bump azdata dependency version
2019-10-30 00:03:13 -07:00
Kim Santiago
8c925a31b6 Fix schema compare include/exclude behavior 2019-10-30 00:02:54 -07:00
Charles Gagnon
b196291052 Add SQL Metrics links to BDC dashboard (#8056)
* Add SQL metrics link to dashboard pages

* Only show SQL metrics column for SQL service

* Add param doc
2019-10-28 15:19:11 -07:00
Karl Burtram
068b64973f Update agent and import versions for Nov (#8054) 2019-10-28 15:18:51 -07:00
Karl Burtram
d83444ffeb dependencies messages, no curl on win32, fixes to min Version 2019-10-27 21:43:30 -07:00
Karl Burtram
872973c4d2 Bump SQL Tools Service to pickup schema compare changes (#8048) 2019-10-27 14:00:09 -07:00
Alan Ren
ca36aa5b2d min version check (#8038)
* min version check

* comments
2019-10-27 11:16:59 -07:00
Alan Ren
0a7cdf79ba update the message (#8031) 2019-10-27 11:16:53 -07:00
Alan Ren
ccb7a03a0f fix 2 issues found during testing (#8029) 2019-10-27 11:16:46 -07:00
Arvind Ranasaria
beab3cb48c pass install paths to notebooks (#8008)
* pass install paths to notebooks

* onComplete

* discover and publish actual installation Path

* pass the path to notebook

* minor fixes needed post merge of code from remote

* fix some errors

* remove unused variable
2019-10-27 11:16:41 -07:00
Chris LaFreniere
fd7b5a8628 serverManager to decide if server start needed (#8017) 2019-10-27 11:16:34 -07:00
Chris LaFreniere
fd0d3855df fix stdin cancel breaks notebook (#8012) 2019-10-27 11:16:27 -07:00
Amir Omidi
0498253b56 Distribute area evenly 2019-10-25 15:33:04 -07:00
Udeesha Gautam
e5609ffd5c Work with single ext loc file (#7894)
* try loc with single file model

* adding filter and languages

* add links in langpack json

* changing variable name and limiting the list to only tested extensions
2019-10-25 15:00:48 -07:00
Chris LaFreniere
29e6145920 Fix for Markdown File in Jupyter Books Viewlet not Opening After 2x (#8009)
* fix for markdown not opening after opened twice

* PR comment to add return type
2019-10-24 22:44:15 -07:00
Chris LaFreniere
b03ff643e5 Fix Issue when Saving Wrong Kernel (#7974)
* Only fire kernelChangeEmitter after lang set

* Fix unused import found by lgtm

* Fix comment
2019-10-24 22:44:08 -07:00
Charles Gagnon
053be4756d Fix column text overflow on BDC status pages (#7928)
* Fix column text overflow on status page

* Fix typo

* Fix another typo
2019-10-24 22:44:01 -07:00
Chris LaFreniere
2bdd55dea4 search book gone from command palette (#8002) 2019-10-24 22:43:55 -07:00
Chris LaFreniere
738c8231ee Always send \n instead of \r\n to Jupyter kernel (#7995)
* Always send \n instead of \r\n to kernel

* Use replace instead of split/join
2019-10-24 22:43:46 -07:00
Alan Ren
1e29949273 Remove RC from strings (#8001) 2019-10-24 22:43:32 -07:00
Maddy
cdd3899648 builtinExtension-insiders to builtinExtension (#7973)
* builtinExtension-insiders to builtinExtension

* maintain both insiders and stable.

* builtinExtension.js is for build time and skipping the check for dev.

* check quality and pick insider vs stable json
2019-10-24 22:43:25 -07:00
Chris LaFreniere
933dfc0f3f Fix starting and separators in a row (#7861) 2019-10-24 22:43:02 -07:00
Alan Ren
10a7b47604 make the azdata install url configurable (#7989)
* make the azdata install url configurable

* use settings without reloading

* comments
2019-10-24 22:42:52 -07:00
Maddy
910dc32623 hide save book action from command pallet (#7981) 2019-10-24 22:42:40 -07:00
Alan Ren
86f38f5074 revert the notebook background execution (#7984) 2019-10-24 22:41:56 -07:00
Charles Gagnon
ba9d3169c5 Change BDC view errors to use modal dialog instead of error toast (#7985)
* Change BDC view errors to use modal dialog instead of error toast

* Move to common control
2019-10-24 22:39:59 -07:00
Charles Gagnon
a19885e719 Fix troubleshoot URL lookup (#7978) 2019-10-24 22:39:51 -07:00
Amir Omidi
84457bf981 Installer icons (#7057) 2019-10-24 12:17:17 -07:00
Karl Burtram
d73fa5e168 Revert "Separate icons for non-stable builds (#7857)"
This reverts commit a60cd0132e.
2019-10-24 12:15:19 -07:00
Alan Ren
e9c3ffe424 remove insider build check (#7926)
* remove insider build check

* fix welcome page not load issue
2019-10-24 00:11:49 -07:00
Aditya Bist
a1aa303922 Fix node infinitely loading when a firewall dialog is cancelled (#7970)
* add back icons for azure actions

* fix firewall infinite loop

* formatting

* change message to firewall canceled

* fix tests
2019-10-24 00:11:43 -07:00
Chris LaFreniere
c9dd2fb4a8 Notebooks: ensure python path dirs added to path on session start (#7968)
* ensure python path dirs add to path session start

* Change logic slightly

* PR feedback from Charles
2019-10-24 00:11:38 -07:00
Chris LaFreniere
3d95b0032e Update recommended package versions for ps (#7972) 2019-10-24 00:11:31 -07:00
Chris LaFreniere
5ff747d6ef check for ownerDocument focus for focus (#7964) 2019-10-24 00:11:24 -07:00
Chris LaFreniere
d26f4167fb Fix for relative links not being resolved in notebook outputs (#7966)
* Fix for relative links not being resolved

* Add comment
2019-10-24 00:11:17 -07:00
Aditya Bist
93a28b30c7 add back icons for azure actions (#7963) 2019-10-24 00:11:10 -07:00
Cory Rivera
10d7db8b37 Append stdErr log to error message when a streamed console command fails. (#7868) 2019-10-24 00:06:33 -07:00
Chris LaFreniere
c4a8b786c3 Add Option to Halt Notebook when Error Occurs in SQL Kernel (#7884)
* Add Option to Halt Nb when Error Occurs

* PR comments
2019-10-23 09:12:32 -07:00
Maddy
c99c09a6ab Update/sqlserverbook extension to stable (#7914)
* move package info from builtin-inisders to builtin extensions

* vbump for the filename fiasco change

* merged master

* revert sql.bat update
2019-10-23 09:12:25 -07:00
Charles Gagnon
b6a36ebc59 BDC Dashboard context sensitive troubleshoot links (#7895)
* Add context awareness to troubleshoot button on dashboard

* Remove tests for now

* Undo yarn.lock changes

* Correct yarn.lock version

* Lower case service check
2019-10-23 09:12:16 -07:00
Charles Gagnon
b783a69e36 Fix HDFS paths to be encoded properly (#7896) 2019-10-23 09:12:08 -07:00
Kevin Cunnane
bbad8f194c Add help text to mount HDFS dialog (#7865) 2019-10-23 09:12:02 -07:00
Charles Gagnon
6f6ba99251 Disable failing test (#7882) 2019-10-23 09:11:55 -07:00
Amir Omidi
f991293ee8 Move vscode from dependencies to devDependencies (#7864)
* Update package.json

Move vscode out of dependencies

* Change extensions.js
2019-10-23 09:11:44 -07:00
Charles Gagnon
a60cd0132e Separate icons for non-stable builds (#7857)
* Use separate icons for non-stable builds

* Fix file name

* Switch icon

* Updated icons

* Switch to copy of code.ico until issue is fixed

* Fix icon

* remove

* add

* Fix file renaming

* Fix a couple naming issues

* Move iss changes to build file
2019-10-22 17:47:27 -07:00
Karl Burtram
05a53af085 Ports to release/1.13 for 10/21 (#7879)
* Add (dummy) IPyWidgets Renderer (#7849)

* Updates to package.json to show books on stable (#7836)

* Updates to package.json to show books on stable

* remove notebookQuality context key

* renamed untitiled to unsaved

* fix the wizard opened twice issue #7866 (#7869)

* fix a typo (#7871)
2019-10-21 23:07:32 -07:00
1353 changed files with 88047 additions and 57153 deletions

View File

@@ -1,9 +0,0 @@
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:
https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#pull-requests.
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `master` branch.
* Include a description of the proposed changes and how to test them.
-->
This PR fixes #

View File

@@ -1,118 +0,0 @@
name: CI
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
- release/*
jobs:
linux:
runs-on: ubuntu-latest
env:
CHILD_CONCURRENCY: "1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
# TODO: rename azure-pipelines/linux/xvfb.init to github-actions
- run: |
sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libkrb5-dev # {{SQL CARBON EDIT}} add kerberos dep
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
name: Setup Build Environment
- uses: actions/setup-node@v1
with:
node-version: 10
# TODO: cache node modules
- run: yarn --frozen-lockfile
name: Install Dependencies
- run: yarn electron x64
name: Download Electron
- run: yarn gulp hygiene --skip-tslint
name: Run Hygiene Checks
- run: yarn gulp tslint
name: Run TSLint Checks
- run: yarn strict-null-check # {{SQL CARBON EDIT}} add step
name: Run Strict Null Check
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
# name: Run Monaco Editor Checks
- run: yarn compile
name: Compile Sources
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
# name: Download Built-in Extensions
- run: DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
name: Run Unit Tests
# - run: DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
# name: Run Integration Tests
windows:
runs-on: windows-2016
env:
CHILD_CONCURRENCY: "1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: actions/setup-python@v1
with:
python-version: '2.x'
- run: yarn --frozen-lockfile
name: Install Dependencies
- run: yarn electron
name: Download Electron
- run: yarn gulp hygiene --skip-tslint
name: Run Hygiene Checks
- run: yarn gulp tslint
name: Run TSLint Checks
- run: yarn strict-null-check # {{SQL CARBON EDIT}} add step
name: Run Strict Null Check
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
# name: Run Monaco Editor Checks
- run: yarn compile
name: Compile Sources
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
# name: Download Built-in Extensions
- run: .\scripts\test.bat --tfs "Unit Tests"
name: Run Unit Tests
# - run: .\scripts\test-integration.bat --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
# name: Run Integration Tests
darwin:
runs-on: macos-latest
env:
CHILD_CONCURRENCY: "1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
- run: yarn --frozen-lockfile
name: Install Dependencies
- run: yarn electron x64
name: Download Electron
- run: yarn gulp hygiene --skip-tslint
name: Run Hygiene Checks
- run: yarn gulp tslint
name: Run TSLint Checks
- run: yarn strict-null-check # {{SQL CARBON EDIT}} add step
name: Run Strict Null Check
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
# name: Run Monaco Editor Checks
- run: yarn compile
name: Compile Sources
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
# name: Download Built-in Extensions
- run: ./scripts/test.sh --tfs "Unit Tests"
name: Run Unit Tests
# - run: ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
# name: Run Integration Tests

View File

@@ -1,13 +0,0 @@
name: TSLint Enforcement
on: [pull_request]
jobs:
job:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v1
- name: TSLint
uses: aaomidi/gh-action-tslint@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
tslint_config: 'tslint-sql.json'

27
.vscode/launch.json vendored
View File

@@ -128,33 +128,6 @@
"webRoot": "${workspaceFolder}",
"timeout": 45000
},
{
"type": "chrome",
"request": "launch",
"name": "Launch ADS (Web) (TBD)",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"web"
],
},
{
"type": "chrome",
"request": "launch",
"name": "Launch ADS (Web, Chrome) (TBD)",
"url": "http://localhost:8080",
"preLaunchTask": "Run web"
},
{
"type": "node",
"request": "launch",
"name": "Git Unit Tests",
"program": "${workspaceFolder}/extensions/git/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"cwd": "${workspaceFolder}/extensions/git",
"outFiles": [
"${workspaceFolder}/extensions/git/out/**/*.js"
]
},
{
"name": "Launch Built-in Extension",
"type": "extensionHost",

View File

@@ -60,6 +60,5 @@
"remote.extensionKind": {
"msjsdiag.debugger-for-chrome": "workspace"
},
"gulp.autoDetect": "off",
"files.insertFinalNewline": true
}

23
.vscode/tasks.json vendored
View File

@@ -90,8 +90,8 @@
"problemMatcher": []
},
{
"type": "npm",
"script": "electron",
"type": "gulp",
"task": "electron",
"label": "Download electron"
},
{
@@ -99,24 +99,5 @@
"task": "hygiene",
"problemMatcher": []
},
{
"type": "shell",
"command": "yarn web -- --no-launch",
"label": "Run web",
"isBackground": true,
// This section to make error go away when launching the debug config
"problemMatcher": {
"pattern": {
"regexp": ""
},
"background": {
"beginsPattern": ".*node .*",
"endsPattern": "Web UI available at .*"
}
},
"presentation": {
"reveal": "never"
}
},
]
}

View File

@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron"
target "6.0.12"
target "4.2.10"
runtime "electron"

View File

@@ -2,7 +2,6 @@
[![Join the chat at https://gitter.im/Microsoft/sqlopsstudio](https://badges.gitter.im/Microsoft/sqlopsstudio.svg)](https://gitter.im/Microsoft/sqlopsstudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://dev.azure.com/azuredatastudio/azuredatastudio/_apis/build/status/Azure%20Data%20Studio%20CI?branchName=master)](https://dev.azure.com/azuredatastudio/azuredatastudio/_build/latest?definitionId=4&branchName=master)
[![Twitter Follow](https://img.shields.io/twitter/follow/azuredatastudio?style=social)](https://twitter.com/azuredatastudio)
Azure Data Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

View File

@@ -0,0 +1,85 @@
steps:
- script: |
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:10
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
sudo apt-get install -y libkrb5-dev
# sh -e /etc/init.d/xvfb start
# sleep 3
displayName: "Linux preinstall"
condition: eq(variables['Agent.OS'], 'Linux')
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
inputs:
versionSpec: "1.10.1"
- script: |
yarn --frozen-lockfile
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp electron-x64
displayName: Download Electron
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- script: |
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn tslint
displayName: Run TSLint
- script: |
yarn strict-null-check
displayName: Run Strict Null Check
- script: |
yarn compile
displayName: Compile
- script: |
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- script: |
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests" --coverage
displayName: Run Unit Tests (Mac)
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
- task: PublishTestResults@2
inputs:
testResultsFiles: '*-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)/.build/coverage/cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/.build/coverage/lcov-report
condition: ne(variables['Agent.OS'], 'Linux')

View File

@@ -0,0 +1,60 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
inputs:
versionSpec: "1.10.1"
- script: |
yarn --frozen-lockfile
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp electron-x64
displayName: "Electron"
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- script: |
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn tslint
displayName: Run TSLint
- script: |
yarn strict-null-check
displayName: Run Strict Null Check
- script: |
yarn compile
displayName: Compile
- powershell: |
.\scripts\test.bat --tfs "Unit Tests"
displayName: Run Unit Tests
- task: PublishTestResults@2
inputs:
testResultsFiles: "*-results.xml"
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
condition: succeededOrFailed()

View File

@@ -1,18 +1,22 @@
trigger:
- master
- release/*
jobs:
- job: Windows
pool:
vmImage: VS2017-Win2016
steps:
- template: build/azure-pipelines/win32/continuous-build-win32.yml
- job: Windows
pool:
vmImage: VS2017-Win2016
steps:
- template: azure-pipelines-windows.yml
- job: Linux
pool:
vmImage: 'Ubuntu-16.04'
steps:
- template: build/azure-pipelines/linux/continuous-build-linux.yml
- job: Linux
pool:
vmImage: "Ubuntu-16.04"
steps:
- template: azure-pipelines-linux-mac.yml
- job: macOS
pool:
vmImage: macOS 10.13
steps:
- template: build/azure-pipelines/darwin/continuous-build-darwin.yml
- job: macOS
pool:
vmImage: macOS 10.13
steps:
- template: azure-pipelines-linux-mac.yml

View File

@@ -4,64 +4,49 @@ steps:
versionSpec: "10.15.1"
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: '$(build-cache)' # {{SQL CARBON EDIT}} update build cache
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: '$(ArtifactFeed)'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.x"
- script: |
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
yarn --frozen-lockfile
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN) # {{SQL CARBON EDIT}} add github token
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: '$(build-cache)' # {{SQL CARBON EDIT}} update build cache
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: '$(ArtifactFeed)'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn electron x64
yarn gulp electron-x64
displayName: Download Electron
env:
GITHUB_TOKEN: $(GITHUB_TOKEN) # {{SQL CARBON EDIT}} add github token
- script: |
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn gulp tslint
displayName: Run TSLint Checks
- script: | # {{SQL CARBON EDIT}} add step
yarn strict-null-check
displayName: Run Strict Null Check.
- script: | # {{SQL CARBON EDIT}} add step
yarn tslint
displayName: Run TSLint (gci)
# - script: | {{SQL CARBON EDIT}} remove step
# yarn monaco-compile-check
# displayName: Run Monaco Editor Checks
- script: |
yarn monaco-compile-check
displayName: Run Monaco Editor Checks
- script: |
yarn compile
displayName: Compile Sources
# - script: | {{SQL CARBON EDIT}} remove step
# yarn download-builtin-extensions
# displayName: Download Built-in Extensions
- script: |
yarn download-builtin-extensions
displayName: Download Built-in Extensions
- script: |
./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests
# - script: | {{SQL CARBON EDIT}} remove step
# ./scripts/test-integration.sh --tfs "Integration Tests"
# displayName: Run Integration Tests
- script: |
./scripts/test-integration.sh --tfs "Integration Tests"
displayName: Run Integration Tests
- task: PublishTestResults@2
displayName: Publish Tests Results
inputs:
testResultsFiles: '*-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
condition: succeededOrFailed()
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 # {{SQL CARBON EDIT}} add task
displayName: 'Component Detection'
inputs:
alertWarningLevel: High
failOnAlert: true

View File

@@ -2,7 +2,7 @@ steps:
- script: |
set -e
sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libkrb5-dev #{{SQL CARBON EDIT}} add kerberos dep
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
@@ -12,64 +12,49 @@ steps:
versionSpec: "10.15.1"
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: '$(build-cache)' # {{SQL CARBON EDIT}} update build cache
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: '$(ArtifactFeed)'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.x"
- script: |
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
yarn --frozen-lockfile
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN) # {{SQL CARBON EDIT}} add github token
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: '$(build-cache)' # {{SQL CARBON EDIT}} update build cache
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: '$(ArtifactFeed)'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn electron x64
yarn gulp electron-x64
displayName: Download Electron
env:
GITHUB_TOKEN: $(GITHUB_TOKEN) # {{SQL CARBON EDIT}} add github token
- script: |
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn gulp tslint
displayName: Run TSLint Checks
- script: | # {{SQL CARBON EDIT}} add gci checks
yarn tslint
displayName: Run TSLint (gci)
- script: | # {{SQL CARBON EDIT}} add strict null check
yarn strict-null-check
displayName: Run Strict Null Check
# - script: | {{SQL CARBON EDIT}} remove monaco editor checks
# yarn monaco-compile-check
# displayName: Run Monaco Editor Checks
- script: |
yarn monaco-compile-check
displayName: Run Monaco Editor Checks
- script: |
yarn compile
displayName: Compile Sources
# - script: | {{SQL CARBON EDIT}} remove step
# yarn download-builtin-extensions
# displayName: Download Built-in Extensions
- script: |
yarn download-builtin-extensions
displayName: Download Built-in Extensions
- script: |
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests
# - script: | {{SQL CARBON EDIT}} remove step
# DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests"
# displayName: Run Integration Tests
- script: |
DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests"
displayName: Run Integration Tests
- task: PublishTestResults@2
displayName: Publish Tests Results
inputs:
testResultsFiles: '*-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
condition: succeededOrFailed()
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 # {{SQL CARBON EDIT}} add task
displayName: 'Component Detection'
inputs:
alertWarningLevel: High
failOnAlert: true

View File

@@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const cp = require("child_process");
let tag = '';
try {
tag = cp
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
if (!isValidTag(tag)) {
throw Error(`Invalid tag ${tag}`);
}
}
catch (err) {
console.error(err);
console.error('Failed to update types');
process.exit(1);
}
function isValidTag(t) {
if (t.split('.').length !== 3) {
return false;
}
const [major, minor, bug] = t.split('.');
// Only release for tags like 1.34.0
if (bug !== '0') {
return false;
}
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
return false;
}
return true;
}

View File

@@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const cp = require("child_process");
const path = require("path");
let tag = '';
try {
tag = cp
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
updateDTSFile(outPath, tag);
console.log(`Done updating vscode.d.ts at ${outPath}`);
}
catch (err) {
console.error(err);
console.error('Failed to update types');
process.exit(1);
}
function updateDTSFile(outPath, tag) {
const oldContent = fs.readFileSync(outPath, 'utf-8');
const newContent = getNewFileContent(oldContent, tag);
fs.writeFileSync(outPath, newContent);
}
function getNewFileContent(content, tag) {
const oldheader = [
`/*---------------------------------------------------------------------------------------------`,
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
` *--------------------------------------------------------------------------------------------*/`
].join('\n');
return getNewFileHeader(tag) + content.slice(oldheader.length);
}
function getNewFileHeader(tag) {
const [major, minor] = tag.split('.');
const shorttag = `${major}.${minor}`;
const header = [
`// Type definitions for Visual Studio Code ${shorttag}`,
`// Project: https://github.com/microsoft/vscode`,
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
``,
`/*---------------------------------------------------------------------------------------------`,
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
` * Licensed under the Source EULA.`,
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
` *--------------------------------------------------------------------------------------------*/`,
``,
`/**`,
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
` * See https://code.visualstudio.com/api for more information`,
` */`
].join('\n');
return header;
}

View File

@@ -2,7 +2,7 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.x"
- task: UsePythonVersion@0
@@ -11,61 +11,45 @@ steps:
addToPath: true
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: '$(build-cache)' # {{SQL CARBON EDIT}} update build cache
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: '$(ArtifactFeed)'
- powershell: |
yarn --frozen-lockfile
env:
CHILD_CONCURRENCY: "1"
GITHUB_TOKEN: $(GITHUB_TOKEN) # {{SQL CARBON EDIT}} add github token
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: '$(build-cache)' # {{SQL CARBON EDIT}} update build cache
keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: '$(ArtifactFeed)'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- powershell: |
yarn electron
env:
GITHUB_TOKEN: $(GITHUB_TOKEN) # {{SQL CARBON EDIT}} add github token
yarn gulp electron
- script: |
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn gulp tslint
displayName: Run TSLint Checks
- script: | # {{SQL CARBON EDIT}} add step
yarn tslint
displayName: Run TSLint (gci)
- script: | # {{SQL CARBON EDIT}} add step
yarn strict-null-check
displayName: Run Strict Null Check
# - powershell: | {{SQL CARBON EDIT}} remove step
# yarn monaco-compile-check
# displayName: Run Monaco Editor Checks
- powershell: |
yarn monaco-compile-check
displayName: Run Monaco Editor Checks
- powershell: |
yarn compile
displayName: Compile Sources
# - powershell: | {{SQL CARBON EDIT}} remove step
# yarn download-builtin-extensions
# displayName: Download Built-in Extensions
- powershell: |
yarn download-builtin-extensions
displayName: Download Built-in Extensions
- powershell: |
.\scripts\test.bat --tfs "Unit Tests"
displayName: Run Unit Tests
# - powershell: | {{SQL CARBON EDIT}} remove step
# .\scripts\test-integration.bat --tfs "Integration Tests"
# displayName: Run Integration Tests
- powershell: |
.\scripts\test-integration.bat --tfs "Integration Tests"
displayName: Run Integration Tests
- task: PublishTestResults@2
displayName: Publish Tests Results
inputs:
testResultsFiles: '*-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
condition: succeededOrFailed()
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 # {{SQL CARBON EDIT}} add task
displayName: 'Component Detection'
inputs:
alertWarningLevel: High
failOnAlert: true

View File

@@ -107,7 +107,7 @@ steps:
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { yarn electron $(VSCODE_ARCH) }
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
displayName: Run unit tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

View File

@@ -84,6 +84,9 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
`lib.dom.d.ts`,
`lib.webworker.importscripts.d.ts`
],
redirects: {
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
},
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
destRoot: path.join(root, 'out-editor-src')

View File

@@ -73,6 +73,7 @@ const indentationFilter = [
'!**/yarn-error.log',
// except multiple specific folders
'!**/octicons/**',
'!**/codicon/**',
'!**/fixtures/**',
'!**/lib/**',
@@ -135,7 +136,6 @@ const copyrightFilter = [
'!extensions/html-language-features/server/src/modes/typescript/*',
'!extensions/*/server/bin/*',
'!src/vs/editor/test/node/classification/typescript-test.ts',
'!scripts/code-web.js',
// {{SQL CARBON EDIT}}
'!extensions/notebook/src/intellisense/text.ts',
'!extensions/mssql/src/hdfs/webhdfs.ts',
@@ -197,33 +197,7 @@ const tslintBaseFilter = [
'!extensions/big-data-cluster/src/bigDataCluster/controller/tokenApiGenerated.ts' // {{SQL CARBON EDIT}},
];
// {{SQL CARBON EDIT}}
const sqlFilter = [
'src/sql/**',
'extensions/**',
// Ignore VS Code extensions
'!extensions/bat/**',
'!extensions/configuration-editing/**',
'!extensions/docker/**',
'!extensions/extension-editing/**',
'!extensions/git/**',
'!extensions/git-ui/**',
'!extensions/image-preview/**',
'!extensions/insights-default/**',
'!extensions/json/**',
'!extensions/json-language-features/**',
'!extensions/markdown-basics/**',
'!extensions/markdown-language-features/**',
'!extensions/merge-conflict/**',
'!extensions/powershell/**',
'!extensions/python/**',
'!extensions/r/**',
'!extensions/theme-*/**',
'!extensions/vscode-*/**',
'!extensions/xml/**',
'!extensions/xml-language-features/**',
'!extensions/yarml/**',
];
const sqlFilter = ['src/sql/**']; // {{SQL CARBON EDIT}}
const tslintCoreFilter = [
'src/**/*.ts',
@@ -249,12 +223,6 @@ const tslintHygieneFilter = [
...tslintBaseFilter
];
const fileLengthFilter = filter([
'**',
'!extensions/import/*.docx',
'!extensions/admin-tool-ext-win/license/**'
], {restore: true});
const copyrightHeaderLines = [
'/*---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
@@ -393,23 +361,6 @@ function hygiene(some) {
});
});
const filelength = es.through(function (file) {
const fileName = path.basename(file.relative);
const fileDir = path.dirname(file.relative);
//check the filename is < 50 characters (basename gets the filename with extension).
if (fileName.length > 50) {
console.error(`File name '${fileName}' under ${fileDir} is too long. Rename file to have less than 50 characters.`);
errorCount++;
}
if (file.relative.length > 150) {
console.error(`File path ${file.relative} exceeds acceptable file-length. Rename the path to have less than 150 characters.`);
errorCount++;
}
this.emit('data', file);
});
const tslintConfiguration = tslint.Configuration.findConfiguration('tslint.json', '.');
const tslintOptions = { fix: false, formatter: 'json' };
const tsLinter = new tslint.Linter(tslintOptions);
@@ -428,7 +379,6 @@ function hygiene(some) {
input = some;
}
// {{SQL CARBON EDIT}} Linting for SQL
const tslintSqlConfiguration = tslint.Configuration.findConfiguration('tslint-sql.json', '.');
const tslintSqlOptions = { fix: false, formatter: 'json' };
const sqlTsLinter = new tslint.Linter(tslintSqlOptions);
@@ -441,9 +391,6 @@ function hygiene(some) {
const productJsonFilter = filter('product.json', { restore: true });
const result = input
.pipe(fileLengthFilter)
.pipe(filelength)
.pipe(fileLengthFilter.restore)
.pipe(filter(f => !f.stat.isDirectory()))
.pipe(productJsonFilter)
.pipe(process.env['BUILD_SOURCEVERSION'] ? es.through() : productJson)
@@ -460,8 +407,8 @@ function hygiene(some) {
if (!process.argv.some(arg => arg === '--skip-tslint')) {
typescript = typescript.pipe(tsl);
typescript = typescript
.pipe(filter(sqlFilter)) // {{SQL CARBON EDIT}}
.pipe(sqlTsl);
.pipe(filter(sqlFilter))
.pipe(sqlTsl); // {{SQL CARBON EDIT}}
}
const javascript = result

View File

@@ -13,6 +13,10 @@ const del = require('del');
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
const path = require('path');
const fs = require('fs');
const rollup = require('rollup');
const rollupNodeResolve = require('rollup-plugin-node-resolve');
const rollupCommonJS = require('rollup-plugin-commonjs');
gulp.task('clean-mssql-extension', util.rimraf('extensions/mssql/node_modules'));
gulp.task('clean-credentials-extension', util.rimraf('extensions/credentials/node_modules'));
@@ -135,3 +139,60 @@ function installSsmsMin() {
gulp.task('install-ssmsmin', () => {
return installSsmsMin();
});
async function rollupModule(options) {
const moduleName = options.moduleName;
try {
const inputFile = options.inputFile;
const outputDirectory = options.outputDirectory;
await fs.promises.mkdir(outputDirectory, {
recursive: true
});
const outputFileName = options.outputFileName;
const outputMapName = `${outputFileName}.map`;
const external = options.external || [];
const outputFilePath = path.resolve(outputDirectory, outputFileName);
const outputMapPath = path.resolve(outputDirectory, outputMapName);
const bundle = await rollup.rollup({
input: inputFile,
plugins: [
rollupNodeResolve(),
rollupCommonJS(),
],
external,
});
const generatedBundle = await bundle.generate({
output: {
name: moduleName
},
format: 'umd',
sourcemap: true
});
const result = generatedBundle.output[0];
result.code = result.code + '\n//# sourceMappingURL=' + path.basename(outputMapName);
await fs.promises.writeFile(outputFilePath, result.code);
await fs.promises.writeFile(outputMapPath, result.map);
return {
name: moduleName,
result: true
};
} catch (ex) {
return {
name: moduleName,
result: false,
exception: ex
};
}
}
module.exports = {
rollupModule
};

View File

@@ -31,7 +31,7 @@ const crypto = require('crypto');
const i18n = require('./lib/i18n');
const ext = require('./lib/extensions'); // {{SQL CARBON EDIT}}
const deps = require('./dependencies');
const { config } = require('./lib/electron');
const getElectronVersion = require('./lib/electron').getElectronVersion;
const createAsar = require('./lib/asar').createAsar;
const { compileBuildTask } = require('./gulpfile.compile');
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
@@ -78,6 +78,7 @@ const vscodeResources = [
'out-build/vs/base/common/performance.js',
'out-build/vs/base/node/languagePacks.js',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/base/browser/ui/codiconLabel/codicon/**',
'out-build/vs/workbench/browser/media/*-theme.css',
'out-build/vs/workbench/contrib/debug/**/*.json',
@@ -143,6 +144,73 @@ const minifyVSCodeTask = task.define('minify-vscode', task.series(
));
gulp.task(minifyVSCodeTask);
// Package
// @ts-ignore JSON checking: darwinCredits is optional
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
function darwinBundleDocumentType(extensions, icon) {
return {
name: product.nameLong + ' document',
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: extensions,
iconFile: icon
};
}
const config = {
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [
// {{SQL CARBON EDIT}} - Remove most document types and replace with ours
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], 'resources/darwin/code_file.icns'),
],
darwinBundleURLTypes: [{
role: 'Viewer',
name: product.nameLong,
urlSchemes: [product.urlProtocol]
}],
darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName,
winIcon: 'resources/win32/code.ico',
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
// @ts-ignore JSON checking: electronRepository is optional
repo: product.electronRepository || undefined
};
function getElectron(arch) {
return () => {
const electronOpts = _.extend({}, config, {
platform: process.platform,
arch,
ffmpegChromium: true,
keepDefaultApp: true
});
return gulp.src('package.json')
.pipe(json({ name: product.nameShort }))
.pipe(electron(electronOpts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(vfs.dest('.build/electron'));
};
}
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
/**
* Compute checksums for some files.
*
@@ -200,7 +268,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
// {{SQL CARBON EDIT}}
ext.packageBuiltInExtensions();
const extensions = gulp.src(['.build/extensions/**', '!.build/extensions/node_modules/**'], { base: '.build', dot: true }); // {{SQL CARBON EDIT}} - don't package the node_modules directory
const extensions = gulp.src('.build/extensions/**', { base: '.build', dot: true });
const sources = es.merge(src, extensions)
.pipe(filter(['**', '!**/*.js.map'], { dot: true }));

View File

@@ -44,7 +44,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@EXEC@@', `/usr/share/${product.applicationName}/${product.applicationName}`))
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
.pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })

View File

@@ -2,88 +2,29 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const path = require("path");
const vfs = require("vinyl-fs");
const filter = require("gulp-filter");
const json = require("gulp-json-editor");
const _ = require("underscore");
const util = require("./util");
const electron = require('gulp-atom-electron');
const fs = require('fs');
const path = require('path');
const root = path.dirname(path.dirname(__dirname));
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
const commit = util.getVersion(root);
function getElectronVersion() {
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
return target;
}
exports.getElectronVersion = getElectronVersion;
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
function darwinBundleDocumentType(extensions, icon) {
return {
name: product.nameLong + ' document',
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: extensions,
iconFile: icon
};
}
exports.config = {
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], 'resources/darwin/code_file.icns'),
],
darwinBundleURLTypes: [{
role: 'Viewer',
name: product.nameLong,
urlSchemes: [product.urlProtocol]
}],
darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName,
winIcon: 'resources/win32/code.ico',
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
repo: product.electronRepository || undefined
};
function getElectron(arch) {
return () => {
const electronOpts = _.extend({}, exports.config, {
platform: process.platform,
arch,
ffmpegChromium: true,
keepDefaultApp: true
});
return vfs.src('package.json')
.pipe(json({ name: product.nameShort }))
.pipe(electron(electronOpts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(vfs.dest('.build/electron'));
};
}
async function main(arch = process.arch) {
const version = getElectronVersion();
const electronPath = path.join(root, '.build', 'electron');
const versionFile = path.join(electronPath, 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;
if (!isUpToDate) {
await util.rimraf(electronPath)();
await util.streamToPromise(getElectron(arch)());
}
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
// @ts-ignore
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
return target;
}
module.exports.getElectronVersion = getElectronVersion;
// returns 0 if the right version of electron is in .build/electron
// @ts-ignore
if (require.main === module) {
main(process.argv[2]).catch(err => {
console.error(err);
process.exit(1);
});
const version = getElectronVersion();
const versionFile = path.join(root, '.build', 'electron', 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;
process.exit(isUpToDate ? 0 : 1);
}

View File

@@ -1,100 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as fs from 'fs';
import * as path from 'path';
import * as vfs from 'vinyl-fs';
import * as filter from 'gulp-filter';
import * as json from 'gulp-json-editor';
import * as _ from 'underscore';
import * as util from './util';
const electron = require('gulp-atom-electron');
const root = path.dirname(path.dirname(__dirname));
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
const commit = util.getVersion(root);
export function getElectronVersion(): string {
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
const target = /^target "(.*)"$/m.exec(yarnrc)![1];
return target;
}
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
function darwinBundleDocumentType(extensions: string[], icon: string) {
return {
name: product.nameLong + ' document',
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: extensions,
iconFile: icon
};
}
export const config = {
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], 'resources/darwin/code_file.icns'),
],
darwinBundleURLTypes: [{
role: 'Viewer',
name: product.nameLong,
urlSchemes: [product.urlProtocol]
}],
darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName,
winIcon: 'resources/win32/code.ico',
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
repo: product.electronRepository || undefined
};
function getElectron(arch: string): () => NodeJS.ReadWriteStream {
return () => {
const electronOpts = _.extend({}, config, {
platform: process.platform,
arch,
ffmpegChromium: true,
keepDefaultApp: true
});
return vfs.src('package.json')
.pipe(json({ name: product.nameShort }))
.pipe(electron(electronOpts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(vfs.dest('.build/electron'));
};
}
async function main(arch = process.arch): Promise<void> {
const version = getElectronVersion();
const electronPath = path.join(root, '.build', 'electron');
const versionFile = path.join(electronPath, 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;
if (!isUpToDate) {
await util.rimraf(electronPath)();
await util.streamToPromise(getElectron(arch)());
}
}
if (require.main === module) {
main(process.argv[2]).catch(err => {
console.error(err);
process.exit(1);
});
}

View File

@@ -1,103 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const rollup = require("rollup");
const path = require("path");
// getting around stupid import rules
const nodeResolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
async function rollupModule(options) {
const moduleName = options.moduleName;
try {
const inputFile = options.inputFile;
const outputDirectory = options.outputDirectory;
await fs.promises.mkdir(outputDirectory, {
recursive: true
});
const outputFileName = options.outputFileName;
const outputMapName = `${outputFileName}.map`;
const external = options.external || [];
const outputFilePath = path.resolve(outputDirectory, outputFileName);
const outputMapPath = path.resolve(outputDirectory, outputMapName);
const bundle = await rollup.rollup({
input: inputFile,
plugins: [
nodeResolve(),
commonjs(),
],
external,
});
const generatedBundle = await bundle.generate({
name: moduleName,
format: 'umd',
sourcemap: true
});
const result = generatedBundle.output[0];
result.code = result.code + '\n//# sourceMappingURL=' + path.basename(outputMapName);
await fs.promises.writeFile(outputFilePath, result.code);
await fs.promises.writeFile(outputMapPath, result.map);
return {
name: moduleName,
result: true
};
}
catch (ex) {
return {
name: moduleName,
result: false,
exception: ex
};
}
}
function rollupAngularSlickgrid(root) {
return new Promise(async (resolve, reject) => {
const result = await rollupModule({
moduleName: 'angular2-slickgrid',
inputFile: path.resolve(root, 'node_modules', 'angular2-slickgrid', 'out', 'index.js'),
outputDirectory: path.resolve(root, 'node_modules', 'angular2-slickgrid', 'out', 'bundles'),
outputFileName: 'angular2-slickgrid.umd.js'
});
if (!result.result) {
return reject(`angular2-slickgrid failed to bundle - ${result.exception}`);
}
resolve();
});
}
exports.rollupAngularSlickgrid = rollupAngularSlickgrid;
function rollupAngular(root) {
return new Promise(async (resolve, reject) => {
const modules = ['core', 'animations', 'common', 'compiler', 'forms', 'platform-browser', 'platform-browser-dynamic', 'router'];
const tasks = modules.map((module) => {
return rollupModule({
moduleName: `ng.${module}`,
inputFile: path.resolve(root, 'node_modules', '@angular', module, '@angular', `${module}.es5.js`),
outputDirectory: path.resolve(root, 'node_modules', '@angular', module, 'bundles'),
outputFileName: `${module}.umd.js`,
external: modules.map(mn => `@angular/${mn}`)
});
});
// array of booleans
const x = await Promise.all(tasks);
const result = x.reduce((prev, current) => {
if (!current.result) {
prev.fails.push(current.name);
prev.exceptions.push(current.exception);
prev.result = false;
}
return prev;
}, {
fails: [],
exceptions: [],
result: true,
});
if (!result.result) {
return reject(`failures: ${result.fails} - exceptions: ${JSON.stringify(result.exceptions)}`);
}
resolve();
});
}
exports.rollupAngular = rollupAngular;

View File

@@ -1,125 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'fs';
import * as rollup from 'rollup';
import * as path from 'path';
// getting around stupid import rules
const nodeResolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
export interface IRollupOptions {
moduleName: string;
inputFile: string;
outputDirectory: string;
outputFileName: string;
external?: string[];
}
async function rollupModule(options: IRollupOptions) {
const moduleName = options.moduleName;
try {
const inputFile = options.inputFile;
const outputDirectory = options.outputDirectory;
await fs.promises.mkdir(outputDirectory, {
recursive: true
});
const outputFileName = options.outputFileName;
const outputMapName = `${outputFileName}.map`;
const external = options.external || [];
const outputFilePath = path.resolve(outputDirectory, outputFileName);
const outputMapPath = path.resolve(outputDirectory, outputMapName);
const bundle = await rollup.rollup({
input: inputFile,
plugins: [
nodeResolve(),
commonjs(),
],
external,
});
const generatedBundle = await bundle.generate({
name: moduleName,
format: 'umd',
sourcemap: true
});
const result = generatedBundle.output[0];
result.code = result.code + '\n//# sourceMappingURL=' + path.basename(outputMapName);
await fs.promises.writeFile(outputFilePath, result.code);
await fs.promises.writeFile(outputMapPath, result.map);
return {
name: moduleName,
result: true
};
} catch (ex) {
return {
name: moduleName,
result: false,
exception: ex
};
}
}
export function rollupAngularSlickgrid(root: string): Promise<void> {
return new Promise(async (resolve, reject) => {
const result = await rollupModule({
moduleName: 'angular2-slickgrid',
inputFile: path.resolve(root, 'node_modules', 'angular2-slickgrid', 'out', 'index.js'),
outputDirectory: path.resolve(root, 'node_modules', 'angular2-slickgrid', 'out', 'bundles'),
outputFileName: 'angular2-slickgrid.umd.js'
});
if (!result.result) {
return reject(`angular2-slickgrid failed to bundle - ${result.exception}`);
}
resolve();
});
}
export function rollupAngular(root: string): Promise<void> {
return new Promise(async (resolve, reject) => {
const modules = ['core', 'animations', 'common', 'compiler', 'forms', 'platform-browser', 'platform-browser-dynamic', 'router'];
const tasks = modules.map((module) => {
return rollupModule({
moduleName: `ng.${module}`,
inputFile: path.resolve(root, 'node_modules', '@angular', module, '@angular', `${module}.es5.js`),
outputDirectory: path.resolve(root, 'node_modules', '@angular', module, 'bundles'),
outputFileName: `${module}.umd.js`,
external: modules.map(mn => `@angular/${mn}`)
});
});
// array of booleans
const x = await Promise.all(tasks);
const result = x.reduce<{ fails: string[]; exceptions: string[]; result: boolean }>((prev, current) => {
if (!current.result) {
prev.fails.push(current.name);
prev.exceptions.push(current.exception);
prev.result = false;
}
return prev;
}, {
fails: [],
exceptions: [],
result: true,
});
if (!result.result) {
return reject(`failures: ${result.fails} - exceptions: ${JSON.stringify(result.exceptions)}`);
}
resolve();
});
}

View File

@@ -48,7 +48,9 @@ class DoubleQuotedStringArgRuleWalker extends Lint.RuleWalker {
const argText = arg.getText();
const doubleQuotedArg = argText.length >= 2 && argText[0] === DoubleQuotedStringArgRuleWalker.DOUBLE_QUOTE && argText[argText.length - 1] === DoubleQuotedStringArgRuleWalker.DOUBLE_QUOTE;
if (!doubleQuotedArg) {
const fix = Lint.Replacement.replaceFromTo(arg.getStart(), arg.getEnd(), `"${arg.getText().slice(1, arg.getWidth() - 1)}"`);
const fix = [
Lint.Replacement.replaceFromTo(arg.getStart(), arg.getWidth(), `"${arg.getText().slice(1, arg.getWidth() - 2)}"`),
];
this.addFailure(this.createFailure(arg.getStart(), arg.getWidth(), `Argument ${this.argIndex + 1} to '${functionName}' must be double quoted.`, fix));
return;
}

View File

@@ -68,7 +68,9 @@ class DoubleQuotedStringArgRuleWalker extends Lint.RuleWalker {
const doubleQuotedArg = argText.length >= 2 && argText[0] === DoubleQuotedStringArgRuleWalker.DOUBLE_QUOTE && argText[argText.length - 1] === DoubleQuotedStringArgRuleWalker.DOUBLE_QUOTE;
if (!doubleQuotedArg) {
const fix = Lint.Replacement.replaceFromTo(arg.getStart(), arg.getEnd(), `"${arg.getText().slice(1, arg.getWidth() - 1)}"`);
const fix = [
Lint.Replacement.replaceFromTo(arg.getStart(), arg.getWidth(), `"${arg.getText().slice(1, arg.getWidth() - 2)}"`),
];
this.addFailure(this.createFailure(
arg.getStart(), arg.getWidth(),
`Argument ${this.argIndex! + 1} to '${functionName}' must be double quoted.`, fix));

View File

@@ -1,49 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const ts = require("typescript");
const Lint = require("tslint");
/**
* Implementation of the no-localize-keys-with-underscore rule which verifies that keys to the localize
* calls don't contain underscores (_) since those break the localization process.
*/
class Rule extends Lint.Rules.AbstractRule {
apply(sourceFile) {
return this.applyWithWalker(new NoLocalizeKeysWithUnderscore(sourceFile, this.getOptions()));
}
}
exports.Rule = Rule;
const signatures = [
"localize",
"nls.localize"
];
class NoLocalizeKeysWithUnderscore extends Lint.RuleWalker {
constructor(file, opts) {
super(file, opts);
}
visitCallExpression(node) {
this.checkCallExpression(node);
super.visitCallExpression(node);
}
checkCallExpression(node) {
// If this isn't one of the localize functions then continue on
const functionName = node.expression.getText();
if (functionName && !signatures.some(s => s === functionName)) {
return;
}
const arg = node && node.arguments && node.arguments.length > 0 ? node.arguments[0] : undefined; // The key is the first element
// Ignore if the arg isn't a string - we expect the compiler to warn if that's an issue
if (arg && ts.isStringLiteral(arg)) {
if (arg.getText().indexOf('_') >= 0) {
const fix = [
Lint.Replacement.replaceFromTo(arg.getStart(), arg.getEnd(), `${arg.getText().replace(/_/g, '.')}`),
];
this.addFailure(this.createFailure(arg.getStart(), arg.getWidth(), `Keys for localize calls must not contain underscores. Use periods (.) instead.`, fix));
return;
}
}
}
}

View File

@@ -1,55 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as Lint from 'tslint';
/**
* Implementation of the no-localize-keys-with-underscore rule which verifies that keys to the localize
* calls don't contain underscores (_) since those break the localization process.
*/
export class Rule extends Lint.Rules.AbstractRule {
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithWalker(new NoLocalizeKeysWithUnderscore(sourceFile, this.getOptions()));
}
}
const signatures = [
"localize",
"nls.localize"
];
class NoLocalizeKeysWithUnderscore extends Lint.RuleWalker {
constructor(file: ts.SourceFile, opts: Lint.IOptions) {
super(file, opts);
}
protected visitCallExpression(node: ts.CallExpression): void {
this.checkCallExpression(node);
super.visitCallExpression(node);
}
private checkCallExpression(node: ts.CallExpression): void {
// If this isn't one of the localize functions then continue on
const functionName = node.expression.getText();
if (functionName && !signatures.some(s => s === functionName)) {
return;
}
const arg = node && node.arguments && node.arguments.length > 0 ? node.arguments[0] : undefined; // The key is the first element
// Ignore if the arg isn't a string - we expect the compiler to warn if that's an issue
if(arg && ts.isStringLiteral(arg)) {
if (arg.getText().indexOf('_') >= 0) {
const fix = [
Lint.Replacement.replaceFromTo(arg.getStart(), arg.getEnd(), `${arg.getText().replace(/_/g, '.')}`),
];
this.addFailure(this.createFailure(
arg.getStart(), arg.getWidth(),
`Keys for localize calls must not contain underscores. Use periods (.) instead.`, fix));
return;
}
}
}
}

View File

@@ -166,23 +166,20 @@ function stripSourceMappingURL() {
}
exports.stripSourceMappingURL = stripSourceMappingURL;
function rimraf(dir) {
const result = () => new Promise((c, e) => {
let retries = 0;
const retry = () => {
_rimraf(dir, { maxBusyTries: 1 }, (err) => {
if (!err) {
return c();
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(), 10);
}
return e(err);
});
};
retry();
});
result.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return result;
let retries = 0;
const retry = (cb) => {
_rimraf(dir, { maxBusyTries: 1 }, (err) => {
if (!err) {
return cb();
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(cb), 10);
}
return cb(err);
});
};
retry.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return retry;
}
exports.rimraf = rimraf;
function getVersion(root) {
@@ -222,10 +219,3 @@ function versionStringToNumber(versionStr) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
}
exports.versionStringToNumber = versionStringToNumber;
function streamToPromise(stream) {
return new Promise((c, e) => {
stream.on('error', err => e(err));
stream.on('end', () => c());
});
}
exports.streamToPromise = streamToPromise;

View File

@@ -218,29 +218,24 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
return es.duplex(input, output);
}
export function rimraf(dir: string): () => Promise<void> {
const result = () => new Promise<void>((c, e) => {
let retries = 0;
export function rimraf(dir: string): (cb: any) => void {
let retries = 0;
const retry = () => {
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
if (!err) {
return c();
}
const retry = (cb: (err?: any) => void) => {
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
if (!err) {
return cb();
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(), 10);
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(cb), 10);
}
return e(err);
});
};
retry();
});
result.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return result;
return cb(err);
});
};
retry.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return retry;
}
export function getVersion(root: string): string | undefined {
@@ -286,10 +281,3 @@ export function versionStringToNumber(versionStr: string) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
}
export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
return new Promise((c, e) => {
stream.on('error', err => e(err));
stream.on('end', () => c());
});
}

View File

@@ -516,7 +516,7 @@ class DeclarationResolver {
'file.ts': fileContents
};
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
const text = service.getEmitOutput('file.ts', true, true).outputFiles[0].text;
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
return new CacheEntry(ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime);
}
}

View File

@@ -617,7 +617,7 @@ export class DeclarationResolver {
'file.ts': fileContents
};
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
const text = service.getEmitOutput('file.ts', true, true).outputFiles[0].text;
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
return new CacheEntry(
ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5),
mtime

View File

@@ -44,10 +44,10 @@
"rollup": "^1.20.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"terser": "4.3.8",
"terser": "4.3.1",
"tslint": "^5.9.1",
"service-downloader": "github:anthonydresser/service-downloader#0.1.7",
"typescript": "3.7.0-dev.20191017",
"typescript": "3.6.2",
"vsce": "1.48.0",
"vscode-telemetry-extractor": "^1.5.4",
"xml2js": "^0.4.17"

View File

@@ -29,7 +29,7 @@ dependencies = [
[[package]]
name = "inno_updater"
version = "0.8.2"
version = "0.8.0"
dependencies = [
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@@ -20,8 +20,8 @@ Compression=lzma
SolidCompression=yes
AppMutex={code:GetAppMutex}
SetupMutex={#AppMutex}setup
WizardImageFile="{#RepoDir}\resources\win32\inno-big-100.bmp,{#RepoDir}\resources\win32\inno-big-125.bmp,{#RepoDir}\resources\win32\inno-big-150.bmp,{#RepoDir}\resources\win32\inno-big-175.bmp,{#RepoDir}\resources\win32\inno-big-200.bmp,{#RepoDir}\resources\win32\inno-big-225.bmp,{#RepoDir}\resources\win32\inno-big-250.bmp"
WizardSmallImageFile="{#RepoDir}\resources\win32\inno-small-100.bmp,{#RepoDir}\resources\win32\inno-small-125.bmp,{#RepoDir}\resources\win32\inno-small-150.bmp,{#RepoDir}\resources\win32\inno-small-175.bmp,{#RepoDir}\resources\win32\inno-small-200.bmp,{#RepoDir}\resources\win32\inno-small-225.bmp,{#RepoDir}\resources\win32\inno-small-250.bmp"
WizardImageFile="{#RepoDir}\resources\win32\sql-big.bmp"
WizardSmallImageFile="{#RepoDir}\resources\win32\sql-small.bmp"
SetupIconFile={#RepoDir}\resources\win32\code.ico
UninstallDisplayIcon={app}\{#ExeBasename}.exe
ChangesEnvironment=true

Binary file not shown.

View File

@@ -322,20 +322,13 @@ acorn@^7.0.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c"
integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==
agent-base@4:
agent-base@4, agent-base@^4.1.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
dependencies:
es6-promisify "^5.0.0"
agent-base@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee"
integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==
dependencies:
es6-promisify "^5.0.0"
ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
@@ -1871,11 +1864,11 @@ http-signature@~1.2.0:
sshpk "^1.7.0"
https-proxy-agent@^2.2.1:
version "2.2.4"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b"
integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==
version "2.2.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
dependencies:
agent-base "^4.3.0"
agent-base "^4.1.0"
debug "^3.1.0"
iconv-lite@0.4.23:
@@ -2384,9 +2377,9 @@ lodash.templatesettings@^3.0.0:
lodash.escape "^3.0.0"
lodash@^4.15.0, lodash@^4.17.10:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
magic-string@^0.25.2:
version "0.25.3"
@@ -3489,10 +3482,10 @@ terser@*:
source-map "~0.6.1"
source-map-support "~0.5.12"
terser@4.3.8:
version "4.3.8"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.8.tgz#707f05f3f4c1c70c840e626addfdb1c158a17136"
integrity sha512-otmIRlRVmLChAWsnSFNO0Bfk6YySuBp6G9qrHiJwlLDd4mxe2ta4sjI7TzIR+W1nBMjilzrMcPOz9pSusgx3hQ==
terser@4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.1.tgz#09820bcb3398299c4b48d9a86aefc65127d0ed65"
integrity sha512-pnzH6dnFEsR2aa2SJaKb1uSCl3QmIsJ8dEkj0Fky+2AwMMcC9doMqLOQIH6wVTEKaVfKVvLSk5qxPBEZT9mywg==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
@@ -3650,10 +3643,10 @@ typed-rest-client@^0.9.0:
tunnel "0.0.4"
underscore "1.8.3"
typescript@3.7.0-dev.20191017:
version "3.7.0-dev.20191017"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20191017.tgz#e61440dd445edea6d7b9a699e7c5d5fbcd1906f2"
integrity sha512-Yi0lCPEN0cn9Gp8TEEkPpgKNR5SWAmx9Hmzzz+oEuivw6amURqRGynaLyFZkMA9iMsvYG5LLqhdlFO3uu5ZT/w==
typescript@3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54"
integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==
typescript@^3.0.1:
version "3.5.3"

View File

@@ -6,7 +6,7 @@
"git": {
"name": "chromium",
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
"commitHash": "91f08db83c2ce8c722ddf0911ead8f7c473bedfa"
"commitHash": "c6a08e5368de4352903e702cde750b33239a50ab"
}
},
"licenseDetail": [
@@ -40,7 +40,7 @@
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
],
"isOnlyProductionDependency": true,
"version": "76.0.3809.146"
"version": "69.0.3497.128"
},
{
"component": {
@@ -48,11 +48,11 @@
"git": {
"name": "nodejs",
"repositoryUrl": "https://github.com/nodejs/node",
"commitHash": "64219741218aa87e259cf8257596073b8e747f0a"
"commitHash": "8c70b2084ce5f76ea1e3b3c4ccdeee4483fe338b"
}
},
"isOnlyProductionDependency": true,
"version": "12.4.0"
"version": "10.11.0"
},
{
"component": {
@@ -60,12 +60,12 @@
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
"commitHash": "1e50380fab37f407c4d357e1e30ecbc3d5a703b8"
"commitHash": "4e4c7527c63fcf27dffaeb58bde996b8d859c0ed"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
"version": "6.0.12"
"version": "4.2.10"
},
{
"component": {
@@ -96,13 +96,25 @@
"component": {
"type": "git",
"git": {
"name": "vscode-codicons",
"repositoryUrl": "https://github.com/microsoft/vscode-codicons",
"commitHash": "7f14c092f65f658cd520df3f13765efe828d0ba4"
"name": "vscode-octicons-font",
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
"commitHash": "4cbf2bd35cf0084eabd47d322cc58339fd7743cf"
}
},
"license": "MIT and Creative Commons Attribution 4.0",
"version": "0.0.1"
"license": "MIT",
"version": "1.3.2"
},
{
"component": {
"type": "git",
"git": {
"name": "octicons",
"repositoryUrl": "https://github.com/primer/octicons",
"commitHash": "d120bf97bc9a12fb415f69fedaf31fe58427ca56"
}
},
"license": "MIT",
"version": "8.3.0"
},
{
"component": {

View File

@@ -74,9 +74,9 @@
"vscode-nls": "^3.2.1"
},
"devDependencies": {
"vscode": "^1.1.10",
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"vscode": "^1.1.36"
"mocha-multi-reporters": "^1.1.7"
},
"__metadata": {
"id": "41",

View File

@@ -99,7 +99,7 @@ function registerCommands(context: vscode.ExtensionContext): void {
async function handleLaunchSsmsMinPropertiesDialogCommand(connectionContext?: azdata.ObjectExplorerContext): Promise<void> {
if (!connectionContext) {
TelemetryReporter.sendErrorEvent(TelemetryViews.SsmsMinProperties, 'NoConnectionContext');
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionContextForProp', "No ConnectionContext provided for handleLaunchSsmsMinPropertiesDialogCommand"));
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionContextForProp', 'No ConnectionContext provided for handleLaunchSsmsMinPropertiesDialogCommand'));
return;
}
@@ -111,7 +111,7 @@ async function handleLaunchSsmsMinPropertiesDialogCommand(connectionContext?: az
nodeType = connectionContext.nodeInfo.nodeType;
} else {
TelemetryReporter.sendErrorEvent(TelemetryViews.SsmsMinProperties, 'NoOENode');
vscode.window.showErrorMessage(localize('adminToolExtWin.noOENode', "Could not determine Object Explorer node from connectionContext : {0}", JSON.stringify(connectionContext)));
vscode.window.showErrorMessage(localize('adminToolExtWin.noOENode', 'Could not determine Object Explorer node from connectionContext : {0}', JSON.stringify(connectionContext)));
return;
}
@@ -128,7 +128,7 @@ async function handleLaunchSsmsMinGswDialogCommand(connectionContext?: azdata.Ob
const action = 'GenerateScripts';
if (!connectionContext) {
TelemetryReporter.sendErrorEvent(TelemetryViews.SsmsMinGsw, 'NoConnectionContext');
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionContextForGsw', "No ConnectionContext provided for handleLaunchSsmsMinPropertiesDialogCommand"));
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionContextForGsw', 'No ConnectionContext provided for handleLaunchSsmsMinPropertiesDialogCommand'));
}
launchSsmsDialog(
@@ -145,7 +145,7 @@ async function handleLaunchSsmsMinGswDialogCommand(connectionContext?: azdata.Ob
async function launchSsmsDialog(action: string, connectionContext: azdata.ObjectExplorerContext): Promise<void> {
if (!connectionContext.connectionProfile) {
TelemetryReporter.sendErrorEvent(TelemetryViews.SsmsMinDialog, 'NoConnectionProfile');
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionProfile', "No connectionProfile provided from connectionContext : {0}", JSON.stringify(connectionContext)));
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionProfile', 'No connectionProfile provided from connectionContext : {0}', JSON.stringify(connectionContext)));
return;
}
@@ -159,7 +159,7 @@ async function launchSsmsDialog(action: string, connectionContext: azdata.Object
}
else {
TelemetryReporter.sendErrorEvent(TelemetryViews.SsmsMinDialog, 'NoOENode');
vscode.window.showErrorMessage(localize('adminToolExtWin.noOENode', "Could not determine Object Explorer node from connectionContext : {0}", JSON.stringify(connectionContext)));
vscode.window.showErrorMessage(localize('adminToolExtWin.noOENode', 'Could not determine Object Explorer node from connectionContext : {0}', JSON.stringify(connectionContext)));
return;
}
@@ -191,7 +191,7 @@ async function launchSsmsDialog(action: string, connectionContext: azdata.Object
}).withConnectionInfo(connectionContext.connectionProfile)
.send();
vscode.window.setStatusBarMessage(localize('adminToolExtWin.launchingDialogStatus', "Launching dialog..."), 3000);
vscode.window.setStatusBarMessage(localize('adminToolExtWin.launchingDialogStatus', 'Launching dialog...'), 3000);
// This will be an async call since we pass in the callback
const proc: ChildProcess = exec(
@@ -212,7 +212,7 @@ async function launchSsmsDialog(action: string, connectionContext: azdata.Object
if (err !== '') {
vscode.window.showErrorMessage(localize(
'adminToolExtWin.ssmsMinError',
"Error calling SsmsMin with args \'{0}\' - {1}", args, err));
'Error calling SsmsMin with args \'{0}\' - {1}', args, err));
}
});

View File

@@ -16,9 +16,9 @@ agent-base@4, agent-base@^4.3.0:
es6-promisify "^5.0.0"
ajv@^6.5.5:
version "6.10.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52"
integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==
version "6.9.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b"
integrity sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==
dependencies:
fast-deep-equal "^2.0.1"
fast-json-stable-stringify "^2.0.0"
@@ -107,9 +107,9 @@ charenc@~0.0.1:
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=
combined-stream@^1.0.6, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
version "1.0.7"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
dependencies:
delayed-stream "~1.0.0"
@@ -272,9 +272,9 @@ glob@7.1.2:
path-is-absolute "^1.0.0"
glob@^7.1.2:
version "7.1.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0"
integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==
version "7.1.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
@@ -329,9 +329,9 @@ http-signature@~1.2.0:
sshpk "^1.7.0"
https-proxy-agent@^2.2.1:
version "2.2.4"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b"
integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==
version "2.2.2"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793"
integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==
dependencies:
agent-base "^4.3.0"
debug "^3.1.0"
@@ -345,9 +345,9 @@ inflight@^1.0.4:
wrappy "1"
inherits@2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
is-buffer@~1.1.1:
version "1.1.6"
@@ -408,17 +408,17 @@ md5@^2.1.0:
crypt "~0.0.1"
is-buffer "~1.1.1"
mime-db@1.40.0:
version "1.40.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32"
integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==
mime-db@~1.38.0:
version "1.38.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad"
integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==
mime-types@^2.1.12, mime-types@~2.1.19:
version "2.1.24"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81"
integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==
version "2.1.22"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd"
integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==
dependencies:
mime-db "1.40.0"
mime-db "~1.38.0"
minimatch@3.0.4, minimatch@^3.0.4:
version "3.0.4"
@@ -508,9 +508,9 @@ performance-now@^2.1.0:
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
psl@^1.1.24:
version "1.4.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2"
integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==
version "1.1.31"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
punycode@^1.4.1:
version "1.4.1"
@@ -564,9 +564,9 @@ requires-port@^1.0.0:
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
safe-buffer@^5.0.1, safe-buffer@^5.1.2:
version "5.2.0"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519"
integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
@@ -584,9 +584,9 @@ semver@^5.4.1:
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
source-map-support@^0.5.0:
version "0.5.16"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042"
integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==
version "0.5.13"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"
integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
@@ -661,9 +661,9 @@ url-parse@^1.4.4:
requires-port "^1.0.0"
uuid@^3.3.2:
version "3.3.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==
version "3.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
verror@1.10.0:
version "1.10.0"
@@ -694,7 +694,7 @@ vscode-test@^0.4.1:
http-proxy-agent "^2.1.0"
https-proxy-agent "^2.2.1"
vscode@^1.1.36:
vscode@^1.1.10:
version "1.1.36"
resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.36.tgz#5e1a0d1bf4977d0c7bc5159a9a13d5b104d4b1b6"
integrity sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==

View File

@@ -81,14 +81,14 @@
"vscode-nls": "^3.2.1"
},
"devDependencies": {
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"@types/mocha": "^5.2.5",
"@types/node": "^10.14.8",
"mocha": "^5.2.0",
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscode": "^1.1.36"
"vscode": "^1.1.10"
},
"__metadata": {
"id": "10",

View File

@@ -14,9 +14,9 @@ import { JobData } from './jobData';
const localize = nls.loadMessageBundle();
export class AlertData implements IAgentDialogData {
public static readonly AlertTypeSqlServerEventString: string = localize('alertData.DefaultAlertTypString', "SQL Server event alert");
public static readonly AlertTypePerformanceConditionString: string = localize('alertDialog.PerformanceCondition', "SQL Server performance condition alert");
public static readonly AlertTypeWmiEventString: string = localize('alertDialog.WmiEvent', "WMI event alert");
public static readonly AlertTypeSqlServerEventString: string = localize('alertData.DefaultAlertTypString', 'SQL Server event alert');
public static readonly AlertTypePerformanceConditionString: string = localize('alertDialog.PerformanceCondition', 'SQL Server performance condition alert');
public static readonly AlertTypeWmiEventString: string = localize('alertDialog.WmiEvent', 'WMI event alert');
public static readonly DefaultAlertTypeString: string = AlertData.AlertTypeSqlServerEventString;
ownerUri: string;

View File

@@ -14,12 +14,12 @@ const localize = nls.loadMessageBundle();
export class JobData implements IAgentDialogData {
private readonly JobCompletionActionCondition_Always: string = localize('jobData.whenJobCompletes', "When the job completes");
private readonly JobCompletionActionCondition_OnFailure: string = localize('jobData.whenJobFails', "When the job fails");
private readonly JobCompletionActionCondition_OnSuccess: string = localize('jobData.whenJobSucceeds', "When the job succeeds");
private readonly JobCompletionActionCondition_Always: string = localize('jobData.whenJobCompletes', 'When the job completes');
private readonly JobCompletionActionCondition_OnFailure: string = localize('jobData.whenJobFails', 'When the job fails');
private readonly JobCompletionActionCondition_OnSuccess: string = localize('jobData.whenJobSucceeds', 'When the job succeeds');
// Error Messages
private readonly CreateJobErrorMessage_NameIsEmpty = localize('jobData.jobNameRequired', "Job name must be provided");
private readonly CreateJobErrorMessage_NameIsEmpty = localize('jobData.jobNameRequired', 'Job name must be provided');
private _ownerUri: string;
private _jobCategories: string[];

View File

@@ -17,8 +17,8 @@ const localize = nls.loadMessageBundle();
export class JobStepData implements IAgentDialogData {
// Error Messages
private static readonly CreateStepErrorMessage_JobNameIsEmpty = localize('stepData.jobNameRequired', "Job name must be provided");
private static readonly CreateStepErrorMessage_StepNameIsEmpty = localize('stepData.stepNameRequired', "Step name must be provided");
private static readonly CreateStepErrorMessage_JobNameIsEmpty = localize('stepData.jobNameRequired', 'Job name must be provided');
private static readonly CreateStepErrorMessage_StepNameIsEmpty = localize('stepData.stepNameRequired', 'Step name must be provided');
public dialogMode: AgentDialogMode;
public ownerUri: string;

View File

@@ -13,17 +13,17 @@ import { IAgentDialogData, AgentDialogMode } from '../interfaces';
import { NotebookDialogOptions } from '../dialogs/notebookDialog';
const localize = nls.loadMessageBundle();
const NotebookCompletionActionCondition_Always: string = localize('notebookData.whenJobCompletes', "When the notebook completes");
const NotebookCompletionActionCondition_OnFailure: string = localize('notebookData.whenJobFails', "When the notebook fails");
const NotebookCompletionActionCondition_OnSuccess: string = localize('notebookData.whenJobSucceeds', "When the notebook succeeds");
const NotebookCompletionActionCondition_Always: string = localize('notebookData.whenJobCompletes', 'When the notebook completes');
const NotebookCompletionActionCondition_OnFailure: string = localize('notebookData.whenJobFails', 'When the notebook fails');
const NotebookCompletionActionCondition_OnSuccess: string = localize('notebookData.whenJobSucceeds', 'When the notebook succeeds');
// Error Messages
const CreateNotebookErrorMessage_NameIsEmpty = localize('notebookData.jobNameRequired', "Notebook name must be provided");
const TemplatePathEmptyErrorMessage = localize('notebookData.templatePathRequired', "Template path must be provided");
const InvalidNotebookPathErrorMessage = localize('notebookData.invalidNotebookPath', "Invalid notebook path");
const SelectStorageDatabaseErrorMessage = localize('notebookData.selectStorageDatabase', "Select storage database");
const SelectExecutionDatabaseErrorMessage = localize('notebookData.selectExecutionDatabase', "Select execution database");
const JobWithSameNameExistsErrorMessage = localize('notebookData.jobExists', "Job with similar name already exists");
const CreateNotebookErrorMessage_NameIsEmpty = localize('notebookData.jobNameRequired', 'Notebook name must be provided');
const TemplatePathEmptyErrorMessage = localize('notebookData.templatePathRequired', 'Template path must be provided');
const InvalidNotebookPathErrorMessage = localize('notebookData.invalidNotebookPath', 'Invalid notebook path');
const SelectStorageDatabaseErrorMessage = localize('notebookData.selectStorageDatabase', 'Select storage database');
const SelectExecutionDatabaseErrorMessage = localize('notebookData.selectExecutionDatabase', 'Select execution database');
const JobWithSameNameExistsErrorMessage = localize('notebookData.jobExists', 'Job with similar name already exists');
export class NotebookData implements IAgentDialogData {

View File

@@ -13,8 +13,8 @@ const localize = nls.loadMessageBundle();
export abstract class AgentDialog<T extends IAgentDialogData> {
private static readonly OkButtonText: string = localize('agentDialog.OK', "OK");
private static readonly CancelButtonText: string = localize('agentDialog.Cancel', "Cancel");
private static readonly OkButtonText: string = localize('agentDialog.OK', 'OK');
private static readonly CancelButtonText: string = localize('agentDialog.Cancel', 'Cancel');
protected _onSuccess: vscode.EventEmitter<T> = new vscode.EventEmitter<T>();
protected _isOpen: boolean = false;

View File

@@ -19,48 +19,48 @@ const localize = nls.loadMessageBundle();
export class AlertDialog extends AgentDialog<AlertData> {
// Top level
private static readonly CreateDialogTitle: string = localize('alertDialog.createAlert', "Create Alert");
private static readonly EditDialogTitle: string = localize('alertDialog.editAlert', "Edit Alert");
private static readonly GeneralTabText: string = localize('alertDialog.General', "General");
private static readonly ResponseTabText: string = localize('alertDialog.Response', "Response");
private static readonly OptionsTabText: string = localize('alertDialog.Options', "Options");
private static readonly EventAlertText: string = localize('alertDialog.eventAlert', "Event alert definition");
private static readonly CreateDialogTitle: string = localize('alertDialog.createAlert', 'Create Alert');
private static readonly EditDialogTitle: string = localize('alertDialog.editAlert', 'Edit Alert');
private static readonly GeneralTabText: string = localize('alertDialog.General', 'General');
private static readonly ResponseTabText: string = localize('alertDialog.Response', 'Response');
private static readonly OptionsTabText: string = localize('alertDialog.Options', 'Options');
private static readonly EventAlertText: string = localize('alertDialog.eventAlert', 'Event alert definition');
// General tab strings
private static readonly NameLabel: string = localize('alertDialog.Name', "Name");
private static readonly TypeLabel: string = localize('alertDialog.Type', "Type");
private static readonly EnabledCheckboxLabel: string = localize('alertDialog.Enabled', "Enabled");
private static readonly DatabaseLabel: string = localize('alertDialog.DatabaseName', "Database name");
private static readonly ErrorNumberLabel: string = localize('alertDialog.ErrorNumber', "Error number");
private static readonly SeverityLabel: string = localize('alertDialog.Severity', "Severity");
private static readonly RaiseIfMessageContainsLabel: string = localize('alertDialog.RaiseAlertContains', "Raise alert when message contains");
private static readonly MessageTextLabel: string = localize('alertDialog.MessageText', "Message text");
private static readonly AlertSeverity001Label: string = localize('alertDialog.Severity001', "001 - Miscellaneous System Information");
private static readonly AlertSeverity002Label: string = localize('alertDialog.Severity002', "002 - Reserved");
private static readonly AlertSeverity003Label: string = localize('alertDialog.Severity003', "003 - Reserved");
private static readonly AlertSeverity004Label: string = localize('alertDialog.Severity004', "004 - Reserved");
private static readonly AlertSeverity005Label: string = localize('alertDialog.Severity005', "005 - Reserved");
private static readonly AlertSeverity006Label: string = localize('alertDialog.Severity006', "006 - Reserved");
private static readonly AlertSeverity007Label: string = localize('alertDialog.Severity007', "007 - Notification: Status Information");
private static readonly AlertSeverity008Label: string = localize('alertDialog.Severity008', "008 - Notification: User Intervention Required");
private static readonly AlertSeverity009Label: string = localize('alertDialog.Severity009', "009 - User Defined");
private static readonly AlertSeverity010Label: string = localize('alertDialog.Severity010', "010 - Information");
private static readonly AlertSeverity011Label: string = localize('alertDialog.Severity011', "011 - Specified Database Object Not Found");
private static readonly AlertSeverity012Label: string = localize('alertDialog.Severity012', "012 - Unused");
private static readonly AlertSeverity013Label: string = localize('alertDialog.Severity013', "013 - User Transaction Syntax Error");
private static readonly AlertSeverity014Label: string = localize('alertDialog.Severity014', "014 - Insufficient Permission");
private static readonly AlertSeverity015Label: string = localize('alertDialog.Severity015', "015 - Syntax Error in SQL Statements");
private static readonly AlertSeverity016Label: string = localize('alertDialog.Severity016', "016 - Miscellaneous User Error");
private static readonly AlertSeverity017Label: string = localize('alertDialog.Severity017', "017 - Insufficient Resources");
private static readonly AlertSeverity018Label: string = localize('alertDialog.Severity018', "018 - Nonfatal Internal Error");
private static readonly AlertSeverity019Label: string = localize('alertDialog.Severity019', "019 - Fatal Error in Resource");
private static readonly AlertSeverity020Label: string = localize('alertDialog.Severity020', "020 - Fatal Error in Current Process");
private static readonly AlertSeverity021Label: string = localize('alertDialog.Severity021', "021 - Fatal Error in Database Processes");
private static readonly AlertSeverity022Label: string = localize('alertDialog.Severity022', "022 - Fatal Error: Table Integrity Suspect");
private static readonly AlertSeverity023Label: string = localize('alertDialog.Severity023', "023 - Fatal Error: Database Integrity Suspect");
private static readonly AlertSeverity024Label: string = localize('alertDialog.Severity024', "024 - Fatal Error: Hardware Error");
private static readonly AlertSeverity025Label: string = localize('alertDialog.Severity025', "025 - Fatal Error");
private static readonly AllDatabases: string = localize('alertDialog.AllDatabases', "<all databases>");
private static readonly NameLabel: string = localize('alertDialog.Name', 'Name');
private static readonly TypeLabel: string = localize('alertDialog.Type', 'Type');
private static readonly EnabledCheckboxLabel: string = localize('alertDialog.Enabled', 'Enabled');
private static readonly DatabaseLabel: string = localize('alertDialog.DatabaseName', 'Database name');
private static readonly ErrorNumberLabel: string = localize('alertDialog.ErrorNumber', 'Error number');
private static readonly SeverityLabel: string = localize('alertDialog.Severity', 'Severity');
private static readonly RaiseIfMessageContainsLabel: string = localize('alertDialog.RaiseAlertContains', 'Raise alert when message contains');
private static readonly MessageTextLabel: string = localize('alertDialog.MessageText', 'Message text');
private static readonly AlertSeverity001Label: string = localize('alertDialog.Severity001', '001 - Miscellaneous System Information');
private static readonly AlertSeverity002Label: string = localize('alertDialog.Severity002', '002 - Reserved');
private static readonly AlertSeverity003Label: string = localize('alertDialog.Severity003', '003 - Reserved');
private static readonly AlertSeverity004Label: string = localize('alertDialog.Severity004', '004 - Reserved');
private static readonly AlertSeverity005Label: string = localize('alertDialog.Severity005', '005 - Reserved');
private static readonly AlertSeverity006Label: string = localize('alertDialog.Severity006', '006 - Reserved');
private static readonly AlertSeverity007Label: string = localize('alertDialog.Severity007', '007 - Notification: Status Information');
private static readonly AlertSeverity008Label: string = localize('alertDialog.Severity008', '008 - Notification: User Intervention Required');
private static readonly AlertSeverity009Label: string = localize('alertDialog.Severity009', '009 - User Defined');
private static readonly AlertSeverity010Label: string = localize('alertDialog.Severity010', '010 - Information');
private static readonly AlertSeverity011Label: string = localize('alertDialog.Severity011', '011 - Specified Database Object Not Found');
private static readonly AlertSeverity012Label: string = localize('alertDialog.Severity012', '012 - Unused');
private static readonly AlertSeverity013Label: string = localize('alertDialog.Severity013', '013 - User Transaction Syntax Error');
private static readonly AlertSeverity014Label: string = localize('alertDialog.Severity014', '014 - Insufficient Permission');
private static readonly AlertSeverity015Label: string = localize('alertDialog.Severity015', '015 - Syntax Error in SQL Statements');
private static readonly AlertSeverity016Label: string = localize('alertDialog.Severity016', '016 - Miscellaneous User Error');
private static readonly AlertSeverity017Label: string = localize('alertDialog.Severity017', '017 - Insufficient Resources');
private static readonly AlertSeverity018Label: string = localize('alertDialog.Severity018', '018 - Nonfatal Internal Error');
private static readonly AlertSeverity019Label: string = localize('alertDialog.Severity019', '019 - Fatal Error in Resource');
private static readonly AlertSeverity020Label: string = localize('alertDialog.Severity020', '020 - Fatal Error in Current Process');
private static readonly AlertSeverity021Label: string = localize('alertDialog.Severity021', '021 - Fatal Error in Database Processes');
private static readonly AlertSeverity022Label: string = localize('alertDialog.Severity022', '022 - Fatal Error: Table Integrity Suspect');
private static readonly AlertSeverity023Label: string = localize('alertDialog.Severity023', '023 - Fatal Error: Database Integrity Suspect');
private static readonly AlertSeverity024Label: string = localize('alertDialog.Severity024', '024 - Fatal Error: Hardware Error');
private static readonly AlertSeverity025Label: string = localize('alertDialog.Severity025', '025 - Fatal Error');
private static readonly AllDatabases: string = localize('alertDialog.AllDatabases', '<all databases>');
private static readonly AlertTypes: string[] = [
AlertData.AlertTypeSqlServerEventString,
@@ -98,23 +98,23 @@ export class AlertDialog extends AgentDialog<AlertData> {
];
// Response tab strings
private static readonly ExecuteJobCheckBoxLabel: string = localize('alertDialog.ExecuteJob', "Execute Job");
private static readonly ExecuteJobTextBoxLabel: string = localize('alertDialog.ExecuteJobName', "Job Name");
private static readonly NotifyOperatorsTextBoxLabel: string = localize('alertDialog.NotifyOperators', "Notify Operators");
private static readonly NewJobButtonLabel: string = localize('alertDialog.NewJob', "New Job");
private static readonly OperatorListLabel: string = localize('alertDialog.OperatorList', "Operator List");
private static readonly OperatorNameColumnLabel: string = localize('alertDialog.OperatorName', "Operator");
private static readonly OperatorEmailColumnLabel: string = localize('alertDialog.OperatorEmail', "E-mail");
private static readonly OperatorPagerColumnLabel: string = localize('alertDialog.OperatorPager', "Pager");
private static readonly NewOperatorButtonLabel: string = localize('alertDialog.NewOperator', "New Operator");
private static readonly ExecuteJobCheckBoxLabel: string = localize('alertDialog.ExecuteJob', 'Execute Job');
private static readonly ExecuteJobTextBoxLabel: string = localize('alertDialog.ExecuteJobName', 'Job Name');
private static readonly NotifyOperatorsTextBoxLabel: string = localize('alertDialog.NotifyOperators', 'Notify Operators');
private static readonly NewJobButtonLabel: string = localize('alertDialog.NewJob', 'New Job');
private static readonly OperatorListLabel: string = localize('alertDialog.OperatorList', 'Operator List');
private static readonly OperatorNameColumnLabel: string = localize('alertDialog.OperatorName', 'Operator');
private static readonly OperatorEmailColumnLabel: string = localize('alertDialog.OperatorEmail', 'E-mail');
private static readonly OperatorPagerColumnLabel: string = localize('alertDialog.OperatorPager', 'Pager');
private static readonly NewOperatorButtonLabel: string = localize('alertDialog.NewOperator', 'New Operator');
// Options tab strings
private static readonly IncludeErrorInEmailCheckBoxLabel: string = localize('alertDialog.IncludeErrorInEmail', "Include alert error text in e-mail");
private static readonly IncludeErrorInPagerCheckBoxLabel: string = localize('alertDialog.IncludeErrorInPager', "Include alert error text in pager");
private static readonly AdditionalMessageTextBoxLabel: string = localize('alertDialog.AdditionalNotification', "Additional notification message to send");
private static readonly DelayBetweenResponsesTextBoxLabel: string = localize('alertDialog.DelayBetweenResponse', "Delay between responses");
private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', "Delay Minutes");
private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', "Delay Seconds");
private static readonly IncludeErrorInEmailCheckBoxLabel: string = localize('alertDialog.IncludeErrorInEmail', 'Include alert error text in e-mail');
private static readonly IncludeErrorInPagerCheckBoxLabel: string = localize('alertDialog.IncludeErrorInPager', 'Include alert error text in pager');
private static readonly AdditionalMessageTextBoxLabel: string = localize('alertDialog.AdditionalNotification', 'Additional notification message to send');
private static readonly DelayBetweenResponsesTextBoxLabel: string = localize('alertDialog.DelayBetweenResponse', 'Delay between responses');
private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', 'Delay Minutes');
private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', 'Delay Seconds');
// Event Name strings
private readonly NewAlertDialog = 'NewAlertDialogOpen';

View File

@@ -19,54 +19,54 @@ export class JobDialog extends AgentDialog<JobData> {
// TODO: localize
// Top level
private static readonly CreateDialogTitle: string = localize('jobDialog.newJob', "New Job");
private static readonly EditDialogTitle: string = localize('jobDialog.editJob', "Edit Job");
private readonly GeneralTabText: string = localize('jobDialog.general', "General");
private readonly StepsTabText: string = localize('jobDialog.steps', "Steps");
private readonly SchedulesTabText: string = localize('jobDialog.schedules', "Schedules");
private readonly AlertsTabText: string = localize('jobDialog.alerts', "Alerts");
private readonly NotificationsTabText: string = localize('jobDialog.notifications', "Notifications");
private readonly BlankJobNameErrorText: string = localize('jobDialog.blankJobNameError', "The name of the job cannot be blank.");
private static readonly CreateDialogTitle: string = localize('jobDialog.newJob', 'New Job');
private static readonly EditDialogTitle: string = localize('jobDialog.editJob', 'Edit Job');
private readonly GeneralTabText: string = localize('jobDialog.general', 'General');
private readonly StepsTabText: string = localize('jobDialog.steps', 'Steps');
private readonly SchedulesTabText: string = localize('jobDialog.schedules', 'Schedules');
private readonly AlertsTabText: string = localize('jobDialog.alerts', 'Alerts');
private readonly NotificationsTabText: string = localize('jobDialog.notifications', 'Notifications');
private readonly BlankJobNameErrorText: string = localize('jobDialog.blankJobNameError', 'The name of the job cannot be blank.');
// General tab strings
private readonly NameTextBoxLabel: string = localize('jobDialog.name', "Name");
private readonly OwnerTextBoxLabel: string = localize('jobDialog.owner', "Owner");
private readonly CategoryDropdownLabel: string = localize('jobDialog.category', "Category");
private readonly DescriptionTextBoxLabel: string = localize('jobDialog.description', "Description");
private readonly EnabledCheckboxLabel: string = localize('jobDialog.enabled', "Enabled");
private readonly NameTextBoxLabel: string = localize('jobDialog.name', 'Name');
private readonly OwnerTextBoxLabel: string = localize('jobDialog.owner', 'Owner');
private readonly CategoryDropdownLabel: string = localize('jobDialog.category', 'Category');
private readonly DescriptionTextBoxLabel: string = localize('jobDialog.description', 'Description');
private readonly EnabledCheckboxLabel: string = localize('jobDialog.enabled', 'Enabled');
// Steps tab strings
private readonly JobStepsTopLabelString: string = localize('jobDialog.jobStepList', "Job step list");
private readonly StepsTable_StepColumnString: string = localize('jobDialog.step', "Step");
private readonly StepsTable_NameColumnString: string = localize('jobDialog.name', "Name");
private readonly StepsTable_TypeColumnString: string = localize('jobDialog.type', "Type");
private readonly StepsTable_SuccessColumnString: string = localize('jobDialog.onSuccess', "On Success");
private readonly StepsTable_FailureColumnString: string = localize('jobDialog.onFailure', "On Failure");
private readonly NewStepButtonString: string = localize('jobDialog.new', "New Step");
private readonly EditStepButtonString: string = localize('jobDialog.edit', "Edit Step");
private readonly DeleteStepButtonString: string = localize('jobDialog.delete', "Delete Step");
private readonly MoveStepUpButtonString: string = localize('jobDialog.moveUp', "Move Step Up");
private readonly MoveStepDownButtonString: string = localize('jobDialog.moveDown', "Move Step Down");
private readonly StartStepDropdownString: string = localize('jobDialog.startStepAt', "Start step");
private readonly JobStepsTopLabelString: string = localize('jobDialog.jobStepList', 'Job step list');
private readonly StepsTable_StepColumnString: string = localize('jobDialog.step', 'Step');
private readonly StepsTable_NameColumnString: string = localize('jobDialog.name', 'Name');
private readonly StepsTable_TypeColumnString: string = localize('jobDialog.type', 'Type');
private readonly StepsTable_SuccessColumnString: string = localize('jobDialog.onSuccess', 'On Success');
private readonly StepsTable_FailureColumnString: string = localize('jobDialog.onFailure', 'On Failure');
private readonly NewStepButtonString: string = localize('jobDialog.new', 'New Step');
private readonly EditStepButtonString: string = localize('jobDialog.edit', 'Edit Step');
private readonly DeleteStepButtonString: string = localize('jobDialog.delete', 'Delete Step');
private readonly MoveStepUpButtonString: string = localize('jobDialog.moveUp', 'Move Step Up');
private readonly MoveStepDownButtonString: string = localize('jobDialog.moveDown', 'Move Step Down');
private readonly StartStepDropdownString: string = localize('jobDialog.startStepAt', 'Start step');
// Notifications tab strings
private readonly NotificationsTabTopLabelString: string = localize('jobDialog.notificationsTabTop', "Actions to perform when the job completes");
private readonly EmailCheckBoxString: string = localize('jobDialog.email', "Email");
private readonly PagerCheckBoxString: string = localize('jobDialog.page', "Page");
private readonly EventLogCheckBoxString: string = localize('jobDialog.eventLogCheckBoxLabel', "Write to the Windows Application event log");
private readonly DeleteJobCheckBoxString: string = localize('jobDialog.deleteJobLabel', "Automatically delete job");
private readonly NotificationsTabTopLabelString: string = localize('jobDialog.notificationsTabTop', 'Actions to perform when the job completes');
private readonly EmailCheckBoxString: string = localize('jobDialog.email', 'Email');
private readonly PagerCheckBoxString: string = localize('jobDialog.page', 'Page');
private readonly EventLogCheckBoxString: string = localize('jobDialog.eventLogCheckBoxLabel', 'Write to the Windows Application event log');
private readonly DeleteJobCheckBoxString: string = localize('jobDialog.deleteJobLabel', 'Automatically delete job');
// Schedules tab strings
private readonly SchedulesTopLabelString: string = localize('jobDialog.schedulesaLabel', "Schedules list");
private readonly PickScheduleButtonString: string = localize('jobDialog.pickSchedule', "Pick Schedule");
private readonly ScheduleNameLabelString: string = localize('jobDialog.scheduleNameLabel', "Schedule Name");
private readonly SchedulesTopLabelString: string = localize('jobDialog.schedulesaLabel', 'Schedules list');
private readonly PickScheduleButtonString: string = localize('jobDialog.pickSchedule', 'Pick Schedule');
private readonly ScheduleNameLabelString: string = localize('jobDialog.scheduleNameLabel', 'Schedule Name');
// Alerts tab strings
private readonly AlertsTopLabelString: string = localize('jobDialog.alertsList', "Alerts list");
private readonly NewAlertButtonString: string = localize('jobDialog.newAlert', "New Alert");
private readonly AlertNameLabelString: string = localize('jobDialog.alertNameLabel', "Alert Name");
private readonly AlertEnabledLabelString: string = localize('jobDialog.alertEnabledLabel', "Enabled");
private readonly AlertTypeLabelString: string = localize('jobDialog.alertTypeLabel', "Type");
private readonly AlertsTopLabelString: string = localize('jobDialog.alertsList', 'Alerts list');
private readonly NewAlertButtonString: string = localize('jobDialog.newAlert', 'New Alert');
private readonly AlertNameLabelString: string = localize('jobDialog.alertNameLabel', 'Alert Name');
private readonly AlertEnabledLabelString: string = localize('jobDialog.alertEnabledLabel', 'Enabled');
private readonly AlertTypeLabelString: string = localize('jobDialog.alertTypeLabel', 'Type');
// Event Name strings
private readonly NewJobDialogEvent: string = 'NewJobDialogOpened';

View File

@@ -20,63 +20,63 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
// TODO: localize
// Top level
//
private static readonly NewDialogTitle: string = localize('jobStepDialog.newJobStep', "New Job Step");
private static readonly EditDialogTitle: string = localize('jobStepDialog.editJobStep', "Edit Job Step");
private readonly FileBrowserDialogTitle: string = localize('jobStepDialog.fileBrowserTitle', "Locate Database Files - ");
private readonly OkButtonText: string = localize('jobStepDialog.ok', "OK");
private readonly CancelButtonText: string = localize('jobStepDialog.cancel', "Cancel");
private readonly GeneralTabText: string = localize('jobStepDialog.general', "General");
private readonly AdvancedTabText: string = localize('jobStepDialog.advanced', "Advanced");
private readonly OpenCommandText: string = localize('jobStepDialog.open', "Open...");
private readonly ParseCommandText: string = localize('jobStepDialog.parse', "Parse");
private readonly SuccessfulParseText: string = localize('jobStepDialog.successParse', "The command was successfully parsed.");
private readonly FailureParseText: string = localize('jobStepDialog.failParse', "The command failed.");
private readonly BlankStepNameErrorText: string = localize('jobStepDialog.blankStepName', "The step name cannot be left blank");
private readonly ProcessExitCodeText: string = localize('jobStepDialog.processExitCode', "Process exit code of a successful command:");
private static readonly NewDialogTitle: string = localize('jobStepDialog.newJobStep', 'New Job Step');
private static readonly EditDialogTitle: string = localize('jobStepDialog.editJobStep', 'Edit Job Step');
private readonly FileBrowserDialogTitle: string = localize('jobStepDialog.fileBrowserTitle', 'Locate Database Files - ');
private readonly OkButtonText: string = localize('jobStepDialog.ok', 'OK');
private readonly CancelButtonText: string = localize('jobStepDialog.cancel', 'Cancel');
private readonly GeneralTabText: string = localize('jobStepDialog.general', 'General');
private readonly AdvancedTabText: string = localize('jobStepDialog.advanced', 'Advanced');
private readonly OpenCommandText: string = localize('jobStepDialog.open', 'Open...');
private readonly ParseCommandText: string = localize('jobStepDialog.parse', 'Parse');
private readonly SuccessfulParseText: string = localize('jobStepDialog.successParse', 'The command was successfully parsed.');
private readonly FailureParseText: string = localize('jobStepDialog.failParse', 'The command failed.');
private readonly BlankStepNameErrorText: string = localize('jobStepDialog.blankStepName', 'The step name cannot be left blank');
private readonly ProcessExitCodeText: string = localize('jobStepDialog.processExitCode', 'Process exit code of a successful command:');
// General Control Titles
private readonly StepNameLabelString: string = localize('jobStepDialog.stepNameLabel', "Step Name");
private readonly TypeLabelString: string = localize('jobStepDialog.typeLabel', "Type");
private readonly RunAsLabelString: string = localize('jobStepDialog.runAsLabel', "Run as");
private readonly DatabaseLabelString: string = localize('jobStepDialog.databaseLabel', "Database");
private readonly CommandLabelString: string = localize('jobStepDialog.commandLabel', "Command");
private readonly StepNameLabelString: string = localize('jobStepDialog.stepNameLabel', 'Step Name');
private readonly TypeLabelString: string = localize('jobStepDialog.typeLabel', 'Type');
private readonly RunAsLabelString: string = localize('jobStepDialog.runAsLabel', 'Run as');
private readonly DatabaseLabelString: string = localize('jobStepDialog.databaseLabel', 'Database');
private readonly CommandLabelString: string = localize('jobStepDialog.commandLabel', 'Command');
// Advanced Control Titles
private readonly SuccessActionLabel: string = localize('jobStepDialog.successAction', "On success action");
private readonly FailureActionLabel: string = localize('jobStepDialog.failureAction', "On failure action");
private readonly RunAsUserLabel: string = localize('jobStepDialog.runAsUser', "Run as user");
private readonly RetryAttemptsLabel: string = localize('jobStepDialog.retryAttempts', "Retry Attempts");
private readonly RetryIntervalLabel: string = localize('jobStepDialog.retryInterval', "Retry Interval (minutes)");
private readonly LogToTableLabel: string = localize('jobStepDialog.logToTable', "Log to table");
private readonly AppendExistingTableEntryLabel: string = localize('jobStepDialog.appendExistingTableEntry', "Append output to exisiting entry in table");
private readonly IncludeStepOutputHistoryLabel: string = localize('jobStepDialog.includeStepOutputHistory', "Include step output in history");
private readonly OutputFileNameLabel: string = localize('jobStepDialog.outputFile', "Output File");
private readonly AppendOutputToFileLabel: string = localize('jobStepDialog.appendOutputToFile', "Append output to existing file");
private readonly SuccessActionLabel: string = localize('jobStepDialog.successAction', 'On success action');
private readonly FailureActionLabel: string = localize('jobStepDialog.failureAction', 'On failure action');
private readonly RunAsUserLabel: string = localize('jobStepDialog.runAsUser', 'Run as user');
private readonly RetryAttemptsLabel: string = localize('jobStepDialog.retryAttempts', 'Retry Attempts');
private readonly RetryIntervalLabel: string = localize('jobStepDialog.retryInterval', 'Retry Interval (minutes)');
private readonly LogToTableLabel: string = localize('jobStepDialog.logToTable', 'Log to table');
private readonly AppendExistingTableEntryLabel: string = localize('jobStepDialog.appendExistingTableEntry', 'Append output to exisiting entry in table');
private readonly IncludeStepOutputHistoryLabel: string = localize('jobStepDialog.includeStepOutputHistory', 'Include step output in history');
private readonly OutputFileNameLabel: string = localize('jobStepDialog.outputFile', 'Output File');
private readonly AppendOutputToFileLabel: string = localize('jobStepDialog.appendOutputToFile', 'Append output to existing file');
// File Browser Control Titles
private readonly SelectedPathLabelString: string = localize('jobStepDialog.selectedPath', "Selected path");
private readonly FilesOfTypeLabelString: string = localize('jobStepDialog.filesOfType', "Files of type");
private readonly FileNameLabelString: string = localize('jobStepDialog.fileName', "File name");
private readonly AllFilesLabelString: string = localize('jobStepDialog.allFiles', "All Files (*)");
private readonly SelectedPathLabelString: string = localize('jobStepDialog.selectedPath', 'Selected path');
private readonly FilesOfTypeLabelString: string = localize('jobStepDialog.filesOfType', 'Files of type');
private readonly FileNameLabelString: string = localize('jobStepDialog.fileName', 'File name');
private readonly AllFilesLabelString: string = localize('jobStepDialog.allFiles', 'All Files (*)');
// Dropdown options
public static readonly TSQLScript: string = localize('jobStepDialog.TSQL', "Transact-SQL script (T-SQL)");
public static readonly Powershell: string = localize('jobStepDialog.powershell', "PowerShell");
public static readonly CmdExec: string = localize('jobStepDialog.CmdExec', "Operating system (CmdExec)");
public static readonly ReplicationDistributor: string = localize('jobStepDialog.replicationDistribution', "Replication Distributor");
public static readonly ReplicationMerge: string = localize('jobStepDialog.replicationMerge', "Replication Merge");
public static readonly ReplicationQueueReader: string = localize('jobStepDialog.replicationQueueReader', "Replication Queue Reader");
public static readonly ReplicationSnapshot: string = localize('jobStepDialog.replicationSnapshot', "Replication Snapshot");
public static readonly ReplicationTransactionLogReader: string = localize('jobStepDialog.replicationTransactionLogReader', "Replication Transaction-Log Reader");
public static readonly AnalysisServicesCommand: string = localize('jobStepDialog.analysisCommand', "SQL Server Analysis Services Command");
public static readonly AnalysisServicesQuery: string = localize('jobStepDialog.analysisQuery', "SQL Server Analysis Services Query");
public static readonly ServicesPackage: string = localize('jobStepDialog.servicesPackage', "SQL Server Integration Service Package");
public static readonly TSQLScript: string = localize('jobStepDialog.TSQL', 'Transact-SQL script (T-SQL)');
public static readonly Powershell: string = localize('jobStepDialog.powershell', 'PowerShell');
public static readonly CmdExec: string = localize('jobStepDialog.CmdExec', 'Operating system (CmdExec)');
public static readonly ReplicationDistributor: string = localize('jobStepDialog.replicationDistribution', 'Replication Distributor');
public static readonly ReplicationMerge: string = localize('jobStepDialog.replicationMerge', 'Replication Merge');
public static readonly ReplicationQueueReader: string = localize('jobStepDialog.replicationQueueReader', 'Replication Queue Reader');
public static readonly ReplicationSnapshot: string = localize('jobStepDialog.replicationSnapshot', 'Replication Snapshot');
public static readonly ReplicationTransactionLogReader: string = localize('jobStepDialog.replicationTransactionLogReader', 'Replication Transaction-Log Reader');
public static readonly AnalysisServicesCommand: string = localize('jobStepDialog.analysisCommand', 'SQL Server Analysis Services Command');
public static readonly AnalysisServicesQuery: string = localize('jobStepDialog.analysisQuery', 'SQL Server Analysis Services Query');
public static readonly ServicesPackage: string = localize('jobStepDialog.servicesPackage', 'SQL Server Integration Service Package');
public static readonly AgentServiceAccount: string = localize('jobStepDialog.agentServiceAccount', "SQL Server Agent Service Account");
public static readonly NextStep: string = localize('jobStepDialog.nextStep', "Go to the next step");
public static readonly QuitJobReportingSuccess: string = localize('jobStepDialog.quitJobSuccess', "Quit the job reporting success");
public static readonly QuitJobReportingFailure: string = localize('jobStepDialog.quitJobFailure', "Quit the job reporting failure");
public static readonly AgentServiceAccount: string = localize('jobStepDialog.agentServiceAccount', 'SQL Server Agent Service Account');
public static readonly NextStep: string = localize('jobStepDialog.nextStep', 'Go to the next step');
public static readonly QuitJobReportingSuccess: string = localize('jobStepDialog.quitJobSuccess', 'Quit the job reporting success');
public static readonly QuitJobReportingFailure: string = localize('jobStepDialog.quitJobFailure', 'Quit the job reporting failure');
// Event Name strings
private readonly NewStepDialog = 'NewStepDialogOpened';

View File

@@ -228,20 +228,20 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
component: notebookPathFlexBox,
title: TemplateNotebookTextBoxLabel,
layout: {
info: localize('notebookDialog.templatePath', "Select a notebook to schedule from PC")
info: localize('notebookDialog.templatePath', 'Select a notebook to schedule from PC')
}
},
{
component: this.targetDatabaseDropDown,
title: TargetDatabaseDropdownLabel,
layout: {
info: localize('notebookDialog.targetDatabaseInfo', "Select a database to store all notebook job metadata and results")
info: localize('notebookDialog.targetDatabaseInfo', 'Select a database to store all notebook job metadata and results')
}
}, {
component: this.executeDatabaseDropDown,
title: ExecuteDatabaseDropdownLabel,
layout: {
info: localize('notebookDialog.executionDatabaseInfo', "Select a database against which notebook queries will run")
info: localize('notebookDialog.executionDatabaseInfo', 'Select a database against which notebook queries will run')
}
}],
title: NotebookDetailsSeparatorTitle

View File

@@ -16,32 +16,32 @@ const localize = nls.loadMessageBundle();
export class OperatorDialog extends AgentDialog<OperatorData> {
// Top level
private static readonly CreateDialogTitle: string = localize('createOperator.createOperator', "Create Operator");
private static readonly EditDialogTitle: string = localize('createOperator.editOperator', "Edit Operator");
private static readonly GeneralTabText: string = localize('createOperator.General', "General");
private static readonly NotificationsTabText: string = localize('createOperator.Notifications', "Notifications");
private static readonly CreateDialogTitle: string = localize('createOperator.createOperator', 'Create Operator');
private static readonly EditDialogTitle: string = localize('createOperator.editOperator', 'Edit Operator');
private static readonly GeneralTabText: string = localize('createOperator.General', 'General');
private static readonly NotificationsTabText: string = localize('createOperator.Notifications', 'Notifications');
// General tab strings
private static readonly NameLabel: string = localize('createOperator.Name', "Name");
private static readonly EnabledCheckboxLabel: string = localize('createOperator.Enabled', "Enabled");
private static readonly EmailNameTextLabel: string = localize('createOperator.EmailName', "E-mail Name");
private static readonly PagerEmailNameTextLabel: string = localize('createOperator.PagerEmailName', "Pager E-mail Name");
private static readonly PagerMondayCheckBoxLabel: string = localize('createOperator.PagerMondayCheckBox', "Monday");
private static readonly PagerTuesdayCheckBoxLabel: string = localize('createOperator.PagerTuesdayCheckBox', "Tuesday");
private static readonly PagerWednesdayCheckBoxLabel: string = localize('createOperator.PagerWednesdayCheckBox', "Wednesday");
private static readonly PagerThursdayCheckBoxLabel: string = localize('createOperator.PagerThursdayCheckBox', "Thursday");
private static readonly PagerFridayCheckBoxLabel: string = localize('createOperator.PagerFridayCheckBox', "Friday ");
private static readonly PagerSaturdayCheckBoxLabel: string = localize('createOperator.PagerSaturdayCheckBox', "Saturday");
private static readonly PagerSundayCheckBoxLabel: string = localize('createOperator.PagerSundayCheckBox', "Sunday");
private static readonly WorkdayBeginLabel: string = localize('createOperator.workdayBegin', "Workday begin");
private static readonly WorkdayEndLabel: string = localize('createOperator.workdayEnd', "Workday end");
private static readonly PagerDutyScheduleLabel: string = localize('createOperator.PagerDutySchedule', "Pager on duty schedule");
private static readonly NameLabel: string = localize('createOperator.Name', 'Name');
private static readonly EnabledCheckboxLabel: string = localize('createOperator.Enabled', 'Enabled');
private static readonly EmailNameTextLabel: string = localize('createOperator.EmailName', 'E-mail Name');
private static readonly PagerEmailNameTextLabel: string = localize('createOperator.PagerEmailName', 'Pager E-mail Name');
private static readonly PagerMondayCheckBoxLabel: string = localize('createOperator.PagerMondayCheckBox', 'Monday');
private static readonly PagerTuesdayCheckBoxLabel: string = localize('createOperator.PagerTuesdayCheckBox', 'Tuesday');
private static readonly PagerWednesdayCheckBoxLabel: string = localize('createOperator.PagerWednesdayCheckBox', 'Wednesday');
private static readonly PagerThursdayCheckBoxLabel: string = localize('createOperator.PagerThursdayCheckBox', 'Thursday');
private static readonly PagerFridayCheckBoxLabel: string = localize('createOperator.PagerFridayCheckBox', 'Friday ');
private static readonly PagerSaturdayCheckBoxLabel: string = localize('createOperator.PagerSaturdayCheckBox', 'Saturday');
private static readonly PagerSundayCheckBoxLabel: string = localize('createOperator.PagerSundayCheckBox', 'Sunday');
private static readonly WorkdayBeginLabel: string = localize('createOperator.workdayBegin', 'Workday begin');
private static readonly WorkdayEndLabel: string = localize('createOperator.workdayEnd', 'Workday end');
private static readonly PagerDutyScheduleLabel: string = localize('createOperator.PagerDutySchedule', 'Pager on duty schedule');
// Notifications tab strings
private static readonly AlertsTableLabel: string = localize('createOperator.AlertListHeading', "Alert list");
private static readonly AlertNameColumnLabel: string = localize('createOperator.AlertNameColumnLabel', "Alert name");
private static readonly AlertEmailColumnLabel: string = localize('createOperator.AlertEmailColumnLabel', "E-mail");
private static readonly AlertPagerColumnLabel: string = localize('createOperator.AlertPagerColumnLabel', "Pager");
private static readonly AlertsTableLabel: string = localize('createOperator.AlertListHeading', 'Alert list');
private static readonly AlertNameColumnLabel: string = localize('createOperator.AlertNameColumnLabel', 'Alert name');
private static readonly AlertEmailColumnLabel: string = localize('createOperator.AlertEmailColumnLabel', 'E-mail');
private static readonly AlertPagerColumnLabel: string = localize('createOperator.AlertPagerColumnLabel', 'Pager');
// Event strings
private readonly NewOperatorDialog = 'NewOperatorDialogOpened';

View File

@@ -15,13 +15,13 @@ export class PickScheduleDialog {
// TODO: localize
// Top level
private readonly DialogTitle: string = localize('pickSchedule.jobSchedules', "Job Schedules");
private readonly OkButtonText: string = localize('pickSchedule.ok', "OK");
private readonly CancelButtonText: string = localize('pickSchedule.cancel', "Cancel");
private readonly SchedulesLabelText: string = localize('pickSchedule.availableSchedules', "Available Schedules:");
public static readonly ScheduleNameLabelText: string = localize('pickSchedule.scheduleName', "Name");
public static readonly SchedulesIDText: string = localize('pickSchedule.scheduleID', "ID");
public static readonly ScheduleDescription: string = localize('pickSchedule.description', "Description");
private readonly DialogTitle: string = localize('pickSchedule.jobSchedules', 'Job Schedules');
private readonly OkButtonText: string = localize('pickSchedule.ok', 'OK');
private readonly CancelButtonText: string = localize('pickSchedule.cancel', 'Cancel');
private readonly SchedulesLabelText: string = localize('pickSchedule.availableSchedules', 'Available Schedules:');
public static readonly ScheduleNameLabelText: string = localize('pickSchedule.scheduleName', 'Name');
public static readonly SchedulesIDText: string = localize('pickSchedule.scheduleID', 'ID');
public static readonly ScheduleDescription: string = localize('pickSchedule.description', 'Description');
// UI Components

View File

@@ -15,26 +15,26 @@ const localize = nls.loadMessageBundle();
export class ProxyDialog extends AgentDialog<ProxyData> {
// Top level
private static readonly CreateDialogTitle: string = localize('createProxy.createProxy', "Create Proxy");
private static readonly EditDialogTitle: string = localize('createProxy.editProxy', "Edit Proxy");
private static readonly GeneralTabText: string = localize('createProxy.General', "General");
private static readonly CreateDialogTitle: string = localize('createProxy.createProxy', 'Create Proxy');
private static readonly EditDialogTitle: string = localize('createProxy.editProxy', 'Edit Proxy');
private static readonly GeneralTabText: string = localize('createProxy.General', 'General');
// General tab strings
private static readonly ProxyNameTextBoxLabel: string = localize('createProxy.ProxyName', "Proxy name");
private static readonly CredentialNameTextBoxLabel: string = localize('createProxy.CredentialName', "Credential name");
private static readonly DescriptionTextBoxLabel: string = localize('createProxy.Description', "Description");
private static readonly SubsystemLabel: string = localize('createProxy.SubsystemName', "Subsystem");
private static readonly OperatingSystemLabel: string = localize('createProxy.OperatingSystem', "Operating system (CmdExec)");
private static readonly ReplicationSnapshotLabel: string = localize('createProxy.ReplicationSnapshot', "Replication Snapshot");
private static readonly ReplicationTransactionLogLabel: string = localize('createProxy.ReplicationTransactionLog', "Replication Transaction-Log Reader");
private static readonly ReplicationDistributorLabel: string = localize('createProxy.ReplicationDistributor', "Replication Distributor");
private static readonly ReplicationMergeLabel: string = localize('createProxy.ReplicationMerge', "Replication Merge");
private static readonly ReplicationQueueReaderLabel: string = localize('createProxy.ReplicationQueueReader', "Replication Queue Reader");
private static readonly SSASQueryLabel: string = localize('createProxy.SSASQueryLabel', "SQL Server Analysis Services Query");
private static readonly SSASCommandLabel: string = localize('createProxy.SSASCommandLabel', "SQL Server Analysis Services Command");
private static readonly SSISPackageLabel: string = localize('createProxy.SSISPackage', "SQL Server Integration Services Package");
private static readonly PowerShellLabel: string = localize('createProxy.PowerShell', "PowerShell");
private static readonly SubSystemHeadingLabel: string = localize('createProxy.subSystemHeading', "Active to the following subsytems");
private static readonly ProxyNameTextBoxLabel: string = localize('createProxy.ProxyName', 'Proxy name');
private static readonly CredentialNameTextBoxLabel: string = localize('createProxy.CredentialName', 'Credential name');
private static readonly DescriptionTextBoxLabel: string = localize('createProxy.Description', 'Description');
private static readonly SubsystemLabel: string = localize('createProxy.SubsystemName', 'Subsystem');
private static readonly OperatingSystemLabel: string = localize('createProxy.OperatingSystem', 'Operating system (CmdExec)');
private static readonly ReplicationSnapshotLabel: string = localize('createProxy.ReplicationSnapshot', 'Replication Snapshot');
private static readonly ReplicationTransactionLogLabel: string = localize('createProxy.ReplicationTransactionLog', 'Replication Transaction-Log Reader');
private static readonly ReplicationDistributorLabel: string = localize('createProxy.ReplicationDistributor', 'Replication Distributor');
private static readonly ReplicationMergeLabel: string = localize('createProxy.ReplicationMerge', 'Replication Merge');
private static readonly ReplicationQueueReaderLabel: string = localize('createProxy.ReplicationQueueReader', 'Replication Queue Reader');
private static readonly SSASQueryLabel: string = localize('createProxy.SSASQueryLabel', 'SQL Server Analysis Services Query');
private static readonly SSASCommandLabel: string = localize('createProxy.SSASCommandLabel', 'SQL Server Analysis Services Command');
private static readonly SSISPackageLabel: string = localize('createProxy.SSISPackage', 'SQL Server Integration Services Package');
private static readonly PowerShellLabel: string = localize('createProxy.PowerShell', 'PowerShell');
private static readonly SubSystemHeadingLabel: string = localize('createProxy.subSystemHeading', 'Active to the following subsytems');
private readonly NewProxyDialog = 'NewProxyDialogOpened';
private readonly EditProxyDialog = 'EditProxyDialogOpened';

View File

@@ -14,11 +14,11 @@ const localize = nls.loadMessageBundle();
export class ScheduleDialog {
// Top level
private readonly DialogTitle: string = localize('scheduleDialog.newSchedule', "New Schedule");
private readonly OkButtonText: string = localize('scheduleDialog.ok', "OK");
private readonly CancelButtonText: string = localize('scheduleDialog.cancel', "Cancel");
private readonly ScheduleNameText: string = localize('scheduleDialog.scheduleName', "Schedule Name");
private readonly SchedulesLabelText: string = localize('scheduleDialog.schedules', "Schedules");
private readonly DialogTitle: string = localize('scheduleDialog.newSchedule', 'New Schedule');
private readonly OkButtonText: string = localize('scheduleDialog.ok', 'OK');
private readonly CancelButtonText: string = localize('scheduleDialog.cancel', 'Cancel');
private readonly ScheduleNameText: string = localize('scheduleDialog.scheduleName', 'Schedule Name');
private readonly SchedulesLabelText: string = localize('scheduleDialog.schedules', 'Schedules');
// UI Components
private dialog: azdata.window.Dialog;

View File

@@ -105,10 +105,10 @@ export class MainController {
AgentUtils.getAgentService().then(async (agentService) => {
let result = await agentService.updateNotebook(templateMap.ownerUri, templateMap.notebookInfo.name, templateMap.notebookInfo, templateMap.tempPath);
if (result.success) {
vscode.window.showInformationMessage(localize('agent.templateUploadSuccessful', "Template updated successfully"));
vscode.window.showInformationMessage(localize('agent.templateUploadSuccessful', 'Template updated successfully'));
}
else {
vscode.window.showInformationMessage(localize('agent.templateUploadError', "Template update failure"));
vscode.window.showInformationMessage(localize('agent.templateUploadError', 'Template update failure'));
}
});
@@ -170,7 +170,7 @@ export class MainController {
let path: string;
if (!ownerUri) {
if (azdata.nb.activeNotebookEditor.document.isDirty || azdata.nb.activeNotebookEditor.document.isUntitled) {
vscode.window.showErrorMessage(localize('agent.unsavedFileSchedulingError', "The notebook must be saved before being scheduled. Please save and then retry scheduling again."), { modal: true });
vscode.window.showErrorMessage(localize('agent.unsavedFileSchedulingError', 'The notebook must be saved before being scheduled. Please save and then retry scheduling again.'), { modal: true });
return;
}
path = azdata.nb.activeNotebookEditor.document.fileName;
@@ -218,10 +218,10 @@ export class MainController {
connectionNames.push(connections[i]);
connectionDisplayString.push(currentConnectionString);
}
connectionDisplayString.push(localize('agent.AddNewConnection', "Add new connection"));
let connectionName = await vscode.window.showQuickPick(connectionDisplayString, { placeHolder: localize('agent.selectConnection', "Select a connection") });
connectionDisplayString.push(localize('agent.AddNewConnection', 'Add new connection'));
let connectionName = await vscode.window.showQuickPick(connectionDisplayString, { placeHolder: localize('agent.selectConnection', 'Select a connection') });
if (connectionDisplayString.indexOf(connectionName) !== -1) {
if (connectionName === localize('agent.AddNewConnection', "Add new connection")) {
if (connectionName === localize('agent.AddNewConnection', 'Add new connection')) {
connection = await azdata.connection.openConnectionDialog();
}
else {
@@ -229,7 +229,7 @@ export class MainController {
}
}
else {
vscode.window.showErrorMessage(localize('agent.selectValidConnection', "Please select a valid connection"), { modal: true });
vscode.window.showErrorMessage(localize('agent.selectValidConnection', 'Please select a valid connection'), { modal: true });
}
}
return connection;

View File

@@ -20,9 +20,9 @@ agent-base@4, agent-base@^4.3.0:
es6-promisify "^5.0.0"
ajv@^6.5.5:
version "6.10.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52"
integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==
version "6.10.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==
dependencies:
fast-deep-equal "^2.0.1"
fast-json-stable-stringify "^2.0.0"
@@ -107,9 +107,9 @@ circular-json@^0.3.1:
integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==
combined-stream@^1.0.6, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
version "1.0.7"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
dependencies:
delayed-stream "~1.0.0"
@@ -260,9 +260,9 @@ glob@7.1.2:
path-is-absolute "^1.0.0"
glob@^7.1.2:
version "7.1.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0"
integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==
version "7.1.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
@@ -317,9 +317,9 @@ http-signature@~1.2.0:
sshpk "^1.7.0"
https-proxy-agent@^2.2.1:
version "2.2.4"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b"
integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==
version "2.2.2"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793"
integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==
dependencies:
agent-base "^4.3.0"
debug "^3.1.0"
@@ -383,9 +383,9 @@ jsprim@^1.2.2:
verror "1.10.0"
lodash@^4.16.4, lodash@^4.17.4:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
md5@^2.1.0:
version "2.2.1"
@@ -501,9 +501,9 @@ postinstall-build@^5.0.1:
integrity sha512-vPvPe8TKgp4FLgY3+DfxCE5PIfoXBK2lyLfNCxsRbDsV6vS4oU5RG/IWxrblMn6heagbnMED3MemUQllQ2bQUg==
psl@^1.1.24:
version "1.4.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2"
integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==
version "1.1.31"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
punycode@^1.4.1:
version "1.4.1"
@@ -557,9 +557,9 @@ requires-port@^1.0.0:
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
safe-buffer@^5.0.1, safe-buffer@^5.1.2:
version "5.2.0"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519"
integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
@@ -616,9 +616,9 @@ should@^13.2.1:
should-util "^1.0.0"
source-map-support@^0.5.0:
version "0.5.16"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042"
integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==
version "0.5.13"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"
integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
@@ -702,9 +702,9 @@ url-parse@^1.4.4:
requires-port "^1.0.0"
uuid@^3.3.2:
version "3.3.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==
version "3.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
verror@1.10.0:
version "1.10.0"
@@ -728,7 +728,7 @@ vscode-test@^0.4.1:
http-proxy-agent "^2.1.0"
https-proxy-agent "^2.2.1"
vscode@^1.1.36:
vscode@^1.1.10:
version "1.1.36"
resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.36.tgz#5e1a0d1bf4977d0c7bc5159a9a13d5b104d4b1b6"
integrity sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==

View File

@@ -15,6 +15,7 @@ module.exports = withDefaults({
extension: './src/extension.ts'
},
externals: {
'ms-rest': 'commonjs ms-rest',
'request': 'commonjs request'
}
});

View File

@@ -13,10 +13,6 @@
"*"
],
"main": "./out/extension",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/azuredatastudio.git"
},
"contributes": {
"configuration": [
{
@@ -142,6 +138,10 @@
{
"command": "azure.resource.connectsqlserver",
"when": "false"
},
{
"command": "azure.resource.connectsqldb",
"when": "false"
}
],
"view/title": [
@@ -169,7 +169,12 @@
},
{
"command": "azure.resource.connectsqlserver",
"when": "viewItem == azure.resource.itemType.databaseServer || viewItem == azure.resource.itemType.database || viewItem == azure.resource.itemType.sqlInstance",
"when": "viewItem == azure.resource.itemType.databaseServer",
"group": "inline"
},
{
"command": "azure.resource.connectsqldb",
"when": "viewItem == azure.resource.itemType.database",
"group": "inline"
}
]
@@ -177,9 +182,10 @@
"hasAzureResourceProviders": true
},
"dependencies": {
"@azure/arm-resourcegraph": "^2.0.0",
"@azure/arm-subscriptions": "1.0.0",
"adal-node": "^0.1.28",
"azure-arm-resource": "^7.0.0",
"azure-arm-sql": "^5.0.1",
"ms-rest": "^2.5.0",
"request": "2.88.0",
"vscode-nls": "^4.0.0"
},
@@ -187,9 +193,9 @@
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.12",
"@types/request": "^2.48.1",
"mocha": "^5.2.0",
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"mocha": "^5.2.0",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscode": "1.1.26"

View File

@@ -1,8 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>SQLManagedInstance_white</title>
<rect x="2.00012" y="2" width="5" height="1" fill="#fff"/>
<rect x="2.00012" y="4" width="5" height="1" fill="#fff"/>
<path d="M.46039,8.4613a4.91729,4.91729,0,0,1,.53973-.44452V1h7V5.031C8.16608,5.01611,8.332,5,8.5,5c.17041,0,.33319.03088.50012.04572V1A.97576.97576,0,0,0,8.922.60938,1.01847,1.01847,0,0,0,8.39075.07812.97581.97581,0,0,0,8.00012,0h-7A.97409.97409,0,0,0,.6095.07812,1.01837,1.01837,0,0,0,.07825.60938.9673.9673,0,0,0,.00012,1V9.02069A4.92958,4.92958,0,0,1,.46039,8.4613Z" fill="#fff"/>
<path d="M3.418,12.17188a.46214.46214,0,0,0,.15234.34765,1.85177,1.85177,0,0,0,.375.26953c.14844.083.31055.167.48828.25a2.73055,2.73055,0,0,1,.48829.293,1.61526,1.61526,0,0,1,.375.39844.98956.98956,0,0,1,.15234.55859,1.02408,1.02408,0,0,1-.52344.94922,1.632,1.632,0,0,1-.52734.19141,3.19774,3.19774,0,0,1-.582.05469,2.68431,2.68431,0,0,1-.27344-.01563c-.10449-.01074-.21-.02441-.31641-.043a2.33361,2.33361,0,0,1-.30859-.07422,1.08972,1.08972,0,0,1-.25-.10937V14.5a.975.975,0,0,0,.23437.168,1.66814,1.66814,0,0,0,.293.12109,2.579,2.579,0,0,0,.3086.07422,1.64373,1.64373,0,0,0,.28906.02734,2.52815,2.52815,0,0,0,.30469-.01953.89453.89453,0,0,0,.28906-.08593.62425.62425,0,0,0,.21875-.17969.48873.48873,0,0,0,.08594-.30078.47128.47128,0,0,0-.15235-.35547,1.77024,1.77024,0,0,0-.375-.26563c-.14844-.08105-.31152-.16113-.48828-.24218a2.72438,2.72438,0,0,1-.48828-.28516,1.549,1.549,0,0,1-.375-.39453,1.00486,1.00486,0,0,1-.15234-.56641.9706.9706,0,0,1,.14843-.54687,1.20875,1.20875,0,0,1,.38282-.3711,1.70905,1.70905,0,0,1,.51953-.21093A2.46975,2.46975,0,0,1,4.26953,11a5.03456,5.03456,0,0,1,.50781.02734,1.45928,1.45928,0,0,1,.48438.12891v.71094a1.25142,1.25142,0,0,0-.45313-.207,2.19048,2.19048,0,0,0-.5-.0586,1.644,1.644,0,0,0-.28906.02735,1.12291,1.12291,0,0,0-.28906.08984.6264.6264,0,0,0-.22266.17187A.42634.42634,0,0,0,3.418,12.17188Zm6.71875,1.01562a3.40218,3.40218,0,0,1-.043.53906,2.30547,2.30547,0,0,1-.40234.97656,1.91775,1.91775,0,0,1-.375.39063L10.57422,16H9.48047l-.78125-.60156c-.11524.02636-.22559.04687-.332.0625a2.30189,2.30189,0,0,1-.332.02344,2.20933,2.20933,0,0,1-.8711-.16407,1.83062,1.83062,0,0,1-.65234-.457,1.9945,1.9945,0,0,1-.40625-.69531,2.624,2.624,0,0,1-.14063-.87109,2.87385,2.87385,0,0,1,.14063-.91407,2.07515,2.07515,0,0,1,.41406-.73047,1.8639,1.8639,0,0,1,.67188-.48046A2.29457,2.29457,0,0,1,8.10547,11a2.05589,2.05589,0,0,1,.85547.17188,1.90312,1.90312,0,0,1,.64062.46484A2.009,2.009,0,0,1,10,12.332,2.65272,2.65272,0,0,1,10.13672,13.1875ZM8.03516,14.85938a1.34466,1.34466,0,0,0,.61328-.12891,1.19009,1.19009,0,0,0,.418-.34766,1.42887,1.42887,0,0,0,.23828-.51172,2.51764,2.51764,0,0,0,.07422-.61328,2.63883,2.63883,0,0,0-.07032-.60937,1.5027,1.5027,0,0,0-.22656-.51953,1.18407,1.18407,0,0,0-.40625-.35938,1.26,1.26,0,0,0-.60937-.13672,1.22053,1.22053,0,0,0-.59375.13672,1.25881,1.25881,0,0,0-.418.36328,1.57394,1.57394,0,0,0-.25.51953,2.20628,2.20628,0,0,0-.082.59766,2.237,2.237,0,0,0,.07812.59375,1.60012,1.60012,0,0,0,.23828.51563,1.15845,1.15845,0,0,0,.9961.5Zm5.30468-.05469v.60937H10.93359V11.07031h.71875v3.73438Z" fill="#fff"/>
<path d="M15.76172,11.82031a2.99728,2.99728,0,0,0-.64844-.94922,3.07314,3.07314,0,0,0-.96094-.63671A2.97165,2.97165,0,0,0,12.97656,10a4.65135,4.65135,0,0,0-.49609-1.58594A4.5455,4.5455,0,0,0,11.5,7.14453a4.49274,4.49274,0,0,0-1.36328-.83984A4.40562,4.40562,0,0,0,8.5,6a4.49586,4.49586,0,0,0-1.125.14062,4.43869,4.43869,0,0,0-1.03125.40626,4.32586,4.32586,0,0,0-.89453.65234,4.65184,4.65184,0,0,0-.72266.87109A3.8619,3.8619,0,0,0,4,8a3.925,3.925,0,0,0-1.55859.3125A3.98153,3.98153,0,0,0,.3125,10.44141a4.043,4.043,0,0,0,0,3.11718A4.003,4.003,0,0,0,1.168,14.832a3.94445,3.94445,0,0,0,.832.6167v-1.2276c-.039-.03516-.08374-.06268-.12109-.1a3.03209,3.03209,0,0,1-.64453-.95312,3.01758,3.01758,0,0,1,0-2.332A3.02292,3.02292,0,0,1,2.832,9.23438,2.91341,2.91341,0,0,1,4,9a2.88027,2.88027,0,0,1,1.23438.27344A3.49138,3.49138,0,0,1,7.44531,7.16406a3.50764,3.50764,0,0,1,2.418.10938,3.5073,3.5073,0,0,1,1.86328,1.86328A3.42177,3.42177,0,0,1,12,10.5V11h1a1.94129,1.94129,0,0,1,.77734.15625,2.01529,2.01529,0,0,1,1.06641,1.06641,2.01175,2.01175,0,0,1,0,1.55468,2.03169,2.03169,0,0,1-.42969.63672A1.999,1.999,0,0,1,14,14.72247v1.09424c.054-.01941.11108-.02838.16406-.05109A3.02292,3.02292,0,0,0,15.76562,14.168a3.03337,3.03337,0,0,0-.0039-2.34766Z" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -1,8 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>SQLManagedInstance</title>
<rect x="2.00012" y="2" width="5" height="1"/>
<rect x="2.00012" y="4" width="5" height="1"/>
<path d="M.46039,8.4613a4.91729,4.91729,0,0,1,.53973-.44452V1h7V5.031C8.16608,5.01611,8.332,5,8.5,5c.17041,0,.33319.03088.50012.04572V1A.97576.97576,0,0,0,8.922.60938,1.01847,1.01847,0,0,0,8.39075.07812.97581.97581,0,0,0,8.00012,0h-7A.97409.97409,0,0,0,.6095.07812,1.01837,1.01837,0,0,0,.07825.60938.9673.9673,0,0,0,.00012,1V9.02069A4.92958,4.92958,0,0,1,.46039,8.4613Z"/>
<path d="M3.418,12.17188a.46214.46214,0,0,0,.15234.34765,1.85177,1.85177,0,0,0,.375.26953c.14844.083.31055.167.48828.25a2.73055,2.73055,0,0,1,.48829.293,1.61526,1.61526,0,0,1,.375.39844.98956.98956,0,0,1,.15234.55859,1.02408,1.02408,0,0,1-.52344.94922,1.632,1.632,0,0,1-.52734.19141,3.19774,3.19774,0,0,1-.582.05469,2.68431,2.68431,0,0,1-.27344-.01563c-.10449-.01074-.21-.02441-.31641-.043a2.33361,2.33361,0,0,1-.30859-.07422,1.08972,1.08972,0,0,1-.25-.10937V14.5a.975.975,0,0,0,.23437.168,1.66814,1.66814,0,0,0,.293.12109,2.579,2.579,0,0,0,.3086.07422,1.64373,1.64373,0,0,0,.28906.02734,2.52815,2.52815,0,0,0,.30469-.01953.89453.89453,0,0,0,.28906-.08593.62425.62425,0,0,0,.21875-.17969.48873.48873,0,0,0,.08594-.30078.47128.47128,0,0,0-.15235-.35547,1.77024,1.77024,0,0,0-.375-.26563c-.14844-.08105-.31152-.16113-.48828-.24218a2.72438,2.72438,0,0,1-.48828-.28516,1.549,1.549,0,0,1-.375-.39453,1.00486,1.00486,0,0,1-.15234-.56641.9706.9706,0,0,1,.14843-.54687,1.20875,1.20875,0,0,1,.38282-.3711,1.70905,1.70905,0,0,1,.51953-.21093A2.46975,2.46975,0,0,1,4.26953,11a5.03456,5.03456,0,0,1,.50781.02734,1.45928,1.45928,0,0,1,.48438.12891v.71094a1.25142,1.25142,0,0,0-.45313-.207,2.19048,2.19048,0,0,0-.5-.0586,1.644,1.644,0,0,0-.28906.02735,1.12291,1.12291,0,0,0-.28906.08984.6264.6264,0,0,0-.22266.17187A.42634.42634,0,0,0,3.418,12.17188Zm6.71875,1.01562a3.40218,3.40218,0,0,1-.043.53906,2.30547,2.30547,0,0,1-.40234.97656,1.91775,1.91775,0,0,1-.375.39063L10.57422,16H9.48047l-.78125-.60156c-.11524.02636-.22559.04687-.332.0625a2.30189,2.30189,0,0,1-.332.02344,2.20933,2.20933,0,0,1-.8711-.16407,1.83062,1.83062,0,0,1-.65234-.457,1.9945,1.9945,0,0,1-.40625-.69531,2.624,2.624,0,0,1-.14063-.87109,2.87385,2.87385,0,0,1,.14063-.91407,2.07515,2.07515,0,0,1,.41406-.73047,1.8639,1.8639,0,0,1,.67188-.48046A2.29457,2.29457,0,0,1,8.10547,11a2.05589,2.05589,0,0,1,.85547.17188,1.90312,1.90312,0,0,1,.64062.46484A2.009,2.009,0,0,1,10,12.332,2.65272,2.65272,0,0,1,10.13672,13.1875ZM8.03516,14.85938a1.34466,1.34466,0,0,0,.61328-.12891,1.19009,1.19009,0,0,0,.418-.34766,1.42887,1.42887,0,0,0,.23828-.51172,2.51764,2.51764,0,0,0,.07422-.61328,2.63883,2.63883,0,0,0-.07032-.60937,1.5027,1.5027,0,0,0-.22656-.51953,1.18407,1.18407,0,0,0-.40625-.35938,1.26,1.26,0,0,0-.60937-.13672,1.22053,1.22053,0,0,0-.59375.13672,1.25881,1.25881,0,0,0-.418.36328,1.57394,1.57394,0,0,0-.25.51953,2.20628,2.20628,0,0,0-.082.59766,2.237,2.237,0,0,0,.07812.59375,1.60012,1.60012,0,0,0,.23828.51563,1.15845,1.15845,0,0,0,.9961.5Zm5.30468-.05469v.60937H10.93359V11.07031h.71875v3.73438Z"/>
<path d="M15.76172,11.82031a2.99728,2.99728,0,0,0-.64844-.94922,3.07314,3.07314,0,0,0-.96094-.63671A2.97165,2.97165,0,0,0,12.97656,10a4.65135,4.65135,0,0,0-.49609-1.58594A4.5455,4.5455,0,0,0,11.5,7.14453a4.49274,4.49274,0,0,0-1.36328-.83984A4.40562,4.40562,0,0,0,8.5,6a4.49586,4.49586,0,0,0-1.125.14062,4.43869,4.43869,0,0,0-1.03125.40626,4.32586,4.32586,0,0,0-.89453.65234,4.65184,4.65184,0,0,0-.72266.87109A3.8619,3.8619,0,0,0,4,8a3.925,3.925,0,0,0-1.55859.3125A3.98153,3.98153,0,0,0,.3125,10.44141a4.043,4.043,0,0,0,0,3.11718A4.003,4.003,0,0,0,1.168,14.832a3.94445,3.94445,0,0,0,.832.6167v-1.2276c-.039-.03516-.08374-.06268-.12109-.1a3.03209,3.03209,0,0,1-.64453-.95312,3.01758,3.01758,0,0,1,0-2.332A3.02292,3.02292,0,0,1,2.832,9.23438,2.91341,2.91341,0,0,1,4,9a2.88027,2.88027,0,0,1,1.23438.27344A3.49138,3.49138,0,0,1,7.44531,7.16406a3.50764,3.50764,0,0,1,2.418.10938,3.5073,3.5073,0,0,1,1.86328,1.86328A3.42177,3.42177,0,0,1,12,10.5V11h1a1.94129,1.94129,0,0,1,.77734.15625,2.01529,2.01529,0,0,1,1.06641,1.06641,2.01175,2.01175,0,0,1,0,1.55468,2.03169,2.03169,0,0,1-.42969.63672A1.999,1.999,0,0,1,14,14.72247v1.09424c.054-.01941.11108-.02838.16406-.05109A3.02292,3.02292,0,0,0,15.76562,14.168a3.03337,3.03337,0,0,0-.0039-2.34766Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -150,7 +150,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
private doIfInitialized<T>(op: () => Promise<T>): Promise<T> {
return this._isInitialized
? op()
: Promise.reject(localize('accountProviderNotInitialized', "Account provider not initialized, cannot perform action"));
: Promise.reject(localize('accountProviderNotInitialized', 'Account provider not initialized, cannot perform action'));
}
private getAccessTokens(account: AzureAccount, resource: azdata.AzureResource): Promise<AzureAccountSecurityTokenCollection> {
@@ -235,8 +235,8 @@ export class AzureAccountProvider implements azdata.AccountProvider {
// 2) Begin the acquiring token polling
// 3) When that completes via callback, close the auto oauth
let title = isAddAccount ?
localize('addAccount', "Add {0} account", self._metadata.displayName) :
localize('refreshAccount', "Refresh {0} account", self._metadata.displayName);
localize('addAccount', 'Add {0} account', self._metadata.displayName) :
localize('refreshAccount', 'Refresh {0} account', self._metadata.displayName);
return azdata.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
.then(() => {
return new Promise<adal.TokenResponse | azdata.PromptFailedResult>((resolve, reject) => {
@@ -293,7 +293,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
userId: userId,
displayName: tenantDetails.length && tenantDetails[0].displayName
? tenantDetails[0].displayName
: localize('azureWorkAccountDisplayName', "Work or school account")
: localize('azureWorkAccountDisplayName', 'Work or school account')
};
});
});
@@ -410,7 +410,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
// Calculate the home tenant display name to use for the contextual display name
let contextualDisplayName = msa
? localize('microsoftAccountDisplayName', "Microsoft Account")
? localize('microsoftAccountDisplayName', 'Microsoft Account')
: tenants[0].displayName;
// Calculate the account type

View File

@@ -78,11 +78,11 @@ export class AzureAccountProviderService implements vscode.Disposable {
return Promise.all(promises)
.then(
() => {
let message = localize('clearTokenCacheSuccess', "Token cache successfully cleared");
let message = localize('clearTokenCacheSuccess', 'Token cache successfully cleared');
vscode.window.showInformationMessage(`${constants.extensionName}: ${message}`);
},
err => {
let message = localize('clearTokenCacheFailure', "Failed to clear token cache");
let message = localize('clearTokenCacheFailure', 'Failed to clear token cache');
vscode.window.showErrorMessage(`${constants.extensionName}: ${message}: ${err}`);
});
}

View File

@@ -13,7 +13,7 @@ const localize = nls.loadMessageBundle();
const publicAzureSettings: ProviderSettings = {
configKey: 'enablePublicCloud',
metadata: {
displayName: localize('publicCloudDisplayName', "Azure"),
displayName: localize('publicCloudDisplayName', 'Azure'),
id: 'azurePublicCloud',
settings: {
host: 'https://login.microsoftonline.com/',

View File

@@ -3,14 +3,15 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { window, QuickPickItem } from 'vscode';
import * as azdata from 'azdata';
import { TokenCredentials } from '@azure/ms-rest-js';
import { AzureResource } from 'azdata';
import { TokenCredentials } from 'ms-rest';
import { AppContext } from '../appContext';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { AppContext } from '../appContext';
import { azureResource } from './azure-resource';
import { TreeNode } from './treeNode';
import { AzureResourceCredentialError } from './errors';
@@ -33,7 +34,7 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
const subscriptions = (await accountNode.getCachedSubscriptions()) || <azureResource.AzureResourceSubscription[]>[];
if (subscriptions.length === 0) {
try {
const tokens = await this.servicePool.apiWrapper.getSecurityToken(this.account, azdata.AzureResource.ResourceManagement);
const tokens = await this.servicePool.apiWrapper.getSecurityToken(this.account, AzureResource.ResourceManagement);
for (const tenant of this.account.properties.tenants) {
const token = tokens[tenant.id].token;
@@ -42,15 +43,11 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
subscriptions.push(...await subscriptionService.getSubscriptions(accountNode.account, new TokenCredentials(token, tokenType)));
}
} catch (error) {
throw new AzureResourceCredentialError(localize('azure.resource.selectsubscriptions.credentialError', "Failed to get credential for account {0}. Please refresh the account.", this.account.key.accountId), error);
throw new AzureResourceCredentialError(localize('azure.resource.selectsubscriptions.credentialError', 'Failed to get credential for account {0}. Please refresh the account.', this.account.key.accountId), error);
}
}
let selectedSubscriptions = await subscriptionFilterService.getSelectedSubscriptions(accountNode.account);
if (!selectedSubscriptions) {
selectedSubscriptions = [];
}
let selectedSubscriptions = (await subscriptionFilterService.getSelectedSubscriptions(accountNode.account)) || <azureResource.AzureResourceSubscription[]>[];
const selectedSubscriptionIds: string[] = [];
if (selectedSubscriptions.length > 0) {
selectedSubscriptionIds.push(...selectedSubscriptions.map((subscription) => subscription.id));
@@ -69,11 +66,11 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
picked: selectedSubscriptionIds.indexOf(subscription.id) !== -1,
subscription: subscription
};
}).sort((a, b) => a.label.localeCompare(b.label));
});
const selectedSubscriptionQuickPickItems = await window.showQuickPick(subscriptionQuickPickItems, { canPickMany: true });
const selectedSubscriptionQuickPickItems = (await window.showQuickPick(subscriptionQuickPickItems, { canPickMany: true }));
if (selectedSubscriptionQuickPickItems && selectedSubscriptionQuickPickItems.length > 0) {
await tree.refresh(node, false);
tree.refresh(node, false);
selectedSubscriptions = selectedSubscriptionQuickPickItems.map((subscriptionItem) => subscriptionItem.subscription);
await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions);
@@ -83,27 +80,10 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
appContext.apiWrapper.registerCommand('azure.resource.refreshall', () => tree.notifyNodeChanged(undefined));
appContext.apiWrapper.registerCommand('azure.resource.refresh', async (node?: TreeNode) => {
await tree.refresh(node, true);
tree.refresh(node, true);
});
appContext.apiWrapper.registerCommand('azure.resource.signin', async (node?: TreeNode) => {
appContext.apiWrapper.executeCommand('workbench.actions.modal.linkedAccount');
});
appContext.apiWrapper.registerCommand('azure.resource.connectsqlserver', async (node?: TreeNode) => {
if (!node) {
return;
}
const treeItem: azdata.TreeItem = await node.getTreeItem();
if (!treeItem.payload) {
return;
}
// Ensure connection is saved to the Connections list, then open connection dialog
let connectionProfile = Object.assign({}, treeItem.payload, { saveProfile: true });
const conn = await appContext.apiWrapper.openConnectionDialog(undefined, connectionProfile, { saveConnection: true, showDashboard: true });
if (conn) {
appContext.apiWrapper.executeCommand('workbench.view.connections');
}
});
}

View File

@@ -3,6 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export enum AzureResourceItemType {
account = 'azure.resource.itemType.account',
subscription = 'azure.resource.itemType.subscription',
@@ -10,7 +12,6 @@ export enum AzureResourceItemType {
database = 'azure.resource.itemType.database',
databaseServerContainer = 'azure.resource.itemType.databaseServerContainer',
databaseServer = 'azure.resource.itemType.databaseServer',
sqlInstance = 'azure.resource.itemType.sqlInstance',
message = 'azure.resource.itemType.message'
}
@@ -21,4 +22,4 @@ export enum AzureResourceServiceNames {
subscriptionService = 'AzureResourceSubscriptionService',
subscriptionFilterService = 'AzureResourceSubscriptionFilterService',
tenantService = 'AzureResourceTenantService'
}
}

View File

@@ -3,8 +3,9 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as msRest from '@azure/ms-rest-js';
'use strict';
import { ServiceClientCredentials } from 'ms-rest';
import { Account, DidChangeAccountsParams } from 'azdata';
import { Event } from 'vscode';
@@ -12,15 +13,17 @@ import { azureResource } from './azure-resource';
export interface IAzureResourceAccountService {
getAccounts(): Promise<Account[]>;
readonly onDidChangeAccounts: Event<DidChangeAccountsParams>;
}
export interface IAzureResourceSubscriptionService {
getSubscriptions(account: Account, credential: msRest.ServiceClientCredentials): Promise<azureResource.AzureResourceSubscription[]>;
getSubscriptions(account: Account, credential: ServiceClientCredentials): Promise<azureResource.AzureResourceSubscription[]>;
}
export interface IAzureResourceSubscriptionFilterService {
getSelectedSubscriptions(account: Account): Promise<azureResource.AzureResourceSubscription[]>;
saveSelectedSubscriptions(account: Account, selectedSubscriptions: azureResource.AzureResourceSubscription[]): Promise<void>;
}
@@ -39,25 +42,4 @@ export interface IAzureResourceTenantService {
export interface IAzureResourceNodeWithProviderId {
resourceProviderId: string;
resourceNode: azureResource.IAzureResourceNode;
}
export interface AzureSqlResource {
name: string;
loginName: string;
}
export interface IAzureResourceService<T extends AzureSqlResource> {
getResources(subscription: azureResource.AzureResourceSubscription, credential: msRest.ServiceClientCredentials): Promise<T[]>;
}
export interface AzureResourceDatabase extends AzureSqlResource {
serverName: string;
serverFullName: string;
}
export interface AzureResourceDatabaseServer extends AzureSqlResource {
id?: string;
fullName: string;
defaultDatabaseName: string;
}
}

View File

@@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IConnectionProfile } from 'azdata';
import { AppContext } from '../../../appContext';
import { TreeNode } from '../../treeNode';
import { generateGuid } from '../../utils';
import { AzureResourceItemType } from '../../constants';
import { IAzureResourceDatabaseNode } from './interfaces';
import { AzureResourceResourceTreeNode } from '../../resourceTreeNode';
export function registerAzureResourceDatabaseCommands(appContext: AppContext): void {
appContext.apiWrapper.registerCommand('azure.resource.connectsqldb', async (node?: TreeNode) => {
if (!node) {
return;
}
const treeItem = await node.getTreeItem();
if (treeItem.contextValue !== AzureResourceItemType.database) {
return;
}
const resourceNode = (node as AzureResourceResourceTreeNode).resourceNodeWithProviderId.resourceNode;
const database = (resourceNode as IAzureResourceDatabaseNode).database;
let connectionProfile: IConnectionProfile = {
id: generateGuid(),
connectionName: undefined,
serverName: database.serverFullName,
databaseName: database.name,
userName: database.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: true,
options: {}
};
const conn = await appContext.apiWrapper.openConnectionDialog(undefined, connectionProfile, { saveConnection: true, showDashboard: true });
if (conn) {
appContext.apiWrapper.executeCommand('workbench.view.connections');
}
});
}

View File

@@ -3,20 +3,24 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ExtensionContext } from 'vscode';
import { ApiWrapper } from '../../../apiWrapper';
import { azureResource } from '../../azure-resource';
import { IAzureResourceDatabaseService } from './interfaces';
import { AzureResourceDatabaseTreeDataProvider } from './databaseTreeDataProvider';
import { IAzureResourceService, AzureResourceDatabase } from '../../interfaces';
export class AzureResourceDatabaseProvider implements azureResource.IAzureResourceProvider {
public constructor(
private _databaseService: IAzureResourceService<AzureResourceDatabase>,
private _apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
databaseService: IAzureResourceDatabaseService,
apiWrapper: ApiWrapper,
extensionContext: ExtensionContext
) {
this._databaseService = databaseService;
this._apiWrapper = apiWrapper;
this._extensionContext = extensionContext;
}
public getTreeDataProvider(): azureResource.IAzureResourceTreeDataProvider {
@@ -26,4 +30,8 @@ export class AzureResourceDatabaseProvider implements azureResource.IAzureResour
public get providerId(): string {
return 'azure.resource.providers.database';
}
}
private _databaseService: IAzureResourceDatabaseService = undefined;
private _apiWrapper: ApiWrapper = undefined;
private _extensionContext: ExtensionContext = undefined;
}

View File

@@ -3,56 +3,38 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ServiceClientCredentials } from '@azure/ms-rest-js';
'use strict';
import { ServiceClientCredentials } from 'ms-rest';
import { SqlManagementClient } from 'azure-arm-sql';
import { azureResource } from '../../azure-resource';
import { IAzureResourceService, AzureResourceDatabase } from '../../interfaces';
import { serversQuery, DbServerGraphData } from '../databaseServer/databaseServerService';
import { ResourceGraphClient } from '@azure/arm-resourcegraph';
import { queryGraphResources, GraphData } from '../resourceTreeDataProviderBase';
import { IAzureResourceDatabaseService } from './interfaces';
import { AzureResourceDatabase } from './models';
interface DatabaseGraphData extends GraphData {
kind: string;
}
export class AzureResourceDatabaseService implements IAzureResourceService<AzureResourceDatabase> {
public async getResources(subscription: azureResource.AzureResourceSubscription, credential: ServiceClientCredentials): Promise<AzureResourceDatabase[]> {
export class AzureResourceDatabaseService implements IAzureResourceDatabaseService {
public async getDatabases(subscription: azureResource.AzureResourceSubscription, credential: ServiceClientCredentials): Promise<AzureResourceDatabase[]> {
const databases: AzureResourceDatabase[] = [];
const resourceClient = new ResourceGraphClient(credential);
// Query servers and databases in parallel (start both promises before waiting on the 1st)
let serverQueryPromise = queryGraphResources<GraphData>(resourceClient, subscription.id, serversQuery);
let dbQueryPromise = queryGraphResources<GraphData>(resourceClient, subscription.id, 'where type == "microsoft.sql/servers/databases"');
let servers: DbServerGraphData[] = await serverQueryPromise as DbServerGraphData[];
let dbByGraph: DatabaseGraphData[] = await dbQueryPromise as DatabaseGraphData[];
// Group servers by resource group, then merge DB results with servers so we
// can get the login name and server fully qualified name to use for connections
let rgMap = new Map<string, DbServerGraphData[]>();
servers.forEach(s => {
let serversForRg = rgMap.get(s.resourceGroup) || [];
serversForRg.push(s);
rgMap.set(s.resourceGroup, serversForRg);
});
// Match database ID. When calling exec [0] is full match, [1] is resource group name, [2] is server name
const svrIdRegExp = new RegExp(`\/subscriptions\/${subscription.id}\/resourceGroups\/(.+)\/providers\/Microsoft\.Sql\/servers\/(.+)\/databases\/.+`);
dbByGraph.forEach(db => {
// Filter master DBs, and for all others find their server to get login info
let serversForRg = rgMap.get(db.resourceGroup);
if (serversForRg && !db.kind.endsWith('system') && svrIdRegExp.test(db.id)) {
const founds = svrIdRegExp.exec(db.id);
const serverName = founds[2];
let server = servers.find(s => s.name === serverName);
if (server) {
databases.push({
name: db.name,
serverName: server.name,
serverFullName: server.properties.fullyQualifiedDomainName,
loginName: server.properties.administratorLogin
});
}
const sqlManagementClient = new SqlManagementClient(credential, subscription.id);
const svrs = await sqlManagementClient.servers.list();
for (const svr of svrs) {
// Extract resource group name from svr.id
const svrIdRegExp = new RegExp(`\/subscriptions\/${subscription.id}\/resourceGroups\/(.+)\/providers\/Microsoft\.Sql\/servers\/${svr.name}`);
if (!svrIdRegExp.test(svr.id)) {
continue;
}
});
const founds = svrIdRegExp.exec(svr.id);
const resouceGroup = founds[1];
const dbs = await sqlManagementClient.databases.listByServer(resouceGroup, svr.name);
dbs.forEach((db) => databases.push({
name: db.name,
serverName: svr.name,
serverFullName: svr.fullyQualifiedDomainName,
loginName: svr.administratorLogin
}));
}
return databases;
}

View File

@@ -3,61 +3,82 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { TreeItem, ExtensionNodeType } from 'azdata';
import { TreeItemCollapsibleState, ExtensionContext } from 'vscode';
'use strict';
import { AzureResource, ExtensionNodeType } from 'azdata';
import { TreeItem, TreeItemCollapsibleState, ExtensionContext } from 'vscode';
import { TokenCredentials } from 'ms-rest';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { azureResource } from '../../azure-resource';
import { IAzureResourceDatabaseService, IAzureResourceDatabaseNode } from './interfaces';
import { AzureResourceDatabase } from './models';
import { AzureResourceItemType } from '../../../azureResource/constants';
import { ApiWrapper } from '../../../apiWrapper';
import { generateGuid } from '../../utils';
import { IAzureResourceService, AzureResourceDatabase } from '../../interfaces';
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
export class AzureResourceDatabaseTreeDataProvider extends ResourceTreeDataProviderBase<AzureResourceDatabase> {
private static readonly containerId = 'azure.resource.providers.database.treeDataProvider.databaseContainer';
private static readonly containerLabel = localize('azure.resource.providers.database.treeDataProvider.databaseContainerLabel', "SQL Databases");
export class AzureResourceDatabaseTreeDataProvider implements azureResource.IAzureResourceTreeDataProvider {
public constructor(
databaseService: IAzureResourceService<AzureResourceDatabase>,
databaseService: IAzureResourceDatabaseService,
apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
extensionContext: ExtensionContext
) {
super(databaseService, apiWrapper);
}
protected getTreeItemForResource(database: AzureResourceDatabase): TreeItem {
return {
id: `databaseServer_${database.serverFullName}.database_${database.name}`,
label: `${database.name} (${database.serverName})`,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/sql_database_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/sql_database.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.database,
payload: {
id: generateGuid(),
connectionName: undefined,
serverName: database.serverFullName,
databaseName: database.name,
userName: database.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: false,
options: {}
},
childProvider: 'MSSQL',
type: ExtensionNodeType.Database
};
this._databaseService = databaseService;
this._apiWrapper = apiWrapper;
this._extensionContext = extensionContext;
}
protected createContainerNode(): azureResource.IAzureResourceNode {
public getTreeItem(element: azureResource.IAzureResourceNode): TreeItem | Thenable<TreeItem> {
return element.treeItem;
}
public async getChildren(element?: azureResource.IAzureResourceNode): Promise<azureResource.IAzureResourceNode[]> {
if (!element) {
return [this.createContainerNode()];
}
const tokens = await this._apiWrapper.getSecurityToken(element.account, AzureResource.ResourceManagement);
const credential = new TokenCredentials(tokens[element.tenantId].token, tokens[element.tenantId].tokenType);
const databases: AzureResourceDatabase[] = (await this._databaseService.getDatabases(element.subscription, credential)) || <AzureResourceDatabase[]>[];
return databases.map((database) => <IAzureResourceDatabaseNode>{
account: element.account,
subscription: element.subscription,
tenantId: element.tenantId,
database: database,
treeItem: {
id: `databaseServer_${database.serverFullName}.database_${database.name}`,
label: `${database.name} (${database.serverName})`,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/sql_database_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/sql_database.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.database,
payload: {
id: generateGuid(),
connectionName: undefined,
serverName: database.serverFullName,
databaseName: database.name,
userName: database.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: false,
options: {}
},
childProvider: 'MSSQL',
type: ExtensionNodeType.Database
}
});
}
private createContainerNode(): azureResource.IAzureResourceNode {
return {
account: undefined,
subscription: undefined,
@@ -74,4 +95,11 @@ export class AzureResourceDatabaseTreeDataProvider extends ResourceTreeDataProvi
}
};
}
private _databaseService: IAzureResourceDatabaseService = undefined;
private _apiWrapper: ApiWrapper = undefined;
private _extensionContext: ExtensionContext = undefined;
private static readonly containerId = 'azure.resource.providers.database.treeDataProvider.databaseContainer';
private static readonly containerLabel = localize('azure.resource.providers.database.treeDataProvider.databaseContainerLabel', 'SQL Databases');
}

View File

@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ServiceClientCredentials } from 'ms-rest';
import { azureResource } from '../../azure-resource';
import { AzureResourceDatabase } from './models';
export interface IAzureResourceDatabaseService {
getDatabases(subscription: azureResource.AzureResourceSubscription, credential: ServiceClientCredentials): Promise<AzureResourceDatabase[]>;
}
export interface IAzureResourceDatabaseNode extends azureResource.IAzureResourceNode {
readonly database: AzureResourceDatabase;
}

View File

@@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export interface AzureResourceDatabase {
name: string;
serverName: string;
serverFullName: string;
loginName: string;
}

View File

@@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IConnectionProfile } from 'azdata';
import { AppContext } from '../../../appContext';
import { TreeNode } from '../../treeNode';
import { generateGuid } from '../../utils';
import { AzureResourceItemType } from '../../constants';
import { IAzureResourceDatabaseServerNode } from './interfaces';
import { AzureResourceResourceTreeNode } from '../../resourceTreeNode';
export function registerAzureResourceDatabaseServerCommands(appContext: AppContext): void {
appContext.apiWrapper.registerCommand('azure.resource.connectsqlserver', async (node?: TreeNode) => {
if (!node) {
return;
}
const treeItem = await node.getTreeItem();
if (treeItem.contextValue !== AzureResourceItemType.databaseServer) {
return;
}
const resourceNode = (node as AzureResourceResourceTreeNode).resourceNodeWithProviderId.resourceNode;
const databaseServer = (resourceNode as IAzureResourceDatabaseServerNode).databaseServer;
let connectionProfile: IConnectionProfile = {
id: generateGuid(),
connectionName: undefined,
serverName: databaseServer.fullName,
databaseName: databaseServer.defaultDatabaseName,
userName: databaseServer.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: true,
options: {}
};
const conn = await appContext.apiWrapper.openConnectionDialog(undefined, connectionProfile, { saveConnection: true, showDashboard: true });
if (conn) {
appContext.apiWrapper.executeCommand('workbench.view.connections');
}
});
}

View File

@@ -3,19 +3,24 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ExtensionContext } from 'vscode';
import { ApiWrapper } from '../../../apiWrapper';
import { azureResource } from '../../azure-resource';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../interfaces';
import { IAzureResourceDatabaseServerService } from './interfaces';
import { AzureResourceDatabaseServerTreeDataProvider } from './databaseServerTreeDataProvider';
export class AzureResourceDatabaseServerProvider implements azureResource.IAzureResourceProvider {
public constructor(
private _databaseServerService: IAzureResourceService<AzureResourceDatabaseServer>,
private _apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
databaseServerService: IAzureResourceDatabaseServerService,
apiWrapper: ApiWrapper,
extensionContext: ExtensionContext
) {
this._databaseServerService = databaseServerService;
this._apiWrapper = apiWrapper;
this._extensionContext = extensionContext;
}
public getTreeDataProvider(): azureResource.IAzureResourceTreeDataProvider {
@@ -25,4 +30,8 @@ export class AzureResourceDatabaseServerProvider implements azureResource.IAzure
public get providerId(): string {
return 'azure.resource.providers.databaseServer';
}
}
private _databaseServerService: IAzureResourceDatabaseServerService = undefined;
private _apiWrapper: ApiWrapper = undefined;
private _extensionContext: ExtensionContext = undefined;
}

View File

@@ -3,33 +3,29 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
import { AzureResourceDatabaseServer } from '../../interfaces';
import { ServiceClientCredentials } from 'ms-rest';
import { SqlManagementClient } from 'azure-arm-sql';
import { azureResource } from '../../azure-resource';
import { IAzureResourceDatabaseServerService } from './interfaces';
import { AzureResourceDatabaseServer } from './models';
export interface DbServerGraphData extends GraphData {
properties: {
fullyQualifiedDomainName: string;
administratorLogin: string;
};
}
export class AzureResourceDatabaseServerService implements IAzureResourceDatabaseServerService {
public async getDatabaseServers(subscription: azureResource.AzureResourceSubscription, credential: ServiceClientCredentials): Promise<AzureResourceDatabaseServer[]> {
const databaseServers: AzureResourceDatabaseServer[] = [];
export const serversQuery = 'where type == "microsoft.sql/servers"';
const sqlManagementClient = new SqlManagementClient(credential, subscription.id);
const svrs = await sqlManagementClient.servers.list();
export class AzureResourceDatabaseServerService extends ResourceServiceBase<DbServerGraphData, AzureResourceDatabaseServer> {
protected get query(): string {
return serversQuery;
}
protected convertResource(resource: DbServerGraphData): AzureResourceDatabaseServer {
return {
id: resource.id,
name: resource.name,
fullName: resource.properties.fullyQualifiedDomainName,
loginName: resource.properties.administratorLogin,
svrs.forEach((svr) => databaseServers.push({
name: svr.name,
fullName: svr.fullyQualifiedDomainName,
loginName: svr.administratorLogin,
defaultDatabaseName: 'master'
};
}));
return databaseServers;
}
}

View File

@@ -3,62 +3,82 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionNodeType, TreeItem } from 'azdata';
import { TreeItemCollapsibleState, ExtensionContext } from 'vscode';
'use strict';
import { AzureResource, ExtensionNodeType } from 'azdata';
import { TreeItem, TreeItemCollapsibleState, ExtensionContext } from 'vscode';
import { TokenCredentials } from 'ms-rest';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { azureResource } from '../../azure-resource';
import { IAzureResourceDatabaseServerService, IAzureResourceDatabaseServerNode } from './interfaces';
import { AzureResourceDatabaseServer } from './models';
import { AzureResourceItemType } from '../../../azureResource/constants';
import { ApiWrapper } from '../../../apiWrapper';
import { generateGuid } from '../../utils';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../interfaces';
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
import { azureResource } from '../../azure-resource';
export class AzureResourceDatabaseServerTreeDataProvider extends ResourceTreeDataProviderBase<AzureResourceDatabaseServer> {
private static readonly containerId = 'azure.resource.providers.databaseServer.treeDataProvider.databaseServerContainer';
private static readonly containerLabel = localize('azure.resource.providers.databaseServer.treeDataProvider.databaseServerContainerLabel', "SQL Servers");
export class AzureResourceDatabaseServerTreeDataProvider implements azureResource.IAzureResourceTreeDataProvider {
public constructor(
databaseServerService: IAzureResourceService<AzureResourceDatabaseServer>,
databaseServerService: IAzureResourceDatabaseServerService,
apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
extensionContext: ExtensionContext
) {
super(databaseServerService, apiWrapper);
this._databaseServerService = databaseServerService;
this._apiWrapper = apiWrapper;
this._extensionContext = extensionContext;
}
protected getTreeItemForResource(databaseServer: AzureResourceDatabaseServer): TreeItem {
return {
id: `databaseServer_${databaseServer.id ? databaseServer.id : databaseServer.name}`,
label: databaseServer.name,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/sql_server_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/sql_server.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServer,
payload: {
id: generateGuid(),
connectionName: undefined,
serverName: databaseServer.fullName,
databaseName: databaseServer.defaultDatabaseName,
userName: databaseServer.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: false,
options: {}
},
childProvider: 'MSSQL',
type: ExtensionNodeType.Server
};
public getTreeItem(element: azureResource.IAzureResourceNode): TreeItem | Thenable<TreeItem> {
return element.treeItem;
}
protected createContainerNode(): azureResource.IAzureResourceNode {
public async getChildren(element?: azureResource.IAzureResourceNode): Promise<azureResource.IAzureResourceNode[]> {
if (!element) {
return [this.createContainerNode()];
}
const tokens = await this._apiWrapper.getSecurityToken(element.account, AzureResource.ResourceManagement);
const credential = new TokenCredentials(tokens[element.tenantId].token, tokens[element.tenantId].tokenType);
const databaseServers: AzureResourceDatabaseServer[] = (await this._databaseServerService.getDatabaseServers(element.subscription, credential)) || <AzureResourceDatabaseServer[]>[];
return databaseServers.map((databaseServer) => <IAzureResourceDatabaseServerNode>{
account: element.account,
subscription: element.subscription,
tenantId: element.tenantId,
databaseServer: databaseServer,
treeItem: {
id: `databaseServer_${databaseServer.name}`,
label: databaseServer.name,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/sql_server_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/sql_server.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServer,
payload: {
id: generateGuid(),
connectionName: undefined,
serverName: databaseServer.fullName,
databaseName: databaseServer.defaultDatabaseName,
userName: databaseServer.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: false,
options: {}
},
childProvider: 'MSSQL',
type: ExtensionNodeType.Server
}
});
}
private createContainerNode(): azureResource.IAzureResourceNode {
return {
account: undefined,
subscription: undefined,
@@ -75,4 +95,11 @@ export class AzureResourceDatabaseServerTreeDataProvider extends ResourceTreeDat
}
};
}
private _databaseServerService: IAzureResourceDatabaseServerService = undefined;
private _apiWrapper: ApiWrapper = undefined;
private _extensionContext: ExtensionContext = undefined;
private static readonly containerId = 'azure.resource.providers.databaseServer.treeDataProvider.databaseServerContainer';
private static readonly containerLabel = localize('azure.resource.providers.databaseServer.treeDataProvider.databaseServerContainerLabel', 'SQL Servers');
}

View File

@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ServiceClientCredentials } from 'ms-rest';
import { azureResource } from '../../azure-resource';
import { AzureResourceDatabaseServer } from './models';
export interface IAzureResourceDatabaseServerService {
getDatabaseServers(subscription: azureResource.AzureResourceSubscription, credentials: ServiceClientCredentials): Promise<AzureResourceDatabaseServer[]>;
}
export interface IAzureResourceDatabaseServerNode extends azureResource.IAzureResourceNode {
readonly databaseServer: AzureResourceDatabaseServer;
}

View File

@@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export interface AzureResourceDatabaseServer {
name: string;
fullName: string;
loginName: string;
defaultDatabaseName: string;
}

View File

@@ -1,28 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionContext } from 'vscode';
import { ApiWrapper } from '../../../apiWrapper';
import { azureResource } from '../../azure-resource';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../interfaces';
import { PostgresServerTreeDataProvider as PostgresServerTreeDataProvider } from './postgresServerTreeDataProvider';
export class PostgresServerProvider implements azureResource.IAzureResourceProvider {
public constructor(
private _databaseServerService: IAzureResourceService<AzureResourceDatabaseServer>,
private _apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
) {
}
public getTreeDataProvider(): azureResource.IAzureResourceTreeDataProvider {
return new PostgresServerTreeDataProvider(this._databaseServerService, this._apiWrapper, this._extensionContext);
}
public get providerId(): string {
return 'azure.resource.providers.postgresServer';
}
}

View File

@@ -1,35 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
import { AzureResourceDatabaseServer } from '../../interfaces';
export interface DbServerGraphData extends GraphData {
properties: {
fullyQualifiedDomainName: string;
administratorLogin: string;
};
}
export const serversQuery = 'where type == "microsoft.dbforpostgresql/servers"';
export class PostgresServerService extends ResourceServiceBase<DbServerGraphData, AzureResourceDatabaseServer> {
protected get query(): string {
return serversQuery;
}
protected convertResource(resource: DbServerGraphData): AzureResourceDatabaseServer {
return {
id: resource.id,
name: resource.name,
fullName: resource.properties.fullyQualifiedDomainName,
loginName: resource.properties.administratorLogin,
defaultDatabaseName: 'postgres'
};
}
}

View File

@@ -1,82 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionNodeType, TreeItem } from 'azdata';
import { TreeItemCollapsibleState, ExtensionContext } from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { AzureResourceItemType } from '../../constants';
import { ApiWrapper } from '../../../apiWrapper';
import { generateGuid } from '../../utils';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../interfaces';
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
import { azureResource } from '../../azure-resource';
export class PostgresServerTreeDataProvider extends ResourceTreeDataProviderBase<AzureResourceDatabaseServer> {
private static readonly containerId = 'azure.resource.providers.databaseServer.treeDataProvider.postgresServerContainer';
private static readonly containerLabel = localize('azure.resource.providers.databaseServer.treeDataProvider.postgresServerContainerLabel', "Azure Database for PostgreSQL Servers");
public constructor(
databaseServerService: IAzureResourceService<AzureResourceDatabaseServer>,
apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
) {
super(databaseServerService, apiWrapper);
}
protected getTreeItemForResource(databaseServer: AzureResourceDatabaseServer): TreeItem {
return {
id: `databaseServer_${databaseServer.id ? databaseServer.id : databaseServer.name}`,
label: databaseServer.name,
// TODO: should get PGSQL-specific icons (also needed in that extension)
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/sql_server_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/sql_server.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServer,
payload: {
id: generateGuid(),
connectionName: undefined,
serverName: databaseServer.fullName,
databaseName: databaseServer.defaultDatabaseName,
userName: `${databaseServer.loginName}@${databaseServer.fullName}`,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'PGSQL',
saveProfile: false,
options: {
// Set default for SSL or will get error complaining about it not being set correctly
'sslmode': 'require'
}
},
childProvider: 'PGSQL',
type: ExtensionNodeType.Server
};
}
protected createContainerNode(): azureResource.IAzureResourceNode {
return {
account: undefined,
subscription: undefined,
tenantId: undefined,
treeItem: {
id: PostgresServerTreeDataProvider.containerId,
label: PostgresServerTreeDataProvider.containerLabel,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/folder_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/folder.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}
};
}
}

View File

@@ -1,118 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureResource, TreeItem } from 'azdata';
import * as msRest from '@azure/ms-rest-js';
import { azureResource } from '../azure-resource';
import { ApiWrapper } from '../../apiWrapper';
import { IAzureResourceService, AzureSqlResource } from '../interfaces';
import { AzureResourceErrorMessageUtil } from '../utils';
import { ResourceGraphClient } from '@azure/arm-resourcegraph';
export abstract class ResourceTreeDataProviderBase<T extends AzureSqlResource> implements azureResource.IAzureResourceTreeDataProvider {
public constructor(
protected _resourceService: IAzureResourceService<T>,
protected _apiWrapper: ApiWrapper
) {
}
public getTreeItem(element: azureResource.IAzureResourceNode): TreeItem | Thenable<TreeItem> {
return element.treeItem;
}
public async getChildren(element?: azureResource.IAzureResourceNode): Promise<azureResource.IAzureResourceNode[]> {
try {
if (!element) {
return [this.createContainerNode()];
}
let resources: T[] = await this.getResources(element);
return resources.map((resource) => <azureResource.IAzureResourceNode>{
account: element.account,
subscription: element.subscription,
tenantId: element.tenantId,
treeItem: this.getTreeItemForResource(resource)
}).sort((a, b) => a.treeItem.label.localeCompare(b.treeItem.label));
} catch (error) {
console.log(AzureResourceErrorMessageUtil.getErrorMessage(error));
throw error;
}
}
private async getResources(element: azureResource.IAzureResourceNode): Promise<T[]> {
const tokens = await this._apiWrapper.getSecurityToken(element.account, AzureResource.ResourceManagement);
const credential = new msRest.TokenCredentials(tokens[element.tenantId].token, tokens[element.tenantId].tokenType);
const resources: T[] = await this._resourceService.getResources(element.subscription, credential) || <T[]>[];
return resources;
}
protected abstract getTreeItemForResource(resource: T): TreeItem;
protected abstract createContainerNode(): azureResource.IAzureResourceNode;
}
export interface GraphData {
id: string;
name: string;
location: string;
type: string;
resourceGroup: string;
}
export async function queryGraphResources<T extends GraphData>(resourceClient: ResourceGraphClient, subId: string, resourceQuery: string): Promise<T[]> {
const allResources: T[] = [];
let totalProcessed = 0;
let doQuery = async (skipToken?: string) => {
const response = await resourceClient.resources({
subscriptions: [subId],
query: resourceQuery,
options: {
resultFormat: 'objectArray',
skipToken: skipToken
}
});
const resources: T[] = response.data;
totalProcessed += resources.length;
allResources.push(...resources);
if (response.skipToken && totalProcessed < response.totalRecords) {
await doQuery(response.skipToken);
}
};
await doQuery();
return allResources;
}
export abstract class ResourceServiceBase<T extends GraphData, U extends AzureSqlResource> implements IAzureResourceService<U> {
constructor() {
}
protected abstract get query(): string;
public async getResources(subscription: azureResource.AzureResourceSubscription, credential: msRest.ServiceClientCredentials): Promise<U[]> {
const convertedResources: U[] = [];
const resourceClient = new ResourceGraphClient(credential);
let graphResources = await queryGraphResources<T>(resourceClient, subscription.id, this.query);
let ids = new Set<string>();
graphResources.forEach((res) => {
if (!ids.has(res.id)) {
ids.add(res.id);
let converted = this.convertResource(res);
convertedResources.push(converted);
}
});
return convertedResources;
}
protected abstract convertResource(resource: T): U;
}

View File

@@ -1,28 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionContext } from 'vscode';
import { ApiWrapper } from '../../../apiWrapper';
import { azureResource } from '../../azure-resource';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../interfaces';
import { SqlInstanceTreeDataProvider as SqlInstanceTreeDataProvider } from './sqlInstanceTreeDataProvider';
export class SqlInstanceProvider implements azureResource.IAzureResourceProvider {
public constructor(
private _service: IAzureResourceService<AzureResourceDatabaseServer>,
private _apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
) {
}
public getTreeDataProvider(): azureResource.IAzureResourceTreeDataProvider {
return new SqlInstanceTreeDataProvider(this._service, this._apiWrapper, this._extensionContext);
}
public get providerId(): string {
return 'azure.resource.providers.sqlInstance';
}
}

View File

@@ -1,33 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureResourceDatabaseServer } from '../../interfaces';
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
export interface SqlInstanceGraphData extends GraphData {
properties: {
fullyQualifiedDomainName: string;
administratorLogin: string;
};
}
const instanceQuery = 'where type == "microsoft.sql/managedinstances"';
export class SqlInstanceResourceService extends ResourceServiceBase<SqlInstanceGraphData, AzureResourceDatabaseServer> {
protected get query(): string {
return instanceQuery;
}
protected convertResource(resource: SqlInstanceGraphData): AzureResourceDatabaseServer {
return {
id: resource.id,
name: resource.name,
fullName: resource.properties.fullyQualifiedDomainName,
loginName: resource.properties.administratorLogin,
defaultDatabaseName: 'master'
};
}
}

View File

@@ -1,78 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionNodeType, TreeItem } from 'azdata';
import { TreeItemCollapsibleState, ExtensionContext } from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { AzureResourceItemType } from '../../constants';
import { ApiWrapper } from '../../../apiWrapper';
import { generateGuid } from '../../utils';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../interfaces';
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
import { azureResource } from '../../azure-resource';
export class SqlInstanceTreeDataProvider extends ResourceTreeDataProviderBase<AzureResourceDatabaseServer> {
private static readonly containerId = 'azure.resource.providers.sqlInstanceContainer';
private static readonly containerLabel = localize('azure.resource.providers.sqlInstanceContainerLabel', "SQL Managed Instances");
public constructor(
databaseServerService: IAzureResourceService<AzureResourceDatabaseServer>,
apiWrapper: ApiWrapper,
private _extensionContext: ExtensionContext
) {
super(databaseServerService, apiWrapper);
}
protected getTreeItemForResource(databaseServer: AzureResourceDatabaseServer): TreeItem {
return {
id: `sqlInstance_${databaseServer.id ? databaseServer.id : databaseServer.name}`,
label: databaseServer.name,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/sql_instance_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/sql_instance.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServer,
payload: {
id: generateGuid(),
connectionName: undefined,
serverName: databaseServer.fullName,
databaseName: databaseServer.defaultDatabaseName,
userName: databaseServer.loginName,
password: '',
authenticationType: 'SqlLogin',
savePassword: true,
groupFullName: '',
groupId: '',
providerName: 'MSSQL',
saveProfile: false,
options: {}
},
childProvider: 'MSSQL',
type: ExtensionNodeType.Server
};
}
protected createContainerNode(): azureResource.IAzureResourceNode {
return {
account: undefined,
subscription: undefined,
tenantId: undefined,
treeItem: {
id: SqlInstanceTreeDataProvider.containerId,
label: SqlInstanceTreeDataProvider.containerLabel,
iconPath: {
dark: this._extensionContext.asAbsolutePath('resources/dark/folder_inverse.svg'),
light: this._extensionContext.asAbsolutePath('resources/light/folder.svg')
},
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}
};
}
}

View File

@@ -41,7 +41,7 @@ export class AzureResourceResourceTreeNode extends TreeNode {
const children = await this._resourceService.getChildren(this.resourceNodeWithProviderId.resourceProviderId, this.resourceNodeWithProviderId.resourceNode);
if (children.length === 0) {
return [AzureResourceMessageTreeNode.create(localize('azure.resource.resourceTreeNode.noResourcesLabel', "No Resources found"), this)];
return [AzureResourceMessageTreeNode.create(localize('azure.resource.resourceTreeNode.noResourcesLabel', 'No Resources found'), this)];
} else {
return children.map((child) => {
// To make tree node's id unique, otherwise, treeModel.js would complain 'item already registered'

View File

@@ -3,9 +3,11 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { Account } from 'azdata';
import { ServiceClientCredentials } from '@azure/ms-rest-js';
import { SubscriptionClient } from '@azure/arm-subscriptions';
import { ServiceClientCredentials } from 'ms-rest';
import { SubscriptionClient } from 'azure-arm-resource';
import { azureResource } from '../azure-resource';
import { IAzureResourceSubscriptionService } from '../interfaces';
@@ -14,7 +16,7 @@ export class AzureResourceSubscriptionService implements IAzureResourceSubscript
public async getSubscriptions(account: Account, credential: ServiceClientCredentials): Promise<azureResource.AzureResourceSubscription[]> {
const subscriptions: azureResource.AzureResourceSubscription[] = [];
const subClient = new SubscriptionClient(credential);
const subClient = new SubscriptionClient.SubscriptionClient(credential);
const subs = await subClient.subscriptions.list();
subs.forEach((sub) => subscriptions.push({
id: sub.subscriptionId,

View File

@@ -47,5 +47,5 @@ export class AzureResourceAccountNotSignedInTreeNode extends TreeNode {
return 'message_accountNotSignedIn';
}
private static readonly signInLabel = localize('azure.resource.tree.accountNotSignedInTreeNode.signInLabel', "Sign in to Azure...");
private static readonly signInLabel = localize('azure.resource.tree.accountNotSignedInTreeNode.signInLabel', 'Sign in to Azure...');
}

View File

@@ -5,12 +5,11 @@
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Account, NodeInfo, AzureResource } from 'azdata';
import { TokenCredentials } from '@azure/ms-rest-js';
import { TokenCredentials } from 'ms-rest';
import { AppContext } from '../../appContext';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { AppContext } from '../../appContext';
import { azureResource } from '../azure-resource';
import { TreeNode } from '../treeNode';
import { AzureResourceCredentialError } from '../errors';
@@ -54,7 +53,7 @@ export class AzureResourceAccountTreeNode extends AzureResourceContainerTreeNode
subscriptions.push(...(await this._subscriptionService.getSubscriptions(this.account, new TokenCredentials(token, tokenType)) || <azureResource.AzureResourceSubscription[]>[]));
}
} catch (error) {
throw new AzureResourceCredentialError(localize('azure.resource.tree.accountTreeNode.credentialError', "Failed to get credential for account {0}. Please refresh the account.", this.account.key.accountId), error);
throw new AzureResourceCredentialError(localize('azure.resource.tree.accountTreeNode.credentialError', 'Failed to get credential for account {0}. Please refresh the account.', this.account.key.accountId), error);
}
this.updateCache<azureResource.AzureResourceSubscription[]>(subscriptions);
@@ -81,12 +80,11 @@ export class AzureResourceAccountTreeNode extends AzureResourceContainerTreeNode
if (subscriptions.length === 0) {
return [AzureResourceMessageTreeNode.create(AzureResourceAccountTreeNode.noSubscriptionsLabel, this)];
} else {
let subTreeNodes = await Promise.all(subscriptions.map(async (subscription) => {
return await Promise.all(subscriptions.map(async (subscription) => {
const tenantId = await this._tenantService.getTenantId(subscription);
return new AzureResourceSubscriptionTreeNode(this.account, subscription, tenantId, this.appContext, this.treeChangeHandler, this);
}));
return subTreeNodes.sort((a, b) => a.subscription.name.localeCompare(b.subscription.name));
}
} catch (error) {
if (error instanceof AzureResourceCredentialError) {
@@ -164,5 +162,5 @@ export class AzureResourceAccountTreeNode extends AzureResourceContainerTreeNode
private _totalSubscriptionCount = 0;
private _selectedSubscriptionCount = 0;
private static readonly noSubscriptionsLabel = localize('azure.resource.tree.accountTreeNode.noSubscriptionsLabel', "No Subscriptions found.");
}
private static readonly noSubscriptionsLabel = localize('azure.resource.tree.accountTreeNode.noSubscriptionsLabel', 'No Subscriptions found.');
}

View File

@@ -3,6 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Account, NodeInfo } from 'azdata';
import { AppContext } from '../../appContext';
@@ -52,7 +54,7 @@ export class AzureResourceSubscriptionTreeNode extends AzureResourceContainerTre
// To make tree node's id unique, otherwise, treeModel.js would complain 'item already registered'
child.resourceNode.treeItem.id = `${this._id}.${child.resourceNode.treeItem.id}`;
return new AzureResourceResourceTreeNode(child, this, this.appContext);
}).sort((a, b) => a.nodePathValue.localeCompare(b.nodePathValue));
});
}
} catch (error) {
return [AzureResourceMessageTreeNode.create(AzureResourceErrorMessageUtil.getErrorMessage(error), this)];
@@ -89,5 +91,5 @@ export class AzureResourceSubscriptionTreeNode extends AzureResourceContainerTre
private _id: string = undefined;
private static readonly noResourcesLabel = localize('azure.resource.tree.subscriptionTreeNode.noResourcesLabel', "No Resources found.");
private static readonly noResourcesLabel = localize('azure.resource.tree.subscriptionTreeNode.noResourcesLabel', 'No Resources found.');
}

View File

@@ -61,7 +61,7 @@ export class AzureResourceTreeProvider implements TreeDataProvider<TreeNode>, IA
if (!this.loadingAccountsPromise) {
this.loadingAccountsPromise = this.loadAccounts();
}
return [AzureResourceMessageTreeNode.create(localize('azure.resource.tree.treeProvider.loadingLabel', "Loading ..."), undefined)];
return [AzureResourceMessageTreeNode.create(localize('azure.resource.tree.treeProvider.loadingLabel', 'Loading ...'), undefined)];
}
try {

View File

@@ -14,7 +14,7 @@ export function getErrorMessage(error: Error | string): string {
export class AzureResourceErrorMessageUtil {
public static getErrorMessage(error: Error | string): string {
return localize('azure.resource.error', "Error: {0}", getErrorMessage(error));
return localize('azure.resource.error', 'Error: {0}', getErrorMessage(error));
}
}

View File

@@ -14,4 +14,4 @@ export enum BuiltInCommands {
SetContext = 'setContext'
}
export const extensionName = localize('extensionName', "Azure Accounts");
export const extensionName = localize('extensionName', 'Azure Accounts');

View File

@@ -26,11 +26,9 @@ import { AzureResourceSubscriptionFilterService } from './azureResource/services
import { AzureResourceCacheService } from './azureResource/services/cacheService';
import { AzureResourceTenantService } from './azureResource/services/tenantService';
import { registerAzureResourceCommands } from './azureResource/commands';
import { registerAzureResourceDatabaseServerCommands } from './azureResource/providers/databaseServer/commands';
import { registerAzureResourceDatabaseCommands } from './azureResource/providers/database/commands';
import { AzureResourceTreeProvider } from './azureResource/tree/treeProvider';
import { SqlInstanceResourceService } from './azureResource/providers/sqlinstance/sqlInstanceService';
import { SqlInstanceProvider } from './azureResource/providers/sqlinstance/sqlInstanceProvider';
import { PostgresServerProvider } from './azureResource/providers/postgresServer/postgresServerProvider';
import { PostgresServerService } from './azureResource/providers/postgresServer/postgresServerService';
let extensionContext: vscode.ExtensionContext;
@@ -67,20 +65,18 @@ export async function activate(context: vscode.ExtensionContext) {
}
// Create the provider service and activate
initAzureAccountProvider(extensionContext, storagePath).catch((err) => console.log(err));
initAzureAccountProvider(extensionContext, storagePath);
registerAzureServices(appContext);
const azureResourceTree = new AzureResourceTreeProvider(appContext);
pushDisposable(apiWrapper.registerTreeDataProvider('azureResourceExplorer', azureResourceTree));
registerAzureResourceCommands(appContext, azureResourceTree);
registerCommands(appContext, azureResourceTree);
return {
provideResources() {
return [
new AzureResourceDatabaseServerProvider(new AzureResourceDatabaseServerService(), apiWrapper, extensionContext),
new AzureResourceDatabaseProvider(new AzureResourceDatabaseService(), apiWrapper, extensionContext),
new SqlInstanceProvider(new SqlInstanceResourceService(), apiWrapper, extensionContext),
new PostgresServerProvider(new PostgresServerService(), apiWrapper, extensionContext)
new AzureResourceDatabaseProvider(new AzureResourceDatabaseService(), apiWrapper, extensionContext)
];
}
};
@@ -133,3 +129,10 @@ function registerAzureServices(appContext: AppContext): void {
appContext.registerService<IAzureResourceTenantService>(AzureResourceServiceNames.tenantService, new AzureResourceTenantService());
}
function registerCommands(appContext: AppContext, azureResourceTree: AzureResourceTreeProvider): void {
registerAzureResourceCommands(appContext, azureResourceTree);
registerAzureResourceDatabaseServerCommands(appContext);
registerAzureResourceDatabaseCommands(appContext);
}

View File

@@ -11,12 +11,13 @@ import 'mocha';
import { azureResource } from '../../../../azureResource/azure-resource';
import { ApiWrapper } from '../../../../apiWrapper';
import { IAzureResourceDatabaseService } from '../../../../azureResource/providers/database/interfaces';
import { AzureResourceDatabaseTreeDataProvider } from '../../../../azureResource/providers/database/databaseTreeDataProvider';
import { AzureResourceDatabase } from '../../../../azureResource/providers/database/models';
import { AzureResourceItemType } from '../../../../azureResource/constants';
import { IAzureResourceService, AzureResourceDatabase } from '../../../../azureResource/interfaces';
// Mock services
let mockDatabaseService: TypeMoq.IMock<IAzureResourceService<AzureResourceDatabase>>;
let mockDatabaseService: TypeMoq.IMock<IAzureResourceDatabaseService>;
let mockApiWrapper: TypeMoq.IMock<ApiWrapper>;
let mockExtensionContext: TypeMoq.IMock<vscode.ExtensionContext>;
@@ -79,7 +80,7 @@ const mockDatabases: AzureResourceDatabase[] = [
describe('AzureResourceDatabaseTreeDataProvider.info', function (): void {
beforeEach(() => {
mockDatabaseService = TypeMoq.Mock.ofType<IAzureResourceService<AzureResourceDatabase>>();
mockDatabaseService = TypeMoq.Mock.ofType<IAzureResourceDatabaseService>();
mockApiWrapper = TypeMoq.Mock.ofType<ApiWrapper>();
mockExtensionContext = TypeMoq.Mock.ofType<vscode.ExtensionContext>();
});
@@ -97,12 +98,12 @@ describe('AzureResourceDatabaseTreeDataProvider.info', function (): void {
describe('AzureResourceDatabaseTreeDataProvider.getChildren', function (): void {
beforeEach(() => {
mockDatabaseService = TypeMoq.Mock.ofType<IAzureResourceService<AzureResourceDatabase>>();
mockDatabaseService = TypeMoq.Mock.ofType<IAzureResourceDatabaseService>();
mockApiWrapper = TypeMoq.Mock.ofType<ApiWrapper>();
mockExtensionContext = TypeMoq.Mock.ofType<vscode.ExtensionContext>();
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
mockDatabaseService.setup((o) => o.getResources(mockSubscription, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockDatabases));
mockDatabaseService.setup((o) => o.getDatabases(mockSubscription, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockDatabases));
mockExtensionContext.setup((o) => o.asAbsolutePath(TypeMoq.It.isAnyString())).returns(() => TypeMoq.It.isAnyString());
});

View File

@@ -11,12 +11,13 @@ import 'mocha';
import { azureResource } from '../../../../azureResource/azure-resource';
import { ApiWrapper } from '../../../../apiWrapper';
import { IAzureResourceDatabaseServerService } from '../../../../azureResource/providers/databaseServer/interfaces';
import { AzureResourceDatabaseServerTreeDataProvider } from '../../../../azureResource/providers/databaseServer/databaseServerTreeDataProvider';
import { AzureResourceDatabaseServer } from '../../../../azureResource/providers/databaseServer/models';
import { AzureResourceItemType } from '../../../../azureResource/constants';
import { IAzureResourceService, AzureResourceDatabaseServer } from '../../../../azureResource/interfaces';
// Mock services
let mockDatabaseServerService: TypeMoq.IMock<IAzureResourceService<AzureResourceDatabaseServer>>;
let mockDatabaseServerService: TypeMoq.IMock<IAzureResourceDatabaseServerService>;
let mockApiWrapper: TypeMoq.IMock<ApiWrapper>;
let mockExtensionContext: TypeMoq.IMock<vscode.ExtensionContext>;
@@ -79,7 +80,7 @@ const mockDatabaseServers: AzureResourceDatabaseServer[] = [
describe('AzureResourceDatabaseServerTreeDataProvider.info', function (): void {
beforeEach(() => {
mockDatabaseServerService = TypeMoq.Mock.ofType<IAzureResourceService<AzureResourceDatabaseServer>>();
mockDatabaseServerService = TypeMoq.Mock.ofType<IAzureResourceDatabaseServerService>();
mockApiWrapper = TypeMoq.Mock.ofType<ApiWrapper>();
mockExtensionContext = TypeMoq.Mock.ofType<vscode.ExtensionContext>();
});
@@ -97,12 +98,12 @@ describe('AzureResourceDatabaseServerTreeDataProvider.info', function (): void {
describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function (): void {
beforeEach(() => {
mockDatabaseServerService = TypeMoq.Mock.ofType<IAzureResourceService<AzureResourceDatabaseServer>>();
mockDatabaseServerService = TypeMoq.Mock.ofType<IAzureResourceDatabaseServerService>();
mockApiWrapper = TypeMoq.Mock.ofType<ApiWrapper>();
mockExtensionContext = TypeMoq.Mock.ofType<vscode.ExtensionContext>();
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
mockDatabaseServerService.setup((o) => o.getResources(mockSubscription, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockDatabaseServers));
mockDatabaseServerService.setup((o) => o.getDatabaseServers(mockSubscription, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockDatabaseServers));
mockExtensionContext.setup((o) => o.asAbsolutePath(TypeMoq.It.isAnyString())).returns(() => TypeMoq.It.isAnyString());
});

View File

@@ -3,6 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as should from 'should';
import * as TypeMoq from 'typemoq';
import * as azdata from 'azdata';
@@ -177,4 +179,4 @@ describe('AzureResourceService.getTreeItem', function(): void {
fail();
});
});
});

Some files were not shown because too many files have changed in this diff Show More