javonet-nodejs-sdk 2.6.14 → 2.6.15

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.
@@ -23,8 +23,8 @@ __export(ConnectionStringConfigResolver_exports, {
23
23
  module.exports = __toCommonJS(ConnectionStringConfigResolver_exports);
24
24
  var import_Config = require("../Config.cjs");
25
25
  var import_ConfigsDictionary = require("../ConfigsDictionary.cjs");
26
- var import_ActivationHelper = require("../../tools/ActivationHelper.cjs");
27
26
  var import_ConfigResolver = require("./ConfigResolver.cjs");
27
+ var import_UtilsConst = require("./../../../utils/UtilsConst.cjs");
28
28
  class ConnectionStringConfigResolver extends import_ConfigResolver.ConfigResolver {
29
29
  /**
30
30
  * Parse and add multiple configuration lines from a connection string source.
@@ -89,7 +89,7 @@ class ConnectionStringConfigResolver extends import_ConfigResolver.ConfigResolve
89
89
  if (slashes >= 0) {
90
90
  valuePortion = valuePortion.substring(0, slashes).trim();
91
91
  }
92
- import_ActivationHelper.ActivationHelper.setTemporaryLicenseKey(valuePortion);
92
+ import_UtilsConst.UtilsConst.setLicenseKey(valuePortion);
93
93
  }
94
94
  }
95
95
  /**
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(JsonConfigResolver_exports);
24
24
  var import_Config = require("../Config.cjs");
25
25
  var import_ConfigsDictionary = require("../ConfigsDictionary.cjs");
26
26
  var import_ConfigResolver = require("./ConfigResolver.cjs");
27
- var import_ActivationHelper = require("../../tools/ActivationHelper.cjs");
27
+ var import_UtilsConst = require("./../../../utils/UtilsConst.cjs");
28
28
  class JsonConfigResolver extends import_ConfigResolver.ConfigResolver {
29
29
  /**
30
30
  * Parse and add configurations from a JSON object.
@@ -43,7 +43,7 @@ class JsonConfigResolver extends import_ConfigResolver.ConfigResolver {
43
43
  jsonObject.licenseKey
44
44
  );
45
45
  if (typeof licenseKey === "string") {
46
- import_ActivationHelper.ActivationHelper.setTemporaryLicenseKey(licenseKey.trim());
46
+ import_UtilsConst.UtilsConst.setLicenseKey(licenseKey.trim());
47
47
  }
48
48
  const configs = (
49
49
  /** @type {Record<string, unknown>} */
@@ -35,7 +35,7 @@ var import_js_yaml = __toESM(require("js-yaml"), 1);
35
35
  var import_Config = require("../Config.cjs");
36
36
  var import_ConfigsDictionary = require("../ConfigsDictionary.cjs");
37
37
  var import_ConfigResolver = require("./ConfigResolver.cjs");
38
- var import_ActivationHelper = require("../../tools/ActivationHelper.cjs");
38
+ var import_UtilsConst = require("./../../../utils/UtilsConst.cjs");
39
39
  class YamlConfigResolver extends import_ConfigResolver.ConfigResolver {
40
40
  /**
41
41
  * Parse YAML string and add configurations.
@@ -59,9 +59,9 @@ class YamlConfigResolver extends import_ConfigResolver.ConfigResolver {
59
59
  /** @type {RootYaml} */
60
60
  data
61
61
  );
62
- const licenseKey = root.licenseKey;
62
+ let licenseKey = root.licenseKey || root.licensekey;
63
63
  if (typeof licenseKey === "string") {
64
- import_ActivationHelper.ActivationHelper.temporaryLicenseKey = licenseKey.trim();
64
+ import_UtilsConst.UtilsConst.setLicenseKey(licenseKey.trim());
65
65
  }
66
66
  const configs = root.configurations;
67
67
  if (typeof configs !== "object" || configs == null || Array.isArray(configs)) {
@@ -1,9 +1,10 @@
1
1
  export type RootYaml = {
2
2
  licenseKey?: string;
3
+ licensekey?: string;
3
4
  configurations?: Record<string, Record<string, unknown>>;
4
5
  };
5
6
  /**
6
- * @typedef {{ licenseKey?: string, configurations?: Record<string, Record<string, unknown>> }} RootYaml
7
+ * @typedef {{ licenseKey?: string, licensekey?: string, configurations?: Record<string, Record<string, unknown>> }} RootYaml
7
8
  */
8
9
  export class YamlConfigResolver extends ConfigResolver {
9
10
  /**
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { Config } from '../Config.js'
4
4
  import { ConfigsDictionary } from '../ConfigsDictionary.js'
5
- import { ActivationHelper } from '../../tools/ActivationHelper.js'
6
5
  import { ConfigResolver } from './ConfigResolver.js'
6
+ import { UtilsConst } from './../../../utils/UtilsConst.js'
7
7
 
8
8
  class ConnectionStringConfigResolver extends ConfigResolver {
9
9
  /**
@@ -80,7 +80,7 @@ class ConnectionStringConfigResolver extends ConfigResolver {
80
80
  if (slashes >= 0) {
81
81
  valuePortion = valuePortion.substring(0, slashes).trim()
82
82
  }
83
- ActivationHelper.setTemporaryLicenseKey(valuePortion)
83
+ UtilsConst.setLicenseKey(valuePortion)
84
84
  }
85
85
  }
86
86
 
@@ -3,7 +3,7 @@
3
3
  import { Config } from '../Config.js'
4
4
  import { ConfigsDictionary } from '../ConfigsDictionary.js'
5
5
  import { ConfigResolver } from './ConfigResolver.js'
6
- import { ActivationHelper } from '../../tools/ActivationHelper.js'
6
+ import { UtilsConst } from './../../../utils/UtilsConst.js'
7
7
 
8
8
  class JsonConfigResolver extends ConfigResolver {
9
9
  /**
@@ -21,7 +21,7 @@ class JsonConfigResolver extends ConfigResolver {
21
21
 
22
22
  const licenseKey = /** @type {Record<string, unknown>} */ (jsonObject).licenseKey
23
23
  if (typeof licenseKey === 'string') {
24
- ActivationHelper.setTemporaryLicenseKey(licenseKey.trim())
24
+ UtilsConst.setLicenseKey(licenseKey.trim())
25
25
  }
26
26
 
27
27
  const configs = /** @type {Record<string, unknown>} */ (jsonObject).configurations
@@ -4,10 +4,10 @@ import yaml from 'js-yaml'
4
4
  import { Config } from '../Config.js'
5
5
  import { ConfigsDictionary } from '../ConfigsDictionary.js'
6
6
  import { ConfigResolver } from './ConfigResolver.js'
7
- import { ActivationHelper } from '../../tools/ActivationHelper.js'
7
+ import { UtilsConst } from './../../../utils/UtilsConst.js'
8
8
 
9
9
  /**
10
- * @typedef {{ licenseKey?: string, configurations?: Record<string, Record<string, unknown>> }} RootYaml
10
+ * @typedef {{ licenseKey?: string, licensekey?: string, configurations?: Record<string, Record<string, unknown>> }} RootYaml
11
11
  */
12
12
 
13
13
  class YamlConfigResolver extends ConfigResolver {
@@ -36,10 +36,10 @@ class YamlConfigResolver extends ConfigResolver {
36
36
  /** @type {RootYaml} */
37
37
  const root = /** @type {RootYaml} */ (data)
38
38
 
39
- const licenseKey = root.licenseKey
39
+ // Check for licenseKey in various casings
40
+ let licenseKey = root.licenseKey || root.licensekey
40
41
  if (typeof licenseKey === 'string') {
41
- // fixed: correct property name casing
42
- ActivationHelper.temporaryLicenseKey = licenseKey.trim()
42
+ UtilsConst.setLicenseKey(licenseKey.trim())
43
43
  }
44
44
 
45
45
  const configs = root.configurations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javonet-nodejs-sdk",
3
- "version": "2.6.14",
3
+ "version": "2.6.15",
4
4
  "description": "Javonet allows you to reference and use modules or packages written in (Java/Kotlin/Groovy/Clojure, C#/VB.NET, Ruby, Perl, Python, JavaScript/TypeScript) like they were created in your technology. It works on Linux/Windows and MacOS for applications created in JVM, CLR/Netcore, Perl, Python, Ruby, NodeJS, C++ or GoLang and gives you unparalleled freedom and flexibility with native performance in building your mixed-technologies products. Let it be accessing best AI or cryptography libraries, devices SDKs, legacy client modules, internal custom packages or anything from public repositories available on NPM, Nuget, PyPI, Maven/Gradle, RubyGems or GitHub. Get free from programming languages barriers today! For more information check out our guides at https://www.javonet.com/guides/v2/",
5
5
  "keywords": [],
6
6
  "author": "SdNCenter Sp. z o. o.",
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var ActivationHelper_exports = {};
20
- __export(ActivationHelper_exports, {
21
- ActivationHelper: () => ActivationHelper
22
- });
23
- module.exports = __toCommonJS(ActivationHelper_exports);
24
- var import_Runtime = require("../../utils/Runtime.cjs");
25
- class ActivationHelper {
26
- /** @type {string} */
27
- static temporaryLicenseKey = "License key not set";
28
- /**
29
- * @param {string} value
30
- */
31
- static setTemporaryLicenseKey(value) {
32
- if (!value || value === "your-license-key") {
33
- return;
34
- }
35
- ActivationHelper.temporaryLicenseKey = value;
36
- }
37
- /**
38
- * @returns {string}
39
- */
40
- static getTemporaryLicenseKey() {
41
- return ActivationHelper.temporaryLicenseKey;
42
- }
43
- /**
44
- * @returns {Promise<string>}
45
- */
46
- static async getLicenseKey() {
47
- try {
48
- return ActivationHelper._getLicenseKeyFromFile();
49
- } catch {
50
- return ActivationHelper.temporaryLicenseKey;
51
- }
52
- }
53
- /**
54
- * @returns {string}
55
- */
56
- static _getLicenseKeyFromFile() {
57
- if (!(0, import_Runtime.isBrowserRuntime)()) {
58
- throw new Error("ActivationHelper is not supported in the browser runtime.");
59
- }
60
- return "";
61
- }
62
- }
63
- // Annotate the CommonJS export names for ESM import in node:
64
- 0 && (module.exports = {
65
- ActivationHelper
66
- });
@@ -1,20 +0,0 @@
1
- export class ActivationHelper {
2
- /** @type {string} */
3
- static temporaryLicenseKey: string;
4
- /**
5
- * @param {string} value
6
- */
7
- static setTemporaryLicenseKey(value: string): void;
8
- /**
9
- * @returns {string}
10
- */
11
- static getTemporaryLicenseKey(): string;
12
- /**
13
- * @returns {Promise<string>}
14
- */
15
- static getLicenseKey(): Promise<string>;
16
- /**
17
- * @returns {string}
18
- */
19
- static _getLicenseKeyFromFile(): string;
20
- }
@@ -1,51 +0,0 @@
1
- // @ts-check
2
- import { isBrowserRuntime } from '../../utils/Runtime.js'
3
-
4
- class ActivationHelper {
5
- /** @type {string} */
6
- static temporaryLicenseKey = 'License key not set'
7
-
8
- /**
9
- * @param {string} value
10
- */
11
- static setTemporaryLicenseKey(value) {
12
- if (!value || value === 'your-license-key') {
13
- return
14
- }
15
- // TODO: Uncomment this when we have a way to send messages to App Insights
16
- // if (ActivationHelper.temporaryLicenseKey !== value) {
17
- // SdkMessageHelper.sendExceptionToAppInsights('SdkMessage', 'Activation');
18
- // }
19
- ActivationHelper.temporaryLicenseKey = value
20
- }
21
-
22
- /**
23
- * @returns {string}
24
- */
25
- static getTemporaryLicenseKey() {
26
- return ActivationHelper.temporaryLicenseKey
27
- }
28
-
29
- /**
30
- * @returns {Promise<string>}
31
- */
32
- static async getLicenseKey() {
33
- try {
34
- return ActivationHelper._getLicenseKeyFromFile()
35
- } catch {
36
- return ActivationHelper.temporaryLicenseKey
37
- }
38
- }
39
-
40
- /**
41
- * @returns {string}
42
- */
43
- static _getLicenseKeyFromFile() {
44
- if (!isBrowserRuntime()) {
45
- throw new Error('ActivationHelper is not supported in the browser runtime.')
46
- }
47
- return ''
48
- }
49
- }
50
-
51
- export { ActivationHelper }