@nasl/cli 0.2.0 → 0.2.2

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.
@@ -29056,7 +29056,7 @@ async function generateCompleteHeaders(options) {
29056
29056
  async function createAxios(options) {
29057
29057
  // 如果需要鉴权,拼接 /openapi/v3/nasl;否则使用原始 URL
29058
29058
  const serverBaseURL = new URL(options.serverBaseURL).origin;
29059
- const baseURL = options.useOPENAPI ? `${serverBaseURL}/openapi/v3/nasl` : `${serverBaseURL}/api/v1/nasl`;
29059
+ const baseURL = options.serverBaseURL.endsWith('app-ai-creator') ? options.serverBaseURL : options.useOPENAPI ? `${serverBaseURL}/openapi/v3/nasl` : `${serverBaseURL}/api/v1/nasl`;
29060
29060
  // 如果需要鉴权,生成完整的认证头;否则只使用基础 headers
29061
29061
  const headers = options.useOPENAPI ? await generateCompleteHeaders(options) : { 'Content-Type': 'application/json' };
29062
29062
  console.log('本次服务调用方为:', baseURL);
@@ -29069,7 +29069,7 @@ async function createAxios(options) {
29069
29069
  instance.post = async (url, data, config) => {
29070
29070
  return oldPost(url, data, config).then((res) => {
29071
29071
  const data = res.data;
29072
- if (data.code !== 200)
29072
+ if (data.code !== 200 && data.success !== true)
29073
29073
  throw new Error(JSON.stringify(data));
29074
29074
  return res;
29075
29075
  }).catch((err) => {
@@ -38166,7 +38166,7 @@ async function compile(entry, options) {
38166
38166
  logger.success(`所有文件已输出到: ${outDir}`);
38167
38167
  }
38168
38168
  catch (error) {
38169
- logger.error(`编译失败:\n${error.message}`);
38169
+ logger.error(`编译过程发生错误:\n${error.message}`);
38170
38170
  logger.exit(1);
38171
38171
  }
38172
38172
  return { config, outDir };
@@ -38182,7 +38182,7 @@ async function tryCompile(entry, options) {
38182
38182
  }
38183
38183
  }
38184
38184
 
38185
- var version = "0.2.0";
38185
+ var version = "0.2.2";
38186
38186
  var pkg = {
38187
38187
  version: version};
38188
38188