azure-kusto-data
Advanced tools
Comparing version 3.3.1 to 3.3.2
import KustoClient from "./source/client"; | ||
import ClientRequestProperties from "./source/clientRequestProperties"; | ||
import KustoConnectionStringBuilder from "./source/connectionBuilder"; | ||
export { KustoClient as Client, ClientRequestProperties, KustoConnectionStringBuilder }; | ||
import * as KustoDataErrors from "./source/errors"; | ||
export { KustoClient as Client, ClientRequestProperties, KustoConnectionStringBuilder, KustoDataErrors }; |
27
index.js
"use strict"; | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -8,3 +31,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KustoConnectionStringBuilder = exports.ClientRequestProperties = exports.Client = void 0; | ||
exports.KustoDataErrors = exports.KustoConnectionStringBuilder = exports.ClientRequestProperties = exports.Client = void 0; | ||
const client_1 = __importDefault(require("./source/client")); | ||
@@ -16,2 +39,4 @@ exports.Client = client_1.default; | ||
exports.KustoConnectionStringBuilder = connectionBuilder_1.default; | ||
const KustoDataErrors = __importStar(require("./source/errors")); | ||
exports.KustoDataErrors = KustoDataErrors; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "azure-kusto-data", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "Azure Data Explorer Query SDK", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"engines": { | ||
"node": ">= 14.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"tags": [ | ||
@@ -20,12 +26,2 @@ "azure", | ||
], | ||
"scripts": { | ||
"build": "tsc -b", | ||
"prepublish": "npm run build ", | ||
"example": "npm run build && node example.js", | ||
"lint": "npx eslint -c .eslintrc.js --ext .ts .", | ||
"test": "npm run build && mocha --parallel", | ||
"testPipeline": "npm run build && nyc --reporter lcovonly mocha --reporter mocha-junit-reporter", | ||
"format": "npx prettier --write .", | ||
"checkFormat": "npx prettier --check --end-of-line lf ." | ||
}, | ||
"repository": { | ||
@@ -36,2 +32,10 @@ "type": "git", | ||
}, | ||
"files": [ | ||
"source/**/*.js", | ||
"source/**/*.d.ts", | ||
"index.js", | ||
"index.d.ts", | ||
"tsconfig.tsbuildinfo", | ||
"example.js" | ||
], | ||
"author": "", | ||
@@ -48,5 +52,6 @@ "license": "ISC", | ||
"moment": "^2.25.3", | ||
"ts-node": "^10.7.0", | ||
"uuid": "^8.3.2" | ||
}, | ||
"gitHead": "a4760ed3302ffa6ec772107fb6346c0ad2bb1453" | ||
"gitHead": "98353bc492ff277e385181c1034d878c8bfb3119" | ||
} |
@@ -24,2 +24,3 @@ "use strict"; | ||
const clientRequestProperties_1 = __importDefault(require("./clientRequestProperties")); | ||
const errors_1 = require("./errors"); | ||
const package_json_1 = __importDefault(require("../package.json")); | ||
@@ -43,3 +44,7 @@ const axios_1 = __importDefault(require("axios")); | ||
this.connectionString = typeof kcsb === "string" ? new connectionBuilder_1.default(kcsb) : kcsb; | ||
this.cluster = this.connectionString.dataSource; | ||
if (!this.connectionString.dataSource) { | ||
throw new Error("Cluster url is required"); | ||
} | ||
const url = new URL(this.connectionString.dataSource); | ||
this.cluster = `${url.protocol}//${url.hostname}${url.port ? `:${url.port}` : ""}`; | ||
this.defaultDatabase = this.connectionString.initialCatalog; | ||
@@ -174,2 +179,5 @@ this.endpoints = { | ||
if (axios_1.default.isAxiosError(error) && error.response) { | ||
if (error.response.status === 429) { | ||
throw new errors_1.ThrottlingError("POST request failed with status 429 (Too Many Requests)", error); | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
@@ -176,0 +184,0 @@ throw ((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.error) || error.response.data; |
@@ -58,3 +58,3 @@ "use strict"; | ||
if (Object.keys(this._options).length !== 0) { | ||
json.Options = this._options; | ||
json.Options = Object.assign({}, this._options); | ||
if (json.Options.servertimeout) { | ||
@@ -65,3 +65,3 @@ json.Options.servertimeout = this._msToTimespan(json.Options.servertimeout); | ||
if (Object.keys(this._parameters).length !== 0) { | ||
json.Parameters = this._parameters; | ||
json.Parameters = Object.assign({}, this._parameters); | ||
} | ||
@@ -68,0 +68,0 @@ return Object.keys(json).length !== 0 ? json : null; |
@@ -7,1 +7,5 @@ export declare class KustoAuthenticationError extends Error { | ||
} | ||
export declare class ThrottlingError extends Error { | ||
inner: Error | undefined; | ||
constructor(message: string, inner: Error | undefined); | ||
} |
@@ -5,3 +5,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KustoAuthenticationError = void 0; | ||
exports.ThrottlingError = exports.KustoAuthenticationError = void 0; | ||
class KustoAuthenticationError extends Error { | ||
@@ -17,2 +17,10 @@ constructor(message, inner, tokenProviderName, context) { | ||
exports.KustoAuthenticationError = KustoAuthenticationError; | ||
class ThrottlingError extends Error { | ||
constructor(message, inner) { | ||
super(message); | ||
this.inner = inner; | ||
this.name = "ThrottlingError"; | ||
} | ||
} | ||
exports.ThrottlingError = ThrottlingError; | ||
//# sourceMappingURL=errors.js.map |
@@ -9,4 +9,2 @@ "use strict"; | ||
exports.KustoResultTable = exports.KustoResultColumn = exports.KustoResultRow = exports.WellKnownDataSet = void 0; | ||
// We want all the Kusto table models in this file | ||
/* eslint-disable max-classes-per-file */ | ||
const moment_1 = __importDefault(require("moment")); | ||
@@ -13,0 +11,0 @@ var WellKnownDataSet; |
@@ -6,4 +6,2 @@ "use strict"; | ||
exports.KustoResponseDataSetV2 = exports.KustoResponseDataSetV1 = exports.KustoResponseDataSet = void 0; | ||
// We want all the Response models to be in this file | ||
/* eslint-disable max-classes-per-file */ | ||
const models_1 = require("./models"); | ||
@@ -10,0 +8,0 @@ var ErrorLevels; |
@@ -15,3 +15,2 @@ "use strict"; | ||
exports.ApplicationCertificateTokenProvider = exports.ApplicationKeyTokenProvider = exports.DeviceLoginTokenProvider = exports.UserPassTokenProvider = exports.UserPromptProvider = exports.AzCliTokenProvider = exports.MsiTokenProvider = exports.AzureIdentityProvider = exports.CallbackTokenProvider = exports.BasicTokenProvider = exports.TokenProviderBase = void 0; | ||
/* eslint-disable max-classes-per-file -- We want all the Token Providers in this file */ | ||
const msal_node_1 = require("@azure/msal-node"); | ||
@@ -18,0 +17,0 @@ const identity_1 = require("@azure/identity"); |
Sorry, the diff of this file is not supported yet
140305
9
27
1896
+ Addedts-node@^10.7.0
+ Added@cspotcode/source-map-support@0.8.1(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.9(transitive)
+ Added@tsconfig/node10@1.0.11(transitive)
+ Added@tsconfig/node12@1.0.11(transitive)
+ Added@tsconfig/node14@1.0.3(transitive)
+ Added@tsconfig/node16@1.0.4(transitive)
+ Addedacorn@8.14.1(transitive)
+ Addedacorn-walk@8.3.4(transitive)
+ Addedarg@4.1.3(transitive)
+ Addedcreate-require@1.1.1(transitive)
+ Addeddiff@4.0.2(transitive)
+ Addedmake-error@1.3.6(transitive)
+ Addedts-node@10.9.2(transitive)
+ Addedtypescript@5.8.2(transitive)
+ Addedv8-compile-cache-lib@3.0.1(transitive)
+ Addedyn@3.1.1(transitive)