Compare commits

...

79 Commits

Author SHA1 Message Date
Abbie Petchtes
4cfd9bdbc0 clean up scripts in extensionSamples (#946) 2018-03-22 11:08:27 -07:00
Abbie Petchtes
f76e8ae2c5 fit and finish for open dashboard dialog (#954) 2018-03-21 21:44:21 -07:00
Anthony Dresser
089577c5a8 fix action execution in insight dialog (#942) 2018-03-20 17:35:06 -07:00
Matt Irvine
c116f933e2 Resize grids and detect changes when toggling panel visibility (#944) 2018-03-20 17:34:31 -07:00
Abbie Petchtes
fe496ab03b fix the UI for nav bar (#937) 2018-03-19 20:38:04 -07:00
Anthony Dresser
3c3d8417e9 vbump slickgrid (#934) 2018-03-19 15:55:16 -07:00
Matt Irvine
2b2672e4bd Enable object explorer find nodes API (#936) 2018-03-19 15:48:31 -07:00
Anthony Dresser
1bfc8c1914 Ellipse on editable dropdown for long values (#908)
* make dropdown ellipse for long database names

* remove unneeded code
2018-03-16 19:53:35 -07:00
Anthony Dresser
2f854cce4a correctly detect undefined for input strings during copy (#906) 2018-03-16 19:52:49 -07:00
Anthony Dresser
40550d0840 rename context key databasename to databaseName (#903)
* rename context key databasename to databaseName

* maintain correct context on database name
2018-03-16 19:52:33 -07:00
Matt Irvine
38bedea0bd Add findNodes Object Explorer API (#916) 2018-03-16 13:37:24 -07:00
Abbie Petchtes
75ab5c1a36 add samples (#920) 2018-03-16 11:05:40 -07:00
Matt Irvine
3d7c081068 Fix formatting in Localization section of readme 2018-03-16 10:17:48 -07:00
Karl Burtram
c276bd8a37 Add localization 'Help Wanted' section to readme (#915) 2018-03-15 13:27:11 -07:00
Leila Lali
890bece70c changing the extension gallery url for insider builds (#902)
* changing the extension gallery url for insider builds
2018-03-13 14:25:25 -07:00
Anthony Dresser
4a4fe584d5 Fix tab contrib to be accurate (#901)
* update tab contrib to be accurate with expectation

* update contracts

* formatting
2018-03-13 13:55:21 -07:00
Anthony Dresser
bcd72d21c7 Tasks schema registration (#900)
* inital task update

* fix schema update problems

* remove dead code
2018-03-13 13:55:08 -07:00
Anthony Dresser
722f5e56cd Add dashboard context (database vs server) to scoped context (#893)
* explicitly add dashboard context to scoped context

* formatting
2018-03-13 13:54:37 -07:00
Abbie Petchtes
f3c7b2416b Support icons in panel (#895)
* support icons in panel

* formatting

* address Smitha comments

* address comments
2018-03-13 13:48:17 -07:00
Anthony Dresser
383d74ceb4 Dashboard Minor code cleanup (#894)
* minor code clean up for dashboard

* formatting
2018-03-13 13:21:21 -07:00
Abbie Petchtes
64f61b2954 Fix several dashboard issues and add telemetry (#889)
* fix several dashboard issues

* formatting

* address comments

* keep track of number of page navigation inside the dashboard service
2018-03-12 13:16:20 -07:00
Anthony Dresser
5c0002404a Task context + schema (#849)
* commting .d.ts changes

* added serverinfo to .d.ts

* maybe its working?

* works

* updated contrib

* remove unnecessary code

* fix compile errors

* update task schema and add the ability to specifiy a when clause

* update defaults for tasks widget

* add when to restore and back up tasks to not show up for cloud servers

* formatting

* fixing engine

* add restore to server page
2018-03-12 11:41:49 -07:00
Leila Lali
66f39fd3eb supporting sql built-in extensions (#890)
* supporting sql built-in extensions
2018-03-12 11:02:47 -07:00
Karl Burtram
e79e3bdf1d Adjust ObjectExplorer spacing to 25px (#886) 2018-03-10 10:26:58 -08:00
Anthony Dresser
9dd3ec9179 add window resize listener to webview for resize (#866) 2018-03-09 16:11:02 -08:00
Matt Irvine
c06ab27d08 Object Explorer API (#783)
See https://github.com/Microsoft/sqlopsstudio/wiki/Extensibility-API#object-explorer for usage details
2018-03-09 15:02:20 -08:00
Anthony Dresser
fab4185c1f Change visibility type for panel hiding (#864)
* change visibility method for panels

* make the new visibility type opt in
2018-03-09 14:54:13 -08:00
Abbie Petchtes
bc4b399f87 Fix "always show" for dashboard tab to behave like pinned by default (#879)
* make tab config settings overwrite always show

* formatting
2018-03-09 10:18:07 -08:00
Leila Lali
52544fa953 changed the format of rowspan and colspan to be string or number (#859) 2018-03-09 09:55:04 -08:00
Anthony Dresser
8b2ea4f0a0 Capabilities Cache (#831)
* init

* finished compile erros

* fixed all merge conflicts

* fix dialog problems

* formatting

* fix opening dialog on first open

* fix various problems with connectiondialog

* formatting

* fix tests
2018-03-08 17:16:40 -08:00
Abbie Petchtes
45b1ae1fb1 Improve experience in "open installed features" dialog (#876)
* fix keyboard nav and double click issues in open install features dialog

* the focus will be at the first item in the extension list when the dialog is opened
2018-03-08 15:30:28 -08:00
Aditya Bist
090ac6eab2 Persist save file location throughout a session (#772)
* persist save file location throughout a session

* added path logic to serializer instead of pathUtilities
2018-03-08 11:18:25 -08:00
The Gitter Badger
b7169f3da9 Add Gitter badge (#868) 2018-03-07 17:03:16 -08:00
Abbie Petchtes
587c3ab436 Handle error when loading the dashboard (#862)
* add error tab when the tab cannot be loaded

* formatting

* changing the look for error message per Smitha request
2018-03-07 14:08:49 -08:00
Anthony Dresser
80bbd9dbf3 update insight last update time on refresh (#841) 2018-03-07 11:57:08 -08:00
Anthony Dresser
c019175fff fix the lock files (#861) 2018-03-07 11:33:46 -08:00
Abbie Petchtes
7f79ab47ac Error handling for dashboard tab contributions (#851)
* support tab without title

* address comments

* formatting

* support error validation for dashboard tab and container contributions

* formatting
2018-03-07 11:06:42 -08:00
Anthony Dresser
ba188189a8 Credentials and Serilization shouldn't register for all features (#833)
* change credentials and serilization so they don't register for all features

* vbump dataprotocol
2018-03-07 10:41:22 -08:00
Abbie Petchtes
8e6359b3a4 fix nav section layout (#854) 2018-03-07 10:20:41 -08:00
Karl Burtram
aac77ed982 Update README to add section for design note links (#856) 2018-03-06 18:47:02 -08:00
Leila Lali
1d284ea66a fixed the grid layout schema and fixed layout bugs (#847)
* fixed the grid layout schema and fixed layout bugs
2018-03-06 15:33:47 -08:00
Anthony Dresser
9f5268101d integrate with contextkeyservice (#804)
* commting .d.ts changes

* added serverinfo to .d.ts

* maybe its working?

* works

* updated contrib

* remove unnecessary code

* fix compile errors

* change back sqlops engine for merge
2018-03-06 13:56:04 -08:00
Abbie Petchtes
0bba972657 Fix few dashboard panel issues (#801)
* home tab is shown by default when the dashboard is opened

* add scroll bar when tab list is overflow

* fix regression in other tab panels

* address comments
2018-03-06 10:28:15 -08:00
Abbie Petchtes
bab9fc01ea focus on the first tab in the nav section by default (#823) 2018-03-06 10:27:24 -08:00
Anthony Dresser
692ed02df8 Collapsible properties (#771)
* started moving properties to home tab

* moved properties

* refactored panel in dashboard

* fix errors

* fix miss-naming

* added collapsable properties

* revert unnecessary change

* add icon for collapsing properties
2018-03-05 10:06:18 -08:00
Leila Lali
2e67d03b56 fixed the grid layout sizing issue (#824) 2018-03-05 09:07:41 -08:00
Abbie Petchtes
56ca3406c4 Fix pin, unpin and close icon issues (#822)
* fix pin, unpin and close icon issues

* formatting
2018-03-02 16:01:12 -08:00
Cory Rivera
94e8ce5185 Update version field in sql syntax file. (#828) 2018-03-02 14:32:19 -08:00
Matt Irvine
bb54b0280a Do not apply hc arrow when loading items in OE (#827) 2018-03-02 14:24:10 -08:00
Anthony Dresser
a99c34d817 fix install location for service (#811) 2018-03-01 16:31:45 -08:00
Karl Burtram
c06f45cf0e Fix duplicate localization ids (#803)
* Add sqlops-core loc project

* Fix duplicate ids step 1

* Merge duplicate id changes.

* A few more duplicate ids
2018-03-01 15:25:51 -08:00
Leila Lali
8114498fb5 writing telemetry into a file when running the app for perf tests (#802) 2018-03-01 08:56:00 -08:00
Abbie Petchtes
889b60a71b support grid container in nav section (#796) 2018-02-27 15:47:42 -08:00
Anthony Dresser
45023b2e71 Revert "Remove widgetContent" (#795)
* Revert "fix dataprotocol developement problems (#788)"

This reverts commit 1c08e64651.

* Revert "Task contribution (#742)"

This reverts commit 3432dac261.

* Revert "remove widgetContent (#784)"

This reverts commit 5adab4fafb.
2018-02-27 14:11:54 -08:00
Anthony Dresser
1c08e64651 fix dataprotocol developement problems (#788)
* whats happening

* fix problems with compiling

* fix compile

* fix problems with building

* deleteing lib

* adding lib back to ignore

* fix more build problems
2018-02-27 11:40:57 -08:00
Anthony Dresser
3432dac261 Task contribution (#742)
* work in progress

* set up necessary code. need to work on getting it working

* formatting

* work in progress

* work in progress

* formatting

* work in progress

* work in progress

* work in progress

* formatting

* needs a lot of work regarding how we do actions vs how extensions do actions

* formatting

* use connection profile for actions

* change action to be
2018-02-27 11:40:13 -08:00
Abbie Petchtes
5adab4fafb remove widgetContent (#784) 2018-02-26 13:47:27 -08:00
Karl Burtram
d45aebcd19 Bump SQL Ops to version 0.27.0 (#782) 2018-02-26 10:16:43 -08:00
Abbie Petchtes
6bf21e4340 fix layout issue for left nav bar and dashboard (#773) 2018-02-23 15:59:03 -08:00
Kevin Cunnane
7ee6dfa21e Add shortcut for toggle results pane (#764) 2018-02-23 15:56:17 -08:00
Abbie Petchtes
bd7341ddc2 Tab contribution support both inline container and registered container (#766)
* accept inline nav section contribution

* contribution accepted both inline container and registered container

* address comments

* formatting
2018-02-23 15:12:30 -08:00
Anthony Dresser
f9d8f479b5 Move dashboard properties, fix scroll (#758)
* started moving properties to home tab

* moved properties

* refactored panel in dashboard

* fix errors

* fix miss-naming
2018-02-23 13:34:11 -08:00
Casey Western
fdc956e116 Removed duplicate contribution from README.md (#753)
Removed duplicate contribution
2018-02-22 21:37:48 -08:00
Anthony Dresser
a44df9adab vbump htmlqueryplan to 2.4 (#744) 2018-02-22 16:02:01 -08:00
Abbie Petchtes
dbc2ce0b3a Refactor and rename dashboard tabs part 1 (#755)
* refactor and rename dashboard tabs

* undo incorrect changes
2018-02-22 13:36:56 -08:00
Abbie Petchtes
51b8e02455 Support left nav bar and inner tabs (#751)
* Add left nav bar and inner tab contribution

* place holder for dashboard left nav bar

* formatting

* refactor widget helper

* improving the panel look and feel

* removed extra files that added by accident
2018-02-21 16:23:24 -08:00
Leila Lali
4f9dfe9afa initial check in for dashboard grid layout (#740)
dashboard grid layout container
2018-02-21 14:41:52 -08:00
Leila Lali
db05ed840d removed rating and installs from extension manager UI (#743) 2018-02-21 09:43:00 -08:00
Anthony Dresser
8570910a43 Move protocol client out (#643)
* close

* connection is working

* formatting

* adds all

* formatting

* formatting and changing how features are initialized

* formatting

* changed named of typings file

* update

* updated to use dataprotocol npm

* formatting

* removed unneeded logging

* readd npm shrinkwrap

* still not working

* removed unnecessary codfe

* addressed comments

* readded azure resource provider

* fix capabilities cacheing

* added backwards capat for older protocol

* update shrinkwrap

* update shrinkwrap

* updated shrinkwrap

* fixed tests

* removed dead code

* remove dead code

* fix compile

* remove backcompat stuff

* change location of npm

* vbump sqltools

* merge master

* fix imports

* fix build breaks

* update for sqlops

* update yarn dependencies
2018-02-20 13:38:16 -08:00
Karl Burtram
8a9ee40524 Update changelog for Jan Hotfix release (#722) 2018-02-16 14:40:25 -08:00
Abbie Petchtes
c166ce112b Refactor dashboard tabs to have widgets and webview tab contents (#716)
* Initial work of adding tab in the dashboard (#526)

* refactor dashboard to have the home tab

* formatting

* fix grid layout issue

* fix initailize issue in database dashboard

* Add action bar to the panel and add close tab to the dashboard (#562)

* add action bar to the panel and add close tab to the dashboard

* formatting

* Tab contribution (#564)

* added contrib

* disabled edit for extensions; fixed new name for insights contrib

* fix merge issue

* move file

* formatting

* fix builds

* moving imports

* Expand on tab contrib (#581)

* added contrib

* disabled edit for extensions; fixed new name for insights contrib

* fix merge issue

* move file

* formatting

* fix builds

* adding to contrib

* updated contrib

* format

* moving imports

* updated contribution to map to current design

* implemented actually using provider and edition filtering

*  Refactor and fix issues in close tab and add the placeholder for pin tab (#588)

* refactor and fix issues in close tab and add the placeholder for pin tab

* formatting

* remove the redundant code

* add clear all tabs in dashboard page init

* Initial work for adding a feature tab dialog (#594)

* initial work for add new dashboard tab

* formatting

* fix add panel action issue

* fix breaking change

* fix issues and tab and panels

* formatting

* minor fix

* address comments

* Add tab status to add extension tab dialog (#610)

* add tab status to add extension tab dialog

* add tab status to add extension tab dialog

* rename add feature tab action

* address comments

* Webview widget (#618)

* getting closer

* webview widget now works

* fix problem with rerendering webview

* formatting

* ensure that webview only shows up for extensions

* formatting

* comments

* fix more compile issues

* Change dashboard page init (#640)

* changed init of serverpage

* formatting

* Webview tab (#638)

* getting closer

* webview widget now works

* fix problem with rerendering webview

* formatting

* ensure that webview only shows up for extensions

* formatting

* comments

* fix more compile issues

* refacting stuff

* added inital webview tab

* piped through messaging and tested

* Implement pin/unpin feature and always on tabs (#629)

* implement pin/unpin feature

* fix issue where insight can't be loaded after reopen

* fix tab look and feel

* implement always show tabs

* make AddFeatureTabAction to track always show and pinned tabs

* formatting

* make dashboard tabs looks like the UX design

* load always show before pinned tab

* fix regression in panel for restore and connection dialog

* fix merge conflict

* don't worry about no widgets if its a webview (#656)

* expose the dashboard server info when a webview is rendering (#644)

* Fix few issues in dashboard command center (#655)

* fix reloading insight wigets and create new tab when there is no extension

* show possible tabIDs in the setting file

* formatting

* address comment

* fix import name

* fixes problem with size of webview widget being wrong (#654)

*  Refactor tab contribution to support content type (#685)

* refactor tab contribution to support content type

* formatting

* address comment

* fix rendering tab issue (#694)

* Add layout option to panel for supporting horizontal and vertical navigation bar  (#700)

* Add left navigation panel for inner tab in the dashboard

* add layout option in panel

* remove panel option in dashboard Page

* refactor widgets content

* formatting

* refactor webveiw content

* delete unused file

* address comment
2018-02-16 13:55:46 -08:00
Anthony Dresser
cea52d2314 add a false output channel to the other place we create a client (#720) 2018-02-16 13:04:41 -08:00
Anthony Dresser
d1cc937f9d enable prod for angular in prod builds (#695) 2018-02-15 12:20:51 -08:00
Abbie Petchtes
b61fbc806b Merge dashboardCommandCenter to master (#697)
* Initial work of adding tab in the dashboard (#526)

* refactor dashboard to have the home tab

* formatting

* fix grid layout issue

* fix initailize issue in database dashboard

* Add action bar to the panel and add close tab to the dashboard (#562)

* add action bar to the panel and add close tab to the dashboard

* formatting

* Tab contribution (#564)

* added contrib

* disabled edit for extensions; fixed new name for insights contrib

* fix merge issue

* move file

* formatting

* fix builds

* moving imports

* Expand on tab contrib (#581)

* added contrib

* disabled edit for extensions; fixed new name for insights contrib

* fix merge issue

* move file

* formatting

* fix builds

* adding to contrib

* updated contrib

* format

* moving imports

* updated contribution to map to current design

* implemented actually using provider and edition filtering

*  Refactor and fix issues in close tab and add the placeholder for pin tab (#588)

* refactor and fix issues in close tab and add the placeholder for pin tab

* formatting

* remove the redundant code

* add clear all tabs in dashboard page init

* Initial work for adding a feature tab dialog (#594)

* initial work for add new dashboard tab

* formatting

* fix add panel action issue

* fix breaking change

* fix issues and tab and panels

* formatting

* minor fix

* address comments

* Add tab status to add extension tab dialog (#610)

* add tab status to add extension tab dialog

* add tab status to add extension tab dialog

* rename add feature tab action

* address comments

* Webview widget (#618)

* getting closer

* webview widget now works

* fix problem with rerendering webview

* formatting

* ensure that webview only shows up for extensions

* formatting

* comments

* fix more compile issues

* Change dashboard page init (#640)

* changed init of serverpage

* formatting

* Webview tab (#638)

* getting closer

* webview widget now works

* fix problem with rerendering webview

* formatting

* ensure that webview only shows up for extensions

* formatting

* comments

* fix more compile issues

* refacting stuff

* added inital webview tab

* piped through messaging and tested

* Implement pin/unpin feature and always on tabs (#629)

* implement pin/unpin feature

* fix issue where insight can't be loaded after reopen

* fix tab look and feel

* implement always show tabs

* make AddFeatureTabAction to track always show and pinned tabs

* formatting

* make dashboard tabs looks like the UX design

* load always show before pinned tab

* fix regression in panel for restore and connection dialog

* fix merge conflict

* don't worry about no widgets if its a webview (#656)

* expose the dashboard server info when a webview is rendering (#644)

* Fix few issues in dashboard command center (#655)

* fix reloading insight wigets and create new tab when there is no extension

* show possible tabIDs in the setting file

* formatting

* address comment

* fix import name

* fixes problem with size of webview widget being wrong (#654)

*  Refactor tab contribution to support content type (#685)

* refactor tab contribution to support content type

* formatting

* address comment

* fix rendering tab issue (#694)

* Add layout option to panel for supporting horizontal and vertical navigation bar  (#700)

* Add left navigation panel for inner tab in the dashboard

* add layout option in panel

* remove panel option in dashboard Page
2018-02-15 10:27:47 -08:00
Leila Lali
dfc212369a Feature/extension manager (#689)
* getting the extension gallery from a static file and enabling the extension manager
2018-02-15 10:23:31 -08:00
Karl Burtram
47b855adf8 Fix a couple more release notest issues (#710) 2018-02-15 08:37:14 -08:00
Karl Burtram
d1bffd0eb0 Update changelog and readme for February (#686) 2018-02-15 08:31:20 -08:00
Karl Burtram
f1b64918ce Bump SQL Ops Studio to 0.26.6 (#702) 2018-02-14 14:00:00 -08:00
Aditya Bist
005e3f1476 fix packaged build dropdown icon (#701) 2018-02-14 13:56:00 -08:00
369 changed files with 19725 additions and 9865 deletions

View File

@@ -1,5 +1,43 @@
# Change Log
## Version 0.26.7
* Release date: February 16, 2017
* Release status: Public Preview Hotfix 1
## What's new in this version
* Bug fix for `#717 Selecting partial query and hitting Cmd or Ctrl+C opens terminal with Error message`
## Version 0.26.6
* Release date: February 15, 2017
* Release status: Public Preview
## What's new in this version
The February release fixes several important customer reported issues, as well as various feature improvements. We've also introduced auto-update support in February which will simplify keeping updated with the lastest changes.
Here's some of the highlights in the February release.
* Support Auto-Update installation on Windows and macOS
* Publish RPM and DEB packages to offical Microsoft repos
* Fix `#6 Keep connection and selected database when opening new query tabs`
* Fix `#22 'Server Name' and 'Database Name' - Can these be drop downs instead of text` boxes?
* Fix #481 Add "Check for updates" option.
* SQL Editor colorization and auto-completion fixes
* `#584 Keyword "FULL" not highlighted by IntelliSense`
* `#345 Colorize SQL functions within the editor`
* `#300 [#tempData] latest "]" will display green color`
* `#225 Keyword color mismatch`
* `#60 invalid sql syntax color highlighting when using temporary table in from clause`
* Introduce Connection extensibility API
* VS Code Editor 1.19 integration
* Update JustinPealing/html-query-plan component to pick-up several Query Plan viewer 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:
* SebastianPfliegel for `Add cursor snippet (#475)`
* mikaoelitiana for fix: `revert README and CONTRIBUTING after last VSCode merge (#574)`
* alextercete for `Reinstate menu item to install from VSIX (#682)`
## Version 0.25.4
* Release date: January 17, 2017
* Release status: Public Preview

View File

@@ -1,22 +1,34 @@
# SQL Operations Studio
[![Join the chat at https://gitter.im/Microsoft/sqlopsstudio](https://badges.gitter.im/Microsoft/sqlopsstudio.svg)](https://gitter.im/Microsoft/sqlopsstudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
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.
**Download SQL Operations Studio January Public Preview**
**Download SQL Operations Studio February Public Preview**
Platform | Link
-- | --
Windows Setup Installer | https://go.microsoft.com/fwlink/?linkid=866480
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=866479
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=866481
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=866482
Linux DEB | https://go.microsoft.com/fwlink/?linkid=866484
Linux RPM | https://go.microsoft.com/fwlink/?linkid=866483
Windows Setup Installer | https://go.microsoft.com/fwlink/?linkid=867998
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=867997
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=867999
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=868000
Linux DEB | https://go.microsoft.com/fwlink/?linkid=868002
Linux RPM | https://go.microsoft.com/fwlink/?linkid=868001
Go to our [download page](https://aka.ms/sqlopsstudio) for more specific instructions.
Try out the latest insiders build from `master` at https://github.com/Microsoft/sqlopsstudio/releases.
See the [change log](https://github.com/Microsoft/sqlopsstudio/blob/master/CHANGELOG.md) for additional details of what's in this release.
**Design Discussions**
The SQL Operations Studio team would like to incorporate community feedback earlier in the development process. To facilitate this, we'd like to share our designs while features are actively being built.
We're currently collecting input on the **SQL Agent** experience and enhancements to the Manage Dashboard that we're calling **"Command Center"**. We'll add additional design feedback requests below as we start work in new feature areas. Please leave comments on these issues to help us understand your requirements and shape feature development.
* [#750 Seeking community feedback on SQL Agent UX prototype](https://github.com/Microsoft/sqlopsstudio/issues/750)
**Feature Highlights**
- Cross-Platform DB management for Windows, macOS and Linux with simple XCopy deployment
@@ -46,9 +58,28 @@ please see the document [How to Contribute](https://github.com/Microsoft/sqlopss
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
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!
## 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"
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
* SebastianPfliegel for `Add cursor snippet (#475)`
* mikaoelitiana for 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)`
* SebastianPfliegel `Remove sqlExtensionHelp (#312)`
* olljanat for `Implemented npm version check (#314)`
## License
Copyright (c) Microsoft Corporation. All rights reserved.

View File

@@ -24,10 +24,17 @@ gulp.task('mixin', function () {
return;
}
// {{SQL CARBON EDIT}}
// {{SQL CARBON EDIT}}
let serviceUrl = 'https://raw.githubusercontent.com/Microsoft/sqlopsstudio/release/extensions/extensionsGallery.json';
if (quality === 'insider') {
serviceUrl = `https://raw.githubusercontent.com/Microsoft/sqlopsstudio/release/extensions/extensionsGallery-${quality}.json`;
}
let newValues = {
"updateUrl": updateUrl,
"quality": quality
"quality": quality,
"extensionsGallery": {
"serviceUrl": serviceUrl
}
};
return gulp.src('./product.json')

View File

@@ -67,6 +67,13 @@ const excludedExtensions = [
'vscode-colorize-tests'
];
// {{SQL CARBON EDIT}}
const vsce = require('vsce');
const sqlBuiltInExtensions = [
// Add SQL built-in extensions here.
// the extension will be excluded from SQLOps package and will have separate vsix packages
];
const vscodeEntryPoints = _.flatten([
buildfile.entrypoint('vs/workbench/workbench.main'),
buildfile.base,
@@ -242,6 +249,26 @@ function computeChecksum(filename) {
return hash;
}
function packageBuiltInExtensions() {
const sqlBuiltInLocalExtensionDescriptions = 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 }) => excludedExtensions.indexOf(name) === -1)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
vsce.createVSIX({
cwd: element.path,
packagePath: packagePath
});
});
}
function packageTask(platform, arch, opts) {
opts = opts || {};
@@ -271,7 +298,10 @@ function packageTask(platform, arch, opts) {
return { name: extensionName, path: extensionPath };
})
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name));
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
// {{SQL CARBON EDIT}}
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
packageBuiltInExtensions();
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
const nlsFilter = filter('**/*.nls.json', { restore: true });

View File

@@ -501,6 +501,8 @@ function prepareXlfFiles(projectName, extensionName) {
}
exports.prepareXlfFiles = prepareXlfFiles;
var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup';
// {{SQL CARBON EDIT}}
var sqlopsProject = 'sqlops-core';
function getResource(sourceFile) {
var resource;
if (/^vs\/platform/.test(sourceFile)) {
@@ -529,6 +531,9 @@ function getResource(sourceFile) {
else if (/^vs\/workbench/.test(sourceFile)) {
return { name: 'vs/workbench', project: workbenchProject };
}
else if (/^sql/.test(sourceFile)) {
return { name: 'sql', project: sqlopsProject };
}
throw new Error("Could not identify the XLF bundle for " + sourceFile);
}
exports.getResource = getResource;

View File

@@ -578,6 +578,9 @@ const editorProject: string = 'vscode-editor',
extensionsProject: string = 'vscode-extensions',
setupProject: string = 'vscode-setup';
// {{SQL CARBON EDIT}}
const sqlopsProject: string = 'sqlops-core';
export function getResource(sourceFile: string): Resource {
let resource: string;
@@ -601,6 +604,11 @@ export function getResource(sourceFile: string): Resource {
return { name: 'vs/workbench', project: workbenchProject };
}
// {{SQL CARBON EDIT}}
else if (/^sql/.test(sourceFile)) {
return { name: 'sql', project: sqlopsProject };
}
throw new Error(`Could not identify the XLF bundle for ${sourceFile}`);
}

View File

@@ -21,7 +21,6 @@ function yarnInstall(location, opts) {
}
// {{SQL CARBON EDIT}}
yarnInstall('dataprotocol-client');
yarnInstall('extensions-modules');
yarnInstall('extensions'); // node modules shared by all extensions

View File

@@ -384,10 +384,10 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
"dataprotocol-client@file:./../dataprotocol-client":
version "1.0.0"
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#0.1.3":
version "0.1.3"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/5758b2a5804ea488d14326662f51d19cc970ccd0"
dependencies:
typescript "2.6.2"
vscode-languageclient "3.5.0"
dateformat@^2.0.0:
@@ -569,11 +569,7 @@ extend@~1.2.1:
"extensions-modules@file:../extensions-modules":
version "0.1.0"
dependencies:
<<<<<<< HEAD
dataprotocol-client "file:./../../../../AppData/Local/Yarn/cache/v1/dataprotocol-client"
=======
dataprotocol-client "file:C:/Users/andresse/AppData/Local/Yarn/cache/v1/dataprotocol-client"
>>>>>>> master
dataprotocol-client "github:Microsoft/sqlops-dataprotocolclient#0.1.3"
decompress "^4.2.0"
fs-extra-promise "^1.0.1"
http-proxy-agent "^2.0.0"
@@ -1972,10 +1968,6 @@ typescript@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631"
typescript@2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
unbzip2-stream@^1.0.9:
version "1.2.5"
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz#73a033a567bbbde59654b193c44d48a7e4f43c47"

View File

@@ -1,3 +0,0 @@
lib
node_modules
npm-debug.log

View File

@@ -1,3 +0,0 @@
src
.gitignore
tsfmt.json

View File

@@ -1,25 +0,0 @@
{
"name": "dataprotocol-client",
"version": "1.0.0",
"description": "SQL Operations Studio studio implementation of vscode-language-client",
"main": "lib/main.js",
"typings": "./lib/main",
"scripts": {
"prepare": "node ./node_modules/vscode/bin/install && tsc -p ./src",
"compile": "tsc -p ./src",
"watch": "tsc -w -p ./src",
"update-vscode": "node ./node_modules/vscode/bin/install"
},
"author": "Microsoft",
"license": "ISC",
"dependencies": {
"typescript": "2.6.2",
"vscode-languageclient": "3.5.0"
},
"devDependencies": {
"vscode": "1.1.5"
},
"engines": {
"vscode": "^1.15"
}
}

View File

@@ -1,68 +0,0 @@
import * as data from 'data';
import * as proto from './protocol';
import * as types from './types';
export interface Ic2p {
asConnectionParams(connectionUri: string, connectionInfo: data.ConnectionInfo): proto.ConnectParams;
asExecutionPlanOptions(planOptions: data.ExecutionPlanOptions): types.ExecutionPlanOptions;
asScriptingParams(connectionUri: string, operation: data.ScriptOperation, metadata: data.ObjectMetadata, paramDetails: data.ScriptingParamDetails): types.ScriptingParams;
}
function asConnectionParams(ownerUri: string, connInfo: data.ConnectionInfo): proto.ConnectParams {
return {
ownerUri,
connection: {
options: connInfo.options
}
};
}
function asExecutionPlanOptions(planOptions: data.ExecutionPlanOptions): types.ExecutionPlanOptions {
return {
includeEstimatedExecutionPlanXml: planOptions ? planOptions.displayEstimatedQueryPlan : undefined,
includeActualExecutionPlanXml: planOptions ? planOptions.displayActualQueryPlan : undefined
};
}
function asScriptingParams(ownerURI: string, operation: data.ScriptOperation, metadata: data.ObjectMetadata, paramDetails: data.ScriptingParamDetails): types.ScriptingParams {
let scriptingObject: types.ScriptingObject = {
type: metadata.metadataTypeName,
schema: metadata.schema,
name: metadata.name
};
let targetDatabaseEngineEdition = paramDetails.targetDatabaseEngineEdition;
let targetDatabaseEngineType = paramDetails.targetDatabaseEngineType;
let scriptCompatibilityOption = paramDetails.scriptCompatibilityOption;
let scriptOptions: types.ScriptOptions = {
scriptCreateDrop: (operation === types.ScriptOperation.Delete) ? 'ScriptDrop' :
(operation === types.ScriptOperation.Select) ? 'ScriptSelect' : 'ScriptCreate',
typeOfDataToScript: 'SchemaOnly',
scriptStatistics: 'ScriptStatsNone',
targetDatabaseEngineEdition: targetDatabaseEngineEdition ? targetDatabaseEngineEdition : 'SqlServerEnterpriseEdition',
targetDatabaseEngineType: targetDatabaseEngineType ? targetDatabaseEngineType : 'SingleInstance',
scriptCompatibilityOption: scriptCompatibilityOption ? scriptCompatibilityOption : 'Script140Compat'
};
return {
connectionString: null,
filePath: paramDetails.filePath,
scriptingObjects: [scriptingObject],
scriptDestination: 'ToEditor',
includeObjectCriteria: null,
excludeObjectCriteria: null,
includeSchemas: null,
excludeSchemas: null,
includeTypes: null,
excludeTypes: null,
scriptOptions,
connectionDetails: null,
selectScript: null,
ownerURI,
operation
};
}
export const c2p: Ic2p = {
asConnectionParams,
asExecutionPlanOptions,
asScriptingParams
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,633 +0,0 @@
import { ClientCapabilities as VSClientCapabilities, RequestType, NotificationType } from 'vscode-languageclient';
import * as types from './types';
import * as data from 'data';
export interface ConnectionClientCapabilities {
connection?: {
/**
* Whether the connection support dynamic registration
*/
dynamicRegistration?: boolean;
};
backup?: {
/**
* Whether the backup support dynamic registration
*/
dynamicRegistration?: boolean;
};
restore?: {
/**
* Whether the restore support dynamic registration
*/
dynamicRegistration?: boolean;
};
query?: {
/**
* Whether the query support dynamic registration
*/
dynamicRegistration?: boolean;
};
objectExplorer?: {
/**
* Whether the object explorer support dynamic registration
*/
dynamicRegistration?: boolean;
};
scripting?: {
/**
* Whether the scripting support dynamic registration
*/
dynamicRegistration?: boolean;
};
taskServices?: {
/**
* Whether the task services support dynamic registration
*/
dynamicRegistration?: boolean;
};
fileBrowser?: {
/**
* Whether the file browser support dynamic registration
*/
dynamicRegistration?: boolean;
};
profiler?: {
/**
* Whether the profiler support dynamic registration
*/
dynamicRegistration?: boolean;
};
capabilities?: {
/**
*
*/
dynamicRegistration?: boolean;
};
metadata?: {
/**
*
*/
dynamicRegistration?: boolean;
};
adminServices?: {
/**
*
*/
dynamicRegistration?: boolean;
};
}
export interface ClientCapabilities extends VSClientCapabilities {
connection?: ConnectionClientCapabilities;
}
//---- Refresh IntelliSense ----------------------------------------
/**
* Notification sent when the an IntelliSense cache invalidation is requested
*/
export namespace RebuildIntelliSenseNotification {
export const type = new NotificationType<RebuildIntelliSenseParams, void>('textDocument/rebuildIntelliSense');
}
/**
* Rebuild IntelliSense notification parameters
*/
export class RebuildIntelliSenseParams {
/**
* URI identifying the text document
*/
public ownerUri: string;
}
// ------------------------------- < Connect Request > ----------------------------------------------
/**
* Connection request message format
*/
export interface ConnectParams {
/**
* URI identifying the owner of the connection
*/
ownerUri: string;
/**
* Details for creating the connection
*/
connection: types.ConnectionDetails;
}
// Connection request message callback declaration
export namespace ConnectionRequest {
export const type = new RequestType<ConnectParams, boolean, void, void>('connection/connect');
}
// ------------------------------- < Connection Complete Event > ------------------------------------
export namespace ConnectionCompleteNotification {
export const type = new NotificationType<types.ConnectionCompleteParams, void>('connection/complete');
}
// ------------------------------- < Connection Changed Event > -------------------------------------
/**
* Parameters for the ConnectionChanged notification.
*/
export class ConnectionChangedParams {
/**
* Owner URI of the connection that changed.
*/
public ownerUri: string;
/**
* Summary of details containing any connection changes.
*/
public connection: types.ConnectionSummary;
}
/**
* Connection changed event callback declaration.
*/
export namespace ConnectionChangedNotification {
export const type = new NotificationType<ConnectionChangedParams, void>('connection/connectionchanged');
}
// ------------------------------- < Disconnect Request > -------------------------------------------
// Disconnect request message format
export class DisconnectParams {
// URI identifying the owner of the connection
public ownerUri: string;
}
// Disconnect response format
export type DisconnectResult = boolean;
// Disconnect request message callback declaration
export namespace DisconnectRequest {
export const type = new RequestType<DisconnectParams, DisconnectResult, void, void>('connection/disconnect');
}
// ------------------------------- < Cancel Connect Request > ---------------------------------------
// Cancel connect request message format
export class CancelConnectParams {
/**
* URI identifying the owner of the connection
*/
public ownerUri: string;
}
// Cancel connect response format.
export type CancelConnectResult = boolean;
// Cancel connect request message callback declaration
export namespace CancelConnectRequest {
export const type = new RequestType<CancelConnectParams, CancelConnectResult, void, void>('connection/cancelconnect');
}
// ------------------------------- < Change Database Request > -------------------------------------
export class ChangeDatabaseParams {
public ownerUri: string;
public newDatabase: string;
}
export namespace ChangeDatabaseRequest {
export const type = new RequestType<ChangeDatabaseParams, boolean, void, void>('connection/changedatabase');
}
// ------------------------------- < List Databases Request > ---------------------------------------
// List databases request format
export class ListDatabasesParams {
// Connection information to use for querying master
public ownerUri: string;
}
// List databases request callback declaration
export namespace ListDatabasesRequest {
export const type = new RequestType<ListDatabasesParams, data.ListDatabasesResult, void, void>('connection/listdatabases');
}
// Language Flavor Changed ================================================================================
/**
* Parameters to provide when sending a language flavor changed notification
*/
export interface DidChangeLanguageFlavorParams {
uri: string;
language: string;
flavor: string;
}
// ------------------------------- < Language Flavor Changed Notification > ---------------------------------------
export namespace LanguageFlavorChangedNotification {
export const type = new NotificationType<DidChangeLanguageFlavorParams, void>('connection/languageflavorchanged');
}
// ------------------------------- < Table Metadata Request > ---------------------------------------
// Table metadata request format
export class TableMetadataParams {
// Connection information to use for querying master
public ownerUri: string;
public schema: string;
public objectName: string;
}
// Table metadata response format
export class TableMetadataResult {
public columns: data.ColumnMetadata[];
}
// Table metadata request callback declaration
export namespace TableMetadataRequest {
export const type = new RequestType<TableMetadataParams, TableMetadataResult, void, void>('metadata/table');
}
// ------------------------------- < View Metadata Request > ---------------------------------------
// Table metadata request callback declaration
export namespace ViewMetadataRequest {
export const type = new RequestType<TableMetadataParams, TableMetadataResult, void, void>('metadata/view');
}
/**
* Event sent when the language service is finished updating after a connection
*/
export namespace IntelliSenseReadyNotification {
export const type = new NotificationType<types.IntelliSenseReadyParams, void>('textDocument/intelliSenseReady');
}
// ------------------------------- < Capabilties Discovery Event > ------------------------------------
export class CapabiltiesDiscoveryParams {
public hostName: string;
public hostVersion: string;
}
export namespace CapabiltiesDiscoveryRequest {
export const type = new RequestType<CapabiltiesDiscoveryParams, types.CapabiltiesDiscoveryResult, void, void>('capabilities/list');
}
// Query Execution ================================================================================
// ------------------------------- < Query Cancellation Request > ------------------------------------
export namespace QueryCancelRequest {
export const type = new RequestType<QueryCancelParams, data.QueryCancelResult, void, void>('query/cancel');
}
export interface QueryCancelParams {
ownerUri: string;
}
// ------------------------------- < Query Dispose Request > ------------------------------------
export namespace QueryDisposeRequest {
export const type = new RequestType<QueryDisposeParams, QueryDisposeResult, void, void>('query/dispose');
}
/**
* Parameters to provide when disposing of a query
*/
export interface QueryDisposeParams {
ownerUri: string;
}
/**
* Result received upon successful disposal of a query
*/
export interface QueryDisposeResult {
}
// ------------------------------- < Query Execution Complete Notification > ------------------------------------
export namespace QueryExecuteCompleteNotification {
export const type = new NotificationType<data.QueryExecuteCompleteNotificationResult, void>('query/complete');
}
// ------------------------------- < Query Batch Start Notification > ------------------------------------
export namespace QueryExecuteBatchStartNotification {
export const type = new NotificationType<data.QueryExecuteBatchNotificationParams, void>('query/batchStart');
}
// ------------------------------- < Query Batch Complete Notification > ------------------------------------
export namespace QueryExecuteBatchCompleteNotification {
export const type = new NotificationType<data.QueryExecuteBatchNotificationParams, void>('query/batchComplete');
}
// ------------------------------- < Query ResultSet Complete Notification > ------------------------------------
export namespace QueryExecuteResultSetCompleteNotification {
export const type = new NotificationType<data.QueryExecuteResultSetCompleteNotificationParams, void>('query/resultSetComplete');
}
// ------------------------------- < Query Message Notification > ------------------------------------
export namespace QueryExecuteMessageNotification {
export const type = new NotificationType<data.QueryExecuteMessageParams, void>('query/message');
}
// ------------------------------- < Query Execution Request > ------------------------------------
export namespace QueryExecuteRequest {
export const type = new RequestType<types.QueryExecuteParams, QueryExecuteResult, void, void>('query/executeDocumentSelection');
}
export interface QueryExecuteResult { }
// ------------------------------- < Query Results Request > ------------------------------------
export namespace QueryExecuteSubsetRequest {
export const type = new RequestType<data.QueryExecuteSubsetParams, data.QueryExecuteSubsetResult, void, void>('query/subset');
}
export interface ResultSetSubset {
rowCount: number;
rows: data.DbCellValue[][];
}
// ------------------------------- < Execute Statement > ------------------------------------
export interface QueryExecuteStatementParams {
ownerUri: string;
line: number;
column: number;
}
export namespace QueryExecuteStatementRequest {
export const type = new RequestType<QueryExecuteStatementParams, QueryExecuteResult, void, void>('query/executedocumentstatement');
}
// --------------------------------- < Save Results as CSV Request > ------------------------------------------
// save results in csv format
export namespace SaveResultsAsCsvRequest {
export const type = new RequestType<data.SaveResultsRequestParams, data.SaveResultRequestResult, void, void>('query/saveCsv');
}
// --------------------------------- </ Save Results as CSV Request > ------------------------------------------
// --------------------------------- < Save Results as JSON Request > ------------------------------------------
// save results in json format
export namespace SaveResultsAsJsonRequest {
export const type = new RequestType<data.SaveResultsRequestParams, data.SaveResultRequestResult, void, void>('query/saveJson');
}
// --------------------------------- </ Save Results as JSON Request > ------------------------------------------
// --------------------------------- < Save Results as Excel Request > ------------------------------------------
// save results in Excel format
export namespace SaveResultsAsExcelRequest {
export const type = new RequestType<data.SaveResultsRequestParams, data.SaveResultRequestResult, void, void>('query/saveExcel');
}
// --------------------------------- </ Save Results as Excel Request > ------------------------------------------
// ------------------------------- < Execute and Return > -----------------------------------
export namespace SimpleExecuteRequest {
export const type = new RequestType<data.SimpleExecuteParams, data.SimpleExecuteResult, void, void>('query/simpleexecute');
}
// ------------------------------- < Execute String > ------------------------------------
export interface QueryExecuteStringParams {
query: string;
ownerUri: string;
}
export namespace QueryExecuteStringRequest {
export const type = new RequestType<QueryExecuteStringParams, QueryExecuteResult, void, void>('query/executeString');
}
// ------------------------------- < Metadata Events > ------------------------------------
export namespace MetadataQueryRequest {
export const type = new RequestType<types.MetadataQueryParams, types.MetadataQueryResult, void, void>('metadata/list');
}
// ------------------------------- < Scripting Events > ------------------------------------
export namespace ScriptingRequest {
export const type = new RequestType<types.ScriptingParams, data.ScriptingResult, void, void>('scripting/script');
}
// ------------------------------- < Scripting Complete Event > ------------------------------------
export namespace ScriptingCompleteNotification {
export const type = new NotificationType<types.ScriptingCompleteParams, void>('scripting/scriptComplete');
}
// Edit Data ======================================================================================
// Shared Interfaces --------------------------------------------------------------------------
export interface EditSessionOperationParams {
ownerUri: string;
}
export interface EditRowOperationParams extends EditSessionOperationParams {
rowId: number;
}
export interface EditCellResult {
cell: data.EditCell;
isRowDirty: boolean;
}
// edit/commit --------------------------------------------------------------------------------
export namespace EditCommitRequest {
export const type = new RequestType<data.EditCommitParams, EditCommitResult, void, void>('edit/commit');
}
export interface EditCommitResult { }
// edit/createRow -----------------------------------------------------------------------------
export namespace EditCreateRowRequest {
export const type = new RequestType<data.EditCreateRowParams, data.EditCreateRowResult, void, void>('edit/createRow');
}
// edit/deleteRow -----------------------------------------------------------------------------
export namespace EditDeleteRowRequest {
export const type = new RequestType<data.EditDeleteRowParams, EditDeleteRowResult, void, void>('edit/deleteRow');
}
export interface EditDeleteRowResult { }
// edit/dispose -------------------------------------------------------------------------------
export namespace EditDisposeRequest {
export const type = new RequestType<data.EditDisposeParams, EditDisposeResult, void, void>('edit/dispose');
}
export interface EditDisposeResult { }
// edit/initialize ----------------------------------------------------------------------------
export namespace EditInitializeRequest {
export const type = new RequestType<data.EditInitializeParams, EditInitializeResult, void, void>('edit/initialize');
}
export interface EditInitializeResult { }
// edit/revertCell --------------------------------------------------------------------------------
export namespace EditRevertCellRequest {
export const type = new RequestType<data.EditRevertCellParams, data.EditRevertCellResult, void, void>('edit/revertCell');
}
// edit/revertRow -----------------------------------------------------------------------------
export namespace EditRevertRowRequest {
export const type = new RequestType<data.EditRevertRowParams, EditRevertRowResult, void, void>('edit/revertRow');
}
export interface EditRevertRowResult { }
// edit/sessionReady Event --------------------------------------------------------------------
export namespace EditSessionReadyNotification {
export const type = new NotificationType<data.EditSessionReadyParams, void>('edit/sessionReady');
}
// edit/updateCell ----------------------------------------------------------------------------
export namespace EditUpdateCellRequest {
export const type = new RequestType<data.EditUpdateCellParams, data.EditUpdateCellResult, void, void>('edit/updateCell');
}
// edit/subset ------------------------------------------------------------------------------------
export namespace EditSubsetRequest {
export const type = new RequestType<data.EditSubsetParams, data.EditSubsetResult, void, void>('edit/subset');
}
// ------------------------------- < Object Explorer Events > ------------------------------------
export namespace ObjectExplorerCreateSessionRequest {
export const type = new RequestType<types.ConnectionDetails, types.CreateSessionResponse, void, void>('objectexplorer/createsession');
}
export namespace ObjectExplorerExpandRequest {
export const type = new RequestType<types.ExpandParams, boolean, void, void>('objectexplorer/expand');
}
export namespace ObjectExplorerRefreshRequest {
export const type = new RequestType<types.ExpandParams, boolean, void, void>('objectexplorer/refresh');
}
export namespace ObjectExplorerCloseSessionRequest {
export const type = new RequestType<types.CloseSessionParams, types.CloseSessionResponse, void, void>('objectexplorer/closesession');
}
// ------------------------------- < Object Explorer Events > ------------------------------------
export namespace ObjectExplorerCreateSessionCompleteNotification {
export const type = new NotificationType<types.SessionCreatedParameters, void>('objectexplorer/sessioncreated');
}
export namespace ObjectExplorerExpandCompleteNotification {
export const type = new NotificationType<types.ExpandResponse, void>('objectexplorer/expandCompleted');
}
// ------------------------------- < Task Service Events > ------------------------------------
export namespace ListTasksRequest {
export const type = new RequestType<data.ListTasksParams, data.ListTasksResponse, void, void>('tasks/listtasks');
}
export namespace CancelTaskRequest {
export const type = new RequestType<data.CancelTaskParams, boolean, void, void>('tasks/canceltask');
}
// ------------------------------- < Task Service Events > ------------------------------------
export namespace TaskStatusChangedNotification {
export const type = new NotificationType<data.TaskProgressInfo, void>('tasks/statuschanged');
}
export namespace TaskCreatedNotification {
export const type = new NotificationType<data.TaskInfo, void>('tasks/newtaskcreated');
}
// ------------------------------- < Admin Service Events > ------------------------------------
export namespace CreateDatabaseRequest {
export const type = new RequestType<types.CreateDatabaseParams, data.CreateDatabaseResponse, void, void>('admin/createdatabase');
}
export namespace DefaultDatabaseInfoRequest {
export const type = new RequestType<types.DefaultDatabaseInfoParams, types.DefaultDatabaseInfoResponse, void, void>('admin/defaultdatabaseinfo');
}
export namespace CreateLoginRequest {
export const type = new RequestType<types.CreateLoginParams, data.CreateLoginResponse, void, void>('admin/createlogin');
}
export namespace GetDatabaseInfoRequest {
export const type = new RequestType<types.GetDatabaseInfoParams, types.GetDatabaseInfoResponse, void, void>('admin/getdatabaseinfo');
}
// ------------------------------- < Disaster Recovery Events > ------------------------------------
export namespace BackupRequest {
export const type = new RequestType<types.BackupParams, data.BackupResponse, void, void>('backup/backup');
}
export namespace BackupConfigInfoRequest {
export const type = new RequestType<types.DefaultDatabaseInfoParams, types.BackupConfigInfoResponse, void, void>('backup/backupconfiginfo');
}
export namespace RestoreRequest {
export const type = new RequestType<types.RestoreParams, data.RestoreResponse, void, void>('restore/restore');
}
export namespace RestorePlanRequest {
export const type = new RequestType<types.RestoreParams, data.RestorePlanResponse, void, void>('restore/restoreplan');
}
export namespace CancelRestorePlanRequest {
export const type = new RequestType<types.RestoreParams, boolean, void, void>('restore/cancelrestoreplan');
}
export namespace RestoreConfigInfoRequest {
export const type = new RequestType<types.RestoreConfigInfoRequestParams, types.RestoreConfigInfoResponse, void, void>('restore/restoreconfiginfo');
}
// ------------------------------- < File Browser Events > ------------------------------------
export namespace FileBrowserOpenRequest {
export const type = new RequestType<types.FileBrowserOpenParams, boolean, void, void>('filebrowser/open');
}
export namespace FileBrowserOpenedNotification {
export const type = new NotificationType<data.FileBrowserOpenedParams, void>('filebrowser/opencomplete');
}
export namespace FileBrowserExpandRequest {
export const type = new RequestType<types.FileBrowserExpandParams, boolean, void, void>('filebrowser/expand');
}
export namespace FileBrowserExpandedNotification {
export const type = new NotificationType<data.FileBrowserExpandedParams, void>('filebrowser/expandcomplete');
}
export namespace FileBrowserValidateRequest {
export const type = new RequestType<types.FileBrowserValidateParams, boolean, void, void>('filebrowser/validate');
}
export namespace FileBrowserValidatedNotification {
export const type = new NotificationType<data.FileBrowserValidatedParams, void>('filebrowser/validatecomplete');
}
export namespace FileBrowserCloseRequest {
export const type = new RequestType<types.FileBrowserCloseParams, data.FileBrowserCloseResponse, void, void>('filebrowser/close');
}
// ------------------------------- < Profiler Events > ------------------------------------
export namespace StartProfilingRequest {
export const type = new RequestType<types.StartProfilingParams, types.StartProfilingResponse, void, void>('profiler/start');
}
export namespace StopProfilingRequest {
export const type = new RequestType<types.StopProfilingParams, types.StopProfilingResponse, void, void>('profiler/stop');
}
export namespace ProfilerEventsAvailableNotification {
export const type = new NotificationType<types.ProfilerEventsAvailableParams, void>('profiler/eventsavailable');
}

View File

@@ -1,198 +0,0 @@
import * as data from 'data';
import * as types from './types';
export interface Ip2c {
asProviderMetadata(params: types.MetadataQueryResult): data.ProviderMetadata;
asServerCapabilities(result: types.CapabiltiesDiscoveryResult): data.DataProtocolServerCapabilities;
}
function asProviderMetadata(params: types.MetadataQueryResult): data.ProviderMetadata {
let objectMetadata: data.ObjectMetadata[] = [];
if (!params.metadata || !params.metadata.length) {
return {
objectMetadata
};
}
for (let i = 0; i < params.metadata.length; ++i) {
let metadata: data.ObjectMetadata = params.metadata[i];
let metadataTypeName: string;
if (metadata.metadataTypeName) {
// Read from the provider since it's defined
metadataTypeName = metadata.metadataTypeName;
} else if (metadata.metadataType === types.MetadataType.View) {
metadataTypeName = 'View';
} else if (metadata.metadataType === types.MetadataType.SProc) {
metadataTypeName = 'StoredProcedure';
} else if (metadata.metadataType === types.MetadataType.Function) {
metadataTypeName = 'Function';
} else {
metadataTypeName = 'Table';
}
objectMetadata.push({
metadataTypeName,
metadataType: metadata.metadataType,
name: metadata.name,
schema: metadata.schema,
urn: metadata.urn
});
}
return <data.ProviderMetadata>{
objectMetadata
};
}
function asServiceOptionType(val: string): data.ServiceOptionType {
if (val === 'string') {
return data.ServiceOptionType.string;
} else if (val === 'multistring') {
return data.ServiceOptionType.multistring;
} else if (val === 'password') {
return data.ServiceOptionType.password;
} else if (val === 'number') {
return data.ServiceOptionType.number;
} else if (val === 'boolean') {
return data.ServiceOptionType.boolean;
} else if (val === 'category') {
return data.ServiceOptionType.category;
} else if (val === 'object') {
return data.ServiceOptionType.object;
}
// assume string for unknown value types
return data.ServiceOptionType.string;
}
function buildServiceOption(srcOption: types.ServiceOption): data.ServiceOption {
return {
name: srcOption.name,
displayName: srcOption.displayName ? srcOption.displayName : srcOption.name,
description: srcOption.description,
groupName: srcOption.groupName,
defaultValue: srcOption.defaultValue,
categoryValues: srcOption.categoryValues,
isRequired: srcOption.isRequired,
isArray: srcOption.isArray,
objectType: srcOption.objectType,
valueType: asServiceOptionType(srcOption.valueType),
};
}
function asServerCapabilities(result: types.CapabiltiesDiscoveryResult): data.DataProtocolServerCapabilities {
let capabilities: data.DataProtocolServerCapabilities = {
protocolVersion: result.capabilities.protocolVersion,
providerName: result.capabilities.providerName,
providerDisplayName: result.capabilities.providerDisplayName,
connectionProvider: undefined,
adminServicesProvider: undefined,
features: []
};
if (result.capabilities.adminServicesProvider) {
capabilities.adminServicesProvider = <data.AdminServicesOptions>{
databaseInfoOptions: new Array<data.ServiceOption>(),
databaseFileInfoOptions: new Array<data.ServiceOption>(),
fileGroupInfoOptions: new Array<data.ServiceOption>()
};
if (result.capabilities.adminServicesProvider.databaseInfoOptions
&& result.capabilities.adminServicesProvider.databaseInfoOptions.length > 0) {
for (let i = 0; i < result.capabilities.adminServicesProvider.databaseInfoOptions.length; ++i) {
let srcOption: any = result.capabilities.adminServicesProvider.databaseInfoOptions[i];
let descOption: data.ServiceOption = buildServiceOption(srcOption);
capabilities.adminServicesProvider.databaseInfoOptions.push(descOption);
}
}
if (result.capabilities.adminServicesProvider.databaseFileInfoOptions
&& result.capabilities.adminServicesProvider.databaseFileInfoOptions.length > 0) {
for (let i = 0; i < result.capabilities.adminServicesProvider.databaseFileInfoOptions.length; ++i) {
//let srcOption: types.ServiceOption = result.capabilities.adminServicesProvider.databaseFileInfoOptions[i];
let srcOption: any = result.capabilities.adminServicesProvider.databaseFileInfoOptions[i];
let descOption: data.ServiceOption = buildServiceOption(srcOption);
capabilities.adminServicesProvider.databaseFileInfoOptions.push(descOption);
}
}
if (result.capabilities.adminServicesProvider.fileGroupInfoOptions
&& result.capabilities.adminServicesProvider.fileGroupInfoOptions.length > 0) {
for (let i = 0; i < result.capabilities.adminServicesProvider.fileGroupInfoOptions.length; ++i) {
//let srcOption: types.ServiceOption = result.capabilities.adminServicesProvider.fileGroupInfoOptions[i];
let srcOption: any = result.capabilities.adminServicesProvider.fileGroupInfoOptions[i];
let descOption: data.ServiceOption = buildServiceOption(srcOption);
capabilities.adminServicesProvider.fileGroupInfoOptions.push(descOption);
}
}
}
if (result.capabilities.connectionProvider
&& result.capabilities.connectionProvider.options
&& result.capabilities.connectionProvider.options.length > 0) {
capabilities.connectionProvider = <data.ConnectionProviderOptions>{
options: new Array<data.ConnectionOption>()
};
for (let i = 0; i < result.capabilities.connectionProvider.options.length; ++i) {
let srcOption: any = result.capabilities.connectionProvider.options[i];
let descOption: data.ConnectionOption = {
name: srcOption.name,
displayName: srcOption.displayName ? srcOption.displayName : srcOption.name,
description: srcOption.description,
groupName: srcOption.groupName,
defaultValue: srcOption.defaultValue,
categoryValues: srcOption.categoryValues,
isIdentity: srcOption.isIdentity,
isRequired: srcOption.isRequired,
valueType: asServiceOptionType(srcOption.valueType),
specialValueType: undefined
};
if (srcOption.specialValueType === 'serverName') {
descOption.specialValueType = data.ConnectionOptionSpecialType.serverName;
} else if (srcOption.specialValueType === 'databaseName') {
descOption.specialValueType = data.ConnectionOptionSpecialType.databaseName;
} else if (srcOption.specialValueType === 'authType') {
descOption.specialValueType = data.ConnectionOptionSpecialType.authType;
} else if (srcOption.specialValueType === 'userName') {
descOption.specialValueType = data.ConnectionOptionSpecialType.userName;
} else if (srcOption.specialValueType === 'password') {
descOption.specialValueType = data.ConnectionOptionSpecialType.password;
} else if (srcOption.specialValueType === 'appName') {
descOption.specialValueType = data.ConnectionOptionSpecialType.appName;
}
capabilities.connectionProvider.options.push(descOption);
}
}
if (result.capabilities.features
&& result.capabilities.features.length > 0) {
result.capabilities.features.forEach(feature => {
let descFeature: data.FeatureMetadataProvider = {
enabled: feature.enabled,
featureName: feature.featureName,
optionsMetadata: []
};
capabilities.features.push(descFeature);
if (feature.optionsMetadata) {
feature.optionsMetadata.forEach(srcOption => {
descFeature.optionsMetadata.push(buildServiceOption(<any>srcOption));
});
}
});
}
return capabilities;
}
export const p2c: Ip2c = {
asProviderMetadata,
asServerCapabilities
};

View File

@@ -1,12 +0,0 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": false,
"inlineSources": false,
"declaration": true,
"stripInternal": true,
"outDir": "../lib"
}
}

View File

@@ -1,939 +0,0 @@
import * as data from 'data';
export interface CreateSessionResponse {
sessionId: string;
}
export interface SessionCreatedParameters {
success: boolean;
sessionId: string;
rootNode: NodeInfo;
errorMessage: string;
}
export interface ExpandResponse {
nodePath: string;
sessionId: string;
nodes: NodeInfo[];
errorMessage: string;
}
export interface NodeInfo {
nodePath: string;
nodeType: string;
nodeSubType: string;
nodeStatus: string;
label: string;
isLeaf: boolean;
metadata: data.ObjectMetadata;
errorMessage: string;
}
export interface ExpandParams {
sessionId: string;
nodePath: string;
}
export interface CloseSessionParams {
sessionId: string;
}
export interface CloseSessionResponse {
success: boolean;
sessionId: string;
}
export interface CategoryValue {
displayName: string;
name: string;
}
export interface ServiceOption {
name: string;
displayName: string;
description: string;
groupName: string;
valueType: string;
defaultValue: string;
objectType: string;
categoryValues: CategoryValue[];
isRequired: boolean;
isArray: boolean;
}
export interface ConnectionOption {
name: string;
displayName: string;
description: string;
groupName: string;
valueType: string;
defaultValue: string;
objectType: string;
categoryValues: CategoryValue[];
specialValueType: string;
isIdentity: boolean;
isRequired: boolean;
isArray: boolean;
}
export interface ConnectionProviderOptions {
options: ConnectionOption[];
}
export interface AdminServicesProviderOptions {
databaseInfoOptions: ServiceOption[];
databaseFileInfoOptions: ServiceOption[];
fileGroupInfoOptions: ServiceOption[];
}
export interface FeatureMetadataProvider {
enabled: boolean;
featureName: string;
optionsMetadata: ServiceOption[];
}
/**
* Parameters to initialize a connection to a database
*/
export interface ConnectionDetails {
/**
* connection options
*/
options: {};
}
/**
* Summary that identifies a unique database connection.
*/
export class ConnectionSummary {
/**
* server name
*/
public serverName: string;
/**
* database name
*/
public databaseName: string;
/**
* user name
*/
public userName: string;
}
/**
* Connection response format.
*/
export class ConnectionCompleteParams {
/**
* URI identifying the owner of the connection
*/
public ownerUri: string;
/**
* connection id returned from service host.
*/
public connectionId: string;
/**
* any diagnostic messages return from the service host.
*/
public messages: string;
/**
* Error message returned from the engine, if any.
*/
public errorMessage: string;
/**
* Error number returned from the engine, if any.
*/
public errorNumber: number;
/**
* Information about the connected server.
*/
public serverInfo: ServerInfo;
/**
* information about the actual connection established
*/
public connectionSummary: ConnectionSummary;
}
/**
* Update event parameters
*/
export class IntelliSenseReadyParams {
/**
* URI identifying the text document
*/
public ownerUri: string;
}
/**
* Information about a SQL Server instance.
*/
export class ServerInfo {
/**
* The major version of the SQL Server instance.
*/
public serverMajorVersion: number;
/**
* The minor version of the SQL Server instance.
*/
public serverMinorVersion: number;
/**
* The build of the SQL Server instance.
*/
public serverReleaseVersion: number;
/**
* The ID of the engine edition of the SQL Server instance.
*/
public engineEditionId: number;
/**
* String containing the full server version text.
*/
public serverVersion: string;
/**
* String describing the product level of the server.
*/
public serverLevel: string;
/**
* The edition of the SQL Server instance.
*/
public serverEdition: string;
/**
* Whether the SQL Server instance is running in the cloud (Azure) or not.
*/
public isCloud: boolean;
/**
* The version of Azure that the SQL Server instance is running on, if applicable.
*/
public azureVersion: number;
/**
* The Operating System version string of the machine running the SQL Server instance.
*/
public osVersion: string;
}
export class CapabiltiesDiscoveryResult {
public capabilities: data.DataProtocolServerCapabilities;
}
// Task Services types
export enum TaskStatus {
notStarted = 0,
inProgress = 1,
succeeded = 2,
succeededWithWarning = 3,
failed = 4,
canceled = 5
}
// Admin Services types
export interface CreateDatabaseParams {
ownerUri: string;
databaseInfo: data.DatabaseInfo;
}
export interface DefaultDatabaseInfoParams {
ownerUri: string;
}
export interface DefaultDatabaseInfoResponse {
defaultDatabaseInfo: data.DatabaseInfo;
}
export interface GetDatabaseInfoResponse {
databaseInfo: data.DatabaseInfo;
}
export interface GetDatabaseInfoParams {
ownerUri: string;
}
export interface BackupConfigInfoResponse {
backupConfigInfo: data.BackupConfigInfo;
}
export interface CreateLoginParams {
ownerUri: string;
loginInfo: data.LoginInfo;
}
// Disaster Recovery types
export interface BackupInfo {
ownerUri: string;
databaseName: string;
backupType: number;
backupComponent: number;
backupDeviceType: number;
selectedFiles: string;
backupsetName: string;
selectedFileGroup: { [path: string]: string };
// List of {key: backup path, value: device type}
backupPathDevices: { [path: string]: number };
backupPathList: [string];
isCopyOnly: boolean;
formatMedia: boolean;
initialize: boolean;
skipTapeHeader: boolean;
mediaName: string;
mediaDescription: string;
checksum: boolean;
continueAfterError: boolean;
logTruncation: boolean;
tailLogBackup: boolean;
retainDays: number;
compressionOption: number;
verifyBackupRequired: boolean;
encryptionAlgorithm: number;
encryptorType: number;
encryptorName: string;
}
export interface BackupParams {
ownerUri: string;
backupInfo: BackupInfo;
taskExecutionMode: data.TaskExecutionMode;
}
export interface RestoreParams {
ownerUri: string;
options: {};
taskExecutionMode: data.TaskExecutionMode;
}
export interface RestoreConfigInfoRequestParams {
ownerUri: string;
}
export interface RestoreConfigInfoResponse {
configInfo: { [key: string]: any };
}
export interface RestoreDatabaseFileInfo {
fileType: string;
logicalFileName: string;
originalFileName: string;
restoreAsFileName: string;
}
export interface FileBrowserOpenParams {
ownerUri: string;
expandPath: string;
fileFilters: string[];
changeFilter: boolean;
}
export interface FileTreeNode {
children: FileTreeNode[];
isExpanded: boolean;
isFile: boolean;
name: string;
fullPath: string;
}
export interface FileTree {
rootNode: FileTreeNode;
selectedNode: FileTreeNode;
}
export interface FileBrowserExpandParams {
ownerUri: string;
expandPath: string;
}
export interface FileBrowserValidateParams {
ownerUri: string;
serviceType: string;
selectedFiles: string[];
}
export interface FileBrowserCloseParams {
ownerUri: string;
}
export interface DatabaseFileInfo {
properties: LocalizedPropertyInfo[];
id: string;
isSelected: boolean;
}
export interface LocalizedPropertyInfo {
propertyName: string;
propertyValue: string;
propertyDisplayName: string;
propertyValueDisplayName: string;
}
export interface RestorePlanDetailInfo {
name: string;
currentValue: any;
isReadOnly: boolean;
isVisible: boolean;
defaultValue: any;
}
// Query Execution types
export interface ResultSetSummary {
id: number;
batchId: number;
rowCount: number;
columnInfo: IDbColumn[];
}
export interface BatchSummary {
hasError: boolean;
id: number;
selection: data.ISelectionData;
resultSetSummaries: ResultSetSummary[];
executionElapsed: string;
executionEnd: string;
executionStart: string;
}
export interface IDbColumn {
allowDBNull?: boolean;
baseCatalogName: string;
baseColumnName: string;
baseSchemaName: string;
baseServerName: string;
baseTableName: string;
columnName: string;
columnOrdinal?: number;
columnSize?: number;
isAliased?: boolean;
isAutoIncrement?: boolean;
isExpression?: boolean;
isHidden?: boolean;
isIdentity?: boolean;
isKey?: boolean;
isBytes?: boolean;
isChars?: boolean;
isSqlVariant?: boolean;
isUdt?: boolean;
dataType: string;
isXml?: boolean;
isJson?: boolean;
isLong?: boolean;
isReadOnly?: boolean;
isUnique?: boolean;
numericPrecision?: number;
numericScale?: number;
udtAssemblyQualifiedName: string;
dataTypeName: string;
}
export interface IGridResultSet {
columns: IDbColumn[];
rowsUri: string;
numberOfRows: number;
}
export interface IResultMessage {
batchId?: number;
isError: boolean;
time: string;
message: string;
}
export interface ExecutionPlanOptions {
includeEstimatedExecutionPlanXml?: boolean;
includeActualExecutionPlanXml?: boolean;
}
export interface QueryExecuteParams {
ownerUri: string;
querySelection: data.ISelectionData;
executionPlanOptions?: ExecutionPlanOptions;
}
export enum EditRowState {
clean = 0,
dirtyInsert = 1,
dirtyDelete = 2,
dirtyUpdate = 3
}
export interface EditRow {
cells: data.DbCellValue[];
id: number;
isDirty: boolean;
state: EditRowState;
}
export class MetadataQueryParams {
/**
* Owner URI of the connection that changed.
*/
public ownerUri: string;
}
/**
* Used as value version of data.MetadataType THESE SHOULD MIRROR
*/
export enum MetadataType {
Table = 0,
View = 1,
SProc = 2,
Function = 3
}
export class MetadataQueryResult {
public metadata: data.ObjectMetadata[];
}
export interface ScriptOptions {
/**
* Generate ANSI padding statements
*/
scriptANSIPadding?: boolean;
/**
* Append the generated script to a file
*/
appendToFile?: boolean;
/**
* Continue to script if an error occurs. Otherwise, stop.
*/
continueScriptingOnError?: boolean;
/**
* Convert user-defined data types to base types.
*/
convertUDDTToBaseType?: boolean;
/**
* Generate script for dependent objects for each object scripted.
*/
generateScriptForDependentObjects?: boolean;
/**
* Include descriptive headers for each object generated.
*/
includeDescriptiveHeaders?: boolean;
/**
* Check that an object with the given name exists before dropping or altering or that an object with the given name does not exist before creating.
*/
includeIfNotExists?: boolean;
/**
* Script options to set vardecimal storage format.
*/
includeVarDecimal?: boolean;
/**
* Include system generated constraint names to enforce declarative referential integrity.
*/
scriptDRIIncludeSystemNames?: boolean;
/**
* Include statements in the script that are not supported on the specified SQL Server database engine type.
*/
includeUnsupportedStatements?: boolean;
/**
* Prefix object names with the object schema.
*/
schemaQualify?: boolean;
/**
* Script options to set bindings option.
*/
bindings?: boolean;
/**
* Script the objects that use collation.
*/
collation?: boolean;
/**
* Script the default values.
*/
default?: boolean;
/**
* Script Object CREATE/DROP statements.
*/
scriptCreateDrop: string;
/**
* Script the Extended Properties for each object scripted.
*/
scriptExtendedProperties?: boolean;
/**
* Script only features compatible with the specified version of SQL Server.
*/
scriptCompatibilityOption: string;
/**
* Script only features compatible with the specified SQL Server database engine type.
*/
targetDatabaseEngineType: string;
/**
* Script only features compatible with the specified SQL Server database engine edition.
*/
targetDatabaseEngineEdition: string;
/**
* Script all logins available on the server. Passwords will not be scripted.
*/
scriptLogins?: boolean;
/**
* Generate object-level permissions.
*/
scriptObjectLevelPermissions?: boolean;
/**
* Script owner for the objects.
*/
scriptOwner?: boolean;
/**
* Script statistics, and optionally include histograms, for each selected table or view.
*/
scriptStatistics: string;
/**
* Generate USE DATABASE statement.
*/
scripUseDatabase?: boolean;
/**
* Generate script that contains schema only or schema and data.
*/
typeOfDataToScript: string;
/**
* Scripts the change tracking information.
*/
scriptChangeTracking?: boolean;
/**
* Script the check constraints for each table or view scripted.
*/
scriptCheckConstraints?: boolean;
/**
* Scripts the data compression information.
*/
scriptDataCompressionOptions?: boolean;
/**
* Script the foreign keys for each table scripted.
*/
scriptForeignKeys?: boolean;
/**
* Script the full-text indexes for each table or indexed view scripted.
*/
scriptFullTextIndexes?: boolean;
/**
* Script the indexes (including XML and clustered indexes) for each table or indexed view scripted.
*/
scriptIndexes?: boolean;
/**
* Script the primary keys for each table or view scripted
*/
scriptPrimaryKeys?: boolean;
/**
* Script the triggers for each table or view scripted
*/
scriptTriggers?: boolean;
/**
* Script the unique keys for each table or view scripted.
*/
uniqueKeys?: boolean;
}
export interface ScriptingObject {
/**
* The database object type
*/
type: string;
/**
* The schema of the database object
*/
schema: string;
/**
* The database object name
*/
name: string;
}
export interface ScriptingParams {
/**
* File path used when writing out the script.
*/
filePath: string;
/**
* Whether scripting to a single file or file per object.
*/
scriptDestination: string;
/**
* Connection string of the target database the scripting operation will run against.
*/
connectionString: string;
/**
* A list of scripting objects to script
*/
scriptingObjects: ScriptingObject[];
/**
* A list of scripting object which specify the include criteria of objects to script.
*/
includeObjectCriteria: ScriptingObject[];
/**
* A list of scripting object which specify the exclude criteria of objects to not script.
*/
excludeObjectCriteria: ScriptingObject[];
/**
* A list of schema name of objects to script.
*/
includeSchemas: string[];
/**
* A list of schema name of objects to not script.
*/
excludeSchemas: string[];
/**
* A list of type name of objects to script.
*/
includeTypes: string[];
/**
* A list of type name of objects to not script.
*/
excludeTypes: string[];
/**
* Scripting options for the ScriptingParams
*/
scriptOptions: ScriptOptions;
/**
* Connection details for the ScriptingParams
*/
connectionDetails: ConnectionDetails;
/**
* Owner URI of the connection
*/
ownerURI: string;
/**
* Whether the scripting operation is for
* select script statements
*/
selectScript: boolean;
/**
* Operation associated with the script request
*/
operation: data.ScriptOperation;
}
export interface ScriptingCompleteParams {
/**
* The error details for an error that occurred during the scripting operation.
*/
errorDetails: string;
/**
* The error message for an error that occurred during the scripting operation.
*/
errorMessage: string;
/**
* A value to indicate an error occurred during the scripting operation.
*/
hasError: boolean;
/**
* A value to indicate the scripting operation was canceled.
*/
canceled: boolean;
/**
* A value to indicate the scripting operation successfully completed.
*/
success: boolean;
}
export class TableMetadata {
columns: data.ColumnMetadata[];
}
/**
* Parameters to start a profiler session
*/
export interface StartProfilingParams {
/**
* Session Owner URI
*/
ownerUri: string;
/**
* Session options
*/
options: {};
}
export interface StartProfilingResponse {
succeeded: string;
errorMessage: string;
}
/**
* Parameters to start a profiler session
*/
export interface StopProfilingParams {
/**
* Session Owner URI
*/
ownerUri: string;
}
export interface StopProfilingResponse {
succeeded: string;
errorMessage: string;
}
/**
* Profiler Event
*/
export interface ProfilerEvent {
/**
* Event class name
*/
name: string;
/**
* Event timestamp
*/
timestamp: string;
/**
* Event values
*/
values: {};
}
/**
* Profiler events available notification parameters
*/
export interface ProfilerEventsAvailableParams {
/**
* Session owner URI
*/
ownerUri: string;
/**
* New profiler events available
*/
events: ProfilerEvent[];
}
/**
* Used as value version of data.ScriptOperation THESE SHOULD BE THE SAME
*/
export enum ScriptOperation {
Select = 0,
Create = 1,
Insert = 2,
Update = 3,
Delete = 4,
Execute = 5,
Alter = 6
}

View File

@@ -1,2 +0,0 @@
/// <reference path='../../../src/sql/data.d.ts'/>

View File

@@ -1,17 +0,0 @@
{
"tabSize": 4,
"indentSize": 4,
"newLineCharacter": "\n",
"convertTabsToSpaces": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,3 @@
lib/
node_modules
lib
*.log

View File

@@ -3,7 +3,7 @@
"version": "0.1.0",
"description": "Shared modules for Carbon extensions",
"dependencies": {
"dataprotocol-client": "file:../dataprotocol-client",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.1.5",
"decompress": "^4.2.0",
"fs-extra-promise": "^1.0.1",
"http-proxy-agent": "^2.0.0",
@@ -15,13 +15,17 @@
},
"devDependencies": {
"@types/node": "^6.0.61",
"vscode": "1.0.1"
"vscode": "^1.1.10",
"sqlops": "github:anthonydresser/vscode-extension-vscode"
},
"scripts": {
"prepare": "tsc -p ./src",
"prepare": "node ./node_modules/vscode/bin/install && node ./node_modules/sqlops/bin/install && tsc -p ./src",
"compile": "tsc -p ./src",
"watch": "tsc -w -p ./src",
"update-vscode": "node ./node_modules/vscode/bin/install"
"watch": "tsc -w -p ./src"
},
"engines": {
"vscode": "*",
"sqlops": "*"
},
"main": "./lib/main.js",
"typings": "./lib/main"

View File

@@ -5,7 +5,7 @@
'use strict';
import { ExtensionContext, workspace, window, OutputChannel, languages } from 'vscode';
import { SqlOpsDataClient, LanguageClientOptions } from 'dataprotocol-client';
import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client';
import { CloseAction, ErrorAction, ServerOptions, NotificationHandler, NotificationType, RequestType, TransportKind } from 'vscode-languageclient';
import { VscodeWrapper } from '../controllers/vscodeWrapper';
@@ -329,14 +329,13 @@ export class SqlToolsServiceClient {
languageClientHelper.createServerOptions(serverPath, runtimeId) : this.createServerOptions(serverPath);
// Options to control the language client
let clientOptions: LanguageClientOptions = {
let clientOptions: ClientOptions = {
documentSelector: [SqlToolsServiceClient._constants.languageId],
providerId: '',
synchronize: {
configurationSection: SqlToolsServiceClient._constants.extensionConfigSectionName
},
errorHandler: new LanguageClientErrorHandler(SqlToolsServiceClient._constants),
serverConnectionMetadata: this._config.getConfigValue(Constants.serverConnectionMetadata),
outputChannel: {
append: () => {
},
@@ -351,8 +350,11 @@ export class SqlToolsServiceClient {
name: '',
show: () => {
}
}
},
// pass in no features so we don't register features we don't want
features: []
};
this._serviceStatus.showServiceLoading();
// cache the client instance for later use
client = new SqlOpsDataClient(SqlToolsServiceClient._constants.serviceName, serverOptions, clientOptions);
@@ -404,14 +406,28 @@ export class SqlToolsServiceClient {
private createLanguageClient(serverOptions: ServerOptions): SqlOpsDataClient {
// Options to control the language client
let clientOptions: LanguageClientOptions = {
let clientOptions: ClientOptions = {
documentSelector: [SqlToolsServiceClient._constants.languageId],
providerId: SqlToolsServiceClient._constants.providerId,
synchronize: {
configurationSection: SqlToolsServiceClient._constants.extensionConfigSectionName
},
errorHandler: new LanguageClientErrorHandler(SqlToolsServiceClient._constants),
serverConnectionMetadata: this._config.getConfigValue(Constants.serverConnectionMetadata)
outputChannel: {
append: () => {
},
appendLine: () => {
},
dispose: () => {
},
clear: () => {
},
hide: () => {
},
name: '',
show: () => {
}
}
};
this._serviceStatus.showServiceLoading();

View File

@@ -102,7 +102,7 @@ export default class ServiceDownloadProvider {
basePath = path.join(__dirname, '../../../extensions/' + extensionConfigSectionName + '/' + installDirFromConfig);
} else {
// The path from config is relative to the out folder
basePath = path.join(__dirname, '../../../../' + extensionConfigSectionName + '/' + installDirFromConfig);
basePath = path.join(__dirname, '../../../../' + installDirFromConfig);
}
return basePath;
}

View File

@@ -1,47 +0,0 @@
// Type definitions for tmp v0.0.28
// Project: https://www.npmjs.com/package/tmp
// Definitions by: Jared Klopper <https://github.com/optical>
declare module "tmp" {
module tmp {
interface Options extends SimpleOptions {
mode?: number;
}
interface SimpleOptions {
prefix?: string;
postfix?: string;
template?: string;
dir?: string;
tries?: number;
keep?: boolean;
unsafeCleanup?: boolean;
}
interface SynchronousResult {
name: string;
fd: number;
removeCallback: () => void;
}
function file(callback: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
function file(config: Options, callback?: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
function fileSync(config?: Options): SynchronousResult;
function dir(callback: (err: any, path: string, cleanupCallback: () => void) => void): void;
function dir(config: Options, callback?: (err: any, path: string, cleanupCallback: () => void) => void): void;
function dirSync(config?: Options): SynchronousResult;
function tmpName(callback: (err: any, path: string) => void): void;
function tmpName(config: SimpleOptions, callback?: (err: any, path: string) => void): void;
function tmpNameSync(config?: SimpleOptions): string;
function setGracefulCleanup(): void;
}
export = tmp;
}

View File

@@ -1,6 +0,0 @@
declare module 'vscode-extension-telemetry' {
export default class TelemetryReporter {
constructor(extensionId: string, extensionVersion: string, key: string);
sendTelemetryEvent(eventName: string, properties?: { [key: string]: string }, measures?: { [key: string]: number }): void;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
'use strict';
import * as adal from 'adal-node';
import * as data from 'data';
import * as sqlops from 'sqlops';
import * as request from 'request';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
@@ -22,7 +22,7 @@ import TokenCache from './tokenCache';
const localize = nls.loadMessageBundle();
export class AzureAccountProvider implements data.AccountProvider {
export class AzureAccountProvider implements sqlops.AccountProvider {
// CONSTANTS ///////////////////////////////////////////////////////////
private static WorkSchoolAccountType: string = 'work_school';
private static MicrosoftAccountType: string = 'microsoft';
@@ -57,7 +57,7 @@ export class AzureAccountProvider implements data.AccountProvider {
* @param {"data".AccountKey} accountKey Key identifying the account to delete tokens for
* @returns {Thenable<void>} Promise to clear requested tokens from the token cache
*/
public clear(accountKey: data.AccountKey): Thenable<void> {
public clear(accountKey: sqlops.AccountKey): Thenable<void> {
return this.doIfInitialized(() => this.clearAccountTokens(accountKey));
}
@@ -73,10 +73,10 @@ export class AzureAccountProvider implements data.AccountProvider {
return this.doIfInitialized(() => this.getAccessTokens(account));
}
public initialize(restoredAccounts: data.Account[]): Thenable<data.Account[]> {
public initialize(restoredAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> {
let self = this;
let rehydrationTasks: Thenable<data.Account>[] = [];
let rehydrationTasks: Thenable<sqlops.Account>[] = [];
for (let account of restoredAccounts) {
// Purge any invalid accounts
if (!account) {
@@ -145,7 +145,7 @@ export class AzureAccountProvider implements data.AccountProvider {
return Promise.resolve();
}
private clearAccountTokens(accountKey: data.AccountKey): Thenable<void> {
private clearAccountTokens(accountKey: sqlops.AccountKey): Thenable<void> {
// Put together a query to look up any tokens associated with the account key
let query = <adal.TokenResponse>{ userId: accountKey.accountId };
@@ -180,7 +180,7 @@ export class AzureAccountProvider implements data.AccountProvider {
if (error) {
// TODO: We'll assume for now that the account is stale, though that might not be accurate
account.isStale = true;
data.accounts.accountUpdated(account);
sqlops.accounts.accountUpdated(account);
reject(error);
return;
@@ -240,7 +240,7 @@ export class AzureAccountProvider implements data.AccountProvider {
let title = isAddAccount ?
localize('addAccount', 'Add {0} account', self._metadata.displayName) :
localize('refreshAccount', 'Refresh {0} account', self._metadata.displayName);
return data.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
return sqlops.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
.then(() => {
return new Promise<adal.TokenResponse>((resolve, reject) => {
let context = oAuth.context;
@@ -249,14 +249,14 @@ export class AzureAccountProvider implements data.AccountProvider {
if (err) {
if (self._autoOAuthCancelled) {
// Auto OAuth was cancelled by the user, indicate this with the error we return
reject(<data.UserCancelledSignInError>{ userCancelledSignIn: true });
reject(<sqlops.UserCancelledSignInError>{ userCancelledSignIn: true });
} else {
// Auto OAuth failed for some other reason
data.accounts.endAutoOAuthDeviceCode();
sqlops.accounts.endAutoOAuthDeviceCode();
reject(err);
}
} else {
data.accounts.endAutoOAuthDeviceCode();
sqlops.accounts.endAutoOAuthDeviceCode();
resolve(<adal.TokenResponse>response);
}

View File

@@ -6,7 +6,7 @@
'use strict';
import * as constants from '../constants';
import * as data from 'data';
import * as sqlops from 'sqlops';
import * as events from 'events';
import * as nls from 'vscode-nls';
import * as path from 'path';
@@ -27,7 +27,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
// MEMBER VARIABLES ////////////////////////////////////////////////////////
private _accountDisposals: { [accountProviderId: string]: vscode.Disposable };
private _accountProviders: { [accountProviderId: string]: AzureAccountProvider };
private _credentialProvider: data.CredentialProvider;
private _credentialProvider: sqlops.CredentialProvider;
private _configChangePromiseChain: Thenable<void>;
private _currentConfig: vscode.WorkspaceConfiguration;
private _event: events.EventEmitter;
@@ -55,7 +55,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
// 2a) Store the credential provider for use later
// 2b) Register the configuration change handler
// 2c) Perform an initial config change handling
return data.credentials.getProvider(AzureAccountProviderService.CredentialNamespace)
return sqlops.credentials.getProvider(AzureAccountProviderService.CredentialNamespace)
.then(credProvider => {
self._credentialProvider = credProvider;
@@ -138,7 +138,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
let tokenCache = new CredentialServiceTokenCache(self._credentialProvider, tokenCacheKey, tokenCachePath);
let accountProvider = new AzureAccountProvider(<AzureAccountProviderMetadata>provider.metadata, tokenCache);
self._accountProviders[provider.metadata.id] = accountProvider;
self._accountDisposals[provider.metadata.id] = data.accounts.registerAccountProvider(provider.metadata, accountProvider);
self._accountDisposals[provider.metadata.id] = sqlops.accounts.registerAccountProvider(provider.metadata, accountProvider);
resolve();
} catch (e) {
console.error(`Failed to register account provider: ${e}`);

View File

@@ -1,6 +1,6 @@
'use strict';
import * as data from 'data';
import * as sqlops from 'sqlops';
/**
* Represents a tenant (an Azure Active Directory instance) to which a user has access
@@ -118,7 +118,7 @@ export interface ProviderSettings {
/**
* Extension of account provider metadata to override settings type for Azure account providers
*/
export interface AzureAccountProviderMetadata extends data.AccountProviderMetadata {
export interface AzureAccountProviderMetadata extends sqlops.AccountProviderMetadata {
/**
* Azure specific account provider settings.
*/
@@ -143,7 +143,7 @@ export interface AzureAccountProperties {
/**
* Override of the Account type to enforce properties that are AzureAccountProperties
*/
export interface AzureAccount extends data.Account {
export interface AzureAccount extends sqlops.Account {
/**
* AzureAccountProperties specifically used for Azure accounts
*/
@@ -179,4 +179,4 @@ export interface AzureAccountSecurityToken {
* Azure account security token maps a tenant ID to the information returned from a request to get
* an access token. The list of tenants correspond to the tenants in the account properties.
*/
export type AzureAccountSecurityTokenCollection = {[tenantId: string]: AzureAccountSecurityToken};
export type AzureAccountSecurityTokenCollection = { [tenantId: string]: AzureAccountSecurityToken };

View File

@@ -6,7 +6,7 @@
'use strict';
import * as adal from 'adal-node';
import * as data from 'data';
import * as sqlops from 'sqlops';
import * as crypto from 'crypto';
import * as fs from 'fs';
@@ -19,7 +19,7 @@ export default class TokenCache implements adal.TokenCache {
private _activeOperation: Thenable<any>;
constructor(
private _credentialProvider: data.CredentialProvider,
private _credentialProvider: sqlops.CredentialProvider,
private _credentialServiceKey: string,
private _cacheSerializationPath: string
) {

View File

@@ -8,15 +8,31 @@
import * as fs from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
import { Utils } from 'extensions-modules';
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(Utils.getDefaultLogLocation(), constants.extensionName);
let storagePath = path.join(getDefaultLogLocation(), constants.extensionName);
try {
if (!fs.existsSync(storagePath)) {
fs.mkdirSync(storagePath);

View File

@@ -4,4 +4,4 @@
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/sql/data.d.ts'/>
/// <reference path='../../../../src/sql/sqlops.d.ts'/>

View File

@@ -6,12 +6,12 @@
"vscode": "*"
},
"contributes": {
"insights": [
"dashboard.insights": [
{
"id": "query-data-store-db-insight",
"contrib": {
"name": "Top 5 Slowest Queries",
"provider": "MSSQL",
"when": "connectionProvider == 'MSSQL'",
"gridItemConfig": {
"x": 2,
"y": 1
@@ -41,7 +41,7 @@
"id": "table-space-db-insight",
"contrib": {
"name": "Space used per table",
"provider": "MSSQL",
"when": "connectionProvider == 'MSSQL'",
"gridItemConfig": {
"x": 2,
"y": 1
@@ -62,8 +62,7 @@
"id": "all-database-size-server-insight",
"contrib": {
"name": "Database Size (MB)",
"provider": "MSSQL",
"edition": [0,1,2,3,4],
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
"gridItemConfig": {
"x": 2,
"y": 2
@@ -84,8 +83,7 @@
"contrib": {
"cacheId": "backup-history-server-insight",
"name": "Backup Status",
"provider": "MSSQL",
"edition": [0,1,2,3,4],
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
"gridItemConfig": {
"x": 1,
"y": 1

View File

@@ -1,7 +1,7 @@
{
"service": {
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "1.4.0-alpha.10",
"version": "1.4.0-alpha.12",
"downloadFileNames": {
"Windows_86": "win-x86-netcoreapp2.0.zip",
"Windows_64": "win-x64-netcoreapp2.0.zip",

View File

@@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
export enum BuiltInCommands {
SetContext = 'setContext',
}
export enum ContextKeys {
ISCLOUD = 'mssql:iscloud'
}
const isCloudEditions = [
5,
6
];
export function setCommandContext(key: ContextKeys | string, value: any) {
return vscode.commands.executeCommand(BuiltInCommands.SetContext, key, value);
}
export default class ContextProvider {
private _disposables = new Array<vscode.Disposable>();
constructor() {
this._disposables.push(sqlops.workspace.onDidOpenDashboard(this.onDashboardOpen, this));
this._disposables.push(sqlops.workspace.onDidChangeToDashboard(this.onDashboardOpen, this));
}
public onDashboardOpen(e: sqlops.DashboardDocument): void {
let iscloud: boolean;
if (e.profile.providerName.toLowerCase() === 'mssql' && e.serverInfo.engineEditionId) {
if (isCloudEditions.some(i => i === e.serverInfo.engineEditionId)) {
iscloud = true;
} else {
iscloud = false;
}
}
if (iscloud === true || iscloud === false) {
setCommandContext(ContextKeys.ISCLOUD, iscloud);
}
}
dispose(): void {
this._disposables = this._disposables.map(i => i.dispose());
}
}

View File

@@ -4,12 +4,12 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import vscode = require('vscode');
import data = require('data');
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import { Constants } from '../models/constants';
import { Serialization } from '../serialize/serialization';
import { AzureResourceProvider } from '../resourceProvider/resourceProvider';
import { CredentialStore } from '../credentialstore/credentialstore';
import { AzureResourceProvider } from '../resourceProvider/resourceProvider';
import { IExtensionConstants, Telemetry, Constants as SharedConstants, SqlToolsServiceClient, VscodeWrapper, Utils, PlatformInformation } from 'extensions-modules';
import { SqlOpsDataClient } from 'dataprotocol-client';
import * as path from 'path';
@@ -101,7 +101,7 @@ export default class MainController implements vscode.Disposable {
self.createResourceProviderClient().then(rpClient => {
let resourceProvider = new AzureResourceProvider(self._client, rpClient);
data.resources.registerResourceProvider({
sqlops.resources.registerResourceProvider({
displayName: 'Azure SQL Resource Provider', // TODO Localize
id: 'Microsoft.Azure.SQL.ResourceProvider',
settings: {
@@ -116,19 +116,19 @@ export default class MainController implements vscode.Disposable {
self.createCredentialClient().then(credentialClient => {
self._credentialStore.languageClient = credentialClient;
credentialClient.onReady().then(() => {
let credentialProvider: data.CredentialProvider = {
let credentialProvider: sqlops.CredentialProvider = {
handle: 0,
saveCredential(credentialId: string, password: string): Thenable<boolean> {
return self._credentialStore.saveCredential(credentialId, password);
},
readCredential(credentialId: string): Thenable<data.Credential> {
readCredential(credentialId: string): Thenable<sqlops.Credential> {
return self._credentialStore.readCredential(credentialId);
},
deleteCredential(credentialId: string): Thenable<boolean> {
return self._credentialStore.deleteCredential(credentialId);
}
};
data.credentials.registerProvider(credentialProvider);
sqlops.credentials.registerProvider(credentialProvider);
Utils.logDebug('credentialProvider registered', MainController._extensionConstants.extensionConfigSectionName);
});
}, error => {

View File

@@ -6,12 +6,15 @@
import vscode = require('vscode');
import MainController from './controllers/mainController';
import ContextProvider from './contextProvider';
export let controller: MainController;
export function activate(context: vscode.ExtensionContext) {
controller = new MainController(context);
let contextProvider = new ContextProvider();
context.subscriptions.push(controller);
context.subscriptions.push(contextProvider);
controller.activate();
}

View File

@@ -5,7 +5,7 @@
'use strict';
import { RequestType } from 'vscode-languageclient';
import * as data from 'data';
import * as sqlops from 'sqlops';
// DEV-NOTE: Still finalizing what we'll need as part of this interface
/**
@@ -22,7 +22,7 @@ export class SaveResultsInfo {
}
export namespace SaveAsRequest {
export const type = new RequestType<SaveResultsInfo, data.SaveResultRequestResult, void, void>('query/saveAs');
export const type = new RequestType<SaveResultsInfo, sqlops.SaveResultRequestResult, void, void>('query/saveAs');
}
// --------------------------------- < Read Credential Request > -------------------------------------------------
@@ -77,7 +77,7 @@ export namespace HandleFirewallRuleRequest {
// Firewall rule interfaces
export interface CreateFirewallRuleParams {
account: data.Account;
account: sqlops.Account;
serverName: string;
startIpAddress: string;
endIpAddress: string;

View File

@@ -7,7 +7,7 @@
import * as Contracts from '../models/contracts';
import { SqlToolsServiceClient } from 'extensions-modules';
import { SqlOpsDataClient } from 'dataprotocol-client';
import * as data from 'data';
import * as sqlops from 'sqlops';
import * as path from 'path';
@@ -16,7 +16,7 @@ import * as path from 'path';
*
* Allows a single credential to be stored per service (that is, one username per service);
*/
export class AzureResourceProvider implements data.ResourceProvider {
export class AzureResourceProvider implements sqlops.ResourceProvider {
public languageClient: SqlOpsDataClient;
@@ -27,9 +27,9 @@ export class AzureResourceProvider implements data.ResourceProvider {
this.languageClient = langClient;
}
public createFirewallRule(account: data.Account, firewallruleInfo: data.FirewallRuleInfo): Thenable<data.CreateFirewallRuleResponse> {
public createFirewallRule(account: sqlops.Account, firewallruleInfo: sqlops.FirewallRuleInfo): Thenable<sqlops.CreateFirewallRuleResponse> {
let self = this;
return new Promise<data.CreateFirewallRuleResponse>((resolve, reject) => {
return new Promise<sqlops.CreateFirewallRuleResponse>((resolve, reject) => {
self._client.
sendRequest(Contracts.CreateFirewallRuleRequest.type, self.asCreateFirewallRuleParams(account, firewallruleInfo), self.languageClient)
.then(response => {
@@ -38,9 +38,9 @@ export class AzureResourceProvider implements data.ResourceProvider {
});
}
public handleFirewallRule(errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<data.HandleFirewallRuleResponse> {
public handleFirewallRule(errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<sqlops.HandleFirewallRuleResponse> {
let self = this;
return new Promise<data.HandleFirewallRuleResponse>((resolve, reject) => {
return new Promise<sqlops.HandleFirewallRuleResponse>((resolve, reject) => {
let params: Contracts.HandleFirewallRuleParams = { errorCode: errorCode, errorMessage: errorMessage, connectionTypeId: connectionTypeId };
self._client.
@@ -51,7 +51,7 @@ export class AzureResourceProvider implements data.ResourceProvider {
});
}
private asCreateFirewallRuleParams(account: data.Account, params: data.FirewallRuleInfo): Contracts.CreateFirewallRuleParams {
private asCreateFirewallRuleParams(account: sqlops.Account, params: sqlops.FirewallRuleInfo): Contracts.CreateFirewallRuleParams {
return {
account: account,
serverName: params.serverName,

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as data from 'data';
import * as sqlops from 'sqlops';
/**
* Serializer for saving results into a different format
@@ -13,5 +13,5 @@ import * as data from 'data';
* @interface ISerialization
*/
export interface ISerialization {
saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Promise<data.SaveResultRequestResult>;
saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Promise<sqlops.SaveResultRequestResult>;
}

View File

@@ -7,7 +7,7 @@
import * as Contracts from '../models/contracts';
import { ISerialization } from './iserialization';
import { SqlToolsServiceClient } from 'extensions-modules';
import * as data from 'data';
import * as sqlops from 'sqlops';
import { SqlOpsDataClient } from 'dataprotocol-client';
import * as path from 'path';
@@ -28,14 +28,14 @@ export class Serialization implements ISerialization {
* @param {string} credentialId the ID uniquely identifying this credential
* @returns {Promise<ISaveResultsInfo>} Promise that resolved to the credential, or undefined if not found
*/
public saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Promise<data.SaveResultRequestResult> {
public saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Promise<sqlops.SaveResultRequestResult> {
let self = this;
let resultsInfo: Contracts.SaveResultsInfo = new Contracts.SaveResultsInfo(saveFormat, savePath, results, appendToFile);
return new Promise<data.SaveResultRequestResult>((resolve, reject) => {
return new Promise<sqlops.SaveResultRequestResult>((resolve, reject) => {
self._client
.sendRequest(Contracts.SaveAsRequest.type, resultsInfo, this._languageClient)
.then(result => {
resolve(<data.SaveResultRequestResult>result);
resolve(<sqlops.SaveResultRequestResult>result);
}, err => reject(err));
});
}

View File

@@ -190,6 +190,9 @@
]
}
},
"dependencies": {
"extensions-modules": "file:../../extensions-modules"
},
"devDependencies": {
"vscode": "1.0.1"
}

View File

@@ -2,6 +2,12 @@
# yarn lockfile v1
agent-base@4, agent-base@^4.1.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce"
dependencies:
es6-promisify "^5.0.0"
ajv@^5.1.0:
version "5.5.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
@@ -41,6 +47,10 @@ ansi-wrap@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"
applicationinsights@0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
arr-diff@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
@@ -109,6 +119,10 @@ balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
base64-js@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"
bcrypt-pbkdf@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
@@ -119,12 +133,22 @@ beeper@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809"
bl@^1.0.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e"
dependencies:
readable-stream "^2.0.5"
block-stream@*:
version "0.0.9"
resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
dependencies:
inherits "~2.0.0"
bluebird@^3.5.0:
version "3.5.1"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
boom@2.x.x:
version "2.10.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
@@ -162,6 +186,14 @@ buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
buffer@^3.0.1:
version "3.6.0"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb"
dependencies:
base64-js "0.0.8"
ieee754 "^1.1.4"
isarray "^1.0.0"
builtin-modules@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
@@ -259,6 +291,12 @@ commander@^2.9.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
commander@~2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4"
dependencies:
graceful-readlink ">= 1.0.0"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -295,6 +333,12 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#0.1.3":
version "0.1.3"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/5758b2a5804ea488d14326662f51d19cc970ccd0"
dependencies:
vscode-languageclient "3.5.0"
dateformat@^1.0.7-1.2.3:
version "1.0.12"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9"
@@ -306,16 +350,76 @@ dateformat@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062"
debug@2:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
ms "2.0.0"
debug@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
dependencies:
ms "0.7.1"
debug@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
ms "2.0.0"
decamelize@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1"
dependencies:
file-type "^5.2.0"
is-stream "^1.1.0"
tar-stream "^1.5.2"
decompress-tarbz2@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b"
dependencies:
decompress-tar "^4.1.0"
file-type "^6.1.0"
is-stream "^1.1.0"
seek-bzip "^1.0.5"
unbzip2-stream "^1.0.9"
decompress-targz@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee"
dependencies:
decompress-tar "^4.1.1"
file-type "^5.2.0"
is-stream "^1.1.0"
decompress-unzip@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69"
dependencies:
file-type "^3.8.0"
get-stream "^2.2.0"
pify "^2.3.0"
yauzl "^2.4.2"
decompress@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d"
dependencies:
decompress-tar "^4.0.0"
decompress-tarbz2 "^4.0.0"
decompress-targz "^4.0.0"
decompress-unzip "^4.0.1"
graceful-fs "^4.1.10"
make-dir "^1.0.0"
pify "^2.3.0"
strip-dirs "^2.0.0"
deep-assign@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-1.0.0.tgz#b092743be8427dc621ea0067cdec7e70dd19f37b"
@@ -367,6 +471,16 @@ error-ex@^1.2.0:
dependencies:
is-arrayish "^0.2.1"
es6-promise@^4.0.3:
version "4.2.4"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
es6-promisify@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
dependencies:
es6-promise "^4.0.3"
escape-string-regexp@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
@@ -421,6 +535,19 @@ extend@^3.0.0, extend@~3.0.0, extend@~3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
"extensions-modules@file:../../extensions-modules":
version "0.1.0"
dependencies:
dataprotocol-client "github:Microsoft/sqlops-dataprotocolclient#0.1.3"
decompress "^4.2.0"
fs-extra-promise "^1.0.1"
http-proxy-agent "^2.0.0"
https-proxy-agent "^2.1.0"
opener "^1.4.3"
tmp "0.0.33"
vscode-extension-telemetry "0.0.8"
vscode-languageclient "^3.5.0"
extglob@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
@@ -457,6 +584,18 @@ fd-slicer@~1.0.1:
dependencies:
pend "~1.2.0"
file-type@^3.8.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
file-type@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"
file-type@^6.1.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
filename-regex@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
@@ -516,6 +655,20 @@ from@~0:
version "0.1.7"
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
fs-extra-promise@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/fs-extra-promise/-/fs-extra-promise-1.0.1.tgz#b6ed1ace97b10e06b95f458d051b7f05c6613ee6"
dependencies:
bluebird "^3.5.0"
fs-extra "^2.1.2"
fs-extra@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^2.1.0"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -543,6 +696,13 @@ get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
get-stream@^2.2.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
dependencies:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
@@ -616,7 +776,7 @@ glogg@^1.0.0:
dependencies:
sparkles "^1.0.0"
graceful-fs@^4.0.0, graceful-fs@^4.1.2:
graceful-fs@^4.0.0, graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
@@ -626,6 +786,10 @@ graceful-fs@~3.0.2:
dependencies:
natives "^1.1.0"
"graceful-readlink@>= 1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
growl@1.9.2:
version "1.9.2"
resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
@@ -814,6 +978,13 @@ hosted-git-info@^2.1.4:
version "2.5.0"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c"
http-proxy-agent@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.0.0.tgz#46482a2f0523a4d6082551709f469cb3e4a85ff4"
dependencies:
agent-base "4"
debug "2"
http-signature@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
@@ -830,6 +1001,17 @@ http-signature@~1.2.0:
jsprim "^1.2.2"
sshpk "^1.7.0"
https-proxy-agent@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.1.1.tgz#a7ce4382a1ba8266ee848578778122d491260fd9"
dependencies:
agent-base "^4.1.0"
debug "^3.1.0"
ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
indent-string@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
@@ -910,6 +1092,10 @@ is-my-json-valid@^2.12.4:
jsonpointer "^4.0.0"
xtend "^4.0.0"
is-natural-number@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
is-number@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
@@ -962,7 +1148,7 @@ isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
isarray@1.0.0, isarray@~1.0.0:
isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -1005,6 +1191,12 @@ 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"
jsonfile@^2.1.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
optionalDependencies:
graceful-fs "^4.1.6"
jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
@@ -1241,6 +1433,12 @@ lru-cache@2:
version "2.7.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
make-dir@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b"
dependencies:
pify "^3.0.0"
map-obj@^1.0.0, map-obj@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
@@ -1352,6 +1550,10 @@ ms@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
multimatch@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b"
@@ -1425,6 +1627,10 @@ once@^1.3.0, once@^1.4.0:
dependencies:
wrappy "1"
opener@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
ordered-read-streams@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b"
@@ -1432,6 +1638,10 @@ ordered-read-streams@^0.3.0:
is-stream "^1.0.1"
readable-stream "^2.0.1"
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
parse-glob@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
@@ -1483,10 +1693,14 @@ performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
pify@^2.0.0:
pify@^2.0.0, pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
pify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
pinkie-promise@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
@@ -1676,6 +1890,12 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
seek-bzip@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"
dependencies:
commander "~2.8.1"
"semver@2 || 3 || 4 || 5", semver@^5.1.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
@@ -1819,6 +2039,12 @@ strip-bom@^2.0.0:
dependencies:
is-utf8 "^0.2.0"
strip-dirs@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5"
dependencies:
is-natural-number "^4.0.1"
strip-indent@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
@@ -1837,6 +2063,15 @@ supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
tar-stream@^1.5.2:
version "1.5.5"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.5.tgz#5cad84779f45c83b1f2508d96b09d88c7218af55"
dependencies:
bl "^1.0.0"
end-of-stream "^1.0.0"
readable-stream "^2.0.0"
xtend "^4.0.0"
tar@~0.1.19:
version "0.1.20"
resolved "https://registry.yarnpkg.com/tar/-/tar-0.1.20.tgz#42940bae5b5f22c74483699126f9f3f27449cb13"
@@ -1880,7 +2115,7 @@ through2@~0.4.1:
readable-stream "~1.0.17"
xtend "~2.1.1"
through@2, through@~2.3, through@~2.3.1:
through@2, through@^2.3.6, through@~2.3, through@~2.3.1:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
@@ -1888,6 +2123,12 @@ time-stamp@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3"
tmp@0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
dependencies:
os-tmpdir "~1.0.2"
to-absolute-glob@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f"
@@ -1922,6 +2163,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
unbzip2-stream@^1.0.9:
version "1.2.5"
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz#73a033a567bbbde59654b193c44d48a7e4f43c47"
dependencies:
buffer "^3.0.1"
through "^2.3.6"
unique-stream@^2.0.2:
version "2.2.1"
resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369"
@@ -2026,6 +2274,34 @@ vinyl@~2.0.1:
remove-trailing-separator "^1.0.1"
replace-ext "^1.0.0"
vscode-extension-telemetry@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
dependencies:
applicationinsights "0.18.0"
winreg "1.2.3"
vscode-jsonrpc@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz#87239d9e166b2d7352245b8a813597804c1d63aa"
vscode-languageclient@3.5.0, vscode-languageclient@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-3.5.0.tgz#36d02cc186a8365a4467719a290fb200a9ae490a"
dependencies:
vscode-languageserver-protocol "^3.5.0"
vscode-languageserver-protocol@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0.tgz#067c5cbe27709795398d119692c97ebba1452209"
dependencies:
vscode-jsonrpc "^3.5.0"
vscode-languageserver-types "^3.5.0"
vscode-languageserver-types@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
vscode@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.0.1.tgz#3d161200615fe2af1d92ddc650751159411a513b"
@@ -2044,6 +2320,10 @@ vscode@1.0.1:
source-map-support "^0.3.2"
vinyl-source-stream "^1.1.0"
winreg@1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -2062,7 +2342,7 @@ xtend@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
yauzl@^2.2.1:
yauzl@^2.2.1, yauzl@^2.4.2:
version "2.9.1"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.9.1.tgz#a81981ea70a57946133883f029c5821a89359a7f"
dependencies:

View File

@@ -2,11 +2,8 @@
"name": "vscode-extensions",
"version": "0.0.1",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "2.6.2",
"extensions-modules": "file:../extensions-modules"
},
"devDependencies": {
"typescript": "2.6.2"
},
"scripts": {
"postinstall": "node ./postinstall"

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/Microsoft/vscode-mssql/commit/cfc8b65ed6daf8252b0cbfd5611aadbd49353bca",
"version": "https://github.com/Microsoft/vscode-mssql/commit/c8effddd6a9df117f3ed45b60b487163950a7ea5",
"fileTypes": [
"sql",
"ddl",

View File

@@ -2,403 +2,6 @@
# yarn lockfile v1
agent-base@4, agent-base@^4.1.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce"
dependencies:
es6-promisify "^5.0.0"
applicationinsights@0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
base64-js@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"
bl@^1.0.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e"
dependencies:
readable-stream "^2.0.5"
bluebird@^3.5.0:
version "3.5.1"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
buffer@^3.0.1:
version "3.6.0"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb"
dependencies:
base64-js "0.0.8"
ieee754 "^1.1.4"
isarray "^1.0.0"
commander@~2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4"
dependencies:
graceful-readlink ">= 1.0.0"
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"
"dataprotocol-client@file:./../dataprotocol-client":
version "1.0.0"
dependencies:
typescript "2.6.2"
vscode-languageclient "3.5.0"
debug@2:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
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"
dependencies:
ms "2.0.0"
decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1"
dependencies:
file-type "^5.2.0"
is-stream "^1.1.0"
tar-stream "^1.5.2"
decompress-tarbz2@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b"
dependencies:
decompress-tar "^4.1.0"
file-type "^6.1.0"
is-stream "^1.1.0"
seek-bzip "^1.0.5"
unbzip2-stream "^1.0.9"
decompress-targz@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee"
dependencies:
decompress-tar "^4.1.1"
file-type "^5.2.0"
is-stream "^1.1.0"
decompress-unzip@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69"
dependencies:
file-type "^3.8.0"
get-stream "^2.2.0"
pify "^2.3.0"
yauzl "^2.4.2"
decompress@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d"
dependencies:
decompress-tar "^4.0.0"
decompress-tarbz2 "^4.0.0"
decompress-targz "^4.0.0"
decompress-unzip "^4.0.1"
graceful-fs "^4.1.10"
make-dir "^1.0.0"
pify "^2.3.0"
strip-dirs "^2.0.0"
end-of-stream@^1.0.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
dependencies:
once "^1.4.0"
es6-promise@^4.0.3:
version "4.2.4"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
es6-promisify@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
dependencies:
es6-promise "^4.0.3"
"extensions-modules@file:../extensions-modules":
version "0.1.0"
dependencies:
<<<<<<< HEAD
dataprotocol-client "file:./../../../../AppData/Local/Yarn/cache/v1/dataprotocol-client"
=======
dataprotocol-client "file:C:/Users/andresse/AppData/Local/Yarn/cache/v1/dataprotocol-client"
>>>>>>> master
decompress "^4.2.0"
fs-extra-promise "^1.0.1"
http-proxy-agent "^2.0.0"
https-proxy-agent "^2.1.0"
opener "^1.4.3"
tmp "0.0.33"
vscode-extension-telemetry "0.0.8"
vscode-languageclient "^3.5.0"
fd-slicer@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
dependencies:
pend "~1.2.0"
file-type@^3.8.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
file-type@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"
file-type@^6.1.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
fs-extra-promise@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/fs-extra-promise/-/fs-extra-promise-1.0.1.tgz#b6ed1ace97b10e06b95f458d051b7f05c6613ee6"
dependencies:
bluebird "^3.5.0"
fs-extra "^2.1.2"
fs-extra@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^2.1.0"
get-stream@^2.2.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
dependencies:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"
graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
"graceful-readlink@>= 1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
http-proxy-agent@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.0.0.tgz#46482a2f0523a4d6082551709f469cb3e4a85ff4"
dependencies:
agent-base "4"
debug "2"
https-proxy-agent@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.1.1.tgz#a7ce4382a1ba8266ee848578778122d491260fd9"
dependencies:
agent-base "^4.1.0"
debug "^3.1.0"
ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
is-natural-number@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
is-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
jsonfile@^2.1.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
optionalDependencies:
graceful-fs "^4.1.6"
make-dir@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51"
dependencies:
pify "^3.0.0"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
object-assign@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
opener@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
pend@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
pify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
pinkie-promise@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
dependencies:
pinkie "^2.0.0"
pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
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"
readable-stream@^2.0.0, readable-stream@^2.0.5:
version "2.3.3"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
safe-buffer "~5.1.1"
string_decoder "~1.0.3"
util-deprecate "~1.0.1"
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
seek-bzip@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"
dependencies:
commander "~2.8.1"
string_decoder@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
dependencies:
safe-buffer "~5.1.0"
strip-dirs@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5"
dependencies:
is-natural-number "^4.0.1"
tar-stream@^1.5.2:
version "1.5.5"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.5.tgz#5cad84779f45c83b1f2508d96b09d88c7218af55"
dependencies:
bl "^1.0.0"
end-of-stream "^1.0.0"
readable-stream "^2.0.0"
xtend "^4.0.0"
through@^2.3.6:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
tmp@0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
dependencies:
os-tmpdir "~1.0.2"
typescript@2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
unbzip2-stream@^1.0.9:
version "1.2.5"
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz#73a033a567bbbde59654b193c44d48a7e4f43c47"
dependencies:
buffer "^3.0.1"
through "^2.3.6"
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
vscode-extension-telemetry@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
dependencies:
applicationinsights "0.18.0"
winreg "1.2.3"
vscode-jsonrpc@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz#87239d9e166b2d7352245b8a813597804c1d63aa"
vscode-languageclient@3.5.0, vscode-languageclient@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-3.5.0.tgz#36d02cc186a8365a4467719a290fb200a9ae490a"
dependencies:
vscode-languageserver-protocol "^3.5.0"
vscode-languageserver-protocol@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0.tgz#067c5cbe27709795398d119692c97ebba1452209"
dependencies:
vscode-jsonrpc "^3.5.0"
vscode-languageserver-types "^3.5.0"
vscode-languageserver-types@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
winreg@1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
xtend@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
yauzl@^2.4.2:
version "2.9.1"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.9.1.tgz#a81981ea70a57946133883f029c5821a89359a7f"
dependencies:
buffer-crc32 "~0.2.3"
fd-slicer "~1.0.1"

13
extensionsGallery.json Normal file
View File

@@ -0,0 +1,13 @@
{
"results": [{
"extensions": [
],
"resultMetadata": [{
"metadataType": "ResultCount",
"metadataItems": [{
"name": "TotalCount",
"count": 0
}]
}]
}]
}

View File

@@ -1,6 +1,6 @@
{
"name": "sqlops",
"version": "0.26.5",
"version": "0.27.0",
"distro": "8c3e97e3425cc9814496472ab73e076de2ba99ee",
"author": {
"name": "Microsoft Corporation"
@@ -44,7 +44,7 @@
"gc-signals": "^0.0.1",
"getmac": "1.0.7",
"graceful-fs": "4.1.11",
"html-query-plan": "git://github.com/anthonydresser/html-query-plan.git#2.3",
"html-query-plan": "git://github.com/anthonydresser/html-query-plan.git#2.4",
"http-proxy-agent": "0.2.7",
"https-proxy-agent": "0.3.6",
"iconv-lite": "0.4.19",
@@ -64,7 +64,7 @@
"reflect-metadata": "^0.1.8",
"rxjs": "5.4.0",
"semver": "4.3.6",
"slickgrid": "github:anthonydresser/SlickGrid#2.3.13",
"slickgrid": "github:anthonydresser/SlickGrid#2.3.16",
"spdlog": "0.3.7",
"svg.js": "^2.2.5",
"systemjs": "0.19.40",

View File

@@ -28,5 +28,9 @@
"releaseNotesUrl": "https://go.microsoft.com/fwlink/?linkid=862039",
"documentationUrl": "https://go.microsoft.com/fwlink/?linkid=862277",
"commit": "9ca6200018fc206d67a47229f991901a8a453781",
"date": "2017-12-15T12:00:00.000Z"
"date": "2017-12-15T12:00:00.000Z",
"recommendedExtensions": [],
"extensionsGallery": {
"serviceUrl": "https://raw.githubusercontent.com/Microsoft/sqlopsstudio/release/extensions/extensionsGallery.json"
}
}

8
samples/extensionSamples/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
out
node_modules
.vscode-test/
*.vsix
.DS_Store
.idea
test-reports/**

View File

@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\out\\src\\extension"
},
{
"type": "node",
"request": "attach",
"name": "Attach to Ops Studio",
"protocol": "inspector",
"port": 5870,
"restart": true,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
],
"preLaunchTask": "",
"timeout": 25000
},
]
}

View File

@@ -0,0 +1,29 @@
# Unwanted compiled files
out/test/**
out/**/*.map
*.vsix
# Build/Source files
src/**
tasks/**
test/**
typings/**
packages/**
samples/**
.gitignore
tsconfig.json
# IDE Settings
.vscode/**
.vscode-test/**
.idea/**
.sqlops/**
# Reference files
**/*.ts
**/*.map
.gitignore
tsconfig.json
*.exe
*.dat
gulpfile.js

View File

@@ -0,0 +1 @@
# Change Log

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

View File

@@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"use strict";
// NOTE: These are es6 gulpfiles
// Basic build tasks
require('./tasks/buildtasks');
// VSIX generation tasks
require('./tasks/packagetasks');

7751
samples/extensionSamples/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,197 @@
{
"name": "extensionSamples",
"displayName": "Extension Samples",
"description": "Extension Samples",
"version": "0.1.0",
"publisher": "Microsoft",
"engines": {
"vscode": "^1.19.0"
},
"license": "MIT",
"repository": "qqq.com",
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./out/src/extension",
"contributes": {
"configuration": [],
"commands": [],
"views": {},
"menus": {},
"dashboard.tabs": [
{
"id": "extension-samples",
"title": "Extension Samples",
"description": "This is the dashboard extension samples.",
"container": {
"nav-section": [
{
"id": "widgets-container1",
"title": "Widgets",
"icon": {
"light": "./out/src/media/file.svg",
"dark": "./out/src/media/file_inverse.svg"
},
"container": {
"widgets-container1": {}
}
},
{
"id": "grid-tab",
"title": "GridLayout",
"icon": {
"light": "./out/src/media/file.svg",
"dark": "./out/src/media/file_inverse.svg"
},
"container": {
"grid-container1": {}
}
},
{
"id": "webviewExample",
"title": "Webivew",
"icon": {
"light": "./out/src/media/file.svg",
"dark": "./out/src/media/file_inverse.svg"
},
"container": {
"webview-container": null
}
}
]
}
}
],
"dashboard.insights": {
"id": "query-data-store-db-insight",
"contrib": {
"name": "Top 5 Slowest Queries",
"provider": "MSSQL",
"gridItemConfig": {
"x": 2,
"y": 1
},
"type": {
"timeSeries": {
"dataDirection": "horizontal",
"dataType": "point",
"legendPosition": "top",
"labelFirstColumn": false,
"columnsAsLabels": false
}
},
"queryFile": "./out/src/sql/qds.sql",
"details": {
"queryFile": "./out/src/sql/qds_detail.sql",
"label": {
"icon": "file",
"column": "query_id",
"state": []
},
"value": "max_duration"
}
}
},
"dashboard.containers": [
{
"id": "grid-container1",
"container": {
"grid-container": [
{
"name": "Tasks",
"row": 0,
"col": 0,
"widget": {
"tasks-widget": [
{
"name": "backup",
"when": "!mssql:iscloud"
},
{
"name": "restore",
"when": "!mssql:iscloud"
},
"configureDashboard",
"newQuery"
]
}
},
{
"name": "Web view buttons",
"widget": {
"webview-widget": {
"id": "webview-button"
}
},
"row": 0,
"col": 1
},
{
"name": "Web view count",
"webview": {
"id": "webview-count"
},
"row": 1,
"col": 0,
"colspan": "*"
}
]
}
},
{
"id": "widgets-container1",
"container": {
"widgets-container": [
{
"widget": {
"query-data-store-db-insight": {
}
}
},
{
"widget": {
"explorer-widget": {
}
}
}
]
}
}
],
"snippets": []
},
"scripts": {
"build": "gulp build",
"compile": "gulp compile",
"watch": "gulp watch",
"postinstall": "node ./node_modules/vscode/bin/install"
},
"dependencies": {
"fs-extra": "^5.0.0",
"handlebars": "^4.0.11",
"vscode-nls": "2.0.2"
},
"devDependencies": {
"@types/handlebars": "^4.0.11",
"@types/mocha": "^2.2.42",
"@types/node": "^7.0.43",
"child-process-promise": "^2.2.1",
"del": "^3.0.0",
"gulp": "^4.0.0",
"gulp-color": "0.0.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-tslint": "^6.0.2",
"gulp-typescript": "^3.2.4",
"should": "^13.2.1",
"temp-write": "^3.4.0",
"tslint": "^3.14.0",
"typemoq": "^2.1.0",
"typescript": "^2.6.1",
"vscode": "^1.1.6",
"vsce": "1.36.2"
}
}

View File

@@ -0,0 +1,5 @@
'use strict';
// CONFIG VALUES ///////////////////////////////////////////////////////////
export const extensionConfigSectionName = 'extensionSamples';
export const configLogDebugInfo = 'logDebugInfo';

View File

@@ -0,0 +1,16 @@
<html>
<header>
</header>
<body>
<button onclick="count()">Count</button>
<button onclick="openFlyout()">Open Flyout</button>
<script>
function count() {
parent.postMessage('count', '*');
}
function openFlyout() {
parent.postMessage('openFlyout', '*');
}
</script>
</body>
</html>

View File

@@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
export default abstract class ControllerBase implements vscode.Disposable {
protected _context: vscode.ExtensionContext;
public constructor(context: vscode.ExtensionContext) {
this._context = context;
}
abstract activate(): Promise<boolean>;
abstract deactivate(): void;
public dispose(): void {
this.deactivate();
}
}

View File

@@ -0,0 +1,15 @@
<html>
<header>
</header>
<body>
<div id="output">Total Counts: 0</div>
<script>
let output = document.getElementById('output');
window.addEventListener("message", receiveMessage, false);
function receiveMessage(e) {
output.innerText = 'Total Counts: ' + e.data;
}
</script>
</body>
</html>

View File

@@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as Utils from '../utils';
import ControllerBase from './controllerBase';
import * as fs from 'fs';
import * as path from 'path';
/**
* The main controller class that initializes the extension
*/
export default class MainController extends ControllerBase {
// PUBLIC METHODS //////////////////////////////////////////////////////
/**
* Deactivates the extension
*/
public deactivate(): void {
Utils.logDebug('Main controller deactivated');
}
public activate(): Promise<boolean> {
const webviewExampleHtml = fs.readFileSync(path.join(__dirname, 'webviewExample.html')).toString();
const buttonHtml = fs.readFileSync(path.join(__dirname, 'button.html')).toString();
const counterHtml = fs.readFileSync(path.join(__dirname, 'counter.html')).toString();
let countWidget: sqlops.DashboardWebview;
let buttonWidget: sqlops.DashboardWebview;
let count = 0;
let dialog: sqlops.ModalDialog = sqlops.window.createDialog('Flyout extension');
dialog.html = '<div>This is a flyout extension.</div>';
sqlops.dashboard.registerWebviewProvider('webview-count', e => {
e.html = counterHtml;
countWidget = e;
});
sqlops.dashboard.registerWebviewProvider('webview-button', e => {
e.html = buttonHtml;
buttonWidget = e;
e.onMessage(event => {
if (event === 'openFlyout') {
dialog.open();
} else {
count++;
countWidget.postMessage(count);
}
});
});
sqlops.dashboard.registerWebviewProvider('webviewExample', e => {
e.html = webviewExampleHtml;
});
return Promise.resolve(true);
}
}

View File

@@ -0,0 +1,19 @@
<html>
<header>
<style>
html {
width: 100%;
height: 100%;
}
body {
width: 100%;
height: 100%;
background-color: skyblue;
}
</style>
</header>
<body>
Hello :)
</body>
</html>

View File

@@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import ControllerBase from './controllers/controllerBase';
import MainController from './controllers/mainController';
let controllers: ControllerBase[] = [];
export function activate(context: vscode.ExtensionContext): Promise<boolean> {
let activations: Promise<boolean>[] = [];
// Start the main controller
let mainController = new MainController(context);
controllers.push(mainController);
context.subscriptions.push(mainController);
activations.push(mainController.activate());
return Promise.all(activations)
.then((results: boolean[]) => {
for (let result of results) {
if (!result) {
return false;
}
}
return true;
});
}
export function deactivate(): void {
for (let controller of controllers) {
controller.deactivate();
}
}

View File

@@ -0,0 +1,5 @@
'use strict';
// TODO: localize!
export const msgErrorLoadingTab = 'An error occurred while loading the tab.';

View 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:#212121;}</style></defs><title>file_16x16</title><polygon class="cls-1" points="13.59 2.21 13.58 2.22 13.58 2.2 13.59 2.21"/><path class="cls-2" d="M8.71,0,14,5.29V16H2V0ZM3,15H13V6H8V1H3ZM9,1.71V5h3.29Z"/></svg>

After

Width:  |  Height:  |  Size: 351 B

View 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>file_inverse_16x16</title><polygon class="cls-1" points="13.59 2.21 13.58 2.22 13.58 2.2 13.59 2.21"/><path class="cls-1" d="M8.71,0,14,5.29V16H2V0ZM3,15H13V6H8V1H3ZM9,1.71V5h3.29Z"/></svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@@ -0,0 +1,39 @@
declare @qds_status int = (SELECT actual_state
FROM sys.database_query_store_options)
if @qds_status > 0
Begin
WITH SlowestQry AS(
SELECT TOP 5
q.query_id,
MAX(rs.max_duration ) max_duration
FROM sys.query_store_query_text AS qt
JOIN sys.query_store_query AS q
ON qt.query_text_id = q.query_text_id
JOIN sys.query_store_plan AS p
ON q.query_id = p.query_id
JOIN sys.query_store_runtime_stats AS rs
ON p.plan_id = rs.plan_id
WHERE rs.last_execution_time > DATEADD(week, -1, GETUTCDATE())
AND is_internal_query = 0
GROUP BY q.query_id
ORDER BY MAX(rs.max_duration ) DESC)
SELECT
q.query_id,
format(rs.last_execution_time,'yyyy-MM-dd hh:mm:ss') as [last_execution_time],
rs.max_duration,
p.plan_id
FROM sys.query_store_query_text AS qt
JOIN sys.query_store_query AS q
ON qt.query_text_id = q.query_text_id
JOIN sys.query_store_plan AS p
ON q.query_id = p.query_id
JOIN sys.query_store_runtime_stats AS rs
ON p.plan_id = rs.plan_id
JOIN SlowestQry tq
ON tq.query_id = q.query_id
WHERE rs.last_execution_time > DATEADD(week, -1, GETUTCDATE())
AND is_internal_query = 0
order by format(rs.last_execution_time,'yyyy-MM-dd hh:mm:ss')
END
else
select 0 as [query_id], getdate() as [QDS is not enabled], 0 as [max_duration]

View File

@@ -0,0 +1,45 @@
'use strict';
import * as fs from 'fs-extra';
import * as handlebars from 'handlebars';
import * as path from 'path';
import * as vscode from 'vscode';
import * as Constants from './constants';
import * as LocalizedConstants from './localizedConstants';
/**
* Helper to log messages to the developer console if enabled
* @param msg Message to log to the console
*/
export function logDebug(msg: any): void {
let config = vscode.workspace.getConfiguration(Constants.extensionConfigSectionName);
let logDebugInfo = config[Constants.configLogDebugInfo];
if (logDebugInfo === true) {
let currentTime = new Date().toLocaleTimeString();
let outputMsg = '[' + currentTime + ']: ' + msg ? msg.toString() : '';
console.log(outputMsg);
}
}
export function renderTemplateHtml(extensionPath: string, templateName: string, templateValues: object): Thenable<string> {
let templatePath = path.join(extensionPath, 'resources', templateName);
// 1) Read the template from the disk
// 2) Compile it as a handlebars template and render the HTML
// 3) On failure, return a simple string as an error
return fs.readFile(templatePath, 'utf-8')
.then(templateText => {
let template = handlebars.compile(templateText);
return template(templateValues);
})
.then(
undefined,
error => {
logDebug(error);
return LocalizedConstants.msgErrorLoadingTab;
}
);
}

View File

@@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"use strict";
let del = require('del');
let gulp = require('gulp');
let srcmap = require('gulp-sourcemaps');
let tslint = require('gulp-tslint');
let ts = require('gulp-typescript');
let cproc = require('child_process');
let os = require('os');
let config = require('./config');
let tsProject = ts.createProject('tsconfig.json');
// GULP TASKS //////////////////////////////////////////////////////////////
gulp.task('clean', function(done) {
return del('out', done);
});
gulp.task('lint', () => {
return gulp.src([
config.paths.project.root + '/src/**/*.ts',
config.paths.project.root + '/test/**/*.ts'
])
.pipe((tslint({
formatter: "verbose"
})))
.pipe(tslint.report());
});
gulp.task('compile:src', function(done) {
gulp.src([
config.paths.project.root + '/src/**/*.sql',
config.paths.project.root + '/src/**/*.svg',
config.paths.project.root + '/src/**/*.html'
]).pipe(gulp.dest('out/src/'));
let srcFiles = [
config.paths.project.root + '/src/**/*.ts',
config.paths.project.root + '/src/**/*.js',
config.paths.project.root + '/typings/**/*.ts'
];
return gulp.src(srcFiles)
.pipe(srcmap.init())
.pipe(tsProject())
.on('error', function() {
if(process.env.BUILDMACHINE) {
done('Failed to compile extension source, see above.');
process.exit(1);
}
})
// TODO: Reinstate localization code
// .pipe(nls.rewriteLocalizeCalls())
// .pipe(nls.createAdditionalLanguageFiles(nls.coreLanguages, config.paths.project.root + '/localization/i18n', undefined, false))
.pipe(srcmap.write('.', { sourceRoot: function(file) { return file.cwd + '/src'; }}))
.pipe(gulp.dest('out/src/'));
});
gulp.task('compile:test', function(done) {
let srcFiles = [
config.paths.project.root + '/test/**/*.ts',
config.paths.project.root + '/typings/**/*.ts'
];
return gulp.src(srcFiles)
.pipe(srcmap.init())
.pipe(tsProject())
.on('error', function() {
if(process.env.BUILDMACHINE) {
done('Failed to compile test source, see above.');
process.exit(1);
}
})
.pipe(srcmap.write('.', {sourceRoot: function(file) { return file.cwd + '/test'; }}))
.pipe(gulp.dest('out/test/'));
});
// COMPOSED GULP TASKS /////////////////////////////////////////////////////
gulp.task("compile", gulp.series("compile:src", "compile:test"));
gulp.task("build", gulp.series("clean", "lint", "compile"));
gulp.task("watch", function() {
gulp.watch([config.paths.project.root + '/src/**/*',
config.paths.project.root + '/test/**/*.ts'],
gulp.series('build'))
});
gulp.task('test', (done) => {
let workspace = process.env['WORKSPACE'];
if (!workspace) {
workspace = process.cwd();
}
process.env.JUNIT_REPORT_PATH = workspace + '/test-reports/ext_xunit.xml';
let sqlopsPath = 'sqlops';
if (process.env['SQLOPS_DEV']) {
let suffix = os.platform === 'win32' ? 'bat' : 'sh';
sqlopsPath = `${process.env['SQLOPS_DEV']}/scripts/sql-cli.${suffix}`;
}
console.log(`Using SQLOPS Path of ${sqlopsPath}`);
cproc.exec(`${sqlopsPath} --extensionDevelopmentPath="${workspace}" --extensionTestsPath="${workspace}/out/test" --verbose`, (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
process.exit(1);
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
done();
});
});

View File

@@ -0,0 +1,19 @@
var path = require('path');
var projectRoot = path.resolve(path.dirname(__dirname));
var srcRoot = path.resolve(projectRoot, 'src');
var localization = path.resolve(projectRoot, 'localization');
var config = {
paths: {
project: {
root: projectRoot,
localization: localization
},
extension: {
root: srcRoot
}
}
};
module.exports = config;

View File

@@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
let gulp = require('gulp');
let exec = require('child-process-promise').exec;
let color = require('gulp-color');
// CONSTANTS ///////////////////////////////////////////////////////////////
let packageVals = require('../package');
// HELPER FUNCTIONS ////////////////////////////////////////////////////////
let buildPackage = function(packageName) {
// Make sure there are
if (!packageVals.repository) {
return Promise.reject("Repository field is not defined in package.json");
}
// Initialize the package command with program and command
let vsceArgs = [];
vsceArgs.push('./node_modules/vsce/out/vsce');
vsceArgs.push('package'); // package command
// Add the package name
vsceArgs.push('-o');
vsceArgs.push(packageName);
// Put it all together and execute the command
let command = vsceArgs.join(' ');
console.log(command);
return exec(command);
};

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "."
},
"exclude": [
"node_modules",
".vscode-test"
]
}

View File

@@ -0,0 +1,123 @@
{
"rules": {
"align": [
true,
"parameters",
"statements"
],
"ban": false,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"spaces"
],
"interface-name": true,
"jsdoc-format": true,
"label-position": true,
"label-undefined": true,
"max-line-length": [
true,
160
],
"member-access": false,
"member-ordering": false,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-null-keyword": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unreachable": true,
"no-unused-expression": false,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-finally",
"check-whitespace"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"radix": true,
"semicolon": true,
"switch-default": true,
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef": [
true,
"call-signature",
"property-declaration"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"use-strict": false,
"variable-name": [
true,
"allow-leading-underscore",
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'data' {
declare module 'sqlops' {
import * as vscode from 'vscode';
// EXPORTED NAMESPACES /////////////////////////////////////////////////
@@ -114,6 +114,20 @@ declare module 'data' {
options: { [name: string]: any };
}
export interface IConnectionProfile extends ConnectionInfo {
serverName: string;
databaseName: string;
userName: string;
password: string;
authenticationType: string;
savePassword: boolean;
groupFullName: string;
groupId: string;
providerName: string;
saveProfile: boolean;
id: string;
}
export interface ConnectionInfoSummary {
/**
@@ -1441,6 +1455,48 @@ declare module 'data' {
postMessage(message: any): Thenable<any>;
}
export interface DashboardWebview {
/**
* Raised when the webview posts a message.
*/
readonly onMessage: vscode.Event<any>;
/**
* Raised when the webview closed.
*/
readonly onClosed: vscode.Event<any>;
/**
* Post a message to the webview.
*
* @param message Body of the message.
*/
postMessage(message: any): Thenable<any>;
/**
* The connection info for the dashboard the webview exists on
*/
readonly connection: connection.Connection;
/**
* The info on the server for the webview dashboard
*/
readonly serverInfo: ServerInfo;
/**
* Contents of the dialog body.
*/
html: string;
}
export namespace dashboard {
/**
* Register a provider for a webview widget
*/
export function registerWebviewProvider(widgetId: string, handler: (webview: DashboardWebview) => void): void;
}
export namespace window {
/**
* creates a dialog
@@ -1450,4 +1506,25 @@ declare module 'data' {
title: string
): ModalDialog;
}
export namespace tasks {
export interface ITaskHandler {
(profile: IConnectionProfile, ...args: any[]): any;
}
/**
* Registers a task that can be invoked via a keyboard shortcut,
* a menu item, an action, or directly.
*
* Registering a task with an existing task identifier twice
* will cause an error.
*
* @param task A unique identifier for the task.
* @param callback A task handler function.
* @param thisArg The `this` context used when invoking the handler function.
* @return Disposable which unregisters this task on disposal.
*/
export function registerTask(task: string, callback: ITaskHandler, thisArg?: any): vscode.Disposable;
}
}

View File

@@ -176,7 +176,7 @@ export class Dropdown extends Disposable {
filter: this._filter,
renderer: this._renderer,
controller: this._controller
});
}, { paddingOnRow: false, indentPixels: 0, twistiePixels: 0 });
this.values = this._options.values;

View File

@@ -14,6 +14,7 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
export interface Template {
label: HTMLElement;
row: HTMLElement;
}
export interface Resource {
@@ -33,17 +34,18 @@ export class DropdownRenderer implements tree.IRenderer {
return '';
}
public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement) {
public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement): Template {
const row = $('div.list-row').style('height', '22px').style('padding-left', '5px').getHTMLElement();
DOM.append(container, row);
const label = $('span.label').style('margin', 'auto').style('vertical-align', 'middle').getHTMLElement();
DOM.append(row, label);
return { label };
return { label, row };
}
public renderElement(tree: tree.ITree, element: Resource, templateId: string, templateData: Template): void {
templateData.label.innerText = element.value;
templateData.row.title = element.value;
}
public disposeTemplate(tree: tree.ITree, templateId: string, templateData: Template): void {

View File

@@ -23,7 +23,19 @@
}
.dropdown-tree .list-row {
margin-left: -33px;
width: 100%;
box-sizing: border-box;
}
.dropdown-tree .content {
width: 100%;
}
.dropdown-tree .list-row .label {
width: 100%;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
}
.connection-input .dropdown .monaco-action-bar .action-label.icon.dropdown-arrow {
@@ -31,7 +43,7 @@
background-size: cover;
}
.connection-input .monaco-action-bar .action-item .icon {
.connection-input .monaco-inputbox .monaco-action-bar .action-item .icon {
width: 8px;
height: 8px;
}

View File

@@ -10,7 +10,7 @@ import { Button } from 'sql/base/browser/ui/button/button';
import { Builder } from 'vs/base/browser/builder';
import * as types from 'vs/base/common/types';
import * as data from 'data';
import * as sqlops from 'sqlops';
export function appendRow(container: Builder, label: string, labelClass: string, cellContainerClass: string): Builder {
let cellContainer: Builder;
@@ -61,7 +61,7 @@ export function getBooleanValueFromStringOrBoolean(value: any): boolean {
return false;
}
export function getCategoryDisplayName(categories: data.CategoryValue[], categoryName: string) {
export function getCategoryDisplayName(categories: sqlops.CategoryValue[], categoryName: string) {
var displayName: string;
categories.forEach(c => {
if (c.name === categoryName) {
@@ -71,7 +71,7 @@ export function getCategoryDisplayName(categories: data.CategoryValue[], categor
return displayName;
}
export function getCategoryName(categories: data.CategoryValue[], categoryDisplayName: string) {
export function getCategoryName(categories: sqlops.CategoryValue[], categoryDisplayName: string) {
var categoryName: string;
categories.forEach(c => {
if (c.displayName === categoryDisplayName) {

View File

@@ -14,7 +14,7 @@ import { IModalOptions, Modal } from './modal';
import * as OptionsDialogHelper from './optionsDialogHelper';
import { attachButtonStyler, attachModalDialogStyler } from 'sql/common/theme/styler';
import * as data from 'data';
import * as sqlops from 'sqlops';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import Event, { Emitter } from 'vs/base/common/event';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
@@ -84,8 +84,8 @@ export class OptionsDialog extends Modal {
private _onCloseEvent = new Emitter<void>();
public onCloseEvent: Event<void> = this._onCloseEvent.event;
public okLabel: string = localize('ok', 'OK');
public cancelLabel: string = localize('cancel', 'Cancel');
public okLabel: string = localize('optionsDialog.ok', 'OK');
public cancelLabel: string = localize('optionsDialog.cancel', 'Cancel');
constructor(
title: string,
@@ -154,9 +154,9 @@ export class OptionsDialog extends Modal {
this._optionDescription.innerHtml(option.description);
}
private fillInOptions(container: Builder, options: data.ServiceOption[]): void {
private fillInOptions(container: Builder, options: sqlops.ServiceOption[]): void {
for (var i = 0; i < options.length; i++) {
var option: data.ServiceOption = options[i];
var option: sqlops.ServiceOption = options[i];
var rowContainer = DialogHelper.appendRow(container, option.displayName, 'optionsDialog-label', 'optionsDialog-input');
OptionsDialogHelper.createOptionElement(option, rowContainer, this._optionValues, this._optionElements, this._contextViewService, (name) => this.onOptionLinkClicked(name));
}
@@ -221,7 +221,7 @@ export class OptionsDialog extends Modal {
this._onCloseEvent.fire();
}
public open(options: data.ServiceOption[], optionValues: { [name: string]: any }) {
public open(options: sqlops.ServiceOption[], optionValues: { [name: string]: any }) {
this._optionValues = optionValues;
var firstOption: string;
var containerGroup: Builder;
@@ -233,7 +233,7 @@ export class OptionsDialog extends Modal {
var splitview = new SplitView(containerGroup.getHTMLElement());
let categoryMap = OptionsDialogHelper.groupOptionsByCategory(options);
for (var category in categoryMap) {
var serviceOptions: data.ServiceOption[] = categoryMap[category];
var serviceOptions: sqlops.ServiceOption[] = categoryMap[category];
var bodyContainer = $().element('table', { class: 'optionsDialog-table' }, (tableContainer: Builder) => {
this.fillInOptions(tableContainer, serviceOptions);
});

View File

@@ -12,24 +12,24 @@ import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
import * as types from 'vs/base/common/types';
import data = require('data');
import * as sqlops from 'sqlops';
import { localize } from 'vs/nls';
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
export interface IOptionElement {
optionWidget: any;
option: data.ServiceOption;
option: sqlops.ServiceOption;
optionValue: any;
}
export function createOptionElement(option: data.ServiceOption, rowContainer: Builder, options: { [name: string]: any },
export function createOptionElement(option: sqlops.ServiceOption, rowContainer: Builder, options: { [name: string]: any },
optionsMap: { [optionName: string]: IOptionElement }, contextViewService: IContextViewService, onFocus: (name) => void): void {
let possibleInputs: string[] = [];
let optionValue = this.getOptionValueAndCategoryValues(option, options, possibleInputs);
let optionWidget: any;
let inputElement: HTMLElement;
let missingErrorMessage = localize('missingRequireField', ' is required.');
let invalidInputMessage = localize('invalidInput', 'Invalid input. Numeric value expected.');
let missingErrorMessage = localize('optionsDialog.missingRequireField', ' is required.');
let invalidInputMessage = localize('optionsDialog.invalidInput', 'Invalid input. Numeric value expected.');
if (option.valueType === ServiceOptionType.number) {
optionWidget = new InputBox(rowContainer.getHTMLElement(), contextViewService, {
@@ -67,8 +67,7 @@ export function createOptionElement(option: data.ServiceOption, rowContainer: Bu
inputElement.onfocus = () => onFocus(option.name);
}
export function getOptionValueAndCategoryValues(option: data.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any {
export function getOptionValueAndCategoryValues(option: sqlops.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any {
var optionValue = option.defaultValue;
if (options[option.name]) {
// if the value type is boolean, the option value can be either boolean or string
@@ -160,8 +159,8 @@ export function findElement(container: Builder, className: string): HTMLElement
return elementBuilder.getHTMLElement();
}
export function groupOptionsByCategory(options: data.ServiceOption[]): { [category: string]: data.ServiceOption[] } {
var connectionOptionsMap: { [category: string]: data.ServiceOption[] } = {};
export function groupOptionsByCategory(options: sqlops.ServiceOption[]): { [category: string]: sqlops.ServiceOption[] } {
var connectionOptionsMap: { [category: string]: sqlops.ServiceOption[] } = {};
options.forEach(option => {
var groupName = option.groupName;
if (groupName === null || groupName === undefined) {

View File

@@ -22,7 +22,6 @@ import WebView from 'vs/workbench/parts/html/browser/webview';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import data = require('data');
export class WebViewDialog extends Modal {
@@ -51,8 +50,8 @@ export class WebViewDialog extends Modal {
@IEnvironmentService private _environmentService: IEnvironmentService,
) {
super('', TelemetryKeys.WebView, _webViewPartService, telemetryService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
this._okLabel = localize('OK', 'OK');
this._closeLabel = localize('close', 'Close');
this._okLabel = localize('webViewDialog.ok', 'OK');
this._closeLabel = localize('webViewDialog.close', 'Close');
}
public set html(value: string) {
@@ -80,7 +79,7 @@ export class WebViewDialog extends Modal {
}
public set headerTitle(value: string) {
this._headerTitle = value
this._headerTitle = value;
}
public get headerTitle(): string {

View File

@@ -5,13 +5,22 @@
.tabbedPanel {
border-top-color: rgba(128, 128, 128, 0.35);
border-top-width: 1;
border-top-width: 1px;
border-top-style: solid;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
panel {
display: block;
height: 100%;
width: 100%;
}
.tabbedPanel .composite.title {
display: flex;
flex: 0 0 auto;
}
.tabbedPanel .tabList {
@@ -19,22 +28,53 @@
margin: 0 auto;
padding: 0;
justify-content: flex-start;
flex-flow: row;
line-height: 35px;
white-space: nowrap;
flex: 1;
}
.tabbedPanel .tabList > .tab {
.tabbedPanel .tabList .tab {
cursor: pointer;
margin: auto;
}
.tabbedPanel .tabList > .tab > .tabLabel {
.tabbedPanel .tabList .tab .tabLabel {
text-transform: uppercase;
margin-left: 16px;
margin-right: 16px;
font-size: 11px;
padding-bottom: 4px;
}
.tabbedPanel .tabList .tab-header {
display: flex;
}
.tabbedPanel.vertical .tabList .tab-header {
display: block;
text-transform: none;
text-overflow: ellipsis;
overflow: hidden;
width: 63px;
height: 50px;
line-height: 45px;
}
.tabbedPanel .tabList .tab .tabLabel.icon {
background-repeat: no-repeat;
background-position: center center;
background-size: 25px;
padding: 20px 20px;
line-height: 50px;
}
.tabbedPanel .tabList .tab-header {
padding-left: 10px;
padding-right: 10px;
}
.tabbedPanel .tabList .actions-container {
margin-right: 8px;
}
.tabbedPanel .composite.title .title-actions .action-label {
display: block;
height: 35px;
@@ -46,7 +86,7 @@
}
.composite.title .title-actions {
flex: 1;
flex: 1 1 auto;
}
.tab > .tabLabel.active {
@@ -55,4 +95,45 @@
.composite.title ~ tab.fullsize > :first-child {
height: calc(100% - 38px);
}
}
.tabbedPanel .title-actions .panel-actions .actions-container {
justify-content: flex-start;
}
.tabbedPanel.vertical {
display: flex;
flex-direction: row;
}
.tabbedPanel.vertical > .title {
flex: 0 0 auto;
flex-direction: column;
height: 100%;
}
.tabbedPanel.vertical .tabList {
flex-direction: column;
}
.tabbedPanel > .tab-content {
flex: 1;
position: relative;
}
.tabbedPanel.vertical > .title > .tabList {
flex-flow: column;
}
.tabbedPanel.horizontal > .title > .tabList {
flex-flow: row;
}
.tabbedPanel > .title > .monaco-scrollable-element {
flex: 0 1 auto;
width: inherit;
}
.visibility.hidden {
visibility: hidden;
}

View File

@@ -3,53 +3,95 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Component, ContentChildren, QueryList, AfterContentInit, Inject, forwardRef, NgZone, OnInit, Input } from '@angular/core';
import { Component, ContentChildren, QueryList, AfterContentInit, Inject, forwardRef, NgZone, OnInit, Input, EventEmitter, Output, ViewChild, ElementRef, OnChanges, OnDestroy, ViewChildren, AfterViewInit } from '@angular/core';
import { TabComponent } from './tab.component';
import { TabHeaderComponent } from './tabHeader.component';
import './panelStyles';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { Action } from 'vs/base/common/actions';
import * as types from 'vs/base/common/types';
import { mixin } from 'vs/base/common/objects';
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
import { Disposable } from 'vs/base/common/lifecycle';
export interface IPanelOptions {
/**
* Whether or not to show the tabs if there is only one tab present
*/
showTabsWhenOne?: boolean;
layout?: NavigationBarLayout;
showIcon?: boolean;
}
export enum NavigationBarLayout {
horizontal = 0,
vertical = 1
}
const defaultOptions: IPanelOptions = {
showTabsWhenOne: true
showTabsWhenOne: true,
layout: NavigationBarLayout.horizontal,
showIcon: false
};
const verticalLayout = 'vertical';
const horizontalLayout = 'horizontal';
let idPool = 0;
@Component({
selector: 'panel',
template: `
<div class="tabbedPanel fullsize">
<div *ngIf="!options.showTabsWhenOne ? _tabs.length !== 1 : true" class="composite title">
<div class="tabList">
<div *ngFor="let tab of _tabs" class="tab" (click)="selectTab(tab)">
<a class="tabLabel" [class.active]="tab.active">
{{tab.title}}
</a>
<div class="tabbedPanel fullsize" #tabbedPanel>
<div *ngIf="!options.showTabsWhenOne ? _tabs.length !== 1 : true" class="composite title" #titleContainer>
<div class="tabList" #tabList>
<div *ngFor="let tab of _tabs">
<tab-header [tab]="tab" [showIcon]="options.showIcon" (onSelectTab)='selectTab($event)' (onCloseTab)='closeTab($event)'> </tab-header>
</div>
</div>
<div class="title-actions">
<div #panelActionbar class="panel-actions" style="flex: 0 0 auto; align-self: end; margin-top: auto; margin-bottom: auto;" >
</div>
</div>
</div>
<div class="tab-content">
<div class="fullsize" style="position: absolute">
<ng-content></ng-content>
</div>
</div>
<ng-content class="fullsize"></ng-content>
</div>
`
})
export class PanelComponent implements AfterContentInit, OnInit {
export class PanelComponent extends Disposable implements AfterContentInit, OnInit, OnChanges, OnDestroy, AfterViewInit {
@Input() public options: IPanelOptions;
@Input() public actions: Array<Action>;
@ContentChildren(TabComponent) private _tabs: QueryList<TabComponent>;
private _activeTab: TabComponent;
@ViewChildren(TabHeaderComponent) private _headerTabs: QueryList<TabHeaderComponent>;
constructor( @Inject(forwardRef(() => NgZone)) private _zone: NgZone) { }
@Output() public onTabChange = new EventEmitter<TabComponent>();
@Output() public onTabClose = new EventEmitter<TabComponent>();
private _activeTab: TabComponent;
private _actionbar: ActionBar;
private _mru: TabComponent[];
private _scrollableElement: ScrollableElement;
@ViewChild('panelActionbar', { read: ElementRef }) private _actionbarRef: ElementRef;
@ViewChild('tabbedPanel', { read: ElementRef }) private _tabbedPanelRef: ElementRef;
@ViewChild('titleContainer', { read: ElementRef }) private _titleContainer: ElementRef;
@ViewChild('tabList', { read: ElementRef }) private _tabList: ElementRef;
constructor( @Inject(forwardRef(() => NgZone)) private _zone: NgZone) {
super();
}
ngOnInit(): void {
this.options = mixin(this.options || {}, defaultOptions, false);
this._mru = [];
}
ngAfterContentInit(): void {
@@ -59,11 +101,71 @@ export class PanelComponent implements AfterContentInit, OnInit {
}
}
ngAfterViewInit(): void {
let container = this._titleContainer.nativeElement as HTMLElement;
let tabList = this._tabList.nativeElement as HTMLElement;
container.removeChild(tabList);
this._scrollableElement = new ScrollableElement(tabList, {
horizontal: ScrollbarVisibility.Auto,
vertical: ScrollbarVisibility.Hidden,
scrollYToX: true,
useShadows: false,
horizontalScrollbarSize: 3
});
this._scrollableElement.onScroll(e => {
tabList.scrollLeft = e.scrollLeft;
});
container.insertBefore(this._scrollableElement.getDomNode(), container.firstChild);
this._scrollableElement.setScrollDimensions({
width: tabList.offsetWidth,
scrollWidth: tabList.scrollWidth
});
this._register(addDisposableListener(window, EventType.RESIZE, () => {
// Todo: Need to set timeout because we have to make sure that the grids have already rearraged before the getContentHeight gets called.
setTimeout(() => {
this._scrollableElement.setScrollDimensions({
width: tabList.offsetWidth,
scrollWidth: tabList.scrollWidth
});
}, 100);
}));
if (this.options.layout === NavigationBarLayout.horizontal) {
(<HTMLElement>this._tabbedPanelRef.nativeElement).classList.add(horizontalLayout);
} else {
(<HTMLElement>this._tabbedPanelRef.nativeElement).classList.add(verticalLayout);
}
}
ngOnChanges(): void {
if (this._actionbarRef && !this._actionbar) {
this._actionbar = new ActionBar(this._actionbarRef.nativeElement);
}
if (this.actions && this._actionbar) {
this._actionbar.clear();
this._actionbar.push(this.actions, { icon: true, label: false });
}
}
ngOnDestroy() {
if (this._actionbar) {
this._actionbar.dispose();
}
if (this.actions && this.actions.length > 0) {
this.actions.forEach((action) => action.dispose());
}
}
/**
* Select a tab based on index (unrecommended)
* @param index index of tab in the html
*/
selectTab(index: number)
selectTab(index: number);
/**
* Select a tab based on the identifier that was passed into the tab
* @param identifier specified identifer of the tab
@@ -85,14 +187,74 @@ export class PanelComponent implements AfterContentInit, OnInit {
tab = this._tabs.find(i => i.identifier === input);
}
// since we need to compare identifiers in this next step we are going to go through and make sure all tabs have one
this._tabs.forEach(i => {
if (!i.identifier) {
i.identifier = 'tabIndex_' + idPool++;
}
});
if (this._activeTab && tab === this._activeTab) {
this.onTabChange.emit(tab);
return;
}
this._zone.run(() => {
if (this._activeTab) {
this._activeTab.active = false;
}
this._activeTab = tab;
this.setMostRecentlyUsed(tab);
this._activeTab.active = true;
// Make the tab header focus on the new selected tab
let activeTabHeader = this._headerTabs.find(i => i.tab === this._activeTab);
if (activeTabHeader) {
activeTabHeader.focusOnTabHeader();
}
this.onTabChange.emit(tab);
});
}
}
/**
* Get the id of the active tab
*/
public get getActiveTab(): string {
return this._activeTab.identifier;
}
private findAndRemoveTabFromMRU(tab: TabComponent): void {
let mruIndex = this._mru.findIndex(i => i === tab);
if (mruIndex !== -1) {
// Remove old index
this._mru.splice(mruIndex, 1);
}
}
private setMostRecentlyUsed(tab: TabComponent): void {
this.findAndRemoveTabFromMRU(tab);
// Set tab to front
this._mru.unshift(tab);
}
/**
* Close a tab
* @param tab tab to close
*/
closeTab(tab: TabComponent) {
this.onTabClose.emit(tab);
// remove the closed tab from mru
this.findAndRemoveTabFromMRU(tab);
// Open the most recent tab
if (this._mru.length > 0) {
this.selectTab(this._mru[0]);
}
}
}

View File

@@ -6,11 +6,12 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TabComponent } from './tab.component';
import { TabHeaderComponent } from './tabHeader.component';
import { PanelComponent } from './panel.component';
@NgModule({
imports: [CommonModule],
exports: [TabComponent, PanelComponent],
declarations: [TabComponent, PanelComponent]
declarations: [TabComponent, TabHeaderComponent, PanelComponent]
})
export class PanelModule { }

View File

@@ -87,21 +87,23 @@ export class TabbedPanel extends Disposable implements IThemable {
}
private _createTab(tab: IInternalPanelTab): void {
let tabHeaderElement = $('.tab-header');
tabHeaderElement.attr('tabindex', '0');
let tabElement = $('.tab');
tabElement.attr('tabindex', '0');
tabHeaderElement.append(tabElement);
let tabLabel = $('a.tabLabel');
tabLabel.safeInnerHtml(tab.title);
tabElement.append(tabLabel);
tabElement.on(EventType.CLICK, e => this.showTab(tab.identifier));
tabElement.on(EventType.KEY_DOWN, (e: KeyboardEvent) => {
tabHeaderElement.on(EventType.CLICK, e => this.showTab(tab.identifier));
tabHeaderElement.on(EventType.KEY_DOWN, (e: KeyboardEvent) => {
let event = new StandardKeyboardEvent(e);
if (event.equals(KeyCode.Enter)) {
this.showTab(tab.identifier);
e.stopImmediatePropagation();
}
});
this.$tabList.append(tabElement);
tab.header = tabElement;
this.$tabList.append(tabHeaderElement);
tab.header = tabHeaderElement;
tab.label = tabLabel;
}
@@ -112,12 +114,14 @@ export class TabbedPanel extends Disposable implements IThemable {
if (this._shownTab) {
this._tabMap.get(this._shownTab).label.removeClass('active');
this._tabMap.get(this._shownTab).header.removeClass('active');
}
this._shownTab = id;
this.$body.clearChildren();
let tab = this._tabMap.get(this._shownTab);
tab.label.addClass('active');
tab.header.addClass('active');
tab.view.render(this.$body.getHTMLElement());
this._onTabChange.fire(id);
if (this._currentDimensions) {

View File

@@ -15,11 +15,15 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const titleActiveBorder = theme.getColor(PANEL_ACTIVE_TITLE_BORDER);
if (titleActive || titleActiveBorder) {
collector.addRule(`
.tabbedPanel > .title > .tabList > .tab:hover .tabLabel,
.tabbedPanel > .title > .tabList > .tab .tabLabel.active {
.tabbedPanel > .title > .tabList .tab:hover .tabLabel,
.tabbedPanel > .title > .tabList .tab .tabLabel.active {
color: ${titleActive};
border-bottom-color: ${titleActiveBorder};
}
.tabbedPanel > .title > .tabList .tab-header.active {
outline: none;
}
`);
}
@@ -27,7 +31,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const titleInactive = theme.getColor(PANEL_INACTIVE_TITLE_FOREGROUND);
if (titleInactive) {
collector.addRule(`
.tabbedPanel > .title > .tabList > .tab .tabLabel {
.tabbedPanel > .title > .tabList .tab .tabLabel {
color: ${titleInactive};
}
`);
@@ -37,7 +41,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const focusBorderColor = theme.getColor(focusBorder);
if (focusBorderColor) {
collector.addRule(`
.tabbedPanel > .title > .tabList > .tab .tabLabel:focus {
.tabbedPanel > .title > .tabList .tab .tabLabel:focus {
color: ${titleActive};
border-bottom-color: ${focusBorderColor} !important;
border-bottom: 1px solid;
@@ -49,20 +53,17 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
// Styling with Outline color (e.g. high contrast theme)
const outline = theme.getColor(activeContrastBorder);
if (outline) {
const outline = theme.getColor(activeContrastBorder);
collector.addRule(`
.tabbedPanel > .title > .tabList > .tab .tabLabel.active,
.tabbedPanel > .title > .tabList > .tab .tabLabel:hover {
.tabbedPanel > .title > .tabList .tab-header.active,
.tabbedPanel > .title > .tabList .tab-header:hover {
outline-color: ${outline};
outline-width: 1px;
outline-style: solid;
border-bottom: none;
padding-bottom: 0;
outline-offset: 3px;
outline-offset: -5px;
}
.tabbedPanel > .title > .tabList > .tab .tabLabel:hover:not(.active) {
.tabbedPanel > .title > .tabList .tab-header:hover:not(.active) {
outline-style: dashed;
}
`);

View File

@@ -2,7 +2,9 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Component, Input, ContentChild } from '@angular/core';
import { Component, Input, ContentChild, OnDestroy } from '@angular/core';
import { Action } from 'vs/base/common/actions';
export abstract class TabChild {
public abstract layout(): void;
@@ -11,16 +13,20 @@ export abstract class TabChild {
@Component({
selector: 'tab',
template: `
<div *ngIf="active" class="fullsize">
<div class="visibility" [class.hidden]="!active && visibilityType == 'visibility'" *ngIf="visibilityType == 'visibility' || active" class="fullsize">
<ng-content class="body fullsize"></ng-content>
</div>
`
})
export class TabComponent {
export class TabComponent implements OnDestroy {
@ContentChild(TabChild) private _child: TabChild;
@Input() public title: string;
@Input() public canClose: boolean;
@Input() public actions: Array<Action>;
@Input() public iconClass: string;
public _active = false;
@Input() public identifier: string;
@Input() private visibilityType: 'if' | 'visibility' = 'if';
public set active(val: boolean) {
this._active = val;
@@ -32,4 +38,11 @@ export class TabComponent {
public get active(): boolean {
return this._active;
}
ngOnDestroy() {
if (this.actions && this.actions.length > 0) {
this.actions.forEach((action) => action.dispose());
}
}
}

View File

@@ -0,0 +1,29 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
export class CloseTabAction extends Action {
private static readonly ID = 'closeTab';
private static readonly LABEL = nls.localize('closeTab', "Close");
private static readonly ICON = 'close';
constructor(
private closeFn: () => void,
private context: any // this
) {
super(CloseTabAction.ID, CloseTabAction.LABEL, CloseTabAction.ICON);
}
run(): TPromise<boolean> {
try {
this.closeFn.apply(this.context);
return TPromise.as(true);
} catch (e) {
return TPromise.as(false);
}
}
}

View File

@@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!sql/media/icons/common-icons';
import 'vs/css!./tabHeader';
import { Component, AfterContentInit, OnDestroy, Input, Output, ElementRef, ViewChild, EventEmitter } from '@angular/core';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import * as DOM from 'vs/base/browser/dom';
import { Disposable } from 'vs/base/common/lifecycle';
import { TabComponent } from './tab.component';
import { CloseTabAction } from './tabActions';
@Component({
selector: 'tab-header',
template: `
<div #actionHeader class="tab-header" style="flex: 0 0; flex-direction: row;" [class.active]="tab.active" tabindex="0" (keyup)="onKey($event)">
<span class="tab" (click)="selectTab(tab)">
<a class="tabLabel" [class.active]="tab.active" #tabLabel>
</a>
</span>
<span #actionbar style="flex: 0 0 auto; align-self: end; margin-top: auto; margin-bottom: auto;" ></span>
</div>
`
})
export class TabHeaderComponent extends Disposable implements AfterContentInit, OnDestroy {
@Input() public tab: TabComponent;
@Input() public showIcon: boolean;
@Output() public onSelectTab: EventEmitter<TabComponent> = new EventEmitter<TabComponent>();
@Output() public onCloseTab: EventEmitter<TabComponent> = new EventEmitter<TabComponent>();
private _actionbar: ActionBar;
@ViewChild('actionHeader', { read: ElementRef }) private _actionHeaderRef: ElementRef;
@ViewChild('actionbar', { read: ElementRef }) private _actionbarRef: ElementRef;
@ViewChild('tabLabel', { read: ElementRef }) private _tabLabelRef: ElementRef;
constructor() {
super();
}
ngAfterContentInit(): void {
if (this.tab.canClose || this.tab.actions) {
this._actionbar = new ActionBar(this._actionbarRef.nativeElement);
if (this.tab.actions) {
this._actionbar.push(this.tab.actions, { icon: true, label: false });
}
if (this.tab.canClose) {
let closeAction = this._register(new CloseTabAction(this.closeTab, this));
this._actionbar.push(closeAction, { icon: true, label: false });
}
}
let tabLabelcontainer = this._tabLabelRef.nativeElement as HTMLElement;
if (this.showIcon && this.tab.iconClass) {
tabLabelcontainer.className = 'tabLabel icon';
tabLabelcontainer.classList.add(this.tab.iconClass);
} else {
tabLabelcontainer.className = 'tabLabel';
tabLabelcontainer.innerHTML = this.tab.title;
}
tabLabelcontainer.title = this.tab.title;
}
ngOnDestroy() {
if (this._actionbar) {
this._actionbar.dispose();
}
this.dispose();
}
selectTab(tab: TabComponent) {
this.onSelectTab.emit(tab);
}
closeTab() {
this.onCloseTab.emit(this.tab);
}
focusOnTabHeader() {
let header = <HTMLElement>this._actionHeaderRef.nativeElement;
header.focus();
}
onKey(e: Event) {
if (DOM.isAncestor(<HTMLElement>e.target, this._actionHeaderRef.nativeElement) && e instanceof KeyboardEvent) {
let event = new StandardKeyboardEvent(e);
if (event.equals(KeyCode.Enter)) {
this.onSelectTab.emit(this.tab);
e.stopPropagation();
}
}
}
}

View File

@@ -0,0 +1,20 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
tab-header .action-item .action-label {
opacity: 0;
padding: 8px;
margin-top: 0.3em;
}
tab-header .action-item {
line-height: 1.4em;
}
tab-header .tab-header.active .action-label, /* always show it for active tab */
tab-header .tab-header:hover .action-label, /* always show it on hover */
tab-header .tab-header:focus .action-label { /* always show it on focus */
opacity: 1;
}

View File

@@ -4,12 +4,19 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
export function subscriptionToDisposable(sub: Subscription): IDisposable {
return {
dispose: sub.unsubscribe
};
}
export class AngularDisposable extends Disposable implements OnDestroy {
ngOnDestroy() {
this.dispose();
}
}

View File

@@ -111,4 +111,3 @@ export class TrieMap<E> {
return result;
}
}

View File

@@ -23,6 +23,7 @@ export const RunQueryStatement = 'RunQueryStatement';
export const CancelQuery = 'CancelQuery';
export const NewQuery = 'NewQuery';
export const FirewallRuleRequested = 'FirewallRuleCreated';
export const DashboardNavigated = 'DashboardNavigated';
// Telemetry Properties
@@ -40,3 +41,4 @@ export const ServerGroups = 'ServerGroups';
export const Accounts = 'Accounts';
export const FireWallRule = 'FirewallRule';
export const AutoOAuth = 'AutoOAuth';
export const AddNewDashboardTab = 'AddNewDashboardTab';

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#C5C5C5" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>

Before

Width:  |  Height:  |  Size: 307 B

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#424242" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><title>close_small</title><path d="M5.58,5.11,10,9.53l-.58.58L5,5.69.58,10.11,0,9.53,4.42,5.11,0,.69.58.11,5,4.53,9.42.11,10,.69Z"/></svg>

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 231 B

View File

@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><defs><style>.cls-1{fill:#fff;}</style></defs><title>close_small_inverse</title><path class="cls-1" d="M5.58,5,10,9.42,9.42,10,5,5.58.58,10,0,9.42,4.42,5,0,.58.58,0,5,4.42,9.42,0,10,.58Z"/></svg>

After

Width:  |  Height:  |  Size: 288 B

View File

@@ -57,6 +57,12 @@
background: url("server_page_inverse.svg") center center no-repeat;
}
.vs .icon.globalError,
.vs-dark .icon.globalError,
.hc-black .icon.globalError {
background: url("globalerror.svg") center center no-repeat;
}
.vs .icon.error,
.vs-dark .icon.error,
.hc-black .icon.error {
@@ -104,13 +110,16 @@
background-position: 2px center;
}
.vs .icon.close {
background-image: url('close.svg');
.vs .icon.close,
.vs .icon.remove {
background: url('close.svg') center center no-repeat !important;
}
.vs-dark .icon.close,
.hc-black .icon.close {
background-image: url('close-dark.svg');
.hc-black .icon.close,
.vs-dark .icon.remove,
.hc-black .icon.remove {
background: url('close_inverse.svg') center center no-repeat !important;
}
.vs .icon.filter {
@@ -122,14 +131,6 @@
background: url("filter_inverse.svg") center center no-repeat !important;
}
.vs .icon.remove {
background: url("remove.svg") center center no-repeat !important;
}
.vs-dark .icon.remove,
.hc-black .icon.remove {
background: url("remove_inverse.svg") center center no-repeat !important;
}
.vs .icon.warning-badge,
.vs-dark .icon.warning-badge,
@@ -155,6 +156,15 @@
background: url('ellipsis.svg') center center no-repeat;
}
.hc-black .icon.new,
.vs-dark .icon.new {
background: url('new_inverse.svg') center center no-repeat;
}
.vs .icon.new {
background: url('new.svg') center center no-repeat;
}
.hc-black .icon.new-query,
.vs-dark .icon.new-query {
background: url('newquery_inverse.svg') center center no-repeat;
@@ -181,3 +191,21 @@
.vs .icon.edit {
background: url('edit.svg') center center no-repeat;
}
.hc-black .icon.pin,
.vs-dark .icon.pin {
background: url('pin_inverse.svg') center center no-repeat;
}
.vs .icon.pin {
background: url('pin.svg') center center no-repeat;
}
.hc-black .icon.unpin,
.vs-dark .icon.unpin {
background: url('unpin_inverse.svg') center center no-repeat;
}
.vs .icon.unpin {
background: url('unpin.svg') center center no-repeat;
}

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