@onekeyfe/react-native-cloud-fs 3.0.162 → 3.0.165

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/README.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @onekeyfe/react-native-cloud-fs
2
2
 
3
+ Cloud file access for OneKey React Native applications. The native interface
4
+ supports cloud availability checks, listing, copying, creating and deleting
5
+ files, with iCloud-specific and Google Drive-specific methods.
6
+
7
+ ## Installation and usage
8
+
9
+ ```sh
10
+ yarn add @onekeyfe/react-native-cloud-fs
11
+ ```
12
+
13
+ Install the application's iOS pods and rebuild its native binary. The consumer
14
+ must configure its cloud provider, native entitlements and authentication flow.
15
+ Package installation alone does not grant cloud access.
16
+
17
+ ```ts
18
+ import { CloudFs } from '@onekeyfe/react-native-cloud-fs';
19
+
20
+ const available = await CloudFs.isAvailable();
21
+ ```
22
+
23
+ ## API and platforms
24
+
25
+ Shared methods include `syncCloud`, `listFiles`, `deleteFromCloud`, `fileExists`,
26
+ `copyToCloud` and `createFile`. Their parameters use explicit provider scope,
27
+ paths or file IDs; the application owns those identifiers and file contents.
28
+
29
+ `getIcloudDocument` is iOS-specific. Android exposes `loginIfNeeded`, `logout`,
30
+ `getGoogleDriveDocument` and `getCurrentlySignedInUserData` for its Google Drive
31
+ integration. Route calls to the appropriate provider and handle promise failures
32
+ such as missing account access or unavailable files.
33
+
34
+ The package exports both the named `CloudFs` and the default native module.
35
+ See [src/NativeCloudFs.ts](src/NativeCloudFs.ts) for complete option/result shapes.
36
+ A successful availability check does not establish that a later transfer has
37
+ completed or that every requested scope is permitted.
38
+
39
+ ## Upstream attribution
40
+
3
41
  First, a sincere thank-you to the
4
42
  `react-native-cloud-fs` maintainers for their excellent work 🙏
5
43
 
@@ -101,7 +101,6 @@ class RNCloudFsModule(private val reactContext: ReactApplicationContext) :
101
101
  override fun logout(promise: Promise) {
102
102
  val signInOptions = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
103
103
  .requestEmail()
104
- .requestScopes(Scope(DriveScopes.DRIVE_FILE))
105
104
  .build()
106
105
  val client: GoogleSignInClient = GoogleSignIn.getClient(reactContext, signInOptions)
107
106
  mDriveServiceHelper = null
@@ -131,7 +130,7 @@ class RNCloudFsModule(private val reactContext: ReactApplicationContext) :
131
130
  Log.d(TAG, "Requesting sign-in")
132
131
  val signInOptions = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
133
132
  .requestEmail()
134
- .requestScopes(Scope(DriveScopes.DRIVE_FILE))
133
+ .requestScopes(Scope(DriveScopes.DRIVE_APPDATA))
135
134
  .build()
136
135
  val client: GoogleSignInClient = GoogleSignIn.getClient(reactContext, signInOptions)
137
136
  reactContext.startActivityForResult(client.signInIntent, REQUEST_CODE_SIGN_IN, null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-cloud-fs",
3
- "version": "3.0.162",
3
+ "version": "3.0.165",
4
4
  "description": "react-native-cloud-fs TurboModule for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -37,14 +37,15 @@
37
37
  ],
38
38
  "repository": {
39
39
  "type": "git",
40
- "url": "git+https://github.com/OneKeyHQ/app-modules/react-native-cloud-fs.git"
40
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
41
+ "directory": "native-modules/react-native-cloud-fs"
41
42
  },
42
43
  "author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
43
44
  "license": "MIT",
44
45
  "bugs": {
45
- "url": "https://github.com/OneKeyHQ/app-modules/react-native-cloud-fs/issues"
46
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
46
47
  },
47
- "homepage": "https://github.com/OneKeyHQ/app-modules/react-native-cloud-fs#readme",
48
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-cloud-fs#readme",
48
49
  "publishConfig": {
49
50
  "registry": "https://registry.npmjs.org/"
50
51
  },