@lcap/nasl 4.3.0-beta.26 → 4.3.0-beta.27

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.
@@ -394,12 +394,14 @@ declare namespace nasl.oql {
394
394
  export function MAX(value: nasl.core.DateTime): nasl.core.DateTime;
395
395
  export function MAX(value: nasl.core.Time): nasl.core.Time;
396
396
  export function MAX(value: nasl.core.Boolean): nasl.core.Boolean;
397
+ export function MAX(value: nasl.core.String): nasl.core.String;
397
398
  export function MIN(value: nasl.core.Long): nasl.core.Long;
398
399
  export function MIN(value: nasl.core.Decimal): nasl.core.Decimal;
399
400
  export function MIN(value: nasl.core.Date): nasl.core.Date;
400
401
  export function MIN(value: nasl.core.DateTime): nasl.core.DateTime;
401
402
  export function MIN(value: nasl.core.Time): nasl.core.Time;
402
403
  export function MIN(value: nasl.core.Boolean): nasl.core.Boolean;
404
+ export function MIN(value: nasl.core.String): nasl.core.String;
403
405
 
404
406
  // self
405
407
  export function STARTWITH(str1: nasl.core.String, str2: nasl.core.String): nasl.core.Boolean;
@@ -495,7 +497,7 @@ class NaslServer {
495
497
  profileMode: false,
496
498
  /**
497
499
  * 是否启用 TypeScript 语言服务
498
- * 默认关闭,使用 NASL 的OQL类型检查器,可以通过在 url 中添加 tss-enabled=true 来开启 tss
500
+ * 默认启用,可以通过在 url 中添加 oql-check=true 来关闭 tss,使用 NASL 的OQL类型检查器
499
501
  */
500
502
  tssEnabled: true,
501
503
  };
@@ -621,8 +623,18 @@ class NaslServer {
621
623
  });
622
624
  }
623
625
  }
626
+ synthesisFlagsFromUrl() {
627
+ if (!utils.isBrowser) {
628
+ return undefined;
629
+ }
630
+ const urlParams = new URLSearchParams(location.search);
631
+ const tssEnabled = urlParams.get('oql-check') === 'false';
632
+ return {
633
+ tssEnabled,
634
+ };
635
+ }
624
636
  async launch(opt) {
625
- const flags = opt.flags;
637
+ const flags = opt.flags ?? this.synthesisFlagsFromUrl();
626
638
  if (flags) {
627
639
  this.loadFlags(flags);
628
640
  }
@@ -3703,23 +3715,11 @@ class NaslServer {
3703
3715
  }
3704
3716
  processAllEvents(payloadList) {
3705
3717
  let changed = false;
3706
- const updatedNodesWithOldObject = new Map();
3707
3718
  for (const payload of payloadList) {
3708
- // 收集 oldObject,用于后续清理旧的引用关系
3709
- if (payload.action === 'update' && payload.oldObject) {
3710
- const targetNode = payload.target;
3711
- if (!(targetNode instanceof concepts_1.I18nInfo) && !this.isAnnotationMode) {
3712
- const targetNodeRaw = NaslServer.toRaw(targetNode);
3713
- updatedNodesWithOldObject.set(targetNodeRaw, {
3714
- oldObject: payload.oldObject,
3715
- field: payload.field
3716
- });
3717
- }
3718
- }
3719
3719
  const res = this.processSingleChangeEvent(payload);
3720
3720
  changed = changed || res;
3721
3721
  }
3722
- return { changed, updatedNodesWithOldObject };
3722
+ return { changed };
3723
3723
  }
3724
3724
  processSingleChangeEvent(payload) {
3725
3725
  const { action } = payload;
@@ -3805,7 +3805,7 @@ class NaslServer {
3805
3805
  this.changeStackList.length = 0;
3806
3806
  const { notifyEndWork } = this.notifyStartWork();
3807
3807
  try {
3808
- const { changed, updatedNodesWithOldObject } = this.processAllEvents(events);
3808
+ const { changed } = this.processAllEvents(events);
3809
3809
  if (changed) {
3810
3810
  this.logger.info('triggerTypeChecking 需要进行类型检查');
3811
3811
  const oqlCheckFiles = new Set((0, nasl_language_server_core_1.getOqlFiles)(this.semEnv, this.typerCheckFiles, this.typerRemoveNodes));
@@ -3825,8 +3825,7 @@ class NaslServer {
3825
3825
  createNodes: this.typerCreateNodes,
3826
3826
  tsDiagnostics,
3827
3827
  removedConnectors: this.removedConnectors,
3828
- checkedFiles: new Set(),
3829
- updatedNodesWithOldObject
3828
+ checkedFiles: new Set()
3830
3829
  });
3831
3830
  // 刷新左侧事件逻辑树
3832
3831
  this._refreshTreeViews();