@aiqa/sdk 1.0.0-develop.3 → 1.0.0-develop.4

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.
@@ -103,7 +103,6 @@ declare class AiQaSdk implements IAiqaSdk {
103
103
  startRecording(): Promise<boolean>;
104
104
  stopRecording(): Promise<boolean>;
105
105
  isRecordingNow(): Promise<boolean>;
106
- private compareVersions;
107
106
  private emitInternal;
108
107
  private createRequestId;
109
108
  private isManagerEvent;
@@ -3363,10 +3363,32 @@ var FactAnswerFormatType = /* @__PURE__ */ ((FactAnswerFormatType2) => {
3363
3363
  var IAiqaSdk = class {
3364
3364
  };
3365
3365
 
3366
+ // src/utils/compareVersions.ts
3367
+ var splitVersion = (value2) => {
3368
+ const [core] = value2.split("-", 2);
3369
+ return core.split(".").map((part) => Number(part));
3370
+ };
3371
+ var compareVersions = (left, right) => {
3372
+ const leftParts = splitVersion(left);
3373
+ const rightParts = splitVersion(right);
3374
+ const maxLength = Math.max(leftParts.length, rightParts.length);
3375
+ for (let i2 = 0; i2 < maxLength; i2 += 1) {
3376
+ const l = leftParts[i2] ?? 0;
3377
+ const r = rightParts[i2] ?? 0;
3378
+ if (l > r) {
3379
+ return 1;
3380
+ }
3381
+ if (l < r) {
3382
+ return -1;
3383
+ }
3384
+ }
3385
+ return 0;
3386
+ };
3387
+
3366
3388
  // package.json
3367
3389
  var package_default = {
3368
3390
  name: "@aiqa/sdk",
3369
- version: "1.0.0-develop.2",
3391
+ version: "1.0.0-develop.3",
3370
3392
  main: "dist/node/node.js",
3371
3393
  module: "dist/node/node.js",
3372
3394
  types: "dist/node/node.d.ts",
@@ -3521,8 +3543,8 @@ var AiQaSdk = class {
3521
3543
  const minVersion = versionRange?.min;
3522
3544
  const maxVersion = versionRange?.max;
3523
3545
  if (minVersion || maxVersion) {
3524
- const tooLow = minVersion ? this.compareVersions(SDK_VERSION, minVersion) < 0 : false;
3525
- const tooHigh = maxVersion ? this.compareVersions(SDK_VERSION, maxVersion) > 0 : false;
3546
+ const tooLow = minVersion ? compareVersions(SDK_VERSION, minVersion) < 0 : false;
3547
+ const tooHigh = maxVersion ? compareVersions(SDK_VERSION, maxVersion) > 0 : false;
3526
3548
  if (tooLow || tooHigh) {
3527
3549
  const error = new Error(
3528
3550
  `SDK version ${SDK_VERSION} is not supported. Supported range: ${minVersion || "-"} to ${maxVersion || "-"}.`
@@ -3626,22 +3648,6 @@ var AiQaSdk = class {
3626
3648
  const result = await this.sendMessage("IS_RECORDING" /* IS_RECORDING */);
3627
3649
  return result && result.data !== void 0 ? result.data : result;
3628
3650
  }
3629
- compareVersions(left, right) {
3630
- const leftParts = left.split(".").map((part) => Number(part));
3631
- const rightParts = right.split(".").map((part) => Number(part));
3632
- const maxLength = Math.max(leftParts.length, rightParts.length);
3633
- for (let i2 = 0; i2 < maxLength; i2 += 1) {
3634
- const l = leftParts[i2] ?? 0;
3635
- const r = rightParts[i2] ?? 0;
3636
- if (l > r) {
3637
- return 1;
3638
- }
3639
- if (l < r) {
3640
- return -1;
3641
- }
3642
- }
3643
- return 0;
3644
- }
3645
3651
  emitInternal(name, ...args) {
3646
3652
  const handlers = this.internalListeners.get(name);
3647
3653
  if (!handlers) {