Skip to content

Commit

Permalink
Updating types file with groupName property (#26092)
Browse files Browse the repository at this point in the history
* updating types file

* updating tests to include previously-missed props

* bumping STS
  • Loading branch information
Benjin authored Dec 10, 2024
1 parent 273e7dd commit 6b05b9d
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 23 deletions.
2 changes: 1 addition & 1 deletion extensions/mssql/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "5.0.20241115.1",
"version": "5.0.20241206.1",
"downloadFileNames": {
"Windows_86": "win-x86-net8.0.zip",
"Windows_64": "win-x64-net8.0.zip",
Expand Down
31 changes: 9 additions & 22 deletions src/sql/azdata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,30 +671,11 @@ declare module 'azdata' {
name: string;
}

export interface ConnectionOption {
name: string;

displayName: string;

description: string;

groupName: string;

valueType: ServiceOptionType;

specialValueType: ConnectionOptionSpecialType;

defaultValue: string;

categoryValues: CategoryValue[];

isIdentity: boolean;

isRequired: boolean;
}

export interface ConnectionProviderOptions {
options: ConnectionOption[];

/** Mapping from connection option group IDs to translated display names */
groupDisplayNames: { [groupId: string]: string };
}

export interface ServiceOption {
Expand All @@ -719,6 +700,12 @@ declare module 'azdata' {
isArray: boolean;
}

export interface ConnectionOption extends ServiceOption {
specialValueType: ConnectionOptionSpecialType;

isIdentity: boolean;
}

export interface AdminServicesOptions {
databaseInfoOptions: ServiceOption[];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined!,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.connectionName,
Expand All @@ -43,6 +45,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined!,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.serverName,
Expand All @@ -55,6 +59,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined!,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.databaseName,
Expand All @@ -67,6 +73,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined!,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.userName,
Expand All @@ -79,6 +87,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined!,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.authType,
Expand All @@ -91,6 +101,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined!,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.password,
Expand All @@ -105,6 +117,8 @@ export class TestCapabilitiesService implements ICapabilitiesService {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: 'false',
objectType: undefined!,
isArray: false,
isIdentity: false,
isRequired: false,
specialValueType: undefined!,
Expand Down
15 changes: 15 additions & 0 deletions src/sql/platform/connection/test/common/connectionConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ suite('ConnectionConfig', () => {
capabilitiesService = TypeMoq.Mock.ofType(TestCapabilitiesService);
capabilities = [];
let connectionProvider: azdata.ConnectionProviderOptions = {
groupDisplayNames: {},
options: [
{
name: 'server',
Expand All @@ -129,6 +130,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.serverName,
Expand All @@ -141,6 +144,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.databaseName,
Expand All @@ -153,6 +158,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.userName,
Expand All @@ -165,6 +172,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.authType,
Expand All @@ -177,6 +186,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.password,
Expand All @@ -189,6 +200,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: "default",
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: undefined!,
Expand All @@ -201,6 +214,8 @@ suite('ConnectionConfig', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: "10",
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: undefined!,
Expand Down
16 changes: 16 additions & 0 deletions src/sql/platform/connection/test/common/connectionProfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.connectionName,
Expand All @@ -90,6 +92,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.serverName,
Expand All @@ -102,6 +106,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.databaseName,
Expand All @@ -114,6 +120,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.userName,
Expand All @@ -126,6 +134,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.authType,
Expand All @@ -138,6 +148,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.password,
Expand All @@ -150,6 +162,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: "true",
objectType: undefined,
isArray: false,
isIdentity: false,
showOnConnectionDialog: true,
isRequired: false,
Expand All @@ -163,6 +177,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: "false",
objectType: undefined,
isArray: false,
isIdentity: false,
showOnConnectionDialog: true,
isRequired: false,
Expand Down
12 changes: 12 additions & 0 deletions src/sql/platform/connection/test/common/connectionStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ suite('ConnectionStore', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.connectionName,
Expand All @@ -70,6 +72,8 @@ suite('ConnectionStore', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.serverName,
Expand All @@ -82,6 +86,8 @@ suite('ConnectionStore', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.databaseName,
Expand All @@ -94,6 +100,8 @@ suite('ConnectionStore', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.userName,
Expand All @@ -106,6 +114,8 @@ suite('ConnectionStore', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.authType,
Expand All @@ -118,6 +128,8 @@ suite('ConnectionStore', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.connectionName,
Expand All @@ -55,6 +57,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.serverName,
Expand All @@ -67,6 +71,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.databaseName,
Expand All @@ -79,6 +85,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.userName,
Expand All @@ -91,6 +99,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.authType,
Expand All @@ -103,6 +113,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: true,
isRequired: true,
specialValueType: ConnectionOptionSpecialType.password,
Expand All @@ -115,6 +127,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
groupName: undefined!,
categoryValues: undefined!,
defaultValue: undefined!,
objectType: undefined,
isArray: false,
isIdentity: false,
isRequired: false,
showOnConnectionDialog: true,
Expand Down
Loading

0 comments on commit 6b05b9d

Please sign in to comment.