qumra-engine 2.0.56 → 2.0.58
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.
|
@@ -18,8 +18,11 @@ const prepareDataMiddleware = (req, res, next) => {
|
|
|
18
18
|
//{ themeVersionId: req.session.themeId }
|
|
19
19
|
let themePath = "";
|
|
20
20
|
const params = new URLSearchParams();
|
|
21
|
-
if (req.session?.
|
|
22
|
-
params.set("
|
|
21
|
+
if (req.session?.theme) {
|
|
22
|
+
params.set("theme", req.session.theme);
|
|
23
|
+
}
|
|
24
|
+
if (req.query?.theme) {
|
|
25
|
+
params.set("theme", String(req.query.theme));
|
|
23
26
|
}
|
|
24
27
|
if (req.query?.appTheme) {
|
|
25
28
|
params.set("appTheme", String(req.query.appTheme));
|
package/dist/middleware.js
CHANGED
|
@@ -38,12 +38,12 @@ const startEngine = async ({ mode, getRender, setRender, port = 3000, themesRepo
|
|
|
38
38
|
}));
|
|
39
39
|
app.use((req, res, next) => {
|
|
40
40
|
if (req.query.theme) {
|
|
41
|
-
req.session.
|
|
41
|
+
req.session.theme = req.query.theme;
|
|
42
42
|
return res.redirect("/");
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
if (themeId) {
|
|
46
|
-
req.session.
|
|
46
|
+
req.session.theme = themeId;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
next();
|
|
@@ -11,6 +11,9 @@ function printServerLog({ port, themeId, app }) {
|
|
|
11
11
|
if (app) {
|
|
12
12
|
console.log('🌍 Theme URL =>', cyan(`${app?.url}?theme=${themeId}`));
|
|
13
13
|
}
|
|
14
|
+
if (app) {
|
|
15
|
+
console.log(' 📦 Customize Theme =>', cyan(`https://app.qumra.cloud/store/${app.subdomain}/themes/${themeId}`));
|
|
16
|
+
}
|
|
14
17
|
// console.log('📦 Builder ID =>', yellow(`https://qumra.cloud/store/test/themes/${themeId}`));
|
|
15
18
|
console.log('');
|
|
16
19
|
}
|
|
@@ -14,7 +14,17 @@ function validateUiData(data) {
|
|
|
14
14
|
for (const [key, value] of Object.entries(item)) {
|
|
15
15
|
if (value === true)
|
|
16
16
|
continue; // استبعاد مثل __keywords: true
|
|
17
|
-
|
|
17
|
+
// دعم الأنواع المسموح بها
|
|
18
|
+
if (typeof value === "string" ||
|
|
19
|
+
typeof value === "number" ||
|
|
20
|
+
typeof value === "boolean" ||
|
|
21
|
+
Array.isArray(value) ||
|
|
22
|
+
(typeof value === "object" && value !== null)) {
|
|
23
|
+
result[key] = value;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw new Error(`❌ نوع قيمة غير مدعوم في المفتاح "${key}": ${JSON.stringify(value)}`);
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
}
|
|
20
30
|
else {
|