vantuz 3.5.5 → 3.5.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.
@@ -1,21 +1,18 @@
1
1
  const crypto = require('crypto');
2
- const fs = require('fs');
3
- const path = require('path');
2
+ const fs = require('path');
4
3
 
5
4
  // Müşteriye Gidecek Olan PUBLIC KEY (Sadece doğrulama yapar)
5
+ // BU KEY, admin-keygen.js'deki private.pem ile eşleşmeli
6
6
  const PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
7
- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvRNpoWJ4evHdT6I55/pE
8
- Kly7N/vycRFavRP7Fsm3w/Ugfl+mdmxCZpjZVUXDWWT2d+I+XBh13g4ZmF9h0hVH
9
- DklNBx6ikV9hax/zMu5auNLKf/IqAs9rM9ibdMaF2pxiiFelC0W2gmr1JDAbsU5o
10
- +Znjs9WskTCxUjcHUpViPqPaRb39wo2UC25BtbHihXEIbx6mYJVXkg8ayFEcsKQc
11
- FF10nTYaA1B0ENV9+mpda5etbaL7WFp6lfekYCDwJ8D78McNrGWDQSkQsJFgfzDL
12
- ad+WCVh97rnXdlW3iQCGLXCN9ad1Ky8sw1C1tllEFQb3irOJvU0+s/8Pv829NLNh
13
- iQIDAQAB
7
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnOaEFB+3s2ouGnbfGlbE
8
+ XO55/RFjoifn2dMNTLt49Ul6CsDES0VaKOQ3+Vmyw8OjYwy773Z/wunX09qCEXDE
9
+ vKHAhxxBa3RQafIbQ/2MIyGTjvxrGelDPzB6yStSwLgShcXtRvAh69aXpFjXCLaW
10
+ svNq+7vcnNdXeZ2c0ipWbnqjpPiFKDe+wZ//gkx70zYXc4WijyLtTQWC6BobhpOA
11
+ isx5uykTzr+LLtMb2n1TpxEopSRbkLQQD4NMskH9Eb1Nx3znl+PjZooUXvr+8eJr
12
+ jQp0PTDTL32LHo2iaWwkKZ38PDc/hfSuu3Kt31t0SIxAwObcCmO2OtiZ7wTKxDow
13
+ RwIDAQAB
14
14
  -----END PUBLIC KEY-----`;
15
15
 
16
- // NOT: Bu dosya artık lisans ÜRETEMEZ. Sadece doğrular.
17
- // Lisans üretmek için 'admin-keygen.js' dosyasını kullanın (Müşteriye vermeyin).
18
-
19
16
  module.exports = {
20
17
  verifyLicense(licenseKey) {
21
18
  try {
@@ -31,10 +28,7 @@ module.exports = {
31
28
  verify.update(data);
32
29
  verify.end();
33
30
 
34
- // Gerçek Public Key'i kullan (Hardcoded)
35
- const pubKey = PUBLIC_KEY;
36
-
37
- const isValid = verify.verify(pubKey, signature, 'base64');
31
+ const isValid = verify.verify(PUBLIC_KEY, signature, 'base64');
38
32
 
39
33
  if (!isValid) {
40
34
  return { valid: false, reason: 'Sahte Lisans (İmza Geçersiz)' };
@@ -43,14 +37,16 @@ module.exports = {
43
37
  const payload = JSON.parse(Buffer.from(data, 'base64').toString('utf8'));
44
38
  const today = new Date().toISOString().split('T')[0];
45
39
 
46
- if (payload.expiry < today) {
40
+ if (payload.expires < today) {
47
41
  return { valid: false, reason: 'Süresi Dolmuş Lisans' };
48
42
  }
49
43
 
50
- return { valid: true, data: payload };
44
+ // Payload'dan customer veya user'ı al
45
+ const customer = payload.customer || payload.user || 'Müşteri';
46
+ return { valid: true, data: { ...payload, customer } };
51
47
 
52
48
  } catch (e) {
53
- return { valid: false, reason: 'Lisans Okunamadı' };
49
+ return { valid: false, reason: 'Lisans Okunamadı: ' + e.message };
54
50
  }
55
51
  }
56
52
  };
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const fs = require('fs');
4
+ const { execSync } = require('child_process');
4
5
  const clear = require('console-clear');
5
6
  const figlet = require('figlet');
6
7
  const chalk = require('chalk');
@@ -10,6 +11,26 @@ const ora = require('ora');
10
11
  const Conf = require('conf');
11
12
  const db = require('./core/database');
12
13
  const licenseManager = require('./core/license-manager');
14
+ const pkg = require('./package.json');
15
+
16
+ // --- BASİT KOMUT SATIRI ARGÜMANLARI ---
17
+ const args = process.argv.slice(2);
18
+
19
+ if (args.includes('--version') || args.includes('-v')) {
20
+ console.log(pkg.version);
21
+ process.exit(0);
22
+ }
23
+
24
+ if (args.includes('--upgrade') || args.includes('-U')) {
25
+ console.log('🔄 Güncelleniyor...');
26
+ try {
27
+ execSync('npm install -g vantuz@latest', { stdio: 'inherit' });
28
+ console.log('✅ Güncelleme tamamlandı!');
29
+ } catch(e) {
30
+ console.log('❌ Güncelleme hatası:', e.message);
31
+ }
32
+ process.exit(0);
33
+ }
13
34
 
14
35
  // ... (Diğer importlar aynı) ...
15
36
  const productManager = require('./core/product-manager');
@@ -26,7 +47,7 @@ const config = new Conf({ projectName: 'vantuz' });
26
47
  const printHeader = () => {
27
48
  clear();
28
49
  console.log(chalk.cyan(figlet.textSync('VANTUZ', { horizontalLayout: 'full' })));
29
- console.log(chalk.grey(' 🐙 E-Ticaretin Yapay Zeka Beyni | v2.2 Enterprise\n'));
50
+ console.log(chalk.grey(` 🐙 E-Ticaretin Yapay Zeka Beyni | v${pkg.version}\n`));
30
51
  };
31
52
 
32
53
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantuz",
3
- "version": "3.5.5",
3
+ "version": "3.5.7",
4
4
  "description": "Yapay Zeka Destekli Yeni Nesil E-Ticaret Yönetim Platformu (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {