@onekeyfe/react-native-zip-archive 3.0.157-alpha.273 → 3.0.157-alpha.276

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.
Files changed (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +5 -4
package/README.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @onekeyfe/react-native-zip-archive
2
2
 
3
+ Native ZIP archive operations for OneKey on iOS and Android. The Nitro module
4
+ extracts archives, creates archives from directories or explicit file lists,
5
+ and inspects password protection and uncompressed size.
6
+
7
+ ## Installation and usage
8
+
9
+ ```sh
10
+ yarn add @onekeyfe/react-native-zip-archive react-native-nitro-modules
11
+ ```
12
+
13
+ Install the application's iOS pods and rebuild the native application.
14
+
15
+ ```ts
16
+ import { unzip, getUncompressedSize } from '@onekeyfe/react-native-zip-archive';
17
+
18
+ const bytes = await getUncompressedSize('/absolute/path/archive.zip');
19
+ const directory = await unzip('/absolute/path/archive.zip', '/absolute/path/output');
20
+ ```
21
+
22
+ ## API and caller responsibilities
23
+
24
+ Named functions include `isPasswordProtected`, `unzip`, `unzipWithPassword`,
25
+ `zipFolder`, `zipFiles` and `getUncompressedSize`. `zip` aliases `zipFolder`;
26
+ `ZipArchive` exposes the underlying Nitro object. Extraction and creation
27
+ methods resolve with the destination path.
28
+
29
+ `getUncompressedSize` returns bytes, or -1 when inspection fails. File paths are
30
+ local paths rather than remote URLs. The application owns destination selection,
31
+ disk-space budgeting, trust decisions and cleanup after failed operations.
32
+ Archive extraction alone does not verify an update's authenticity or integrity.
33
+
34
+ Handle promise failures and inspect the destination through the consumer's
35
+ existing validation flow before using extracted content. The full signatures
36
+ are in [src/ReactNativeZipArchive.nitro.ts](src/ReactNativeZipArchive.nitro.ts),
37
+ and [src/index.tsx](src/index.tsx) documents the compatibility exports.
38
+
39
+ ## Upstream attribution
40
+
3
41
  First, a sincere thank-you to Mockingbot and the
4
42
  `react-native-zip-archive` maintainers for their excellent work 🙏
5
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-zip-archive",
3
- "version": "3.0.157-alpha.273",
3
+ "version": "3.0.157-alpha.276",
4
4
  "description": "react-native-zip-archive Nitro HybridObject for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -45,14 +45,15 @@
45
45
  ],
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "git+https://github.com/OneKeyHQ/app-modules/react-native-zip-archive.git"
48
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
49
+ "directory": "native-modules/react-native-zip-archive"
49
50
  },
50
51
  "author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
51
52
  "license": "MIT",
52
53
  "bugs": {
53
- "url": "https://github.com/OneKeyHQ/app-modules/react-native-zip-archive/issues"
54
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
54
55
  },
55
- "homepage": "https://github.com/OneKeyHQ/app-modules/react-native-zip-archive#readme",
56
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-zip-archive#readme",
56
57
  "publishConfig": {
57
58
  "registry": "https://registry.npmjs.org/"
58
59
  },