diff --git a/types/azure-kusto-data/azure-kusto-data-tests.ts b/types/azure-kusto-data/azure-kusto-data-tests.ts index a892d8e847..3ed01ef456 100644 --- a/types/azure-kusto-data/azure-kusto-data-tests.ts +++ b/types/azure-kusto-data/azure-kusto-data-tests.ts @@ -16,8 +16,8 @@ KustoConnectionStringBuilder.withAadManagedIdentities(connectionString, 'msi_end KustoConnectionStringBuilder.withAadUserPasswordAuthentication(connectionString, 'username', 'password'); KustoConnectionStringBuilder.withAadUserPasswordAuthentication(connectionString, 'username', 'password', 'authorityId'); KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId'); -KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId', (tokenResponse: any) => { - console.log(`Open ${tokenResponse.verificationUrl} and use ${tokenResponse.userCode } code to authorize.`); +KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId', tokenResponse => { + console.log(`Open ${tokenResponse.verificationUrl} and use ${tokenResponse.userCode} code to authorize.`); }); const client2 = new Client("http://cluster.region.kusto.windows.net"); diff --git a/types/azure-kusto-data/index.d.ts b/types/azure-kusto-data/index.d.ts index 95979c5fd5..5c538b71c4 100644 --- a/types/azure-kusto-data/index.d.ts +++ b/types/azure-kusto-data/index.d.ts @@ -4,6 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +/// +import { UserCodeInfo } from "adal-node"; + export class Client { constructor(kcsb: string | KustoConnectionStringBuilder); connectionString: KustoConnectionStringBuilder; @@ -40,7 +43,7 @@ export class KustoConnectionStringBuilder { authorityId: string; static withAadApplicationCertificateAuthentication(connectionString: string, aadAppId: string, certificate: string, thumbprint: string, authorityId: string): KustoConnectionStringBuilder; static withAadApplicationKeyAuthentication(connectionString: string, aadAppId: string, appKey: string, authorityId: string): KustoConnectionStringBuilder; - static withAadDeviceAuthentication(connectionString: string, authorityId: string, authCallback?: any): KustoConnectionStringBuilder; + static withAadDeviceAuthentication(connectionString: string, authorityId: string, authCallback?: (tokenReponse: UserCodeInfo) => void): KustoConnectionStringBuilder; static withAadUserPasswordAuthentication(connectionString: string, userId: string, password: string, authorityId?: any): KustoConnectionStringBuilder; static withAadManagedIdentities(connectionString: string, msiEndpoint?: string, clientId?: string): KustoConnectionStringBuilder; } diff --git a/types/azure-kusto-data/package.json b/types/azure-kusto-data/package.json new file mode 100644 index 0000000000..db73243f3b --- /dev/null +++ b/types/azure-kusto-data/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "adal-node": "^0.1.28" + } +} \ No newline at end of file