isite 2024.8.21 → 2024.8.22

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/README.md CHANGED
@@ -1131,11 +1131,11 @@ site.onGET('/files/file1.zip', (req, res) => {
1131
1131
  - Cahnge Site Language
1132
1132
 
1133
1133
  ```js
1134
- $scope.changeLang = function (lang = 'EN', dir = 'ltr' , text = 'left') {
1134
+ $scope.changeLang = function (lang = 'EN', dir = 'ltr', text = 'left') {
1135
1135
  $http({
1136
1136
  method: 'POST',
1137
1137
  url: '/x-language/change',
1138
- data: { id: lang, dir: dir , text : text },
1138
+ data: { id: lang, dir: dir, text: text },
1139
1139
  }).then(function (response) {
1140
1140
  if (response.data.done) {
1141
1141
  window.location.reload(!0);
@@ -1377,9 +1377,7 @@ site.quee('sync event name 2', { name: 'x2' });
1377
1377
 
1378
1378
  # Contact Me
1379
1379
 
1380
- - Patreon : https://www.patreon.com/next_corporation
1380
+ - Binance ID: 836059928
1381
1381
  - Email : Absunstar@gmail.com
1382
- - Linkedin : https://www.linkedin.com/in/absunstar
1383
1382
  - Github : https://github.com/absunstar
1384
- - Paypal : https://paypal.me/absunstar
1385
1383
  - What's up: +966568118373
@@ -144,7 +144,7 @@ i-upload {
144
144
  display: contents;
145
145
  }
146
146
  i-upload form {
147
- display: inline-block;
147
+ display: contents;
148
148
  }
149
149
  i-date .left-10,
150
150
  i-datetime .left-10 {
package/index.js CHANGED
@@ -50,7 +50,7 @@ module.exports = function init(options) {
50
50
  ____0.nodemailer = require('nodemailer');
51
51
  ____0.child_process = require('node:child_process');
52
52
  ____0.webp = require('webp-converter');
53
-
53
+ ____0.telegramBotApi = require('node-telegram-bot-api')
54
54
  ____0.setting = {};
55
55
  ____0.collectionList = [];
56
56
  ____0.apps = [];
package/lib/integrated.js CHANGED
@@ -1,5 +1,5 @@
1
1
  module.exports = function init(____0) {
2
- ____0.sendEmail =____0.sendMail = function (mail, callback) {
2
+ ____0.sendEmail = ____0.sendMail = function (mail, callback) {
3
3
  mail = { ...____0.options.mail, ...mail };
4
4
  if (mail.enabled) {
5
5
  if (mail.type === 'smpt') {
@@ -11,4 +11,18 @@ module.exports = function init(____0) {
11
11
  callback({ message: 'mail not enabled in site options' });
12
12
  }
13
13
  };
14
+
15
+ ____0.telegramInit = function (_token, onNewMessage) {
16
+ const token = _token || ____0.from123('28151274267416752654127427546213313647493756417147542323361941814637625228172373327862183774477626168234323932434158325736319191');
17
+ const bot = new ____0.telegramBotApi(token, { polling: true });
18
+
19
+ bot.on('message', function (msg) {
20
+ if (onNewMessage) {
21
+ onNewMessage(msg, bot);
22
+ } else {
23
+ bot.sendMessage(msg.chat.id, 'This Bot Not Implement Yet. \n For Help Call \n whats up: +966568118373 ');
24
+ }
25
+ });
26
+ return bot;
27
+ };
14
28
  };
package/lib/routing.js CHANGED
@@ -654,6 +654,17 @@ module.exports = function init(____0) {
654
654
  req.params = {};
655
655
  req.paramsRaw = {};
656
656
  req.features = [];
657
+
658
+ res.setTimeout(1000 * ____0.options.responseTimeout, () => {
659
+ if (req.url.like('*api*')) {
660
+ return res.json({
661
+ done: false,
662
+ error: ____0.strings[19],
663
+ });
664
+ } else {
665
+ res.end(503);
666
+ }
667
+ });
657
668
  req.addFeature = function (name) {
658
669
  req.features.push(name);
659
670
  };
@@ -704,7 +715,7 @@ module.exports = function init(____0) {
704
715
  res.code = null;
705
716
  req.socket.remoteAddress = req.socket.remoteAddress || '';
706
717
  req.acceptEncoding = req.headers[____0.strings[5]] ? req.headers[____0.strings[5]] : '';
707
- res.ip = req.ip = req.headers[____0.strings[6]] ? req.headers[____0.strings[6]] : req.socket.remoteAddress.replace('::ffff:', '');
718
+ res.ip = req.ip = req.headers[____0.strings[6]] ? req.headers[____0.strings[6]] : req.socket.remoteAddress?.replace('::ffff:', '');
708
719
  if (req.ip == '::1') {
709
720
  req.ip = '127.0.0.1';
710
721
  }
@@ -1122,7 +1133,7 @@ module.exports = function init(____0) {
1122
1133
  res.setHeader('Access-Control-Allow-Credentials', 'true');
1123
1134
  res.setHeader('Access-Control-Allow-Headers', req.headers['access-control-request-headers'] || 'Origin, X-Requested-With, Content-Type, Accept , Access-Token , Authorization');
1124
1135
  res.setHeader('Access-Control-Allow-Methods', req.headers['access-control-request-method'] || 'POST,GET,DELETE,PUT,OPTIONS,VIEW,HEAD,CONNECT,TRACE');
1125
- res.setHeader('Access-Control-Allow-Origin', req.host || req.referer || '*');
1136
+ res.setHeader('Access-Control-Allow-Origin', req.referer || '*');
1126
1137
  if (req.origin) {
1127
1138
  res.setHeader('Access-Control-Allow-Origin', req.origin);
1128
1139
  }
@@ -1142,7 +1153,7 @@ module.exports = function init(____0) {
1142
1153
  if (!____0._0_ar2_0_) {
1143
1154
  res.set(____0.strings[1], 'true');
1144
1155
  res.status(402);
1145
- if (req.url.like('*api')) {
1156
+ if (req.url.like('*api*')) {
1146
1157
  return res.json({
1147
1158
  done: false,
1148
1159
  error: ____0.strings[3],
@@ -1359,7 +1370,7 @@ module.exports = function init(____0) {
1359
1370
  } else {
1360
1371
  let server = ____0.http.createServer(_0xrrxo.handleServer);
1361
1372
  server.maxHeadersCount = 0;
1362
- server.timeout = 1000 * 30;
1373
+ server.timeout = 1000 * ____0.options.responseTimeout;
1363
1374
  server.on('error', (e) => {
1364
1375
  if (e.code === 'EADDRINUSE') {
1365
1376
  console.error('Address in use, Closing Server : ' + p);
@@ -1397,7 +1408,7 @@ module.exports = function init(____0) {
1397
1408
  ____0.options.https.ports.forEach((p, i) => {
1398
1409
  let server = ____0.https.createServer(_0xrrxo.handleServer);
1399
1410
  server.maxHeadersCount = 0;
1400
- server.timeout = 1000 * 30;
1411
+ server.timeout = 1000 * ____0.options.responseTimeout;
1401
1412
  server.on('error', (e) => {
1402
1413
  if (e.code === 'EADDRINUSE') {
1403
1414
  console.error('Address in use, Closing Server : ' + p);
@@ -35,6 +35,7 @@ function setOptions(_options, ____0) {
35
35
  hostname: 'localhost',
36
36
  key: null,
37
37
  savingTime: 10,
38
+ responseTimeout: 60,
38
39
  _0x14xo: _0x14xo, // 3259376545129191
39
40
  _0xddxo: _0xddxo, // 421957684138766241719191
40
41
  log: !0,
@@ -175,6 +176,7 @@ function setOptions(_options, ____0) {
175
176
  _x0oo.backup_dir = _x0oo.backup_dir || template.backup_dir;
176
177
 
177
178
  _x0oo.savingTime = _x0oo.savingTime ?? template.savingTime;
179
+ _x0oo.responseTimeout = _x0oo.responseTimeout ?? template.responseTimeout;
178
180
  _x0oo.hostname = _x0oo.hostname || template.hostname;
179
181
  _x0oo.log = _x0oo.log ?? template.log;
180
182
  _x0oo.lang = _x0oo.lang ?? template.lang;
@@ -18,6 +18,7 @@ module.exports = function init(____0) {
18
18
  ____0.strings[16] = ____0._x0f1xo('41391362');
19
19
  ____0.strings[17] = ____0._x0f1xo('4319326745129191');
20
20
  ____0.strings[18] = ____0._x0f1xo('41788668471837684714767548391357');
21
+ ____0.strings[19] = ____0._x0f1xo('36783773475837732116237646795691');
21
22
 
22
23
 
23
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2024.08.21",
3
+ "version": "2024.08.22",
4
4
  "description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -45,6 +45,7 @@
45
45
  "mongodb": "^6.8.0",
46
46
  "mv": "^2.1.1",
47
47
  "node-fetch": "^3.3.2",
48
+ "node-telegram-bot-api": "^0.66.0",
48
49
  "nodemailer": "^6.9.14",
49
50
  "pdf-lib": "^1.17.1",
50
51
  "utf8": "^3.0.0",