multicloud_rule_manager 1.1.70 → 1.1.72

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.
@@ -42,15 +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}`
49
- }
48
+ "Authorization": `Bearer ${access_token}`,
49
+ "Accept": "application/json"
50
+ },
51
+ redirect: "manual"
50
52
  }
51
53
  );
54
+
55
+ console.log(" Chiamo products"+argv.productName);
52
56
  const products = await safeJson(productsResp, "products");
53
57
 
58
+ console.log(" Chiamo products finita "+argv.productName);
54
59
  const product = products.find(p => p.name === argv.productName);
55
60
 
56
61
  if (!product) {
@@ -70,11 +75,13 @@ export default {
70
75
 
71
76
  const structResp = await fetch(
72
77
  `https://${cred.realm}.bit2win.cloud/api/data/v1/products_structure/`,
73
- {
78
+ {
74
79
  method: "GET",
75
80
  headers: {
76
- "Authorization": `Bearer ${access_token}`
77
- }
81
+ "Authorization": `Bearer ${access_token}`,
82
+ "Accept": "application/json"
83
+ },
84
+ redirect: "manual"
78
85
  }
79
86
  );
80
87
 
@@ -107,14 +114,16 @@ export default {
107
114
  const getFamilies = async (productId) => {
108
115
  const resp = await fetch(
109
116
  `https://${cred.realm}.bit2win.cloud/api/catalog/v1/products/${productId}/families`,
110
- {
111
- method: "GET",
112
- headers: {
113
- "Authorization": `Bearer ${access_token}`,
114
- "Accept": "application/json"
115
- }
116
- }
117
- );
117
+ {
118
+ method: "GET",
119
+ headers: {
120
+ "Authorization": `Bearer ${access_token}`,
121
+ "Accept": "application/json"
122
+ },
123
+ redirect: "manual"
124
+ }
125
+ );
126
+
118
127
 
119
128
  const data = await safeJson(resp, `families:${productId}`);
120
129
 
@@ -241,6 +250,7 @@ export default {
241
250
 
242
251
  async function safeJson(resp, label) {
243
252
  const text = await resp.text();
253
+ console.log("RAW products:", resp);
244
254
  console.log("RAW products:", text);
245
255
 
246
256
  if (!resp.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multicloud_rule_manager",
3
- "version": "1.1.70",
3
+ "version": "1.1.72",
4
4
  "description": "CLI interna per retrieve/upload con token",
5
5
  "main": "index.js",
6
6
  "type": "module",