@progress/kendo-react-mcp 1.0.2 → 1.0.3

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.
@@ -3,6 +3,7 @@ import grpc from '@grpc/grpc-js';
3
3
  import { dirname, join } from 'path';
4
4
  import { fileURLToPath } from 'url';
5
5
  import { readLicense } from './read-license.js';
6
+ import { log } from './logger.js';
6
7
  const protoPath = join(dirname(fileURLToPath(import.meta.url)), '../../proto/service.proto');
7
8
  const proto = protoLoader.loadSync(protoPath, {
8
9
  keepCase: true,
@@ -15,8 +16,19 @@ const protoDescriptor = grpc.loadPackageDefinition(proto);
15
16
  const service = protoDescriptor.ContextQueryService;
16
17
  const client = new service('contextapi.telerik.com:443', grpc.credentials.createSsl());
17
18
  export async function query(queryParams) {
18
- const license = readLicense();
19
+ let license = readLicense();
19
20
  const metadata = new grpc.Metadata();
21
+ if (license && typeof license === 'string') {
22
+ // Check for BOM character and trim it
23
+ license = license.replace(/^\uFEFF/, '');
24
+ try {
25
+ metadata.add('x-license-key', license);
26
+ }
27
+ catch (error) {
28
+ log('Error adding license key to metadata:', error);
29
+ return Promise.reject(new Error(`Failed to use license key: ${error.message}`));
30
+ }
31
+ }
20
32
  if (license && typeof license === 'string') {
21
33
  metadata.add('x-license-key', license);
22
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "bin": "./dist/index.js",
6
6
  "license": "See LICENSE.md",