This commit is contained in:
Ohad Bitton 2022-09-08 23:24:34 +03:00
Родитель 384946ee41
Коммит 35afce4363
22 изменённых файлов: 831 добавлений и 51 удалений

Просмотреть файл

@ -1,9 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import KustoClient from "./source/client";
import ClientRequestProperties from "./source/clientRequestProperties";
import KustoConnectionStringBuilder from "./source/connectionBuilder";
import * as KustoDataErrors from "./source/errors";
export { KustoClient as Client, ClientRequestProperties, KustoConnectionStringBuilder, KustoDataErrors };

792
packages/azure-kusto-data-browser/package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -3,9 +3,13 @@
"version": "3.4.2",
"description": "Azure Data Explorer Query SDK",
"main": "index.js",
"browser": {
".": "./src/index.js"
},
"types": "index.d.ts",
"scripts": {
"build": "tsc"
"build": "tsc",
"test": "mocha --parallel"
},
"engines": {
"node": ">= 14.0.0"
@ -29,10 +33,12 @@
"directory": "azure-kusto-data-browser"
},
"files": [
"source/*.js",
"source/*.d.ts",
"index.js",
"index.d.ts",
"src/**/*.js",
"src/*.js",
"src/*.d.ts",
"src/**/*.d.ts",
"src/index.js",
"src/index.d.ts",
"tsconfig.tsbuildinfo",
"example.js"
],
@ -44,12 +50,14 @@
"@azure/msal-browser": "^2.28.1",
"@types/uuid": "^8.3.4",
"axios": "^0.27.2",
"crypto-browserify": "^3.12.0",
"https-browserify": "1.0.0",
"moment": "^2.29.4",
"https-browserify":"1.0.0",
"os-browserify":"0.3.0",
"stream-browserify":"3.0.0",
"uuid": "^8.3.2",
"stream-http":"3.2.0"
"os-browserify": "0.3.0",
"stream-browserify": "3.0.0",
"stream-http": "3.2.0",
"url": "^0.11.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/webpack-dev-server": "^4.7.2",

Просмотреть файл

@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import KustoClient from "./client";
import ClientRequestProperties from "./clientRequestProperties";
import KustoConnectionStringBuilder from "./connectionBuilder";
import * as KustoDataErrors from "./errors";
export { KustoClient as Client, ClientRequestProperties, KustoConnectionStringBuilder, KustoDataErrors };

Просмотреть файл

@ -6,17 +6,17 @@ import assert from "assert";
import { v4 as uuidv4 } from "uuid";
import moment from "moment";
import { KustoClient } from "../source/client";
import { KustoClient } from "../src/client";
import { ClientRequestProperties } from "../source/clientRequestProperties";
import { KustoResponseDataSetV1, KustoResponseDataSetV2 } from "../source/response";
import { ClientRequestProperties } from "../src/clientRequestProperties";
import { KustoResponseDataSetV1, KustoResponseDataSetV2 } from "../src/response";
import v2Response from "./data/response/v2.json";
import v2ResponseError from "./data/response/v2error.json";
import v1Response from "./data/response/v1.json";
import v1_2Response from "./data/response/v1_2.json";
import { Readable } from "stream";
import ConnectionBuilder from "../source/connectionBuilder";
import ConnectionBuilder from "../src/connectionBuilder";
enum ExecutionType {
Mgmt = "mgmt",

Просмотреть файл

@ -5,7 +5,7 @@
import assert from "assert";
import { v4 as uuidv4 } from "uuid";
import { KustoConnectionStringBuilder } from "../source/connectionBuilder";
import { KustoConnectionStringBuilder } from "../src/connectionBuilder";
import { DeviceCodeResponse } from "@azure/msal-common";
const doComparsion = (
@ -604,7 +604,6 @@ describe("KustoConnectionStringBuilder", () => {
});
it("with optional params", () => {
const clientId = "clientId";
const loginHint = "myUser";
const timeoutMs = 10;
const kcsbs = [KustoConnectionStringBuilder.withUserPrompt("localhost", DEFAULT_AUTHORITY, timeoutMs, loginHint)];
@ -612,7 +611,6 @@ describe("KustoConnectionStringBuilder", () => {
const kcsb1 = new KustoConnectionStringBuilder("server=localhost");
kcsb1.aadFederatedSecurity = true;
kcsb1.useUserPromptAuth = true;
kcsb1.applicationClientId = clientId;
kcsb1.timeoutMs = timeoutMs;
kcsb1.loginHint = loginHint;
@ -623,12 +621,11 @@ describe("KustoConnectionStringBuilder", () => {
authorityId: DEFAULT_AUTHORITY,
useUserPromptAuth: true,
aadFederatedSecurity: true,
applicationClientId: clientId,
timeoutMs,
loginHint,
},
`Data Source=localhost;AAD Federated Security=true;Initial Catalog=NetDefaultDB;Application Client Id=${clientId};Authority Id=organizations`,
`Data Source=localhost;AAD Federated Security=true;Initial Catalog=NetDefaultDB;Application Client Id=${clientId};Authority Id=organizations`
`Data Source=localhost;AAD Federated Security=true;Initial Catalog=NetDefaultDB;Authority Id=organizations`,
`Data Source=localhost;AAD Federated Security=true;Initial Catalog=NetDefaultDB;Authority Id=organizations`
);
});
});

Просмотреть файл

@ -3,7 +3,7 @@
import assert from "assert";
import moment from "moment";
import { KustoResultColumn, KustoResultRow, KustoResultTable } from "../source/models";
import { KustoResultColumn, KustoResultRow, KustoResultTable } from "../src/models";
import v2 from "./data/response/v2";
const v2Response = v2;

Просмотреть файл

@ -4,7 +4,7 @@
import assert from "assert";
import v2Response from "./data/response/v2.json";
import { KustoResponseDataSetV2, V2Frames } from "../source/response";
import { KustoResponseDataSetV2, V2Frames } from "../src/response";
describe("KustoResultDataSet", () => {
describe("#constructor()", () => {

Просмотреть файл

@ -1,12 +1,12 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { KustoConnectionStringBuilder } from "../index";
import AadHelper from "../source/security";
import { CloudSettings } from "../source/cloudSettings";
import { KustoConnectionStringBuilder } from "../src/index";
import AadHelper from "../src/security";
import { CloudSettings } from "../src/cloudSettings";
import assert from "assert";
import { ClientAuthError } from "@azure/msal-node";
import { KustoAuthenticationError } from "../source/errors";
import { KustoAuthenticationError } from "../src/errors";
import { CredentialUnavailableError } from "@azure/identity";
import { loginTest, manualLoginTest } from "./data/testUtils";

Просмотреть файл

@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { CloudSettings } from "../source/cloudSettings";
import { UserPassTokenProvider } from "../source/tokenProvider";
import { CloudSettings } from "../src/cloudSettings";
import { UserPassTokenProvider } from "../src/tokenProvider";
import assert from "assert";
describe("CloudInfo", () => {

Просмотреть файл

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"include": ["./source", "./test", "index.ts", "webpack.config.ts"],
"include": ["src", "./test", "src/index.ts","webpack.config.ts"],
"exclude": ["node_modules", "*.d.ts", "**/*.d.ts"]
}

Просмотреть файл

@ -5,23 +5,26 @@ import 'webpack-dev-server';
const config: webpack.Configuration = {
mode: 'development',
entry: './index.js',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'main.bundle.js',
},
// context:"./source"
};
module.exports = {
resolve: {
aliasFields: ['browser'],
fallback: {
crypto: require.resolve("crypto-browserify") ,
assert: require.resolve('assert'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
stream: require.resolve('stream-browserify'),
},
},
}
}
};
export default config;