new-native-tools 3.1.27 → 3.1.28

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,7 +10,18 @@ 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
+ /**
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.
17
+ */
18
+ export declare function generateZipPatchFile(oldFilePath: string, newFilePath: string): Promise<string | null>
13
19
  export declare function applyZipPatch(basePath: string, patch: Array<number>, targetPath: string): Promise<void>
20
+ /**
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.
23
+ */
24
+ export declare function applyZipPatchFile(basePath: string, patchFilePath: string, targetPath: string): Promise<void>
14
25
  export declare function downloadWithProgress(url: string, callback: (...args: any[]) => any): object
15
26
  export declare function exportEntireLeveldb(dbPath: string): Promise<Record<string, any>>
16
27
  export declare function importLevelDb(levelDbPath: string, levelDbJsonData: string): Promise<void>
package/index.js CHANGED
@@ -310,11 +310,13 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { checkVersionInAllFolders, generateZipPatch, applyZipPatch, downloadWithProgress, 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
321
  module.exports.exportEntireLeveldb = exportEntireLeveldb
320
322
  module.exports.importLevelDb = importLevelDb
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "new-native-tools",
3
- "version": "3.1.27",
3
+ "version": "3.1.28",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
@@ -41,10 +41,10 @@
41
41
  "version": "napi version"
42
42
  },
43
43
  "optionalDependencies": {
44
- "new-native-tools-win32-x64-msvc": "3.1.27",
45
- "new-native-tools-darwin-x64": "3.1.27",
46
- "new-native-tools-linux-x64-gnu": "3.1.27",
47
- "new-native-tools-darwin-arm64": "3.1.27",
48
- "new-native-tools-win32-ia32-msvc": "3.1.27"
44
+ "new-native-tools-win32-x64-msvc": "3.1.28",
45
+ "new-native-tools-darwin-x64": "3.1.28",
46
+ "new-native-tools-linux-x64-gnu": "3.1.28",
47
+ "new-native-tools-darwin-arm64": "3.1.28",
48
+ "new-native-tools-win32-ia32-msvc": "3.1.28"
49
49
  }
50
50
  }
Binary file
Binary file
Binary file
Binary file
Binary file