new-native-tools 3.1.27-cobra-33-146-1757491392 → 3.1.27-datadir-size-fix-160-1759158401

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/index.d.ts CHANGED
@@ -10,103 +10,19 @@ export interface ProfileVersion {
10
10
  }
11
11
  export declare function checkVersionInAllFolders(dirs: Array<string>): Array<ProfileVersion>
12
12
  export declare function generateZipPatch(oldFilePath: string, newFilePath: string): Promise<Array<number>>
13
- export declare function applyZipPatch(basePath: string, patch: Array<number>, targetPath: string): Promise<void>
14
- export declare function downloadWithProgress(url: string, callback: (...args: any[]) => any): object
15
13
  /**
16
- * Статус интернет соединения
17
- *
18
- * Структура содержит полную информацию о состоянии сетевого подключения устройства
14
+ * Generates a zip patch file and returns the path to a temporary file if the patch is reasonable.
15
+ * Returns None if the patch would be larger than the original file size (or 90% for files > 3MB).
16
+ * The caller is responsible for cleaning up the temporary file.
19
17
  */
20
- export interface ConnectionStatus {
21
- /**
22
- * Статус подключения к интернету
23
- *
24
- * `true` - есть интернет соединение, `false` - нет соединения
25
- */
26
- isConnected: boolean
27
- /**
28
- * Тип сетевого соединения
29
- *
30
- * Возможные значения:
31
- * - `"wifi"` - Wi-Fi соединение
32
- * - `"ethernet"` - Проводное Ethernet соединение
33
- * - `"cellular"` - Мобильная связь (3G/4G/5G)
34
- * - `"internet"` - Подтвержденное интернет соединение (Windows)
35
- * - `"local-network"` - Только локальная сеть
36
- * - `"vpn"` - VPN соединение (macOS)
37
- * - `"http-verified"` - Подтверждено через HTTP запрос
38
- * - `"unknown"` - Тип соединения не определен
39
- * - `"none"` - Нет соединения
40
- */
41
- connectionType: string
42
- /**
43
- * Задержка соединения в миллисекундах
44
- *
45
- * Измеряется только при HTTP проверках. Для системных проверок равно `null`
46
- */
47
- latencyMs?: number
48
- /**
49
- * Сообщение об ошибке
50
- *
51
- * Содержит описание проблемы, если `is_connected = false`.
52
- * Для успешных соединений равно `null`
53
- */
54
- errorMessage?: string
55
- /**
56
- * Требуется ли вход через captive portal
57
- *
58
- * `true` - обнаружен captive portal, требуется аутентификация
59
- * `false` - captive portal не обнаружен
60
- * `null` - статус неизвестен
61
- */
62
- requiresPortalLogin?: boolean
63
- }
18
+ export declare function generateZipPatchFile(oldFilePath: string, newFilePath: string): Promise<string | null>
19
+ export declare function applyZipPatch(basePath: string, patch: Array<number>, targetPath: string): Promise<void>
64
20
  /**
65
- * Проверяет состояние интернет соединения устройства
66
- *
67
- * Функция выполняет двухэтапную проверку:
68
- * 1. **Системная проверка** - быстрая проверка наличия сетевого подключения через ОС
69
- * 2. **HTTP проверка** - проверка реального интернета через переданный хост (опционально)
70
- *
71
- * # Параметры
72
- *
73
- * * `host` - Опциональный хост для проверки реального интернет соединения.
74
- * Если не передан, возвращается только результат системной проверки.
75
- *
76
- * # Возвращаемое значение
77
- *
78
- * Возвращает `ConnectionStatus` со следующими полями:
79
- * - `is_connected` - true если есть интернет соединение
80
- * - `connection_type` - тип соединения ("wifi", "ethernet", "cellular", "http-custom", etc.)
81
- * - `latency_ms` - задержка в миллисекундах (если измерялась)
82
- * - `error_message` - описание ошибки (если есть)
83
- *
84
- * # Логика работы
85
- *
86
- * ## Без хоста (быстрая проверка ~1ms):
87
- * - **Windows**: `InternetGetConnectedState` WinAPI
88
- * - **Linux**: Проверка `/proc/net/route` на наличие default route
89
- * - **macOS**: `SCNetworkReachability` для общей сетевой доступности
90
- *
91
- * ## С хостом (полная проверка ~100-2000ms):
92
- * 1. Выполняется системная проверка
93
- * 2. При наличии подключения делается HTTP запрос к переданному хосту
94
- * 3. Пробуются HTTPS и HTTP варианты
95
- * 4. Любой HTTP ответ считается успешным
96
- *
97
- * # Примеры
98
- *
99
- * ```javascript
100
- * // Быстрая системная проверка
101
- * const systemCheck = await checkInternetConnection();
102
- *
103
- * // Полная проверка с вашим сервисом
104
- * const fullCheck = await checkInternetConnection("api.yourservice.com");
105
- * ```
106
- *
107
- * Timeout: 10 секунд. Функция не использует предопределенные внешние сервисы.
21
+ * Applies a zip patch from a file. Automatically cleans up temporary patch files
22
+ * created by generate_zip_patch_file, but leaves other files untouched for safety.
108
23
  */
109
- export declare function checkInternetConnection(host?: string | undefined | null): Promise<ConnectionStatus>
24
+ export declare function applyZipPatchFile(basePath: string, patchFilePath: string, targetPath: string): Promise<void>
25
+ export declare function downloadWithProgress(url: string, callback: (...args: any[]) => any): object
110
26
  export declare function exportEntireLeveldb(dbPath: string): Promise<Record<string, any>>
111
27
  export declare function importLevelDb(levelDbPath: string, levelDbJsonData: string): Promise<void>
112
28
  export declare function proxyCheckHttp(ip: string, port: number, username: string | undefined | null, password: string | undefined | null, domain: string, useHttps?: boolean | undefined | null): Promise<string>
package/index.js CHANGED
@@ -310,13 +310,14 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { checkVersionInAllFolders, generateZipPatch, applyZipPatch, downloadWithProgress, checkInternetConnection, exportEntireLeveldb, importLevelDb, proxyCheckHttp, proxyCheckSocks5H, proxyCheckSocks5, sqliteAddLoginPassword, createSqliteLoginDatabase, sqliteGetVersion, sqliteAddCookies, sqliteGetCookies, migrateCookiesDown, getSystemInfo, unzipToFolder, archivateFolder, validateArchive, setForegroundByPid, isProcessRunning, killProcessByPid, closeProcessByPid, tileWindowsEvenly, rustLoggerInit, getVersion } = nativeBinding
313
+ const { checkVersionInAllFolders, generateZipPatch, generateZipPatchFile, applyZipPatch, applyZipPatchFile, downloadWithProgress, exportEntireLeveldb, importLevelDb, proxyCheckHttp, proxyCheckSocks5H, proxyCheckSocks5, sqliteAddLoginPassword, createSqliteLoginDatabase, sqliteGetVersion, sqliteAddCookies, sqliteGetCookies, migrateCookiesDown, getSystemInfo, unzipToFolder, archivateFolder, validateArchive, setForegroundByPid, isProcessRunning, killProcessByPid, closeProcessByPid, tileWindowsEvenly, rustLoggerInit, getVersion } = nativeBinding
314
314
 
315
315
  module.exports.checkVersionInAllFolders = checkVersionInAllFolders
316
316
  module.exports.generateZipPatch = generateZipPatch
317
+ module.exports.generateZipPatchFile = generateZipPatchFile
317
318
  module.exports.applyZipPatch = applyZipPatch
319
+ module.exports.applyZipPatchFile = applyZipPatchFile
318
320
  module.exports.downloadWithProgress = downloadWithProgress
319
- module.exports.checkInternetConnection = checkInternetConnection
320
321
  module.exports.exportEntireLeveldb = exportEntireLeveldb
321
322
  module.exports.importLevelDb = importLevelDb
322
323
  module.exports.proxyCheckHttp = proxyCheckHttp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "new-native-tools",
3
- "version": "3.1.27-cobra-33-146-1757491392",
3
+ "version": "3.1.27-datadir-size-fix-160-1759158401",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
Binary file
Binary file
Binary file
Binary file
Binary file