multicloud_rule_manager 1.0.13 → 1.0.15
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 +8 -16
- package/package.json +1 -1
package/commands/retrieve.js
CHANGED
|
@@ -27,18 +27,14 @@ export default {
|
|
|
27
27
|
})
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
console.log("🔹 Token response raw:", loginText);
|
|
30
|
+
const loginData = await loginResp.json(); // leggi direttamente JSON
|
|
31
|
+
const access_token = loginData.access_token;
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} catch (err) {
|
|
40
|
-
throw new Error(`Token JSON parsing failed: ${err.message}`);
|
|
41
|
-
}
|
|
33
|
+
console.log("🔹 Token response raw:", access_token);
|
|
34
|
+
|
|
35
|
+
if (!access_token) {
|
|
36
|
+
throw new Error("Token non ricevuto nel campo 'access_token'");
|
|
37
|
+
}
|
|
42
38
|
|
|
43
39
|
|
|
44
40
|
|
|
@@ -47,11 +43,7 @@ export default {
|
|
|
47
43
|
const apiResp = await fetch(`https://eon-dev-01.bit2win.cloud/api/data/v1/rules/`, { // usa dominio fisso
|
|
48
44
|
method: "GET",
|
|
49
45
|
headers: {
|
|
50
|
-
Authorization: `Bearer ${access_token}
|
|
51
|
-
Accept: "*/*",
|
|
52
|
-
"User-Agent": "PostmanRuntime/7.51.1",
|
|
53
|
-
"Accept-Encoding": "gzip, deflate, br",
|
|
54
|
-
Connection: "keep-alive"
|
|
46
|
+
Authorization: `Bearer ${access_token}`
|
|
55
47
|
}
|
|
56
48
|
});
|
|
57
49
|
|