multicloud_rule_manager 1.1.78 → 1.1.80
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/retrieveproduct.js +2 -12
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ export default {
|
|
|
38
38
|
// --- SECONDA CHIAMATA: retrieve ---
|
|
39
39
|
console.log("🔹 Inizio richiesta dati API...");
|
|
40
40
|
const apiResp = await fetch(
|
|
41
|
-
`https://${cred.realm}.bit2win.cloud/api/data/v1/
|
|
41
|
+
`https://${cred.realm}.bit2win.cloud/api/data/v1/products`,
|
|
42
42
|
{
|
|
43
43
|
method: "GET",
|
|
44
44
|
headers: {
|
|
@@ -50,16 +50,6 @@ export default {
|
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const data = await apiResp;
|
|
56
|
-
|
|
57
|
-
console.log(" Chiamo products"+data);
|
|
58
|
-
// Controlla che sia array
|
|
59
|
-
console.log(" Chiamo products"+data.json());
|
|
60
|
-
if (!Array.isArray(data.json())) {
|
|
61
|
-
throw new Error("La risposta API non è una lista di oggetti");
|
|
62
|
-
}
|
|
63
53
|
|
|
64
54
|
console.log(" Chiamo products"+argv.productName);
|
|
65
55
|
const products = await safeJson(apiResp, "products");
|
|
@@ -83,7 +73,7 @@ export default {
|
|
|
83
73
|
console.log("Chiamo products structure");
|
|
84
74
|
|
|
85
75
|
const structResp = await fetch(
|
|
86
|
-
`https://${cred.realm}.bit2win.cloud/api/data/v1/products_structure
|
|
76
|
+
`https://${cred.realm}.bit2win.cloud/api/data/v1/products_structure`,
|
|
87
77
|
{
|
|
88
78
|
method: "GET",
|
|
89
79
|
headers: {
|