@datapos/datapos-development 0.3.117 → 0.3.119
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/dist/datapos-development.es.js +15 -15
- package/package.json +1 -1
|
@@ -110,43 +110,43 @@ async function D() {
|
|
|
110
110
|
console.error("Error updating README:", i), process.exit(1);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
async function
|
|
113
|
+
async function M() {
|
|
114
114
|
const o = "<!-- OWASP_BADGE_START -->", e = "<!-- OWASP_BADGE_END -->";
|
|
115
115
|
try {
|
|
116
|
-
const i = JSON.parse(await t.readFile("./dependency-check-reports/dependency-check-report.json", "utf-8")), n = { critical: 0, high: 0, moderate: 0, low: 0,
|
|
116
|
+
const i = JSON.parse(await t.readFile("./dependency-check-reports/dependency-check-report.json", "utf-8")), n = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
117
117
|
for (const u of i.dependencies)
|
|
118
118
|
if (u.vulnerabilities != null)
|
|
119
|
-
for (const
|
|
120
|
-
const
|
|
121
|
-
|
|
119
|
+
for (const g of u.vulnerabilities) {
|
|
120
|
+
const m = g.severity?.toLowerCase() ?? "unknown";
|
|
121
|
+
m in n ? n[m]++ : n.unknown++;
|
|
122
122
|
}
|
|
123
123
|
const s = {
|
|
124
124
|
critical: { color: "red", label: "Critical" },
|
|
125
125
|
high: { color: "orange", label: "High" },
|
|
126
126
|
moderate: { color: "yellow", label: "Moderate" },
|
|
127
127
|
low: { color: "green", label: "Low" },
|
|
128
|
-
info: { color: "brightgreen", label: "Info" },
|
|
129
128
|
unknown: { color: "lightgrey", label: "Unknown" }
|
|
130
129
|
}, r = [];
|
|
131
|
-
for (const [u,
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
for (const [u, g] of Object.entries(n)) {
|
|
131
|
+
if (g === 0) continue;
|
|
132
|
+
const m = s[u], y = `https://img.shields.io/badge/OWASP%20${m.label}-${g}-${m.color}`;
|
|
133
|
+
r.push(`[](./dependency-check-reports/dependency-check-report.html)`);
|
|
134
134
|
}
|
|
135
|
-
const d = Object.values(n).reduce((u,
|
|
135
|
+
const d = Object.values(n).reduce((u, g) => u + g, 0);
|
|
136
136
|
console.info(`✅ Total vulnerabilities found: ${d}`), console.info(
|
|
137
|
-
` Critical: ${n.critical}, High: ${n.high}, Moderate: ${n.moderate}, Low: ${n.low},
|
|
137
|
+
` Critical: ${n.critical}, High: ${n.high}, Moderate: ${n.moderate}, Low: ${n.low}, Unknown: ${n.unknown}`
|
|
138
138
|
);
|
|
139
139
|
const a = await t.readFile("./README.md", "utf8"), c = a.indexOf(o), l = a.indexOf(e);
|
|
140
140
|
(c === -1 || l === -1) && (console.error("❌ Markers not found in README.md."), process.exit(1));
|
|
141
141
|
const f = r.join(" "), p = a.substring(0, c + o.length) + `
|
|
142
142
|
` + f + `
|
|
143
143
|
` + a.substring(l);
|
|
144
|
-
await t.writeFile("
|
|
144
|
+
await t.writeFile("README.md", p, "utf8"), console.info("✅ OWASP dependency check badges inserted into README.md");
|
|
145
145
|
} catch (i) {
|
|
146
146
|
console.error("❌ Error updating README with OWASP badges:", i), process.exit(1);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
async function
|
|
149
|
+
async function I() {
|
|
150
150
|
try {
|
|
151
151
|
console.info("🚀 Sending deployment notice...");
|
|
152
152
|
const o = JSON.parse(await t.readFile("config.json", "utf8")), e = {
|
|
@@ -235,8 +235,8 @@ export {
|
|
|
235
235
|
A as bumpVersion,
|
|
236
236
|
F as echoScriptNotImplemented,
|
|
237
237
|
D as insertLicensesIntoReadme,
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
M as insertOWASPDependencyCheckBadgeIntoReadme,
|
|
239
|
+
I as sendDeploymentNotice,
|
|
240
240
|
P as syncWithGitHub,
|
|
241
241
|
T as uploadDirectoryToR2,
|
|
242
242
|
_ as uploadModuleConfigToDO,
|
package/package.json
CHANGED