react-native-cloud-storage 2.2.1 → 2.3.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 (188) hide show
  1. package/LICENSE +1 -1
  2. package/android/build.gradle +101 -0
  3. package/android/gradle.properties +5 -0
  4. package/android/src/main/AndroidManifest.xml +3 -0
  5. package/android/src/main/AndroidManifestNew.xml +2 -0
  6. package/android/src/main/java/com/voicekit/CloudStorageError.kt +86 -0
  7. package/android/src/main/java/com/voicekit/CloudStorageLocalFileSystemModule.kt +236 -0
  8. package/android/src/main/java/com/voicekit/CloudStoragePackage.kt +17 -0
  9. package/android/src/main/java/com/voicekit/FileUtils.kt +41 -0
  10. package/android/src/main/java/com/voicekit/Types.kt +6 -0
  11. package/app.plugin.js +1 -1
  12. package/{lib/commonjs/RNCloudStorage.js → dist/commonjs/cloud-storage.js} +130 -80
  13. package/dist/commonjs/cloud-storage.js.map +1 -0
  14. package/dist/commonjs/expo-plugin/index.js +13 -0
  15. package/dist/commonjs/expo-plugin/index.js.map +1 -0
  16. package/{lib/commonjs/expo-plugin/withRNCloudStorageIos.js → dist/commonjs/expo-plugin/ios.js} +1 -1
  17. package/dist/commonjs/expo-plugin/ios.js.map +1 -0
  18. package/{lib/commonjs/hooks/useCloudFile.js → dist/commonjs/hooks/use-cloud-file.js} +26 -8
  19. package/dist/commonjs/hooks/use-cloud-file.js.map +1 -0
  20. package/{lib/commonjs/hooks/useIsCloudAvailable.js → dist/commonjs/hooks/use-is-cloud-available.js} +3 -3
  21. package/dist/commonjs/hooks/use-is-cloud-available.js.map +1 -0
  22. package/{lib → dist}/commonjs/index.js +10 -10
  23. package/dist/commonjs/index.js.map +1 -0
  24. package/dist/commonjs/storages/cloudkit.js +10 -0
  25. package/dist/commonjs/storages/cloudkit.js.map +1 -0
  26. package/{lib/commonjs → dist/commonjs/storages}/google-drive/client.js +82 -39
  27. package/dist/commonjs/storages/google-drive/client.js.map +1 -0
  28. package/{lib/commonjs → dist/commonjs/storages}/google-drive/index.js +120 -64
  29. package/dist/commonjs/storages/google-drive/index.js.map +1 -0
  30. package/dist/commonjs/storages/google-drive/types.js.map +1 -0
  31. package/dist/commonjs/types/native.js +28 -0
  32. package/dist/commonjs/types/native.js.map +1 -0
  33. package/{lib/commonjs/utils/CloudStorageError.js → dist/commonjs/utils/cloud-storage-error.js} +3 -1
  34. package/dist/commonjs/utils/cloud-storage-error.js.map +1 -0
  35. package/dist/commonjs/utils/constants.js +24 -0
  36. package/dist/commonjs/utils/constants.js.map +1 -0
  37. package/dist/commonjs/utils/local-fs.js +16 -0
  38. package/dist/commonjs/utils/local-fs.js.map +1 -0
  39. package/dist/commonjs/utils/native.js +35 -0
  40. package/dist/commonjs/utils/native.js.map +1 -0
  41. package/{lib/module/RNCloudStorage.js → dist/module/cloud-storage.js} +130 -80
  42. package/dist/module/cloud-storage.js.map +1 -0
  43. package/dist/module/expo-plugin/index.js +8 -0
  44. package/dist/module/expo-plugin/index.js.map +1 -0
  45. package/{lib/module/expo-plugin/withRNCloudStorageIos.js → dist/module/expo-plugin/ios.js} +1 -1
  46. package/dist/module/expo-plugin/ios.js.map +1 -0
  47. package/{lib/module/hooks/useCloudFile.js → dist/module/hooks/use-cloud-file.js} +25 -7
  48. package/dist/module/hooks/use-cloud-file.js.map +1 -0
  49. package/{lib/module/hooks/useIsCloudAvailable.js → dist/module/hooks/use-is-cloud-available.js} +2 -2
  50. package/dist/module/hooks/use-is-cloud-available.js.map +1 -0
  51. package/dist/module/index.js +9 -0
  52. package/dist/module/index.js.map +1 -0
  53. package/dist/module/storages/cloudkit.js +6 -0
  54. package/dist/module/storages/cloudkit.js.map +1 -0
  55. package/{lib/module → dist/module/storages}/google-drive/client.js +82 -39
  56. package/dist/module/storages/google-drive/client.js.map +1 -0
  57. package/{lib/module → dist/module/storages}/google-drive/index.js +119 -62
  58. package/dist/module/storages/google-drive/index.js.map +1 -0
  59. package/dist/module/storages/google-drive/types.js.map +1 -0
  60. package/dist/module/types/native.js +24 -0
  61. package/dist/module/types/native.js.map +1 -0
  62. package/{lib/module/utils/CloudStorageError.js → dist/module/utils/cloud-storage-error.js} +3 -1
  63. package/dist/module/utils/cloud-storage-error.js.map +1 -0
  64. package/dist/module/utils/constants.js +20 -0
  65. package/dist/module/utils/constants.js.map +1 -0
  66. package/dist/module/utils/local-fs.js +12 -0
  67. package/dist/module/utils/local-fs.js.map +1 -0
  68. package/dist/module/utils/native.js +30 -0
  69. package/dist/module/utils/native.js.map +1 -0
  70. package/{lib/typescript/RNCloudStorage.d.ts → dist/typescript/cloud-storage.d.ts} +60 -8
  71. package/dist/typescript/cloud-storage.d.ts.map +1 -0
  72. package/{lib/typescript/expo-plugin/withRNCloudStorage.d.ts → dist/typescript/expo-plugin/index.d.ts} +1 -1
  73. package/dist/typescript/expo-plugin/index.d.ts.map +1 -0
  74. package/{lib/typescript/expo-plugin/withRNCloudStorageIos.d.ts → dist/typescript/expo-plugin/ios.d.ts} +1 -1
  75. package/dist/typescript/expo-plugin/ios.d.ts.map +1 -0
  76. package/{lib/typescript/hooks/useCloudFile.d.ts → dist/typescript/hooks/use-cloud-file.d.ts} +22 -4
  77. package/dist/typescript/hooks/use-cloud-file.d.ts.map +1 -0
  78. package/{lib/typescript/hooks/useIsCloudAvailable.d.ts → dist/typescript/hooks/use-is-cloud-available.d.ts} +2 -2
  79. package/dist/typescript/hooks/use-is-cloud-available.d.ts.map +1 -0
  80. package/dist/typescript/index.d.ts +7 -0
  81. package/dist/typescript/index.d.ts.map +1 -0
  82. package/dist/typescript/storages/cloudkit.d.ts +3 -0
  83. package/dist/typescript/storages/cloudkit.d.ts.map +1 -0
  84. package/{lib/typescript → dist/typescript/storages}/google-drive/client.d.ts +9 -2
  85. package/dist/typescript/storages/google-drive/client.d.ts.map +1 -0
  86. package/dist/typescript/storages/google-drive/index.d.ts +35 -0
  87. package/dist/typescript/storages/google-drive/index.d.ts.map +1 -0
  88. package/dist/typescript/storages/google-drive/types.d.ts.map +1 -0
  89. package/dist/typescript/types/native.d.ts +64 -0
  90. package/dist/typescript/types/native.d.ts.map +1 -0
  91. package/dist/typescript/utils/cloud-storage-error.d.ts +8 -0
  92. package/dist/typescript/utils/cloud-storage-error.d.ts.map +1 -0
  93. package/dist/typescript/utils/constants.d.ts +4 -0
  94. package/dist/typescript/utils/constants.d.ts.map +1 -0
  95. package/{lib → dist}/typescript/utils/helpers.d.ts.map +1 -1
  96. package/dist/typescript/utils/local-fs.d.ts +3 -0
  97. package/dist/typescript/utils/local-fs.d.ts.map +1 -0
  98. package/dist/typescript/utils/native.d.ts +7 -0
  99. package/dist/typescript/utils/native.d.ts.map +1 -0
  100. package/ios/CloudStorage.xcodeproj/project.pbxproj +12 -6
  101. package/ios/{CloudStorage.m → CloudStorageCloudKit.m} +4 -2
  102. package/ios/{CloudStorage.swift → CloudStorageCloudKit.swift} +60 -5
  103. package/ios/CloudStorageLocalFileSystem.m +15 -0
  104. package/ios/CloudStorageLocalFileSystem.swift +215 -0
  105. package/ios/Utils/CloudKitUtils.swift +4 -4
  106. package/ios/Utils/CloudStorageError.swift +8 -0
  107. package/ios/Utils/FileUtils.swift +19 -0
  108. package/ios/Utils/Types.swift +7 -1
  109. package/package.json +44 -103
  110. package/src/{RNCloudStorage.ts → cloud-storage.ts} +147 -85
  111. package/src/expo-plugin/{withRNCloudStorage.ts → index.ts} +2 -2
  112. package/src/hooks/{useCloudFile.ts → use-cloud-file.ts} +24 -6
  113. package/src/hooks/{useIsCloudAvailable.ts → use-is-cloud-available.ts} +1 -1
  114. package/src/index.ts +5 -6
  115. package/src/storages/cloudkit.ts +5 -0
  116. package/src/{google-drive → storages/google-drive}/client.ts +99 -40
  117. package/src/{google-drive → storages/google-drive}/index.ts +172 -89
  118. package/src/types/native.ts +50 -14
  119. package/src/utils/cloud-storage-error.ts +15 -0
  120. package/src/utils/constants.ts +20 -0
  121. package/src/utils/local-fs.ts +19 -0
  122. package/src/utils/native.ts +40 -0
  123. package/lib/commonjs/RNCloudStorage.js.map +0 -1
  124. package/lib/commonjs/expo-plugin/withRNCloudStorage.js +0 -13
  125. package/lib/commonjs/expo-plugin/withRNCloudStorage.js.map +0 -1
  126. package/lib/commonjs/expo-plugin/withRNCloudStorageIos.js.map +0 -1
  127. package/lib/commonjs/google-drive/client.js.map +0 -1
  128. package/lib/commonjs/google-drive/index.js.map +0 -1
  129. package/lib/commonjs/google-drive/types.js.map +0 -1
  130. package/lib/commonjs/hooks/useCloudFile.js.map +0 -1
  131. package/lib/commonjs/hooks/useIsCloudAvailable.js.map +0 -1
  132. package/lib/commonjs/index.js.map +0 -1
  133. package/lib/commonjs/types/native.js +0 -26
  134. package/lib/commonjs/types/native.js.map +0 -1
  135. package/lib/commonjs/utils/CloudStorageError.js.map +0 -1
  136. package/lib/module/RNCloudStorage.js.map +0 -1
  137. package/lib/module/expo-plugin/withRNCloudStorage.js +0 -8
  138. package/lib/module/expo-plugin/withRNCloudStorage.js.map +0 -1
  139. package/lib/module/expo-plugin/withRNCloudStorageIos.js.map +0 -1
  140. package/lib/module/google-drive/client.js.map +0 -1
  141. package/lib/module/google-drive/index.js.map +0 -1
  142. package/lib/module/google-drive/types.js.map +0 -1
  143. package/lib/module/hooks/useCloudFile.js.map +0 -1
  144. package/lib/module/hooks/useIsCloudAvailable.js.map +0 -1
  145. package/lib/module/index.js +0 -10
  146. package/lib/module/index.js.map +0 -1
  147. package/lib/module/types/native.js +0 -22
  148. package/lib/module/types/native.js.map +0 -1
  149. package/lib/module/utils/CloudStorageError.js.map +0 -1
  150. package/lib/typescript/RNCloudStorage.d.ts.map +0 -1
  151. package/lib/typescript/expo-plugin/withRNCloudStorage.d.ts.map +0 -1
  152. package/lib/typescript/expo-plugin/withRNCloudStorageIos.d.ts.map +0 -1
  153. package/lib/typescript/google-drive/client.d.ts.map +0 -1
  154. package/lib/typescript/google-drive/index.d.ts +0 -34
  155. package/lib/typescript/google-drive/index.d.ts.map +0 -1
  156. package/lib/typescript/google-drive/types.d.ts.map +0 -1
  157. package/lib/typescript/hooks/useCloudFile.d.ts.map +0 -1
  158. package/lib/typescript/hooks/useIsCloudAvailable.d.ts.map +0 -1
  159. package/lib/typescript/index.d.ts +0 -8
  160. package/lib/typescript/index.d.ts.map +0 -1
  161. package/lib/typescript/types/native.d.ts +0 -40
  162. package/lib/typescript/types/native.d.ts.map +0 -1
  163. package/lib/typescript/utils/CloudStorageError.d.ts +0 -8
  164. package/lib/typescript/utils/CloudStorageError.d.ts.map +0 -1
  165. package/src/utils/CloudStorageError.ts +0 -14
  166. /package/{lib → dist}/commonjs/expo-plugin/types/index.js +0 -0
  167. /package/{lib → dist}/commonjs/expo-plugin/types/index.js.map +0 -0
  168. /package/{lib/commonjs → dist/commonjs/storages}/google-drive/types.js +0 -0
  169. /package/{lib → dist}/commonjs/types/main.js +0 -0
  170. /package/{lib → dist}/commonjs/types/main.js.map +0 -0
  171. /package/{lib → dist}/commonjs/utils/helpers.js +0 -0
  172. /package/{lib → dist}/commonjs/utils/helpers.js.map +0 -0
  173. /package/{lib → dist}/module/expo-plugin/types/index.js +0 -0
  174. /package/{lib → dist}/module/expo-plugin/types/index.js.map +0 -0
  175. /package/{lib → dist}/module/package.json +0 -0
  176. /package/{lib/module → dist/module/storages}/google-drive/types.js +0 -0
  177. /package/{lib → dist}/module/types/main.js +0 -0
  178. /package/{lib → dist}/module/types/main.js.map +0 -0
  179. /package/{lib → dist}/module/utils/helpers.js +0 -0
  180. /package/{lib → dist}/module/utils/helpers.js.map +0 -0
  181. /package/{lib → dist}/typescript/expo-plugin/types/index.d.ts +0 -0
  182. /package/{lib → dist}/typescript/expo-plugin/types/index.d.ts.map +0 -0
  183. /package/{lib/typescript → dist/typescript/storages}/google-drive/types.d.ts +0 -0
  184. /package/{lib → dist}/typescript/types/main.d.ts +0 -0
  185. /package/{lib → dist}/typescript/types/main.d.ts.map +0 -0
  186. /package/{lib → dist}/typescript/utils/helpers.d.ts +0 -0
  187. /package/src/expo-plugin/{withRNCloudStorageIos.ts → ios.ts} +0 -0
  188. /package/src/{google-drive → storages/google-drive}/types.ts +0 -0
@@ -5,49 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _main = require("./types/main");
8
+ var _native = require("./types/native");
8
9
  var _helpers = require("./utils/helpers");
9
10
  var _reactNative = require("react-native");
10
- var _CloudStorageError = _interopRequireDefault(require("./utils/CloudStorageError"));
11
- var _native = require("./types/native");
12
- var _googleDrive = _interopRequireDefault(require("./google-drive"));
11
+ var _googleDrive = _interopRequireDefault(require("./storages/google-drive"));
12
+ var _cloudkit = require("./storages/cloudkit");
13
+ var _constants = require("./utils/constants");
14
+ var _cloudStorageError = _interopRequireDefault(require("./utils/cloud-storage-error"));
13
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- const LINKING_ERROR = `The package 'react-native-cloud-storage' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
15
- ios: "- You have run 'pod install'\n",
16
- default: ''
17
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
18
-
19
- // proxy NativeModules.CloudStorage to catch any errors thrown by the native module and wrap them in a CloudStorageError
20
- const nativeIosInstance = _reactNative.NativeModules.CloudStorage ? new Proxy(_reactNative.NativeModules.CloudStorage, {
21
- get(target, prop) {
22
- const originalFunction = target[prop];
23
- if (typeof originalFunction === 'function') {
24
- return async (...args) => {
25
- try {
26
- // @ts-expect-error - we can't know the types of the functions and their arguments
27
- return await originalFunction(...args);
28
- } catch (error) {
29
- if (error?.code && Object.values(_native.CloudStorageErrorCode).includes(error.code)) {
30
- throw new _CloudStorageError.default(error?.message || '', error.code);
31
- } else {
32
- throw new _CloudStorageError.default('Unknown error', _native.CloudStorageErrorCode.UNKNOWN, error);
33
- }
34
- }
35
- };
36
- }
37
- return originalFunction;
38
- }
39
- }) : null;
40
- const defaultProviderOptions = {
41
- [_main.CloudStorageProvider.ICloud]: {
42
- scope: _main.CloudStorageScope.AppData
43
- },
44
- [_main.CloudStorageProvider.GoogleDrive]: {
45
- scope: _main.CloudStorageScope.AppData,
46
- accessToken: null,
47
- strictFilenames: false,
48
- timeout: 3000
49
- }
50
- };
51
16
  class RNCloudStorage {
52
17
  cloudAvailabilityListeners = [];
53
18
 
@@ -62,23 +27,27 @@ class RNCloudStorage {
62
27
  }
63
28
  this.provider = {
64
29
  provider: provider ?? RNCloudStorage.getDefaultProvider(),
65
- options: defaultProviderOptions[provider ?? RNCloudStorage.getDefaultProvider()]
30
+ options: _constants.DEFAULT_PROVIDER_OPTIONS[provider ?? RNCloudStorage.getDefaultProvider()]
66
31
  };
67
32
  this.setProvider(provider ?? RNCloudStorage.getDefaultProvider());
68
33
  if (options) {
69
34
  this.setProviderOptions(options);
70
35
  }
71
36
  }
72
- get nativeInstance() {
37
+ get nativeStorage() {
73
38
  switch (this.provider.provider) {
74
39
  case _main.CloudStorageProvider.ICloud:
75
- return nativeIosInstance ?? new Proxy({}, {
76
- get() {
77
- throw new Error(LINKING_ERROR);
78
- }
79
- });
40
+ {
41
+ return _cloudkit.NativeCloudKit ?? new Proxy({}, {
42
+ get() {
43
+ throw new Error(_constants.LINKING_ERROR);
44
+ }
45
+ });
46
+ }
80
47
  default:
81
- return new _googleDrive.default(this.provider.options);
48
+ {
49
+ return new _googleDrive.default(this.provider.options);
50
+ }
82
51
  }
83
52
  }
84
53
 
@@ -89,9 +58,13 @@ class RNCloudStorage {
89
58
  static getDefaultProvider() {
90
59
  switch (_reactNative.Platform.OS) {
91
60
  case 'ios':
92
- return _main.CloudStorageProvider.ICloud;
61
+ {
62
+ return _main.CloudStorageProvider.ICloud;
63
+ }
93
64
  default:
94
- return _main.CloudStorageProvider.GoogleDrive;
65
+ {
66
+ return _main.CloudStorageProvider.GoogleDrive;
67
+ }
95
68
  }
96
69
  }
97
70
 
@@ -100,7 +73,7 @@ class RNCloudStorage {
100
73
  * @returns An array of supported CloudStorageProviders.
101
74
  */
102
75
  static getSupportedProviders() {
103
- return Object.values(_main.CloudStorageProvider).filter(_helpers.isProviderSupported);
76
+ return Object.values(_main.CloudStorageProvider).filter(provider => (0, _helpers.isProviderSupported)(provider));
104
77
  }
105
78
 
106
79
  /**
@@ -121,22 +94,22 @@ class RNCloudStorage {
121
94
  }
122
95
  this.provider = {
123
96
  provider,
124
- options: defaultProviderOptions[provider]
97
+ options: _constants.DEFAULT_PROVIDER_OPTIONS[provider]
125
98
  };
126
99
 
127
100
  // Emit an event to notify useIsCloudAvailable() hook consumers of the new cloud availability status
128
- this.nativeInstance.isCloudAvailable().then(available => {
129
- this.cloudAvailabilityListeners.forEach(listener => {
101
+ this.nativeStorage.isCloudAvailable().then(available => {
102
+ for (const listener of this.cloudAvailabilityListeners) {
130
103
  listener(available);
131
- });
104
+ }
132
105
  });
133
106
  if (provider === _main.CloudStorageProvider.ICloud) {
134
107
  // Listen to native cloud availability change events
135
108
  const eventEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.CloudStorageEventEmitter);
136
109
  eventEmitter.addListener('RNCloudStorage.cloud.availability-changed', event => {
137
- this.cloudAvailabilityListeners.forEach(listener => {
110
+ for (const listener of this.cloudAvailabilityListeners) {
138
111
  listener(event.available);
139
- });
112
+ }
140
113
  });
141
114
  }
142
115
  }
@@ -161,9 +134,9 @@ class RNCloudStorage {
161
134
  };
162
135
  if (this.provider.provider === _main.CloudStorageProvider.GoogleDrive && 'accessToken' in newOptions) {
163
136
  // Emit an event to notify useIsCloudAvailable() hook consumers of the new cloud availability status
164
- this.cloudAvailabilityListeners.forEach(listener => {
137
+ for (const listener of this.cloudAvailabilityListeners) {
165
138
  listener(!!newOptions.accessToken?.length);
166
- });
139
+ }
167
140
  }
168
141
  }
169
142
  subscribeToCloudAvailability(listener) {
@@ -181,7 +154,7 @@ class RNCloudStorage {
181
154
  * @returns A promise that resolves to true if the cloud storage is available, false otherwise.
182
155
  */
183
156
  isCloudAvailable() {
184
- return this.nativeInstance.isCloudAvailable();
157
+ return this.nativeStorage.isCloudAvailable();
185
158
  }
186
159
 
187
160
  /**
@@ -192,7 +165,7 @@ class RNCloudStorage {
192
165
  * @returns A promise that resolves when the data has been appended.
193
166
  */
194
167
  appendFile(path, data, scope) {
195
- return this.nativeInstance.appendToFile(path, data, scope ?? this.provider.options.scope);
168
+ return this.nativeStorage.appendToFile(path, data, scope ?? this.provider.options.scope);
196
169
  }
197
170
 
198
171
  /**
@@ -202,7 +175,7 @@ class RNCloudStorage {
202
175
  * @returns A promise that resolves to true if the path exists, false otherwise.
203
176
  */
204
177
  exists(path, scope) {
205
- return this.nativeInstance.fileExists(path, scope ?? this.provider.options.scope);
178
+ return this.nativeStorage.fileExists(path, scope ?? this.provider.options.scope);
206
179
  }
207
180
 
208
181
  /**
@@ -213,7 +186,7 @@ class RNCloudStorage {
213
186
  * @returns A promise that resolves when the file has been written.
214
187
  */
215
188
  writeFile(path, data, scope) {
216
- return this.nativeInstance.createFile(path, data, scope ?? this.provider.options.scope, true);
189
+ return this.nativeStorage.createFile(path, data, scope ?? this.provider.options.scope, true);
217
190
  }
218
191
 
219
192
  /**
@@ -223,7 +196,7 @@ class RNCloudStorage {
223
196
  * @returns A promise that resolves when the directory has been created.
224
197
  */
225
198
  mkdir(path, scope) {
226
- return this.nativeInstance.createDirectory(path, scope ?? this.provider.options.scope);
199
+ return this.nativeStorage.createDirectory(path, scope ?? this.provider.options.scope);
227
200
  }
228
201
 
229
202
  /**
@@ -233,7 +206,7 @@ class RNCloudStorage {
233
206
  * @returns A promise that resolves to an array of file names, excluding '.' and '..'.
234
207
  */
235
208
  readdir(path, scope) {
236
- return this.nativeInstance.listFiles(path, scope ?? this.provider.options.scope);
209
+ return this.nativeStorage.listFiles(path, scope ?? this.provider.options.scope);
237
210
  }
238
211
 
239
212
  /**
@@ -243,17 +216,55 @@ class RNCloudStorage {
243
216
  * @returns A promise that resolves to the contents of the file.
244
217
  */
245
218
  readFile(path, scope) {
246
- return this.nativeInstance.readFile(path, scope ?? this.provider.options.scope);
219
+ return this.nativeStorage.readFile(path, scope ?? this.provider.options.scope);
247
220
  }
248
221
 
249
222
  /**
250
- * Downloads the file at the given path. Does not have any effect on Google Drive.
251
- * @param path The file to trigger the download for.
223
+ * Triggers synchronization for the file at the given path. Does not have any effect on Google Drive.
224
+ * @param path The file to trigger synchronization for.
225
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
226
+ * @returns A promise that resolves once the synchronization has been triggered.
227
+ */
228
+ triggerSync(path, scope) {
229
+ return this.nativeStorage.triggerSync(path, scope ?? this.provider.options.scope);
230
+ }
231
+
232
+ /**
233
+ * 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.
234
+ * @param remotePath The remote path to upload to.
235
+ * @param localPath The local path of the file to upload.
236
+ * @param options The options for the upload. Must contain a `mimeType` property.
237
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
238
+ * @returns A promise that resolves when the file has been uploaded.
239
+ */
240
+ uploadFile(remotePath, localPath, options, scope) {
241
+ return this.nativeStorage.uploadFile(remotePath, localPath, options.mimeType, scope ?? this.provider.options.scope, true);
242
+ }
243
+
244
+ /**
245
+ * Triggers synchronization for the file at the given path. Does not have any effect on Google Drive.
246
+ * @param path The file to trigger synchronization for.
247
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
248
+ * @returns A promise that resolves once the synchronization has been triggered.
249
+ * @deprecated Use `triggerSync` instead.
250
+ */
251
+
252
+ /**
253
+ * Downloads the cloud file at the given remote path to the given local path.
254
+ * @param remotePath The remote path of the file to download from the cloud.
255
+ * @param localPath The local path to download the cloud file to.
252
256
  * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
253
- * @returns A promise that resolves once the download has been triggered.
254
257
  */
255
- downloadFile(path, scope) {
256
- return this.nativeInstance.downloadFile(path, scope ?? this.provider.options.scope);
258
+
259
+ downloadFile(remotePathOrPath, localPathOrScope, scope) {
260
+ if (!localPathOrScope || !scope && typeof localPathOrScope === 'string' && Object.values(_main.CloudStorageScope).includes(localPathOrScope)) {
261
+ // deprecated `triggerSync` call
262
+ return this.triggerSync(remotePathOrPath, scope);
263
+ }
264
+ if (!localPathOrScope) {
265
+ throw new _cloudStorageError.default('Invalid arguments provided to downloadFile', _native.NativeCloudStorageErrorCode.UNKNOWN);
266
+ }
267
+ return this.nativeStorage.downloadFile(remotePathOrPath, localPathOrScope, scope ?? this.provider.options.scope);
257
268
  }
258
269
 
259
270
  /**
@@ -263,7 +274,7 @@ class RNCloudStorage {
263
274
  * @returns A promise that resolves when the file has been deleted.
264
275
  */
265
276
  unlink(path, scope) {
266
- return this.nativeInstance.deleteFile(path, scope ?? this.provider.options.scope);
277
+ return this.nativeStorage.deleteFile(path, scope ?? this.provider.options.scope);
267
278
  }
268
279
 
269
280
  /**
@@ -274,7 +285,7 @@ class RNCloudStorage {
274
285
  * @returns A promise that resolves when the directory has been deleted.
275
286
  */
276
287
  rmdir(path, options, scope) {
277
- return this.nativeInstance.deleteDirectory(path, options?.recursive ?? false, scope ?? this.provider.options.scope);
288
+ return this.nativeStorage.deleteDirectory(path, options?.recursive ?? false, scope ?? this.provider.options.scope);
278
289
  }
279
290
 
280
291
  /**
@@ -284,7 +295,7 @@ class RNCloudStorage {
284
295
  * @returns A promise that resolves to the CloudStorageFileStat object.
285
296
  */
286
297
  async stat(path, scope) {
287
- const native = await this.nativeInstance.statFile(path, scope ?? this.provider.options.scope);
298
+ const native = await this.nativeStorage.statFile(path, scope ?? this.provider.options.scope);
288
299
  return {
289
300
  ...native,
290
301
  birthtime: new Date(native.birthtimeMs),
@@ -407,13 +418,52 @@ class RNCloudStorage {
407
418
  }
408
419
 
409
420
  /**
410
- * Downloads the file at the given path in the provider of the default static instance. Does not have any effect on Google Drive.
411
- * @param path The file to trigger the download for.
421
+ * 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.
422
+ * @param path The file to trigger synchronization for.
412
423
  * @param scope The directory scope the path is in. Defaults to the default scope set for the default static instance.
413
- * @returns A promise that resolves once the download has been triggered.
424
+ * @returns A promise that resolves once the synchronization has been triggered.
425
+ */
426
+ static triggerSync(path, scope) {
427
+ return RNCloudStorage.getDefaultInstance().triggerSync(path, scope);
428
+ }
429
+
430
+ /**
431
+ * 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.
432
+ * @param remotePath The remote path to upload to.
433
+ * @param localPath The local path of the file to upload.
434
+ * @param options The options for the upload. Must contain a `mimeType` property.
435
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
436
+ * @returns A promise that resolves when the file has been uploaded.
414
437
  */
415
- static downloadFile(path, scope) {
416
- return RNCloudStorage.getDefaultInstance().downloadFile(path, scope);
438
+ static uploadFile(remotePath, localPath, options, scope) {
439
+ return RNCloudStorage.getDefaultInstance().uploadFile(remotePath, localPath, options, scope);
440
+ }
441
+
442
+ /**
443
+ * 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.
444
+ * @param path The file to trigger synchronization for.
445
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
446
+ * @returns A promise that resolves once the synchronization has been triggered.
447
+ * @deprecated Use `triggerSync` instead.
448
+ */
449
+
450
+ /**
451
+ * Downloads the cloud file at the given remote path to the given local path.
452
+ * @param remotePath The remote path of the file to download from the cloud.
453
+ * @param localPath The local path to download the cloud file to.
454
+ * @param scope The directory scope the path is in. Defaults to set default scope set for the current provider.
455
+ */
456
+
457
+ static downloadFile(remotePathOrPath, localPathOrScope, scope) {
458
+ if (typeof scope === 'string') {
459
+ if (!localPathOrScope) {
460
+ throw new _cloudStorageError.default('Invalid arguments provided to downloadFile', _native.NativeCloudStorageErrorCode.UNKNOWN);
461
+ }
462
+ return RNCloudStorage.getDefaultInstance().downloadFile(remotePathOrPath, localPathOrScope, scope);
463
+ } else {
464
+ // deprecated `triggerSync` call
465
+ return RNCloudStorage.getDefaultInstance().triggerSync(remotePathOrPath, scope);
466
+ }
417
467
  }
418
468
 
419
469
  /**
@@ -449,4 +499,4 @@ class RNCloudStorage {
449
499
  //#endregion
450
500
  }
451
501
  exports.default = RNCloudStorage;
452
- //# sourceMappingURL=RNCloudStorage.js.map
502
+ //# sourceMappingURL=cloud-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_main","require","_native","_helpers","_reactNative","_googleDrive","_interopRequireDefault","_cloudkit","_constants","_cloudStorageError","e","__esModule","default","RNCloudStorage","cloudAvailabilityListeners","constructor","provider","options","isProviderSupported","Error","getDefaultProvider","DEFAULT_PROVIDER_OPTIONS","setProvider","setProviderOptions","nativeStorage","CloudStorageProvider","ICloud","NativeCloudKit","Proxy","get","LINKING_ERROR","GoogleDrive","Platform","OS","getSupportedProviders","Object","values","filter","getProvider","isCloudAvailable","then","available","listener","eventEmitter","NativeEventEmitter","NativeModules","CloudStorageEventEmitter","addListener","event","getProviderOptions","newOptions","fromEntries","entries","_","v","undefined","accessToken","length","subscribeToCloudAvailability","push","unsubscribeFromCloudAvailability","l","appendFile","path","data","scope","appendToFile","exists","fileExists","writeFile","createFile","mkdir","createDirectory","readdir","listFiles","readFile","triggerSync","uploadFile","remotePath","localPath","mimeType","downloadFile","remotePathOrPath","localPathOrScope","CloudStorageScope","includes","CloudStorageError","NativeCloudStorageErrorCode","UNKNOWN","unlink","deleteFile","rmdir","deleteDirectory","recursive","stat","native","statFile","birthtime","Date","birthtimeMs","mtime","mtimeMs","isDirectory","isFile","getDefaultInstance","defaultInstance","exports"],"sourceRoot":"../../src","sources":["cloud-storage.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAH,sBAAA,CAAAL,OAAA;AA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ACrB,MAAM,IAAIG,0BAAiB,CAAC,4CAA4C,EAAEC,mCAA2B,CAACC,OAAO,CAAC;MAChH;MACA,OAAO3E,cAAc,CAAC2F,kBAAkB,CAAC,CAAC,CAACvB,YAAY,CAACC,gBAAgB,EAAEC,gBAAgB,EAAElB,KAAK,CAAC;IACpG,CAAC,MAAM;MACL;MACA,OAAOpD,cAAc,CAAC2F,kBAAkB,CAAC,CAAC,CAAC5B,WAAW,CAACM,gBAAgB,EAAEjB,KAAK,CAAC;IACjF;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOwB,MAAMA,CAAC1B,IAAY,EAAEE,KAAyB,EAAiB;IACpE,OAAOpD,cAAc,CAAC2F,kBAAkB,CAAC,CAAC,CAACf,MAAM,CAAC1B,IAAI,EAAEE,KAAK,CAAC;EAChE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAO0B,KAAKA,CAAC5B,IAAY,EAAE9C,OAAiC,EAAEgD,KAAyB,EAAiB;IACtG,OAAOpD,cAAc,CAAC2F,kBAAkB,CAAC,CAAC,CAACb,KAAK,CAAC5B,IAAI,EAAE9C,OAAO,EAAEgD,KAAK,CAAC;EACxE;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAO6B,IAAIA,CAAC/B,IAAY,EAAEE,KAAyB,EAAiC;IAClF,OAAOpD,cAAc,CAAC2F,kBAAkB,CAAC,CAAC,CAACV,IAAI,CAAC/B,IAAI,EAAEE,KAAK,CAAC;EAC9D;EACA;AACF;AAACyC,OAAA,CAAA9F,OAAA,GAAAC,cAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ios = _interopRequireDefault(require("./ios"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ // Android config plugin not needed as there's nothing to configure.
10
+
11
+ const withRNCloudStorage = (config, options) => (0, _ios.default)(config, options);
12
+ var _default = exports.default = withRNCloudStorage;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ios","_interopRequireDefault","require","e","__esModule","default","withRNCloudStorage","config","options","withRNCloudStorageIos","_default","exports"],"sourceRoot":"../../../src","sources":["expo-plugin/index.ts"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG1C;;AAEA,MAAMG,kBAAmE,GAAGA,CAACC,MAAM,EAAEC,OAAO,KAC1F,IAAAC,YAAqB,EAACF,MAAM,EAAEC,OAAO,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAE1BC,kBAAkB","ignoreList":[]}
@@ -34,4 +34,4 @@ const withRNCloudStorageEntitlementsPlist = (config, options) => (0, _configPlug
34
34
  });
35
35
  const withRNCloudStorageIos = (config, options) => (0, _configPlugins.withPlugins)(config, [[withRNCloudStorageInfoPlist, options], [withRNCloudStorageEntitlementsPlist, options]]);
36
36
  var _default = exports.default = withRNCloudStorageIos;
37
- //# sourceMappingURL=withRNCloudStorageIos.js.map
37
+ //# sourceMappingURL=ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_configPlugins","require","getICloudContainerIdentifier","config","options","iCloudContainerIdentifier","ios","bundleIdentifier","Error","withRNCloudStorageInfoPlist","withInfoPlist","newConfig","infoPlist","modResults","NSUbiquitousContainers","NSUbiquitousContainerIsDocumentScopePublic","NSUbiquitousContainerSupportedFolderLevels","NSUbiquitousContainerName","slug","withRNCloudStorageEntitlementsPlist","withEntitlementsPlist","entitlementsPlist","iCloudContainerEnvironment","withRNCloudStorageIos","withPlugins","_default","exports","default"],"sourceRoot":"../../../src","sources":["expo-plugin/ios.ts"],"mappings":";;;;;;AAAA,IAAAA,c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ACrDD,iBAAiB,CAAC,oDAAoD,CAAC,GAAG,CACxEnB,4BAA4B,CAACC,MAAM,EAAEC,OAAO,CAAC,CAC9C;EAED,OAAOO,SAAS;AAClB,CAAC,CAAC;AAEJ,MAAMY,qBAAsE,GAAGA,CAACpB,MAAM,EAAEC,OAAO,KAC7F,IAAAoB,0BAAW,EAACrB,MAAM,EAAE,CAClB,CAACM,2BAA2B,EAAEL,OAAO,CAAC,EACtC,CAACe,mCAAmC,EAAEf,OAAO,CAAC,CAC/C,CAAC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEUJ,qBAAqB","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useCloudFile = void 0;
7
- var _RNCloudStorage = _interopRequireDefault(require("../RNCloudStorage"));
7
+ var _cloudStorage = _interopRequireDefault(require("../cloud-storage"));
8
8
  var _react = require("react");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  /**
@@ -16,7 +16,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
16
16
  */
17
17
  const useCloudFile = (path, scope, cloudStorageInstance) => {
18
18
  const [content, setContent] = (0, _react.useState)(null);
19
- const instance = cloudStorageInstance ?? _RNCloudStorage.default;
19
+ const instance = cloudStorageInstance ?? _cloudStorage.default;
20
20
  const read = (0, _react.useCallback)(async () => {
21
21
  const exists = await instance.exists(path, scope);
22
22
  if (!exists) {
@@ -36,20 +36,38 @@ const useCloudFile = (path, scope, cloudStorageInstance) => {
36
36
  await instance.unlink(path, scope);
37
37
  setContent(null);
38
38
  }, [path, scope, instance]);
39
- const download = (0, _react.useCallback)(async () => {
40
- await instance.downloadFile(path, scope);
39
+ const sync = (0, _react.useCallback)(async () => {
40
+ await instance.triggerSync(path, scope);
41
41
  }, [path, scope, instance]);
42
42
  return {
43
+ /**
44
+ * The content of the file.
45
+ */
43
46
  content,
47
+ /**
48
+ * Reads the file from the cloud.
49
+ */
44
50
  read,
51
+ /**
52
+ * Writes new content to the file.
53
+ */
45
54
  write,
55
+ /**
56
+ * Deletes the file.
57
+ */
46
58
  remove,
47
59
  /**
48
- * Downloads the file from iCloud to the device. Needed if the file hasn't been synced yet. Has no effect on
49
- * Google Drive.
60
+ * Triggers synchronization for the file. Needed if the file hasn't been synced yet from iCloud.
61
+ * Has no effect on Google Drive.
62
+ */
63
+ sync,
64
+ /**
65
+ * Triggers synchronization for the file. Needed if the file hasn't been synced yet from iCloud.
66
+ * Has no effect on Google Drive.
67
+ * @deprecated Use `sync` instead.
50
68
  */
51
- download
69
+ download: sync
52
70
  };
53
71
  };
54
72
  exports.useCloudFile = useCloudFile;
55
- //# sourceMappingURL=useCloudFile.js.map
73
+ //# sourceMappingURL=use-cloud-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_cloudStorage","_interopRequireDefault","require","_react","e","__esModule","default","useCloudFile","path","scope","cloudStorageInstance","content","setContent","useState","instance","RNCloudStorage","read","useCallback","exists","readFile","then","useEffect","write","newContent","writeFile","remove","unlink","sync","triggerSync","download","exports"],"sourceRoot":"../../../src","sources":["hooks/use-cloud-file.ts"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAyD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,YAAY,GAAGA,CAACC,IAAY,EAAEC,KAAyB,EAAEC,oBAAqC,KAAK;EAC9G,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAgB,IAAI,CAAC;EAC3D,MAAMC,QAAQ,GAAGJ,oBAAoB,IAAIK,qBAAc;EAEvD,MAAMC,IAAI,GAAG,IAAAC,kBAAW,EAAC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AI;IACJ;AACJ;AACA;AACA;AACA;IACIE,QAAQ,EAAEF;EACZ,CAAC;AACH,CAAC;AAACG,OAAA,CAAAvB,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useIsCloudAvailable = void 0;
7
7
  var _react = require("react");
8
- var _RNCloudStorage = _interopRequireDefault(require("../RNCloudStorage"));
8
+ var _cloudStorage = _interopRequireDefault(require("../cloud-storage"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  /**
11
11
  * A hook that tests whether or not the cloud storage is available.
@@ -14,7 +14,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
14
14
  */
15
15
  const useIsCloudAvailable = cloudStorageInstance => {
16
16
  const [isAvailable, setIsAvailable] = (0, _react.useState)(false);
17
- const instance = cloudStorageInstance ?? _RNCloudStorage.default.getDefaultInstance();
17
+ const instance = cloudStorageInstance ?? _cloudStorage.default.getDefaultInstance();
18
18
  const handleAvailabilityChange = (0, _react.useCallback)(available => {
19
19
  setIsAvailable(available);
20
20
  }, []);
@@ -31,4 +31,4 @@ const useIsCloudAvailable = cloudStorageInstance => {
31
31
  return isAvailable;
32
32
  };
33
33
  exports.useIsCloudAvailable = useIsCloudAvailable;
34
- //# sourceMappingURL=useIsCloudAvailable.js.map
34
+ //# sourceMappingURL=use-is-cloud-available.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_cloudStorage","_interopRequireDefault","e","__esModule","default","useIsCloudAvailable","cloudStorageInstance","isAvailable","setIsAvailable","useState","instance","RNCloudStorage","getDefaultInstance","handleAvailabilityChange","useCallback","available","useEffect","isCloudAvailable","then","subscribeToCloudAvailability","unsubscribeFromCloudAvailability","exports"],"sourceRoot":"../../../src","sources":["hooks/use-is-cloud-available.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACO,MAAMG,mBAAmB,GAAIC,oBAAqC,IAAK;EAC5E,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EACrD,MAAMC,QAAQ,GAAGJ,oBAAoB,IAAIK,qBAAc,CAACC,kBAAkB,CAAC,CAAC;EAE5E,MAAMC,wBAAwB,GAAG,IAAAC,kBAAW,EAAEC,SAAkB,IAAK;IACnEP,cAAc,CAACO,SAAS,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAC,gBAAS,EAAC,MAAM;IACd;IACAN,QAAQ,CAACO,gBAAgB,CAAC,CAAC,CAACC,IAAI,CAACV,cAAc,CAAC;;IAEhD;IACAE,QAAQ,CAACS,4BAA4B,CAACN,wBAAwB,CAAC;IAE/D,OAAO,MAAM;MACXH,QAAQ,CAACU,gCAAgC,CAACP,wBAAwB,CAAC;IACrE,CAAC;EACH,CAAC,EAAE,CAACH,QAAQ,EAAEG,wBAAwB,CAAC,CAAC;EAExC,OAAON,WAAW;AACpB,CAAC;AAACc,OAAA,CAAAhB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -4,30 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
- CloudStorage: true,
8
7
  CloudStorageErrorCode: true,
9
- CloudStorageError: true
8
+ CloudStorageError: true,
9
+ CloudStorage: true
10
10
  };
11
11
  Object.defineProperty(exports, "CloudStorage", {
12
12
  enumerable: true,
13
13
  get: function () {
14
- return _RNCloudStorage.default;
14
+ return _cloudStorage.default;
15
15
  }
16
16
  });
17
17
  Object.defineProperty(exports, "CloudStorageError", {
18
18
  enumerable: true,
19
19
  get: function () {
20
- return _CloudStorageError.default;
20
+ return _cloudStorageError.default;
21
21
  }
22
22
  });
23
23
  Object.defineProperty(exports, "CloudStorageErrorCode", {
24
24
  enumerable: true,
25
25
  get: function () {
26
- return _native.CloudStorageErrorCode;
26
+ return _native.NativeCloudStorageErrorCode;
27
27
  }
28
28
  });
29
- var _RNCloudStorage = _interopRequireDefault(require("./RNCloudStorage"));
30
- var _native = require("./types/native");
31
29
  var _main = require("./types/main");
32
30
  Object.keys(_main).forEach(function (key) {
33
31
  if (key === "default" || key === "__esModule") return;
@@ -40,7 +38,7 @@ Object.keys(_main).forEach(function (key) {
40
38
  }
41
39
  });
42
40
  });
43
- var _useCloudFile = require("./hooks/useCloudFile");
41
+ var _useCloudFile = require("./hooks/use-cloud-file");
44
42
  Object.keys(_useCloudFile).forEach(function (key) {
45
43
  if (key === "default" || key === "__esModule") return;
46
44
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -52,7 +50,7 @@ Object.keys(_useCloudFile).forEach(function (key) {
52
50
  }
53
51
  });
54
52
  });
55
- var _useIsCloudAvailable = require("./hooks/useIsCloudAvailable");
53
+ var _useIsCloudAvailable = require("./hooks/use-is-cloud-available");
56
54
  Object.keys(_useIsCloudAvailable).forEach(function (key) {
57
55
  if (key === "default" || key === "__esModule") return;
58
56
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -64,6 +62,8 @@ Object.keys(_useIsCloudAvailable).forEach(function (key) {
64
62
  }
65
63
  });
66
64
  });
67
- var _CloudStorageError = _interopRequireDefault(require("./utils/CloudStorageError"));
65
+ var _native = require("./types/native");
66
+ var _cloudStorageError = _interopRequireDefault(require("./utils/cloud-storage-error"));
67
+ var _cloudStorage = _interopRequireDefault(require("./cloud-storage"));
68
68
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
69
69
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_main","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_useCloudFile","_useIsCloudAvailable","_native","_cloudStorageError","_interopRequireDefault","_cloudStorage","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,aAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,aAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,aAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,oBAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,oBAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,oBAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,oBAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAW,OAAA,GAAAf,OAAA;AACA,IAAAgB,kBAAA,GAAAC,sBAAA,CAAAjB,OAAA;AACA,IAAAkB,aAAA,GAAAD,sBAAA,CAAAjB,OAAA;AAA0D,SAAAiB,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NativeCloudKit = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _native = require("../utils/native");
9
+ const NativeCloudKit = exports.NativeCloudKit = (0, _native.createProxiedNativeModule)(_reactNative.NativeModules.CloudStorageCloudKit);
10
+ //# sourceMappingURL=cloudkit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_native","NativeCloudKit","exports","createProxiedNativeModule","NativeModules","CloudStorageCloudKit"],"sourceRoot":"../../../src","sources":["storages/cloudkit.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAEO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,iCAAyB,EAAgBC,0BAAa,CAACC,oBAAoB,CAAC","ignoreList":[]}