qumra-engine 2.0.44 → 2.0.46

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.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loginController = void 0;
4
4
  const loginController = async (req, res) => {
5
5
  const { redirect_url, token } = req.query;
6
- console.log("🚀 ~ app.get ~ req.query:", req.query);
7
6
  if (!redirect_url || !token) {
8
7
  return res.status(400).send("Missing redirect_url or token");
9
8
  }
@@ -29,7 +29,6 @@ exports.default = new (class WidgetExtension {
29
29
  `);
30
30
  }
31
31
  const validated = (0, validateUiData_1.validateUiData)(data);
32
- console.log(validated);
33
32
  const rendered = env.render(filePath, {
34
33
  context: ctx.context,
35
34
  globals: ctx.globals,
@@ -15,32 +15,28 @@ const prepareDataMiddleware = (req, res, next) => {
15
15
  // }
16
16
  // }
17
17
  let themePath = "";
18
+ //{ themeVersionId: req.session.themeId }
19
+ const params = new URLSearchParams();
18
20
  if (req.session.themeId) {
19
- themePath = `?themeVersionId=${req.session.themeId}`;
21
+ params.set("themeVersionId", req.session.themeId);
20
22
  }
23
+ console.log(req.query);
24
+ if (req.query.appTheme) {
25
+ params.set("appTheme", req.query?.appTheme);
26
+ }
27
+ themePath = `?${params.toString()}`;
21
28
  const api = true
22
29
  ? `https://store-gate.qumra.cloud/render${themePath}`
23
30
  : `http://192.168.1.8:4019/v1/render${themePath}`;
24
- console.log(req.cookies);
25
- console.log({
26
- "Content-Type": "application/json",
27
- qdid: req.cookies.qdid || "",
28
- authorization: req.cookies.authorization || "",
29
- });
30
31
  const qdid = req.cookies.qdid || "";
31
32
  const Authorization = req.cookies.authorization || "";
32
- console.log({
33
- "Content-Type": "application/json",
34
- Authorization,
35
- "qdid": qdid,
36
- });
37
33
  axios_1.default
38
34
  .post(api, { url: parsedUrl.fullUrl }, // ← body مباشرة هنا
39
35
  {
40
36
  headers: {
41
37
  "Content-Type": "application/json",
42
38
  Authorization,
43
- "qdid": qdid,
39
+ qdid: qdid,
44
40
  },
45
41
  })
46
42
  .then((engineResponse) => {
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderMiddleware = void 0;
4
4
  const renderMiddleware = (req, res, next) => {
5
- const render = res.locals.render;
6
- console.log("🚀 ~ render:", render);
7
- const env = res.locals.env;
5
+ // const render = res.locals.render;
6
+ // const env = res.locals.env;
8
7
  // if (!render?.context?.page?.fileName) {
9
8
  // return next(
10
9
  // new Error("❌ Missing fileName in res.locals.render.context.page")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.44",
3
+ "version": "2.0.46",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {