Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.0.0-alpha.1 #326

Merged
merged 5 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.0.0-alpha.1] - 2024-09-22

### Fixed

- Added azure/core-utils as an official dependency
- Added "main" field back to package.json

## [7.0.0-alpha.0] - 2024-09-16

### Changed

- Changed type of projects to be "module" to support EcmaScript modules. It shouldn't affect the usage of the SDK, if it does please open an issue.
- Types are now properly exported using "export type"
- CloudInfo is now exported
- Changed type of projects to be "module" to support EcmaScript modules. It shouldn't affect the usage of the SDK, if it does please open an issue.
- Types are now properly exported using "export type"
- CloudInfo is now exported

### Fixed

- Server timeout was with accuracy of tenth of a second.
- Updated default endpoint urls

### Security
- Updated dependencies to fix security vulnerabilities

- Updated dependencies to fix security vulnerabilities

## [6.0.2] - 2024-04-11

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<body>
<!-- index.js is part of webpack output -->
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "7.0.0-alpha.0",
"version": "7.0.0-alpha.1",
"useNx": true
}
260 changes: 158 additions & 102 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^18.0.0",
"@types/node": "^20.14.8",
"@types/webpack-dev-server": "^4.7.2",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
Expand All @@ -40,17 +40,16 @@
"jest-junit": "^16.0.0",
"lerna": "^7.4.2",
"npm": "^9.6.2",
"prettier": "^2.8.4",
"prettier": "^3.3.3",
"rimraf": "^3.0.2",
"shx": "^0.3.4",
"sinon": "^14.0.0",
"stream-browserify": "^3.0.0",
"ts-jest": "^29.2.5",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"typescript": "^5.5.4",
"webpack-cli": "^5.0.1"

},
"workspaces": [
"packages/azure-kusto-data",
Expand Down
4 changes: 3 additions & 1 deletion packages/azure-kusto-data/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "azure-kusto-data",
"version": "7.0.0-alpha.0",
"version": "7.0.0-alpha.1",
"description": "Azure Data Explorer Query SDK",
"type": "module",
"main": "dist-esm/src/index.js",
"exports": {
".": {
"import": "./dist-esm/src/index.js",
Expand Down Expand Up @@ -60,6 +61,7 @@
"rimraf": "^3.0.2"
},
"dependencies": {
"@azure/core-util": "^1.10.0",
"@azure/identity": "^4.0.1",
"@types/uuid": "^8.3.4",
"axios": "^1.6.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/azure-kusto-data/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class KustoClient {
streamFormat: any,
mappingName: string | null,
blob?: string,
clientRequestId?: string
clientRequestId?: string,
): Promise<KustoResponseDataSet> {
let endpoint = `${this.endpoints[ExecutionType.Ingest]}/${this.getDb(db)}/${table}?streamFormat=${streamFormat}`;
if (mappingName != null) {
Expand All @@ -141,7 +141,7 @@ export class KustoClient {
executionType: ExecutionType,
db: string | null,
entity: RequestEntity,
properties?: ClientRequestProperties | null
properties?: ClientRequestProperties | null,
): Promise<KustoResponseDataSet> {
this.ensureOpen();
kustoTrustedEndpoints.validateTrustedEndpoint(endpoint, (await CloudSettings.getCloudInfoForCluster(this.cluster)).LoginEndpoint);
Expand Down Expand Up @@ -226,7 +226,7 @@ export class KustoClient {
headers: { [header: string]: string },
payload: any,
timeout: number,
properties?: ClientRequestProperties | null
properties?: ClientRequestProperties | null,
): Promise<KustoResponseDataSet> {
// replace non-ascii characters with ? in headers
for (const key of Object.keys(headers)) {
Expand Down
7 changes: 5 additions & 2 deletions packages/azure-kusto-data/src/clientDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const None = "[none]";
export class ClientDetails {
readonly versionForTracing: string;

constructor(public applicationNameForTracing: string | null, public userNameForTracing: string | null) {
constructor(
public applicationNameForTracing: string | null,
public userNameForTracing: string | null,
) {
if (this.applicationNameForTracing === null) {
this.applicationNameForTracing = ClientDetails.defaultApplication();
}
Expand Down Expand Up @@ -85,7 +88,7 @@ export class ClientDetails {
app_version: string | null = null,
send_user: boolean = false,
override_user: string | null = null,
additional_fields: [string, string][] | null = null
additional_fields: [string, string][] | null = null,
): ClientDetails {
const params: [string, string][] = [["Kusto." + this.escapeHeader(name, false), version]];

Expand Down
12 changes: 6 additions & 6 deletions packages/azure-kusto-data/src/connectionBuilder.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
_connectionString: string,
_userId: string,
_password: string,
_authorityId?: string
_authorityId?: string,
): KustoConnectionStringBuilder {
throw new Error("Not supported in browser - use withUserPrompt instead");
}
Expand All @@ -23,7 +23,7 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
_connectionString: string,
_aadAppId: string,
_appKey: string,
_authorityId?: string
_authorityId?: string,
): KustoConnectionStringBuilder {
throw new Error("Not supported in browser - use withUserPrompt instead");
}
Expand All @@ -34,15 +34,15 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
_applicationCertificatePrivateKey?: string,
_authorityId?: string,
_applicationCertificateSendX5c?: boolean,
_applicationCertificatePath?: string
_applicationCertificatePath?: string,
): KustoConnectionStringBuilder {
throw new Error("Not supported in browser - use withUserPrompt instead");
}

static withAadDeviceAuthentication(
_connectionString: string,
_authorityId?: string,
_deviceCodeCallback?: (response: DeviceCodeInfo) => void
_deviceCodeCallback?: (response: DeviceCodeInfo) => void,
): KustoConnectionStringBuilder {
throw new Error("Not supported in browser - use withUserPrompt instead");
}
Expand Down Expand Up @@ -80,11 +80,11 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
static withUserPrompt(
connectionString: string,
interactiveCredentialOptions: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions,
timeoutMs?: number
timeoutMs?: number,
): KustoConnectionStringBuilder {
if (!interactiveCredentialOptions) {
throw new Error(
"Invalid parameters - You must provide interactiveCredentialOptions={clientId: string, redirectUri:string} to authenticate with user prompt in browser."
"Invalid parameters - You must provide interactiveCredentialOptions={clientId: string, redirectUri:string} to authenticate with user prompt in browser.",
);
}
const kcsb = new KustoConnectionStringBuilder(connectionString);
Expand Down
8 changes: 4 additions & 4 deletions packages/azure-kusto-data/src/connectionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
applicationCertificatePrivateKey?: string,
authorityId?: string,
applicationCertificateSendX5c?: boolean,
applicationCertificatePrivatePath?: string
applicationCertificatePrivatePath?: string,
): KustoConnectionStringBuilder {
if (aadAppId.trim().length === 0) throw new Error("Invalid app id");
const kcsb = new KustoConnectionStringBuilder(connectionString);
Expand Down Expand Up @@ -80,7 +80,7 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
static withAadDeviceAuthentication(
connectionString: string,
authorityId?: string,
deviceCodeCallback?: (response: DeviceCodeInfo) => void
deviceCodeCallback?: (response: DeviceCodeInfo) => void,
): KustoConnectionStringBuilder {
const kcsb = new KustoConnectionStringBuilder(connectionString);
kcsb.aadFederatedSecurity = true;
Expand All @@ -97,7 +97,7 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
connectionString: string,
msiClientId?: string,
authorityId?: string,
timeoutMs?: number
timeoutMs?: number,
): KustoConnectionStringBuilder {
const kcsb = new KustoConnectionStringBuilder(connectionString);
kcsb.aadFederatedSecurity = true;
Expand Down Expand Up @@ -158,7 +158,7 @@ export class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBa
static withUserPrompt(
connectionString: string,
options?: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions,
timeoutMs?: number
timeoutMs?: number,
): KustoConnectionStringBuilder {
const kcsb = new KustoConnectionStringBuilder(connectionString);
const { tenantId, clientId } = (options as InteractiveBrowserCredentialNodeOptions) || {};
Expand Down
2 changes: 1 addition & 1 deletion packages/azure-kusto-data/src/connectionBuilderBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export abstract class KustoConnectionStringBuilderBase {
appVersion?: string,
sendUser: boolean = false,
overrideUser?: string,
additionalFields?: [string, string][]
additionalFields?: [string, string][],
): void {
const clientDetails = ClientDetails.setConnectorDetails(name, version, appName, appVersion, sendUser, overrideUser, additionalFields);

Expand Down
12 changes: 10 additions & 2 deletions packages/azure-kusto-data/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
// Licensed under the MIT License.

export class KustoAuthenticationError extends Error {
constructor(message: string, public inner: Error | undefined, public tokenProviderName: string, public context: Record<string, any>) {
constructor(
message: string,
public inner: Error | undefined,
public tokenProviderName: string,
public context: Record<string, any>,
) {
super(message);
this.name = "KustoAuthenticationError";
}
}

export class ThrottlingError extends Error {
constructor(message: string, public inner: Error | undefined) {
constructor(
message: string,
public inner: Error | undefined,
) {
super(message);
this.name = "ThrottlingError";
}
Expand Down
2 changes: 1 addition & 1 deletion packages/azure-kusto-data/src/kustoTrustedEndpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class MatchRule {
* Indicates whether the match must be exact (the candidate must
* not have any prefix) or not.
*/
public exact: boolean
public exact: boolean,
) {}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/azure-kusto-data/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class KustoResultRow {
columns: KustoResultColumn[],
row: { [ord: number]: any },
dateTimeParser: DateTimeParser = defaultDatetimeParser,
timeSpanParser: TimeSpanParser = defaultTimespanParser
timeSpanParser: TimeSpanParser = defaultTimespanParser,
) {
this.columns = columns.sort((a, b) => a.ordinal - b.ordinal);
this.raw = row;
Expand Down
6 changes: 3 additions & 3 deletions packages/azure-kusto-data/src/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class AadHelper {
kcsb.applicationClientId,
kcsb.applicationKey,
kcsb.authorityId,
kcsb.timeoutMs
kcsb.timeoutMs,
);
} else if (!!kcsb.applicationClientId && (!!kcsb.applicationCertificatePrivateKey || !!kcsb.applicationCertificatePath)) {
this.tokenProvider = new TokenProvider.ApplicationCertificateTokenProvider(
Expand All @@ -31,7 +31,7 @@ export class AadHelper {
kcsb.applicationCertificatePath,
kcsb.applicationCertificateSendX5c,
kcsb.authorityId,
kcsb.timeoutMs
kcsb.timeoutMs,
);
} else if (kcsb.useManagedIdentityAuth) {
this.tokenProvider = new TokenProvider.MsiTokenProvider(kcsb.dataSource, kcsb.msiClientId, kcsb.authorityId, kcsb.timeoutMs);
Expand Down Expand Up @@ -62,7 +62,7 @@ export class AadHelper {
e instanceof Error ? e.message : `${e}`,
e instanceof Error ? e : undefined,
this.tokenProvider.constructor.name,
this.tokenProvider.context()
this.tokenProvider.context(),
);
}
}
Expand Down
Loading
Loading