react-native-cloud-storage 2.2.2 → 3.0.0

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 (216) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/android/build.gradle +88 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/voicekit/CloudStorageError.kt +86 -0
  8. package/android/src/main/java/com/voicekit/CloudStorageLocalFileSystemModule.kt +232 -0
  9. package/android/src/main/java/com/voicekit/CloudStoragePackage.kt +32 -0
  10. package/android/src/main/java/com/voicekit/FileUtils.kt +41 -0
  11. package/android/src/main/java/com/voicekit/Types.kt +6 -0
  12. package/app.plugin.js +1 -1
  13. package/{lib/commonjs/RNCloudStorage.js → dist/commonjs/cloud-storage.js} +177 -92
  14. package/dist/commonjs/cloud-storage.js.map +1 -0
  15. package/dist/commonjs/expo-plugin/index.js +13 -0
  16. package/dist/commonjs/expo-plugin/index.js.map +1 -0
  17. package/{lib/commonjs/expo-plugin/withRNCloudStorageIos.js → dist/commonjs/expo-plugin/ios.js} +1 -1
  18. package/dist/commonjs/expo-plugin/ios.js.map +1 -0
  19. package/{lib/commonjs/hooks/useCloudFile.js → dist/commonjs/hooks/use-cloud-file.js} +26 -8
  20. package/dist/commonjs/hooks/use-cloud-file.js.map +1 -0
  21. package/{lib/commonjs/hooks/useIsCloudAvailable.js → dist/commonjs/hooks/use-is-cloud-available.js} +3 -3
  22. package/dist/commonjs/hooks/use-is-cloud-available.js.map +1 -0
  23. package/{lib → dist}/commonjs/index.js +10 -10
  24. package/dist/commonjs/index.js.map +1 -0
  25. package/dist/commonjs/specs/NativeCloudStorageCloudKitIOS.js +9 -0
  26. package/dist/commonjs/specs/NativeCloudStorageCloudKitIOS.js.map +1 -0
  27. package/dist/commonjs/specs/NativeCloudStorageLocalFileSystem.js +9 -0
  28. package/dist/commonjs/specs/NativeCloudStorageLocalFileSystem.js.map +1 -0
  29. package/dist/commonjs/storages/cloudkit.js +12 -0
  30. package/dist/commonjs/storages/cloudkit.js.map +1 -0
  31. package/{lib/commonjs → dist/commonjs/storages}/google-drive/client.js +83 -40
  32. package/dist/commonjs/storages/google-drive/client.js.map +1 -0
  33. package/dist/commonjs/storages/google-drive/index.js +399 -0
  34. package/dist/commonjs/storages/google-drive/index.js.map +1 -0
  35. package/dist/commonjs/storages/google-drive/types.js.map +1 -0
  36. package/{lib → dist}/commonjs/types/main.js.map +1 -1
  37. package/dist/commonjs/types/native.js +28 -0
  38. package/dist/commonjs/types/native.js.map +1 -0
  39. package/{lib/commonjs/utils/CloudStorageError.js → dist/commonjs/utils/cloud-storage-error.js} +3 -1
  40. package/dist/commonjs/utils/cloud-storage-error.js.map +1 -0
  41. package/dist/commonjs/utils/constants.js +25 -0
  42. package/dist/commonjs/utils/constants.js.map +1 -0
  43. package/dist/commonjs/utils/local-fs.js +17 -0
  44. package/dist/commonjs/utils/local-fs.js.map +1 -0
  45. package/dist/commonjs/utils/native.js +35 -0
  46. package/dist/commonjs/utils/native.js.map +1 -0
  47. package/{lib/module/RNCloudStorage.js → dist/module/cloud-storage.js} +178 -93
  48. package/dist/module/cloud-storage.js.map +1 -0
  49. package/dist/module/expo-plugin/index.js +8 -0
  50. package/dist/module/expo-plugin/index.js.map +1 -0
  51. package/{lib/module/expo-plugin/withRNCloudStorageIos.js → dist/module/expo-plugin/ios.js} +1 -1
  52. package/dist/module/expo-plugin/ios.js.map +1 -0
  53. package/{lib/module/hooks/useCloudFile.js → dist/module/hooks/use-cloud-file.js} +25 -7
  54. package/dist/module/hooks/use-cloud-file.js.map +1 -0
  55. package/{lib/module/hooks/useIsCloudAvailable.js → dist/module/hooks/use-is-cloud-available.js} +2 -2
  56. package/dist/module/hooks/use-is-cloud-available.js.map +1 -0
  57. package/dist/module/index.js +9 -0
  58. package/dist/module/index.js.map +1 -0
  59. package/dist/module/specs/NativeCloudStorageCloudKitIOS.js +5 -0
  60. package/dist/module/specs/NativeCloudStorageCloudKitIOS.js.map +1 -0
  61. package/dist/module/specs/NativeCloudStorageLocalFileSystem.js +5 -0
  62. package/dist/module/specs/NativeCloudStorageLocalFileSystem.js.map +1 -0
  63. package/dist/module/storages/cloudkit.js +7 -0
  64. package/dist/module/storages/cloudkit.js.map +1 -0
  65. package/{lib/module → dist/module/storages}/google-drive/client.js +83 -40
  66. package/dist/module/storages/google-drive/client.js.map +1 -0
  67. package/dist/module/storages/google-drive/index.js +392 -0
  68. package/dist/module/storages/google-drive/index.js.map +1 -0
  69. package/dist/module/storages/google-drive/types.js.map +1 -0
  70. package/{lib → dist}/module/types/main.js.map +1 -1
  71. package/dist/module/types/native.js +24 -0
  72. package/dist/module/types/native.js.map +1 -0
  73. package/{lib/module/utils/CloudStorageError.js → dist/module/utils/cloud-storage-error.js} +3 -1
  74. package/dist/module/utils/cloud-storage-error.js.map +1 -0
  75. package/dist/module/utils/constants.js +21 -0
  76. package/dist/module/utils/constants.js.map +1 -0
  77. package/dist/module/utils/local-fs.js +12 -0
  78. package/dist/module/utils/local-fs.js.map +1 -0
  79. package/dist/module/utils/native.js +30 -0
  80. package/dist/module/utils/native.js.map +1 -0
  81. package/{lib/typescript/RNCloudStorage.d.ts → dist/typescript/cloud-storage.d.ts} +67 -8
  82. package/dist/typescript/cloud-storage.d.ts.map +1 -0
  83. package/{lib/typescript/expo-plugin/withRNCloudStorage.d.ts → dist/typescript/expo-plugin/index.d.ts} +1 -1
  84. package/dist/typescript/expo-plugin/index.d.ts.map +1 -0
  85. package/{lib/typescript/expo-plugin/withRNCloudStorageIos.d.ts → dist/typescript/expo-plugin/ios.d.ts} +1 -1
  86. package/dist/typescript/expo-plugin/ios.d.ts.map +1 -0
  87. package/{lib/typescript/hooks/useCloudFile.d.ts → dist/typescript/hooks/use-cloud-file.d.ts} +22 -4
  88. package/dist/typescript/hooks/use-cloud-file.d.ts.map +1 -0
  89. package/{lib/typescript/hooks/useIsCloudAvailable.d.ts → dist/typescript/hooks/use-is-cloud-available.d.ts} +2 -2
  90. package/dist/typescript/hooks/use-is-cloud-available.d.ts.map +1 -0
  91. package/dist/typescript/index.d.ts +7 -0
  92. package/dist/typescript/index.d.ts.map +1 -0
  93. package/dist/typescript/specs/NativeCloudStorageCloudKitIOS.d.ts +30 -0
  94. package/dist/typescript/specs/NativeCloudStorageCloudKitIOS.d.ts.map +1 -0
  95. package/dist/typescript/specs/NativeCloudStorageLocalFileSystem.d.ts +24 -0
  96. package/dist/typescript/specs/NativeCloudStorageLocalFileSystem.d.ts.map +1 -0
  97. package/dist/typescript/storages/cloudkit.d.ts +6 -0
  98. package/dist/typescript/storages/cloudkit.d.ts.map +1 -0
  99. package/{lib/typescript → dist/typescript/storages}/google-drive/client.d.ts +10 -3
  100. package/dist/typescript/storages/google-drive/client.d.ts.map +1 -0
  101. package/dist/typescript/storages/google-drive/index.d.ts +41 -0
  102. package/dist/typescript/storages/google-drive/index.d.ts.map +1 -0
  103. package/dist/typescript/storages/google-drive/types.d.ts.map +1 -0
  104. package/{lib → dist}/typescript/types/main.d.ts +8 -0
  105. package/dist/typescript/types/main.d.ts.map +1 -0
  106. package/dist/typescript/types/native.d.ts +27 -0
  107. package/dist/typescript/types/native.d.ts.map +1 -0
  108. package/dist/typescript/utils/cloud-storage-error.d.ts +8 -0
  109. package/dist/typescript/utils/cloud-storage-error.d.ts.map +1 -0
  110. package/dist/typescript/utils/constants.d.ts +4 -0
  111. package/dist/typescript/utils/constants.d.ts.map +1 -0
  112. package/{lib → dist}/typescript/utils/helpers.d.ts.map +1 -1
  113. package/dist/typescript/utils/local-fs.d.ts +2 -0
  114. package/dist/typescript/utils/local-fs.d.ts.map +1 -0
  115. package/dist/typescript/utils/native.d.ts +7 -0
  116. package/dist/typescript/utils/native.d.ts.map +1 -0
  117. package/ios/CloudStorage-Bridging-Header.h +0 -1
  118. package/ios/CloudStorage.xcodeproj/project.pbxproj +12 -6
  119. package/ios/CloudStorageCloudKit.swift +159 -0
  120. package/ios/CloudStorageLocalFileSystem.swift +216 -0
  121. package/ios/RCTCloudStorageCloudKit.mm +209 -0
  122. package/ios/RCTCloudStorageLocalFileSystem.mm +149 -0
  123. package/ios/Utils/CloudKitUtils.swift +12 -6
  124. package/ios/Utils/CloudStorageError.swift +8 -0
  125. package/ios/Utils/FileUtils.swift +21 -4
  126. package/ios/Utils/Promise.swift +1 -0
  127. package/ios/Utils/Types.swift +8 -1
  128. package/ios/react_native_cloud_storage.h +6 -0
  129. package/package.json +64 -110
  130. package/react-native-cloud-storage.podspec +2 -0
  131. package/src/{RNCloudStorage.ts → cloud-storage.ts} +210 -100
  132. package/src/expo-plugin/{withRNCloudStorage.ts → index.ts} +2 -2
  133. package/src/hooks/{useCloudFile.ts → use-cloud-file.ts} +24 -6
  134. package/src/hooks/{useIsCloudAvailable.ts → use-is-cloud-available.ts} +1 -1
  135. package/src/index.ts +5 -6
  136. package/src/specs/NativeCloudStorageCloudKitIOS.ts +33 -0
  137. package/src/specs/NativeCloudStorageLocalFileSystem.ts +28 -0
  138. package/src/storages/cloudkit.ts +13 -0
  139. package/src/{google-drive → storages/google-drive}/client.ts +100 -41
  140. package/src/storages/google-drive/index.ts +488 -0
  141. package/src/types/main.ts +9 -0
  142. package/src/types/native.ts +14 -22
  143. package/src/utils/cloud-storage-error.ts +15 -0
  144. package/src/utils/constants.ts +21 -0
  145. package/src/utils/local-fs.ts +19 -0
  146. package/src/utils/native.ts +40 -0
  147. package/ios/CloudStorage.m +0 -22
  148. package/ios/CloudStorage.swift +0 -103
  149. package/ios/CloudStorageEventEmitter.m +0 -16
  150. package/ios/CloudStorageEventEmitter.swift +0 -30
  151. package/lib/commonjs/RNCloudStorage.js.map +0 -1
  152. package/lib/commonjs/expo-plugin/withRNCloudStorage.js +0 -13
  153. package/lib/commonjs/expo-plugin/withRNCloudStorage.js.map +0 -1
  154. package/lib/commonjs/expo-plugin/withRNCloudStorageIos.js.map +0 -1
  155. package/lib/commonjs/google-drive/client.js.map +0 -1
  156. package/lib/commonjs/google-drive/index.js +0 -321
  157. package/lib/commonjs/google-drive/index.js.map +0 -1
  158. package/lib/commonjs/google-drive/types.js.map +0 -1
  159. package/lib/commonjs/hooks/useCloudFile.js.map +0 -1
  160. package/lib/commonjs/hooks/useIsCloudAvailable.js.map +0 -1
  161. package/lib/commonjs/index.js.map +0 -1
  162. package/lib/commonjs/types/native.js +0 -26
  163. package/lib/commonjs/types/native.js.map +0 -1
  164. package/lib/commonjs/utils/CloudStorageError.js.map +0 -1
  165. package/lib/module/RNCloudStorage.js.map +0 -1
  166. package/lib/module/expo-plugin/withRNCloudStorage.js +0 -8
  167. package/lib/module/expo-plugin/withRNCloudStorage.js.map +0 -1
  168. package/lib/module/expo-plugin/withRNCloudStorageIos.js.map +0 -1
  169. package/lib/module/google-drive/client.js.map +0 -1
  170. package/lib/module/google-drive/index.js +0 -313
  171. package/lib/module/google-drive/index.js.map +0 -1
  172. package/lib/module/google-drive/types.js.map +0 -1
  173. package/lib/module/hooks/useCloudFile.js.map +0 -1
  174. package/lib/module/hooks/useIsCloudAvailable.js.map +0 -1
  175. package/lib/module/index.js +0 -10
  176. package/lib/module/index.js.map +0 -1
  177. package/lib/module/types/native.js +0 -22
  178. package/lib/module/types/native.js.map +0 -1
  179. package/lib/module/utils/CloudStorageError.js.map +0 -1
  180. package/lib/typescript/RNCloudStorage.d.ts.map +0 -1
  181. package/lib/typescript/expo-plugin/withRNCloudStorage.d.ts.map +0 -1
  182. package/lib/typescript/expo-plugin/withRNCloudStorageIos.d.ts.map +0 -1
  183. package/lib/typescript/google-drive/client.d.ts.map +0 -1
  184. package/lib/typescript/google-drive/index.d.ts +0 -34
  185. package/lib/typescript/google-drive/index.d.ts.map +0 -1
  186. package/lib/typescript/google-drive/types.d.ts.map +0 -1
  187. package/lib/typescript/hooks/useCloudFile.d.ts.map +0 -1
  188. package/lib/typescript/hooks/useIsCloudAvailable.d.ts.map +0 -1
  189. package/lib/typescript/index.d.ts +0 -8
  190. package/lib/typescript/index.d.ts.map +0 -1
  191. package/lib/typescript/types/main.d.ts.map +0 -1
  192. package/lib/typescript/types/native.d.ts +0 -40
  193. package/lib/typescript/types/native.d.ts.map +0 -1
  194. package/lib/typescript/utils/CloudStorageError.d.ts +0 -8
  195. package/lib/typescript/utils/CloudStorageError.d.ts.map +0 -1
  196. package/src/google-drive/index.ts +0 -399
  197. package/src/utils/CloudStorageError.ts +0 -14
  198. /package/{lib → dist}/commonjs/expo-plugin/types/index.js +0 -0
  199. /package/{lib → dist}/commonjs/expo-plugin/types/index.js.map +0 -0
  200. /package/{lib/commonjs → dist/commonjs/storages}/google-drive/types.js +0 -0
  201. /package/{lib → dist}/commonjs/types/main.js +0 -0
  202. /package/{lib → dist}/commonjs/utils/helpers.js +0 -0
  203. /package/{lib → dist}/commonjs/utils/helpers.js.map +0 -0
  204. /package/{lib → dist}/module/expo-plugin/types/index.js +0 -0
  205. /package/{lib → dist}/module/expo-plugin/types/index.js.map +0 -0
  206. /package/{lib → dist}/module/package.json +0 -0
  207. /package/{lib/module → dist/module/storages}/google-drive/types.js +0 -0
  208. /package/{lib → dist}/module/types/main.js +0 -0
  209. /package/{lib → dist}/module/utils/helpers.js +0 -0
  210. /package/{lib → dist}/module/utils/helpers.js.map +0 -0
  211. /package/{lib → dist}/typescript/expo-plugin/types/index.d.ts +0 -0
  212. /package/{lib → dist}/typescript/expo-plugin/types/index.d.ts.map +0 -0
  213. /package/{lib/typescript → dist/typescript/storages}/google-drive/types.d.ts +0 -0
  214. /package/{lib → dist}/typescript/utils/helpers.d.ts +0 -0
  215. /package/src/expo-plugin/{withRNCloudStorageIos.ts → ios.ts} +0 -0
  216. /package/src/{google-drive → storages/google-drive}/types.ts +0 -0
@@ -3,12 +3,13 @@ export default class RNCloudStorage {
3
3
  private static defaultInstance;
4
4
  private provider;
5
5
  private cloudAvailabilityListeners;
6
+ private cloudAvailabilitySubscription;
6
7
  /**
7
8
  * Creates a new RNCloudStorage instance for the given provider.
8
9
  * @param provider The provider to create the instance for. Defaults to the default provider for the current platform.
9
10
  */
10
11
  constructor(provider?: CloudStorageProvider, options?: CloudStorageProviderOptions[keyof CloudStorageProviderOptions]);
11
- private get nativeInstance();
12
+ private get nativeStorage();
12
13
  /**
13
14
  * Gets the default CloudStorageProvider for the current platform.
14
15
  * @returns The default CloudStorageProvider.
@@ -24,6 +25,11 @@ export default class RNCloudStorage {
24
25
  * @returns The current CloudStorageProvider.
25
26
  */
26
27
  getProvider(): CloudStorageProvider;
28
+ private notifyCloudAvailabilityListeners;
29
+ private refreshCloudAvailability;
30
+ private getNativeCloudKitModule;
31
+ private removeCloudAvailabilitySubscription;
32
+ private configureCloudAvailabilitySubscription;
27
33
  /**
28
34
  * Sets the current CloudStorageProvider.
29
35
  * @param provider The provider to set.
@@ -41,6 +47,7 @@ export default class RNCloudStorage {
41
47
  setProviderOptions(options: CloudStorageProviderOptions[keyof CloudStorageProviderOptions]): void;
42
48
  subscribeToCloudAvailability(listener: (available: boolean) => void): void;
43
49
  unsubscribeFromCloudAvailability(listener: (available: boolean) => void): void;
50
+ private resolveNativeScope;
44
51
  /**
45
52
  * Tests whether or not the cloud storage is available. Always returns true for Google Drive. iCloud may be
46
53
  * unavailable right after app launch or if the user is not logged in.
@@ -92,12 +99,38 @@ export default class RNCloudStorage {
92
99
  */
93
100
  readFile(path: string, scope?: CloudStorageScope): Promise<string>;
94
101
  /**
95
- * Downloads the file at the given path. Does not have any effect on Google Drive.
96
- * @param path The file to trigger the download for.
102
+ * Triggers synchronization for the file at the given path. Does not have any effect on Google Drive.
103
+ * @param path The file to trigger synchronization for.
97
104
  * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
98
- * @returns A promise that resolves once the download has been triggered.
105
+ * @returns A promise that resolves once the synchronization has been triggered.
106
+ */
107
+ triggerSync(path: string, scope?: CloudStorageScope): Promise<void>;
108
+ /**
109
+ * Uploads the file at the given local path to the given path, creating it if it doesn't exist or overwriting it if it does.
110
+ * @param remotePath The remote path to upload to.
111
+ * @param localPath The local path of the file to upload.
112
+ * @param options The options for the upload. Must contain a `mimeType` property.
113
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
114
+ * @returns A promise that resolves when the file has been uploaded.
115
+ */
116
+ uploadFile(remotePath: string, localPath: string, options: {
117
+ mimeType: string;
118
+ }, scope?: CloudStorageScope): Promise<void>;
119
+ /**
120
+ * Triggers synchronization for the file at the given path. Does not have any effect on Google Drive.
121
+ * @param path The file to trigger synchronization for.
122
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
123
+ * @returns A promise that resolves once the synchronization has been triggered.
124
+ * @deprecated Use `triggerSync` instead.
99
125
  */
100
126
  downloadFile(path: string, scope?: CloudStorageScope): Promise<void>;
127
+ /**
128
+ * Downloads the cloud file at the given remote path to the given local path.
129
+ * @param remotePath The remote path of the file to download from the cloud.
130
+ * @param localPath The local path to download the cloud file to.
131
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
132
+ */
133
+ downloadFile(remotePath: string, localPath: string, scope?: CloudStorageScope): Promise<void>;
101
134
  /**
102
135
  * Deletes the file at the given path.
103
136
  * @param path The file to delete.
@@ -194,12 +227,38 @@ export default class RNCloudStorage {
194
227
  */
195
228
  static readFile(path: string, scope?: CloudStorageScope): Promise<string>;
196
229
  /**
197
- * Downloads the file at the given path in the provider of the default static instance. Does not have any effect on Google Drive.
198
- * @param path The file to trigger the download for.
230
+ * Triggers synchronization for the file at the given path in the provider of the default static instance. Does not have any effect on Google Drive.
231
+ * @param path The file to trigger synchronization for.
199
232
  * @param scope The directory scope the path is in. Defaults to the default scope set for the default static instance.
200
- * @returns A promise that resolves once the download has been triggered.
233
+ * @returns A promise that resolves once the synchronization has been triggered.
234
+ */
235
+ static triggerSync(path: string, scope?: CloudStorageScope): Promise<void>;
236
+ /**
237
+ * Uploads the file at the given local path to the given path in the provider of the default static instance, creating it if it doesn't exist or overwriting it if it does.
238
+ * @param remotePath The remote path to upload to.
239
+ * @param localPath The local path of the file to upload.
240
+ * @param options The options for the upload. Must contain a `mimeType` property.
241
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
242
+ * @returns A promise that resolves when the file has been uploaded.
243
+ */
244
+ static uploadFile(remotePath: string, localPath: string, options: {
245
+ mimeType: string;
246
+ }, scope?: CloudStorageScope): Promise<void>;
247
+ /**
248
+ * Triggers synchronization for the file at the given path in the provider of the default static instance. Does not have any effect on Google Drive.
249
+ * @param path The file to trigger synchronization for.
250
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
251
+ * @returns A promise that resolves once the synchronization has been triggered.
252
+ * @deprecated Use `triggerSync` instead.
201
253
  */
202
254
  static downloadFile(path: string, scope?: CloudStorageScope): Promise<void>;
255
+ /**
256
+ * Downloads the cloud file at the given remote path to the given local path.
257
+ * @param remotePath The remote path of the file to download from the cloud.
258
+ * @param localPath The local path to download the cloud file to.
259
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
260
+ */
261
+ static downloadFile(remotePath: string, localPath: string, scope?: CloudStorageScope): Promise<void>;
203
262
  /**
204
263
  * Deletes the file at the given path in the provider of the default static instance.
205
264
  * @param path The file to delete.
@@ -225,4 +284,4 @@ export default class RNCloudStorage {
225
284
  */
226
285
  static stat(path: string, scope?: CloudStorageScope): Promise<CloudStorageFileStat>;
227
286
  }
228
- //# sourceMappingURL=RNCloudStorage.d.ts.map
287
+ //# sourceMappingURL=cloud-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-storage.d.ts","sourceRoot":"","sources":["../../src/cloud-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAEjC,MAAM,cAAc,CAAC;AAStB,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAiB;IAC/C,OAAO,CAAC,QAAQ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;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAIpF"}
@@ -2,4 +2,4 @@ import type { RNCloudStorageConfigPluginOptions } from './types';
2
2
  import type { ConfigPlugin } from '@expo/config-plugins';
3
3
  declare const withRNCloudStorage: ConfigPlugin<RNCloudStorageConfigPluginOptions>;
4
4
  export default withRNCloudStorage;
5
- //# sourceMappingURL=withRNCloudStorage.d.ts.map
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/expo-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,QAAA,MAAM,kBAAkB,EAAE,YAAY,CAAC,iCAAiC,CAChC,CAAC;AAEzC,eAAe,kBAAkB,CAAC"}
@@ -2,4 +2,4 @@ import { type ConfigPlugin } from '@expo/config-plugins';
2
2
  import type { RNCloudStorageConfigPluginOptions } from './types';
3
3
  declare const withRNCloudStorageIos: ConfigPlugin<RNCloudStorageConfigPluginOptions>;
4
4
  export default withRNCloudStorageIos;
5
- //# sourceMappingURL=withRNCloudStorageIos.d.ts.map
5
+ //# sourceMappingURL=ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../src/expo-plugin/ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE5G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AA0CjE,QAAA,MAAM,qBAAqB,EAAE,YAAY,CAAC,iCAAiC,CAIvE,CAAC;AAEL,eAAe,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { CloudStorageScope } from '../types/main';
2
- import RNCloudStorage from '../RNCloudStorage';
2
+ import RNCloudStorage from '../cloud-storage';
3
3
  /**
4
4
  * A utility hook for reading and writing to a single file in the cloud.
5
5
  * @param path The path to the file.
@@ -8,14 +8,32 @@ import RNCloudStorage from '../RNCloudStorage';
8
8
  * @returns An object containing the file's contents and functions for downloading, reading, writing, and removing the file.
9
9
  */
10
10
  export declare const useCloudFile: (path: string, scope?: CloudStorageScope, cloudStorageInstance?: RNCloudStorage) => {
11
+ /**
12
+ * The content of the file.
13
+ */
11
14
  content: string | null;
15
+ /**
16
+ * Reads the file from the cloud.
17
+ */
12
18
  read: () => Promise<void>;
19
+ /**
20
+ * Writes new content to the file.
21
+ */
13
22
  write: (newContent: string) => Promise<void>;
23
+ /**
24
+ * Deletes the file.
25
+ */
14
26
  remove: () => Promise<void>;
15
27
  /**
16
- * Downloads the file from iCloud to the device. Needed if the file hasn't been synced yet. Has no effect on
17
- * Google Drive.
28
+ * Triggers synchronization for the file. Needed if the file hasn't been synced yet from iCloud.
29
+ * Has no effect on Google Drive.
30
+ */
31
+ sync: () => Promise<void>;
32
+ /**
33
+ * Triggers synchronization for the file. Needed if the file hasn't been synced yet from iCloud.
34
+ * Has no effect on Google Drive.
35
+ * @deprecated Use `sync` instead.
18
36
  */
19
37
  download: () => Promise<void>;
20
38
  };
21
- //# sourceMappingURL=useCloudFile.d.ts.map
39
+ //# sourceMappingURL=use-cloud-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cloud-file.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-cloud-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,QAAQ,iBAAiB,EAAE,uBAAuB,cAAc;IAmCvG;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;wBA3BgB,MAAM;IA6BzB;;OAEG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;CAGN,CAAC"}
@@ -1,8 +1,8 @@
1
- import RNCloudStorage from '../RNCloudStorage';
1
+ import RNCloudStorage from '../cloud-storage';
2
2
  /**
3
3
  * A hook that tests whether or not the cloud storage is available.
4
4
  * @param cloudStorageInstance - An optional instance of RNCloudStorage to use instead of the default instance.
5
5
  * @returns A boolean indicating whether or not the cloud storage is available.
6
6
  */
7
7
  export declare const useIsCloudAvailable: (cloudStorageInstance?: RNCloudStorage) => boolean;
8
- //# sourceMappingURL=useIsCloudAvailable.d.ts.map
8
+ //# sourceMappingURL=use-is-cloud-available.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-is-cloud-available.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-is-cloud-available.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,uBAAuB,cAAc,YAqBxE,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './types/main';
2
+ export * from './hooks/use-cloud-file';
3
+ export * from './hooks/use-is-cloud-available';
4
+ export { NativeCloudStorageErrorCode as CloudStorageErrorCode } from './types/native';
5
+ export { default as CloudStorageError } from './utils/cloud-storage-error';
6
+ export { default as CloudStorage } from './cloud-storage';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAE/C,OAAO,EAAE,2BAA2B,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { CodegenTypes, TurboModule } from 'react-native';
2
+ export type CloudStorageFileStat = {
3
+ size: number;
4
+ birthtimeMs: number;
5
+ mtimeMs: number;
6
+ isDirectory: boolean;
7
+ isFile: boolean;
8
+ };
9
+ export type CloudAvailabilityChangedEvent = {
10
+ available: boolean;
11
+ };
12
+ export interface Spec extends TurboModule {
13
+ fileExists(path: string, scope: string): Promise<boolean>;
14
+ appendToFile(path: string, data: string, scope: string): Promise<void>;
15
+ createFile(path: string, data: string, scope: string, overwrite: boolean): Promise<void>;
16
+ createDirectory(path: string, scope: string): Promise<void>;
17
+ listFiles(path: string, scope: string): Promise<Array<string>>;
18
+ readFile(path: string, scope: string): Promise<string>;
19
+ triggerSync(path: string, scope: string): Promise<void>;
20
+ deleteFile(path: string, scope: string): Promise<void>;
21
+ deleteDirectory(path: string, recursive: boolean, scope: string): Promise<void>;
22
+ statFile(path: string, scope: string): Promise<CloudStorageFileStat>;
23
+ downloadFile(remotePath: string, localPath: string, scope: string): Promise<void>;
24
+ uploadFile(remotePath: string, localPath: string, mimeType: string, scope: string, overwrite: boolean): Promise<void>;
25
+ isCloudAvailable(): Promise<boolean>;
26
+ readonly onCloudAvailabilityChanged: CodegenTypes.EventEmitter<CloudAvailabilityChangedEvent>;
27
+ }
28
+ declare const _default: Spec | null;
29
+ export default _default;
30
+ //# sourceMappingURL=NativeCloudStorageCloudKitIOS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeCloudStorageCloudKitIOS.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeCloudStorageCloudKitIOS.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAA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K,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACrE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtH,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,0BAA0B,EAAE,YAAY,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;CAC/F;;AAED,wBAAqE"}
@@ -0,0 +1,24 @@
1
+ import type { CodegenTypes, TurboModule } from 'react-native';
2
+ export type LocalFileSystemConstants = {
3
+ temporaryDirectory: string;
4
+ };
5
+ export type LocalFileSystemDownloadOptions = {
6
+ headers?: CodegenTypes.UnsafeObject;
7
+ };
8
+ export type LocalFileSystemUploadOptions = {
9
+ headers?: CodegenTypes.UnsafeObject;
10
+ method?: string;
11
+ uploadType?: string;
12
+ fieldName?: string;
13
+ parameters?: CodegenTypes.UnsafeObject;
14
+ };
15
+ export interface Spec extends TurboModule {
16
+ getConstants(): LocalFileSystemConstants;
17
+ createFile(path: string, data: string): Promise<string>;
18
+ readFile(path: string): Promise<string>;
19
+ downloadFile(remoteUri: string, localPath: string, options?: LocalFileSystemDownloadOptions): Promise<void>;
20
+ uploadFile(localPath: string, remoteUri: string, options: LocalFileSystemUploadOptions): Promise<void>;
21
+ }
22
+ declare const _default: Spec | null;
23
+ export default _default;
24
+ //# sourceMappingURL=NativeCloudStorageLocalFileSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeCloudStorageLocalFileSystem.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeCloudStorageLocalFileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,MAAM,wBAAwB,GAAG;IACrC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,YAAY,IAAI,wBAAwB,CAAC;IACzC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5G,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxG;;AAED,wBAA4E"}
@@ -0,0 +1,6 @@
1
+ import { type Spec as NativeCloudStorageCloudKitTurboModule } from '../specs/NativeCloudStorageCloudKitIOS';
2
+ import { NativeStorage } from '../types/native';
3
+ export declare const NativeCloudKitModule: NativeCloudStorageCloudKitTurboModule | null;
4
+ export declare const NativeCloudKit: NativeStorage | null;
5
+ export type { NativeCloudStorageCloudKitTurboModule };
6
+ //# sourceMappingURL=cloudkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudkit.d.ts","sourceRoot":"","sources":["../../../src/storages/cloudkit.ts"],"names":[],"mappings":"AAAA,OAAsC,EACpC,KAAK,IAAI,IAAI,qCAAqC,EACnD,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,oBAAoB,8CAAgC,CAAC;AAElE,eAAO,MAAM,cAAc,sBAE1B,CAAC;AAEF,YAAY,EAAE,qCAAqC,EAAE,CAAC"}
@@ -1,9 +1,9 @@
1
- import { type CloudStorageProviderOptions, type DeepRequired } from '../types/main';
1
+ import { type CloudStorageProviderOptions, type DeepRequired } from '../../types/main';
2
2
  import { type GoogleDriveFile, type GoogleDriveFileSpace } from './types';
3
3
  export declare class GoogleDriveHttpError extends Error {
4
4
  status: number;
5
5
  json: any;
6
- constructor(message: string, status: number, json: any);
6
+ constructor(message: string, status: number, json: unknown);
7
7
  }
8
8
  export default class GoogleDriveApiClient {
9
9
  private _fetchTimeout;
@@ -12,7 +12,7 @@ export default class GoogleDriveApiClient {
12
12
  private buildQueryString;
13
13
  private request;
14
14
  private buildMultiPartBody;
15
- listFiles(space: GoogleDriveFileSpace): Promise<GoogleDriveFile[]>;
15
+ listFiles(space: GoogleDriveFileSpace, query?: string): Promise<GoogleDriveFile[]>;
16
16
  getFile(fileId: string): Promise<GoogleDriveFile>;
17
17
  getFileText(fileId: string): Promise<string>;
18
18
  deleteFile(fileId: string): Promise<void>;
@@ -22,6 +22,9 @@ export default class GoogleDriveApiClient {
22
22
  }, media: {
23
23
  mimeType: string;
24
24
  body: string;
25
+ } | {
26
+ mimeType: string;
27
+ localPath: string;
25
28
  }): Promise<void>;
26
29
  createDirectory(metadata: {
27
30
  name: string;
@@ -30,6 +33,10 @@ export default class GoogleDriveApiClient {
30
33
  updateFile(fileId: string, media: {
31
34
  mimeType: string;
32
35
  body: string;
36
+ } | {
37
+ mimeType: string;
38
+ localPath: string;
33
39
  }): Promise<void>;
40
+ downloadFile(fileId: string, localPath: string): Promise<void>;
34
41
  }
35
42
  //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/storages/google-drive/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAG1B,MAAM,SAAS,CAAC;AAOjB,qBAAa,oBAAqB,SAAQ,KAAK;IACtC,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,GAAG,CAAC;gBAEL,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;CAK3D;AAGD,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,OAAO,CAAC,aAAa,CAA+B;IACpD,OAAO,CAAC,OAAO,CAA2D;gBAE9D,OAAO,EAAE,YAAY,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC;IAI7E,OAAO,CAAC,gBAAgB;YAeV,OAAO;IAqDrB,OAAO,CAAC,kBAAkB;IAeb,SAAS,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAsBlF,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IASjD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO5C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMzC,UAAU,CACrB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC9C,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAClF,OAAO,CAAC,IAAI,CAAC;IAqCH,eAAe,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9E,UAAU,CACrB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAClF,OAAO,CAAC,IAAI,CAAC;IAyBH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ5E"}
@@ -0,0 +1,41 @@
1
+ import { NativeStorage, type NativeStorageFileStat, type NativeStorageScope } from '../../types/native';
2
+ import { type CloudStorageProviderOptions, type DeepRequired } from '../../types/main';
3
+ /**
4
+ * A JavaScript-based implementation of the Google Drive API that implements the cloud storage interface.
5
+ */
6
+ export default class GoogleDrive implements NativeStorage {
7
+ private drive;
8
+ private options;
9
+ constructor(options: DeepRequired<CloudStorageProviderOptions['googledrive']>);
10
+ isCloudAvailable: () => Promise<boolean>;
11
+ private getRootDirectory;
12
+ private isRootPath;
13
+ private resolvePathToDirectories;
14
+ private escapeDriveQueryValue;
15
+ private getQueryRootParentId;
16
+ private findDirectoryByNameAndParent;
17
+ private findFilesByNameAndParent;
18
+ private findFilesByParent;
19
+ private findParentDirectoryId;
20
+ /**
21
+ * Gets the Google Drive ID of the root directory for the given scope.
22
+ * @param scope The scope to get the root directory for.
23
+ * @returns A promise that resolves to the ID of the root directory.
24
+ */
25
+ private getRootDirectoryId;
26
+ private checkIfMultipleFilesWithSameName;
27
+ private getFileId;
28
+ fileExists(path: string, scope: NativeStorageScope): Promise<boolean>;
29
+ appendToFile(path: string, data: string, scope: NativeStorageScope): Promise<void>;
30
+ createFile(path: string, data: string, scope: NativeStorageScope, overwrite: boolean): Promise<void>;
31
+ listFiles(path: string, scope: NativeStorageScope): Promise<string[]>;
32
+ createDirectory(path: string, scope: NativeStorageScope): Promise<void>;
33
+ readFile(path: string, scope: NativeStorageScope): Promise<string>;
34
+ triggerSync(_path: string, _scope: NativeStorageScope): Promise<void>;
35
+ deleteFile(path: string, scope: NativeStorageScope): Promise<void>;
36
+ deleteDirectory(path: string, recursive: boolean, scope: NativeStorageScope): Promise<void>;
37
+ statFile(path: string, scope: NativeStorageScope): Promise<NativeStorageFileStat>;
38
+ downloadFile(remotePath: string, localPath: string, scope: NativeStorageScope): Promise<void>;
39
+ uploadFile(remotePath: string, localPath: string, mimeType: string, scope: NativeStorageScope, overwrite: boolean): Promise<void>;
40
+ }
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storages/google-drive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEvF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,aAAa;IACvD,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,OAAO,CAA2D;gBAE9D,OAAO,EAAE,YAAY,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC;IAuBtE,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAG7C;IAEF,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,UAAU;IA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app_data"
7
7
  }
8
+ export type ICloudDocumentsMode = 'icloud' | 'legacy_sandbox';
8
9
  export interface CloudStorageFileStat {
9
10
  size: number;
10
11
  birthtimeMs: number;
@@ -24,6 +25,13 @@ export interface CloudStorageProviderOptions {
24
25
  * The directory scope to use for iCloud operations. Defaults to 'app_data'.
25
26
  */
26
27
  scope?: CloudStorageScope;
28
+ /**
29
+ * The directory mode to use for CloudStorageScope.Documents.
30
+ * `icloud` uses the user-facing iCloud Documents directory, while
31
+ * `legacy_sandbox` uses the local app sandbox Documents directory.
32
+ * Defaults to `icloud`.
33
+ */
34
+ documentsMode?: ICloudDocumentsMode;
27
35
  };
28
36
  [CloudStorageProvider.GoogleDrive]: {
29
37
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/types/main.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF,oBAAY,iBAAiB;IAC3B,SAAS,cAAc;IACvB,OAAO,aAAa;CACrB;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,gBAAgB,CAAC;AAE9D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,MAAM,EAAE,MAAM,OAAO,CAAC;CACvB;AAED,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,WAAW,gBAAgB;CAC5B;AAED,MAAM,WAAW,2BAA2B;IAC1C,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE;QAC7B;;WAEG;QACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAC1B;;;;;WAKG;QACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;KACrC,CAAC;IAEF,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE;QAClC;;WAEG;QACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAC1B;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B;;WAEG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH"}
@@ -0,0 +1,27 @@
1
+ import type { CloudStorageFileStat, Spec as NativeCloudStorageCloudKitSpec } from '../specs/NativeCloudStorageCloudKitIOS';
2
+ import type { Spec as NativeCloudStorageLocalFileSystemSpec } from '../specs/NativeCloudStorageLocalFileSystem';
3
+ export type NativeStorageScope = 'documents' | 'documents_legacy' | 'app_data';
4
+ export type NativeStorageFileStat = CloudStorageFileStat;
5
+ export declare enum NativeCloudStorageErrorCode {
6
+ INVALID_SCOPE = "ERR_INVALID_SCOPE",
7
+ FILE_NOT_FOUND = "ERR_FILE_NOT_FOUND",
8
+ PATH_IS_FILE = "ERR_PATH_IS_FILE",
9
+ PATH_IS_DIRECTORY = "ERR_PATH_IS_DIRECTORY",
10
+ DIRECTORY_NOT_FOUND = "ERR_DIRECTORY_NOT_FOUND",
11
+ DIRECTORY_NOT_EMPTY = "ERR_DIRECTORY_NOT_EMPTY",
12
+ FILE_ALREADY_EXISTS = "ERR_FILE_EXISTS",
13
+ MULTIPLE_FILES_SAME_NAME = "ERR_MULTIPLE_FILES_SAME_NAME",
14
+ AUTHENTICATION_FAILED = "ERR_AUTHENTICATION_FAILED",
15
+ WRITE_ERROR = "ERR_WRITE_ERROR",
16
+ READ_ERROR = "ERR_READ_ERROR",
17
+ DELETE_ERROR = "ERR_DELETE_ERROR",
18
+ STAT_ERROR = "ERR_STAT_ERROR",
19
+ UNKNOWN = "ERR_UNKNOWN",
20
+ FILE_NOT_DOWNLOADABLE = "ERR_FILE_NOT_DOWNLOADABLE",
21
+ ACCESS_TOKEN_MISSING = "ERR_ACCESS_TOKEN_MISSING",
22
+ INVALID_URL = "ERR_INVALID_URL",
23
+ NETWORK_ERROR = "ERR_NETWORK_ERROR"
24
+ }
25
+ export type NativeLocalFileSystem = NativeCloudStorageLocalFileSystemSpec;
26
+ export type NativeStorage = Omit<NativeCloudStorageCloudKitSpec, 'onCloudAvailabilityChanged'>;
27
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/types/native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,IAAI,IAAI,8BAA8B,EACvC,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,IAAI,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAEhH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAE/E,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEzD,oBAAY,2BAA2B;IACrC,aAAa,sBAAsB;IACnC,cAAc,uBAAuB;IACrC,YAAY,qBAAqB;IACjC,iBAAiB,0BAA0B;IAC3C,mBAAmB,4BAA4B;IAC/C,mBAAmB,4BAA4B;IAC/C,mBAAmB,oBAAoB;IACvC,wBAAwB,iCAAiC;IACzD,qBAAqB,8BAA8B;IACnD,WAAW,oBAAoB;IAC/B,UAAU,mBAAmB;IAC7B,YAAY,qBAAqB;IACjC,UAAU,mBAAmB;IAC7B,OAAO,gBAAgB;IACvB,qBAAqB,8BAA8B;IACnD,oBAAoB,6BAA6B;IACjD,WAAW,oBAAoB;IAC/B,aAAa,sBAAsB;CACpC;AAED,MAAM,MAAM,qBAAqB,GAAG,qCAAqC,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,8BAA8B,EAAE,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { NativeCloudStorageErrorCode } from '../types/native';
2
+ declare class CloudStorageError extends Error {
3
+ code: NativeCloudStorageErrorCode;
4
+ details?: any;
5
+ constructor(message: string, code: NativeCloudStorageErrorCode, details?: any);
6
+ }
7
+ export default CloudStorageError;
8
+ //# sourceMappingURL=cloud-storage-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-storage-error.d.ts","sourceRoot":"","sources":["../../../src/utils/cloud-storage-error.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAEnE,cAAM,iBAAkB,SAAQ,KAAK;IACnC,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,CAAC,EAAE,GAAG,CAAC;gBAEF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,CAAC,EAAE,GAAG;CAK9E;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { CloudStorageProviderOptions, DeepRequired } from '../types/main';
2
+ export declare const LINKING_ERROR: string;
3
+ export declare const DEFAULT_PROVIDER_OPTIONS: DeepRequired<CloudStorageProviderOptions>;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,2BAA2B,EAAqB,YAAY,EAAE,MAAM,eAAe,CAAC;AAEnH,eAAO,MAAM,aAAa,QAIO,CAAC;AAElC,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,2BAA2B,CAW9E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,eAAO,MAAM,mBAAmB,aAAc,oBAAoB,KAAG,OAMpE,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,eAAO,MAAM,mBAAmB,GAAI,UAAU,oBAAoB,KAAG,OAMpE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const localFileSystem: import("../specs/NativeCloudStorageLocalFileSystem").Spec;
2
+ //# sourceMappingURL=local-fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-fs.d.ts","sourceRoot":"","sources":["../../../src/utils/local-fs.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,2DASE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates a proxied native module that wraps thrown errors in a CloudStorageError.
3
+ * @param nativeModule The native module to proxy.
4
+ * @returns The proxied native module.
5
+ */
6
+ export declare const createProxiedNativeModule: <T extends object>(nativeModule: T | null | undefined) => T | null;
7
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/utils/native.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,MAAM,EAAE,cAAc,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,CAAC,GAAG,IA+BpG,CAAC"}
@@ -1,3 +1,2 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
  #import <React/RCTViewManager.h>
3
- #import <React/RCTEventEmitter.h>
@@ -7,13 +7,14 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ 5038BD322DFB657800C1D225 /* CloudStorageLocalFileSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5038BD312DFB656A00C1D225 /* CloudStorageLocalFileSystem.swift */; };
10
11
  50ADE3732B56EE1300DB5583 /* CloudStorageEventEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5009AB9B2B56ECD30058E83A /* CloudStorageEventEmitter.swift */; };
11
12
  50BC353B2CA6ED940085E8B9 /* FileUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BC353A2CA6ED940085E8B9 /* FileUtils.swift */; };
12
13
  50BC353F2CA6EF760085E8B9 /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BC353E2CA6EF760085E8B9 /* Types.swift */; };
13
14
  50BC35412CA6F0E80085E8B9 /* CloudKitUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BC35402CA6F0E80085E8B9 /* CloudKitUtils.swift */; };
14
15
  50BC35452CA6FA6D0085E8B9 /* CloudStorageError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BC35442CA6FA6D0085E8B9 /* CloudStorageError.swift */; };
15
16
  50BC35472CA6FF3F0085E8B9 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BC35462CA6FF3F0085E8B9 /* Promise.swift */; };
16
- F4FF95D7245B92E800C19C63 /* CloudStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* CloudStorage.swift */; };
17
+ F4FF95D7245B92E800C19C63 /* CloudStorageCloudKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* CloudStorageCloudKit.swift */; };
17
18
  /* End PBXBuildFile section */
18
19
 
19
20
  /* Begin PBXCopyFilesBuildPhase section */
@@ -31,15 +32,17 @@
31
32
  /* Begin PBXFileReference section */
32
33
  134814201AA4EA6300B7C361 /* libCloudStorage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCloudStorage.a; sourceTree = BUILT_PRODUCTS_DIR; };
33
34
  5009AB9B2B56ECD30058E83A /* CloudStorageEventEmitter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorageEventEmitter.swift; sourceTree = "<group>"; };
35
+ 5038BD312DFB656A00C1D225 /* CloudStorageLocalFileSystem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorageLocalFileSystem.swift; sourceTree = "<group>"; };
36
+ 5038BD352DFB659F00C1D225 /* CloudStorageLocalFileSystem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CloudStorageLocalFileSystem.m; sourceTree = "<group>"; };
34
37
  50ADE3712B56EDFB00DB5583 /* CloudStorageEventEmitter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CloudStorageEventEmitter.m; sourceTree = "<group>"; };
35
38
  50BC353A2CA6ED940085E8B9 /* FileUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileUtils.swift; sourceTree = "<group>"; };
36
39
  50BC353E2CA6EF760085E8B9 /* Types.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Types.swift; sourceTree = "<group>"; };
37
40
  50BC35402CA6F0E80085E8B9 /* CloudKitUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudKitUtils.swift; sourceTree = "<group>"; };
38
41
  50BC35442CA6FA6D0085E8B9 /* CloudStorageError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorageError.swift; sourceTree = "<group>"; };
39
42
  50BC35462CA6FF3F0085E8B9 /* Promise.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Promise.swift; sourceTree = "<group>"; };
40
- B3E7B5891CC2AC0600A0062D /* CloudStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CloudStorage.m; sourceTree = "<group>"; };
43
+ B3E7B5891CC2AC0600A0062D /* CloudStorageCloudKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CloudStorageCloudKit.m; sourceTree = "<group>"; };
41
44
  F4FF95D5245B92E700C19C63 /* CloudStorage-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CloudStorage-Bridging-Header.h"; sourceTree = "<group>"; };
42
- F4FF95D6245B92E800C19C63 /* CloudStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorage.swift; sourceTree = "<group>"; };
45
+ F4FF95D6245B92E800C19C63 /* CloudStorageCloudKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorageCloudKit.swift; sourceTree = "<group>"; };
43
46
  /* End PBXFileReference section */
44
47
 
45
48
  /* Begin PBXFrameworksBuildPhase section */
@@ -77,10 +80,12 @@
77
80
  isa = PBXGroup;
78
81
  children = (
79
82
  50BC35482CA704A60085E8B9 /* Utils */,
83
+ F4FF95D6245B92E800C19C63 /* CloudStorageCloudKit.swift */,
84
+ B3E7B5891CC2AC0600A0062D /* CloudStorageCloudKit.m */,
80
85
  50ADE3712B56EDFB00DB5583 /* CloudStorageEventEmitter.m */,
81
86
  5009AB9B2B56ECD30058E83A /* CloudStorageEventEmitter.swift */,
82
- F4FF95D6245B92E800C19C63 /* CloudStorage.swift */,
83
- B3E7B5891CC2AC0600A0062D /* CloudStorage.m */,
87
+ 5038BD312DFB656A00C1D225 /* CloudStorageLocalFileSystem.swift */,
88
+ 5038BD352DFB659F00C1D225 /* CloudStorageLocalFileSystem.m */,
84
89
  F4FF95D5245B92E700C19C63 /* CloudStorage-Bridging-Header.h */,
85
90
  134814211AA4EA7D00B7C361 /* Products */,
86
91
  );
@@ -143,11 +148,12 @@
143
148
  isa = PBXSourcesBuildPhase;
144
149
  buildActionMask = 2147483647;
145
150
  files = (
151
+ 5038BD322DFB657800C1D225 /* CloudStorageLocalFileSystem.swift in Sources */,
146
152
  50BC353B2CA6ED940085E8B9 /* FileUtils.swift in Sources */,
147
153
  50BC35412CA6F0E80085E8B9 /* CloudKitUtils.swift in Sources */,
148
154
  50BC35472CA6FF3F0085E8B9 /* Promise.swift in Sources */,
149
155
  50BC35452CA6FA6D0085E8B9 /* CloudStorageError.swift in Sources */,
150
- F4FF95D7245B92E800C19C63 /* CloudStorage.swift in Sources */,
156
+ F4FF95D7245B92E800C19C63 /* CloudStorageCloudKit.swift in Sources */,
151
157
  50ADE3732B56EE1300DB5583 /* CloudStorageEventEmitter.swift in Sources */,
152
158
  50BC353F2CA6EF760085E8B9 /* Types.swift in Sources */,
153
159
  );