multicloud_rule_manager 1.1.69 → 1.1.71
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 +19 -13
- package/package.json +1 -1
|
@@ -42,16 +42,20 @@ export default {
|
|
|
42
42
|
console.log(" Chiamo products");
|
|
43
43
|
const productsResp = await fetch(
|
|
44
44
|
`https://${cred.realm}.bit2win.cloud/api/data/v1/products/`,
|
|
45
|
-
|
|
45
|
+
{
|
|
46
46
|
method: "GET",
|
|
47
47
|
headers: {
|
|
48
|
-
"Authorization": `Bearer ${access_token}
|
|
48
|
+
"Authorization": `Bearer ${access_token}`,
|
|
49
|
+
"Accept": "application/json"
|
|
49
50
|
},
|
|
50
51
|
redirect: "manual"
|
|
51
52
|
}
|
|
52
53
|
);
|
|
54
|
+
|
|
55
|
+
console.log(" Chiamo products"+argv.productName);
|
|
53
56
|
const products = await safeJson(productsResp, "products");
|
|
54
57
|
|
|
58
|
+
console.log(" Chiamo products finita "+argv.productName);
|
|
55
59
|
const product = products.find(p => p.name === argv.productName);
|
|
56
60
|
|
|
57
61
|
if (!product) {
|
|
@@ -71,10 +75,11 @@ export default {
|
|
|
71
75
|
|
|
72
76
|
const structResp = await fetch(
|
|
73
77
|
`https://${cred.realm}.bit2win.cloud/api/data/v1/products_structure/`,
|
|
74
|
-
|
|
78
|
+
{
|
|
75
79
|
method: "GET",
|
|
76
80
|
headers: {
|
|
77
|
-
"Authorization": `Bearer ${access_token}
|
|
81
|
+
"Authorization": `Bearer ${access_token}`,
|
|
82
|
+
"Accept": "application/json"
|
|
78
83
|
},
|
|
79
84
|
redirect: "manual"
|
|
80
85
|
}
|
|
@@ -109,15 +114,16 @@ export default {
|
|
|
109
114
|
const getFamilies = async (productId) => {
|
|
110
115
|
const resp = await fetch(
|
|
111
116
|
`https://${cred.realm}.bit2win.cloud/api/catalog/v1/products/${productId}/families`,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
{
|
|
118
|
+
method: "GET",
|
|
119
|
+
headers: {
|
|
120
|
+
"Authorization": `Bearer ${access_token}`,
|
|
121
|
+
"Accept": "application/json"
|
|
122
|
+
},
|
|
123
|
+
redirect: "manual"
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
|
|
121
127
|
|
|
122
128
|
const data = await safeJson(resp, `families:${productId}`);
|
|
123
129
|
|