multicloud_rule_manager 1.0.37 → 1.0.39

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.
@@ -40,25 +40,27 @@ export default {
40
40
 
41
41
  // --- SECONDA CHIAMATA: retrieve ---
42
42
  console.log("🔹 Inizio richiesta dati API...");
43
- const apiResp = await fetch(
44
- `https://${cred.realm}.cloud/api/data/v1/rules`,
45
- {
46
- method: "GET",
47
- headers: {
48
- "Authorization": `Bearer ${access_token}`,
49
- "Accept": "application/json"
50
- },
51
- redirect: "manual"
52
- }
53
- );
43
+ const apiResp = await fetch(
44
+ `https://${cred.realm}.cloud/api/data/v1/rules`,
45
+ {
46
+ method: "GET",
47
+ headers: {
48
+ "Authorization": `Bearer ${access_token}`,
49
+ "Accept": "application/json"
50
+ },
51
+ redirect: "manual"
52
+ }
53
+ );
54
54
 
55
- const data = await apiResp.json();
56
- console.log("🔹 API status:", data.status);
55
+ if (!apiResp.ok) {
56
+ const errText = await apiResp.text();
57
+ throw new Error(`Errore API ${apiResp.status}: ${errText}`);
58
+ }
57
59
 
58
- if (!data.ok) {
59
- const errText = await data.text();
60
- throw new Error(`Errore API ${data.status}: ${errText}`);
61
- }
60
+ const data = await apiResp.json();
61
+ console.log("🔹 API status:", apiResp.status);
62
+
63
+
62
64
 
63
65
  console.log("🔹 API final URL:", data.url);
64
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multicloud_rule_manager",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "CLI interna per retrieve/upload con token",
5
5
  "main": "index.js",
6
6
  "type": "module",