diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 4d29436..ac6a61d 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/package.json b/package.json index ce7bd47..88e439d 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@types/mocha": "^10.0.6", "@types/node": "^18.19.3", "@types/uuid": "^9.0.7", - "@types/vscode": "^1.85.0", + "@types/vscode": "^1.83.0", "@typescript-eslint/eslint-plugin": "^6.13.2", "@typescript-eslint/parser": "^6.13.2", "@vscode/vsce": "^2.22.0", diff --git a/src/DatabricksCommands.ts b/src/DatabricksCommands.ts index 9530403..f9a860d 100644 --- a/src/DatabricksCommands.ts +++ b/src/DatabricksCommands.ts @@ -3,13 +3,13 @@ */ import {ILanguageServer} from "@sqltools/types"; -import {Headers as HeaderFields} from "./types"; +import {HeadersInit} from "./types"; import {IExtension} from "@sqltools/types"; export class DatabricksCommandsClient { constructor(private server: ILanguageServer) {} - async authenticate(headers: HeaderFields) { + async authenticate(headers: HeadersInit): Promise { return await this.server.sendRequest("db/authenticate", headers); } @@ -55,7 +55,7 @@ export async function initDatabricksCommands( await client.onRequest( "db/authenticate", - async (headerFields: HeaderFields) => { + async (headerFields: HeadersInit) => { const apiClient = await getApiClient(); const headers = new Headers(headerFields); await apiClient.config.authenticate(headers); @@ -63,7 +63,7 @@ export async function initDatabricksCommands( return [...headers.entries()].reduce((obj, [key, value]) => { obj[key] = value; return obj; - }, {} as HeaderFields); + }, {} as HeadersInit); } ); diff --git a/src/ls/ExtensionAuthProvider.ts b/src/ls/ExtensionAuthProvider.ts index 92d8727..c24ab79 100644 --- a/src/ls/ExtensionAuthProvider.ts +++ b/src/ls/ExtensionAuthProvider.ts @@ -1,11 +1,10 @@ import IAuthentication from "@databricks/sql/dist/connection/contracts/IAuthentication"; -import ITransport from "@databricks/sql/dist/connection/contracts/ITransport"; import {buildUserAgentString} from "@databricks/sql/dist/utils"; import {DatabricksCommandsClient} from "../DatabricksCommands"; -import {Headers} from "../types"; +import {HeadersInit} from "../types"; export class ExtensionAuthProvider implements IAuthentication { - private headers: Headers; + private headers: HeadersInit; constructor( private dbCommands: DatabricksCommandsClient, @@ -15,10 +14,8 @@ export class ExtensionAuthProvider implements IAuthentication { this.headers["User-Agent"] = buildUserAgentString(clientId); } - async authenticate(transport: ITransport): Promise { + async authenticate(): Promise { const headers = await this.dbCommands.authenticate(this.headers); - transport.setOptions("headers", headers); - - return transport; + return headers; } } diff --git a/src/types.ts b/src/types.ts index cd4098b..13f0007 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1 +1 @@ -export type Headers = Record; +export type HeadersInit = Record; diff --git a/yarn.lock b/yarn.lock index a3589ea..7f2dfe8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -518,7 +518,7 @@ __metadata: languageName: node linkType: hard -"@types/vscode@npm:^1.85.0": +"@types/vscode@npm:^1.83.0": version: 1.85.0 resolution: "@types/vscode@npm:1.85.0" checksum: d7934e55b8606d0df0ac60e6ce0877d3edd513b5bc150e06fababd888f328a6ba87e3eef71930fc8eae1bcce60ec6106dae89d149905cdad613e84f48a6d003e @@ -4442,7 +4442,7 @@ __metadata: "@types/mocha": ^10.0.6 "@types/node": ^18.19.3 "@types/uuid": ^9.0.7 - "@types/vscode": ^1.85.0 + "@types/vscode": ^1.83.0 "@typescript-eslint/eslint-plugin": ^6.13.2 "@typescript-eslint/parser": ^6.13.2 "@vscode/vsce": ^2.22.0