mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 04:20:11 -04:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
128
src/sqltest/stubs/capabilitiesTestService.ts
Normal file
128
src/sqltest/stubs/capabilitiesTestService.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 data = require('data');
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import Event from 'vs/base/common/event';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
|
||||
|
||||
export class CapabilitiesTestService implements ICapabilitiesService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _providers: data.CapabilitiesProvider[] = [];
|
||||
|
||||
private _capabilities: data.DataProtocolServerCapabilities[] = [];
|
||||
|
||||
|
||||
constructor() {
|
||||
|
||||
let connectionProvider: data.ConnectionProviderOptions = {
|
||||
options: [
|
||||
{
|
||||
name: 'serverName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: 0,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'databaseName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: 1,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'userName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: 3,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'authenticationType',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: 2,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: 4,
|
||||
valueType: 0
|
||||
}
|
||||
]
|
||||
};
|
||||
let msSQLCapabilities = {
|
||||
protocolVersion: '1',
|
||||
providerName: 'MSSQL',
|
||||
providerDisplayName: 'MSSQL',
|
||||
connectionProvider: connectionProvider,
|
||||
adminServicesProvider: undefined,
|
||||
features: undefined
|
||||
};
|
||||
this._capabilities.push(msSQLCapabilities);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of registered server capabilities
|
||||
*/
|
||||
public getCapabilities(): data.DataProtocolServerCapabilities[] {
|
||||
return this._capabilities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the capabilities provider and query the provider for its capabilities
|
||||
* @param provider
|
||||
*/
|
||||
public registerProvider(provider: data.CapabilitiesProvider): void {
|
||||
}
|
||||
|
||||
// Event Emitters
|
||||
public get onProviderRegisteredEvent(): Event<data.DataProtocolServerCapabilities> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public isFeatureAvailable(featureName: Action, connectionManagementInfo: ConnectionManagementInfo): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public onCapabilitiesReady(): Promise<void> {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user