multicloud_rule_manager 1.1.58 → 1.1.59
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/deploy.js +10 -8
- package/package.json +1 -1
package/commands/deploy.js
CHANGED
|
@@ -56,8 +56,6 @@ export default {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const guid = match[1];
|
|
59
|
-
const filename = file.substring(0, file.lastIndexOf("_"));
|
|
60
|
-
const startDate = new Date().toISOString().replace("Z", "000");
|
|
61
59
|
// --- POST API ---
|
|
62
60
|
try {
|
|
63
61
|
const resp = await fetch(`https://${cred.realm}.bit2win.cloud/api/data/v1/rules/${guid}`, {
|
|
@@ -68,12 +66,7 @@ export default {
|
|
|
68
66
|
},
|
|
69
67
|
body: JSON.stringify({
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
name: filename,
|
|
73
|
-
end_date: null,
|
|
74
|
-
agenda_group: "always",
|
|
75
|
-
status: "draft",
|
|
76
|
-
start_date: startDate,
|
|
69
|
+
|
|
77
70
|
dsl_internal: content
|
|
78
71
|
|
|
79
72
|
})
|
|
@@ -90,6 +83,8 @@ export default {
|
|
|
90
83
|
) {
|
|
91
84
|
console.warn(`⚠️ Rule ${guid} non trovata, provo creazione...`);
|
|
92
85
|
|
|
86
|
+
const filename = file.substring(0, file.lastIndexOf("_"));
|
|
87
|
+
const startDate = new Date().toISOString().replace("Z", "000");
|
|
93
88
|
const resp = await fetch(`https://${cred.realm}.bit2win.cloud/api/data/v1/rules`, {
|
|
94
89
|
method: "POST",
|
|
95
90
|
headers: {
|
|
@@ -98,6 +93,13 @@ export default {
|
|
|
98
93
|
},
|
|
99
94
|
body: JSON.stringify({
|
|
100
95
|
|
|
96
|
+
|
|
97
|
+
context: "catalog",
|
|
98
|
+
name: filename,
|
|
99
|
+
end_date: null,
|
|
100
|
+
agenda_group: "always",
|
|
101
|
+
status: "draft",
|
|
102
|
+
start_date: startDate,
|
|
101
103
|
dsl_internal: content
|
|
102
104
|
})
|
|
103
105
|
});
|