azure-kusto-data
Advanced tools
Comparing version
{ | ||
"name": "azure-kusto-data", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Azure Data Explorer Query SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -72,4 +72,10 @@ const moment = require("moment"); | ||
this.name = tableObj.TableName; | ||
this.id = tableObj.TableId; | ||
this.kind = tableObj.TableKind; | ||
if (tableObj.TableId !== undefined) { | ||
this.id = tableObj.TableId; | ||
} | ||
if (tableObj.TableKind) { | ||
this.kind = tableObj.TableKind; | ||
} | ||
this.columns = tableObj.Columns.map((item, index) => new KustoResultColumn(item, index)); | ||
@@ -76,0 +82,0 @@ this._rows = tableObj.Rows; |
@@ -81,17 +81,21 @@ const { KustoResultTable, WellKnownDataSet } = require("./models"); | ||
if (this.tables.length <= 2) { | ||
this.tables[0].TableKind = WellKnownDataSet.PrimaryResult; | ||
this.tables[0].TableId = 0; | ||
if (this.tables[0].kind === undefined){ | ||
this.tables[0].kind = WellKnownDataSet.PrimaryResult; | ||
this.primaryResults.push(this.tables[0]); | ||
} | ||
this.tables[0].id = 0; | ||
if (this.tables.length == 2) { | ||
this.tables[1].TableKind = WellKnownDataSet.QueryProperties; | ||
this.tables[1].TableId = 1; | ||
this.tables[1].kind = WellKnownDataSet.QueryProperties; | ||
this.tables[1].id = 1; | ||
} | ||
} else { | ||
const toc = this.tables[this.tables.length - 1]; | ||
toc.TableKind = WellKnownDataSet.TableOfContents; | ||
toc.TableId = this.tables.length - 1; | ||
toc.kind = WellKnownDataSet.TableOfContents; | ||
toc.id = this.tables.length - 1; | ||
for (let i = 0; i < this.tables.length - 1; i++) { | ||
this.tables[i].TableName = toc[i]["Name"]; | ||
this.tables[i].TableId = toc[i]["Id"]; | ||
this.tables[i].TableKind = KustoResponseDataSetV1.getTablesKinds()[toc[i]["Kind"]]; | ||
this.tables[i].name = toc[i]["Name"]; | ||
this.tables[i].id = toc[i]["Id"]; | ||
this.tables[i].kind = KustoResponseDataSetV1.getTablesKinds()[toc[i]["Kind"]]; | ||
} | ||
@@ -98,0 +102,0 @@ } |
@@ -1,2 +0,2 @@ | ||
const { URL } = require("url"); | ||
const { AuthenticationContext } = require("adal-node"); | ||
@@ -11,2 +11,3 @@ | ||
module.exports = class AadHelper { | ||
@@ -17,3 +18,12 @@ constructor(kcsb) { | ||
let authority = kcsb.authorityId || "common"; | ||
let url = new URL(kcsb.dataSource); | ||
let url; | ||
// support node compatability | ||
try { | ||
url = new URL(kcsb.dataSource); | ||
} catch (e){ | ||
const URL = require("url").URL; | ||
url = new URL(kcsb.dataSource); | ||
} | ||
this.kustoCluster = `${url.protocol}//${url.hostname}`; | ||
@@ -20,0 +30,0 @@ this.adalContext = new AuthenticationContext(`https://login.microsoftonline.com/${authority}`); |
27641
1.55%552
2.41%