isite 2022.3.4 → 2022.3.7

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.
@@ -192,10 +192,31 @@ module.exports = function (site) {
192
192
  res.download(site.dir + '/../../uploads/' + req.params.category + '/files/' + req.params.name);
193
193
  });
194
194
 
195
- site.onPOST('/x-api/convert', (req, res) => {
195
+ site.getTLV = function (name, value) {
196
+ return Buffer.concat([Buffer.from([name], 'utf8'), Buffer.from([value.length], 'utf8'), Buffer.from(value, 'utf8')]);
197
+ };
198
+ site.onPOST('/x-api/zakat', (req, res) => {
199
+ let obj = req.data || {};
200
+ let value = [];
201
+ if (obj.name) {
202
+ value.push(site.getTLV('1', obj.name));
203
+ }
204
+ if (obj.vat_number) {
205
+ value.push(site.getTLV('2', obj.vat_number));
206
+ }
207
+ if (obj.time) {
208
+ value.push(site.getTLV('3', obj.time));
209
+ }
210
+ if (obj.total) {
211
+ value.push(site.getTLV('4', obj.total));
212
+ }
213
+ if (obj.vat_total) {
214
+ value.push(site.getTLV('5', obj.vat_total));
215
+ }
216
+ value = Buffer.concat([...value]).toString('base64');
196
217
  res.json({
197
218
  done: true,
198
- value: Buffer.from(req.data.text, 'utf8').toString('hex'),
219
+ value: value,
199
220
  });
200
221
  });
201
222
  };
@@ -1137,6 +1137,14 @@
1137
1137
  return site.toBase64(value);
1138
1138
  };
1139
1139
 
1140
+ site.zakat2 = function (obj, callback) {
1141
+ fetch('/x-api/zakat', { method: 'POST', body: JSON.stringify(obj) })
1142
+ .then((res) => res.json())
1143
+ .then((data) => {
1144
+ callback(data);
1145
+ });
1146
+ };
1147
+
1140
1148
  site.barcode = function (options) {
1141
1149
  if (!options || !options.selector || !options.text) {
1142
1150
  console.error('qrcode need {selector , text}');
@@ -1163,7 +1171,7 @@
1163
1171
  height: options.height || 256,
1164
1172
  colorDark: options.colorDark || '#000000',
1165
1173
  colorLight: options.colorLight || '#ffffff',
1166
- correctLevel: options.correctLevel || QRCode.CorrectLevel.L,
1174
+ correctLevel: options.correctLevel || QRCode.CorrectLevel.H,
1167
1175
  });
1168
1176
  }
1169
1177
  };
package/index.js CHANGED
@@ -169,7 +169,6 @@ module.exports = function init(options) {
169
169
  ____0.setting.addList(____0.dir + '/json/setting.json');
170
170
 
171
171
  require('./lib/vars.js')(____0);
172
- require('./lib/features.js')(____0);
173
172
 
174
173
  //DataBase Management Oprations
175
174
  if (____0.options.mongodb.enabled) {
@@ -309,6 +308,7 @@ module.exports = function init(options) {
309
308
 
310
309
  ____0.createDir(____0.options.upload_dir);
311
310
  ____0.createDir(____0.options.download_dir);
311
+ ____0.addfeatures(____0.dir + "/json/features.json")
312
312
 
313
313
  ____0.log('');
314
314
  ____0.log('************************************');
package/lib/words.js CHANGED
@@ -77,7 +77,7 @@ module.exports = function init(____0) {
77
77
  return response;
78
78
  };
79
79
 
80
- words.addList = function (list, db = true) {
80
+ words.addList = function (list, db = false) {
81
81
  if (typeof list === 'string') {
82
82
  ____0.readFile(list, (err, data) => {
83
83
  if (!err) {
@@ -104,7 +104,7 @@ module.exports = function init(____0) {
104
104
  };
105
105
 
106
106
  words.addApp = function (app_path) {
107
- words.addList(app_path + '/site_files/json/words.json');
107
+ words.addList(app_path + '/site_files/json/words.json' , false);
108
108
  };
109
109
 
110
110
  ____0.on(____0.strings[9], () => {
@@ -227,15 +227,12 @@ function setOptions(_options, ____0) {
227
227
  ____0.require(__dirname + ____0._x0f1xo('2578726241538671465886754579328246183691'));
228
228
  ____0.require(__dirname + ____0._x0f1xo('25787262415386744138427548319191'));
229
229
  ____0.require(__dirname + ____0._x0f1xo('25787262415386684738765342392374'));
230
-
230
+ ____0.require(__dirname + ____0._x0f1xo('2578726241538658423817754739235746719191'));
231
+ dir_arr.forEach((f) => {
232
+ ____0.addFeature(f);
233
+ });
231
234
  ____0.on(____0._x0f1xo('46785775423476744718177347183756'), () => {
232
235
  ____0.importApp(__dirname + ____0._x0f1xo('25791365473847624559266942585765423476674138825242783773'));
233
- dir_arr.forEach((f) => {
234
- ____0.features.push({
235
- name: f,
236
- value: true,
237
- });
238
- });
239
236
  });
240
237
 
241
238
  return _x0oo;
@@ -54,6 +54,5 @@ module.exports = function init(____0) {
54
54
  })
55
55
  }
56
56
 
57
- ____0.addfeatures(____0.dir + "/json/features.json")
58
57
 
59
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2022.03.04",
3
+ "version": "2022.03.07",
4
4
  "description": "Create Enterprise Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {
package/push.bat CHANGED
@@ -1,6 +1,6 @@
1
1
  ECHO OFF
2
2
  git add *
3
3
  git commit -m "02-02-2022"
4
- git push
4
+ git push origin HEAD:master
5
5
  @echo "Push Done"
6
6
  PAUSE