simplex-chat 6.5.0-beta.4.4 → 6.5.1

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.
@@ -4,7 +4,19 @@ const path = require('path');
4
4
  const extract = require('extract-zip');
5
5
 
6
6
  const GITHUB_REPO = 'simplex-chat/simplex-chat-libs';
7
- const RELEASE_TAG = 'v6.5.0-beta.4';
7
+ const RELEASE_TAG = 'v6.5.1';
8
+ const BACKEND = (process.env.SIMPLEX_BACKEND || process.env.npm_config_simplex_backend || 'sqlite').toLowerCase();
9
+
10
+ if (BACKEND !== 'sqlite' && BACKEND !== 'postgres') {
11
+ console.error(`✗ Invalid SIMPLEX_BACKEND: "${BACKEND}". Must be "sqlite" or "postgres".`);
12
+ process.exit(1);
13
+ }
14
+
15
+ if (BACKEND === 'postgres' && (process.platform !== 'linux' || process.arch !== 'x64')) {
16
+ console.error(`✗ SIMPLEX_BACKEND=postgres is only supported on Linux x86_64.`);
17
+ process.exit(1);
18
+ }
19
+
8
20
  const ROOT_DIR = process.cwd(); // Root of the package being installed
9
21
  const LIBS_DIR = path.join(ROOT_DIR, 'libs')
10
22
  const INSTALLED_FILE = path.join(LIBS_DIR, 'installed.txt');
@@ -56,11 +68,12 @@ function isAlreadyInstalled() {
56
68
 
57
69
  try {
58
70
  const installedVersion = fs.readFileSync(INSTALLED_FILE, 'utf-8').trim();
59
- if (installedVersion === RELEASE_TAG) {
60
- console.log(`✓ Libraries version ${RELEASE_TAG} already installed`);
71
+ const expectedVersion = `${RELEASE_TAG}:${BACKEND}`;
72
+ if (installedVersion === expectedVersion) {
73
+ console.log(`✓ Libraries version ${RELEASE_TAG}:${BACKEND} already installed`);
61
74
  return true;
62
75
  } else {
63
- console.log(`Version mismatch: installed ${installedVersion}, need ${RELEASE_TAG}`);
76
+ console.log(`Version mismatch: installed ${installedVersion}, need ${expectedVersion}`);
64
77
  cleanLibsDirectory();
65
78
  return false;
66
79
  }
@@ -79,12 +92,14 @@ async function install() {
79
92
 
80
93
  const { platformName, archName } = getPlatformInfo();
81
94
  const repoName = GITHUB_REPO.split('/')[1];
82
- const zipFilename = `${repoName}-${platformName}-${archName}.zip`;
95
+ const backendSuffix = BACKEND === 'postgres' ? '-postgres' : '';
96
+ const zipFilename = `${repoName}-${platformName}-${archName}${backendSuffix}.zip`;
83
97
  const ZIP_URL = `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}/${zipFilename}`;
84
98
  const ZIP_PATH = path.join(ROOT_DIR, zipFilename);
85
99
  const TEMP_EXTRACT_DIR = path.join(ROOT_DIR, '.temp-extract');
86
100
 
87
101
  console.log(`Detected: ${platformName} ${archName}`);
102
+ console.log(`Backend: ${BACKEND}`);
88
103
  console.log(`Downloading: ${zipFilename}`);
89
104
 
90
105
  // Create libs directory
@@ -124,8 +139,8 @@ async function install() {
124
139
  }
125
140
 
126
141
  // Write installed.txt with version
127
- fs.writeFileSync(INSTALLED_FILE, RELEASE_TAG, 'utf-8');
128
- console.log(`✓ Wrote version ${RELEASE_TAG} to installed.txt`);
142
+ fs.writeFileSync(INSTALLED_FILE, `${RELEASE_TAG}:${BACKEND}`, 'utf-8');
143
+ console.log(`✓ Wrote version ${RELEASE_TAG}:${BACKEND} to installed.txt`);
129
144
 
130
145
  // Cleanup
131
146
  fs.rmSync(TEMP_EXTRACT_DIR, { recursive: true, force: true });
@@ -1,33 +0,0 @@
1
- [**simplex-chat**](README.md)
2
-
3
- ***
4
-
5
- [simplex-chat](README.md) / [bot](Namespace.bot.md) / BotDbOpts
6
-
7
- # Interface: BotDbOpts
8
-
9
- Defined in: [src/bot.ts:7](../src/bot.ts#L7)
10
-
11
- ## Properties
12
-
13
- ### confirmMigrations?
14
-
15
- > `optional` **confirmMigrations**: [`MigrationConfirmation`](core.Enumeration.MigrationConfirmation.md)
16
-
17
- Defined in: [src/bot.ts:10](../src/bot.ts#L10)
18
-
19
- ***
20
-
21
- ### dbFilePrefix
22
-
23
- > **dbFilePrefix**: `string`
24
-
25
- Defined in: [src/bot.ts:8](../src/bot.ts#L8)
26
-
27
- ***
28
-
29
- ### dbKey?
30
-
31
- > `optional` **dbKey**: `string`
32
-
33
- Defined in: [src/bot.ts:9](../src/bot.ts#L9)