mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Update product references from 'sqlops' to 'azdata' (#4259)
* Update extensions to use azdata * Switch core code to use azdata
This commit is contained in:
@@ -8,13 +8,13 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { SqlMainContext, MainThreadCredentialManagementShape, ExtHostCredentialManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
|
||||
class CredentialAdapter {
|
||||
public provider: sqlops.CredentialProvider;
|
||||
public provider: azdata.CredentialProvider;
|
||||
|
||||
constructor(provider: sqlops.CredentialProvider) {
|
||||
constructor(provider: azdata.CredentialProvider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class CredentialAdapter {
|
||||
return this.provider.saveCredential(credentialId, password);
|
||||
}
|
||||
|
||||
public readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
public readCredential(credentialId: string): Thenable<azdata.Credential> {
|
||||
return this.provider.readCredential(credentialId);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
}
|
||||
|
||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||
public $registerCredentialProvider(provider: sqlops.CredentialProvider): vscode.Disposable {
|
||||
public $registerCredentialProvider(provider: azdata.CredentialProvider): vscode.Disposable {
|
||||
// Store the credential provider
|
||||
provider.handle = this._nextHandle();
|
||||
this._adapter[provider.handle] = new CredentialAdapter(provider);
|
||||
@@ -67,7 +67,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return this._createDisposable(provider.handle);
|
||||
}
|
||||
|
||||
public $getCredentialProvider(namespaceId: string): Thenable<sqlops.CredentialProvider> {
|
||||
public $getCredentialProvider(namespaceId: string): Thenable<azdata.CredentialProvider> {
|
||||
let self = this;
|
||||
|
||||
if (!namespaceId) {
|
||||
@@ -84,7 +84,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return this._withAdapter(0, CredentialAdapter, adapter => adapter.saveCredential(credentialId, password));
|
||||
}
|
||||
|
||||
public $readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
public $readCredential(credentialId: string): Thenable<azdata.Credential> {
|
||||
return this._withAdapter(0, CredentialAdapter, adapter => adapter.readCredential(credentialId));
|
||||
}
|
||||
|
||||
@@ -105,9 +105,9 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return `${namespaceId}|${credentialId}`;
|
||||
}
|
||||
|
||||
private _createNamespacedCredentialProvider(namespaceId: string, adapter: CredentialAdapter): Thenable<sqlops.CredentialProvider> {
|
||||
private _createNamespacedCredentialProvider(namespaceId: string, adapter: CredentialAdapter): Thenable<azdata.CredentialProvider> {
|
||||
// Create a provider that wraps the methods in a namespace
|
||||
let provider: sqlops.CredentialProvider = {
|
||||
let provider: azdata.CredentialProvider = {
|
||||
handle: adapter.provider.handle,
|
||||
deleteCredential: (credentialId: string) => {
|
||||
let namespacedId = ExtHostCredentialManagement._getNamespacedCredentialId(namespaceId, credentialId);
|
||||
|
||||
Reference in New Issue
Block a user