azure-kusto-data 2.2.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +247 -0
- package/.prettierignore +7 -0
- package/.prettierrc.json +5 -0
- package/README.md +38 -12
- package/example.js +3 -5
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +63 -50
- package/source/client.d.ts +9 -7
- package/source/client.js +55 -28
- package/source/client.js.map +1 -1
- package/source/clientRequestProperties.d.ts +13 -2
- package/source/clientRequestProperties.js +11 -5
- package/source/clientRequestProperties.js.map +1 -1
- package/source/cloudSettings.js +2 -2
- package/source/cloudSettings.js.map +1 -1
- package/source/connectionBuilder.d.ts +24 -6
- package/source/connectionBuilder.js +128 -50
- package/source/connectionBuilder.js.map +1 -1
- package/source/errors.d.ts +6 -0
- package/source/errors.js +16 -0
- package/source/errors.js.map +1 -0
- package/source/models.d.ts +29 -5
- package/source/models.js +57 -20
- package/source/models.js.map +1 -1
- package/source/response.d.ts +2 -2
- package/source/response.js +15 -13
- package/source/response.js.map +1 -1
- package/source/security.d.ts +2 -2
- package/source/security.js +31 -20
- package/source/security.js.map +1 -1
- package/source/tokenProvider.d.ts +62 -27
- package/source/tokenProvider.js +143 -64
- package/source/tokenProvider.js.map +1 -1
- package/source/typeUtilts.d.ts +3 -0
- package/source/typeUtilts.js +5 -0
- package/source/typeUtilts.js.map +1 -0
- package/tsconfig.json +16 -16
- package/tsconfig.tsbuildinfo +1618 -1292
- package/index.ts +0 -13
- package/tslint.json +0 -18
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/*
|
|
2
|
+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
|
|
3
|
+
https://github.com/typescript-eslint/tslint-to-eslint-config
|
|
4
|
+
|
|
5
|
+
It represents the closest reasonable ESLint configuration to this
|
|
6
|
+
project's original TSLint configuration.
|
|
7
|
+
|
|
8
|
+
We recommend eventually switching this configuration to extend from
|
|
9
|
+
the recommended rulesets in typescript-eslint.
|
|
10
|
+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
|
|
11
|
+
|
|
12
|
+
Happy linting! 💖
|
|
13
|
+
*/
|
|
14
|
+
module.exports = {
|
|
15
|
+
"env": {
|
|
16
|
+
"browser": true,
|
|
17
|
+
"es6": true,
|
|
18
|
+
"node": true
|
|
19
|
+
},
|
|
20
|
+
"extends": [
|
|
21
|
+
"eslint:recommended",
|
|
22
|
+
"plugin:@typescript-eslint/recommended",
|
|
23
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
24
|
+
"prettier"
|
|
25
|
+
],
|
|
26
|
+
"ignorePatterns": [
|
|
27
|
+
"node_modules",
|
|
28
|
+
"**/*.d.ts",
|
|
29
|
+
"**/*.js"
|
|
30
|
+
],
|
|
31
|
+
"parser": "@typescript-eslint/parser",
|
|
32
|
+
"parserOptions": {
|
|
33
|
+
"project": "tsconfig.json",
|
|
34
|
+
"sourceType": "module"
|
|
35
|
+
},
|
|
36
|
+
"plugins": [
|
|
37
|
+
"eslint-plugin-jsdoc",
|
|
38
|
+
"eslint-plugin-prefer-arrow",
|
|
39
|
+
"@typescript-eslint",
|
|
40
|
+
"header"
|
|
41
|
+
],
|
|
42
|
+
"rules": {
|
|
43
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
44
|
+
"@typescript-eslint/array-type": [
|
|
45
|
+
"error",
|
|
46
|
+
{
|
|
47
|
+
"default": "array"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
51
|
+
"@typescript-eslint/ban-types": [
|
|
52
|
+
"error",
|
|
53
|
+
{
|
|
54
|
+
"types": {
|
|
55
|
+
"Object": {
|
|
56
|
+
"message": "Avoid using the `Object` type. Did you mean `object`?"
|
|
57
|
+
},
|
|
58
|
+
"Function": {
|
|
59
|
+
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
|
|
60
|
+
},
|
|
61
|
+
"Boolean": {
|
|
62
|
+
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
|
|
63
|
+
},
|
|
64
|
+
"Number": {
|
|
65
|
+
"message": "Avoid using the `Number` type. Did you mean `number`?"
|
|
66
|
+
},
|
|
67
|
+
"String": {
|
|
68
|
+
"message": "Avoid using the `String` type. Did you mean `string`?"
|
|
69
|
+
},
|
|
70
|
+
"Symbol": {
|
|
71
|
+
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"@typescript-eslint/consistent-type-assertions": "error",
|
|
77
|
+
"@typescript-eslint/dot-notation": "error",
|
|
78
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
79
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
80
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
81
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
82
|
+
"@typescript-eslint/no-extra-semi": "error",
|
|
83
|
+
"@typescript-eslint/no-loss-of-precision": "error",
|
|
84
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
85
|
+
"@typescript-eslint/no-namespace": "error",
|
|
86
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
87
|
+
"@typescript-eslint/no-parameter-properties": "off",
|
|
88
|
+
"@typescript-eslint/no-shadow": [
|
|
89
|
+
"error",
|
|
90
|
+
{
|
|
91
|
+
"hoist": "all"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
95
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
96
|
+
"@typescript-eslint/no-unused-expressions": "error",
|
|
97
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
98
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
99
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
100
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
101
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
102
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
103
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
104
|
+
"@typescript-eslint/triple-slash-reference": [
|
|
105
|
+
"error",
|
|
106
|
+
{
|
|
107
|
+
"path": "always",
|
|
108
|
+
"types": "prefer-import",
|
|
109
|
+
"lib": "always"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
113
|
+
"complexity": "off",
|
|
114
|
+
"constructor-super": "error",
|
|
115
|
+
"dot-notation": "error",
|
|
116
|
+
"eqeqeq": [
|
|
117
|
+
"error",
|
|
118
|
+
"smart"
|
|
119
|
+
],
|
|
120
|
+
"for-direction": "error",
|
|
121
|
+
"getter-return": "error",
|
|
122
|
+
"guard-for-in": "error",
|
|
123
|
+
"id-denylist": [
|
|
124
|
+
"error",
|
|
125
|
+
"any",
|
|
126
|
+
"Number",
|
|
127
|
+
"number",
|
|
128
|
+
"String",
|
|
129
|
+
"string",
|
|
130
|
+
"Boolean",
|
|
131
|
+
"boolean",
|
|
132
|
+
"Undefined",
|
|
133
|
+
"undefined"
|
|
134
|
+
],
|
|
135
|
+
"id-match": "error",
|
|
136
|
+
"jsdoc/check-alignment": "error",
|
|
137
|
+
"jsdoc/check-indentation": "error",
|
|
138
|
+
"jsdoc/newline-after-description": "error",
|
|
139
|
+
"max-classes-per-file": [
|
|
140
|
+
"error",
|
|
141
|
+
1
|
|
142
|
+
],
|
|
143
|
+
"new-parens": "error",
|
|
144
|
+
"no-array-constructor": "off",
|
|
145
|
+
"no-async-promise-executor": "error",
|
|
146
|
+
"no-bitwise": "error",
|
|
147
|
+
"no-caller": "error",
|
|
148
|
+
"no-case-declarations": "error",
|
|
149
|
+
"no-class-assign": "error",
|
|
150
|
+
"no-compare-neg-zero": "error",
|
|
151
|
+
"no-cond-assign": "error",
|
|
152
|
+
"no-console": "error",
|
|
153
|
+
"no-const-assign": "error",
|
|
154
|
+
"no-control-regex": "error",
|
|
155
|
+
"no-debugger": "error",
|
|
156
|
+
"no-delete-var": "error",
|
|
157
|
+
"no-dupe-args": "error",
|
|
158
|
+
"no-dupe-class-members": "error",
|
|
159
|
+
"no-dupe-else-if": "error",
|
|
160
|
+
"no-dupe-keys": "error",
|
|
161
|
+
"no-duplicate-case": "error",
|
|
162
|
+
"no-empty": "error",
|
|
163
|
+
"no-empty-character-class": "error",
|
|
164
|
+
"no-empty-pattern": "error",
|
|
165
|
+
"no-eval": "error",
|
|
166
|
+
"no-ex-assign": "error",
|
|
167
|
+
"no-extra-boolean-cast": "error",
|
|
168
|
+
"no-extra-semi": "off",
|
|
169
|
+
"no-fallthrough": "off",
|
|
170
|
+
"no-func-assign": "error",
|
|
171
|
+
"no-global-assign": "error",
|
|
172
|
+
"no-import-assign": "error",
|
|
173
|
+
"no-inner-declarations": "error",
|
|
174
|
+
"no-invalid-regexp": "error",
|
|
175
|
+
"no-invalid-this": "off",
|
|
176
|
+
"no-irregular-whitespace": "error",
|
|
177
|
+
"no-loss-of-precision": "off",
|
|
178
|
+
"no-misleading-character-class": "error",
|
|
179
|
+
"no-mixed-spaces-and-tabs": "error",
|
|
180
|
+
"no-new-symbol": "error",
|
|
181
|
+
"no-new-wrappers": "error",
|
|
182
|
+
"no-nonoctal-decimal-escape": "error",
|
|
183
|
+
"no-obj-calls": "error",
|
|
184
|
+
"no-octal": "error",
|
|
185
|
+
"no-prototype-builtins": "error",
|
|
186
|
+
"no-redeclare": "error",
|
|
187
|
+
"no-regex-spaces": "error",
|
|
188
|
+
"no-self-assign": "error",
|
|
189
|
+
"no-setter-return": "error",
|
|
190
|
+
"no-shadow-restricted-names": "error",
|
|
191
|
+
"no-sparse-arrays": "error",
|
|
192
|
+
"no-this-before-super": "error",
|
|
193
|
+
"no-throw-literal": "error",
|
|
194
|
+
"no-trailing-spaces": "error",
|
|
195
|
+
"no-undef-init": "error",
|
|
196
|
+
"no-unexpected-multiline": "error",
|
|
197
|
+
"no-unreachable": "error",
|
|
198
|
+
"no-unsafe-finally": "error",
|
|
199
|
+
"no-unsafe-negation": "error",
|
|
200
|
+
"no-unsafe-optional-chaining": "error",
|
|
201
|
+
"no-unused-expressions": "error",
|
|
202
|
+
"no-unused-labels": "error",
|
|
203
|
+
"no-unused-vars": "off",
|
|
204
|
+
"no-use-before-define": "off",
|
|
205
|
+
"no-useless-backreference": "error",
|
|
206
|
+
"no-useless-catch": "error",
|
|
207
|
+
"no-useless-escape": "error",
|
|
208
|
+
"no-var": "error",
|
|
209
|
+
"no-with": "error",
|
|
210
|
+
"object-shorthand": "error",
|
|
211
|
+
"one-var": [
|
|
212
|
+
"error",
|
|
213
|
+
"never"
|
|
214
|
+
],
|
|
215
|
+
"prefer-arrow/prefer-arrow-functions": "error",
|
|
216
|
+
"prefer-const": "error",
|
|
217
|
+
"radix": "error",
|
|
218
|
+
"require-yield": "error",
|
|
219
|
+
"spaced-comment": [
|
|
220
|
+
"error",
|
|
221
|
+
"always",
|
|
222
|
+
{
|
|
223
|
+
"markers": [
|
|
224
|
+
"/"
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"use-isnan": "error",
|
|
229
|
+
"valid-typeof": "off",
|
|
230
|
+
|
|
231
|
+
// Rules that were added manually
|
|
232
|
+
|
|
233
|
+
"header/header": ["error", "line", " Copyright (c) Microsoft Corporation.\n Licensed under the MIT License."],
|
|
234
|
+
|
|
235
|
+
// Disabled rules to avoid too many changes, consider re-enabling in the future
|
|
236
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
237
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
238
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
239
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
240
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
241
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
242
|
+
"no-undef":"off",
|
|
243
|
+
"@typescript-eslint/no-non-null-assertion":"off",
|
|
244
|
+
"@typescript-eslint/no-unnecessary-type-assertion":"off",
|
|
245
|
+
"no-constant-condition": "off",
|
|
246
|
+
}
|
|
247
|
+
};
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
package/README.md
CHANGED
|
@@ -6,56 +6,66 @@
|
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
9
|
-
```javascript
|
|
9
|
+
```javascript
|
|
10
10
|
const KustoClient = require("azure-kusto-data").Client;
|
|
11
11
|
const KustoConnectionStringBuilder = require("azure-kusto-data").KustoConnectionStringBuilder;
|
|
12
12
|
|
|
13
|
-
const kcsb = KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(`https://${clusterName}.kusto.windows.net`,
|
|
13
|
+
const kcsb = KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(`https://${clusterName}.kusto.windows.net`, "appid", "appkey", "authorityId");
|
|
14
14
|
const client = new KustoClient(kcsb);
|
|
15
15
|
|
|
16
16
|
const results = await client.execute("db", "TableName | limit 1");
|
|
17
17
|
console.log(JSON.stringify(results));
|
|
18
18
|
console.log(results.primaryResults[0].toString());
|
|
19
|
-
|
|
20
19
|
```
|
|
21
20
|
|
|
22
21
|
## Authentication
|
|
22
|
+
|
|
23
23
|
There are several authentication methods
|
|
24
24
|
|
|
25
25
|
### AAD application
|
|
26
|
+
|
|
26
27
|
There are three ways to authenticate using AAD application:
|
|
27
28
|
|
|
28
29
|
Option 1: Authenticating using AAD application id and corresponding key.
|
|
30
|
+
|
|
29
31
|
```javascript
|
|
30
|
-
const kcsb = KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(`https://${clusterName}.kusto.windows.net`,
|
|
32
|
+
const kcsb = KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(`https://${clusterName}.kusto.windows.net`, "appid", "appkey", "authorityId");
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
Option 2: Authenticating using AAD application id and corresponding certificate.
|
|
34
36
|
|
|
35
37
|
```javascript
|
|
36
|
-
const kcsb = KustoConnectionStringBuilder.withAadApplicationCertificateAuthentication(
|
|
38
|
+
const kcsb = KustoConnectionStringBuilder.withAadApplicationCertificateAuthentication(
|
|
39
|
+
`https://${clusterName}.kusto.windows.net`,
|
|
40
|
+
"appid",
|
|
41
|
+
"certificate",
|
|
42
|
+
"thumbprint",
|
|
43
|
+
"authorityId"
|
|
44
|
+
);
|
|
37
45
|
```
|
|
38
46
|
|
|
39
47
|
Option 3: Authenticating using [AAD Managed Identities](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview).
|
|
40
48
|
|
|
41
49
|
```javascript
|
|
42
|
-
const kcsb = KustoConnectionStringBuilder.withAadManagedIdentities(`https://${clusterName}.kusto.windows.net`,
|
|
50
|
+
const kcsb = KustoConnectionStringBuilder.withAadManagedIdentities(`https://${clusterName}.kusto.windows.net`, "(Optional)msiEndpoint", "(Optional)clientId");
|
|
43
51
|
```
|
|
44
52
|
|
|
45
|
-
|
|
46
53
|
### Username/Password
|
|
54
|
+
|
|
47
55
|
```javascript
|
|
48
|
-
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(`https://${clusterName}.kusto.windows.net`,
|
|
56
|
+
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(`https://${clusterName}.kusto.windows.net`, "username", "password");
|
|
49
57
|
```
|
|
50
58
|
|
|
51
|
-
Authority is optional
|
|
59
|
+
Authority is optional _when it can inferred from the domain_ ('user@microsoft.com' would make the authority 'microsoft.com').
|
|
52
60
|
In any case it is possible to pass the authority id
|
|
61
|
+
|
|
53
62
|
```javascript
|
|
54
|
-
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(`https://${clusterName}.kusto.windows.net`,
|
|
63
|
+
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(`https://${clusterName}.kusto.windows.net`, "username", "password", "authorityId");
|
|
55
64
|
```
|
|
56
65
|
|
|
57
66
|
### Device
|
|
58
|
-
|
|
67
|
+
|
|
68
|
+
Using this method will write a token to the console, which can be used to authenticate at https://login.microsoftonline.com/common/oauth2/deviceauth and will allow temporary access.
|
|
59
69
|
|
|
60
70
|
**<!>It is not meant for production purposes<!>**
|
|
61
71
|
|
|
@@ -71,7 +81,24 @@ KustoConnectionStringBuilder.withAadDeviceAuthentication(`https://${clusterName}
|
|
|
71
81
|
});
|
|
72
82
|
```
|
|
73
83
|
|
|
84
|
+
### Az Login
|
|
85
|
+
|
|
86
|
+
You will need to [install the azure-cli](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) and run the following command:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
az login
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This method uses the token stored in azure cli for authentication.
|
|
93
|
+
|
|
94
|
+
**<!>This is not recommeneded for unattended authentication<!>**
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
const kcsb = KustoConnectionStringBuilder.withAzLoginIdentity(`https://${clusterName}.kusto.windows.net`); // optionally also pass authorityId
|
|
98
|
+
```
|
|
99
|
+
|
|
74
100
|
## Usage
|
|
101
|
+
|
|
75
102
|
Query language docs can be found at https://docs.microsoft.com/en-us/azure/data-explorer/write-queries#overview-of-the-query-language
|
|
76
103
|
|
|
77
104
|
## Advanced Usage
|
|
@@ -96,4 +123,3 @@ const results = await client.executeQuery("db", query, clientRequestProps);
|
|
|
96
123
|
```
|
|
97
124
|
|
|
98
125
|
A full list of those properties can be found at https://docs.microsoft.com/en-us/azure/kusto/api/netfx/request-properties
|
|
99
|
-
|
package/example.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
const KustoClient = require("azure-kusto-data").Client;
|
|
5
5
|
const KustoConnectionStringBuilder = require("azure-kusto-data").KustoConnectionStringBuilder;
|
|
6
6
|
const ClientRequestProperties = require("azure-kusto-data").ClientRequestProperties;
|
|
7
|
-
const { v4: uuidv4 } = require(
|
|
7
|
+
const { v4: uuidv4 } = require("uuid");
|
|
8
8
|
|
|
9
9
|
const clusterConectionString = "https://<cluster>.<region>.kusto.windows.net";
|
|
10
10
|
const database = "<databaseName>";
|
|
@@ -19,8 +19,7 @@ async function start() {
|
|
|
19
19
|
const results = await kustoClient.execute(database, `['${table}'] | limit 1`);
|
|
20
20
|
console.log(JSON.stringify(results));
|
|
21
21
|
console.log(results.primaryResults[0].toString());
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
22
|
+
} catch (error) {
|
|
24
23
|
console.log(error);
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -41,8 +40,7 @@ async function start() {
|
|
|
41
40
|
const results = await kustoClient.execute(database, `['${table}'] | limit 1`, clientRequestProps);
|
|
42
41
|
console.log(JSON.stringify(results));
|
|
43
42
|
console.log(results.primaryResults[0].toString());
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
43
|
+
} catch (error) {
|
|
46
44
|
console.log(error);
|
|
47
45
|
}
|
|
48
46
|
}
|
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,6DAA0C;AAIlB,iBAJjB,gBAAW,CAIY;AAH9B,+FAAuE;AAGvC,kCAHzB,iCAAuB,CAGyB;AAFvD,mFAAsE;AAEb,uCAFlD,2BAA4B,CAEkD"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
"name": "azure-kusto-data",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"description": "Azure Data Explorer Query SDK",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">= 14.0.0"
|
|
9
|
+
},
|
|
10
|
+
"tags": [
|
|
11
|
+
"azure",
|
|
12
|
+
"kusto",
|
|
13
|
+
"sdk"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"node",
|
|
17
|
+
"azure",
|
|
18
|
+
"kusto"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -b",
|
|
22
|
+
"prepublish": "npm run build ",
|
|
23
|
+
"example": "npm run build && node example.js",
|
|
24
|
+
"lint": "npx eslint -c .eslintrc.js --ext .ts .",
|
|
25
|
+
"test": "npm run build && mocha --parallel",
|
|
26
|
+
"testPipeline": "npm run build && nyc --reporter lcovonly mocha --reporter mocha-junit-reporter",
|
|
27
|
+
"format": "npx prettier --write .",
|
|
28
|
+
"checkFormat": "npx prettier --check --end-of-line lf ."
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/Azure/azure-kusto-node.git",
|
|
33
|
+
"directory": "azure-kusto-data"
|
|
34
|
+
},
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "ISC",
|
|
37
|
+
"homepage": "https://github.com/Azure/azure-kusto-node/blob/master/azure-kusto-data/README.md",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@azure/identity": "^2.0.1",
|
|
40
|
+
"@azure/msal-node": "^1.5.0",
|
|
41
|
+
"@types/node": "^14.14.13",
|
|
42
|
+
"@types/uuid": "^8.3.0",
|
|
43
|
+
"axios": "^0.24.0",
|
|
44
|
+
"follow-redirects": "^1.14.8",
|
|
45
|
+
"moment": "^2.25.3",
|
|
46
|
+
"uuid": "^8.3.2"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/mocha": "^8.2.0",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^5.12.0",
|
|
51
|
+
"@typescript-eslint/parser": "^5.12.0",
|
|
52
|
+
"eslint": "^8.9.0",
|
|
53
|
+
"eslint-config-prettier": "^8.3.0",
|
|
54
|
+
"eslint-plugin-header": "^3.1.1",
|
|
55
|
+
"eslint-plugin-jsdoc": "^37.9.1",
|
|
56
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
57
|
+
"mocha": "^9.2.0",
|
|
58
|
+
"mocha-junit-reporter": "^2.0.2",
|
|
59
|
+
"nyc": "^15.1.0",
|
|
60
|
+
"prettier": "2.5.1",
|
|
61
|
+
"sinon": "^7.2.3",
|
|
62
|
+
"ts-node": "^9.1.1",
|
|
63
|
+
"typescript": "^4.1.3"
|
|
64
|
+
}
|
|
52
65
|
}
|
package/source/client.d.ts
CHANGED
|
@@ -12,21 +12,23 @@ declare enum ExecutionType {
|
|
|
12
12
|
export declare class KustoClient {
|
|
13
13
|
connectionString: ConnectionStringBuilder;
|
|
14
14
|
cluster: string;
|
|
15
|
+
defaultDatabase?: string;
|
|
15
16
|
endpoints: {
|
|
16
17
|
[key in ExecutionType]: string;
|
|
17
18
|
};
|
|
18
19
|
aadHelper: AadHelper;
|
|
19
20
|
axiosInstance: AxiosInstance;
|
|
20
21
|
constructor(kcsb: string | ConnectionStringBuilder);
|
|
21
|
-
execute(db: string, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
22
|
-
executeQuery(db: string, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
23
|
-
executeQueryV1(db: string, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
24
|
-
executeMgmt(db: string, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
25
|
-
executeStreamingIngest(db: string, table: string, stream: any, streamFormat: any, mappingName: string | null): Promise<KustoResponseDataSet>;
|
|
26
|
-
_execute(endpoint: string, executionType: ExecutionType, db: string, query: string | null, stream:
|
|
22
|
+
execute(db: string | null, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
23
|
+
executeQuery(db: string | null, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
24
|
+
executeQueryV1(db: string | null, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
25
|
+
executeMgmt(db: string | null, query: string, properties?: ClientRequestProperties): Promise<KustoResponseDataSet>;
|
|
26
|
+
executeStreamingIngest(db: string | null, table: string, stream: any, streamFormat: any, mappingName: string | null, clientRequestId?: string): Promise<KustoResponseDataSet>;
|
|
27
|
+
_execute(endpoint: string, executionType: ExecutionType, db: string | null, query: string | null, stream: any, properties?: ClientRequestProperties | null): Promise<KustoResponseDataSet>;
|
|
28
|
+
private getDb;
|
|
27
29
|
_doRequest(endpoint: string, executionType: ExecutionType, headers: {
|
|
28
30
|
[header: string]: string;
|
|
29
|
-
}, payload:
|
|
31
|
+
}, payload: any, timeout: number, properties?: ClientRequestProperties | null): Promise<KustoResponseDataSet>;
|
|
30
32
|
_parseResponse(response: any, executionType: ExecutionType, properties?: ClientRequestProperties | null, status?: number): KustoResponseDataSet;
|
|
31
33
|
_getClientTimeout(executionType: ExecutionType, properties?: ClientRequestProperties | null): number;
|
|
32
34
|
}
|