multicloud_rule_manager 1.1.21 → 1.1.23
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/commands/retrieve.js +1 -7
- package/package.json +1 -1
- package/utils/ruleValidator.js +6 -1
package/commands/retrieve.js
CHANGED
|
@@ -30,8 +30,6 @@ export default {
|
|
|
30
30
|
const loginData = await loginResp.json(); // leggi direttamente JSON
|
|
31
31
|
const access_token = loginData.access_token;
|
|
32
32
|
|
|
33
|
-
console.log("🔹 Token response raw:", access_token);
|
|
34
|
-
|
|
35
33
|
if (!access_token) {
|
|
36
34
|
throw new Error("Token non ricevuto nel campo 'access_token'");
|
|
37
35
|
}
|
|
@@ -55,11 +53,7 @@ export default {
|
|
|
55
53
|
|
|
56
54
|
|
|
57
55
|
const data = await apiResp.json();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
console.log("🔹 API final URL:", data.url);
|
|
56
|
+
|
|
63
57
|
|
|
64
58
|
// Controlla che sia array
|
|
65
59
|
if (!Array.isArray(data)) {
|
package/package.json
CHANGED
package/utils/ruleValidator.js
CHANGED
|
@@ -2,7 +2,7 @@ import fs from "fs";
|
|
|
2
2
|
import esprima from "esprima";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
export function validateRule(
|
|
5
|
+
export function validateRule(fileNameWithId, content) {
|
|
6
6
|
const lines = content.split("\n");
|
|
7
7
|
let stack = [];
|
|
8
8
|
let hasWhen = false;
|
|
@@ -11,6 +11,11 @@ export function validateRule(fileName, content) {
|
|
|
11
11
|
let inThen = false;
|
|
12
12
|
let thenStack = [];
|
|
13
13
|
|
|
14
|
+
const match = fileNameWithId.match(/_(.+)\.js$/);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const fileName = match[0];
|
|
18
|
+
|
|
14
19
|
for (let i = 0; i < lines.length; i++) {
|
|
15
20
|
const line = lines[i];
|
|
16
21
|
|