@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.
- package/dist/bin/nasl.mjs +13 -10
- package/dist/bin/nasl.mjs.map +1 -1
- package/dist/bin/naslc.mjs +4 -4
- package/dist/bin/naslc.mjs.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/out/apis/compileApi.d.ts.map +1 -1
- package/out/apis/compileApi.js +3 -2
- package/out/apis/compileApi.js.map +1 -1
- package/out/apis/createAxios.js +2 -2
- package/out/apis/createAxios.js.map +1 -1
- package/out/bin/nasl.js +2 -2
- package/out/bin/nasl.js.map +1 -1
- package/out/commands/check.d.ts.map +1 -1
- package/out/commands/check.js +2 -0
- package/out/commands/check.js.map +1 -1
- package/out/commands/compile.js +1 -1
- package/out/commands/compile.js.map +1 -1
- package/out/commands/createAppInIde.js +2 -2
- package/out/commands/createAppInIde.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/naslc.mjs
CHANGED
|
@@ -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(
|
|
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.
|
|
38185
|
+
var version = "0.2.2";
|
|
38186
38186
|
var pkg = {
|
|
38187
38187
|
version: version};
|
|
38188
38188
|
|