isite 2024.10.1 → 2024.10.3

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.
Files changed (47) hide show
  1. package/README.md +7 -7
  2. package/apps/charts/site_files/html/PieChart.html +1 -1
  3. package/apps/charts/site_files/html/PieChart2.html +1 -1
  4. package/apps/charts/site_files/html/XYChart.html +1 -1
  5. package/apps/charts/site_files/html/column.html +1 -1
  6. package/apps/charts/site_files/html/gauge.html +1 -1
  7. package/apps/charts/site_files/html/index.html +1 -1
  8. package/apps/charts/site_files/html/line-graph.html +1 -1
  9. package/apps/charts/site_files/html/pie-chart-rounded-corners.html +1 -1
  10. package/apps/charts/site_files/html/simple-3D-pie-chart.html +1 -1
  11. package/apps/client-side/README.md +2 -2
  12. package/apps/client-side/site_files/css/form.css +1 -0
  13. package/apps/client-side/site_files/html/require_features.html +1 -1
  14. package/apps/client-side/site_files/html/require_payments.html +1 -1
  15. package/apps/client-side/site_files/html/require_permissions.html +1 -1
  16. package/apps/client-side/site_files/html/words-old.html +1 -1
  17. package/apps/client-side/site_files/html/words.html +1 -3
  18. package/apps/client-side/site_files/js/WebShareEditor.js +1 -1
  19. package/apps/client-side/site_files/js/bootstrap-5-directive.js +4 -4
  20. package/apps/client-side/site_files/js/bootstrap-5-directive.min.js +1 -1
  21. package/apps/client-side/site_files/js/site.js +0 -4
  22. package/apps/client-side/site_files/js/site.min.js +1 -1
  23. package/apps/client-side/site_files/js/video.min.js +2 -2
  24. package/apps/security/site_files/html/add_modal.html +1 -1
  25. package/apps/security/site_files/html/content.html +1 -1
  26. package/apps/security/site_files/html/index.html +1 -1
  27. package/apps/security/site_files/html/navbar.html +2 -2
  28. package/apps/security/site_files/html/view.html +2 -2
  29. package/apps/security/site_files/js/navbar.js +1 -1
  30. package/apps/security/site_files/json/permissions.json +6 -6
  31. package/apps/security/site_files/json/roles.json +8 -8
  32. package/apps/security/site_files/json/words.json +27 -27
  33. package/apps/ui-print/site_files/html/content.html +1 -1
  34. package/apps/ui-print/site_files/html/image.html +1 -1
  35. package/apps/ui-print/site_files/html/index.html +1 -1
  36. package/apps/ui-print/site_files/html/svg.html +1 -1
  37. package/isite_files/css/custom.css +2 -0
  38. package/isite_files/html/index.html +1 -1
  39. package/lib/dashboard.js +1 -1
  40. package/lib/mongodb.js +56 -215
  41. package/lib/routing.js +27 -25
  42. package/lib/security.js +7 -7
  43. package/lib/session.js +1 -1
  44. package/lib/sessions.js +12 -8
  45. package/object-options/index.js +1 -1
  46. package/object-options/plugins/file-manager/site-files/html/index.html +1 -1
  47. package/package.json +1 -1
package/lib/routing.js CHANGED
@@ -192,7 +192,7 @@ module.exports = function init(____0) {
192
192
  if ((response = ____0.sharedList.find((s) => s.host == req.host && s.filePath == route.path && s.url == req.url))) {
193
193
  res.headers = response.headers;
194
194
  res.code = response.code;
195
- res.set('x-shared', '-host=' + req.host + ' -port=' + ____0.options.port + ' -index=' + ____0.sharedList.length + ' -count=' + route.count);
195
+ res.set('x-shared', '-host=' + req.host + ' -port=' + ____0.options.port + ' -index=' + ____0.sharedList.length + ' -count=' + req.route.count);
196
196
  return res.end(response.content, response.encode);
197
197
  }
198
198
 
@@ -375,6 +375,7 @@ module.exports = function init(____0) {
375
375
  route.path = null;
376
376
  route.parser = 'static';
377
377
  route.parserDir = ____0.dir;
378
+ route.count = 0;
378
379
  route.cache = !0;
379
380
  route.hide = !1;
380
381
  route.compress = !1;
@@ -407,6 +408,7 @@ module.exports = function init(____0) {
407
408
  route.masterPage = r.masterPage || null;
408
409
  route.overwrite = r.overwrite ?? !1;
409
410
  route.cache = r.cache ?? !0;
411
+ route.count = r.count || 0;
410
412
  route.hide = r.hide ?? !1;
411
413
  route.compress = r.compress ?? !1;
412
414
  route.encript = r.encript ?? !1;
@@ -952,114 +954,114 @@ module.exports = function init(____0) {
952
954
 
953
955
  req.content = content;
954
956
  req.data = { ...req.data, ..._data };
955
- req.route = { ...req.route, ...options };
957
+ let route = { ...req.route, ...options };
956
958
 
957
- if (req.route.encript == '123') {
959
+ if (route.encript == '123') {
958
960
  req.content = ____0.f1(req.content);
959
961
  }
960
962
 
961
- if (req.route.parser) {
962
- req.content = ____0.parser(req, res, ____0, req.route).html(req.content);
963
+ if (route.parser) {
964
+ req.content = ____0.parser(req, res, ____0, route).html(req.content);
963
965
  }
964
966
 
965
- if (req.route.compress) {
967
+ if (route.compress) {
966
968
  req.content = req.content.replace(/\r?\n|\r/g, ' ').replace(/\s+/g, ' ');
967
969
  }
968
970
 
969
971
  res.status(options.code || 200);
970
972
  if (filePath.endsWith('.css')) {
971
973
  res.set(____0.strings[7], 'text/css');
972
- if (____0.options.cache.enabled && req.route.cache) {
974
+ if (____0.options.cache.enabled && route.cache) {
973
975
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.css);
974
976
  }
975
977
  } else if (filePath.endsWith('.js')) {
976
978
  res.set(____0.strings[7], 'application/javascript');
977
- if (____0.options.cache.enabled && req.route.cache) {
979
+ if (____0.options.cache.enabled && route.cache) {
978
980
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.js);
979
981
  }
980
982
  } else if (filePath.endsWith('.html')) {
981
983
  res.set(____0.strings[7], 'text/html');
982
- if (____0.options.cache.enabled && req.route.cache) {
984
+ if (____0.options.cache.enabled && route.cache) {
983
985
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.html);
984
986
  }
985
987
  } else if (filePath.endsWith('.txt')) {
986
988
  res.set(____0.strings[7], 'text/plain');
987
- if (____0.options.cache.enabled && req.route.cache) {
989
+ if (____0.options.cache.enabled && route.cache) {
988
990
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.txt);
989
991
  }
990
992
  } else if (filePath.endsWith('.json')) {
991
993
  res.set(____0.strings[7], 'application/json');
992
- if (____0.options.cache.enabled && req.route.cache) {
994
+ if (____0.options.cache.enabled && route.cache) {
993
995
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.json);
994
996
  }
995
997
  } else if (filePath.endsWith('.xml')) {
996
998
  res.set(____0.strings[7], 'text/xml');
997
- if (____0.options.cache.enabled && req.route.cache) {
999
+ if (____0.options.cache.enabled && route.cache) {
998
1000
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.xml);
999
1001
  }
1000
1002
  } else if (filePath.endsWith('.woff2')) {
1001
1003
  res.set(____0.strings[7], 'application/font-woff2');
1002
- if (____0.options.cache.enabled && req.route.cache) {
1004
+ if (____0.options.cache.enabled && route.cache) {
1003
1005
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
1004
1006
  }
1005
1007
  } else if (filePath.endsWith('.woff')) {
1006
1008
  res.set(____0.strings[7], 'application/font-woff');
1007
- if (____0.options.cache.enabled && req.route.cache) {
1009
+ if (____0.options.cache.enabled && route.cache) {
1008
1010
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
1009
1011
  }
1010
1012
  } else if (filePath.endsWith('.ttf')) {
1011
1013
  res.set(____0.strings[7], 'application/font-ttf');
1012
- if (____0.options.cache.enabled && req.route.cache) {
1014
+ if (____0.options.cache.enabled && route.cache) {
1013
1015
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
1014
1016
  }
1015
1017
  } else if (filePath.endsWith('.svg')) {
1016
1018
  res.set(____0.strings[7], 'application/font-svg');
1017
- if (____0.options.cache.enabled && req.route.cache) {
1019
+ if (____0.options.cache.enabled && route.cache) {
1018
1020
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
1019
1021
  }
1020
1022
  } else if (filePath.endsWith('.otf')) {
1021
1023
  res.set(____0.strings[7], 'application/font-otf');
1022
- if (____0.options.cache.enabled && req.route.cache) {
1024
+ if (____0.options.cache.enabled && route.cache) {
1023
1025
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
1024
1026
  }
1025
1027
  } else if (filePath.endsWith('.eot')) {
1026
1028
  res.set(____0.strings[7], 'application/font-eot');
1027
- if (____0.options.cache.enabled && req.route.cache) {
1029
+ if (____0.options.cache.enabled && route.cache) {
1028
1030
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
1029
1031
  }
1030
1032
  } else if (filePath.endsWith('.gif')) {
1031
1033
  res.set(____0.strings[7], 'image/gif');
1032
- if (____0.options.cache.enabled && req.route.cache) {
1034
+ if (____0.options.cache.enabled && route.cache) {
1033
1035
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1034
1036
  }
1035
1037
  } else if (filePath.endsWith('.png')) {
1036
1038
  res.set(____0.strings[7], 'image/png');
1037
- if (____0.options.cache.enabled && req.route.cache) {
1039
+ if (____0.options.cache.enabled && route.cache) {
1038
1040
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1039
1041
  }
1040
1042
  } else if (filePath.endsWith('.jpg')) {
1041
1043
  res.set(____0.strings[7], 'image/jpg');
1042
- if (____0.options.cache.enabled && req.route.cache) {
1044
+ if (____0.options.cache.enabled && route.cache) {
1043
1045
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1044
1046
  }
1045
1047
  } else if (filePath.endsWith('.jpeg')) {
1046
1048
  res.set(____0.strings[7], 'image/jpeg');
1047
- if (____0.options.cache.enabled && req.route.cache) {
1049
+ if (____0.options.cache.enabled && route.cache) {
1048
1050
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1049
1051
  }
1050
1052
  } else if (filePath.endsWith('.ico')) {
1051
1053
  res.set(____0.strings[7], 'image/ico');
1052
- if (____0.options.cache.enabled && req.route.cache) {
1054
+ if (____0.options.cache.enabled && route.cache) {
1053
1055
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1054
1056
  }
1055
1057
  } else if (filePath.endsWith('.bmp')) {
1056
1058
  res.set(____0.strings[7], 'image/bmp');
1057
- if (____0.options.cache.enabled && req.route.cache) {
1059
+ if (____0.options.cache.enabled && route.cache) {
1058
1060
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1059
1061
  }
1060
1062
  } else if (filePath.endsWith('.webp')) {
1061
1063
  res.set(____0.strings[7], 'image/webp');
1062
- if (____0.options.cache.enabled && req.route.cache) {
1064
+ if (____0.options.cache.enabled && route.cache) {
1063
1065
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1064
1066
  }
1065
1067
  }
package/lib/security.js CHANGED
@@ -491,7 +491,6 @@ module.exports = function init(____0) {
491
491
  $req.session.user = _user;
492
492
  $req.session.user_id = _user.id;
493
493
  $req.session.$save();
494
-
495
494
  }
496
495
  callback(null, _user);
497
496
  ____0.call('user login', {
@@ -520,7 +519,6 @@ module.exports = function init(____0) {
520
519
  $req.session.user = doc;
521
520
  $req.session.user_id = doc.id;
522
521
  $req.session.$save();
523
-
524
522
  }
525
523
 
526
524
  callback(null, doc);
@@ -586,7 +584,6 @@ module.exports = function init(____0) {
586
584
  $req.session.user = doc;
587
585
  $req.session.user_id = doc.id;
588
586
  $req.session.$save();
589
-
590
587
  }
591
588
  ____0.call('user register', {
592
589
  db: ____0.$users.db,
@@ -610,22 +607,25 @@ module.exports = function init(____0) {
610
607
 
611
608
  if (security.isUserLogin(req, res)) {
612
609
  let _user = req.session.user;
613
-
614
610
 
615
611
  ____0.call('user logout', {
616
612
  db: ____0.$users.db,
617
613
  collection: ____0.$users.collection,
618
614
  doc: _user,
619
- $res: res,
620
- $req: req,
621
615
  });
622
616
  }
623
617
 
624
- delete req.session.user;
618
+ req.session.user = null;
619
+ req.session.user_id = null;
620
+ req.session.$save();
621
+
625
622
  req.session.accessToken = req.host + new Date().getTime().toString() + '_' + Math.random();
626
623
  req.session.accessToken = ____0.x0md50x(req.session.accessToken);
624
+ req.session.$save();
625
+
627
626
  res.set('Access-Token', req.session.accessToken);
628
627
  res.cookie('access_token', req.session.accessToken);
628
+
629
629
  callback(null, !0);
630
630
  };
631
631
 
package/lib/session.js CHANGED
@@ -123,7 +123,7 @@ module.exports = function init(req, res, ____0, callback) {
123
123
 
124
124
  AssignFeatures();
125
125
 
126
- if (____0.security && session.user_id) {
126
+ if (____0.security && session.user_id ) {
127
127
  ____0.security.getUser(
128
128
  {
129
129
  id: session.user_id,
package/lib/sessions.js CHANGED
@@ -36,9 +36,8 @@ module.exports = function init(____0) {
36
36
  sessions.list = sessions.list.filter((s) => s && new Date().getTime() - s.createdTime < 1000 * 60 * ____0.options.session.timeout);
37
37
  sessions.list = sessions.list.filter((s) => s && new Date().getTime() - s.$time < 1000 * 60 * ____0.options.session.memoryTimeout);
38
38
 
39
- if (____0.options.session.storage === 'mongodb') {
39
+ if (____0.options.session.enabled && ____0.options.session.storage === 'mongodb') {
40
40
  sessions.$collection.deleteAll({ createdTime: { $lt: new Date().getTime() - 1000 * 60 * ____0.options.session.timeout } });
41
- sessions.$collection.deleteAll({ where: { createdTime: { $exists: false } } });
42
41
  }
43
42
  };
44
43
 
@@ -96,6 +95,7 @@ module.exports = function init(____0) {
96
95
  sessions.list[index].$time = new Date().getTime();
97
96
  sessions.list[index].requestesCount++;
98
97
  sessions.list[index].language = sessions.list[index].language || ____0.options.language;
98
+ sessions.list[index].lang = sessions.list[index].language.id;
99
99
  callback(sessions.list[index]);
100
100
  } else {
101
101
  if (____0.options.session.storage === 'mongodb') {
@@ -105,13 +105,17 @@ module.exports = function init(____0) {
105
105
  if (!err && doc) {
106
106
  doc.$time = new Date().getTime();
107
107
  doc.requestesCount++;
108
- doc.language = doc.language || ____0.options.language;
108
+ if (!doc.language || !doc.language.id) {
109
+ doc.language = ____0.options.language;
110
+ }
111
+
112
+ doc.lang = doc.language.id;
109
113
  sessions.list.push(doc);
110
114
  callback(sessions.list[sessions.list.findIndex((s) => s.accessToken == session.accessToken)]);
111
115
  } else {
112
116
  session.$new = !0;
113
117
  session.language = ____0.options.language;
114
- session.lang = ____0.options.language.id;
118
+ session.lang = session.language.id;
115
119
  session.theme = ____0.options.theme;
116
120
  session.data = [];
117
121
  session.requestesCount = 1;
@@ -126,7 +130,7 @@ module.exports = function init(____0) {
126
130
  } else {
127
131
  session.$new = !0;
128
132
  session.language = ____0.options.language;
129
- session.lang = ____0.options.language.id;
133
+ session.lang = session.language.id;
130
134
  session.theme = ____0.options.theme;
131
135
  session.data = [];
132
136
  session.requestesCount = 1;
@@ -139,7 +143,7 @@ module.exports = function init(____0) {
139
143
  } else {
140
144
  session.$new = !0;
141
145
  session.language = ____0.options.language;
142
- session.lang = ____0.options.language.id;
146
+ session.lang = session.language.id;
143
147
  session.theme = ____0.options.theme;
144
148
  session.data = [];
145
149
  session.requestesCount = 1;
@@ -165,12 +169,12 @@ module.exports = function init(____0) {
165
169
 
166
170
  ____0.onPOST({ name: '/x-language/change', public: true }, (req, res) => {
167
171
  req.session.language = req.data;
168
- req.session.lang = req.session.language?.id || req.data.name;
172
+ req.session.lang = req.session.language.id || req.data.name;
169
173
  req.session.langDir = req.session.language?.dir;
170
174
  req.session.$save();
171
175
  res.json({
172
176
  done: true,
173
- lang: req.data.name,
177
+ language: req.session.language,
174
178
  });
175
179
  });
176
180
 
@@ -39,7 +39,7 @@ function setOptions(_options, ____0) {
39
39
  _0x14xo: _0x14xo, // 3259376545129191
40
40
  _0xddxo: _0xddxo, // 421957684138766241719191
41
41
  log: !0,
42
- lang: 'en',
42
+ lang: 'En',
43
43
  language: { id: 'En', dir: 'ltr', text: 'left' },
44
44
  theme: 'default',
45
45
  public: false,
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
2
+ <html lang="En">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2024.10.01",
3
+ "version": "2024.10.03",
4
4
  "description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {