@onekeyfe/react-native-cloud-kit-module 3.0.157-alpha.275 → 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 +55 -0
  2. package/package.json +5 -4
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @onekeyfe/react-native-cloud-kit-module
2
+
3
+ CloudKit account and private-record access for OneKey React Native applications.
4
+ The iOS implementation uses the application's default CloudKit container and
5
+ its private database. The caller owns record schema, serialization and deciding
6
+ which application data may be stored in iCloud.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ yarn add @onekeyfe/react-native-cloud-kit-module react-native-nitro-modules
12
+ ```
13
+
14
+ Install the application's iOS pods and rebuild the native application. Configure
15
+ the application's iCloud/CloudKit entitlements and container before using the
16
+ module; package installation does not provision them.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { CloudKit } from '@onekeyfe/react-native-cloud-kit-module';
22
+
23
+ if (await CloudKit.isAvailable()) {
24
+ const account = await CloudKit.getAccountInfo();
25
+ const record = await CloudKit.fetchRecord({
26
+ recordType: 'Backup',
27
+ recordID: 'example-record',
28
+ });
29
+ }
30
+ ```
31
+
32
+ ## API
33
+
34
+ | Method | Purpose |
35
+ | --- | --- |
36
+ | `isAvailable()` | Check iCloud account availability. |
37
+ | `getAccountInfo()` | Return account status and optional container user ID. |
38
+ | `saveRecord({ recordType, recordID, data, meta })` | Store string data and metadata. |
39
+ | `fetchRecord({ recordType, recordID })` | Read a record or return `null`. |
40
+ | `recordExists({ recordType, recordID })` | Check for a record. |
41
+ | `deleteRecord({ recordType, recordID })` | Remove a record. |
42
+ | `queryRecords({ recordType })` | Return records matching a type. |
43
+
44
+ Records include IDs, type, string data/metadata and creation/modification times.
45
+ Handle promise failures in the application, including unavailable accounts and
46
+ CloudKit errors. Android exposes placeholder methods and reports unavailable;
47
+ it does not provide CloudKit storage. Do not treat a placeholder write result
48
+ as a persisted backup.
49
+
50
+ See [src/CloudKitModule.nitro.ts](src/CloudKitModule.nitro.ts) for the exported
51
+ parameter and result types.
52
+
53
+ ## License
54
+
55
+ MIT.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-cloud-kit-module",
3
- "version": "3.0.157-alpha.275",
4
- "description": "react-native-cloud-kit-module",
3
+ "version": "3.0.157-alpha.276",
4
+ "description": "CloudKit account and private record access for OneKey on iOS",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
7
7
  "exports": {
@@ -50,14 +50,15 @@
50
50
  ],
51
51
  "repository": {
52
52
  "type": "git",
53
- "url": "git+https://github.com/OneKeyHQ/app-modules.git"
53
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
54
+ "directory": "native-modules/react-native-cloud-kit-module"
54
55
  },
55
56
  "author": "react-native-cloud-kit-module <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
56
57
  "license": "MIT",
57
58
  "bugs": {
58
59
  "url": "https://github.com/OneKeyHQ/app-modules/issues"
59
60
  },
60
- "homepage": "https://github.com/OneKeyHQ/app-modules#readme",
61
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-cloud-kit-module#readme",
61
62
  "publishConfig": {
62
63
  "registry": "https://registry.npmjs.org/"
63
64
  },