Compare commits
340 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1263a27c1c | ||
|
|
e1c084d365 | ||
|
|
7465ec0bbd | ||
|
|
17ed57836f | ||
|
|
d0acb51fd7 | ||
|
|
71c1ed6c49 | ||
|
|
bfb68254a4 | ||
|
|
18f7662209 | ||
|
|
a0d84f383c | ||
|
|
1f447ae681 | ||
|
|
8bd6691331 | ||
|
|
42afcf9322 | ||
|
|
3d3694bb8d | ||
|
|
589b913960 | ||
|
|
7ba4f42494 | ||
|
|
c96118d2b5 | ||
|
|
0285d8cd38 | ||
|
|
ee87604a4d | ||
|
|
2235ebaf20 | ||
|
|
954d0d954f | ||
|
|
e31747d087 | ||
|
|
fc581253a4 | ||
|
|
47c4609f23 | ||
|
|
2d52bc2a49 | ||
|
|
5367101330 | ||
|
|
db145b4999 | ||
|
|
7f950ddb80 | ||
|
|
50e2251e74 | ||
|
|
33d5455b6f | ||
|
|
ac018500cd | ||
|
|
3e661db283 | ||
|
|
18fb78b3ec | ||
|
|
58ff13d399 | ||
|
|
0ac0175bb1 | ||
|
|
f39007cd2d | ||
|
|
2349aa4df8 | ||
|
|
a93a173183 | ||
|
|
42e55dd2dd | ||
|
|
ca3146d38f | ||
|
|
7f6cd514a5 | ||
|
|
88e24e92b5 | ||
|
|
8b447e361f | ||
|
|
a92dd2d4e4 | ||
|
|
852ec44567 | ||
|
|
b6e32cdeb4 | ||
|
|
4bd264d9be | ||
|
|
4a4b8574d0 | ||
|
|
ded073edd9 | ||
|
|
568f95e7a3 | ||
|
|
5adcabc8de | ||
|
|
e3bce7172c | ||
|
|
96fb618390 | ||
|
|
2d4fdcb661 | ||
|
|
7a84cff5b4 | ||
|
|
2af627b704 | ||
|
|
77fdf18686 | ||
|
|
944a77fe42 | ||
|
|
049678b32e | ||
|
|
3325e4d854 | ||
|
|
1e90e88d4b | ||
|
|
8aeb33c98c | ||
|
|
3b08721835 | ||
|
|
5a30878599 | ||
|
|
c8a8935db0 | ||
|
|
ec196f57bb | ||
|
|
f7809ec3a7 | ||
|
|
71d3ec3616 | ||
|
|
4a7cf8d870 | ||
|
|
4bf8836c0a | ||
|
|
1ca36ee29c | ||
|
|
3446ff88cf | ||
|
|
de5a91a13f | ||
|
|
814cd73019 | ||
|
|
c21611661b | ||
|
|
8f817ce689 | ||
|
|
971b5111e7 | ||
|
|
07069a64ae | ||
|
|
6acea51f12 | ||
|
|
7aa2dab307 | ||
|
|
3091be8f67 | ||
|
|
487531cc52 | ||
|
|
58bfcb4273 | ||
|
|
8d8be27f22 | ||
|
|
27a978cba5 | ||
|
|
71b4e6afa4 | ||
|
|
e1f3b19c0c | ||
|
|
649c2aa5a6 | ||
|
|
cac8cc99e1 | ||
|
|
cb162b16f2 | ||
|
|
86e54ce145 | ||
|
|
efd809971f | ||
|
|
38ae14cc4d | ||
|
|
c7e33a90fe | ||
|
|
5add835750 | ||
|
|
734c614cba | ||
|
|
f6b347fa62 | ||
|
|
08d2f3125e | ||
|
|
385c48dcad | ||
|
|
0926057bfe | ||
|
|
6912e3893e | ||
|
|
d3052657df | ||
|
|
a5ca4d8edf | ||
|
|
afb1ebebd5 | ||
|
|
a04a9eb5ad | ||
|
|
027badd21f | ||
|
|
1affc760e6 | ||
|
|
3ca72b7398 | ||
|
|
702dbddd78 | ||
|
|
8fbecc0227 | ||
|
|
421271acfa | ||
|
|
98af76b3ac | ||
|
|
3952fdbe2d | ||
|
|
bc13beaa85 | ||
|
|
59b2e706ca | ||
|
|
8bf835c531 | ||
|
|
087ed7c132 | ||
|
|
4c075df327 | ||
|
|
9ea8baca05 | ||
|
|
9b6784720e | ||
|
|
3761e1dd60 | ||
|
|
b3eb809550 | ||
|
|
cb72865dcc | ||
|
|
d646b4729b | ||
|
|
a2dd903d0d | ||
|
|
28ed378ee7 | ||
|
|
15ae55136f | ||
|
|
b18abd954f | ||
|
|
b45f79a1f8 | ||
|
|
01a03b4c84 | ||
|
|
e48328af34 | ||
|
|
8925d44807 | ||
|
|
213283510f | ||
|
|
9f8190dc28 | ||
|
|
c32d4ee2f7 | ||
|
|
2c867a4b2c | ||
|
|
da5194bdcb | ||
|
|
bbb27aed10 | ||
|
|
c02fbaeae7 | ||
|
|
847218da73 | ||
|
|
90dc788893 | ||
|
|
f3525cc555 | ||
|
|
198f243181 | ||
|
|
8e049f4af5 | ||
|
|
ff465a59b6 | ||
|
|
68b4f3ca04 | ||
|
|
6b31f2b3f2 | ||
|
|
63cf0f1548 | ||
|
|
e607f68b3e | ||
|
|
db3bb82dbd | ||
|
|
5889c600fa | ||
|
|
d7d4c7236c | ||
|
|
f54d8ce36f | ||
|
|
43faa13cb5 | ||
|
|
85a2d994f3 | ||
|
|
d8cd78cd6b | ||
|
|
3e59a5bcd2 | ||
|
|
0efb89d6ff | ||
|
|
6697c075cb | ||
|
|
06660160e7 | ||
|
|
0b571737b7 | ||
|
|
0a486a280d | ||
|
|
bd53e685d0 | ||
|
|
a2bbf3f44e | ||
|
|
410bb62906 | ||
|
|
cbb4ac3e20 | ||
|
|
7508192ab9 | ||
|
|
bbf6cbd8fb | ||
|
|
9765269d27 | ||
|
|
61746b7ff7 | ||
|
|
e6066c2cb5 | ||
|
|
633a918590 | ||
|
|
71c14a0837 | ||
|
|
9bbed2c275 | ||
|
|
d9ba4d9130 | ||
|
|
ecd40de7ec | ||
|
|
e2bd6c06ec | ||
|
|
a26be76d79 | ||
|
|
3b68c1eb69 | ||
|
|
f7879bdbf9 | ||
|
|
dbb0fc519f | ||
|
|
b931ccfabf | ||
|
|
eeab048f46 | ||
|
|
5da89ac05b | ||
|
|
e2b446be1c | ||
|
|
5f2e17a738 | ||
|
|
399d6d0045 | ||
|
|
f36f3ffd21 | ||
|
|
3c785ae7d8 | ||
|
|
00cd772cbc | ||
|
|
d434724a54 | ||
|
|
b6c9a3bb89 | ||
|
|
fc3bf45a7f | ||
|
|
cbf6c06e4b | ||
|
|
cff21124da | ||
|
|
ce7893c2e5 | ||
|
|
f7dcaa38ff | ||
|
|
8ce1013a26 | ||
|
|
114d67b408 | ||
|
|
56c2d16560 | ||
|
|
2238c42432 | ||
|
|
64f6cf6747 | ||
|
|
c0e9f1ca43 | ||
|
|
7f66087d8c | ||
|
|
18671b7cca | ||
|
|
233156c744 | ||
|
|
ac0ffab99c | ||
|
|
5e964d2105 | ||
|
|
59e7a5fa4b | ||
|
|
8452f577d2 | ||
|
|
726eb8d0e1 | ||
|
|
2c0d6b93ee | ||
|
|
98d06b2892 | ||
|
|
533f2734f1 | ||
|
|
856c19fa17 | ||
|
|
3237507bb2 | ||
|
|
ff5a248240 | ||
|
|
fc3bdc9037 | ||
|
|
533c0bf0b1 | ||
|
|
afb6862035 | ||
|
|
92d9d04a78 | ||
|
|
0704e5ee67 | ||
|
|
7dfcd89a04 | ||
|
|
2859bee4c0 | ||
|
|
724c49f5c4 | ||
|
|
48c4a473df | ||
|
|
3d39272536 | ||
|
|
0a63966cbd | ||
|
|
89e959c2e3 | ||
|
|
c56dd2cdbd | ||
|
|
363f28a46b | ||
|
|
5549f51a13 | ||
|
|
972f857c71 | ||
|
|
d2eb1488fd | ||
|
|
82486ee22e | ||
|
|
29cc57f52a | ||
|
|
f7d92caae5 | ||
|
|
201174e293 | ||
|
|
dc2f6235a1 | ||
|
|
0824c779db | ||
|
|
e002ad3b6a | ||
|
|
8a570069f8 | ||
|
|
bfe44c1621 | ||
|
|
b17882a1c1 | ||
|
|
f309979126 | ||
|
|
5a0490e81f | ||
|
|
2c007115f7 | ||
|
|
508e4eac61 | ||
|
|
ac47fb84a8 | ||
|
|
7ba14a3925 | ||
|
|
67514ccc5f | ||
|
|
6ee3886ecf | ||
|
|
76282ed1ef | ||
|
|
fd1d807012 | ||
|
|
906c4c7f39 | ||
|
|
bfa9e8c495 | ||
|
|
425eecf692 | ||
|
|
ac1f7542a9 | ||
|
|
225d168fdd | ||
|
|
e073b2cf42 | ||
|
|
1cb366d822 | ||
|
|
c9c8e30ced | ||
|
|
c50941ac7d | ||
|
|
58f950ffbd | ||
|
|
a1341ba503 | ||
|
|
620f4a8bfb | ||
|
|
668e43f57c | ||
|
|
7f11d44130 | ||
|
|
5c77e752f6 | ||
|
|
6d260c195f | ||
|
|
fdfecbb3f7 | ||
|
|
1d8132bcaa | ||
|
|
5f1bde5885 | ||
|
|
0adb025573 | ||
|
|
f8e7623f23 | ||
|
|
9243cceb9a | ||
|
|
5a62035ed7 | ||
|
|
c3a81b5bf3 | ||
|
|
34f6811eea | ||
|
|
c800e70ec1 | ||
|
|
7aa2ee08bf | ||
|
|
933aa88dc7 | ||
|
|
4b79ecc3d9 | ||
|
|
0bd179c6ca | ||
|
|
70141bd049 | ||
|
|
65cc585697 | ||
|
|
bd39468b96 | ||
|
|
dad831bc8c | ||
|
|
8a8745701b | ||
|
|
48b899b5d0 | ||
|
|
210447cd37 | ||
|
|
e672fbf6e2 | ||
|
|
004464c699 | ||
|
|
6f39a37656 | ||
|
|
b097b54792 | ||
|
|
0693080630 | ||
|
|
75d27837c2 | ||
|
|
597f29e90a | ||
|
|
a77bb50b9e | ||
|
|
3f84e8e652 | ||
|
|
1df7f25cad | ||
|
|
a0c30517bd | ||
|
|
dc36a9c3e7 | ||
|
|
0e61ad27da | ||
|
|
b3009c3366 | ||
|
|
810073a79b | ||
|
|
79c69d03fa | ||
|
|
22996da737 | ||
|
|
82d0b6c9f0 | ||
|
|
77c997b91e | ||
|
|
bb5d52d72c | ||
|
|
1474bab34a | ||
|
|
05f6f4ea5b | ||
|
|
05feb39501 | ||
|
|
ce92c3329b | ||
|
|
216b6eecc0 | ||
|
|
c0917e9276 | ||
|
|
0bbcbf0d2d | ||
|
|
9b998e3fca | ||
|
|
d7d65cdf21 | ||
|
|
27925289d4 | ||
|
|
03ea265bab | ||
|
|
917f9eead3 | ||
|
|
08f2e72af8 | ||
|
|
a2fb0ec029 | ||
|
|
084042ad13 | ||
|
|
8da3defe24 | ||
|
|
58f9cd32a5 | ||
|
|
f7abf5a2d5 | ||
|
|
c8c6d072f6 | ||
|
|
4d9cc604b9 | ||
|
|
1dc76fa171 | ||
|
|
1d37b9ae9c | ||
|
|
26828602a8 | ||
|
|
e253f3ac89 | ||
|
|
4d59fdea1b | ||
|
|
98a313eb5b | ||
|
|
77e1cd8b32 | ||
|
|
dede5c5ef5 | ||
|
|
d156c0be3d | ||
|
|
dc0bc6e606 |
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,13 +1,17 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please search existing issues to avoid creating duplicates. -->
|
||||
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed. -->
|
||||
|
||||
<!-- Use Help > Report Issue to prefill these. -->
|
||||
- SQL Operations Studio Version:
|
||||
- Azure Data Studio Version:
|
||||
|
||||
Steps to Reproduce:
|
||||
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution or feature you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
58
.travis.yml
@@ -1,58 +0,0 @@
|
||||
sudo: false
|
||||
language: cpp
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/yarn
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
webhooks:
|
||||
- http://vscode-probot.westus.cloudapp.azure.com:3450/travis/notifications
|
||||
- http://vscode-test-probot.westus.cloudapp.azure.com:3450/travis/notifications
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-4.9
|
||||
- g++-4.9
|
||||
- gcc-4.9-multilib
|
||||
- g++-4.9-multilib
|
||||
- zip
|
||||
- libgtk2.0-0
|
||||
- libx11-dev
|
||||
- libxkbfile-dev
|
||||
- libsecret-1-dev
|
||||
|
||||
before_install:
|
||||
- git submodule update --init --recursive
|
||||
- nvm install 8.9.1
|
||||
- nvm use 8.9.1
|
||||
- npm i -g yarn
|
||||
# - npm config set python `which python`
|
||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then
|
||||
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
|
||||
sh -e /etc/init.d/xvfb start;
|
||||
sleep 3;
|
||||
fi
|
||||
# Make npm logs less verbose
|
||||
# - npm config set depth 0
|
||||
# - npm config set loglevel warn
|
||||
|
||||
install:
|
||||
- yarn
|
||||
|
||||
script:
|
||||
- node_modules/.bin/gulp electron --silent
|
||||
- node_modules/.bin/gulp compile --silent --max_old_space_size=4096
|
||||
- node_modules/.bin/gulp optimize-vscode --silent --max_old_space_size=4096
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
|
||||
|
||||
after_success:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then node_modules/.bin/coveralls < .build/coverage/lcov.info; fi
|
||||
46
.vscode/launch.json
vendored
@@ -66,13 +66,13 @@
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"name": "Attach to sqlops",
|
||||
"name": "Attach to azuredatastudio",
|
||||
"port": 9222
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch sqlops",
|
||||
"name": "Launch azuredatastudio",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat"
|
||||
},
|
||||
@@ -90,7 +90,31 @@
|
||||
"**/winjs*.js"
|
||||
],
|
||||
"webRoot": "${workspaceFolder}",
|
||||
"timeout": 15000
|
||||
"timeout": 45000
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch azuredatastudio with new notebook command",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat"
|
||||
},
|
||||
"osx": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
||||
},
|
||||
"linux": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
||||
},
|
||||
"urlFilter": "*index.html*",
|
||||
"runtimeArgs": [
|
||||
"--inspect=5875",
|
||||
"--command=notebook.command.new"
|
||||
],
|
||||
"skipFiles": [
|
||||
"**/winjs*.js"
|
||||
],
|
||||
"webRoot": "${workspaceFolder}",
|
||||
"timeout": 45000
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
@@ -98,12 +122,12 @@
|
||||
"name": "Unit Tests",
|
||||
"protocol": "inspector",
|
||||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/SQL Operations Studio.app/Contents/MacOS/Electron",
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/Azure Data Studio.app/Contents/MacOS/Electron",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/sqlops.exe"
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio.exe"
|
||||
},
|
||||
"linux": {
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/sqlops"
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio"
|
||||
},
|
||||
"stopOnEntry": false,
|
||||
"outputCapture": "std",
|
||||
@@ -132,25 +156,25 @@
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Debug sqlops Main and Renderer",
|
||||
"name": "Debug azuredatastudio Main and Renderer",
|
||||
"configurations": [
|
||||
"Launch sqlops",
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Main Process"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search and Renderer processes",
|
||||
"configurations": [
|
||||
"Launch sqlops",
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Search Process"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Renderer and Extension Host processes",
|
||||
"configurations": [
|
||||
"Launch SQL Ops",
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Extension Host"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
2
.yarnrc
@@ -1,3 +1,3 @@
|
||||
disturl "https://atom.io/download/electron"
|
||||
target "2.0.8"
|
||||
target "2.0.9"
|
||||
runtime "electron"
|
||||
|
||||
97
CHANGELOG.md
@@ -1,5 +1,88 @@
|
||||
# Change Log
|
||||
|
||||
## Version 1.3.8
|
||||
* Release date: January 9, 2019
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* #13 Feature Request: Azure Active Directory Authentication
|
||||
* #1040 Stream initial query results as they become available
|
||||
* #3298 Сan't add an azure account.
|
||||
* #2387 Support Per-User Installer
|
||||
* SQL Server Import updates for DACPAC\BACPAC
|
||||
* SQL Server Profiler UI and UX improvements
|
||||
* Updates to [SQL Server 2019 extension](https://docs.microsoft.com/sql/azure-data-studio/sql-server-2019-extension?view=sql-server-ver15)
|
||||
* **sp_executesql to SQL** and **New Database** extensions
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* Tarig0 for `Add Routine_Type to CreateStoredProc fixes #3257 (#3286)`
|
||||
* oltruong for `typo fix #3025'`
|
||||
* Thomas-S-B for `Removed unnecessary IErrorDetectionStrategy #749`
|
||||
* Thomas-S-B for `Simplified code #750`
|
||||
|
||||
## Version 1.2.4
|
||||
* Release date: November 6, 2018
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Update to the SQL Server 2019 Preview extension
|
||||
* Introducing Paste the Plan extension
|
||||
* Introducing High Color queries extension, including SSMS editor theme
|
||||
* Fixes in SQL Server Agent, Profiler, and Import extensions
|
||||
* Fix .Net Core Socket KeepAlive issue causing dropped inactive connections on macOS
|
||||
* Upgrade SQL Tools Service to .Net Core 2.2 Preview 3 (for eventual AAD support)
|
||||
* Fix customer reported GitHub issues
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* rdaniels6813 for `Add query plan theme support #3031`
|
||||
* Ruturaj123 for `Fixed some typos and grammatical errors #3027`
|
||||
* PromoFaux for `Use emoji shortcodes in CONTRIBUTING.md instead of <20> #3009`
|
||||
* ckaczor for `Fix: DATETIMEOFFSET data types should be ISO formatted #714`
|
||||
* hi-im-T0dd for `Fixed sync issue with my forked master so this commit is correct #2948`
|
||||
* hi-im-T0dd for `Fixed when right clicking and selecting Manage-correct name displays #2794`
|
||||
|
||||
## Version 1.1.3
|
||||
* Release date: October 18, 2018
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Introducing the Azure Resource Explorer to browse Azure SQL Databases
|
||||
* Improve Object Explorer and Query Editor connectivity robustness
|
||||
* SQL Server 2019 and SQL Agent extension improvements
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* philoushka for `center the icon #2760`
|
||||
* anthonypants for `Typo #2775`
|
||||
* kstolte for `Fix Invalid Configuration in Launch.json #2789`
|
||||
* kstolte for `Fixing a reference to SQL Ops Studio #2788`
|
||||
|
||||
## Version 1.0.0
|
||||
* Release date: September 24, 2018
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Announcing the SQL Server 2019 Preview extension.
|
||||
* Support for SQL Server 2019 preview features including big data cluster support.
|
||||
* Azure Data Studio Notebooks
|
||||
* The Azure Resource Explorer viewlets you browse data-related endpoints for your Azure accounts and create connections to them in Object Explorer. In this release Azure SQL Databases and servers are supported.
|
||||
* SQL Server Polybase Create External Table Wizard
|
||||
* Query Results Grid performance and UX improvements for large number of result sets.
|
||||
* Visual Studio Code source code refresh from 1.23 to 1.26.1 with Grid Layout and Improved Settings Editor (preview).
|
||||
* Accessibility improvements for screen reader, keyboard navigation and high-contrast.
|
||||
* Added Connection name option to provide an alternative display name in the Servers viewlet.
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* AlexFsmn `Feature: Ability to add connection name #2332`
|
||||
* AlexFsmn `Disabled connection name input when connecting to a server. #2566`
|
||||
|
||||
## Version 0.33.7
|
||||
* Release date: August 30, 2018
|
||||
* Release status: Public Preview
|
||||
@@ -31,13 +114,13 @@ We would like to thank all our users who raised issues, and in particular the fo
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
* SQL Server Agent for SQL Operations Studio extension improvements
|
||||
* SQL Server Agent for Azure Data Studio extension improvements
|
||||
* Added view of Alerts, Operators, and Proxies and icons on left pane
|
||||
* Added dialogs for New Job, New Job Step, New Alert, and New Operator
|
||||
* Added Delete Job, Delete Alert, and Delete Operator (right-click)
|
||||
* Added Previous Runs visualization
|
||||
* Added Filters for each column name
|
||||
* SQL Server Profiler for SQL Operations Studio extension improvements
|
||||
* SQL Server Profiler for Azure Data Studio extension improvements
|
||||
* Added Hotkeys to quickly launch and start/stop Profiler
|
||||
* Added 5 Default Templates to view Extended Events
|
||||
* Added Server/Database connection name
|
||||
@@ -52,10 +135,10 @@ We would like to thank all our users who raised issues, and in particular the fo
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
* **SQL Server Profiler for SQL Operations Studio *Preview*** extension initial release
|
||||
* **SQL Server Profiler for Azure Data Studio *Preview*** extension initial release
|
||||
* The new **SQL Data Warehouse** extension includes rich customizable dashboard widgets surfacing insights to your data warehouse. This unlocks key scenarios around managing and tuning your data warehouse to ensure it is optimized for consistent performance.
|
||||
* **Edit Data "Filtering and Sorting"** support
|
||||
* **SQL Server Agent for SQL Operations Studio *Preview*** extension enhancements for Jobs and Job History views
|
||||
* **SQL Server Agent for Azure Data Studio *Preview*** extension enhancements for Jobs and Job History views
|
||||
* Improved **Wizard & Dialog UI Builder Framework** extensibility APIs
|
||||
* Update VS Code Platform source code integrating [March 2018 (1.22)](https://code.visualstudio.com/updates/v1_22) and [April 2018 (1.23)](https://code.visualstudio.com/updates/v1_23) releases
|
||||
* Fix GitHub Issues
|
||||
@@ -69,7 +152,7 @@ The May release is focused on stabilization and bug fixes leading up to the Buil
|
||||
|
||||
* Announcing **Redgate SQL Search** extension available in Extension Manager
|
||||
* Community Localization available for 10 languages: **German, Spanish, French, Italian, Japanese, Korean, Portuguese, Russian, Simplified Chinese and Traditional Chinese!**
|
||||
* Reduced telemetry collection, improved [opt-out](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Disable-Telemetry-Reporting) experience and in-product links to [Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement)
|
||||
* Reduced telemetry collection, improved [opt-out](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Disable-Telemetry-Reporting) experience and in-product links to [Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement)
|
||||
* Extension Manager has improved Marketplace experience to easily discover community extensions
|
||||
* SQL Agent extension Jobs and Job History view improvement
|
||||
* Updates for **whoisactive** and **Server Reports** extensions
|
||||
@@ -95,8 +178,8 @@ The April Public Preview release contains some of the following highlights.
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
The March Public Preview release enables some key aspects of the SQL Operations
|
||||
Studio extensibility story. Here are some highlights in this release.
|
||||
The March Public Preview release enables some key aspects of the Azure Data Studio
|
||||
extensibility story. Here are some highlights in this release.
|
||||
|
||||
* Enhance the Manage Dashboard extensibility model to support tabbed Insights and Configuration panes
|
||||
* Dashboard Insights extensions for `sp_whoisactive` from [whoisactive.com](http://whoisactive.com)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## Contributing Issues
|
||||
|
||||
### Before Submitting an Issue
|
||||
First, please do a search in [open issues](https://github.com/Microsoft/sqlopsstudio/issues) to see if the issue or feature request has already been filed. Use this [query](https://github.com/Microsoft/sqlopsstudio/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) to search for the most popular feature requests.
|
||||
First, please do a search in [open issues](https://github.com/Microsoft/azuredatastudio/issues) to see if the issue or feature request has already been filed. Use this [query](https://github.com/Microsoft/azuredatastudio/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) to search for the most popular feature requests.
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment.
|
||||
|
||||
<EFBFBD> - upvote
|
||||
:+1: - upvote
|
||||
|
||||
<EFBFBD> - downvote
|
||||
:-1: - downvote
|
||||
|
||||
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
|
||||
|
||||
@@ -18,29 +18,29 @@ File a single issue per problem and feature request.
|
||||
* Do not enumerate multiple bugs or feature requests in the same issue.
|
||||
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
|
||||
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
|
||||
Please include the following with each issue.
|
||||
Please include the following with each issue.
|
||||
|
||||
* Version of SQL Ops Studio
|
||||
* Version of Azure Data Studio (formerly SQL Operations Studio).
|
||||
|
||||
> **Tip:** You can easily create an issue using `Report Issues` from SQL Operations Studio Help menu.
|
||||
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.
|
||||
|
||||
* Reproducible steps (1... 2... 3...) and what you expected versus what you actually saw.
|
||||
* Images, animations, or a link to a video.
|
||||
* A code snippet that demonstrates the issue or a link to a code repository we can easily pull down onto our machine to recreate the issue.
|
||||
* Reproducible steps (1... 2... 3...) and what you expected versus what you actually saw.
|
||||
* Images, animations, or a link to a video.
|
||||
* A code snippet that demonstrates the issue or a link to a code repository we can easily pull down onto our machine to recreate the issue.
|
||||
|
||||
> **Note:** Because we need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
|
||||
> **Note:** Because we need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
|
||||
|
||||
* Errors in the Dev Tools Console (Help | Toggle Developer Tools)
|
||||
|
||||
Please remember to do the following:
|
||||
|
||||
* Search the issue repository to see if there exists a duplicate.
|
||||
* Simplify your scripts around the issue so we can better isolate the problem.
|
||||
* Search the issue repository to see if there exists a duplicate.
|
||||
* Simplify your scripts around the issue so we can better isolate the problem.
|
||||
|
||||
Don't feel bad if we can't reproduce the issue and ask for more information!
|
||||
|
||||
## Contributing Fixes
|
||||
If you are interested in fixing issues and contributing directly to the code base,
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute).
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MICROSOFT SOFTWARE LICENSE TERMS
|
||||
|
||||
MICROSOFT SQL OPERATIONS STUDIO
|
||||
MICROSOFT AZURE DATA STUDIO
|
||||
|
||||
Microsoft Corporation ("Microsoft") grants you a nonexclusive, perpetual,
|
||||
royalty-free right to use, copy, and modify the software code provided by us
|
||||
|
||||
81
README.md
@@ -1,25 +1,27 @@
|
||||
# SQL Operations Studio
|
||||
# Azure Data Studio
|
||||
|
||||
[](https://gitter.im/Microsoft/sqlopsstudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://dev.azure.com/ms/azuredatastudio/_build/latest?definitionId=4)
|
||||
|
||||
SQL Operations 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.
|
||||
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.
|
||||
|
||||
**Download SQL Operations Studio August Public Preview**
|
||||
**Download the latest Azure Data Studio release**
|
||||
|
||||
Platform | Link
|
||||
-- | --
|
||||
Windows Setup Installer | https://go.microsoft.com/fwlink/?linkid=2013365
|
||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2013712
|
||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2013715
|
||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2013718
|
||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2013830
|
||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2013833
|
||||
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2049972
|
||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2049975
|
||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2050146
|
||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2049981
|
||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2049986
|
||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2049989
|
||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2050157
|
||||
|
||||
Go to our [download page](https://aka.ms/sqlopsstudio) for more specific instructions.
|
||||
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
||||
|
||||
Try out the latest insiders build from `master` at https://github.com/Microsoft/sqlopsstudio/releases.
|
||||
Try out the latest insiders build from `master` at https://github.com/Microsoft/azuredatastudio/releases.
|
||||
|
||||
See the [change log](https://github.com/Microsoft/sqlopsstudio/blob/master/CHANGELOG.md) for additional details of what's in this release.
|
||||
See the [change log](https://github.com/Microsoft/azuredatastudio/blob/master/CHANGELOG.md) for additional details of what's in this release.
|
||||
|
||||
**Feature Highlights**
|
||||
|
||||
@@ -34,71 +36,86 @@ See the [change log](https://github.com/Microsoft/sqlopsstudio/blob/master/CHANG
|
||||
- Task History window to view current task execution status, completion results with error messages and task T-SQL scripting
|
||||
- Scripting support to generate CREATE, SELECT, ALTER and DROP statements for database objects
|
||||
- Workspaces with full Git integration and Find In Files support to managing T-SQL script libraries
|
||||
- Modern light-weight shell with theming, user settings, full screen support, integrated terminal and numerous other features
|
||||
- Modern light-weight shell with theming, user settings, full-screen support, integrated terminal and numerous other features
|
||||
|
||||
Here's some of these features in action.
|
||||
Here are some of these features in action.
|
||||
|
||||
<img src='https://github.com/Microsoft/sqlopsstudio/blob/master/docs/overview_screen.jpg' width='800px'>
|
||||
<img src='https://github.com/Microsoft/azuredatastudio/blob/master/docs/overview_screen.jpg' width='800px'>
|
||||
|
||||
## Contributing
|
||||
If you are interested in fixing issues and contributing directly to the code base,
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute), which covers the following:
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute), which covers the following:
|
||||
|
||||
* [How to build and run from source](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute#Build-and-Run-From-Source)
|
||||
* [The development workflow, including debugging and running tests](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute#development-workflow)
|
||||
* [Submitting pull requests](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute#pull-requests)
|
||||
* [How to build and run from source](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#Build-and-Run-From-Source)
|
||||
* [The development workflow, including debugging and running tests](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#development-workflow)
|
||||
* [Submitting pull requests](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#pull-requests)
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Localization
|
||||
SQL Operations Studio localization is now open for community contributions. You can contribute to localization for both software and docs. https://aka.ms/SQLOpsStudioLoc
|
||||
Azure Data Studio localization is now open for community contributions. You can contribute to localization for both software and docs. https://aka.ms/SQLOpsStudioLoc
|
||||
|
||||
Localization is now opened for 10 languages: French, Italian, German, Spanish, Simplified Chinese, Traditional Chinese, Japanese, Korean, Russian, and Portuguese (Brazil). Help us make SQL Operations Studio available in your language!
|
||||
Localization is now opened for 10 languages: French, Italian, German, Spanish, Simplified Chinese, Traditional Chinese, Japanese, Korean, Russian, and Portuguese (Brazil). Help us make Azure Data Studio available in your language!
|
||||
|
||||
## Privacy Statement
|
||||
The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement) describes the privacy statement of this software.
|
||||
|
||||
## Contributions and "thank you"
|
||||
## Contributions and "Thank You"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* Tarig0 for `Add Routine_Type to CreateStoredProc fixes #3257 (#3286)`
|
||||
* oltruong for `typo fix #3025'`
|
||||
* Thomas-S-B for `Removed unnecessary IErrorDetectionStrategy #749`
|
||||
* Thomas-S-B for `Simplified code #750`
|
||||
* rdaniels6813 for `Add query plan theme support #3031`
|
||||
* Ruturaj123 for `Fixed some typos and grammatical errors #3027`
|
||||
* PromoFaux for `Use emoji shortcodes in CONTRIBUTING.md instead of <20> #3009`
|
||||
* ckaczor for `Fix: DATETIMEOFFSET data types should be ISO formatted #714`
|
||||
* hi-im-T0dd for `Fixed sync issue with my forked master so this commit is correct #2948`
|
||||
* hi-im-T0dd for `Fixed when right clicking and selecting Manage-correct name displays #2794`
|
||||
* philoushka for `center the icon #2760`
|
||||
* anthonypants for `Typo #2775`
|
||||
* kstolte for `Fix Invalid Configuration in Launch.json #2789`
|
||||
* kstolte for `Fixing a reference to SQL Ops Studio #2788`
|
||||
* AlexFsmn `Feature: Ability to add connection name #2332`
|
||||
* AlexFsmn `Disabled connection name input when connecting to a server. #2566`
|
||||
* SebastianPfliegel `Added more saveAsCsv options #2099`
|
||||
* ianychoi `Fixes a typo: Mimunum -> Minimum #1994`
|
||||
* AlexFsmn `Fixed bug where proper file extension wasn't appended to filename. #2151`
|
||||
* AlexFsmn `Fixed bug where proper file extension wasn't appended to the filename. #2151`
|
||||
* AlexFsmn `Added functionality for adding any file to import wizard #2329`
|
||||
* AlexFsmn `Fixed background issue when copying a chart to clipboard #2215`
|
||||
* AlexFsmn `Fixed problem where vertical charts didn't display labels correctly. #2263`
|
||||
* AlexFsmn `Fixed Initial values for charts to match visuals #2266`
|
||||
* AlexFsmn `Renamed chart option labels #2264`
|
||||
* AlexFsmn `Added feature for opening file after exporting to CSV/XLS/JSON & query files #2216`
|
||||
* AlexFsmn `Added feature for the opening file after exporting to CSV/XLS/JSON & query files #2216`
|
||||
* AlexFsmm `Get Connection String should copy to clipboard #2175`
|
||||
* lanceklinger `Fix for double clicking column handle in results table #1504`
|
||||
* lanceklinger `Fix for double-clicking column handle in results table #1504`
|
||||
* westerncj for `Removed duplicate contribution from README.md (#753)`
|
||||
* ntovas for `Fix for duplicate extensions shown in "Save File" dialog. (#779)`
|
||||
* SebastianPfliegel for `Add cursor snippet (#475)`
|
||||
* mikaoelitiana for fix: `revert README and CONTRIBUTING after last VSCode merge (#574)`
|
||||
* mikaoelitiana for the fix: `revert README and CONTRIBUTING after last VSCode merge (#574)`
|
||||
* alextercete for `Reinstate menu item to install from VSIX (#682)`
|
||||
* alextercete for `Fix "No extension gallery service configured" error (#427)`
|
||||
* mwiedemeyer for `Fix #58: Default sort order for DB size widget (#111)`
|
||||
* AlexTroshkin for `Show disconnect in context menu only when connectionProfile connected (#150)`
|
||||
* AlexTroshkin for `Fix #138: Invalid syntax color highlighting (identity not highlighting) (#140))`
|
||||
* stebet for `Fix #153: Fixing sql snippets that failed on a DB with case-sensitive collation. (#152)`
|
||||
* stebet for `Fix #153: Fixing sql snippets that failed on a DB with a case-sensitive collation. (#152)`
|
||||
* SebastianPfliegel `Remove sqlExtensionHelp (#312)`
|
||||
* olljanat for `Implemented npm version check (#314)`
|
||||
* Adam Mechanic for helping with the `whoisactive` extension
|
||||
* All community localization contributors
|
||||
* Adam Machanic for helping with the `whoisactive` extension
|
||||
* All community localization contributors:
|
||||
* French: Adrien Clerbois, ANAS BELABBES, Antoine Griffard, Arian Papillon, Eric Macarez, Eric Van Thorre, Jérémy LANDON, Matthias GROSPERRIN, Maxime COQUEREL, Olivier Guinart, thierry DEMAN-BARCELÒ, Thomas Potier
|
||||
* Italian: Aldo Donetti, Alessandro Alpi, Andrea Dottor, Bruni Luca, Gianluca Hotz, Luca Nardi, Luigi Bruno, Marco Dal Pino, Mirco Vanini, Pasquale Ceglie, Riccardo Cappello, Sergio Govoni, Stefano Demiliani
|
||||
* German: Anna Henke-Gunvaldson, Ben Weissman, David Ullmer, J.M. ., Kai Modo, Konstantin Staschill, Kostja Klein, Lennart Trunk, Markus Ehrenmüller-Jensen, Mascha Kroenlein, Matthias Knoll, Mourad Louha, Thomas Hütter, Wolfgang Straßer
|
||||
* Spanish: Alberto Poblacion, Andy Gonzalez, Carlos Mendible, Christian Araujo, Daniel D, Eickhel Mendoza, Ernesto Cardenas, Ivan Toledo Ivanovic, Fran Diaz, JESUS GIL, Jorge Serrano Pérez, José Saturnino Pimentel Juárez, Mauricio Hidalgo, Pablo Iglesias, Rikhardo Estrada Rdez, Thierry DEMAN, YOLANDA CUESTA ALTIERI
|
||||
* Japanese: Fujio Kojima, Kazushi KAMEGAWA, Masayoshi Yamada, Masayuki Ozawa , Seiji Momoto, Takashi Kanai, Takayoshi Tanaka, Yoshihisa Ozaki, 庄垣内治
|
||||
* Japanese: Fujio Kojima, Kazushi KAMEGAWA, Masayoshi Yamada, Masayuki Ozawa, Seiji Momoto, Takashi Kanai, Takayoshi Tanaka, Yoshihisa Ozaki, 庄垣内治
|
||||
* Chinese (simplified): DAN YE, Joel Yang, Lynne Dong, Ryan(Yu) Zhang, Sheng Jiang, Wei Zhang, Zhiliang Xu
|
||||
* Chinese (Traditional): Bruce Chen, Chiayi Yen, Kevin Yang, Winnie Lin, 保哥 Will, 謝政廷
|
||||
* Korean: Do-Kyun Kim, Evelyn Kim, Helen Jung, Hong Jmee, jeongwoo choi, Jun Hyoung Lee, Jungsun Kim정선, Justin Yoo, Kavrith mucha, Kiwoong Youm, MinGyu Ju, MVP_JUNO BEA, Sejun Kim, SOONMAN KWON, sung man ko, Yeongrak Choi, younggun kim, Youngjae Kim, 소영 이
|
||||
* Russian: Andrey Veselov, Anton Fontanov, Anton Savin, Elena Ostrovskaia, Igor Babichev, Maxim Zelensky, Rodion Fedechkin, Tasha T, Vladimir Zyryanov
|
||||
* Portuguese Brazil: Daniel de Sousa, Diogo Duarte, Douglas Correa, Douglas Eccker, José Emanuel Mendes, Marcelo Fernandes, Marcondes Alexandre, Roberto Fonseca, Rodrigo Crespi
|
||||
|
||||
|
||||
And of course we'd like to thank the authors of all upstream dependencies. Please see a full list in the [ThirdPartyNotices.txt](https://raw.githubusercontent.com/Microsoft/sqlopsstudio/master/ThirdPartyNotices.txt)
|
||||
And of course, we'd like to thank the authors of all upstream dependencies. Please see a full list in the [ThirdPartyNotices.txt](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/ThirdPartyNotices.txt)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
MICROSOFT SQL OPERATIONS STUDIO
|
||||
MICROSOFT Azure Data Studio
|
||||
|
||||
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
@@ -21,6 +21,7 @@ expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
error-ex: https://github.com/Qix-/node-error-ex
|
||||
escape-string-regexp: https://github.com/sindresorhus/escape-string-regexp
|
||||
fast-plist: https://github.com/Microsoft/node-fast-plist
|
||||
find-remove: https://www.npmjs.com/package/find-remove
|
||||
fs-extra: https://github.com/jprichardson/node-fs-extra
|
||||
gc-signals: https://github.com/Microsoft/node-gc-signals
|
||||
getmac: https://github.com/bevry/getmac
|
||||
@@ -33,6 +34,7 @@ expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
jquery-ui: https://github.com/jquery/jquery-ui
|
||||
jquery.event.drag: https://github.com/devongovett/jquery.event.drag
|
||||
jschardet: https://github.com/aadsm/jschardet
|
||||
JupyterLab: https://github.com/jupyterlab/jupyterlab
|
||||
make-error: https://github.com/JsCommunity/make-error
|
||||
minimist: https://github.com/substack/minimist
|
||||
moment: https://github.com/moment/moment
|
||||
@@ -1165,6 +1167,43 @@ That's all there is to it!
|
||||
=========================================
|
||||
END OF jschardet NOTICES AND INFORMATION
|
||||
|
||||
%% JupyterLab NOTICES AND INFORMATION BEGIN HERE
|
||||
Copyright (c) 2015 Project Jupyter Contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Semver File License
|
||||
===================
|
||||
|
||||
The semver.py file is from https://github.com/podhmo/python-semver
|
||||
which is licensed under the "MIT" license. See the semver.py file for details.
|
||||
|
||||
END OF JupyterLab NOTICES AND INFORMATION
|
||||
|
||||
%% make-error NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
ISC © Julien Fontanet
|
||||
|
||||
19
appveyor.yml
@@ -1,19 +0,0 @@
|
||||
environment:
|
||||
ELECTRON_RUN_AS_NODE: 1
|
||||
VSCODE_BUILD_VERBOSE: true
|
||||
|
||||
cache:
|
||||
- '%LOCALAPPDATA%\Yarn\cache'
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 8.9.1 x64
|
||||
|
||||
build_script:
|
||||
- yarn
|
||||
- .\node_modules\.bin\gulp electron
|
||||
- npm run compile
|
||||
|
||||
test_script:
|
||||
- node --version
|
||||
- .\scripts\test.bat
|
||||
- .\scripts\test-integration.bat
|
||||
42
azure-pipelines-linux-mac.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '8.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: |
|
||||
git submodule update --init --recursive
|
||||
nvm install 8.9.1
|
||||
nvm use 8.9.1
|
||||
npm i -g yarn
|
||||
displayName: 'preinstall'
|
||||
|
||||
- script: |
|
||||
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
|
||||
sh -e /etc/init.d/xvfb start
|
||||
sleep 3
|
||||
displayName: 'Linux preinstall'
|
||||
condition: eq(variables['Agent.OS'], 'Linux')
|
||||
|
||||
- script: |
|
||||
yarn
|
||||
displayName: 'Install'
|
||||
|
||||
- script: |
|
||||
node_modules/.bin/gulp electron --silent
|
||||
node_modules/.bin/gulp compile --silent --max_old_space_size=4096
|
||||
node_modules/.bin/gulp optimize-vscode --silent --max_old_space_size=4096
|
||||
displayName: 'Scripts'
|
||||
|
||||
- script: |
|
||||
./scripts/test.sh --reporter mocha-junit-reporter
|
||||
displayName: 'Tests'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: '**/test-results.xml'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- script: |
|
||||
yarn run tslint
|
||||
displayName: 'Run TSLint'
|
||||
30
azure-pipelines-windows.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '8.9'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: |
|
||||
yarn
|
||||
displayName: 'Yarn Install'
|
||||
|
||||
- script: |
|
||||
.\node_modules\.bin\gulp electron
|
||||
displayName: 'Electron'
|
||||
|
||||
- script: |
|
||||
npm run compile
|
||||
displayName: 'Compile'
|
||||
|
||||
- script: |
|
||||
.\scripts\test.bat --reporter mocha-junit-reporter
|
||||
displayName: 'Test'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: 'test-results.xml'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- script: |
|
||||
yarn run tslint
|
||||
displayName: 'Run TSLint'
|
||||
29
azure-pipelines.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
trigger:
|
||||
- master
|
||||
- releases/*
|
||||
|
||||
jobs:
|
||||
|
||||
# All tasks on Windows
|
||||
- job: build_all_windows
|
||||
displayName: Build all tasks (Windows)
|
||||
pool:
|
||||
vmImage: vs2017-win2016
|
||||
steps:
|
||||
- template: azure-pipelines-windows.yml
|
||||
|
||||
# All tasks on Linux
|
||||
- job: build_all_linux
|
||||
displayName: Build all tasks (Linux)
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
steps:
|
||||
- template: azure-pipelines-linux-mac.yml
|
||||
|
||||
# All tasks on macOS
|
||||
- job: build_all_darwin
|
||||
displayName: Build all tasks (macOS)
|
||||
pool:
|
||||
vmImage: macos-10.13
|
||||
steps:
|
||||
- template: azure-pipelines-linux-mac.yml
|
||||
@@ -76,6 +76,7 @@ const sqlBuiltInExtensions = [
|
||||
'import',
|
||||
'profiler'
|
||||
];
|
||||
var azureExtensions = [ 'azurecore'];
|
||||
|
||||
const vscodeEntryPoints = _.flatten([
|
||||
buildfile.entrypoint('vs/workbench/workbench.main'),
|
||||
@@ -128,6 +129,7 @@ const vscodeResources = [
|
||||
'out-build/sql/parts/jobManagement/common/media/*.svg',
|
||||
'out-build/sql/media/objectTypes/*.svg',
|
||||
'out-build/sql/media/icons/*.svg',
|
||||
'out-build/sql/parts/notebook/media/**/*.svg',
|
||||
'!**/test/**'
|
||||
];
|
||||
|
||||
@@ -208,7 +210,7 @@ function getElectron(arch) {
|
||||
});
|
||||
|
||||
return gulp.src('package.json')
|
||||
.pipe(json({ name: product.nameShort }))
|
||||
.pipe(json({ name: product.nameShort }))
|
||||
.pipe(electron(electronOpts))
|
||||
.pipe(filter(['**', '!**/app/package.json']))
|
||||
.pipe(vfs.dest('.build/electron'));
|
||||
@@ -276,11 +278,45 @@ function packageBuiltInExtensions() {
|
||||
});
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
function packageAzureCoreTask(platform, arch) {
|
||||
var destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
if (platform === 'darwin') {
|
||||
destination = path.join(destination, 'Azure Data Studio.app', 'Contents', 'Resources', 'app', 'extensions', 'azurecore');
|
||||
} else {
|
||||
destination = path.join(destination, 'resources', 'app', 'extensions', 'azurecore');
|
||||
}
|
||||
|
||||
platform = platform || process.platform;
|
||||
|
||||
return () => {
|
||||
const root = path.resolve(path.join(__dirname, '..'));
|
||||
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => azureExtensions.indexOf(name) > -1);
|
||||
|
||||
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
|
||||
return ext.fromLocal(extension.path);
|
||||
}));
|
||||
|
||||
let result = localExtensions
|
||||
.pipe(util.skipDirectories())
|
||||
.pipe(util.fixWin32DirectoryPermissions())
|
||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||
|
||||
return result.pipe(vfs.dest(destination));
|
||||
};
|
||||
}
|
||||
|
||||
function packageTask(platform, arch, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const destination = path.join(path.dirname(root), 'sqlops') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
const destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
platform = platform || process.platform;
|
||||
|
||||
return () => {
|
||||
@@ -307,8 +343,10 @@ function packageTask(platform, arch, opts) {
|
||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||
packageBuiltInExtensions();
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
||||
|
||||
packageBuiltInExtensions();
|
||||
|
||||
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
|
||||
return ext.fromLocal(extension.path)
|
||||
@@ -325,7 +363,6 @@ function packageTask(platform, arch, opts) {
|
||||
.pipe(util.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('typescript', ['**/**'], undefined));
|
||||
|
||||
|
||||
const sources = es.merge(src, localExtensions, localExtensionDependencies)
|
||||
.pipe(util.setExecutableBit(['**/*.sh']))
|
||||
.pipe(filter(['**', '!**/*.js.map']));
|
||||
@@ -338,7 +375,8 @@ function packageTask(platform, arch, opts) {
|
||||
version += '-' + quality;
|
||||
}
|
||||
|
||||
const name = product.nameShort;
|
||||
// {{SQL CARBON EDIT}}
|
||||
const name = (platform === 'darwin') ? 'Azure Data Studio' : product.nameShort;
|
||||
const packageJsonStream = gulp.src(['package.json'], { base: '.' })
|
||||
.pipe(json({ name, version }));
|
||||
|
||||
@@ -460,18 +498,22 @@ function packageTask(platform, arch, opts) {
|
||||
const buildRoot = path.dirname(root);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'sqlops-win32-ia32')));
|
||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'sqlops-win32-x64')));
|
||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'sqlops-darwin')));
|
||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'sqlops-linux-ia32')));
|
||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'sqlops-linux-x64')));
|
||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'sqlops-linux-arm')));
|
||||
gulp.task('vscode-win32-x64-azurecore', ['optimize-vscode'], packageAzureCoreTask('win32', 'x64'));
|
||||
gulp.task('vscode-darwin-azurecore', ['optimize-vscode'], packageAzureCoreTask('darwin'));
|
||||
gulp.task('vscode-linux-x64-azurecore', ['optimize-vscode'], packageAzureCoreTask('linux', 'x64'));
|
||||
|
||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-ia32')));
|
||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-x64')));
|
||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'azuredatastudio-darwin')));
|
||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-ia32')));
|
||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-x64')));
|
||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm')));
|
||||
|
||||
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32'));
|
||||
gulp.task('vscode-win32-x64', ['optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
||||
gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin'));
|
||||
gulp.task('vscode-win32-x64', ['vscode-win32-x64-azurecore', 'optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
||||
gulp.task('vscode-darwin', ['vscode-darwin-azurecore', 'optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin'));
|
||||
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
|
||||
gulp.task('vscode-linux-x64', ['optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
||||
gulp.task('vscode-linux-x64', ['vscode-linux-x64-azurecore', 'optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
||||
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
|
||||
|
||||
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
|
||||
|
||||
@@ -24,7 +24,7 @@ function getDebPackageArch(arch) {
|
||||
|
||||
function prepareDebPackage(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../sqlops-linux-' + arch;
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const debArch = getDebPackageArch(arch);
|
||||
const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch;
|
||||
|
||||
@@ -104,7 +104,7 @@ function getRpmPackageArch(arch) {
|
||||
|
||||
function prepareRpmPackage(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../sqlops-linux-' + arch;
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const rpmArch = getRpmPackageArch(arch);
|
||||
|
||||
return function () {
|
||||
@@ -213,7 +213,7 @@ function getFlatpakArch(arch) {
|
||||
|
||||
function prepareFlatpak(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../sqlops-linux-' + arch;
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const flatpakArch = getFlatpakArch(arch);
|
||||
const destination = '.build/linux/flatpak/' + flatpakArch;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ const mkdirp = require('mkdirp');
|
||||
|
||||
const repoPath = path.dirname(__dirname);
|
||||
// {{SQL CARBON EDIT}}
|
||||
const buildPath = arch => path.join(path.dirname(repoPath), `sqlops-win32-${arch}`);
|
||||
const buildPath = arch => path.join(path.dirname(repoPath), `azuredatastudio-win32-${arch}`);
|
||||
const zipDir = arch => path.join(repoPath, '.build', `win32-${arch}`, 'archive');
|
||||
const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`);
|
||||
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "sqlops-oss-dev-build",
|
||||
"name": "azuredatastudio-oss-dev-build",
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"@types/azure": "0.9.19",
|
||||
@@ -7,21 +7,23 @@
|
||||
"@types/es6-collections": "0.5.31",
|
||||
"@types/es6-promise": "0.0.33",
|
||||
"@types/mime": "0.0.29",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"@types/node": "8.0.33",
|
||||
"@types/xml2js": "0.0.33",
|
||||
"@types/request": "^2.47.0",
|
||||
"@types/xml2js": "0.0.33",
|
||||
"azure-storage": "^2.1.0",
|
||||
"decompress": "^4.2.0",
|
||||
"del": "^3.0.0",
|
||||
"documentdb": "1.13.0",
|
||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
||||
"fs-extra-promise": "^1.0.1",
|
||||
"github-releases": "^0.4.1",
|
||||
"mime": "^1.3.4",
|
||||
"minimist": "^1.2.0",
|
||||
"request": "^2.85.0",
|
||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
||||
"typescript": "2.9.2",
|
||||
"vscode": "^1.0.1",
|
||||
"xml2js": "^0.4.17",
|
||||
"github-releases": "^0.4.1",
|
||||
"request": "^2.85.0"
|
||||
"xml2js": "^0.4.17"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "tsc -p tsconfig.build.json",
|
||||
@@ -29,4 +31,4 @@
|
||||
"postinstall": "npm run compile",
|
||||
"npmCheckJs": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@ AppId={#AppId}
|
||||
AppName={#NameLong}
|
||||
AppVerName={#NameVersion}
|
||||
AppPublisher=Microsoft Corporation
|
||||
AppPublisherURL=https://github.com/Microsoft/sqlopsstudio
|
||||
AppSupportURL=https://github.com/Microsoft/sqlopsstudio
|
||||
AppUpdatesURL=https://github.com/Microsoft/sqlopsstudio
|
||||
AppPublisherURL=https://github.com/Microsoft/azuredatastudio
|
||||
AppSupportURL=https://github.com/Microsoft/azuredatastudio
|
||||
AppUpdatesURL=https://github.com/Microsoft/azuredatastudio
|
||||
|
||||
DefaultGroupName={#NameLong}
|
||||
AllowNoIcons=yes
|
||||
OutputDir={#OutputDir}
|
||||
OutputBaseFilename=SqlOpsStudioSetup
|
||||
OutputBaseFilename=AzureDataStudioSetup
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
AppMutex={code:GetAppMutex}
|
||||
@@ -68,7 +68,7 @@ Type: filesandordirs; Name: "{app}\_"
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce; Check: IsNotUpdate
|
||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
|
||||
Name: "associatewithfiles"; Description: "{cm:AssociateWithFiles,{#NameShort}}"; GroupDescription: "{cm:Other}"; Flags: unchecked
|
||||
Name: "associatewithfiles"; Description: "{cm:AssociateWithFiles,{#NameLong}}"; GroupDescription: "{cm:Other}"; Flags: unchecked
|
||||
Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
|
||||
Name: "runcode"; Description: "{cm:RunAfter,{#NameShort}}"; GroupDescription: "{cm:Other}"; Check: WizardSilent
|
||||
|
||||
@@ -91,17 +91,17 @@ Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong
|
||||
#else
|
||||
#define SoftwareClassesRootKey "HKLM"
|
||||
#endif
|
||||
Root: HKCR; Subkey: "{#RegValueName}SourceFile"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,{#NameLong}}"; Flags: uninsdeletekey
|
||||
Root: HKCR; Subkey: "{#RegValueName}SourceFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico"
|
||||
Root: HKCR; Subkey: "{#RegValueName}SourceFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}SourceFile"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,{#NameLong}}"; Flags: uninsdeletekey
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}SourceFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico"
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}SourceFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""
|
||||
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Tasks: addtopath; Check: NeedsAddPath(ExpandConstant('{app}\bin'))
|
||||
|
||||
Root: HKCU; Subkey: "Software\Classes\.sql\OpenWithProgids"; ValueType: none; ValueName: "{#RegValueName}"; Flags: deletevalue uninsdeletevalue; Tasks: associatewithfiles
|
||||
Root: HKCU; Subkey: "Software\Classes\.sql\OpenWithProgids"; ValueType: string; ValueName: "{#RegValueName}.sql"; ValueData: ""; Flags: uninsdeletevalue; Tasks: associatewithfiles
|
||||
Root: HKCU; Subkey: "Software\Classes\{#RegValueName}.sql"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,SQL}"; Flags: uninsdeletekey; Tasks: associatewithfiles
|
||||
Root: HKCU; Subkey: "Software\Classes\{#RegValueName}.sql"; ValueType: string; ValueName: "AppUserModelID"; ValueData: "{#AppUserId}"; Flags: uninsdeletekey; Tasks: associatewithfiles
|
||||
Root: HKCU; Subkey: "Software\Classes\{#RegValueName}.sql\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico"; Tasks: associatewithfiles
|
||||
Root: HKCU; Subkey: "Software\Classes\{#RegValueName}.sql\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\.sql\OpenWithProgids"; ValueType: none; ValueName: "{#RegValueName}"; Flags: deletevalue uninsdeletevalue; Tasks: associatewithfiles
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\.sql\OpenWithProgids"; ValueType: string; ValueName: "{#RegValueName}.sql"; ValueData: ""; Flags: uninsdeletevalue; Tasks: associatewithfiles
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,SQL}"; Flags: uninsdeletekey; Tasks: associatewithfiles
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql"; ValueType: string; ValueName: "AppUserModelID"; ValueData: "{#AppUserId}"; Flags: uninsdeletekey; Tasks: associatewithfiles
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico"; Tasks: associatewithfiles
|
||||
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles
|
||||
; Environment
|
||||
#if "user" == InstallTarget
|
||||
#define EnvironmentRootKey "HKCU"
|
||||
@@ -180,9 +180,9 @@ begin
|
||||
Result := not IsBackgroundUpdate();
|
||||
end;
|
||||
|
||||
// SqlOps will create a flag file before the update starts (/update=C:\foo\bar)
|
||||
// - if the file exists at this point, the user quit SqlOps before the update finished, so don't start SqlOps after update
|
||||
// - otherwise, the user has accepted to apply the update and SqlOps should start
|
||||
// AzureDataStudio will create a flag file before the update starts (/update=C:\foo\bar)
|
||||
// - if the file exists at this point, the user quit AzureDataStudio before the update finished, so don't start AzureDataStudio after update
|
||||
// - otherwise, the user has accepted to apply the update and AzureDataStudio should start
|
||||
function LockFileExists(): Boolean;
|
||||
begin
|
||||
Result := FileExists(ExpandConstant('{param:update}'))
|
||||
|
||||
459
build/yarn.lock
1
docs/UX-Design-Guidelines.md
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
src/**
|
||||
tsconfig.json
|
||||
npm-shrinkwrap.json
|
||||
348
extensions/account-provider-azure/npm-shrinkwrap.json
generated
@@ -1,348 +0,0 @@
|
||||
{
|
||||
"name": "account-provider-azure",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "8.5.1",
|
||||
"from": "@types/node@>=8.0.47 <9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.5.1.tgz"
|
||||
},
|
||||
"adal-node": {
|
||||
"version": "0.1.25",
|
||||
"from": "adal-node@0.1.25",
|
||||
"resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.25.tgz"
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"from": "ansi-regex@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz"
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "2.2.1",
|
||||
"from": "ansi-styles@>=2.2.1 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz"
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.1.11",
|
||||
"from": "asn1@0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
|
||||
},
|
||||
"assert-plus": {
|
||||
"version": "0.1.5",
|
||||
"from": "assert-plus@>=0.1.5 <0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz"
|
||||
},
|
||||
"async": {
|
||||
"version": "2.6.0",
|
||||
"from": "async@>=0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz"
|
||||
},
|
||||
"aws-sign2": {
|
||||
"version": "0.5.0",
|
||||
"from": "aws-sign2@>=0.5.0 <0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
|
||||
},
|
||||
"base64url": {
|
||||
"version": "2.0.0",
|
||||
"from": "base64url@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz"
|
||||
},
|
||||
"bl": {
|
||||
"version": "1.0.3",
|
||||
"from": "bl@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bl/-/bl-1.0.3.tgz"
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "2.11.0",
|
||||
"from": "bluebird@>=2.9.30 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz"
|
||||
},
|
||||
"boom": {
|
||||
"version": "2.10.1",
|
||||
"from": "boom@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz"
|
||||
},
|
||||
"buffer-equal-constant-time": {
|
||||
"version": "1.0.1",
|
||||
"from": "buffer-equal-constant-time@1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz"
|
||||
},
|
||||
"caseless": {
|
||||
"version": "0.11.0",
|
||||
"from": "caseless@>=0.11.0 <0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz"
|
||||
},
|
||||
"chalk": {
|
||||
"version": "1.1.3",
|
||||
"from": "chalk@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz"
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.5",
|
||||
"from": "combined-stream@>=1.0.1 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz"
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.12.2",
|
||||
"from": "commander@>=2.8.1 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz"
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"from": "core-util-is@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
|
||||
},
|
||||
"cryptiles": {
|
||||
"version": "2.0.5",
|
||||
"from": "cryptiles@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz"
|
||||
},
|
||||
"ctype": {
|
||||
"version": "0.5.3",
|
||||
"from": "ctype@0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz"
|
||||
},
|
||||
"date-utils": {
|
||||
"version": "1.2.21",
|
||||
"from": "date-utils@*",
|
||||
"resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz"
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"from": "delayed-stream@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
|
||||
},
|
||||
"ecdsa-sig-formatter": {
|
||||
"version": "1.0.9",
|
||||
"from": "ecdsa-sig-formatter@1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz"
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"from": "escape-string-regexp@>=1.0.2 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.1",
|
||||
"from": "extend@>=3.0.0 <3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz"
|
||||
},
|
||||
"forever-agent": {
|
||||
"version": "0.6.1",
|
||||
"from": "forever-agent@>=0.6.0 <0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
|
||||
},
|
||||
"form-data": {
|
||||
"version": "1.0.1",
|
||||
"from": "form-data@>=1.0.0-rc1 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz"
|
||||
},
|
||||
"generate-function": {
|
||||
"version": "2.0.0",
|
||||
"from": "generate-function@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"
|
||||
},
|
||||
"generate-object-property": {
|
||||
"version": "1.2.0",
|
||||
"from": "generate-object-property@>=1.1.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz"
|
||||
},
|
||||
"har-validator": {
|
||||
"version": "1.8.0",
|
||||
"from": "har-validator@>=1.6.1 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz"
|
||||
},
|
||||
"has-ansi": {
|
||||
"version": "2.0.0",
|
||||
"from": "has-ansi@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz"
|
||||
},
|
||||
"hawk": {
|
||||
"version": "3.1.3",
|
||||
"from": "hawk@>=3.1.0 <3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz"
|
||||
},
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"from": "hoek@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz"
|
||||
},
|
||||
"http-signature": {
|
||||
"version": "0.11.0",
|
||||
"from": "http-signature@>=0.11.0 <0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.11.0.tgz"
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"from": "inherits@>=2.0.1 <2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
|
||||
},
|
||||
"is-my-json-valid": {
|
||||
"version": "2.17.1",
|
||||
"from": "is-my-json-valid@>=2.12.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz"
|
||||
},
|
||||
"is-property": {
|
||||
"version": "1.0.2",
|
||||
"from": "is-property@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"from": "isarray@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
|
||||
},
|
||||
"isstream": {
|
||||
"version": "0.1.2",
|
||||
"from": "isstream@>=0.1.1 <0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
|
||||
},
|
||||
"json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
|
||||
},
|
||||
"jsonpointer": {
|
||||
"version": "4.0.1",
|
||||
"from": "jsonpointer@>=4.0.0 <5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz"
|
||||
},
|
||||
"jwa": {
|
||||
"version": "1.1.5",
|
||||
"from": "jwa@>=1.1.4 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz"
|
||||
},
|
||||
"jws": {
|
||||
"version": "3.1.4",
|
||||
"from": "jws@>=3.0.0 <4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz"
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.4",
|
||||
"from": "lodash@>=4.14.0 <5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz"
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.30.0",
|
||||
"from": "mime-db@>=1.30.0 <1.31.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz"
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.17",
|
||||
"from": "mime-types@>=2.1.2 <2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz"
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
"from": "oauth-sign@>=0.8.0 <0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz"
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "1.0.7",
|
||||
"from": "process-nextick-args@>=1.0.6 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz"
|
||||
},
|
||||
"punycode": {
|
||||
"version": "1.4.1",
|
||||
"from": "punycode@>=1.4.1 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz"
|
||||
},
|
||||
"qs": {
|
||||
"version": "5.1.0",
|
||||
"from": "qs@>=5.1.0 <5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-5.1.0.tgz"
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.0.6",
|
||||
"from": "readable-stream@>=2.0.5 <2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz"
|
||||
},
|
||||
"request": {
|
||||
"version": "2.63.0",
|
||||
"from": "request@2.63.0",
|
||||
"resolved": "https://registry.npmjs.org/request/-/request-2.63.0.tgz",
|
||||
"dependencies": {
|
||||
"node-uuid": {
|
||||
"version": "1.4.8",
|
||||
"from": "node-uuid@>=1.4.0 <1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"from": "safe-buffer@>=5.0.1 <6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz"
|
||||
},
|
||||
"sntp": {
|
||||
"version": "1.0.9",
|
||||
"from": "sntp@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz"
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"from": "string_decoder@>=0.10.0 <0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
|
||||
},
|
||||
"stringstream": {
|
||||
"version": "0.0.5",
|
||||
"from": "stringstream@>=0.0.4 <0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz"
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"from": "strip-ansi@>=3.0.0 <4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "2.0.0",
|
||||
"from": "supports-color@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz"
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.3.3",
|
||||
"from": "tough-cookie@>=0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz"
|
||||
},
|
||||
"tunnel-agent": {
|
||||
"version": "0.4.3",
|
||||
"from": "tunnel-agent@>=0.4.0 <0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz"
|
||||
},
|
||||
"underscore": {
|
||||
"version": "1.8.3",
|
||||
"from": "underscore@>=1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz"
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"from": "util-deprecate@>=1.0.1 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.1.0",
|
||||
"from": "uuid@>=3.1.0 <4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz"
|
||||
},
|
||||
"vscode-nls": {
|
||||
"version": "2.0.2",
|
||||
"from": "vscode-nls@2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz"
|
||||
},
|
||||
"xmldom": {
|
||||
"version": "0.1.27",
|
||||
"from": "xmldom@>=0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz"
|
||||
},
|
||||
"xpath.js": {
|
||||
"version": "1.0.7",
|
||||
"from": "xpath.js@>=1.0.5 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/xpath.js/-/xpath.js-1.0.7.tgz"
|
||||
},
|
||||
"xtend": {
|
||||
"version": "4.0.1",
|
||||
"from": "xtend@>=4.0.0 <5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
{
|
||||
"name": "account-provider-azure",
|
||||
"version": "0.0.1",
|
||||
"publisher": "Microsoft",
|
||||
"engines": { "vscode": "*" },
|
||||
"main": "./out/main",
|
||||
"activationEvents": [ "*" ],
|
||||
"scripts": {
|
||||
"compile": "gulp compile-extension:account-provider-azure"
|
||||
},
|
||||
"dependencies": {
|
||||
"adal-node": "0.1.25",
|
||||
"request": "2.63.0",
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.0.24"
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "accounts.clearTokenCache",
|
||||
"title": "%accounts.clearTokenCache%",
|
||||
"category": "Azure Accounts"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Azure Account Configuration",
|
||||
"properties": {
|
||||
"accounts.azure.enablePublicCloud": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "%config.enablePublicCloudDescription%"
|
||||
}
|
||||
}
|
||||
},
|
||||
"account-type": [
|
||||
{
|
||||
"id": "microsoft",
|
||||
"icon": {
|
||||
"light": "./out/account-provider/media/microsoft_account_light.svg",
|
||||
"dark": "./out/account-provider/media/microsoft_account_dark.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "work_school",
|
||||
"icon": {
|
||||
"light": "./out/account-provider/media/work_school_account_light.svg",
|
||||
"dark": "./out/account-provider/media/work_school_account_dark.svg"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"accounts.clearTokenCache": "Clear Azure Account Token Cache",
|
||||
"config.enablePublicCloudDescription": "Should Azure public cloud integration be enabled",
|
||||
"config.enableUsGovCloudDescription": "Should US Government Azure cloud (Fairfax) integration be enabled",
|
||||
"config.enableChinaCloudDescription": "Should Azure China integration be enabled",
|
||||
"config.enableGermanyCloudDescription": "Should Azure Germany integration be enabled"
|
||||
}
|
||||
@@ -1,51 +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 vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
|
||||
import * as constants from './constants';
|
||||
import { AzureAccountProviderService } from './account-provider/azureAccountProviderService';
|
||||
|
||||
// The function is a duplicate of \src\paths.js. IT would be better to import path.js but it doesn't
|
||||
// work for now because the extension is running in different process.
|
||||
export function getAppDataPath() {
|
||||
var platform = process.platform;
|
||||
switch (platform) {
|
||||
case 'win32': return process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming');
|
||||
case 'darwin': return path.join(os.homedir(), 'Library', 'Application Support');
|
||||
case 'linux': return process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config');
|
||||
default: throw new Error('Platform not supported');
|
||||
}
|
||||
}
|
||||
|
||||
export function getDefaultLogLocation() {
|
||||
return path.join(getAppDataPath(), 'sqlops');
|
||||
}
|
||||
|
||||
// EXTENSION ACTIVATION ////////////////////////////////////////////////////
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
// Create the folder for storing the token caches
|
||||
let storagePath = path.join(getDefaultLogLocation(), constants.extensionName);
|
||||
try {
|
||||
if (!fs.existsSync(storagePath)) {
|
||||
fs.mkdirSync(storagePath);
|
||||
console.log('Initialized Azure account extension storage.');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Initialization of Azure account extension storage failed: ${e}`);
|
||||
console.error('Azure accounts will not be available');
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the provider service and activate
|
||||
const accountProviderService = new AzureAccountProviderService(context, storagePath);
|
||||
context.subscriptions.push(accountProviderService);
|
||||
accountProviderService.activate();
|
||||
}
|
||||
@@ -1,608 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^8.0.24", "@types/node@^8.0.47":
|
||||
version "8.5.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.9.tgz#7155cfb4ae405bca4dd8df1a214c339e939109bf"
|
||||
|
||||
adal-node@0.1.25:
|
||||
version "0.1.25"
|
||||
resolved "https://registry.yarnpkg.com/adal-node/-/adal-node-0.1.25.tgz#6554350ab42914870004c45c0d64448f3dbfcd03"
|
||||
dependencies:
|
||||
"@types/node" "^8.0.47"
|
||||
async ">=0.6.0"
|
||||
date-utils "*"
|
||||
jws "3.x.x"
|
||||
request ">= 2.52.0"
|
||||
underscore ">= 1.3.1"
|
||||
uuid "^3.1.0"
|
||||
xmldom ">= 0.1.x"
|
||||
xpath.js "~1.0.5"
|
||||
|
||||
ajv@^5.1.0:
|
||||
version "5.5.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
|
||||
dependencies:
|
||||
co "^4.6.0"
|
||||
fast-deep-equal "^1.0.0"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.3.0"
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
asn1@0.1.11:
|
||||
version "0.1.11"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.1.11.tgz#559be18376d08a4ec4dbe80877d27818639b2df7"
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
|
||||
assert-plus@^0.1.5:
|
||||
version "0.1.5"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.1.5.tgz#ee74009413002d84cec7219c6ac811812e723160"
|
||||
|
||||
async@>=0.6.0, async@^2.0.1:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
|
||||
dependencies:
|
||||
lodash "^4.14.0"
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
|
||||
aws-sign2@~0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.5.0.tgz#c57103f7a17fc037f02d7c2e64b602ea223f7d63"
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
|
||||
|
||||
aws4@^1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
|
||||
|
||||
base64url@2.0.0, base64url@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/base64url/-/base64url-2.0.0.tgz#eac16e03ea1438eff9423d69baa36262ed1f70bb"
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
bl@~1.0.0:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/bl/-/bl-1.0.3.tgz#fc5421a28fd4226036c3b3891a66a25bc64d226e"
|
||||
dependencies:
|
||||
readable-stream "~2.0.5"
|
||||
|
||||
bluebird@^2.9.30:
|
||||
version "2.11.0"
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
|
||||
|
||||
boom@2.x.x:
|
||||
version "2.10.1"
|
||||
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
|
||||
dependencies:
|
||||
hoek "2.x.x"
|
||||
|
||||
boom@4.x.x:
|
||||
version "4.3.1"
|
||||
resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31"
|
||||
dependencies:
|
||||
hoek "4.x.x"
|
||||
|
||||
boom@5.x.x:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02"
|
||||
dependencies:
|
||||
hoek "4.x.x"
|
||||
|
||||
buffer-equal-constant-time@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819"
|
||||
|
||||
caseless@~0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
|
||||
chalk@^1.0.0:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||
dependencies:
|
||||
ansi-styles "^2.2.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^2.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
co@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
|
||||
combined-stream@^1.0.5, combined-stream@~1.0.1, combined-stream@~1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
commander@^2.8.1:
|
||||
version "2.13.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
|
||||
|
||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
||||
cryptiles@2.x.x:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
|
||||
dependencies:
|
||||
boom "2.x.x"
|
||||
|
||||
cryptiles@3.x.x:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe"
|
||||
dependencies:
|
||||
boom "5.x.x"
|
||||
|
||||
ctype@0.5.3:
|
||||
version "0.5.3"
|
||||
resolved "https://registry.yarnpkg.com/ctype/-/ctype-0.5.3.tgz#82c18c2461f74114ef16c135224ad0b9144ca12f"
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
date-utils@*:
|
||||
version "1.2.21"
|
||||
resolved "https://registry.yarnpkg.com/date-utils/-/date-utils-1.2.21.tgz#61fb16cdc1274b3c9acaaffe9fc69df8720a2b64"
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
|
||||
ecdsa-sig-formatter@1.0.9:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz#4bc926274ec3b5abb5016e7e1d60921ac262b2a1"
|
||||
dependencies:
|
||||
base64url "^2.0.0"
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
escape-string-regexp@^1.0.2:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
extend@~3.0.0, extend@~3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
|
||||
|
||||
extsprintf@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
|
||||
|
||||
extsprintf@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
|
||||
fast-deep-equal@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
|
||||
|
||||
forever-agent@~0.6.0, forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
|
||||
form-data@~1.0.0-rc1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c"
|
||||
dependencies:
|
||||
async "^2.0.1"
|
||||
combined-stream "^1.0.5"
|
||||
mime-types "^2.1.11"
|
||||
|
||||
form-data@~2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf"
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.5"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
generate-function@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
|
||||
|
||||
generate-object-property@^1.1.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
|
||||
dependencies:
|
||||
is-property "^1.0.0"
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
|
||||
har-validator@^1.6.1:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-1.8.0.tgz#d83842b0eb4c435960aeb108a067a3aa94c0eeb2"
|
||||
dependencies:
|
||||
bluebird "^2.9.30"
|
||||
chalk "^1.0.0"
|
||||
commander "^2.8.1"
|
||||
is-my-json-valid "^2.12.0"
|
||||
|
||||
har-validator@~5.0.3:
|
||||
version "5.0.3"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd"
|
||||
dependencies:
|
||||
ajv "^5.1.0"
|
||||
har-schema "^2.0.0"
|
||||
|
||||
has-ansi@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
hawk@~3.1.0:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
|
||||
dependencies:
|
||||
boom "2.x.x"
|
||||
cryptiles "2.x.x"
|
||||
hoek "2.x.x"
|
||||
sntp "1.x.x"
|
||||
|
||||
hawk@~6.0.2:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038"
|
||||
dependencies:
|
||||
boom "4.x.x"
|
||||
cryptiles "3.x.x"
|
||||
hoek "4.x.x"
|
||||
sntp "2.x.x"
|
||||
|
||||
hoek@2.x.x:
|
||||
version "2.16.3"
|
||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
|
||||
|
||||
hoek@4.x.x:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d"
|
||||
|
||||
http-signature@~0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-0.11.0.tgz#1796cf67a001ad5cd6849dca0991485f09089fe6"
|
||||
dependencies:
|
||||
asn1 "0.1.11"
|
||||
assert-plus "^0.1.5"
|
||||
ctype "0.5.3"
|
||||
|
||||
http-signature@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
inherits@~2.0.1:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
is-my-json-valid@^2.12.0:
|
||||
version "2.17.1"
|
||||
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz#3da98914a70a22f0a8563ef1511a246c6fc55471"
|
||||
dependencies:
|
||||
generate-function "^2.0.0"
|
||||
generate-object-property "^1.1.0"
|
||||
jsonpointer "^4.0.0"
|
||||
xtend "^4.0.0"
|
||||
|
||||
is-property@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
|
||||
isstream@~0.1.1, isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
|
||||
json-schema-traverse@^0.3.0:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
|
||||
json-stringify-safe@~5.0.0, json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
|
||||
jsonpointer@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.3.0"
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
jwa@^1.1.4:
|
||||
version "1.1.5"
|
||||
resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.1.5.tgz#a0552ce0220742cd52e153774a32905c30e756e5"
|
||||
dependencies:
|
||||
base64url "2.0.0"
|
||||
buffer-equal-constant-time "1.0.1"
|
||||
ecdsa-sig-formatter "1.0.9"
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
jws@3.x.x:
|
||||
version "3.1.4"
|
||||
resolved "https://registry.yarnpkg.com/jws/-/jws-3.1.4.tgz#f9e8b9338e8a847277d6444b1464f61880e050a2"
|
||||
dependencies:
|
||||
base64url "^2.0.0"
|
||||
jwa "^1.1.4"
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
lodash@^4.14.0:
|
||||
version "4.17.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||
|
||||
mime-db@~1.30.0:
|
||||
version "1.30.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"
|
||||
|
||||
mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.2:
|
||||
version "2.1.17"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
|
||||
dependencies:
|
||||
mime-db "~1.30.0"
|
||||
|
||||
node-uuid@~1.4.0:
|
||||
version "1.4.8"
|
||||
resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
|
||||
|
||||
oauth-sign@~0.8.0, oauth-sign@~0.8.2:
|
||||
version "0.8.2"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
|
||||
process-nextick-args@~1.0.6:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
|
||||
qs@~5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-5.1.0.tgz#4d932e5c7ea411cca76a312d39a606200fd50cd9"
|
||||
|
||||
qs@~6.5.1:
|
||||
version "6.5.1"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
|
||||
|
||||
readable-stream@~2.0.5:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.1"
|
||||
isarray "~1.0.0"
|
||||
process-nextick-args "~1.0.6"
|
||||
string_decoder "~0.10.x"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
request@2.63.0:
|
||||
version "2.63.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.63.0.tgz#c83e7c3485e5d9bf9b146318429bc48f1253d8be"
|
||||
dependencies:
|
||||
aws-sign2 "~0.5.0"
|
||||
bl "~1.0.0"
|
||||
caseless "~0.11.0"
|
||||
combined-stream "~1.0.1"
|
||||
extend "~3.0.0"
|
||||
forever-agent "~0.6.0"
|
||||
form-data "~1.0.0-rc1"
|
||||
har-validator "^1.6.1"
|
||||
hawk "~3.1.0"
|
||||
http-signature "~0.11.0"
|
||||
isstream "~0.1.1"
|
||||
json-stringify-safe "~5.0.0"
|
||||
mime-types "~2.1.2"
|
||||
node-uuid "~1.4.0"
|
||||
oauth-sign "~0.8.0"
|
||||
qs "~5.1.0"
|
||||
stringstream "~0.0.4"
|
||||
tough-cookie ">=0.12.0"
|
||||
tunnel-agent "~0.4.0"
|
||||
|
||||
"request@>= 2.52.0":
|
||||
version "2.83.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356"
|
||||
dependencies:
|
||||
aws-sign2 "~0.7.0"
|
||||
aws4 "^1.6.0"
|
||||
caseless "~0.12.0"
|
||||
combined-stream "~1.0.5"
|
||||
extend "~3.0.1"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.3.1"
|
||||
har-validator "~5.0.3"
|
||||
hawk "~6.0.2"
|
||||
http-signature "~1.2.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.17"
|
||||
oauth-sign "~0.8.2"
|
||||
performance-now "^2.1.0"
|
||||
qs "~6.5.1"
|
||||
safe-buffer "^5.1.1"
|
||||
stringstream "~0.0.5"
|
||||
tough-cookie "~2.3.3"
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.1.0"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
|
||||
|
||||
sntp@1.x.x:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
|
||||
dependencies:
|
||||
hoek "2.x.x"
|
||||
|
||||
sntp@2.x.x:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8"
|
||||
dependencies:
|
||||
hoek "4.x.x"
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
getpass "^0.1.1"
|
||||
optionalDependencies:
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
string_decoder@~0.10.x:
|
||||
version "0.10.31"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
|
||||
|
||||
stringstream@~0.0.4, stringstream@~0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
|
||||
|
||||
strip-ansi@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
supports-color@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||
|
||||
tough-cookie@>=0.12.0, tough-cookie@~2.3.3:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561"
|
||||
dependencies:
|
||||
punycode "^1.4.1"
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tunnel-agent@~0.4.0:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
|
||||
"underscore@>= 1.3.1":
|
||||
version "1.8.3"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022"
|
||||
|
||||
util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
|
||||
uuid@^3.1.0:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14"
|
||||
|
||||
verror@1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.2.tgz#3817eca5b985c2393de325197cf4e15eb2aa5350"
|
||||
|
||||
"xmldom@>= 0.1.x":
|
||||
version "0.1.27"
|
||||
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9"
|
||||
|
||||
xpath.js@~1.0.5:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/xpath.js/-/xpath.js-1.0.7.tgz#7e94627f541276cbc6a6b02b5d35e9418565b3e4"
|
||||
|
||||
xtend@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
||||
@@ -1,6 +1,6 @@
|
||||
# Microsoft SQL Server Agent for SQL Operations Studio
|
||||
# Microsoft SQL Server Agent for Azure Data Studio
|
||||
|
||||
Welcome to Microsoft SQL Server Agent for SQL Operations Studio! An extension for managing and troubleshooting
|
||||
Welcome to Microsoft SQL Server Agent for Azure Data Studio! An extension for managing and troubleshooting
|
||||
SQL Server Agent jobs and configuration. The current is an early release of this extension that provides
|
||||
basic functionality for the following.
|
||||
|
||||
@@ -22,4 +22,4 @@ The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.micro
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/sqlopsstudio/master/LICENSE.txt).
|
||||
Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt).
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
"name": "agent",
|
||||
"displayName": "SQL Server Agent",
|
||||
"description": "Manage and troubleshoot SQL Server Agent jobs",
|
||||
"version": "0.32.7",
|
||||
"version": "0.35.2",
|
||||
"publisher": "Microsoft",
|
||||
"preview": true,
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/sqlopsstudio/master/LICENSE.txt",
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
||||
"icon": "images/sqlserver.png",
|
||||
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||
"engines": {
|
||||
@@ -17,7 +17,7 @@
|
||||
"main": "./out/main",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/sqlopsstudio.git"
|
||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||
},
|
||||
"extensionDependencies": [
|
||||
"Microsoft.mssql"
|
||||
@@ -26,12 +26,6 @@
|
||||
"outputChannels": [
|
||||
"sqlagent"
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"command": "agent.openNewStepDialog",
|
||||
"title": "agent.openNewStepDialog"
|
||||
}
|
||||
],
|
||||
"dashboard.tabs": [
|
||||
{
|
||||
"id": "data-management-agent",
|
||||
|
||||
@@ -35,4 +35,5 @@ export class AgentUtils {
|
||||
}
|
||||
return this._queryProvider;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
import { JobData } from './jobData';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -45,8 +46,19 @@ export class AlertData implements IAgentDialogData {
|
||||
wmiEventNamespace: string;
|
||||
wmiEventQuery: string;
|
||||
|
||||
constructor(ownerUri:string, alertInfo: sqlops.AgentAlertInfo) {
|
||||
private viaJobDialog: boolean;
|
||||
private jobModel: JobData;
|
||||
|
||||
constructor(
|
||||
ownerUri:string,
|
||||
alertInfo: sqlops.AgentAlertInfo,
|
||||
jobModel?: JobData,
|
||||
viaJobDialog: boolean = false
|
||||
) {
|
||||
this.ownerUri = ownerUri;
|
||||
this.viaJobDialog = viaJobDialog;
|
||||
this.jobModel = jobModel;
|
||||
this.jobName = this.jobName ? this.jobName : this.jobModel.name;
|
||||
|
||||
if (alertInfo) {
|
||||
this.dialogMode = AgentDialogMode.EDIT;
|
||||
@@ -57,10 +69,9 @@ export class AlertData implements IAgentDialogData {
|
||||
this.eventDescriptionKeyword = alertInfo.eventDescriptionKeyword;
|
||||
this.eventSource = alertInfo.eventSource;
|
||||
this.hasNotification = alertInfo.hasNotification;
|
||||
this.includeEventDescription = alertInfo.includeEventDescription.toString();
|
||||
this.includeEventDescription = alertInfo.includeEventDescription ? alertInfo.includeEventDescription.toString() : null;
|
||||
this.isEnabled = alertInfo.isEnabled;
|
||||
this.jobId = alertInfo.jobId;
|
||||
this.jobName = alertInfo.jobName;
|
||||
this.lastOccurrenceDate = alertInfo.lastOccurrenceDate;
|
||||
this.lastResponseDate = alertInfo.lastResponseDate;
|
||||
this.messageId = alertInfo.messageId;
|
||||
@@ -71,7 +82,7 @@ export class AlertData implements IAgentDialogData {
|
||||
this.databaseName = alertInfo.databaseName;
|
||||
this.countResetDate = alertInfo.countResetDate;
|
||||
this.categoryName = alertInfo.categoryName;
|
||||
this.alertType = alertInfo.alertType.toString();
|
||||
this.alertType = alertInfo.alertType ? alertInfo.alertType.toString() : null;
|
||||
this.wmiEventNamespace = alertInfo.wmiEventNamespace;
|
||||
this.wmiEventQuery = alertInfo.wmiEventQuery;
|
||||
}
|
||||
@@ -82,10 +93,18 @@ export class AlertData implements IAgentDialogData {
|
||||
|
||||
public async save() {
|
||||
let agentService = await AgentUtils.getAgentService();
|
||||
let result = this.dialogMode === AgentDialogMode.CREATE
|
||||
? await agentService.createAlert(this.ownerUri, this.toAgentAlertInfo())
|
||||
: await agentService.updateAlert(this.ownerUri, this.originalName, this.toAgentAlertInfo());
|
||||
|
||||
let result: any;
|
||||
// if it's called via the job dialog, add it to the
|
||||
// job model
|
||||
if (this.viaJobDialog) {
|
||||
if (this.jobModel) {
|
||||
Promise.resolve(this);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// has to be a create alert
|
||||
result = await agentService.createAlert(this.ownerUri, this.toAgentAlertInfo());
|
||||
}
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('alertData.saveErrorMessage', "Alert update failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
|
||||
@@ -44,6 +44,8 @@ export class JobData implements IAgentDialogData {
|
||||
public jobSteps: sqlops.AgentJobStepInfo[];
|
||||
public jobSchedules: sqlops.AgentJobScheduleInfo[];
|
||||
public alerts: sqlops.AgentAlertInfo[];
|
||||
public jobId: string;
|
||||
public startStepId: number;
|
||||
|
||||
constructor(
|
||||
ownerUri: string,
|
||||
@@ -59,6 +61,11 @@ export class JobData implements IAgentDialogData {
|
||||
this.category = jobInfo.category;
|
||||
this.description = jobInfo.description;
|
||||
this.enabled = jobInfo.enabled;
|
||||
this.jobSteps = jobInfo.jobSteps;
|
||||
this.jobSchedules = jobInfo.jobSchedules;
|
||||
this.alerts = jobInfo.alerts;
|
||||
this.jobId = jobInfo.jobId;
|
||||
this.startStepId = jobInfo.startStepId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +112,6 @@ export class JobData implements IAgentDialogData {
|
||||
displayName: this.JobCompletionActionCondition_Always,
|
||||
name: sqlops.JobCompletionActionCondition.Always.toString()
|
||||
}];
|
||||
|
||||
this.jobSchedules = [];
|
||||
}
|
||||
|
||||
public async save() {
|
||||
@@ -114,7 +119,6 @@ export class JobData implements IAgentDialogData {
|
||||
let result = this.dialogMode === AgentDialogMode.CREATE
|
||||
? await this._agentService.createJob(this.ownerUri, jobInfo)
|
||||
: await this._agentService.updateJob(this.ownerUri, this.originalName, jobInfo);
|
||||
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('jobData.saveErrorMessage', "Job update failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
@@ -134,29 +138,22 @@ export class JobData implements IAgentDialogData {
|
||||
};
|
||||
}
|
||||
|
||||
public addJobSchedule(schedule: sqlops.AgentJobScheduleInfo) {
|
||||
let existingSchedule = this.jobSchedules.find(item => item.name === schedule.name);
|
||||
if (!existingSchedule) {
|
||||
this.jobSchedules.push(schedule);
|
||||
}
|
||||
}
|
||||
|
||||
public toAgentJobInfo(): sqlops.AgentJobInfo {
|
||||
return {
|
||||
name: this.name,
|
||||
owner: this.owner,
|
||||
description: this.description,
|
||||
EmailLevel: this.emailLevel,
|
||||
PageLevel: this.pageLevel,
|
||||
EventLogLevel: this.eventLogLevel,
|
||||
DeleteLevel: this.deleteLevel,
|
||||
OperatorToEmail: this.operatorToEmail,
|
||||
OperatorToPage: this.operatorToPage,
|
||||
emailLevel: this.emailLevel,
|
||||
pageLevel: this.pageLevel,
|
||||
eventLogLevel: this.eventLogLevel,
|
||||
deleteLevel: this.deleteLevel,
|
||||
operatorToEmail: this.operatorToEmail,
|
||||
operatorToPage: this.operatorToPage,
|
||||
enabled: this.enabled,
|
||||
category: this.category,
|
||||
Alerts: this.alerts,
|
||||
JobSchedules: this.jobSchedules,
|
||||
JobSteps: this.jobSteps,
|
||||
alerts: this.alerts,
|
||||
jobSchedules: this.jobSchedules,
|
||||
jobSteps: this.jobSteps,
|
||||
// The properties below are not collected from UI
|
||||
// We could consider using a seperate class for create job request
|
||||
//
|
||||
@@ -171,7 +168,8 @@ export class JobData implements IAgentDialogData {
|
||||
categoryType: 1, // LocalJob, hard-coding the value, corresponds to the target tab in SSMS
|
||||
lastRun: '',
|
||||
nextRun: '',
|
||||
jobId: ''
|
||||
jobId: this.jobId,
|
||||
startStepId: this.startStepId
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4,39 +4,55 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
import { JobData } from './jobData';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class JobStepData implements IAgentDialogData {
|
||||
public dialogMode: AgentDialogMode = AgentDialogMode.CREATE;
|
||||
|
||||
// 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');
|
||||
|
||||
public dialogMode: AgentDialogMode;
|
||||
public ownerUri: string;
|
||||
public jobId: string; //
|
||||
public jobId: string;
|
||||
public jobName: string;
|
||||
public script: string; //
|
||||
public script: string;
|
||||
public scriptName: string;
|
||||
public stepName: string; //
|
||||
public subSystem: string; //
|
||||
public stepName: string;
|
||||
public subSystem: string;
|
||||
public id: number;
|
||||
public failureAction: string; //
|
||||
public successAction: string; //
|
||||
public failStepId: number;
|
||||
public failureAction: string;
|
||||
public successAction: string;
|
||||
public successStepId: number;
|
||||
public failStepId: number;
|
||||
public command: string;
|
||||
public commandExecutionSuccessCode: number;
|
||||
public databaseName: string; //
|
||||
public databaseName: string;
|
||||
public databaseUserName: string;
|
||||
public server: string;
|
||||
public outputFileName: string; //
|
||||
public outputFileName: string;
|
||||
public appendToLogFile: boolean;
|
||||
public appendToStepHist: boolean;
|
||||
public writeLogToTable: boolean;
|
||||
public appendLogToTable: boolean;
|
||||
public retryAttempts: number; //
|
||||
public retryInterval: number; //
|
||||
public retryAttempts: number;
|
||||
public retryInterval: number;
|
||||
public proxyName: string;
|
||||
private jobModel: JobData;
|
||||
private viaJobDialog: boolean;
|
||||
|
||||
constructor(ownerUri:string) {
|
||||
constructor(ownerUri:string, jobModel?: JobData, viaJobDialog: boolean = false) {
|
||||
this.ownerUri = ownerUri;
|
||||
this.jobName = jobModel.name;
|
||||
this.jobModel = jobModel;
|
||||
this.viaJobDialog = viaJobDialog;
|
||||
}
|
||||
|
||||
public async initialize() {
|
||||
@@ -44,33 +60,101 @@ export class JobStepData implements IAgentDialogData {
|
||||
|
||||
public async save() {
|
||||
let agentService = await AgentUtils.getAgentService();
|
||||
agentService.createJobStep(this.ownerUri, {
|
||||
jobId: this.jobId,
|
||||
jobName: this.jobName,
|
||||
script: this.script,
|
||||
scriptName: this.scriptName,
|
||||
stepName: this.stepName,
|
||||
subSystem: this.subSystem,
|
||||
id: 1,
|
||||
failureAction: this.failureAction,
|
||||
successAction: this.successAction,
|
||||
failStepId: this.failStepId,
|
||||
successStepId: this.successStepId,
|
||||
command: this.command,
|
||||
commandExecutionSuccessCode: this.commandExecutionSuccessCode,
|
||||
databaseName: this.databaseName,
|
||||
databaseUserName: this.databaseUserName,
|
||||
server: this.server,
|
||||
outputFileName: this.outputFileName,
|
||||
appendToLogFile: this.appendToLogFile,
|
||||
appendToStepHist: this.appendToStepHist,
|
||||
writeLogToTable: this.writeLogToTable,
|
||||
appendLogToTable: this.appendLogToTable,
|
||||
retryAttempts: this.retryAttempts,
|
||||
retryInterval: this.retryInterval,
|
||||
proxyName: this.proxyName
|
||||
}).then(result => {
|
||||
console.info(result);
|
||||
});
|
||||
let result: any;
|
||||
// if it's called via the job dialog, add it to the
|
||||
// job model
|
||||
if (this.viaJobDialog) {
|
||||
if (this.jobModel) {
|
||||
Promise.resolve(this);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// has to be a create step
|
||||
result = await agentService.createJobStep(this.ownerUri, JobStepData.convertToAgentJobStepInfo(this));
|
||||
}
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('jobStepData.saveErrorMessage', "Step update failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
}
|
||||
}
|
||||
|
||||
public validate(): { valid: boolean, errorMessages: string[] } {
|
||||
let validationErrors: string[] = [];
|
||||
|
||||
if (!(this.stepName && this.stepName.trim())) {
|
||||
validationErrors.push(JobStepData.CreateStepErrorMessage_StepNameIsEmpty);
|
||||
}
|
||||
|
||||
if (!(this.jobName && this.jobName.trim())) {
|
||||
validationErrors.push(JobStepData.CreateStepErrorMessage_JobNameIsEmpty);
|
||||
}
|
||||
|
||||
return {
|
||||
valid: validationErrors.length === 0,
|
||||
errorMessages: validationErrors
|
||||
};
|
||||
}
|
||||
|
||||
public static convertToJobStepData(jobStepInfo: sqlops.AgentJobStepInfo, jobData: JobData) {
|
||||
let stepData = new JobStepData(jobData.ownerUri, jobData);
|
||||
stepData.ownerUri = jobData.ownerUri;
|
||||
stepData.jobId = jobStepInfo.jobId;
|
||||
stepData.jobName = jobStepInfo.jobName;
|
||||
stepData.script = jobStepInfo.script;
|
||||
stepData.scriptName = jobStepInfo.scriptName,
|
||||
stepData.stepName = jobStepInfo.stepName,
|
||||
stepData.subSystem = jobStepInfo.subSystem,
|
||||
stepData.id = jobStepInfo.id,
|
||||
stepData.failureAction = jobStepInfo.failureAction,
|
||||
stepData.successAction = jobStepInfo.successAction,
|
||||
stepData.failStepId = jobStepInfo.failStepId,
|
||||
stepData.successStepId = jobStepInfo.successStepId,
|
||||
stepData.command = jobStepInfo.command,
|
||||
stepData.commandExecutionSuccessCode = jobStepInfo.commandExecutionSuccessCode,
|
||||
stepData.databaseName = jobStepInfo.databaseName,
|
||||
stepData.databaseUserName = jobStepInfo.databaseUserName,
|
||||
stepData.server = jobStepInfo.server,
|
||||
stepData.outputFileName = jobStepInfo.outputFileName,
|
||||
stepData.appendToLogFile = jobStepInfo.appendToLogFile,
|
||||
stepData.appendToStepHist = jobStepInfo.appendToStepHist,
|
||||
stepData.writeLogToTable = jobStepInfo.writeLogToTable,
|
||||
stepData.appendLogToTable = jobStepInfo.appendLogToTable,
|
||||
stepData.retryAttempts = jobStepInfo.retryAttempts,
|
||||
stepData.retryInterval = jobStepInfo.retryInterval,
|
||||
stepData.proxyName = jobStepInfo.proxyName;
|
||||
stepData.dialogMode = AgentDialogMode.EDIT;
|
||||
stepData.viaJobDialog = true;
|
||||
return stepData;
|
||||
}
|
||||
|
||||
public static convertToAgentJobStepInfo(jobStepData: JobStepData): sqlops.AgentJobStepInfo {
|
||||
let result: sqlops.AgentJobStepInfo = {
|
||||
jobId: jobStepData.jobId,
|
||||
jobName: jobStepData.jobName,
|
||||
script: jobStepData.script,
|
||||
scriptName: jobStepData.scriptName,
|
||||
stepName: jobStepData.stepName,
|
||||
subSystem: jobStepData.subSystem,
|
||||
id: jobStepData.id,
|
||||
failureAction: jobStepData.failureAction,
|
||||
successAction: jobStepData.successAction,
|
||||
failStepId: jobStepData.failStepId,
|
||||
successStepId: jobStepData.successStepId,
|
||||
command: jobStepData.command,
|
||||
commandExecutionSuccessCode: jobStepData.commandExecutionSuccessCode,
|
||||
databaseName: jobStepData.databaseName,
|
||||
databaseUserName: jobStepData.databaseUserName,
|
||||
server: jobStepData.server,
|
||||
outputFileName: jobStepData.outputFileName,
|
||||
appendToLogFile: jobStepData.appendToLogFile,
|
||||
appendToStepHist: jobStepData.appendToStepHist,
|
||||
writeLogToTable: jobStepData.writeLogToTable,
|
||||
appendLogToTable: jobStepData.appendLogToTable,
|
||||
retryAttempts: jobStepData.retryAttempts,
|
||||
retryInterval: jobStepData.retryInterval,
|
||||
proxyName: jobStepData.proxyName
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,9 +13,11 @@ export class PickScheduleData implements IAgentDialogData {
|
||||
public ownerUri: string;
|
||||
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||
private jobName: string;
|
||||
|
||||
constructor(ownerUri:string) {
|
||||
constructor(ownerUri:string, jobName: string) {
|
||||
this.ownerUri = ownerUri;
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
public async initialize() {
|
||||
@@ -27,5 +29,6 @@ export class PickScheduleData implements IAgentDialogData {
|
||||
}
|
||||
|
||||
public async save() {
|
||||
this.selectedSchedule.jobName = this.jobName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
public readonly onSuccess: vscode.Event<T> = this._onSuccess.event;
|
||||
public dialog: sqlops.window.modelviewdialog.Dialog;
|
||||
|
||||
// Dialog Name for Telemetry
|
||||
public dialogName: string;
|
||||
|
||||
constructor(public ownerUri: string, public model: T, public title: string) {
|
||||
}
|
||||
|
||||
@@ -31,8 +34,9 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
|
||||
protected abstract async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog);
|
||||
|
||||
public async openDialog() {
|
||||
this.dialog = sqlops.window.modelviewdialog.createDialog(this.title);
|
||||
public async openDialog(dialogName?: string) {
|
||||
let event = dialogName ? dialogName : null;
|
||||
this.dialog = sqlops.window.modelviewdialog.createDialog(this.title, event);
|
||||
|
||||
await this.model.initialize();
|
||||
|
||||
@@ -49,10 +53,8 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
|
||||
protected async execute() {
|
||||
this.updateModel();
|
||||
let success = await this.model.save();
|
||||
if (success) {
|
||||
this._onSuccess.fire(this.model);
|
||||
}
|
||||
await this.model.save();
|
||||
this._onSuccess.fire(this.model);
|
||||
}
|
||||
|
||||
protected async cancel() {
|
||||
|
||||
@@ -12,6 +12,7 @@ import { AgentUtils } from '../agentUtils';
|
||||
import { AlertData } from '../data/alertData';
|
||||
import { OperatorDialog } from './operatorDialog';
|
||||
import { JobDialog } from './jobDialog';
|
||||
import { JobData } from '../data/jobData';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -115,6 +116,10 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
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';
|
||||
private readonly EditAlertDialog = 'EditAlertDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||
private responseTab: sqlops.window.modelviewdialog.DialogTab;
|
||||
@@ -148,14 +153,26 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
private delayMinutesTextBox: sqlops.InputBoxComponent;
|
||||
private delaySecondsTextBox: sqlops.InputBoxComponent;
|
||||
|
||||
private jobs: string[];
|
||||
private isEdit: boolean = false;
|
||||
private databases: string[];
|
||||
private jobModel: JobData;
|
||||
public jobId: string;
|
||||
public jobName: string;
|
||||
|
||||
constructor(ownerUri: string, alertInfo: sqlops.AgentAlertInfo = undefined, jobs: string[]) {
|
||||
constructor(
|
||||
ownerUri: string,
|
||||
jobModel: JobData,
|
||||
alertInfo: sqlops.AgentAlertInfo = undefined,
|
||||
viaJobDialog: boolean = false
|
||||
) {
|
||||
super(ownerUri,
|
||||
new AlertData(ownerUri, alertInfo),
|
||||
new AlertData(ownerUri, alertInfo, jobModel, viaJobDialog),
|
||||
alertInfo ? AlertDialog.EditDialogTitle : AlertDialog.CreateDialogTitle);
|
||||
this.jobs = jobs;
|
||||
this.jobModel = jobModel;
|
||||
this.jobId = this.jobId ? this.jobId : this.jobModel.jobId;
|
||||
this.jobName = this.jobName ? this.jobName : this.jobModel.name;
|
||||
this.isEdit = alertInfo ? true : false;
|
||||
this.dialogName = this.isEdit ? this.EditAlertDialog : this.NewAlertDialog;
|
||||
}
|
||||
|
||||
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
|
||||
@@ -512,7 +529,8 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
protected updateModel() {
|
||||
this.model.name = this.nameTextBox.value;
|
||||
this.model.isEnabled = this.enabledCheckBox.checked;
|
||||
|
||||
this.model.jobId = this.jobId;
|
||||
this.model.jobName = this.jobName;
|
||||
this.model.alertType = this.getDropdownValue(this.typeDropDown);
|
||||
let databaseName = this.getDropdownValue(this.databaseDropDown);
|
||||
this.model.databaseName = (databaseName !== AlertDialog.AllDatabases) ? databaseName : undefined;
|
||||
|
||||
@@ -10,6 +10,8 @@ import { JobStepDialog } from './jobStepDialog';
|
||||
import { PickScheduleDialog } from './pickScheduleDialog';
|
||||
import { AlertDialog } from './alertDialog';
|
||||
import { AgentDialog } from './agentDialog';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { JobStepData } from '../data/jobStepData';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -40,11 +42,12 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
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...');
|
||||
private readonly EditStepButtonString: string = localize('jobDialog.edit', 'Edit');
|
||||
private readonly DeleteStepButtonString: string = localize('jobDialog.delete', 'Delete');
|
||||
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 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');
|
||||
@@ -62,6 +65,12 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
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';
|
||||
private readonly EditJobDialogEvent: string = 'EditJobDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||
@@ -97,6 +106,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
private eventLogConditionDropdown: sqlops.DropDownComponent;
|
||||
private deleteJobCheckBox: sqlops.CheckBoxComponent;
|
||||
private deleteJobConditionDropdown: sqlops.DropDownComponent;
|
||||
private startStepDropdown: sqlops.DropDownComponent;
|
||||
|
||||
// Schedule tab controls
|
||||
private schedulesTable: sqlops.TableComponent;
|
||||
@@ -105,12 +115,24 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
// Alert tab controls
|
||||
private alertsTable: sqlops.TableComponent;
|
||||
private newAlertButton: sqlops.ButtonComponent;
|
||||
private isEdit: boolean = false;
|
||||
|
||||
// Job objects
|
||||
private steps: sqlops.AgentJobStepInfo[];
|
||||
private schedules: sqlops.AgentJobScheduleInfo[];
|
||||
private alerts: sqlops.AgentAlertInfo[] = [];
|
||||
private startStepDropdownValues: sqlops.CategoryValue[] = [];
|
||||
|
||||
constructor(ownerUri: string, jobInfo: sqlops.AgentJobInfo = undefined) {
|
||||
super(
|
||||
ownerUri,
|
||||
new JobData(ownerUri, jobInfo),
|
||||
jobInfo ? JobDialog.EditDialogTitle : JobDialog.CreateDialogTitle);
|
||||
this.steps = this.model.jobSteps ? this.model.jobSteps : [];
|
||||
this.schedules = this.model.jobSchedules ? this.model.jobSchedules : [];
|
||||
this.alerts = this.model.alerts ? this.model.alerts : [];
|
||||
this.isEdit = jobInfo ? true : false;
|
||||
this.dialogName = this.isEdit ? this.EditJobDialogEvent : this.NewJobDialogEvent;
|
||||
}
|
||||
|
||||
protected async initializeDialog() {
|
||||
@@ -193,10 +215,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
|
||||
private initializeStepsTab() {
|
||||
this.stepsTab.registerContent(async view => {
|
||||
let previewTag = view.modelBuilder.text()
|
||||
.withProperties({
|
||||
value: 'Feature Preview'
|
||||
}).component();
|
||||
let data = this.steps ? this.convertStepsToData(this.steps) : [];
|
||||
this.stepsTable = view.modelBuilder.table()
|
||||
.withProperties({
|
||||
columns: [
|
||||
@@ -206,20 +225,27 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
this.StepsTable_SuccessColumnString,
|
||||
this.StepsTable_FailureColumnString
|
||||
],
|
||||
data: [],
|
||||
height: 430
|
||||
data: data,
|
||||
height: 650
|
||||
}).component();
|
||||
|
||||
this.startStepDropdown = view.modelBuilder.dropDown().withProperties({ width: 180 }).component();
|
||||
this.startStepDropdown.enabled = this.steps.length > 1 ? true : false;
|
||||
this.steps.forEach((step) => {
|
||||
this.startStepDropdownValues.push({ displayName: step.id + ': ' + step.stepName, name: step.id.toString() });
|
||||
});
|
||||
this.startStepDropdown.values = this.startStepDropdownValues;
|
||||
|
||||
this.moveStepUpButton = view.modelBuilder.button()
|
||||
.withProperties({
|
||||
label: this.MoveStepUpButtonString,
|
||||
width: 80
|
||||
width: 120
|
||||
}).component();
|
||||
|
||||
this.moveStepDownButton = view.modelBuilder.button()
|
||||
.withProperties({
|
||||
label: this.MoveStepDownButtonString,
|
||||
width: 80
|
||||
width: 120
|
||||
}).component();
|
||||
|
||||
this.moveStepUpButton.enabled = false;
|
||||
@@ -227,13 +253,24 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
|
||||
this.newStepButton = view.modelBuilder.button().withProperties({
|
||||
label: this.NewStepButtonString,
|
||||
width: 80
|
||||
width: 140
|
||||
}).component();
|
||||
|
||||
let stepDialog = new JobStepDialog(this.model.ownerUri, '' , this.model, null, true);
|
||||
stepDialog.onSuccess((step) => {
|
||||
let stepInfo = JobStepData.convertToAgentJobStepInfo(step);
|
||||
this.steps.push(stepInfo);
|
||||
this.stepsTable.data = this.convertStepsToData(this.steps);
|
||||
this.startStepDropdownValues = [];
|
||||
this.steps.forEach((step) => {
|
||||
this.startStepDropdownValues.push({ displayName: step.id + ': ' + step.stepName, name: step.id.toString() });
|
||||
});
|
||||
this.startStepDropdown.values = this.startStepDropdownValues;
|
||||
});
|
||||
this.newStepButton.onDidClick((e)=>{
|
||||
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
|
||||
let stepDialog = new JobStepDialog(this.model.ownerUri, this.nameTextBox.value, '' , 1, this.model);
|
||||
stepDialog.openNewStepDialog();
|
||||
stepDialog.jobName = this.nameTextBox.value;
|
||||
stepDialog.openDialog();
|
||||
} else {
|
||||
this.dialog.message = { text: this.BlankJobNameErrorText };
|
||||
}
|
||||
@@ -241,43 +278,143 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
|
||||
this.editStepButton = view.modelBuilder.button().withProperties({
|
||||
label: this.EditStepButtonString,
|
||||
width: 80
|
||||
width: 140
|
||||
}).component();
|
||||
|
||||
this.deleteStepButton = view.modelBuilder.button().withProperties({
|
||||
label: this.DeleteStepButtonString,
|
||||
width: 80
|
||||
width: 140
|
||||
}).component();
|
||||
|
||||
this.stepsTable.enabled = false;
|
||||
this.editStepButton.enabled = false;
|
||||
this.deleteStepButton.enabled = false;
|
||||
|
||||
let formModel = view.modelBuilder.formContainer()
|
||||
.withFormItems([{
|
||||
component: previewTag,
|
||||
title: ''
|
||||
},
|
||||
this.moveStepUpButton.onDidClick(() => {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
let previousRow = rowNumber - 1;
|
||||
let previousStep = this.steps[previousRow];
|
||||
let previousStepId = this.steps[previousRow].id;
|
||||
let currentStep = this.steps[rowNumber];
|
||||
let currentStepId = this.steps[rowNumber].id;
|
||||
this.steps[previousRow] = currentStep;
|
||||
this.steps[rowNumber] = previousStep;
|
||||
this.stepsTable.data = this.convertStepsToData(this.steps);
|
||||
this.steps[previousRow].id = previousStepId;
|
||||
this.steps[rowNumber].id = currentStepId;
|
||||
});
|
||||
|
||||
this.moveStepDownButton.onDidClick(() => {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
let nextRow = rowNumber + 1;
|
||||
let nextStep = this.steps[nextRow];
|
||||
let nextStepId = this.steps[nextRow].id;
|
||||
let currentStep = this.steps[rowNumber];
|
||||
let currentStepId = this.steps[rowNumber].id;
|
||||
this.steps[nextRow] = currentStep;
|
||||
this.steps[rowNumber] = nextStep;
|
||||
this.stepsTable.data = this.convertStepsToData(this.steps);
|
||||
this.steps[nextRow].id = nextStepId;
|
||||
this.steps[rowNumber].id = currentStepId;
|
||||
});
|
||||
|
||||
this.editStepButton.onDidClick(() => {
|
||||
if (this.stepsTable.selectedRows.length === 1) {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
let stepData = this.model.jobSteps[rowNumber];
|
||||
let editStepDialog = new JobStepDialog(this.model.ownerUri, '' , this.model, stepData, true);
|
||||
editStepDialog.onSuccess((step) => {
|
||||
let stepInfo = JobStepData.convertToAgentJobStepInfo(step);
|
||||
for (let i = 0; i < this.steps.length; i++) {
|
||||
if (this.steps[i].id === stepInfo.id) {
|
||||
this.steps[i] = stepInfo;
|
||||
}
|
||||
}
|
||||
this.stepsTable.data = this.convertStepsToData(this.steps);
|
||||
this.startStepDropdownValues = [];
|
||||
this.steps.forEach((step) => {
|
||||
this.startStepDropdownValues.push({ displayName: step.id + ': ' + step.stepName, name: step.id.toString() });
|
||||
});
|
||||
this.startStepDropdown.values = this.startStepDropdownValues;
|
||||
|
||||
});
|
||||
editStepDialog.openDialog();
|
||||
}
|
||||
});
|
||||
|
||||
this.deleteStepButton.onDidClick(() => {
|
||||
if (this.stepsTable.selectedRows.length === 1) {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
AgentUtils.getAgentService().then((agentService) => {
|
||||
let steps = this.model.jobSteps ? this.model.jobSteps : [];
|
||||
let stepData = this.model.jobSteps[rowNumber];
|
||||
agentService.deleteJobStep(this.ownerUri, stepData).then((result) => {
|
||||
if (result && result.success) {
|
||||
delete steps[rowNumber];
|
||||
let data = this.convertStepsToData(steps);
|
||||
this.stepsTable.data = data;
|
||||
this.startStepDropdownValues = [];
|
||||
this.steps.forEach((step) => {
|
||||
this.startStepDropdownValues.push({ displayName: step.id + ': ' + step.stepName, name: step.id.toString() });
|
||||
});
|
||||
this.startStepDropdown.values = this.startStepDropdownValues;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.stepsTable.onRowSelected((row) => {
|
||||
// only let edit or delete steps if there's
|
||||
// one step selection
|
||||
if (this.stepsTable.selectedRows.length === 1) {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
// if it's not the last step
|
||||
if (this.steps.length !== rowNumber + 1) {
|
||||
this.moveStepDownButton.enabled = true;
|
||||
}
|
||||
// if it's not the first step
|
||||
if (rowNumber !== 0) {
|
||||
this.moveStepUpButton.enabled = true;
|
||||
}
|
||||
this.deleteStepButton.enabled = true;
|
||||
this.editStepButton.enabled = true;
|
||||
}
|
||||
});
|
||||
let stepMoveContainer = this.createRowContainer(view).withItems([this.startStepDropdown, this.moveStepUpButton, this.moveStepDownButton]).component();
|
||||
let stepsDialogContainer = this.createRowContainer(view).withItems([this.newStepButton, this.editStepButton, this.deleteStepButton]).component();
|
||||
let formModel = view.modelBuilder.formContainer().withFormItems([
|
||||
{
|
||||
component: this.stepsTable,
|
||||
title: this.JobStepsTopLabelString,
|
||||
actions: [this.moveStepUpButton, this.moveStepDownButton, this.newStepButton, this.editStepButton, this.deleteStepButton]
|
||||
}]).withLayout({ width: '100%' }).component();
|
||||
title: this.JobStepsTopLabelString
|
||||
},
|
||||
{
|
||||
component: stepMoveContainer,
|
||||
title: this.StartStepDropdownString
|
||||
},
|
||||
{
|
||||
component: stepsDialogContainer,
|
||||
title: ''
|
||||
}
|
||||
]).withLayout({ width: '100%' }).component();
|
||||
await view.initializeModel(formModel);
|
||||
this.setConditionDropdownSelectedValue(this.startStepDropdown, this.model.startStepId);
|
||||
});
|
||||
}
|
||||
|
||||
private initializeAlertsTab() {
|
||||
this.alertsTab.registerContent(async view => {
|
||||
let previewTag = view.modelBuilder.text()
|
||||
.withProperties({
|
||||
value: 'Feature Preview'
|
||||
}).component();
|
||||
let alerts = this.model.alerts ? this.model.alerts : [];
|
||||
let data = this.convertAlertsToData(alerts);
|
||||
this.alertsTable = view.modelBuilder.table()
|
||||
.withProperties({
|
||||
columns: [
|
||||
this.AlertNameLabelString
|
||||
this.AlertNameLabelString,
|
||||
this.AlertEnabledLabelString,
|
||||
this.AlertTypeLabelString
|
||||
],
|
||||
data: [],
|
||||
height: 430,
|
||||
data: data,
|
||||
height: 750,
|
||||
width: 400
|
||||
}).component();
|
||||
|
||||
@@ -286,18 +423,24 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
width: 80
|
||||
}).component();
|
||||
|
||||
this.newAlertButton.onDidClick((e)=>{
|
||||
let alertDialog = new AlertDialog(this.model.ownerUri, null, []);
|
||||
alertDialog.onSuccess((dialogModel) => {
|
||||
});
|
||||
alertDialog.openDialog();
|
||||
let alertDialog = new AlertDialog(this.model.ownerUri, this.model, null, true);
|
||||
alertDialog.onSuccess((alert) => {
|
||||
let alertInfo = alert.toAgentAlertInfo();
|
||||
this.alerts.push(alertInfo);
|
||||
this.alertsTable.data = this.convertAlertsToData(this.alerts);
|
||||
});
|
||||
this.newAlertButton.onDidClick(()=>{
|
||||
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
|
||||
alertDialog.jobId = this.model.jobId;
|
||||
alertDialog.jobName = this.model.name ? this.model.name : this.nameTextBox.value;
|
||||
alertDialog.openDialog();
|
||||
} else {
|
||||
this.dialog.message = { text: this.BlankJobNameErrorText };
|
||||
}
|
||||
});
|
||||
|
||||
let formModel = view.modelBuilder.formContainer()
|
||||
.withFormItems([{
|
||||
component: previewTag,
|
||||
title: ''
|
||||
}, {
|
||||
component: this.alertsTable,
|
||||
title: this.AlertsTopLabelString,
|
||||
actions: [this.newAlertButton]
|
||||
@@ -312,10 +455,12 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
this.schedulesTable = view.modelBuilder.table()
|
||||
.withProperties({
|
||||
columns: [
|
||||
this.ScheduleNameLabelString
|
||||
PickScheduleDialog.SchedulesIDText,
|
||||
PickScheduleDialog.ScheduleNameLabelText,
|
||||
PickScheduleDialog.ScheduleDescription
|
||||
],
|
||||
data: [],
|
||||
height: 430,
|
||||
height: 750,
|
||||
width: 420
|
||||
}).component();
|
||||
|
||||
@@ -323,13 +468,16 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
label: this.PickScheduleButtonString,
|
||||
width: 80
|
||||
}).component();
|
||||
|
||||
this.pickScheduleButton.onDidClick((e)=>{
|
||||
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri);
|
||||
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri, this.model.name);
|
||||
pickScheduleDialog.onSuccess((dialogModel) => {
|
||||
let selectedSchedule = dialogModel.selectedSchedule;
|
||||
if (selectedSchedule) {
|
||||
this.model.addJobSchedule(selectedSchedule);
|
||||
let existingSchedule = this.schedules.find(item => item.name === selectedSchedule.name);
|
||||
if (!existingSchedule) {
|
||||
selectedSchedule.jobName = this.model.name ? this.model.name : this.nameTextBox.value;
|
||||
this.schedules.push(selectedSchedule);
|
||||
}
|
||||
this.populateScheduleTable();
|
||||
}
|
||||
});
|
||||
@@ -350,13 +498,10 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
}
|
||||
|
||||
private populateScheduleTable() {
|
||||
if (this.model.jobSchedules) {
|
||||
let data: any[][] = [];
|
||||
for (let i = 0; i < this.model.jobSchedules.length; ++i) {
|
||||
let schedule = this.model.jobSchedules[i];
|
||||
data[i] = [ schedule.name ];
|
||||
}
|
||||
let data = this.convertSchedulesToData(this.schedules);
|
||||
if (data.length > 0) {
|
||||
this.schedulesTable.data = data;
|
||||
this.schedulesTable.height = 750;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,6 +611,44 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
});
|
||||
}
|
||||
|
||||
private convertStepsToData(jobSteps: sqlops.AgentJobStepInfo[]): any[][] {
|
||||
let result = [];
|
||||
jobSteps.forEach(jobStep => {
|
||||
let cols = [];
|
||||
cols.push(jobStep.id);
|
||||
cols.push(jobStep.stepName);
|
||||
cols.push(jobStep.subSystem);
|
||||
cols.push(jobStep.successAction);
|
||||
cols.push(jobStep.failureAction);
|
||||
result.push(cols);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
private convertSchedulesToData(jobSchedules: sqlops.AgentJobScheduleInfo[]): any[][] {
|
||||
let result = [];
|
||||
jobSchedules.forEach(schedule => {
|
||||
let cols = [];
|
||||
cols.push(schedule.id);
|
||||
cols.push(schedule.name);
|
||||
cols.push(schedule.description);
|
||||
result.push(cols);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
private convertAlertsToData(alerts: sqlops.AgentAlertInfo[]): any[][] {
|
||||
let result = [];
|
||||
alerts.forEach(alert => {
|
||||
let cols = [];
|
||||
cols.push(alert.name);
|
||||
cols.push(alert.isEnabled);
|
||||
cols.push(alert.alertType.toString());
|
||||
result.push(cols);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
protected updateModel() {
|
||||
this.model.name = this.nameTextBox.value;
|
||||
this.model.owner = this.ownerTextBox.value;
|
||||
@@ -478,5 +661,18 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
this.model.pageLevel = this.getActualConditionValue(this.pagerCheckBox, this.pagerConditionDropdown);
|
||||
this.model.eventLogLevel = this.getActualConditionValue(this.eventLogCheckBox, this.eventLogConditionDropdown);
|
||||
this.model.deleteLevel = this.getActualConditionValue(this.deleteJobCheckBox, this.deleteJobConditionDropdown);
|
||||
this.model.startStepId = +this.getDropdownValue(this.startStepDropdown);
|
||||
if (!this.model.jobSteps) {
|
||||
this.model.jobSteps = [];
|
||||
}
|
||||
this.model.jobSteps = this.steps;
|
||||
if (!this.model.jobSchedules) {
|
||||
this.model.jobSchedules = [];
|
||||
}
|
||||
this.model.jobSchedules = this.schedules;
|
||||
if (!this.model.alerts) {
|
||||
this.model.alerts = [];
|
||||
}
|
||||
this.model.alerts = this.alerts;
|
||||
}
|
||||
}
|
||||
@@ -9,16 +9,19 @@ import * as vscode from 'vscode';
|
||||
import { JobStepData } from '../data/jobStepData';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { JobData } from '../data/jobData';
|
||||
import { AgentDialog } from './agentDialog';
|
||||
import { AgentDialogMode } from '../interfaces';
|
||||
const path = require('path');
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class JobStepDialog {
|
||||
export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
|
||||
// TODO: localize
|
||||
// Top level
|
||||
//
|
||||
private readonly DialogTitle: string = localize('jobStepDialog.newJobStep', 'New Job Step');
|
||||
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');
|
||||
@@ -64,10 +67,12 @@ export class JobStepDialog {
|
||||
private readonly QuitJobReportingSuccess: string = localize('jobStepDialog.quitJobSuccess', 'Quit the job reporting success');
|
||||
private readonly QuitJobReportingFailure: string = localize('jobStepDialog.quitJobFailure', 'Quit the job reporting failure');
|
||||
|
||||
// Event Name strings
|
||||
private readonly NewStepDialog = 'NewStepDialogOpened';
|
||||
private readonly EditStepDialog = 'EditStepDialogOpened';
|
||||
// UI Components
|
||||
|
||||
// Dialogs
|
||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||
private fileBrowserDialog: sqlops.window.modelviewdialog.Dialog;
|
||||
|
||||
// Dialog tabs
|
||||
@@ -102,38 +107,40 @@ export class JobStepDialog {
|
||||
// Checkbox
|
||||
private appendToExistingFileCheckbox: sqlops.CheckBoxComponent;
|
||||
private logToTableCheckbox: sqlops.CheckBoxComponent;
|
||||
private logStepOutputHistoryCheckbox: sqlops.CheckBoxComponent;
|
||||
|
||||
private fileBrowserTree: sqlops.FileBrowserTreeComponent;
|
||||
private jobModel: JobData;
|
||||
private model: JobStepData;
|
||||
private ownerUri: string;
|
||||
private jobName: string;
|
||||
public jobName: string;
|
||||
private server: string;
|
||||
private stepId: number;
|
||||
private isEdit: boolean;
|
||||
|
||||
constructor(
|
||||
ownerUri: string,
|
||||
jobName: string,
|
||||
server: string,
|
||||
stepId: number,
|
||||
jobModel?: JobData
|
||||
jobModel: JobData,
|
||||
jobStepInfo?: sqlops.AgentJobStepInfo,
|
||||
viaJobDialog: boolean = false
|
||||
) {
|
||||
this.model = new JobStepData(ownerUri);
|
||||
this.stepId = stepId;
|
||||
this.ownerUri = ownerUri;
|
||||
this.jobName = jobName;
|
||||
this.server = server;
|
||||
super(ownerUri,
|
||||
jobStepInfo ? JobStepData.convertToJobStepData(jobStepInfo, jobModel) : new JobStepData(ownerUri, jobModel, viaJobDialog),
|
||||
jobStepInfo ? JobStepDialog.EditDialogTitle : JobStepDialog.NewDialogTitle);
|
||||
this.stepId = jobStepInfo ?
|
||||
jobStepInfo.id : jobModel.jobSteps ?
|
||||
jobModel.jobSteps.length + 1 : 1;
|
||||
this.isEdit = jobStepInfo ? true : false;
|
||||
this.model.dialogMode = this.isEdit ? AgentDialogMode.EDIT : AgentDialogMode.CREATE;
|
||||
this.jobModel = jobModel;
|
||||
this.jobName = this.jobName ? this.jobName : this.jobModel.name;
|
||||
this.server = server;
|
||||
this.dialogName = this.isEdit ? this.EditStepDialog : this.NewStepDialog;
|
||||
}
|
||||
|
||||
private initializeUIComponents() {
|
||||
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
|
||||
this.advancedTab = sqlops.window.modelviewdialog.createTab(this.AdvancedTabText);
|
||||
this.dialog.content = [this.generalTab, this.advancedTab];
|
||||
this.dialog.okButton.onClick(async () => await this.execute());
|
||||
this.dialog.okButton.label = this.OkButtonText;
|
||||
this.dialog.cancelButton.label = this.CancelButtonText;
|
||||
}
|
||||
|
||||
private createCommands(view, queryProvider: sqlops.QueryProvider) {
|
||||
@@ -262,6 +269,14 @@ export class JobStepDialog {
|
||||
let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component();
|
||||
formWrapper.loading = false;
|
||||
await view.initializeModel(formWrapper);
|
||||
|
||||
// Load values for edit scenario
|
||||
if (this.isEdit) {
|
||||
this.nameTextBox.value = this.model.stepName;
|
||||
this.typeDropdown.value = this.model.subSystem;
|
||||
this.databaseDropdown.value = this.model.databaseName;
|
||||
this.commandTextBox.value = this.model.command;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -298,7 +313,7 @@ export class JobStepDialog {
|
||||
let logToTableContainer = view.modelBuilder.flexContainer()
|
||||
.withLayout({ flexFlow: 'row', justifyContent: 'space-between', width: 300 })
|
||||
.withItems([this.logToTableCheckbox]).component();
|
||||
let logStepOutputHistoryCheckbox = view.modelBuilder.checkBox()
|
||||
this.logStepOutputHistoryCheckbox = view.modelBuilder.checkBox()
|
||||
.withProperties({ label: this.IncludeStepOutputHistoryLabel }).component();
|
||||
this.userInputBox = view.modelBuilder.inputBox()
|
||||
.withProperties({ inputType: 'text', width: '100%' }).component();
|
||||
@@ -323,7 +338,7 @@ export class JobStepDialog {
|
||||
component: appendCheckboxContainer,
|
||||
title: ' '
|
||||
}, {
|
||||
component: logStepOutputHistoryCheckbox,
|
||||
component: this.logStepOutputHistoryCheckbox,
|
||||
title: ''
|
||||
}, {
|
||||
component: this.userInputBox,
|
||||
@@ -334,7 +349,19 @@ export class JobStepDialog {
|
||||
|
||||
let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component();
|
||||
formWrapper.loading = false;
|
||||
view.initializeModel(formWrapper);
|
||||
await view.initializeModel(formWrapper);
|
||||
|
||||
if (this.isEdit) {
|
||||
this.successActionDropdown.value = this.model.successAction;
|
||||
this.retryAttemptsBox.value = this.model.retryAttempts.toString();
|
||||
this.retryIntervalBox.value = this.model.retryInterval.toString();
|
||||
this.failureActionDropdown.value = this.model.failureAction;
|
||||
this.outputFileNameBox.value = this.model.outputFileName;
|
||||
this.appendToExistingFileCheckbox.checked = this.model.appendToLogFile;
|
||||
this.logToTableCheckbox.checked = this.model.appendLogToTable;
|
||||
this.logStepOutputHistoryCheckbox.checked = this.model.appendToStepHist;
|
||||
this.userInputBox.value = this.model.databaseUserName;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -478,7 +505,7 @@ export class JobStepDialog {
|
||||
return outputFileForm;
|
||||
}
|
||||
|
||||
protected execute() {
|
||||
protected updateModel() {
|
||||
this.model.stepName = this.nameTextBox.value;
|
||||
if (!this.model.stepName || this.model.stepName.length === 0) {
|
||||
this.dialog.message = this.dialog.message = { text: this.BlankStepNameErrorText };
|
||||
@@ -487,7 +514,6 @@ export class JobStepDialog {
|
||||
this.model.jobName = this.jobName;
|
||||
this.model.id = this.stepId;
|
||||
this.model.server = this.server;
|
||||
this.model.stepName = this.nameTextBox.value;
|
||||
this.model.subSystem = this.typeDropdown.value as string;
|
||||
this.model.databaseName = this.databaseDropdown.value as string;
|
||||
this.model.script = this.commandTextBox.value;
|
||||
@@ -497,14 +523,23 @@ export class JobStepDialog {
|
||||
this.model.failureAction = this.failureActionDropdown.value as string;
|
||||
this.model.outputFileName = this.outputFileNameBox.value;
|
||||
this.model.appendToLogFile = this.appendToExistingFileCheckbox.checked;
|
||||
this.model.command = this.commandTextBox.value ? this.commandTextBox.value : '';
|
||||
}
|
||||
|
||||
public async openNewStepDialog() {
|
||||
public async initializeDialog() {
|
||||
let databases = await AgentUtils.getDatabases(this.ownerUri);
|
||||
let queryProvider = await AgentUtils.getQueryProvider();
|
||||
this.initializeUIComponents();
|
||||
this.createGeneralTab(databases, queryProvider);
|
||||
this.createAdvancedTab();
|
||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||
this.dialog.registerCloseValidator(() => {
|
||||
this.updateModel();
|
||||
let validationResult = this.model.validate();
|
||||
if (!validationResult.valid) {
|
||||
// TODO: Show Error Messages
|
||||
console.error(validationResult.errorMessages.join(','));
|
||||
}
|
||||
return validationResult.valid;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
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 schdule');
|
||||
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');
|
||||
@@ -43,6 +43,10 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
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';
|
||||
private readonly EditOperatorDialog = 'EditOperatorDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||
private notificationsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||
@@ -68,12 +72,15 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
|
||||
// Notification tab controls
|
||||
private alertsTable: sqlops.TableComponent;
|
||||
private isEdit: boolean = false;
|
||||
|
||||
constructor(ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo = undefined) {
|
||||
super(
|
||||
ownerUri,
|
||||
new OperatorData(ownerUri, operatorInfo),
|
||||
operatorInfo ? OperatorDialog.EditDialogTitle : OperatorDialog.CreateDialogTitle);
|
||||
this.isEdit = operatorInfo ? true : false;
|
||||
this.dialogName = this.isEdit ? this.EditOperatorDialog : this.NewOperatorDialog;
|
||||
}
|
||||
|
||||
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
|
||||
|
||||
@@ -18,8 +18,11 @@ export class PickScheduleDialog {
|
||||
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 ScheduleNameLabelText: string = localize('pickSchedule.scheduleName', 'Schedule Name');
|
||||
private readonly SchedulesLabelText: string = localize('pickSchedule.schedules', 'Schedules');
|
||||
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
|
||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||
@@ -30,8 +33,8 @@ export class PickScheduleDialog {
|
||||
private _onSuccess: vscode.EventEmitter<PickScheduleData> = new vscode.EventEmitter<PickScheduleData>();
|
||||
public readonly onSuccess: vscode.Event<PickScheduleData> = this._onSuccess.event;
|
||||
|
||||
constructor(ownerUri: string) {
|
||||
this.model = new PickScheduleData(ownerUri);
|
||||
constructor(ownerUri: string, jobName: string) {
|
||||
this.model = new PickScheduleData(ownerUri, jobName);
|
||||
}
|
||||
|
||||
public async showDialog() {
|
||||
@@ -50,11 +53,13 @@ export class PickScheduleDialog {
|
||||
this.schedulesTable = view.modelBuilder.table()
|
||||
.withProperties({
|
||||
columns: [
|
||||
this.ScheduleNameLabelText
|
||||
PickScheduleDialog.SchedulesIDText,
|
||||
PickScheduleDialog.ScheduleNameLabelText,
|
||||
PickScheduleDialog.ScheduleDescription
|
||||
],
|
||||
data: [],
|
||||
height: '80em',
|
||||
width: '40em'
|
||||
height: 750,
|
||||
width: 430
|
||||
}).component();
|
||||
|
||||
let formModel = view.modelBuilder.formContainer()
|
||||
@@ -69,7 +74,7 @@ export class PickScheduleDialog {
|
||||
let data: any[][] = [];
|
||||
for (let i = 0; i < this.model.schedules.length; ++i) {
|
||||
let schedule = this.model.schedules[i];
|
||||
data[i] = [ schedule.name ];
|
||||
data[i] = [ schedule.id, schedule.name, schedule.description ];
|
||||
}
|
||||
this.schedulesTable.data = data;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||
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';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||
|
||||
@@ -56,6 +59,7 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||
private powershellCheckBox: sqlops.CheckBoxComponent;
|
||||
|
||||
private credentials: sqlops.CredentialInfo[];
|
||||
private isEdit: boolean = false;
|
||||
|
||||
constructor(ownerUri: string, proxyInfo: sqlops.AgentProxyInfo = undefined, credentials: sqlops.CredentialInfo[]) {
|
||||
super(
|
||||
@@ -63,6 +67,8 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||
new ProxyData(ownerUri, proxyInfo),
|
||||
proxyInfo ? ProxyDialog.EditDialogTitle : ProxyDialog.CreateDialogTitle);
|
||||
this.credentials = credentials;
|
||||
this.isEdit = proxyInfo ? true : false;
|
||||
this.dialogName = this.isEdit ? this.EditProxyDialog : this.NewProxyDialog;
|
||||
}
|
||||
|
||||
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
|
||||
|
||||
@@ -13,5 +13,5 @@ export enum AgentDialogMode {
|
||||
export interface IAgentDialogData {
|
||||
dialogMode: AgentDialogMode;
|
||||
initialize(): void;
|
||||
save(): void;
|
||||
save(): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import { OperatorDialog } from './dialogs/operatorDialog';
|
||||
import { ProxyDialog } from './dialogs/proxyDialog';
|
||||
import { JobStepDialog } from './dialogs/jobStepDialog';
|
||||
import { PickScheduleDialog } from './dialogs/pickScheduleDialog';
|
||||
import { JobData } from './data/jobData';
|
||||
import { AgentUtils } from './agentUtils';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -38,29 +40,33 @@ export class MainController {
|
||||
public activate(): void {
|
||||
vscode.commands.registerCommand('agent.openJobDialog', (ownerUri: string, jobInfo: sqlops.AgentJobInfo) => {
|
||||
let dialog = new JobDialog(ownerUri, jobInfo);
|
||||
dialog.openDialog();
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, jobId: string, server: string, stepId: number) => {
|
||||
let dialog = new JobStepDialog(ownerUri, jobId, server, stepId);
|
||||
dialog.openNewStepDialog();
|
||||
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, server: string, jobInfo: sqlops.AgentJobInfo, jobStepInfo: sqlops.AgentJobStepInfo) => {
|
||||
AgentUtils.getAgentService().then((agentService) => {
|
||||
let jobData: JobData = new JobData(ownerUri, jobInfo, agentService);
|
||||
let dialog = new JobStepDialog(ownerUri, server, jobData, jobStepInfo, false);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openPickScheduleDialog', (ownerUri: string) => {
|
||||
let dialog = new PickScheduleDialog(ownerUri);
|
||||
vscode.commands.registerCommand('agent.openPickScheduleDialog', (ownerUri: string, jobName: string) => {
|
||||
let dialog = new PickScheduleDialog(ownerUri, jobName);
|
||||
dialog.showDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openAlertDialog', (ownerUri: string, alertInfo: sqlops.AgentAlertInfo, jobs: string[]) => {
|
||||
let dialog = new AlertDialog(ownerUri, alertInfo, jobs);
|
||||
dialog.openDialog();
|
||||
vscode.commands.registerCommand('agent.openAlertDialog', (ownerUri: string, jobInfo: sqlops.AgentJobInfo, alertInfo: sqlops.AgentAlertInfo) => {
|
||||
AgentUtils.getAgentService().then((agentService) => {
|
||||
let jobData: JobData = new JobData(ownerUri, jobInfo, agentService);
|
||||
let dialog = new AlertDialog(ownerUri, jobData, alertInfo, false);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openOperatorDialog', (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo) => {
|
||||
let dialog = new OperatorDialog(ownerUri, operatorInfo);
|
||||
dialog.openDialog();
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openProxyDialog', (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo, credentials: sqlops.CredentialInfo[]) => {
|
||||
//@TODO: reenable create proxy after snapping July release (7/14/18)
|
||||
// let dialog = new ProxyDialog(ownerUri, proxyInfo, credentials);
|
||||
// dialog.openDialog();
|
||||
MainController.showNotYetImplemented();
|
||||
let dialog = new ProxyDialog(ownerUri, proxyInfo, credentials);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export class TestAgentService implements sqlops.AgentServicesProvider {
|
||||
getJobs(ownerUri: string): Thenable<sqlops.AgentJobsResult> {
|
||||
return undefined;
|
||||
}
|
||||
getJobHistory(ownerUri: string, jobId: string): Thenable<sqlops.AgentJobHistoryResult> {
|
||||
getJobHistory(ownerUri: string, jobId: string, jobName: string): Thenable<sqlops.AgentJobHistoryResult> {
|
||||
return undefined;
|
||||
}
|
||||
jobAction(ownerUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus> {
|
||||
|
||||
@@ -5,38 +5,46 @@
|
||||
ansi-regex@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
|
||||
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
|
||||
|
||||
charenc@~0.0.1:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
|
||||
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=
|
||||
|
||||
crypt@~0.0.1:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
|
||||
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=
|
||||
|
||||
debug@^2.2.0:
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
is-buffer@~1.1.1:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||
|
||||
lodash@^4.16.4:
|
||||
version "4.17.10"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
|
||||
integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
|
||||
|
||||
md5@^2.1.0:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9"
|
||||
integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=
|
||||
dependencies:
|
||||
charenc "~0.0.1"
|
||||
crypt "~0.0.1"
|
||||
@@ -45,16 +53,19 @@ md5@^2.1.0:
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
|
||||
|
||||
mkdirp@~0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mocha-junit-reporter@^1.17.0:
|
||||
version "1.17.0"
|
||||
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.17.0.tgz#2e5149ed40fc5d2e3ca71e42db5ab1fec9c6d85c"
|
||||
integrity sha1-LlFJ7UD8XS48px5C21qx/snG2Fw=
|
||||
dependencies:
|
||||
debug "^2.2.0"
|
||||
md5 "^2.1.0"
|
||||
@@ -65,6 +76,7 @@ mocha-junit-reporter@^1.17.0:
|
||||
mocha-multi-reporters@^1.1.7:
|
||||
version "1.1.7"
|
||||
resolved "https://registry.yarnpkg.com/mocha-multi-reporters/-/mocha-multi-reporters-1.1.7.tgz#cc7f3f4d32f478520941d852abb64d9988587d82"
|
||||
integrity sha1-zH8/TTL0eFIJQdhSq7ZNmYhYfYI=
|
||||
dependencies:
|
||||
debug "^3.1.0"
|
||||
lodash "^4.16.4"
|
||||
@@ -72,17 +84,21 @@ mocha-multi-reporters@^1.1.7:
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
strip-ansi@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
|
||||
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
|
||||
dependencies:
|
||||
ansi-regex "^3.0.0"
|
||||
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.2.tgz#3817eca5b985c2393de325197cf4e15eb2aa5350"
|
||||
integrity sha512-/Ur1+tgazwd51+ncRyoy0UIu4dvMdVXS9XMUULQlZIBoNGEwOhwEx9x+hHWoUjldMrOQ32t2CGKo0u6D4R6/hg==
|
||||
|
||||
xml@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
|
||||
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=
|
||||
|
||||
21
extensions/azurecore/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Azure (Core) extension for Azure Data Studio
|
||||
|
||||
Welcome to the Azure (Core) extension for Azure Data Studio! This extension supports core Azure functionality such as browsing and connecting to Azure data endpoints. In the current release the following features are supported:
|
||||
|
||||
* Log in to Azure and browse your accounts, subscriptions and data resources
|
||||
* See Azure SQL Databases and Servers in the tree, and open these connections in Object Explorer
|
||||
* Filter the list of subscriptions for a given account, to make finding specific databases easier
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Privacy Statement
|
||||
|
||||
The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement) describes the privacy statement of this software.
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt).
|
||||
172
extensions/azurecore/package.json
Normal file
@@ -0,0 +1,172 @@
|
||||
{
|
||||
"name": "azurecore",
|
||||
"displayName": "%azure.displayName%",
|
||||
"description": "%azure.description",
|
||||
"version": "0.1.0",
|
||||
"publisher": "Microsoft",
|
||||
"preview": true,
|
||||
"engines": {
|
||||
"vscode": "^1.25.0",
|
||||
"sqlops": "*"
|
||||
},
|
||||
"activationEvents": [
|
||||
"*"
|
||||
],
|
||||
"main": "./out/extension",
|
||||
"contributes": {
|
||||
"configuration": [
|
||||
{
|
||||
"type": "object",
|
||||
"title": "%azure.resource.config.title%",
|
||||
"properties": {
|
||||
"azure.resource.config.filter": {
|
||||
"type": "array",
|
||||
"default": null,
|
||||
"description": "%azure.resource.config.filter.description%"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"title": "Azure Account Configuration",
|
||||
"properties": {
|
||||
"accounts.azure.enablePublicCloud": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "%config.enablePublicCloudDescription%"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"account-type": [
|
||||
{
|
||||
"id": "microsoft",
|
||||
"icon": {
|
||||
"light": "./out/account-provider/media/microsoft_account_light.svg",
|
||||
"dark": "./out/account-provider/media/microsoft_account_dark.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "work_school",
|
||||
"icon": {
|
||||
"light": "./out/account-provider/media/work_school_account_light.svg",
|
||||
"dark": "./out/account-provider/media/work_school_account_dark.svg"
|
||||
}
|
||||
}
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"command": "accounts.clearTokenCache",
|
||||
"title": "%accounts.clearTokenCache%",
|
||||
"category": "Azure Accounts"
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.refreshall",
|
||||
"title": "%azure.resource.refreshall.title%",
|
||||
"icon": {
|
||||
"dark": "resources/dark/refresh_inverse.svg",
|
||||
"light": "resources/light/refresh.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.refresh",
|
||||
"title": "%azure.resource.refresh.title%",
|
||||
"icon": {
|
||||
"dark": "resources/dark/refresh_inverse.svg",
|
||||
"light": "resources/light/refresh.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.signin",
|
||||
"title": "%azure.resource.signin.title%"
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.selectsubscriptions",
|
||||
"title": "%azure.resource.selectsubscriptions.title%",
|
||||
"icon": {
|
||||
"dark": "resources/dark/filter_inverse.svg",
|
||||
"light": "resources/light/filter.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.connectsqlserver",
|
||||
"title": "%azure.resource.connectsqlserver.title%",
|
||||
"icon": {
|
||||
"dark": "resources/dark/connect_to_inverse.svg",
|
||||
"light": "resources/light/connect_to.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.connectsqldb",
|
||||
"title": "%azure.resource.connectsqldb.title%",
|
||||
"icon": {
|
||||
"dark": "resources/dark/connect_to_inverse.svg",
|
||||
"light": "resources/light/connect_to.svg"
|
||||
}
|
||||
}
|
||||
],
|
||||
"viewsContainers": {
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "azureResource",
|
||||
"title": "%azure.title%",
|
||||
"icon": "resources/azure.svg"
|
||||
}
|
||||
]
|
||||
},
|
||||
"views": {
|
||||
"azureResource": [
|
||||
{
|
||||
"id": "azureResourceExplorer",
|
||||
"name": "%azure.resource.explorer.title%"
|
||||
}
|
||||
]
|
||||
},
|
||||
"menus": {
|
||||
"view/title": [
|
||||
{
|
||||
"command": "azure.resource.refreshall",
|
||||
"when": "view == azureResourceExplorer",
|
||||
"group": "navigation@1"
|
||||
}
|
||||
],
|
||||
"view/item/context": [
|
||||
{
|
||||
"command": "azure.resource.selectsubscriptions",
|
||||
"when": "viewItem == azure.resource.itemType.account",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.refresh",
|
||||
"when": "viewItem =~ /^azure\\.resource\\.itemType\\.(?:account|subscription|databaseContainer|databaseServerContainer)$/",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.connectsqlserver",
|
||||
"when": "viewItem == azure.resource.itemType.databaseServer",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "azure.resource.connectsqldb",
|
||||
"when": "viewItem == azure.resource.itemType.database",
|
||||
"group": "inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hasAzureResourceProviders": true
|
||||
},
|
||||
"dependencies": {
|
||||
"azure-arm-resource": "^7.0.0",
|
||||
"azure-arm-sql": "^5.0.1",
|
||||
"request": "2.88.0",
|
||||
"vscode-nls": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^5.2.5",
|
||||
"@types/node": "^8.0.24",
|
||||
"mocha": "^5.2.0",
|
||||
"should": "^13.2.1",
|
||||
"vscode": "^1.1.26",
|
||||
"typemoq": "^2.1.0"
|
||||
}
|
||||
}
|
||||
22
extensions/azurecore/package.nls.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"azure.displayName": "Azure (Core)",
|
||||
"azure.description": "Browse and work with Azure resources",
|
||||
"azure.title": "Azure",
|
||||
|
||||
"azure.resource.config.title": "Azure Resource Configuration",
|
||||
"azure.resource.config.filter.description": "The resource filter, each element is an account id, a subscription id and name separated by a slash",
|
||||
"azure.resource.explorer.title": "Resource Explorer",
|
||||
"azure.resource.refreshall.title": "Refresh All",
|
||||
"azure.resource.refresh.title": "Refresh",
|
||||
"azure.resource.signin.title": "Sign In",
|
||||
"azure.resource.selectsubscriptions.title": "Select Subscriptions",
|
||||
"azure.resource.connectsqlserver.title": "Connect",
|
||||
"azure.resource.connectsqldb.title": "Connect",
|
||||
|
||||
"accounts.clearTokenCache": "Clear Azure Account Token Cache",
|
||||
|
||||
"config.enablePublicCloudDescription": "Should Azure public cloud integration be enabled",
|
||||
"config.enableUsGovCloudDescription": "Should US Government Azure cloud (Fairfax) integration be enabled",
|
||||
"config.enableChinaCloudDescription": "Should Azure China integration be enabled",
|
||||
"config.enableGermanyCloudDescription": "Should Azure Germany integration be enabled"
|
||||
}
|
||||
6
extensions/azurecore/resources/azure.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="28" width="28" version="1.1" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<path fill="#0072C6" d="M11.423,44.326l23.623-4.156L22.894,25.748l6.328-17.346L50,44.33L11.423,44.326z M27.566,5.67L11.469,40.109v-0.034H0l12.717-21.975L27.566,5.67z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 331 B |
1
extensions/azurecore/resources/dark/account_inverse.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>account_inverse</title><path class="cls-1" d="M8,.11a7.71,7.71,0,1,0,7.72,7.72A7.73,7.73,0,0,0,8,.11ZM4.2,13.36a4,4,0,0,1,.13-.93,3.69,3.69,0,0,1,1-1.66A3.56,3.56,0,0,1,6,10.19a4,4,0,0,1,.9-.38,4.17,4.17,0,0,1,1-.13A3.79,3.79,0,0,1,9.43,10a3.61,3.61,0,0,1,2,2,3.74,3.74,0,0,1,.29,1.47A6.62,6.62,0,0,1,8,14.54,6.71,6.71,0,0,1,4.2,13.36Zm2-5a2.76,2.76,0,0,1-.54-.79,2.43,2.43,0,0,1-.19-1,2.4,2.4,0,0,1,.19-1,2.82,2.82,0,0,1,.54-.8A2.81,2.81,0,0,1,7,4.25a2.4,2.4,0,0,1,1-.19,2.43,2.43,0,0,1,1,.19,2.76,2.76,0,0,1,.79.54,2.46,2.46,0,0,1,.54.8,2.4,2.4,0,0,1,.2,1,2.44,2.44,0,0,1-.2,1A2.59,2.59,0,0,1,8.92,8.86a2.44,2.44,0,0,1-1,.2,2.4,2.4,0,0,1-1-.2A2.46,2.46,0,0,1,6.18,8.32ZM12.3,13a4.39,4.39,0,0,0-.18-.89,4.22,4.22,0,0,0-.57-1.19A4.24,4.24,0,0,0,9.44,9.31a3.41,3.41,0,0,0,.68-.5A3.36,3.36,0,0,0,11,7.39a3.32,3.32,0,0,0,.11-.83,3.09,3.09,0,0,0-.24-1.22,3.26,3.26,0,0,0-.67-1,3,3,0,0,0-1-.67,3,3,0,0,0-1.22-.25,2.93,2.93,0,0,0-1.22.25A3.07,3.07,0,0,0,5.07,5.34a2.93,2.93,0,0,0-.25,1.22,3,3,0,0,0,.12.84,3,3,0,0,0,.32.76,3.3,3.3,0,0,0,.52.65,3.06,3.06,0,0,0,.68.5A4.41,4.41,0,0,0,5.27,10a4.1,4.1,0,0,0-.91,1,4.18,4.18,0,0,0-.58,1.18,4.41,4.41,0,0,0-.18.8A6.66,6.66,0,0,1,1.28,7.83,6.72,6.72,0,1,1,12.3,13Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16"><defs><style>.cls-1,.cls-2{clip-rule:evenodd;}.cls-2,.cls-5,.cls-7{fill:#fff;}.cls-3,.cls-5{fill-rule:evenodd;}.cls-4{clip-path:url(#clip-path);}.cls-6{clip-path:url(#clip-path-2);}</style><clipPath id="clip-path"><path class="cls-1" d="M11.5-15.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5-9v6h-1V-9a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1,2.53,2.53,0,0,0,.53.8,2.53,2.53,0,0,0,.8.53,2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath><clipPath id="clip-path-2"><path class="cls-2" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath></defs><title>connect_to_inverse</title><path class="cls-3" d="M11.5-15.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5-9v6h-1V-9a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1,2.53,2.53,0,0,0,.53.8,2.53,2.53,0,0,0,.8.53,2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-4"><rect x="-0.5" y="-23.92" width="17" height="26"/></g><path class="cls-5" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-6"><rect class="cls-7" x="-0.5" y="-5" width="17" height="26"/></g></svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
1
extensions/azurecore/resources/dark/filter_inverse.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{font-size:12px;font-family:FullMDL2Assets, Full MDL2 Assets;}.cls-1,.cls-2{fill:#fff;}</style></defs><title>filter_inverse_16x16</title><text class="cls-1" transform="translate(0.03 12.1)"> </text><path class="cls-2" d="M.05,1.63H16V3.33l-6,6v6.27H6V9.31l-6-6ZM15,2.91V2.62H1v.29l6,6v5.69H9V8.89Z"/></svg>
|
||||
|
After Width: | Height: | Size: 418 B |
1
extensions/azurecore/resources/dark/folder_inverse.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#231f20;}.cls-2{fill:#fff;}</style></defs><title>folder_inverse_16x16</title><polygon class="cls-1" points="13.59 2.34 13.58 2.35 13.58 2.33 13.59 2.34"/><text></text><path class="cls-2" d="M16,14.13H0v-12a1,1,0,0,1,.08-.39,1,1,0,0,1,.53-.53A1,1,0,0,1,1,1.13H4.75a2.16,2.16,0,0,1,.61.07,2.26,2.26,0,0,1,.45.18,2.14,2.14,0,0,1,.36.24l.32.24a1.8,1.8,0,0,0,.34.18,1.12,1.12,0,0,0,.43.07H15a1,1,0,0,1,.39.08,1,1,0,0,1,.53.53,1,1,0,0,1,.08.39ZM1,2.13v1H4.75a1.36,1.36,0,0,0,.33,0A1,1,0,0,0,5.34,3l.23-.16.25-.21-.25-.21-.23-.16a1,1,0,0,0-.26-.1,1.36,1.36,0,0,0-.33,0Zm14,11v-10H7.25a1.12,1.12,0,0,0-.43.07,1.8,1.8,0,0,0-.34.18l-.32.24a2.14,2.14,0,0,1-.36.24,2.26,2.26,0,0,1-.45.18,2.16,2.16,0,0,1-.61.07H1v9Z"/></svg>
|
||||
|
After Width: | Height: | Size: 830 B |
1
extensions/azurecore/resources/dark/refresh_inverse.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z" fill="#2D2D30"/><path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z" fill="#C5C5C5"/></svg>
|
||||
|
After Width: | Height: | Size: 986 B |
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>sql_database_inverse</title><g id="iconBg"><rect class="cls-1" x="8" y="8" width="1.12" height="3.35"/><path class="cls-1" d="M7.75.13C4.25.13,1.3,1.34,1.3,2.59V13.3c0,1.36,3.67,2.57,7.13,2.57s6.27-1.15,6.27-2.46V2.7C14.7,1.39,11.26.13,7.75.13ZM5.77,8H3.53V9.12H5.77v3.35H2.42V11.35H4.65V10.23H2.42V6.89H5.77Zm-.5-4.51L5,3.42a5.74,5.74,0,0,1-.7-.23,1.92,1.92,0,0,1-.56-.33.51.51,0,0,1-.2-.37c0-.69,2-1.25,4.46-1.25s4.47.56,4.47,1.25a.51.51,0,0,1-.2.37,1.92,1.92,0,0,1-.56.33,6.38,6.38,0,0,1-.7.23l-.31.07-.6.11A13.55,13.55,0,0,1,8,3.75a13.55,13.55,0,0,1-2.1-.15ZM11,14,9.44,12.47H6.88V6.89h3.35v4.79l1.51,1.51Zm2.63-1.51H11.35V6.89h1.11v4.46h1.12Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 806 B |
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>sql_server_inverse</title><path id="iconBg" class="cls-1" d="M6.43.14C3,.14.15,1.31.15,2.53V13c0,1.32,3.58,2.49,6.94,2.49a12.79,12.79,0,0,0,1.41-.07,4.86,4.86,0,0,1-1.77-3.24H5.59V6.71H8.85v.82A4.88,4.88,0,0,1,9.93,7v-.3H11v0a4.94,4.94,0,0,1,.54,0,4.86,4.86,0,0,1,1.63.3V2.63C13.19,1.36,9.84.14,6.43.14ZM4.5,7.79H2.33V8.88H4.5v3.26H1.24V11H3.41V10H1.24V6.71H4.5ZM6.64,3.65c-2.4,0-4.34-.55-4.34-1.22S4.24,1.21,6.64,1.21,11,1.75,11,2.43,9,3.65,6.64,3.65Zm0,4.14V11h.06a4.87,4.87,0,0,1,1-2.49V7.79Zm4.89,2.72a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm4.29,1.63a3.18,3.18,0,0,0,.06-.54,3.3,3.3,0,0,0-.06-.55l-1.34-.17a2.85,2.85,0,0,0-.36-.86L15,8.95a4.79,4.79,0,0,0-.78-.78L13.14,9a2.85,2.85,0,0,0-.86-.36l-.17-1.34a3.31,3.31,0,0,0-.55-.06,3.31,3.31,0,0,0-.54.06l-.17,1.34A2.85,2.85,0,0,0,10,9L8.91,8.17a4.74,4.74,0,0,0-.77.78L9,10a3.13,3.13,0,0,0-.36.86L7.27,11a4.89,4.89,0,0,0,0,.55,5.12,5.12,0,0,0,0,.55l1.35.16a2.77,2.77,0,0,0,.36.87l-.84,1.07a4,4,0,0,0,.77.77L10,14.19a3.13,3.13,0,0,0,.86.36L11,15.89a5,5,0,0,0,.54.06,4.86,4.86,0,0,0,.55-.06l.17-1.34a3.13,3.13,0,0,0,.86-.36l1.07.83a4.37,4.37,0,0,0,.78-.77l-.84-1.07a3,3,0,0,0,.36-.87Zm-4.29,1.63a2.17,2.17,0,1,1,2.18-2.17A2.17,2.17,0,0,1,11.56,13.77Zm0-3.26a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Zm0,0a1.09,1.09,0,1,0,1.09,1.09A1.08,1.08,0,0,0,11.56,10.51Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>subscription_inverse</title><path class="cls-1" d="M15.63,5.94A8.32,8.32,0,0,0,14.83,4a8.36,8.36,0,0,0-1.24-1.6A7.69,7.69,0,0,0,12,1.21,7.57,7.57,0,0,0,10.1.41a7.75,7.75,0,0,0-4.2,0A7.9,7.9,0,0,0,4,1.21,7.63,7.63,0,0,0,2.4,2.45,8,8,0,0,0,1.17,4a7.9,7.9,0,0,0-.8,1.89A7.76,7.76,0,0,0,.08,8a7.66,7.66,0,0,0,.28,2.1A7.9,7.9,0,0,0,1.17,12a7.71,7.71,0,0,0,1.24,1.6A8,8,0,0,0,4,14.88a7.78,7.78,0,0,0,1.9.79,7.71,7.71,0,0,0,4.19,0A7.55,7.55,0,0,0,12,14.88,8.1,8.1,0,0,0,14.83,12a8.32,8.32,0,0,0,.8-1.89A7.66,7.66,0,0,0,15.92,8,7.76,7.76,0,0,0,15.63,5.94Zm-1.09,3.9a6.87,6.87,0,0,1-.69,1.62,6.5,6.5,0,0,1-1.06,1.38,7.07,7.07,0,0,1-1.37,1.06,7.21,7.21,0,0,1-1.62.68,6.64,6.64,0,0,1-3.61,0,6.85,6.85,0,0,1-1.62-.68A7.07,7.07,0,0,1,3.2,12.84a5.73,5.73,0,0,1-.9-1.13L5.92,8.1l2.25,2.25,4.5-4.5V8.31h.75V4.56H9.67v.75h2.47l-4,4L5.92,7l-4,4a6.92,6.92,0,0,1-.46-1.2A6.63,6.63,0,0,1,1.21,8a6.74,6.74,0,0,1,.24-1.8,6.48,6.48,0,0,1,.69-1.62A6.42,6.42,0,0,1,3.2,3.24,7.07,7.07,0,0,1,4.57,2.18,6.85,6.85,0,0,1,6.2,1.5a6.91,6.91,0,0,1,3.61,0,7.21,7.21,0,0,1,1.62.68A7.07,7.07,0,0,1,12.8,3.24a6.76,6.76,0,0,1,1.06,1.38,6.87,6.87,0,0,1,.69,1.62A6.74,6.74,0,0,1,14.79,8,6.63,6.63,0,0,1,14.55,9.84Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
extensions/azurecore/resources/light/account.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>account</title><path d="M8,.52a7.71,7.71,0,1,0,7.72,7.72A7.73,7.73,0,0,0,8,.52ZM4.2,13.77a4,4,0,0,1,.13-.93,3.69,3.69,0,0,1,1-1.66A3.56,3.56,0,0,1,6,10.6a4,4,0,0,1,.9-.38,4.17,4.17,0,0,1,1-.13,3.79,3.79,0,0,1,1.48.29,3.61,3.61,0,0,1,2,2,3.74,3.74,0,0,1,.29,1.47A6.62,6.62,0,0,1,8,15,6.71,6.71,0,0,1,4.2,13.77Zm2-5a2.76,2.76,0,0,1-.54-.79,2.43,2.43,0,0,1-.19-1,2.4,2.4,0,0,1,.19-1,2.82,2.82,0,0,1,.54-.8A2.81,2.81,0,0,1,7,4.66a2.4,2.4,0,0,1,1-.19,2.43,2.43,0,0,1,1,.19,2.76,2.76,0,0,1,.79.54,2.46,2.46,0,0,1,.54.8,2.4,2.4,0,0,1,.2,1,2.44,2.44,0,0,1-.2,1A2.59,2.59,0,0,1,8.92,9.27a2.44,2.44,0,0,1-1,.2,2.4,2.4,0,0,1-1-.2A2.46,2.46,0,0,1,6.18,8.73Zm6.12,4.66a4.39,4.39,0,0,0-.18-.89,4.22,4.22,0,0,0-.57-1.19A4.24,4.24,0,0,0,9.44,9.72a3.41,3.41,0,0,0,.68-.5A3.36,3.36,0,0,0,11,7.8,3.32,3.32,0,0,0,11.07,7a3.09,3.09,0,0,0-.24-1.22,3.26,3.26,0,0,0-.67-1,3,3,0,0,0-1-.67,3,3,0,0,0-1.22-.25,2.93,2.93,0,0,0-1.22.25A3.07,3.07,0,0,0,5.07,5.75,2.93,2.93,0,0,0,4.82,7a3,3,0,0,0,.12.84,3,3,0,0,0,.32.76,3.3,3.3,0,0,0,.52.65,3.06,3.06,0,0,0,.68.5,4.41,4.41,0,0,0-1.19.65,4.1,4.1,0,0,0-.91,1,4.18,4.18,0,0,0-.58,1.18,4.41,4.41,0,0,0-.18.8A6.66,6.66,0,0,1,1.28,8.24a6.72,6.72,0,1,1,11,5.15Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
extensions/azurecore/resources/light/connect_to.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16"><defs><style>.cls-1,.cls-2{clip-rule:evenodd;}.cls-2,.cls-5,.cls-7{fill:#fff;}.cls-3,.cls-5{fill-rule:evenodd;}.cls-4{clip-path:url(#clip-path);}.cls-6{clip-path:url(#clip-path-2);}</style><clipPath id="clip-path"><path class="cls-1" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath><clipPath id="clip-path-2"><path class="cls-2" d="M11.5,21.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77,3.43,3.43,0,0,1-1.19.4v6h-1v-6a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,27.72a2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath></defs><title>connect_to</title><path class="cls-3" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-4"><rect x="-0.5" y="-5" width="17" height="26"/></g><path class="cls-5" d="M11.5,21.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77,3.43,3.43,0,0,1-1.19.4v6h-1v-6a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,27.72a2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-6"><rect class="cls-7" x="-0.5" y="13.92" width="17" height="26"/></g></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
1
extensions/azurecore/resources/light/filter.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{font-size:12px;font-family:FullMDL2Assets, Full MDL2 Assets;}</style></defs><title>filter_16x16</title><text class="cls-1" transform="translate(0 12)"> </text><path d="M0,1.53H16V3.24l-6,6v6.27H6V9.22l-6-6ZM15,2.82V2.53H1v.29l6,6v5.69H9V8.8Z"/></svg>
|
||||
|
After Width: | Height: | Size: 363 B |
1
extensions/azurecore/resources/light/folder.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>folder_16x16</title><polygon class="cls-1" points="13.59 2.21 13.58 2.22 13.58 2.2 13.59 2.21"/><text></text><path d="M16,14H0V2a1,1,0,0,1,.08-.39,1,1,0,0,1,.53-.53A1,1,0,0,1,1,1H4.75a2.16,2.16,0,0,1,.61.07,2.26,2.26,0,0,1,.45.18,2.14,2.14,0,0,1,.36.24l.32.24a1.8,1.8,0,0,0,.34.18A1.12,1.12,0,0,0,7.25,2H15a1,1,0,0,1,.39.08,1,1,0,0,1,.53.53A1,1,0,0,1,16,3ZM1,2V3H4.75a1.36,1.36,0,0,0,.33,0,1,1,0,0,0,.26-.1l.23-.16.25-.21-.25-.21-.23-.16A1,1,0,0,0,5.08,2a1.36,1.36,0,0,0-.33,0ZM15,13V3H7.25a1.12,1.12,0,0,0-.43.07,1.8,1.8,0,0,0-.34.18l-.32.24a2.14,2.14,0,0,1-.36.24,2.26,2.26,0,0,1-.45.18A2.16,2.16,0,0,1,4.75,4H1v9Z"/></svg>
|
||||
|
After Width: | Height: | Size: 774 B |
1
extensions/azurecore/resources/light/refresh.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z" fill="#F6F6F6"/><path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z" fill="#424242"/></svg>
|
||||
|
After Width: | Height: | Size: 986 B |
1
extensions/azurecore/resources/light/sql_database.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#212121;}.cls-2{fill:#fff;}</style></defs><title>sql_database</title><g id="iconBg"><path class="cls-1" d="M8,8H9.12v3.35H8Z"/><path class="cls-1" d="M7.75.13C4.25.13,1.3,1.34,1.3,2.59V13.3c0,1.36,3.67,2.56,7.12,2.56s6.27-1.15,6.27-2.46V2.7C14.7,1.39,11.26.13,7.75.13ZM8,1.24c2.46,0,4.46.56,4.46,1.25S10.43,3.74,8,3.74,3.5,3.18,3.5,2.49,5.5,1.24,8,1.24ZM5.77,8H3.54V9.12H5.77v3.35H2.42V11.35H4.65V10.23H2.42V6.88H5.77ZM11,14,9.44,12.46H6.88V6.88h3.35v4.79l1.51,1.51Zm2.63-1.51H11.35V6.88h1.12v4.46h1.12Z"/></g><g id="iconFg"><path class="cls-2" d="M3.54,8V9.12H5.77v3.35H2.42V11.35H4.65V10.23H2.42V6.88H5.77V8ZM11,14,9.44,12.46H6.88V6.88h3.35v4.79l1.51,1.51ZM8,11.35H9.12V8H8Zm4.46,0V6.88H11.35v5.58h2.23V11.35Zm-9-8.86c0,.69,2,1.25,4.46,1.25s4.46-.56,4.46-1.25S10.43,1.23,8,1.23,3.5,1.8,3.5,2.49Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 928 B |
1
extensions/azurecore/resources/light/sql_server.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#212121;}.cls-2{fill:#fff;}</style></defs><title>sql_server</title><path id="iconBg" class="cls-1" d="M6.72,12.14H5.58V6.71H8.84v.83A4.85,4.85,0,0,1,9.93,7v-.3H11v.05a5,5,0,0,1,.54-.05,4.83,4.83,0,0,1,1.63.3V2.63c0-1.27-3.35-2.5-6.76-2.5S.15,1.31.15,2.53V13c0,1.32,3.57,2.5,6.94,2.5.49,0,1,0,1.41-.07A4.86,4.86,0,0,1,6.72,12.14ZM6.64,1.21C9,1.21,11,1.75,11,2.43S9,3.65,6.64,3.65,2.29,3.1,2.29,2.43,4.24,1.21,6.64,1.21ZM4.5,7.79H2.32V8.88H4.5v3.26H1.24V11.05H3.41V10H1.24V6.71H4.5Zm2.23,3.26H6.67V7.79H7.76v.76A4.84,4.84,0,0,0,6.72,11.05Zm7.79,1.26a3.06,3.06,0,0,1-.36.86L15,14.24a4.32,4.32,0,0,1-.77.77l-1.07-.83a3,3,0,0,1-.86.36l-.17,1.34a4.17,4.17,0,0,1-.55.06,4.14,4.14,0,0,1-.55-.06l-.17-1.34a3,3,0,0,1-.86-.36L8.91,15a4.32,4.32,0,0,1-.77-.77L9,13.18a3,3,0,0,1-.36-.86l-1.34-.17a4,4,0,0,1-.06-.55A4.14,4.14,0,0,1,7.27,11l1.34-.17A3,3,0,0,1,9,10L8.14,8.95a4.32,4.32,0,0,1,.77-.77L10,9a3,3,0,0,1,.86-.36L11,7.31a4.14,4.14,0,0,1,.55-.06,4.14,4.14,0,0,1,.55.06l.17,1.34a3,3,0,0,1,.86.36l1.07-.83a4.32,4.32,0,0,1,.77.77L14.15,10a3,3,0,0,1,.36.86l1.34.17a4.14,4.14,0,0,1,.06.55,4.14,4.14,0,0,1-.06.55ZM11.56,9.42a2.17,2.17,0,1,0,2.17,2.17,2.17,2.17,0,0,0-2.17-2.17Zm0,1.09a1.09,1.09,0,1,0,1.09,1.09A1.09,1.09,0,0,0,11.56,10.51Z"/><g id="iconFg"><path class="cls-2" d="M9.93,6.71H11v.05A4.87,4.87,0,0,0,9.93,7ZM6.64,3.65C9,3.65,11,3.1,11,2.43S9,1.2,6.64,1.2s-4.34.55-4.34,1.22S4.24,3.65,6.64,3.65ZM1.24,6.71V10H3.41v1.09H1.24v1.09H4.5V8.88H2.32V7.79H4.5V6.71ZM6.67,11.6a5,5,0,0,1,.05-.54H6.67V7.79H7.76v.76a4.92,4.92,0,0,1,1.09-1V6.71H5.58v5.43H6.72A5,5,0,0,1,6.67,11.6Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
1
extensions/azurecore/resources/light/subscription.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>subscription</title><path d="M15.63,5.9A8.32,8.32,0,0,0,14.83,4a8.36,8.36,0,0,0-1.24-1.6A7.69,7.69,0,0,0,12,1.17,7.57,7.57,0,0,0,10.1.37a7.75,7.75,0,0,0-4.2,0A7.9,7.9,0,0,0,4,1.17,7.63,7.63,0,0,0,2.4,2.41,8,8,0,0,0,1.17,4,7.9,7.9,0,0,0,.37,5.9,7.76,7.76,0,0,0,.08,8a7.66,7.66,0,0,0,.28,2.1A7.9,7.9,0,0,0,1.17,12a7.71,7.71,0,0,0,1.24,1.6A8,8,0,0,0,4,14.84a7.78,7.78,0,0,0,1.9.79,7.71,7.71,0,0,0,4.19,0A7.55,7.55,0,0,0,12,14.84,8.1,8.1,0,0,0,14.83,12a8.32,8.32,0,0,0,.8-1.89A7.66,7.66,0,0,0,15.92,8,7.76,7.76,0,0,0,15.63,5.9ZM14.55,9.8a6.87,6.87,0,0,1-.69,1.62A6.5,6.5,0,0,1,12.8,12.8a7.07,7.07,0,0,1-1.37,1.06,7.21,7.21,0,0,1-1.62.68,6.64,6.64,0,0,1-3.61,0,6.85,6.85,0,0,1-1.62-.68A7.07,7.07,0,0,1,3.2,12.8a5.73,5.73,0,0,1-.9-1.13L5.92,8.06l2.25,2.25,4.5-4.5V8.27h.75V4.52H9.67v.75h2.47l-4,4L5.92,7l-4,4a6.92,6.92,0,0,1-.46-1.2A6.63,6.63,0,0,1,1.21,8a6.74,6.74,0,0,1,.24-1.8,6.48,6.48,0,0,1,.69-1.62A6.42,6.42,0,0,1,3.2,3.2,7.07,7.07,0,0,1,4.57,2.14,6.85,6.85,0,0,1,6.2,1.46a6.91,6.91,0,0,1,3.61,0,7.21,7.21,0,0,1,1.62.68A7.07,7.07,0,0,1,12.8,3.2a6.76,6.76,0,0,1,1.06,1.38,6.87,6.87,0,0,1,.69,1.62A6.74,6.74,0,0,1,14.79,8,6.63,6.63,0,0,1,14.55,9.8Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -69,8 +69,8 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
return this._tokenCache.clear();
|
||||
}
|
||||
|
||||
public getSecurityToken(account: AzureAccount): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
return this.doIfInitialized(() => this.getAccessTokens(account));
|
||||
public getSecurityToken(account: AzureAccount, resource: sqlops.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
return this.doIfInitialized(() => this.getAccessTokens(account, resource));
|
||||
}
|
||||
|
||||
public initialize(restoredAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> {
|
||||
@@ -90,7 +90,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
|
||||
// Attempt to get fresh tokens. If this fails then the account is stale.
|
||||
// NOTE: Based on ADAL implementation, getting tokens should use the refresh token if necessary
|
||||
let task = this.getAccessTokens(account)
|
||||
let task = this.getAccessTokens(account, sqlops.AzureResource.ResourceManagement)
|
||||
.then(
|
||||
() => {
|
||||
return account;
|
||||
@@ -161,9 +161,14 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
: Promise.reject(localize('accountProviderNotInitialized', 'Account provider not initialized, cannot perform action'));
|
||||
}
|
||||
|
||||
private getAccessTokens(account: AzureAccount): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
private getAccessTokens(account: AzureAccount, resource: sqlops.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
let self = this;
|
||||
|
||||
const resourceIdMap = new Map<sqlops.AzureResource, string>([
|
||||
[sqlops.AzureResource.ResourceManagement, self._metadata.settings.armResource.id],
|
||||
[sqlops.AzureResource.Sql, self._metadata.settings.sqlResource.id]
|
||||
]);
|
||||
|
||||
let accessTokenPromises: Thenable<void>[] = [];
|
||||
let tokenCollection: AzureAccountSecurityTokenCollection = {};
|
||||
for (let tenant of account.properties.tenants) {
|
||||
@@ -172,7 +177,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
let context = new adal.AuthenticationContext(authorityUrl, null, self._tokenCache);
|
||||
|
||||
context.acquireToken(
|
||||
self._metadata.settings.armResource.id,
|
||||
resourceIdMap.get(resource),
|
||||
tenant.userId,
|
||||
self._metadata.settings.clientId,
|
||||
(error: Error, response: adal.TokenResponse | adal.ErrorResponse) => {
|
||||
@@ -20,7 +20,7 @@ let localize = nls.loadMessageBundle();
|
||||
|
||||
export class AzureAccountProviderService implements vscode.Disposable {
|
||||
// CONSTANTS ///////////////////////////////////////////////////////////////
|
||||
private static CommandClearTokenCache = 'accounts.azure.clearTokenCache';
|
||||
private static CommandClearTokenCache = 'accounts.clearTokenCache';
|
||||
private static ConfigurationSection = 'accounts.azure';
|
||||
private static CredentialNamespace = 'azureAccountProviderCredentials';
|
||||
|
||||
@@ -81,6 +81,11 @@ export interface Settings {
|
||||
*/
|
||||
armResource?: Resource;
|
||||
|
||||
/**
|
||||
* Information that describes the SQL Azure resource
|
||||
*/
|
||||
sqlResource?: Resource;
|
||||
|
||||
/**
|
||||
* A list of tenant IDs to authenticate against. If defined, then these IDs will be used
|
||||
* instead of querying the tenants endpoint of the armResource
|
||||
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 442 B |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -27,6 +27,10 @@ const publicAzureSettings: ProviderSettings = {
|
||||
id: 'https://management.core.windows.net/',
|
||||
endpoint: 'https://management.azure.com'
|
||||
},
|
||||
sqlResource: {
|
||||
id: 'https://database.windows.net/',
|
||||
endpoint: 'https://database.windows.net'
|
||||
},
|
||||
redirectUri: 'http://localhost/redirect'
|
||||
}
|
||||
}
|
||||
@@ -223,22 +223,16 @@ export default class TokenCache implements adal.TokenCache {
|
||||
return this.getOrCreateEncryptionParams()
|
||||
.then(encryptionParams => {
|
||||
try {
|
||||
let cacheCipher = fs.readFileSync(self._cacheSerializationPath, TokenCache.FsOptions);
|
||||
|
||||
let decipher = crypto.createDecipheriv(TokenCache.CipherAlgorithm, encryptionParams.key, encryptionParams.initializationVector);
|
||||
let cacheJson = decipher.update(cacheCipher, 'hex', 'binary');
|
||||
cacheJson += decipher.final('binary');
|
||||
|
||||
// Deserialize the JSON into the array of tokens
|
||||
let cacheObj = <adal.TokenResponse[]>JSON.parse(cacheJson);
|
||||
for (let objIndex in cacheObj) {
|
||||
// Rehydrate Date objects since they will always serialize as a string
|
||||
cacheObj[objIndex].expiresOn = new Date(<string>cacheObj[objIndex].expiresOn);
|
||||
}
|
||||
|
||||
return cacheObj;
|
||||
return self.decryptCache('utf8', encryptionParams);
|
||||
} catch (e) {
|
||||
throw e;
|
||||
try {
|
||||
// try to parse using 'binary' encoding and rewrite cache as UTF8
|
||||
let response = self.decryptCache('binary', encryptionParams);
|
||||
self.writeCache(response);
|
||||
return response;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(null, err => {
|
||||
@@ -248,6 +242,22 @@ export default class TokenCache implements adal.TokenCache {
|
||||
});
|
||||
}
|
||||
|
||||
private decryptCache(encoding: crypto.Utf8AsciiBinaryEncoding, encryptionParams: EncryptionParams): adal.TokenResponse[] {
|
||||
let cacheCipher = fs.readFileSync(this._cacheSerializationPath, TokenCache.FsOptions);
|
||||
let decipher = crypto.createDecipheriv(TokenCache.CipherAlgorithm, encryptionParams.key, encryptionParams.initializationVector);
|
||||
let cacheJson = decipher.update(cacheCipher, 'hex', encoding);
|
||||
cacheJson += decipher.final(encoding);
|
||||
|
||||
// Deserialize the JSON into the array of tokens
|
||||
let cacheObj = <adal.TokenResponse[]>JSON.parse(cacheJson);
|
||||
for (let objIndex in cacheObj) {
|
||||
// Rehydrate Date objects since they will always serialize as a string
|
||||
cacheObj[objIndex].expiresOn = new Date(<string>cacheObj[objIndex].expiresOn);
|
||||
}
|
||||
|
||||
return cacheObj;
|
||||
}
|
||||
|
||||
private removeFromCache(cache: adal.TokenResponse[], entries: adal.TokenResponse[]): adal.TokenResponse[] {
|
||||
entries.forEach((entry: adal.TokenResponse) => {
|
||||
// Check to see if the entry exists
|
||||
@@ -274,7 +284,7 @@ export default class TokenCache implements adal.TokenCache {
|
||||
let cacheJson = JSON.stringify(cache);
|
||||
|
||||
let cipher = crypto.createCipheriv(TokenCache.CipherAlgorithm, encryptionParams.key, encryptionParams.initializationVector);
|
||||
let cacheCipher = cipher.update(cacheJson, 'binary', 'hex');
|
||||
let cacheCipher = cipher.update(cacheJson, 'utf8', 'hex');
|
||||
cacheCipher += cipher.final('hex');
|
||||
|
||||
fs.writeFileSync(self._cacheSerializationPath, cacheCipher, TokenCache.FsOptions);
|
||||
225
extensions/azurecore/src/apiWrapper.ts
Normal file
@@ -0,0 +1,225 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import * as constants from './constants';
|
||||
|
||||
/**
|
||||
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
|
||||
* this API from our code
|
||||
*
|
||||
* @export
|
||||
* @class ApiWrapper
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
public registerConnectionProvider(provider: sqlops.ConnectionProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerConnectionProvider(provider);
|
||||
}
|
||||
|
||||
public registerObjectExplorerProvider(provider: sqlops.ObjectExplorerProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerObjectExplorerProvider(provider);
|
||||
}
|
||||
|
||||
public registerTaskServicesProvider(provider: sqlops.TaskServicesProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerTaskServicesProvider(provider);
|
||||
}
|
||||
|
||||
public registerFileBrowserProvider(provider: sqlops.FileBrowserProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerFileBrowserProvider(provider);
|
||||
}
|
||||
|
||||
public registerCapabilitiesServiceProvider(provider: sqlops.CapabilitiesProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerCapabilitiesServiceProvider(provider);
|
||||
}
|
||||
|
||||
public registerModelViewProvider(widgetId: string, handler: (modelView: sqlops.ModelView) => void): void {
|
||||
return sqlops.ui.registerModelViewProvider(widgetId, handler);
|
||||
}
|
||||
|
||||
public registerWebviewProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void): void {
|
||||
return sqlops.dashboard.registerWebviewProvider(widgetId, handler);
|
||||
}
|
||||
|
||||
public createDialog(title: string): sqlops.window.modelviewdialog.Dialog {
|
||||
return sqlops.window.modelviewdialog.createDialog(title);
|
||||
}
|
||||
|
||||
public openDialog(dialog: sqlops.window.modelviewdialog.Dialog): void {
|
||||
return sqlops.window.modelviewdialog.openDialog(dialog);
|
||||
}
|
||||
|
||||
public closeDialog(dialog: sqlops.window.modelviewdialog.Dialog): void {
|
||||
return sqlops.window.modelviewdialog.closeDialog(dialog);
|
||||
}
|
||||
|
||||
public registerTaskHandler(taskId: string, handler: (profile: sqlops.IConnectionProfile) => void): void {
|
||||
sqlops.tasks.registerTask(taskId, handler);
|
||||
}
|
||||
|
||||
public startBackgroundOperation(operationInfo: sqlops.BackgroundOperationInfo): void {
|
||||
sqlops.tasks.startBackgroundOperation(operationInfo);
|
||||
}
|
||||
|
||||
public getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||
return sqlops.connection.getActiveConnections();
|
||||
}
|
||||
|
||||
public getCurrentConnection(): Thenable<sqlops.connection.Connection> {
|
||||
return sqlops.connection.getCurrentConnection();
|
||||
}
|
||||
|
||||
public createModelViewEditor(title: string, options?: sqlops.ModelViewEditorOptions): sqlops.workspace.ModelViewEditor {
|
||||
return sqlops.workspace.createModelViewEditor(title, options);
|
||||
}
|
||||
|
||||
// VSCode APIs
|
||||
public createTerminal(name?: string, shellPath?: string, shellArgs?: string[]): vscode.Terminal {
|
||||
return vscode.window.createTerminal(name, shellPath, shellArgs);
|
||||
}
|
||||
|
||||
public createTerminalWithOptions(options: vscode.TerminalOptions): vscode.Terminal {
|
||||
return vscode.window.createTerminal(options);
|
||||
}
|
||||
|
||||
public executeCommand(command: string, ...rest: any[]): Thenable<any> {
|
||||
return vscode.commands.executeCommand(command, ...rest);
|
||||
}
|
||||
|
||||
public getFilePathRelativeToWorkspace(uri: vscode.Uri): string {
|
||||
return vscode.workspace.asRelativePath(uri);
|
||||
}
|
||||
|
||||
public getWorkspaceFolders(): vscode.WorkspaceFolder[] {
|
||||
return vscode.workspace.workspaceFolders;
|
||||
}
|
||||
|
||||
public getWorkspacePathFromUri(uri: vscode.Uri): string | undefined {
|
||||
let workspaceFolder = vscode.workspace.getWorkspaceFolder(uri);
|
||||
return workspaceFolder ? workspaceFolder.uri.fsPath : undefined;
|
||||
}
|
||||
|
||||
public registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): vscode.Disposable {
|
||||
return vscode.commands.registerCommand(command, callback, thisArg);
|
||||
}
|
||||
|
||||
public registerDocumentOpenHandler(handler: (doc: vscode.TextDocument) => any): vscode.Disposable {
|
||||
return vscode.workspace.onDidOpenTextDocument(handler);
|
||||
}
|
||||
|
||||
public registerTreeDataProvider<T>(viewId: string, treeDataProvider: vscode.TreeDataProvider<T>): vscode.Disposable {
|
||||
return vscode.window.registerTreeDataProvider(viewId, treeDataProvider);
|
||||
}
|
||||
|
||||
public setCommandContext(key: string, value: any): Thenable<any> {
|
||||
return vscode.commands.executeCommand(constants.BuiltInCommands.SetContext, key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configuration for a extensionName
|
||||
* @param extensionName The string name of the extension to get the configuration for
|
||||
* @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations
|
||||
*/
|
||||
public getConfiguration(extensionName?: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration {
|
||||
if (typeof resource === 'string') {
|
||||
try {
|
||||
resource = this.parseUri(resource);
|
||||
} catch (e) {
|
||||
resource = undefined;
|
||||
}
|
||||
}
|
||||
return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri);
|
||||
}
|
||||
|
||||
public getExtensionConfiguration(): vscode.WorkspaceConfiguration {
|
||||
return this.getConfiguration(constants.extensionConfigSectionName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse uri
|
||||
*/
|
||||
public parseUri(uri: string): vscode.Uri {
|
||||
return vscode.Uri.parse(uri);
|
||||
}
|
||||
|
||||
public showOpenDialog(options: vscode.OpenDialogOptions): Thenable<vscode.Uri[] | undefined> {
|
||||
return vscode.window.showOpenDialog(options);
|
||||
}
|
||||
|
||||
public showSaveDialog(options: vscode.SaveDialogOptions): Thenable<vscode.Uri> {
|
||||
return vscode.window.showSaveDialog(options);
|
||||
}
|
||||
|
||||
public openTextDocument(uri: vscode.Uri): Thenable<vscode.TextDocument>;
|
||||
public openTextDocument(options: { language?: string; content?: string; }): Thenable<vscode.TextDocument>;
|
||||
public openTextDocument(uriOrOptions): Thenable<vscode.TextDocument> {
|
||||
return vscode.workspace.openTextDocument(uriOrOptions);
|
||||
}
|
||||
|
||||
public showTextDocument(document: vscode.TextDocument, column?: vscode.ViewColumn, preserveFocus?: boolean, preview?: boolean): Thenable<vscode.TextEditor> {
|
||||
let options: vscode.TextDocumentShowOptions = {
|
||||
viewColumn: column,
|
||||
preserveFocus: preserveFocus,
|
||||
preview: preview
|
||||
};
|
||||
return vscode.window.showTextDocument(document, options);
|
||||
}
|
||||
|
||||
public showErrorMessage(message: string, ...items: string[]): Thenable<string | undefined> {
|
||||
return vscode.window.showErrorMessage(message, ...items);
|
||||
}
|
||||
|
||||
public showWarningMessage(message: string, ...items: string[]): Thenable<string | undefined> {
|
||||
return vscode.window.showWarningMessage(message, ...items);
|
||||
}
|
||||
|
||||
public showInformationMessage(message: string, ...items: string[]): Thenable<string | undefined> {
|
||||
return vscode.window.showInformationMessage(message, ...items);
|
||||
}
|
||||
|
||||
public createStatusBarItem(alignment?: vscode.StatusBarAlignment, priority?: number): vscode.StatusBarItem {
|
||||
return vscode.window.createStatusBarItem(alignment, priority);
|
||||
}
|
||||
|
||||
public get workspaceFolders(): vscode.WorkspaceFolder[] {
|
||||
return vscode.workspace.workspaceFolders;
|
||||
}
|
||||
|
||||
public createOutputChannel(name: string): vscode.OutputChannel {
|
||||
return vscode.window.createOutputChannel(name);
|
||||
}
|
||||
|
||||
public createWizardPage(title: string): sqlops.window.modelviewdialog.WizardPage {
|
||||
return sqlops.window.modelviewdialog.createWizardPage(title);
|
||||
}
|
||||
|
||||
public registerCompletionItemProvider(selector: vscode.DocumentSelector, provider: vscode.CompletionItemProvider, ...triggerCharacters: string[]): vscode.Disposable {
|
||||
return vscode.languages.registerCompletionItemProvider(selector, provider, ...triggerCharacters);
|
||||
}
|
||||
|
||||
public createTab(title: string): sqlops.window.modelviewdialog.DialogTab {
|
||||
return sqlops.window.modelviewdialog.createTab(title);
|
||||
}
|
||||
|
||||
// Account APIs
|
||||
public getAllAccounts(): Thenable<sqlops.Account[]> {
|
||||
return sqlops.accounts.getAllAccounts();
|
||||
}
|
||||
|
||||
public getSecurityToken(account: sqlops.Account, resource: sqlops.AzureResource): Thenable<{}> {
|
||||
return sqlops.accounts.getSecurityToken(account, resource);
|
||||
}
|
||||
|
||||
public readonly onDidChangeAccounts = sqlops.accounts.onDidChangeAccounts;
|
||||
|
||||
// Connection APIs
|
||||
public openConnectionDialog(providers: string[], initialConnectionProfile?: sqlops.IConnectionProfile, connectionCompletionOptions?: sqlops.IConnectionCompletionOptions): Thenable<sqlops.connection.Connection> {
|
||||
return sqlops.connection.openConnectionDialog(providers, initialConnectionProfile, connectionCompletionOptions);
|
||||
}
|
||||
}
|
||||
28
extensions/azurecore/src/appContext.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 vscode from 'vscode';
|
||||
import { ApiWrapper } from './apiWrapper';
|
||||
|
||||
/**
|
||||
* Global context for the application
|
||||
*/
|
||||
export class AppContext {
|
||||
|
||||
private serviceMap: Map<string, any> = new Map();
|
||||
constructor(public readonly extensionContext: vscode.ExtensionContext, public readonly apiWrapper: ApiWrapper) {
|
||||
this.apiWrapper = apiWrapper || new ApiWrapper();
|
||||
}
|
||||
|
||||
public getService<T>(serviceName: string): T {
|
||||
return this.serviceMap.get(serviceName) as T;
|
||||
}
|
||||
|
||||
public registerService<T>(serviceName: string, service: T): void {
|
||||
this.serviceMap.set(serviceName, service);
|
||||
}
|
||||
}
|
||||
28
extensions/azurecore/src/azureResource/azure-resource.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { TreeDataProvider, TreeItem } from 'vscode';
|
||||
import { DataProvider, Account } from 'sqlops';
|
||||
|
||||
export namespace azureResource {
|
||||
export interface IAzureResourceProvider extends DataProvider {
|
||||
getTreeDataProvider(): IAzureResourceTreeDataProvider;
|
||||
}
|
||||
|
||||
export interface IAzureResourceTreeDataProvider extends TreeDataProvider<IAzureResourceNode> {
|
||||
}
|
||||
|
||||
export interface IAzureResourceNode {
|
||||
readonly account: Account;
|
||||
readonly subscription: AzureResourceSubscription;
|
||||
readonly tenantId: string;
|
||||
readonly treeItem: TreeItem;
|
||||
}
|
||||
|
||||
export interface AzureResourceSubscription {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
89
extensions/azurecore/src/azureResource/commands.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { window, QuickPickItem } from 'vscode';
|
||||
import { AzureResource } from 'sqlops';
|
||||
import { TokenCredentials } from 'ms-rest';
|
||||
import { AppContext } from '../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { azureResource } from './azure-resource';
|
||||
import { TreeNode } from './treeNode';
|
||||
import { AzureResourceCredentialError } from './errors';
|
||||
import { AzureResourceTreeProvider } from './tree/treeProvider';
|
||||
import { AzureResourceAccountTreeNode } from './tree/accountTreeNode';
|
||||
import { IAzureResourceSubscriptionService, IAzureResourceSubscriptionFilterService } from '../azureResource/interfaces';
|
||||
import { AzureResourceServiceNames } from './constants';
|
||||
|
||||
export function registerAzureResourceCommands(appContext: AppContext, tree: AzureResourceTreeProvider): void {
|
||||
appContext.apiWrapper.registerCommand('azure.resource.selectsubscriptions', async (node?: TreeNode) => {
|
||||
if (!(node instanceof AzureResourceAccountTreeNode)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const subscriptionService = appContext.getService<IAzureResourceSubscriptionService>(AzureResourceServiceNames.subscriptionService);
|
||||
const subscriptionFilterService = appContext.getService<IAzureResourceSubscriptionFilterService>(AzureResourceServiceNames.subscriptionFilterService);
|
||||
|
||||
const accountNode = node as AzureResourceAccountTreeNode;
|
||||
|
||||
const subscriptions = (await accountNode.getCachedSubscriptions()) || <azureResource.AzureResourceSubscription[]>[];
|
||||
if (subscriptions.length === 0) {
|
||||
try {
|
||||
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;
|
||||
const tokenType = tokens[tenant.id].tokenType;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
let selectedSubscriptions = (await subscriptionFilterService.getSelectedSubscriptions(accountNode.account)) || <azureResource.AzureResourceSubscription[]>[];
|
||||
const selectedSubscriptionIds: string[] = [];
|
||||
if (selectedSubscriptions.length > 0) {
|
||||
selectedSubscriptionIds.push(...selectedSubscriptions.map((subscription) => subscription.id));
|
||||
} else {
|
||||
// ALL subscriptions are selected by default
|
||||
selectedSubscriptionIds.push(...subscriptions.map((subscription) => subscription.id));
|
||||
}
|
||||
|
||||
interface AzureResourceSubscriptionQuickPickItem extends QuickPickItem {
|
||||
subscription: azureResource.AzureResourceSubscription;
|
||||
}
|
||||
|
||||
const subscriptionQuickPickItems: AzureResourceSubscriptionQuickPickItem[] = subscriptions.map((subscription) => {
|
||||
return {
|
||||
label: subscription.name,
|
||||
picked: selectedSubscriptionIds.indexOf(subscription.id) !== -1,
|
||||
subscription: subscription
|
||||
};
|
||||
});
|
||||
|
||||
const selectedSubscriptionQuickPickItems = (await window.showQuickPick(subscriptionQuickPickItems, { canPickMany: true }));
|
||||
if (selectedSubscriptionQuickPickItems && selectedSubscriptionQuickPickItems.length > 0) {
|
||||
tree.refresh(node, false);
|
||||
|
||||
selectedSubscriptions = selectedSubscriptionQuickPickItems.map((subscriptionItem) => subscriptionItem.subscription);
|
||||
await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions);
|
||||
}
|
||||
});
|
||||
|
||||
appContext.apiWrapper.registerCommand('azure.resource.refreshall', () => tree.notifyNodeChanged(undefined));
|
||||
|
||||
appContext.apiWrapper.registerCommand('azure.resource.refresh', async (node?: TreeNode) => {
|
||||
tree.refresh(node, true);
|
||||
});
|
||||
|
||||
appContext.apiWrapper.registerCommand('azure.resource.signin', async (node?: TreeNode) => {
|
||||
appContext.apiWrapper.executeCommand('sql.action.accounts.manageLinkedAccount');
|
||||
});
|
||||
}
|
||||
24
extensions/azurecore/src/azureResource/constants.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 enum AzureResourceItemType {
|
||||
account = 'azure.resource.itemType.account',
|
||||
subscription = 'azure.resource.itemType.subscription',
|
||||
databaseContainer = 'azure.resource.itemType.databaseContainer',
|
||||
database = 'azure.resource.itemType.database',
|
||||
databaseServerContainer = 'azure.resource.itemType.databaseServerContainer',
|
||||
databaseServer = 'azure.resource.itemType.databaseServer',
|
||||
message = 'azure.resource.itemType.message'
|
||||
}
|
||||
|
||||
export enum AzureResourceServiceNames {
|
||||
cacheService = 'AzureResourceCacheService',
|
||||
accountService = 'AzureResourceAccountService',
|
||||
subscriptionService = 'AzureResourceSubscriptionService',
|
||||
subscriptionFilterService = 'AzureResourceSubscriptionFilterService',
|
||||
tenantService = 'AzureResourceTenantService'
|
||||
}
|
||||
15
extensions/azurecore/src/azureResource/errors.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 class AzureResourceCredentialError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly innerError: Error
|
||||
) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
45
extensions/azurecore/src/azureResource/interfaces.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { Account, DidChangeAccountsParams } from 'sqlops';
|
||||
import { Event } from 'vscode';
|
||||
|
||||
import { azureResource } from './azure-resource';
|
||||
|
||||
export interface IAzureResourceAccountService {
|
||||
getAccounts(): Promise<Account[]>;
|
||||
|
||||
readonly onDidChangeAccounts: Event<DidChangeAccountsParams>;
|
||||
}
|
||||
|
||||
export interface IAzureResourceSubscriptionService {
|
||||
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>;
|
||||
}
|
||||
|
||||
export interface IAzureResourceCacheService {
|
||||
generateKey(id: string): string;
|
||||
|
||||
get<T>(key: string): T | undefined;
|
||||
|
||||
update<T>(key: string, value: T): void;
|
||||
}
|
||||
|
||||
export interface IAzureResourceTenantService {
|
||||
getTenantId(subscription: azureResource.AzureResourceSubscription): Promise<string>;
|
||||
}
|
||||
|
||||
export interface IAzureResourceNodeWithProviderId {
|
||||
resourceProviderId: string;
|
||||
resourceNode: azureResource.IAzureResourceNode;
|
||||
}
|
||||
60
extensions/azurecore/src/azureResource/messageTreeNode.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { NodeInfo } from 'sqlops';
|
||||
|
||||
import { TreeNode } from './treeNode';
|
||||
import { AzureResourceItemType } from './constants';
|
||||
|
||||
export class AzureResourceMessageTreeNode extends TreeNode {
|
||||
public constructor(
|
||||
public readonly message: string,
|
||||
parent: TreeNode
|
||||
) {
|
||||
super();
|
||||
|
||||
this.parent = parent;
|
||||
this._id = `message_${AzureResourceMessageTreeNode._messageNum++}`;
|
||||
}
|
||||
|
||||
public static create(message: string, parent: TreeNode): AzureResourceMessageTreeNode {
|
||||
return new AzureResourceMessageTreeNode(message, parent);
|
||||
}
|
||||
|
||||
public getChildren(): TreeNode[] | Promise<TreeNode[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
public getTreeItem(): TreeItem | Promise<TreeItem> {
|
||||
let item = new TreeItem(this.message, TreeItemCollapsibleState.None);
|
||||
item.contextValue = AzureResourceItemType.message;
|
||||
return item;
|
||||
}
|
||||
|
||||
public getNodeInfo(): NodeInfo {
|
||||
return {
|
||||
label: this.message,
|
||||
isLeaf: true,
|
||||
errorMessage: undefined,
|
||||
metadata: undefined,
|
||||
nodePath: this.generateNodePath(),
|
||||
nodeStatus: undefined,
|
||||
nodeType: AzureResourceItemType.message,
|
||||
nodeSubType: undefined,
|
||||
iconType: AzureResourceItemType.message
|
||||
};
|
||||
}
|
||||
|
||||
public get nodePathValue(): string {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
private _id: string;
|
||||
|
||||
private static _messageNum: number = 0;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 'sqlops';
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { ExtensionContext } from 'vscode';
|
||||
import { ApiWrapper } from '../../../apiWrapper';
|
||||
|
||||
import { azureResource } from '../../azure-resource';
|
||||
import { IAzureResourceDatabaseService } from './interfaces';
|
||||
import { AzureResourceDatabaseTreeDataProvider } from './databaseTreeDataProvider';
|
||||
|
||||
export class AzureResourceDatabaseProvider implements azureResource.IAzureResourceProvider {
|
||||
public constructor(
|
||||
databaseService: IAzureResourceDatabaseService,
|
||||
apiWrapper: ApiWrapper,
|
||||
extensionContext: ExtensionContext
|
||||
) {
|
||||
this._databaseService = databaseService;
|
||||
this._apiWrapper = apiWrapper;
|
||||
this._extensionContext = extensionContext;
|
||||
}
|
||||
|
||||
public getTreeDataProvider(): azureResource.IAzureResourceTreeDataProvider {
|
||||
return new AzureResourceDatabaseTreeDataProvider(this._databaseService, this._apiWrapper, this._extensionContext);
|
||||
}
|
||||
|
||||
public get providerId(): string {
|
||||
return 'azure.resource.providers.database';
|
||||
}
|
||||
|
||||
private _databaseService: IAzureResourceDatabaseService = undefined;
|
||||
private _apiWrapper: ApiWrapper = undefined;
|
||||
private _extensionContext: ExtensionContext = undefined;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { SqlManagementClient } from 'azure-arm-sql';
|
||||
|
||||
import { azureResource } from '../../azure-resource';
|
||||
import { IAzureResourceDatabaseService } from './interfaces';
|
||||
import { AzureResourceDatabase } from './models';
|
||||
|
||||
export class AzureResourceDatabaseService implements IAzureResourceDatabaseService {
|
||||
public async getDatabases(subscription: azureResource.AzureResourceSubscription, credential: ServiceClientCredentials): Promise<AzureResourceDatabase[]> {
|
||||
const databases: AzureResourceDatabase[] = [];
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { AzureResource } from 'sqlops';
|
||||
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';
|
||||
|
||||
export class AzureResourceDatabaseTreeDataProvider implements azureResource.IAzureResourceTreeDataProvider {
|
||||
public constructor(
|
||||
databaseService: IAzureResourceDatabaseService,
|
||||
apiWrapper: ApiWrapper,
|
||||
extensionContext: ExtensionContext
|
||||
) {
|
||||
this._databaseService = databaseService;
|
||||
this._apiWrapper = apiWrapper;
|
||||
this._extensionContext = extensionContext;
|
||||
}
|
||||
|
||||
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.None,
|
||||
contextValue: AzureResourceItemType.database
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private createContainerNode(): azureResource.IAzureResourceNode {
|
||||
return {
|
||||
account: undefined,
|
||||
subscription: undefined,
|
||||
tenantId: undefined,
|
||||
treeItem: {
|
||||
id: AzureResourceDatabaseTreeDataProvider.containerId,
|
||||
label: AzureResourceDatabaseTreeDataProvider.containerLabel,
|
||||
iconPath: {
|
||||
dark: this._extensionContext.asAbsolutePath('resources/dark/folder_inverse.svg'),
|
||||
light: this._extensionContext.asAbsolutePath('resources/light/folder.svg')
|
||||
},
|
||||
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
||||
contextValue: AzureResourceItemType.databaseContainer
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 'sqlops';
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { ExtensionContext } from 'vscode';
|
||||
import { ApiWrapper } from '../../../apiWrapper';
|
||||
|
||||
import { azureResource } from '../../azure-resource';
|
||||
import { IAzureResourceDatabaseServerService } from './interfaces';
|
||||
import { AzureResourceDatabaseServerTreeDataProvider } from './databaseServerTreeDataProvider';
|
||||
|
||||
export class AzureResourceDatabaseServerProvider implements azureResource.IAzureResourceProvider {
|
||||
public constructor(
|
||||
databaseServerService: IAzureResourceDatabaseServerService,
|
||||
apiWrapper: ApiWrapper,
|
||||
extensionContext: ExtensionContext
|
||||
) {
|
||||
this._databaseServerService = databaseServerService;
|
||||
this._apiWrapper = apiWrapper;
|
||||
this._extensionContext = extensionContext;
|
||||
}
|
||||
|
||||
public getTreeDataProvider(): azureResource.IAzureResourceTreeDataProvider {
|
||||
return new AzureResourceDatabaseServerTreeDataProvider(this._databaseServerService, this._apiWrapper, this._extensionContext);
|
||||
}
|
||||
|
||||
public get providerId(): string {
|
||||
return 'azure.resource.providers.databaseServer';
|
||||
}
|
||||
|
||||
private _databaseServerService: IAzureResourceDatabaseServerService = undefined;
|
||||
private _apiWrapper: ApiWrapper = undefined;
|
||||
private _extensionContext: ExtensionContext = undefined;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { SqlManagementClient } from 'azure-arm-sql';
|
||||
|
||||
import { azureResource } from '../../azure-resource';
|
||||
import { IAzureResourceDatabaseServerService } from './interfaces';
|
||||
import { AzureResourceDatabaseServer } from './models';
|
||||
|
||||
export class AzureResourceDatabaseServerService implements IAzureResourceDatabaseServerService {
|
||||
public async getDatabaseServers(subscription: azureResource.AzureResourceSubscription, credential: ServiceClientCredentials): Promise<AzureResourceDatabaseServer[]> {
|
||||
const databaseServers: AzureResourceDatabaseServer[] = [];
|
||||
|
||||
const sqlManagementClient = new SqlManagementClient(credential, subscription.id);
|
||||
const svrs = await sqlManagementClient.servers.list();
|
||||
|
||||
svrs.forEach((svr) => databaseServers.push({
|
||||
name: svr.name,
|
||||
fullName: svr.fullyQualifiedDomainName,
|
||||
loginName: svr.administratorLogin,
|
||||
defaultDatabaseName: 'master'
|
||||
}));
|
||||
|
||||
return databaseServers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { AzureResource } from 'sqlops';
|
||||
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';
|
||||
|
||||
export class AzureResourceDatabaseServerTreeDataProvider implements azureResource.IAzureResourceTreeDataProvider {
|
||||
public constructor(
|
||||
databaseServerService: IAzureResourceDatabaseServerService,
|
||||
apiWrapper: ApiWrapper,
|
||||
extensionContext: ExtensionContext
|
||||
) {
|
||||
this._databaseServerService = databaseServerService;
|
||||
this._apiWrapper = apiWrapper;
|
||||
this._extensionContext = extensionContext;
|
||||
}
|
||||
|
||||
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 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.None,
|
||||
contextValue: AzureResourceItemType.databaseServer
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private createContainerNode(): azureResource.IAzureResourceNode {
|
||||
return {
|
||||
account: undefined,
|
||||
subscription: undefined,
|
||||
tenantId: undefined,
|
||||
treeItem: {
|
||||
id: AzureResourceDatabaseServerTreeDataProvider.containerId,
|
||||
label: AzureResourceDatabaseServerTreeDataProvider.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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
129
extensions/azurecore/src/azureResource/resourceService.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { extensions, TreeItem } from 'vscode';
|
||||
import { Account } from 'sqlops';
|
||||
|
||||
import { azureResource } from './azure-resource';
|
||||
import { IAzureResourceNodeWithProviderId } from './interfaces';
|
||||
|
||||
export class AzureResourceService {
|
||||
private constructor() {
|
||||
}
|
||||
|
||||
public static getInstance(): AzureResourceService {
|
||||
return AzureResourceService._instance;
|
||||
}
|
||||
|
||||
public async listResourceProviderIds(): Promise<string[]> {
|
||||
await this.ensureResourceProvidersRegistered();
|
||||
|
||||
return Object.keys(this._resourceProviders);
|
||||
}
|
||||
|
||||
public registerResourceProvider(resourceProvider: azureResource.IAzureResourceProvider): void {
|
||||
this.doRegisterResourceProvider(resourceProvider);
|
||||
}
|
||||
|
||||
public clearResourceProviders(): void {
|
||||
this._resourceProviders = {};
|
||||
this._treeDataProviders = {};
|
||||
this._areResourceProvidersLoaded = false;
|
||||
}
|
||||
|
||||
public async getRootChildren(resourceProviderId: string, account: Account, subscription: azureResource.AzureResourceSubscription, tenatId: string): Promise<IAzureResourceNodeWithProviderId[]> {
|
||||
await this.ensureResourceProvidersRegistered();
|
||||
|
||||
if (!(resourceProviderId in this._resourceProviders)) {
|
||||
throw new Error(`Azure resource provider doesn't exist. Id: ${resourceProviderId}`);
|
||||
}
|
||||
|
||||
const treeDataProvider = this._treeDataProviders[resourceProviderId];
|
||||
const children = await treeDataProvider.getChildren();
|
||||
|
||||
return children.map((child) => <IAzureResourceNodeWithProviderId>{
|
||||
resourceProviderId: resourceProviderId,
|
||||
resourceNode: <azureResource.IAzureResourceNode>{
|
||||
account: account,
|
||||
subscription: subscription,
|
||||
tenantId: tenatId,
|
||||
treeItem: child.treeItem
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async getChildren(resourceProviderId: string, element: azureResource.IAzureResourceNode): Promise<IAzureResourceNodeWithProviderId[]> {
|
||||
await this.ensureResourceProvidersRegistered();
|
||||
|
||||
if (!(resourceProviderId in this._resourceProviders)) {
|
||||
throw new Error(`Azure resource provider doesn't exist. Id: ${resourceProviderId}`);
|
||||
}
|
||||
|
||||
const treeDataProvider = this._treeDataProviders[resourceProviderId];
|
||||
const children = await treeDataProvider.getChildren(element);
|
||||
|
||||
return children.map((child) => <IAzureResourceNodeWithProviderId>{
|
||||
resourceProviderId: resourceProviderId,
|
||||
resourceNode: child
|
||||
});
|
||||
}
|
||||
|
||||
public async getTreeItem(resourceProviderId: string, element?: azureResource.IAzureResourceNode): Promise<TreeItem> {
|
||||
await this.ensureResourceProvidersRegistered();
|
||||
|
||||
if (!(resourceProviderId in this._resourceProviders)) {
|
||||
throw new Error(`Azure resource provider doesn't exist. Id: ${resourceProviderId}`);
|
||||
}
|
||||
|
||||
const treeDataProvider = this._treeDataProviders[resourceProviderId];
|
||||
return treeDataProvider.getTreeItem(element);
|
||||
}
|
||||
|
||||
public get areResourceProvidersLoaded(): boolean {
|
||||
return this._areResourceProvidersLoaded;
|
||||
}
|
||||
|
||||
public set areResourceProvidersLoaded(value: boolean) {
|
||||
this._areResourceProvidersLoaded = value;
|
||||
}
|
||||
|
||||
private async ensureResourceProvidersRegistered(): Promise<void> {
|
||||
if (this._areResourceProvidersLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const extension of extensions.all) {
|
||||
const contributes = extension.packageJSON && extension.packageJSON.contributes;
|
||||
if (!contributes) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (contributes['hasAzureResourceProviders']) {
|
||||
await extension.activate();
|
||||
|
||||
if (extension.exports && extension.exports.provideResources) {
|
||||
for (const resourceProvider of <azureResource.IAzureResourceProvider[]>extension.exports.provideResources()) {
|
||||
this.doRegisterResourceProvider(resourceProvider);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._areResourceProvidersLoaded = true;
|
||||
}
|
||||
|
||||
private doRegisterResourceProvider(resourceProvider: azureResource.IAzureResourceProvider): void {
|
||||
this._resourceProviders[resourceProvider.providerId] = resourceProvider;
|
||||
this._treeDataProviders[resourceProvider.providerId] = resourceProvider.getTreeDataProvider();
|
||||
}
|
||||
|
||||
private _areResourceProvidersLoaded: boolean = false;
|
||||
private _resourceProviders: { [resourceProviderId: string]: azureResource.IAzureResourceProvider } = {};
|
||||
private _treeDataProviders: { [resourceProviderId: string]: azureResource.IAzureResourceTreeDataProvider } = {};
|
||||
|
||||
private static readonly _instance = new AzureResourceService();
|
||||
}
|
||||
79
extensions/azurecore/src/azureResource/resourceTreeNode.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { NodeInfo } from 'sqlops';
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { TreeNode } from './treeNode';
|
||||
import { AzureResourceService } from './resourceService';
|
||||
import { IAzureResourceNodeWithProviderId } from './interfaces';
|
||||
import { AzureResourceMessageTreeNode } from './messageTreeNode';
|
||||
import { AzureResourceErrorMessageUtil } from './utils';
|
||||
|
||||
export class AzureResourceResourceTreeNode extends TreeNode {
|
||||
public constructor(
|
||||
public readonly resourceNodeWithProviderId: IAzureResourceNodeWithProviderId,
|
||||
parent: TreeNode
|
||||
) {
|
||||
super();
|
||||
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public async getChildren(): Promise<TreeNode[]> {
|
||||
// It is a leaf node.
|
||||
if (this.resourceNodeWithProviderId.resourceNode.treeItem.collapsibleState === TreeItemCollapsibleState.None) {
|
||||
return <TreeNode[]>[];
|
||||
}
|
||||
|
||||
try {
|
||||
const children = await this._resourceService.getChildren(this.resourceNodeWithProviderId.resourceProviderId, this.resourceNodeWithProviderId.resourceNode);
|
||||
|
||||
if (children.length === 0) {
|
||||
return [AzureResourceMessageTreeNode.create(AzureResourceResourceTreeNode.noResourcesLabel, this)];
|
||||
} else {
|
||||
return children.map((child) => {
|
||||
// To make tree node's id unique, otherwise, treeModel.js would complain 'item already registered'
|
||||
child.resourceNode.treeItem.id = `${this.resourceNodeWithProviderId.resourceNode.treeItem.id}.${child.resourceNode.treeItem.id}`;
|
||||
return new AzureResourceResourceTreeNode(child, this);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
return [AzureResourceMessageTreeNode.create(AzureResourceErrorMessageUtil.getErrorMessage(error), this)];
|
||||
}
|
||||
}
|
||||
|
||||
public getTreeItem(): TreeItem | Promise<TreeItem> {
|
||||
return this._resourceService.getTreeItem(this.resourceNodeWithProviderId.resourceProviderId, this.resourceNodeWithProviderId.resourceNode);
|
||||
}
|
||||
|
||||
public getNodeInfo(): NodeInfo {
|
||||
const treeItem = this.resourceNodeWithProviderId.resourceNode.treeItem;
|
||||
|
||||
return {
|
||||
label: treeItem.label,
|
||||
isLeaf: treeItem.collapsibleState === TreeItemCollapsibleState.None ? true : false,
|
||||
errorMessage: undefined,
|
||||
metadata: undefined,
|
||||
nodePath: this.generateNodePath(),
|
||||
nodeStatus: undefined,
|
||||
nodeType: treeItem.contextValue,
|
||||
nodeSubType: undefined,
|
||||
iconType: treeItem.contextValue
|
||||
};
|
||||
}
|
||||
|
||||
public get nodePathValue(): string {
|
||||
return this.resourceNodeWithProviderId.resourceNode.treeItem.id;
|
||||
}
|
||||
|
||||
private _resourceService = AzureResourceService.getInstance();
|
||||
|
||||
private static readonly noResourcesLabel = localize('azure.resource.resourceTreeNode.noResourcesLabel', 'No Resources found.');
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { Event } from 'vscode';
|
||||
import { Account, DidChangeAccountsParams } from 'sqlops';
|
||||
import { ApiWrapper } from '../../apiWrapper';
|
||||
|
||||
import { IAzureResourceAccountService } from '../interfaces';
|
||||
|
||||
export class AzureResourceAccountService implements IAzureResourceAccountService {
|
||||
public constructor(
|
||||
apiWrapper: ApiWrapper
|
||||
) {
|
||||
this._apiWrapper = apiWrapper;
|
||||
this._onDidChangeAccounts = this._apiWrapper.onDidChangeAccounts;
|
||||
}
|
||||
|
||||
public async getAccounts(): Promise<Account[]> {
|
||||
return await this._apiWrapper.getAllAccounts();
|
||||
}
|
||||
|
||||
public get onDidChangeAccounts(): Event<DidChangeAccountsParams> {
|
||||
return this._onDidChangeAccounts;
|
||||
}
|
||||
|
||||
private _apiWrapper: ApiWrapper = undefined;
|
||||
private _onDidChangeAccounts: Event<DidChangeAccountsParams> = undefined;
|
||||
}
|
||||