mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 09:35:39 -05:00
* removes more builder references * remove builder from profiler * formatting * fix profiler dailog * remove builder from oatuhdialog * remove the rest of builder references * formatting * add more strict null checks to base * enable strict tslint rules * fix formatting * fix compile error * fix the rest of the hygeny issues and add pipeline step * fix pipeline files
146 lines
3.5 KiB
TypeScript
146 lines
3.5 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { RequestType, NotificationType } from 'vscode-languageclient';
|
|
|
|
export interface IMessage {
|
|
jsonrpc: string;
|
|
}
|
|
|
|
// ------------------------------- < Telemetry Sent Event > ------------------------------------
|
|
|
|
/**
|
|
* Event sent when the language service send a telemetry event
|
|
*/
|
|
export namespace TelemetryNotification {
|
|
export const type = new NotificationType<TelemetryParams, void>('telemetry/sqlevent');
|
|
}
|
|
|
|
/**
|
|
* Update event parameters
|
|
*/
|
|
export class TelemetryParams {
|
|
public params: {
|
|
eventName: string;
|
|
properties: ITelemetryEventProperties;
|
|
measures: ITelemetryEventMeasures;
|
|
};
|
|
}
|
|
|
|
export interface ITelemetryEventProperties {
|
|
[key: string]: string;
|
|
}
|
|
|
|
export interface ITelemetryEventMeasures {
|
|
[key: string]: number;
|
|
}
|
|
|
|
/**
|
|
* Contract Classes
|
|
*/
|
|
export interface Result {
|
|
success: boolean;
|
|
errorMessage: string;
|
|
}
|
|
|
|
export interface ColumnInfo {
|
|
name: string;
|
|
sqlType: string;
|
|
isNullable: boolean;
|
|
}
|
|
|
|
|
|
/**
|
|
* PROSEDiscoveryRequest
|
|
* Send this request to create a new PROSE session with a new file and preview it
|
|
*/
|
|
const proseDiscoveryRequestName = 'flatfile/proseDiscovery';
|
|
|
|
export interface PROSEDiscoveryParams {
|
|
filePath: string;
|
|
tableName: string;
|
|
schemaName?: string;
|
|
fileType?: string;
|
|
}
|
|
|
|
export interface PROSEDiscoveryResponse {
|
|
dataPreview: string[][];
|
|
columnInfo: ColumnInfo[];
|
|
}
|
|
|
|
/**
|
|
* InsertDataRequest
|
|
*/
|
|
const insertDataRequestName = 'flatfile/insertData';
|
|
|
|
export interface InsertDataParams {
|
|
connectionString: string;
|
|
batchSize: number;
|
|
}
|
|
|
|
export interface InsertDataResponse {
|
|
result: Result;
|
|
}
|
|
|
|
|
|
/**
|
|
* GetColumnInfoRequest
|
|
*/
|
|
const getColumnInfoRequestName = 'flatfile/getColumnInfo';
|
|
|
|
export interface GetColumnInfoParams {
|
|
}
|
|
|
|
export interface GetColumnInfoResponse {
|
|
columnInfo: ColumnInfo[];
|
|
}
|
|
|
|
|
|
/**
|
|
* ChangeColumnSettingsRequest
|
|
*/
|
|
const changeColumnSettingsRequestName = 'flatfile/changeColumnSettings';
|
|
|
|
export interface ChangeColumnSettingsParams {
|
|
index: number;
|
|
newName?: string;
|
|
newDataType?: string;
|
|
newNullable?: boolean;
|
|
newInPrimaryKey?: boolean;
|
|
}
|
|
|
|
export interface ChangeColumnSettingsResponse {
|
|
result: Result;
|
|
}
|
|
|
|
/**
|
|
* Requests
|
|
*/
|
|
export namespace PROSEDiscoveryRequest {
|
|
export const type = new RequestType<PROSEDiscoveryParams, PROSEDiscoveryResponse, void, void>(proseDiscoveryRequestName);
|
|
}
|
|
|
|
export namespace InsertDataRequest {
|
|
export const type = new RequestType<InsertDataParams, InsertDataResponse, void, void>(insertDataRequestName);
|
|
}
|
|
|
|
export namespace GetColumnInfoRequest {
|
|
export const type = new RequestType<GetColumnInfoParams, GetColumnInfoResponse, void, void>(getColumnInfoRequestName);
|
|
}
|
|
|
|
export namespace ChangeColumnSettingsRequest {
|
|
export const type = new RequestType<ChangeColumnSettingsParams, ChangeColumnSettingsResponse, void, void>(changeColumnSettingsRequestName);
|
|
}
|
|
|
|
|
|
export interface FlatFileProvider {
|
|
providerId?: string;
|
|
|
|
sendPROSEDiscoveryRequest(params: PROSEDiscoveryParams): Thenable<PROSEDiscoveryResponse>;
|
|
sendInsertDataRequest(params: InsertDataParams): Thenable<InsertDataResponse>;
|
|
sendGetColumnInfoRequest(params: GetColumnInfoParams): Thenable<GetColumnInfoResponse>;
|
|
sendChangeColumnSettingsRequest(params: ChangeColumnSettingsParams): Thenable<ChangeColumnSettingsResponse>;
|
|
}
|