diff --git a/package-lock.json b/package-lock.json index fc9d14b..5106549 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3290,9 +3290,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "dev": true, "funding": [ { diff --git a/src/ServerClient/ADXClient.ts b/src/ServerClient/ADXClient.ts index faf804c..4aa5da7 100644 --- a/src/ServerClient/ADXClient.ts +++ b/src/ServerClient/ADXClient.ts @@ -1,4 +1,5 @@ import { ADXResponse, RawADXResponse } from "./ADXResponse"; + type ADXTokenProvider = () => Promise; declare global { @@ -69,7 +70,10 @@ export class ADXClient { "Content-Type": "application/json", Authorization: `Bearer ${token}`, "x-ms-client-request-id": `KTrender;${self.crypto.randomUUID()}`, - "x-ms-app": "KustoTrender" + "x-ms-app": "KustoTrender", + "x-ms-client-version": process.env.PACKAGE_VERSION, + "x-ms-user" : "KustoTrender", + "User-Agent" : navigator.userAgent }, body: JSON.stringify(body), }); diff --git a/tsconfig.json b/tsconfig.json index 78f152a..96e5b3a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,9 @@ "lib" : ["es5", "es2015.promise", "dom", "es6"], "moduleResolution": "Node", "declaration": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "esModuleInterop": true }, "include": [ "src" diff --git a/webpack.common.js b/webpack.common.js index aa5e400..e8f799e 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,5 +1,7 @@ const path = require('path'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const packageJson = require('./package.json'); +const webpack = require('webpack'); module.exports = { entry: './src/KustoTrender.ts', @@ -48,4 +50,9 @@ module.exports = { publicPath: '/dist/', libraryTarget: 'umd' }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version) + }) + ] }; \ No newline at end of file