react-native-cloud-storage 0.7.0 → 1.0.1

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 (57) hide show
  1. package/README.md +0 -2
  2. package/ios/CloudStorage.swift +95 -76
  3. package/lib/commonjs/RNCloudStorage.js +19 -14
  4. package/lib/commonjs/RNCloudStorage.js.map +1 -1
  5. package/lib/commonjs/expo-plugin/types/index.js +2 -0
  6. package/lib/commonjs/expo-plugin/types/index.js.map +1 -0
  7. package/lib/commonjs/expo-plugin/withRNCloudStorage.js +1 -1
  8. package/lib/commonjs/expo-plugin/withRNCloudStorage.js.map +1 -1
  9. package/lib/commonjs/expo-plugin/withRNCloudStorageIos.js +3 -3
  10. package/lib/commonjs/expo-plugin/withRNCloudStorageIos.js.map +1 -1
  11. package/lib/commonjs/google-drive/index.js +5 -0
  12. package/lib/commonjs/google-drive/index.js.map +1 -1
  13. package/lib/commonjs/hooks/useCloudFile.js +14 -3
  14. package/lib/commonjs/hooks/useCloudFile.js.map +1 -1
  15. package/lib/commonjs/types/native.js +1 -1
  16. package/lib/commonjs/utils/helpers.js +23 -0
  17. package/lib/commonjs/utils/helpers.js.map +1 -0
  18. package/lib/module/RNCloudStorage.js +19 -14
  19. package/lib/module/RNCloudStorage.js.map +1 -1
  20. package/lib/module/expo-plugin/types/index.js +2 -0
  21. package/lib/module/expo-plugin/types/index.js.map +1 -0
  22. package/lib/module/expo-plugin/withRNCloudStorage.js +1 -2
  23. package/lib/module/expo-plugin/withRNCloudStorage.js.map +1 -1
  24. package/lib/module/expo-plugin/withRNCloudStorageIos.js +3 -3
  25. package/lib/module/expo-plugin/withRNCloudStorageIos.js.map +1 -1
  26. package/lib/module/google-drive/index.js +5 -0
  27. package/lib/module/google-drive/index.js.map +1 -1
  28. package/lib/module/hooks/useCloudFile.js +15 -3
  29. package/lib/module/hooks/useCloudFile.js.map +1 -1
  30. package/lib/module/types/native.js +1 -1
  31. package/lib/module/utils/helpers.js +16 -0
  32. package/lib/module/utils/helpers.js.map +1 -0
  33. package/lib/typescript/RNCloudStorage.d.ts +17 -15
  34. package/lib/typescript/RNCloudStorage.d.ts.map +1 -1
  35. package/lib/typescript/expo-plugin/types/index.d.ts +7 -0
  36. package/lib/typescript/expo-plugin/types/index.d.ts.map +1 -0
  37. package/lib/typescript/expo-plugin/withRNCloudStorage.d.ts +1 -6
  38. package/lib/typescript/expo-plugin/withRNCloudStorage.d.ts.map +1 -1
  39. package/lib/typescript/expo-plugin/withRNCloudStorageIos.d.ts +3 -2
  40. package/lib/typescript/expo-plugin/withRNCloudStorageIos.d.ts.map +1 -1
  41. package/lib/typescript/google-drive/index.d.ts.map +1 -1
  42. package/lib/typescript/hooks/useCloudFile.d.ts +13 -2
  43. package/lib/typescript/hooks/useCloudFile.d.ts.map +1 -1
  44. package/lib/typescript/types/native.d.ts +1 -1
  45. package/lib/typescript/types/native.d.ts.map +1 -1
  46. package/lib/typescript/utils/helpers.d.ts +10 -0
  47. package/lib/typescript/utils/helpers.d.ts.map +1 -0
  48. package/package.json +24 -20
  49. package/react-native-cloud-storage.podspec +7 -1
  50. package/src/RNCloudStorage.ts +26 -22
  51. package/src/expo-plugin/types/index.ts +6 -0
  52. package/src/expo-plugin/withRNCloudStorage.ts +2 -7
  53. package/src/expo-plugin/withRNCloudStorageIos.ts +8 -10
  54. package/src/google-drive/index.ts +11 -0
  55. package/src/hooks/useCloudFile.ts +14 -3
  56. package/src/types/native.ts +1 -1
  57. package/src/utils/helpers.ts +17 -0
@@ -1,8 +1,13 @@
1
1
  import createRNCloudStorage from './createRNCloudStorage';
2
2
  import GoogleDriveApiClient from './google-drive';
3
+ import { CloudStorageScope } from './types/main';
3
4
  import { Platform } from 'react-native';
5
+ import { verifyLeadingSlash } from './utils/helpers';
4
6
  const nativeInstance = createRNCloudStorage();
7
+ let defaultScope = CloudStorageScope.AppData;
5
8
  const RNCloudStorage = {
9
+ getDefaultScope: () => defaultScope,
10
+ setDefaultScope: scope => defaultScope = scope,
6
11
  getGoogleDriveAccessToken: () => GoogleDriveApiClient.accessToken,
7
12
  setGoogleDriveAccessToken: accessToken => GoogleDriveApiClient.accessToken = accessToken,
8
13
  setThrowOnFilesWithSameName: enable => GoogleDriveApiClient.throwOnFilesWithSameName = enable,
@@ -25,66 +30,66 @@ const RNCloudStorage = {
25
30
  /**
26
31
  * Tests whether or not the file at the given path exists.
27
32
  * @param path The path to test.
28
- * @param scope The directory scope the path is in.
33
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
29
34
  * @returns A promise that resolves to true if the path exists, false otherwise.
30
35
  */
31
36
  exists: (path, scope) => {
32
- return nativeInstance.fileExists(path, scope);
37
+ return nativeInstance.fileExists(verifyLeadingSlash(path), scope ?? defaultScope);
33
38
  },
34
39
  /**
35
40
  * Writes to the file at the given path, creating it if it doesn't exist or overwriting it if it does.
36
41
  * @param path The file to write to.
37
42
  * @param data The data to write.
38
- * @param scope The directory scope the path is in.
43
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
39
44
  * @returns A promise that resolves when the file has been written.
40
45
  */
41
46
  writeFile: (path, data, scope) => {
42
- return nativeInstance.createFile(path, data, scope, true);
47
+ return nativeInstance.createFile(verifyLeadingSlash(path), data, scope ?? defaultScope, true);
43
48
  },
44
49
  /**
45
50
  * Creates a new directory at the given path.
46
51
  * @param path The directory to create.
47
- * @param scope The directory scope the path is in.
52
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
48
53
  * @returns A promise that resolves when the directory has been created.
49
54
  */
50
55
  mkdir: (path, scope) => {
51
- return nativeInstance.createDirectory(path, scope);
56
+ return nativeInstance.createDirectory(verifyLeadingSlash(path), scope ?? defaultScope);
52
57
  },
53
58
  /**
54
59
  * Lists the contents of the directory at the given path.
55
60
  * @param path The directory to list.
56
- * @param scope The directory scope the path is in.
61
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
57
62
  * @returns A promise that resolves to an array of file names, excluding '.' and '..'.
58
63
  */
59
64
  readdir: (path, scope) => {
60
- return nativeInstance.listFiles(path, scope);
65
+ return nativeInstance.listFiles(verifyLeadingSlash(path), scope ?? defaultScope);
61
66
  },
62
67
  /**
63
68
  * Reads the contents of the file at the given path.
64
69
  * @param path The file to read.
65
- * @param scope The directory scope the path is in.
70
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
66
71
  * @returns A promise that resolves to the contents of the file.
67
72
  */
68
73
  readFile: (path, scope) => {
69
- return nativeInstance.readFile(path, scope);
74
+ return nativeInstance.readFile(verifyLeadingSlash(path), scope ?? defaultScope);
70
75
  },
71
76
  /**
72
77
  * Deletes the file at the given path.
73
78
  * @param path The file to delete.
74
- * @param scope The directory scope the path is in.
79
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
75
80
  * @returns A promise that resolves when the file has been deleted.
76
81
  */
77
82
  unlink: (path, scope) => {
78
- return nativeInstance.deleteFile(path, scope);
83
+ return nativeInstance.deleteFile(verifyLeadingSlash(path), scope ?? defaultScope);
79
84
  },
80
85
  /**
81
86
  * Gets the size, creation time, and modification time of the file at the given path.
82
87
  * @param path The file to stat.
83
- * @param scope The directory scope the path is in.
88
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
84
89
  * @returns A promise that resolves to the CloudStorageFileStat object.
85
90
  */
86
91
  stat: async (path, scope) => {
87
- const native = await nativeInstance.statFile(path, scope);
92
+ const native = await nativeInstance.statFile(verifyLeadingSlash(path), scope ?? defaultScope);
88
93
  return {
89
94
  ...native,
90
95
  birthtime: new Date(native.birthtimeMs),
@@ -1 +1 @@
1
- {"version":3,"names":["createRNCloudStorage","GoogleDriveApiClient","Platform","nativeInstance","RNCloudStorage","getGoogleDriveAccessToken","accessToken","setGoogleDriveAccessToken","setThrowOnFilesWithSameName","enable","throwOnFilesWithSameName","subscribeToFilesWithSameName","OS","subscriber","remove","bind","isCloudAvailable","exists","path","scope","fileExists","writeFile","data","createFile","mkdir","createDirectory","readdir","listFiles","readFile","unlink","deleteFile","stat","native","statFile","birthtime","Date","birthtimeMs","mtime","mtimeMs","isDirectory","isFile"],"sourceRoot":"../../src","sources":["RNCloudStorage.ts"],"mappings":"AAAA,OAAOA,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,oBAAoB,MAAM,gBAAgB;AAEjD,SAASC,QAAQ,QAAQ,cAAc;AAEvC,MAAMC,cAAc,GAAGH,oBAAoB,EAAE;AAE7C,MAAMI,cAAc,GAAG;EACrBC,yBAAyB,EAAEA,CAAA,KAAMJ,oBAAoB,CAACK,WAAW;EACjEC,yBAAyB,EAAGD,WAAmB,IAAML,oBAAoB,CAACK,WAAW,GAAGA,WAAY;EACpGE,2BAA2B,EAAGC,MAAe,IAAMR,oBAAoB,CAACS,wBAAwB,GAAGD,MAAO;EAC1G;EACAE,4BAA4B,EAC1BT,QAAQ,CAACU,EAAE,KAAK,KAAK;EACjB;EACCC,UAA4E,KAAM;IAAEC,MAAM,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC,CAAC,GACvGX,cAAc,CAA0BQ,4BAA4B,CAACI,IAAI,CAACZ,cAAc,CAAC;EAChG;;EAEA;AACF;AACA;AACA;AACA;EACEa,gBAAgB,EAAE,MAAAA,CAAA,KAA8B;IAC9C,OAAOb,cAAc,CAACa,gBAAgB,EAAE;EAC1C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,MAAM,EAAEA,CAACC,IAAY,EAAEC,KAAwB,KAAuB;IACpE,OAAOhB,cAAc,CAACiB,UAAU,CAACF,IAAI,EAAEC,KAAK,CAAC;EAC/C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,SAAS,EAAEA,CAACH,IAAY,EAAEI,IAAY,EAAEH,KAAwB,KAAoB;IAClF,OAAOhB,cAAc,CAACoB,UAAU,CAACL,IAAI,EAAEI,IAAI,EAAEH,KAAK,EAAE,IAAI,CAAC;EAC3D,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEK,KAAK,EAAEA,CAACN,IAAY,EAAEC,KAAwB,KAAoB;IAChE,OAAOhB,cAAc,CAACsB,eAAe,CAACP,IAAI,EAAEC,KAAK,CAAC;EACpD,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEO,OAAO,EAAEA,CAACR,IAAY,EAAEC,KAAwB,KAAwB;IACtE,OAAOhB,cAAc,CAACwB,SAAS,CAACT,IAAI,EAAEC,KAAK,CAAC;EAC9C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACES,QAAQ,EAAEA,CAACV,IAAY,EAAEC,KAAwB,KAAsB;IACrE,OAAOhB,cAAc,CAACyB,QAAQ,CAACV,IAAI,EAAEC,KAAK,CAAC;EAC7C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEU,MAAM,EAAEA,CAACX,IAAY,EAAEC,KAAwB,KAAoB;IACjE,OAAOhB,cAAc,CAAC2B,UAAU,CAACZ,IAAI,EAAEC,KAAK,CAAC;EAC/C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEY,IAAI,EAAE,MAAAA,CAAOb,IAAY,EAAEC,KAAwB,KAAoC;IACrF,MAAMa,MAAM,GAAG,MAAM7B,cAAc,CAAC8B,QAAQ,CAACf,IAAI,EAAEC,KAAK,CAAC;IAEzD,OAAO;MACL,GAAGa,MAAM;MACTE,SAAS,EAAE,IAAIC,IAAI,CAACH,MAAM,CAACI,WAAW,CAAC;MACvCC,KAAK,EAAE,IAAIF,IAAI,CAACH,MAAM,CAACM,OAAO,CAAC;MAC/BC,WAAW,EAAEA,CAAA,KAAMP,MAAM,CAACO,WAAW;MACrCC,MAAM,EAAEA,CAAA,KAAMR,MAAM,CAACQ;IACvB,CAAC;EACH;AACF,CAAC;AAED,eAAepC,cAAc"}
1
+ {"version":3,"names":["createRNCloudStorage","GoogleDriveApiClient","CloudStorageScope","Platform","verifyLeadingSlash","nativeInstance","defaultScope","AppData","RNCloudStorage","getDefaultScope","setDefaultScope","scope","getGoogleDriveAccessToken","accessToken","setGoogleDriveAccessToken","setThrowOnFilesWithSameName","enable","throwOnFilesWithSameName","subscribeToFilesWithSameName","OS","subscriber","remove","bind","isCloudAvailable","exists","path","fileExists","writeFile","data","createFile","mkdir","createDirectory","readdir","listFiles","readFile","unlink","deleteFile","stat","native","statFile","birthtime","Date","birthtimeMs","mtime","mtimeMs","isDirectory","isFile"],"sourceRoot":"../../src","sources":["RNCloudStorage.ts"],"mappings":"AAAA,OAAOA,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,oBAAoB,MAAM,gBAAgB;AACjD,SAAoCC,iBAAiB,QAAQ,cAAc;AAC3E,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,kBAAkB,QAAQ,iBAAiB;AAEpD,MAAMC,cAAc,GAAGL,oBAAoB,EAAE;AAC7C,IAAIM,YAAY,GAAGJ,iBAAiB,CAACK,OAAO;AAE5C,MAAMC,cAAc,GAAG;EACrBC,eAAe,EAAEA,CAAA,KAAMH,YAAY;EACnCI,eAAe,EAAGC,KAAwB,IAAML,YAAY,GAAGK,KAAM;EACrEC,yBAAyB,EAAEA,CAAA,KAAMX,oBAAoB,CAACY,WAAW;EACjEC,yBAAyB,EAAGD,WAAmB,IAAMZ,oBAAoB,CAACY,WAAW,GAAGA,WAAY;EACpGE,2BAA2B,EAAGC,MAAe,IAAMf,oBAAoB,CAACgB,wBAAwB,GAAGD,MAAO;EAC1G;EACAE,4BAA4B,EAC1Bf,QAAQ,CAACgB,EAAE,KAAK,KAAK;EACjB;EACCC,UAA4E,KAAM;IAAEC,MAAM,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC,CAAC,GACvGhB,cAAc,CAA0Ba,4BAA4B,CAACI,IAAI,CAACjB,cAAc,CAAC;EAChG;;EAEA;AACF;AACA;AACA;AACA;EACEkB,gBAAgB,EAAE,MAAAA,CAAA,KAA8B;IAC9C,OAAOlB,cAAc,CAACkB,gBAAgB,EAAE;EAC1C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,MAAM,EAAEA,CAACC,IAAY,EAAEd,KAAyB,KAAuB;IACrE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AM2B,MAAM,GAAG,MAAMjC,cAAc,CAACkC,QAAQ,CAACnC,kBAAkB,CAACqB,IAAI,CAAC,EAAEd,KAAK,IAAIL,YAAY,CAAC;IAE7F,OAAO;MACL,GAAGgC,MAAM;MACTE,SAAS,EAAE,IAAIC,IAAI,CAACH,MAAM,CAACI,WAAW,CAAC;MACvCC,KAAK,EAAE,IAAIF,IAAI,CAACH,MAAM,CAACM,OAAO,CAAC;MAC/BC,WAAW,EAAEA,CAAA,KAAMP,MAAM,CAACO,WAAW;MACrCC,MAAM,EAAEA,CAAA,KAAMR,MAAM,CAACQ;IACvB,CAAC;EACH;AACF,CAAC;AAED,eAAetC,cAAc"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["expo-plugin/types/index.ts"],"mappings":""}
@@ -1,7 +1,6 @@
1
1
  import withRNCloudStorageIos from './withRNCloudStorageIos';
2
-
3
2
  // Android config plugin not needed as there's no native code to configure.
4
3
 
5
- const withRNCloudStorage = (config, options) => withRNCloudStorageIos(config, (options === null || options === void 0 ? void 0 : options.iCloudContainerEnvironment) ?? 'Production');
4
+ const withRNCloudStorage = (config, options) => withRNCloudStorageIos(config, options);
6
5
  export default withRNCloudStorage;
7
6
  //# sourceMappingURL=withRNCloudStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["withRNCloudStorageIos","withRNCloudStorage","config","options","iCloudContainerEnvironment"],"sourceRoot":"../../../src","sources":["expo-plugin/withRNCloudStorage.ts"],"mappings":"AAAA,OAAOA,qBAAqB,MAAM,yBAAyB;;AAG3D;;AAQA,MAAMC,kBAAmE,GAAGA,CAACC,MAAM,EAAEC,OAAO,KAC1FH,qBAAqB,CAACE,MAAM,EAAE,CAAAC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,0BAA0B,KAAI,YAAY,CAAC;AAEpF,eAAeH,kBAAkB"}
1
+ {"version":3,"names":["withRNCloudStorageIos","withRNCloudStorage","config","options"],"sourceRoot":"../../../src","sources":["expo-plugin/withRNCloudStorage.ts"],"mappings":"AACA,OAAOA,qBAAqB,MAAM,yBAAyB;AAG3D;;AAEA,MAAMC,kBAAmE,GAAGA,CAACC,MAAM,EAAEC,OAAO,KAC1FH,qBAAqB,CAACE,MAAM,EAAEC,OAAO,CAAC;AAExC,eAAeF,kBAAkB"}
@@ -14,7 +14,7 @@ const withRNCloudStorageInfoPlist = config => withInfoPlist(config, async newCon
14
14
  };
15
15
  return newConfig;
16
16
  });
17
- const withRNCloudStorageEntitlementsPlist = (config, iCloudContainerEnvironment) => withEntitlementsPlist(config, async newConfig => {
17
+ const withRNCloudStorageEntitlementsPlist = (config, options) => withEntitlementsPlist(config, async newConfig => {
18
18
  var _config$ios2;
19
19
  if (!((_config$ios2 = config.ios) !== null && _config$ios2 !== void 0 && _config$ios2.bundleIdentifier)) {
20
20
  throw new Error('Missing iOS bundle identifier');
@@ -22,11 +22,11 @@ const withRNCloudStorageEntitlementsPlist = (config, iCloudContainerEnvironment)
22
22
  const entitlementsPlist = newConfig.modResults;
23
23
  entitlementsPlist['com.apple.developer.icloud-container-identifiers'] = [`iCloud.${config.ios.bundleIdentifier}`];
24
24
  entitlementsPlist['com.apple.developer.icloud-services'] = ['CloudDocuments'];
25
- entitlementsPlist['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
25
+ entitlementsPlist['com.apple.developer.icloud-container-environment'] = (options === null || options === void 0 ? void 0 : options.iCloudContainerEnvironment) ?? 'Production';
26
26
  entitlementsPlist['com.apple.developer.ubiquity-container-identifiers'] = [`iCloud.${config.ios.bundleIdentifier}`];
27
27
  entitlementsPlist['com.apple.developer.ubiquity-kvstore-identifier'] = `$(TeamIdentifierPrefix)${config.ios.bundleIdentifier}`;
28
28
  return newConfig;
29
29
  });
30
- const withRNCloudStorageIos = (config, iCloudContainerEnvironment) => withPlugins(config, [withRNCloudStorageInfoPlist, [withRNCloudStorageEntitlementsPlist, iCloudContainerEnvironment]]);
30
+ const withRNCloudStorageIos = (config, options) => withPlugins(config, [withRNCloudStorageInfoPlist, [withRNCloudStorageEntitlementsPlist, options]]);
31
31
  export default withRNCloudStorageIos;
32
32
  //# sourceMappingURL=withRNCloudStorageIos.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["withEntitlementsPlist","withInfoPlist","withPlugins","withRNCloudStorageInfoPlist","config","newConfig","_config$ios","ios","bundleIdentifier","Error","infoPlist","modResults","NSUbiquitousContainers","NSUbiquitousContainerIsDocumentScopePublic","NSUbiquitousContainerSupportedFolderLevels","NSUbiquitousContainerName","slug","withRNCloudStorageEntitlementsPlist","iCloudContainerEnvironment","_config$ios2","entitlementsPlist","withRNCloudStorageIos"],"sourceRoot":"../../../src","sources":["expo-plugin/withRNCloudStorageIos.ts"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,aAAa,EAAEC,WAAW,QAAQ,sBAAsB;AAGxF,MAAMC,2BAA2B,GAAIC,MAAkB,IACrDH,aAAa,CAACG,MAAM,EAAE,MAAOC,SAAS,IAAK;EAAA,IAAAC,WAAA;EACzC,IAAI,GAAAA,WAAA,GAACF,MAAM,CAACG,GAAG,cAAAD,WAAA,eAAVA,WAAA,CAAYE,gBAAgB,GAAE;IACjC,MAAM,IAAIC,KAAK,CAAC,+BAA+B,CAAC;EAClD;EACA,MAAMC,SAAS,GAAGL,SAAS,CAACM,UAAU;EACtCD,SAAS,CAACE,sBAAsB,GAAG;IACjC,CAAE,UAASR,MAAM,CAACG,GAAG,CAACC,gBAAiB,EAAC,GAAG;MACzCK,0CAA0C,EAAE,IAAI;MAChDC,0CAA0C,EAAE,KAAK;MACjDC,yBAAyB,EAAEX,MAAM,CAACY;IACpC;EACF,CAAC;EAED,OAAOX,SAAS;AAClB,CAAC,CAAC;AAEJ,MAAMY,mCAAmC,GAAGA,CAC1Cb,MAAkB,EAClBc,0BAAwD,KAExDlB,qBAAqB,CAACI,MAAM,EAAE,MAAOC,SAAS,IAAK;EAAA,IAAAc,YAAA;EACjD,IAAI,GAAAA,YAAA,GAACf,MAAM,CAACG,GAAG,cAAAY,YAAA,eAAVA,YAAA,CAAYX,gBAAgB,GAAE;IACjC,MAAM,IAAIC,KAAK,CAAC,+BAA+B,CAAC;EAClD;EACA,MAAMW,iBAAiB,GAAGf,SAAS,CAACM,UAAU;EAC9CS,iBAAiB,CAAC,kDAAkD,CAAC,GAAG,CAAE,UAAShB,MAAM,CAACG,GAAG,CAACC,gBAAiB,EAAC,CAAC;EACjHY,iBAAiB,CAAC,qCAAqC,CAAC,GAAG,CAAC,gBAAgB,CAAC;EAC7EA,iBAAiB,CAAC,kDAAkD,CAAC,GAAGF,0BAA0B;EAClGE,iBAAiB,CAAC,oDAAoD,CAAC,GAAG,CAAE,UAAShB,MAAM,CAACG,GAAG,CAACC,gBAAiB,EAAC,CAAC;EACnHY,iBAAiB,CACf,iDAAiD,CAClD,GAAI,0BAAyBhB,MAAM,CAACG,GAAG,CAACC,gBAAiB,EAAC;EAE3D,OAAOH,SAAS;AAClB,CAAC,CAAC;AAEJ,MAAMgB,qBAAqB,GAAGA,CAACjB,MAAkB,EAAEc,0BAAwD,KACzGhB,WAAW,CAACE,MAAM,EAAE,CAACD,2BAA2B,EAAE,CAACc,mCAAmC,EAAEC,0BAA0B,CAAC,CAAC,CAAC;AAEvH,eAAeG,qBAAqB"}
1
+ {"version":3,"names":["withEntitlementsPlist","withInfoPlist","withPlugins","withRNCloudStorageInfoPlist","config","newConfig","_config$ios","ios","bundleIdentifier","Error","infoPlist","modResults","NSUbiquitousContainers","NSUbiquitousContainerIsDocumentScopePublic","NSUbiquitousContainerSupportedFolderLevels","NSUbiquitousContainerName","slug","withRNCloudStorageEntitlementsPlist","options","_config$ios2","entitlementsPlist","iCloudContainerEnvironment","withRNCloudStorageIos"],"sourceRoot":"../../../src","sources":["expo-plugin/withRNCloudStorageIos.ts"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,aAAa,EAAEC,WAAW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C,gBAAiB,EAAC,CAAC;EACnHY,iBAAiB,CACf,iDAAiD,CAClD,GAAI,0BAAyBhB,MAAM,CAACG,GAAG,CAACC,gBAAiB,EAAC;EAE3D,OAAOH,SAAS;AAClB,CAAC,CAAC;AAEJ,MAAMiB,qBAAsE,GAAGA,CAAClB,MAAM,EAAEc,OAAO,KAC7FhB,WAAW,CAACE,MAAM,EAAE,CAACD,2BAA2B,EAAE,CAACc,mCAAmC,EAAEC,OAAO,CAAC,CAAC,CAAC;AAEpG,eAAeI,qBAAqB"}
@@ -130,6 +130,11 @@ export default class GoogleDriveApiClient {
130
130
  let throwIfDirectory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
131
131
  try {
132
132
  const files = await this.listInternalFiles(scope);
133
+ if (path === '' || path === '/') {
134
+ const rootDirectoryId = await this.getRootDirectoryId(scope);
135
+ if (!rootDirectoryId) throw new CloudStorageError(`Root directory in scope ${scope} not found`, CloudStorageErrorCode.DIRECTORY_NOT_FOUND);
136
+ return rootDirectoryId;
137
+ }
133
138
  const {
134
139
  directories,
135
140
  filename
@@ -1 +1 @@
1
- {"version":3,"names":["GDrive","HttpError","MimeTypes","CloudStorageErrorCode","CloudStorageError","GoogleDriveApiClient","drive","throwOnFilesWithSameName","constructor","filesWithSameNameSubscribers","fetchTimeout","Proxy","get","target","prop","allowedFunctions","includes","toString","accessToken","GOOGLE_DRIVE_ACCESS_TOKEN_MISSING","subscribeToFilesWithSameName","subscriber","push","remove","filter","s","isCloudAvailable","_GoogleDriveApiClient","length","getRootDirectory","scope","resolvePathToDirectories","path","startsWith","slice","endsWith","directories","split","actualFilename","pop","filename","findParentDirectoryId","files","directoryTree","possibleTopDirectories","f","mimeType","FOLDER","name","topDirectoryId","id","possibleTopDirectory","find","parents","DIRECTORY_NOT_FOUND","currentDirectoryId","i","currentDirectory","nextDirectory","getRootDirectoryId","listInternalFiles","file","list","spaces","fields","checkIfMultipleFilesWithSameName","parentDirectoryId","possibleFiles","f2","map","join","MULTIPLE_FILES_SAME_NAME","forEach","fileIds","getFileId","throwIfDirectory","arguments","undefined","FILE_NOT_FOUND","PATH_IS_DIRECTORY","e","_e$json","_e$json$error","json","error","status","AUTHENTICATION_FAILED","UNKNOWN","fileExists","code","createFile","data","overwrite","fileId","FILE_ALREADY_EXISTS","uploader","newMultipartUploader","setData","TEXT","setIdOfFileToUpdate","setRequestBody","execute","listFiles","allFiles","Array","from","Set","rootDirectoryId","createDirectory","newMetadataOnlyUploader","readFile","content","getText","deleteFile","delete","statFile","size","birthtimeMs","Date","createdTime","getTime","mtimeMs","modifiedTime","isDirectory","isFile"],"sourceRoot":"../../../src","sources":["google-drive/index.ts"],"mappings":"AAAA,SAASA,MAAM,EAAEC,SAAS,EAAEC,SAAS,QAAQ,0CAA0C;AAEvF,SACEC,qBAAqB,QAGhB,iBAAiB;AAExB,OAAOC,iBAAiB,MAAM,4BAA4B;AAE1D,eAAe,MAAMC,oBAAoB,CAAiC;EACxE,OAAeC,KAAK,GAAW,IAAIN,MAAM,EAAE;EAC3C,OAAcO,wBAAwB,GAAG,KAAK;EAG9CC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,4BAA4B,GAAG,EAAE;IACtCJ,oBAAoB,CAACC,KAAK,CAACI,YAAY,GAAG,IAAI;IAC9C,OAAO,IAAIC,KAAK,CAAC,IAAI,EAAE;MACrB;MACAC,GAAGA,CAACC,MAA4B,EAAEC,IAAgC,EAAE;QAClE,MAAMC,gBAAgB,GAAG,CAAC,kBAAkB,EAAE,8BAA8B,CAAC;QAC7E,IAAI,OAAOF,MAAM,CAACC,IAAI,CAAC,KAAK,UAAU,IAAI,CAACC,gBAAgB,CAACC,QAAQ,CAACF,IAAI,CAACG,QAAQ,EAAE,CAAC,EAAE;UACrF,IAAI,CAACZ,oBAAoB,CAACC,KAAK,CAACY,WAAW,EAAE;YAC3C,MAAM,IAAId,iBAAiB,CACxB,8DAA6DU,IAAI,CAACG,QAAQ,EAAG,EAAC,EAC/Ed,qBAAq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UA,CAACjF,IAAY,EAAEF,KAAqC,EAAiB;IACnF,MAAM+D,MAAM,GAAG,MAAM,IAAI,CAACnB,SAAS,CAAC1C,IAAI,EAAEF,KAAK,CAAC;IAChD,MAAMzB,oBAAoB,CAACC,KAAK,CAACoC,KAAK,CAACwE,MAAM,CAACrB,MAAM,CAAC;EACvD;EAEA,MAAMsB,QAAQA,CAACnF,IAAY,EAAEF,KAAqC,EAA8C;IAC9G,MAAM+D,MAAM,GAAG,MAAM,IAAI,CAACnB,SAAS,CAAC1C,IAAI,EAAEF,KAAK,EAAE,KAAK,CAAC;IACvD,MAAM+B,IAA6B,GAAG,MAAM,CAC1C,MAAMxD,oBAAoB,CAACC,KAAK,CAACoC,KAAK,CAAC9B,GAAG,CAACiF,MAAM,EAAG;MAClD7B,MAAM,EAAE;IACV,CAAC,CAAC,EACFmB,IAAI,EAAE;IAER,OAAO;MACLiC,IAAI,EAAEvD,IAAI,CAACuD,IAAI,IAAI,CAAC;MACpBC,WAAW,EAAE,IAAIC,IAAI,CAACzD,IAAI,CAAC0D,WAAW,CAAE,CAACC,OAAO,EAAE;MAClDC,OAAO,EAAE,IAAIH,IAAI,CAACzD,IAAI,CAAC6D,YAAY,CAAE,CAACF,OAAO,EAAE;MAC/CG,WAAW,EAAE9D,IAAI,CAACf,QAAQ,KAAK5C,SAAS,CAAC6C,MAAM;MAC/C6E,MAAM,EAAE/D,IAAI,CAACf,QAAQ,KAAK5C,SAAS,CAAC6C;IACtC,CAAC;EACH;AACF"}
1
+ {"version":3,"names":["GDrive","HttpError","MimeTypes","CloudStorageErrorCode","CloudStorageError","GoogleDriveApiClient","drive","throwOnFilesWithSameName","constructor","filesWithSameNameSubscribers","fetchTimeout","Proxy","get","target","prop","allowedFunctions","includes","toString","accessToken","GOOGLE_DRIVE_ACCESS_TOKEN_MISSING","subscribeToFilesWithSameName","subscriber","push","remove","filter","s","isCloudAvailable","_GoogleDriveApiClient","length","getRootDirectory","scope","resolvePathToDirectories","path","startsWith","slice","endsWith","directories","split","actualFilename","pop","filename","findParentDirectoryId","files","directoryTree","possibleTopDirectories","f","mimeType","FOLDER","name","topDirectoryId","id","possibleTopDirectory","find","parents","DIRECTORY_NOT_FOUND","currentDirectoryId","i","currentDirectory","nextDirectory","getRootDirectoryId","listInternalFiles","file","list","spaces","fields","checkIfMultipleFilesWithSameName","parentDirectoryId","possibleFiles","f2","map","join","MULTIPLE_FILES_SAME_NAME","forEach","fileIds","getFileId","throwIfDirectory","arguments","undefined","rootDirectoryId","FILE_NOT_FOUND","PATH_IS_DIRECTORY","e","_e$json","_e$json$error","json","error","status","AUTHENTICATION_FAILED","UNKNOWN","fileExists","code","createFile","data","overwrite","fileId","FILE_ALREADY_EXISTS","uploader","newMultipartUploader","setData","TEXT","setIdOfFileToUpdate","setRequestBody","execute","listFiles","allFiles","Array","from","Set","createDirectory","newMetadataOnlyUploader","readFile","content","getText","deleteFile","delete","statFile","size","birthtimeMs","Date","createdTime","getTime","mtimeMs","modifiedTime","isDirectory","isFile"],"sourceRoot":"../../../src","sources":["google-drive/index.ts"],"mappings":"AAAA,SAASA,MAAM,EAAEC,SAAS,EAAEC,SAAS,QAAQ,0CAA0C;AAEvF,SACEC,qBAAqB,QAGhB,iBAAiB;AAExB,OAAOC,iBAAiB,MAAM,4BAA4B;AAE1D,eAAe,MAAMC,oBAAoB,CAAiC;EACxE,OAAeC,KAAK,GAAW,IAAIN,MAAM,EAAE;EAC3C,OAAcO,wBAAwB,GAAG,KAAK;EAG9CC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,4BAA4B,GAAG,EAAE;IACtCJ,oBAAoB,CAACC,KAAK,CAACI,YAAY,GAAG,IAAI;IAC9C,OAAO,IAAIC,KAAK,CAAC,IAAI,EAAE;MACrB;MACAC,GAAGA,CAACC,MAA4B,EAAEC,IAAgC,EAAE;QAClE,MAAMC,gBAAgB,GAAG,CAAC,kBAAkB,EAAE,8BAA8B,CAAC;QAC7E,IAAI,OAAOF,MAAM,CAACC,I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AAO,EAAE,IAAIH,IAAI,CAACzD,IAAI,CAAC6D,YAAY,CAAE,CAACF,OAAO,EAAE;MAC/CG,WAAW,EAAE9D,IAAI,CAACf,QAAQ,KAAK5C,SAAS,CAAC6C,MAAM;MAC/C6E,MAAM,EAAE/D,IAAI,CAACf,QAAQ,KAAK5C,SAAS,CAAC6C;IACtC,CAAC;EACH;AACF"}
@@ -1,5 +1,12 @@
1
1
  import RNCloudStorage from '../RNCloudStorage';
2
2
  import { useCallback, useEffect, useState } from 'react';
3
+
4
+ /**
5
+ * A utility hook for reading and writing to a single file in the cloud.
6
+ * @param path The path to the file.
7
+ * @param scope The directory scope the path is in. If not provided, defaults to the default scope set in the library.
8
+ * @returns An object containing the file's contents and functions for reading, writing, and removing the file.
9
+ */
3
10
  export const useCloudFile = (path, scope) => {
4
11
  const [content, setContent] = useState(null);
5
12
  const read = useCallback(async () => {
@@ -13,7 +20,7 @@ export const useCloudFile = (path, scope) => {
13
20
  useEffect(() => {
14
21
  read();
15
22
  }, [read]);
16
- const update = useCallback(async newContent => {
23
+ const write = useCallback(async newContent => {
17
24
  await RNCloudStorage.writeFile(path, newContent, scope);
18
25
  read();
19
26
  }, [path, scope, read]);
@@ -24,8 +31,13 @@ export const useCloudFile = (path, scope) => {
24
31
  return {
25
32
  content,
26
33
  read,
27
- update,
28
- remove
34
+ write,
35
+ remove,
36
+ /**
37
+ * @deprecated Use `write` instead.
38
+ * @alias write
39
+ */
40
+ update: write
29
41
  };
30
42
  };
31
43
  //# sourceMappingURL=useCloudFile.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["RNCloudStorage","useCallback","useEffect","useState","useCloudFile","path","scope","content","setContent","read","exists","readFile","then","update","newContent","writeFile","remove","unlink"],"sourceRoot":"../../../src","sources":["hooks/useCloudFile.ts"],"mappings":"AACA,OAAOA,cAAc,MAAM,mBAAmB;AAC9C,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAExD,OAAO,MAAMC,YAAY,GAAGA,CAACC,IAAY,EAAEC,KAAwB,KAAK;EACtE,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGL,QAAQ,CAAgB,IAAI,CAAC;EAE3D,MAAMM,IAAI,GAAGR,WAAW,CAAC,YAAY;IACnC,MAAMS,MAAM,GAAG,MAAMV,cAAc,CAACU,MAAM,CAACL,IAAI,EAAEC,KAAK,CAAC;IACvD,IAAI,CAACI,MAAM,EAAE;MACXF,UAAU,CAAC,IAAI,CAAC;MAChB;IACF;IACAR,cAAc,CAACW,QAAQ,CAACN,IAAI,EAAEC,KAAK,CAAC,CAACM,IAAI,CAACJ,UAAU,CAAC;EACvD,CAAC,EAAE,CAACH,IAAI,EAAEC,KAAK,CAAC,CAAC;EAEjBJ,SAAS,CAAC,MAAM;IACdO,IAAI,EAAE;EACR,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EAEV,MAAMI,MAAM,GAAGZ,WAAW,CACxB,MAAOa,UAAkB,IAAK;IAC5B,MAAMd,cAAc,CAACe,SAAS,CAACV,IAAI,EAAES,UAAU,EAAER,KAAK,CAAC;IACvDG,IAAI,EAAE;EACR,CAAC,EACD,CAACJ,IAAI,EAAEC,KAAK,EAAEG,IAAI,CAAC,CACpB;EAED,MAAMO,MAAM,GAAGf,WAAW,CAAC,YAAY;IACrC,MAAMD,cAAc,CAACiB,MAAM,CAACZ,IAAI,EAAEC,KAAK,CAAC;IACxCE,UAAU,CAAC,IAAI,CAAC;EAClB,CAAC,EAAE,CAACH,IAAI,EAAEC,KAAK,CAAC,CAAC;EAEjB,OAAO;IACLC,OAAO;IACPE,IAAI;IACJI,MAAM;IACNG;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["RNCloudStorage","useCallback","useEffect","useState","useCloudFile","path","scope","content","setContent","read","exists","readFile","then","write","newContent","writeFile","remove","unlink","update"],"sourceRoot":"../../../src","sources":["hooks/useCloudFile.ts"],"mappings":"AACA,OAAOA,cAAc,MAAM,mBAAmB;AAC9C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rorCode = /*#__PURE__*/function (CloudStorageErrorCode) {
2
2
  CloudStorageErrorCode["FILE_NOT_FOUND"] = "ERR_FILE_NOT_FOUND";
3
3
  CloudStorageErrorCode["PATH_IS_DIRECTORY"] = "ERR_PATH_IS_DIRECTORY";
4
- CloudStorageErrorCode["DIRECTORY_NOT_FOUND"] = "ERR_NO_DIRECTORY_FOUND";
4
+ CloudStorageErrorCode["DIRECTORY_NOT_FOUND"] = "ERR_DIRECTORY_NOT_FOUND";
5
5
  CloudStorageErrorCode["FILE_ALREADY_EXISTS"] = "ERR_FILE_EXISTS";
6
6
  CloudStorageErrorCode["MULTIPLE_FILES_SAME_NAME"] = "ERR_MULTIPLE_FILES_SAME_NAME";
7
7
  CloudStorageErrorCode["AUTHENTICATION_FAILED"] = "ERR_AUTHENTICATION_FAILED";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Checks if the path starts with a leading slash and adds one if it doesn't to maintain backwards compatibility.
3
+ * Will log a warning to the console if it had to add a leading slash. Will throw an error in the future.
4
+ *
5
+ * @param path The path to check.
6
+ * @returns The path with a leading slash, if it didn't have one already.
7
+ * @private
8
+ */
9
+ export const verifyLeadingSlash = path => {
10
+ if (!path.startsWith('/')) {
11
+ console.warn(`[react-native-cloud-storage] Path "${path}" did not start with a leading slash. This is deprecated and will be an error in the future.`);
12
+ return `/${path}`;
13
+ }
14
+ return path;
15
+ };
16
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["verifyLeadingSlash","path","startsWith","console","warn"],"sourceRoot":"../../../src","sources":["utils/helpers.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,kBAAkB,GAAIC,IAAY,IAAK;EAClD,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,EAAE;IACzBC,OAAO,CAACC,IAAI,CACT,sCAAqCH,IAAK,8FAA6F,CACzI;IACD,OAAQ,IAAGA,IAAK,EAAC;EACnB;EACA,OAAOA,IAAI;AACb,CAAC"}
@@ -1,5 +1,7 @@
1
- import type { CloudStorageFileStat, CloudStorageScope } from './types/main';
1
+ import { type CloudStorageFileStat, CloudStorageScope } from './types/main';
2
2
  declare const RNCloudStorage: {
3
+ getDefaultScope: () => CloudStorageScope;
4
+ setDefaultScope: (scope: CloudStorageScope) => CloudStorageScope;
3
5
  getGoogleDriveAccessToken: () => string | undefined;
4
6
  setGoogleDriveAccessToken: (accessToken: string) => string;
5
7
  setThrowOnFilesWithSameName: (enable: boolean) => boolean;
@@ -18,53 +20,53 @@ declare const RNCloudStorage: {
18
20
  /**
19
21
  * Tests whether or not the file at the given path exists.
20
22
  * @param path The path to test.
21
- * @param scope The directory scope the path is in.
23
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
22
24
  * @returns A promise that resolves to true if the path exists, false otherwise.
23
25
  */
24
- exists: (path: string, scope: CloudStorageScope) => Promise<boolean>;
26
+ exists: (path: string, scope?: CloudStorageScope) => Promise<boolean>;
25
27
  /**
26
28
  * Writes to the file at the given path, creating it if it doesn't exist or overwriting it if it does.
27
29
  * @param path The file to write to.
28
30
  * @param data The data to write.
29
- * @param scope The directory scope the path is in.
31
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
30
32
  * @returns A promise that resolves when the file has been written.
31
33
  */
32
- writeFile: (path: string, data: string, scope: CloudStorageScope) => Promise<void>;
34
+ writeFile: (path: string, data: string, scope?: CloudStorageScope) => Promise<void>;
33
35
  /**
34
36
  * Creates a new directory at the given path.
35
37
  * @param path The directory to create.
36
- * @param scope The directory scope the path is in.
38
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
37
39
  * @returns A promise that resolves when the directory has been created.
38
40
  */
39
- mkdir: (path: string, scope: CloudStorageScope) => Promise<void>;
41
+ mkdir: (path: string, scope?: CloudStorageScope) => Promise<void>;
40
42
  /**
41
43
  * Lists the contents of the directory at the given path.
42
44
  * @param path The directory to list.
43
- * @param scope The directory scope the path is in.
45
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
44
46
  * @returns A promise that resolves to an array of file names, excluding '.' and '..'.
45
47
  */
46
- readdir: (path: string, scope: CloudStorageScope) => Promise<string[]>;
48
+ readdir: (path: string, scope?: CloudStorageScope) => Promise<string[]>;
47
49
  /**
48
50
  * Reads the contents of the file at the given path.
49
51
  * @param path The file to read.
50
- * @param scope The directory scope the path is in.
52
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
51
53
  * @returns A promise that resolves to the contents of the file.
52
54
  */
53
- readFile: (path: string, scope: CloudStorageScope) => Promise<string>;
55
+ readFile: (path: string, scope?: CloudStorageScope) => Promise<string>;
54
56
  /**
55
57
  * Deletes the file at the given path.
56
58
  * @param path The file to delete.
57
- * @param scope The directory scope the path is in.
59
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
58
60
  * @returns A promise that resolves when the file has been deleted.
59
61
  */
60
- unlink: (path: string, scope: CloudStorageScope) => Promise<void>;
62
+ unlink: (path: string, scope?: CloudStorageScope) => Promise<void>;
61
63
  /**
62
64
  * Gets the size, creation time, and modification time of the file at the given path.
63
65
  * @param path The file to stat.
64
- * @param scope The directory scope the path is in.
66
+ * @param scope The directory scope the path is in. Defaults to the set default scope.
65
67
  * @returns A promise that resolves to the CloudStorageFileStat object.
66
68
  */
67
- stat: (path: string, scope: CloudStorageScope) => Promise<CloudStorageFileStat>;
69
+ stat: (path: string, scope?: CloudStorageScope) => Promise<CloudStorageFileStat>;
68
70
  };
69
71
  export default RNCloudStorage;
70
72
  //# sourceMappingURL=RNCloudStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RNCloudStorage.d.ts","sourceRoot":"","sources":["../../src/RNCloudStorage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAK5E,QAAA,MAAM,cAAc;;6CAEuB,MAAM;0CACT,OAAO;;;;;;;IAS7C;;;;OAIG;4BACyB,QAAQ,OAAO,C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iBAAiB,KAAG,QAAQ,IAAI,CAAC;IAIhE;;;;;OAKG;iBACgB,MAAM,UAAU,iBAAiB,KAAG,QAAQ,oBAAoB,CAAC;CAWrF,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface RNCloudStorageConfigPluginOptions {
2
+ /**
3
+ * The iCloud container environment to use. Defaults to 'Production'.
4
+ */
5
+ iCloudContainerEnvironment?: 'Production' | 'Development';
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/expo-plugin/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,0BAA0B,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CAC3D"}
@@ -1,10 +1,5 @@
1
+ import type { RNCloudStorageConfigPluginOptions } from './types';
1
2
  import type { ConfigPlugin } from '@expo/config-plugins';
2
- interface RNCloudStorageConfigPluginOptions {
3
- /**
4
- * The iCloud container environment to use. Defaults to 'Production'.
5
- */
6
- iCloudContainerEnvironment?: 'Production' | 'Development';
7
- }
8
3
  declare const withRNCloudStorage: ConfigPlugin<RNCloudStorageConfigPluginOptions>;
9
4
  export default withRNCloudStorage;
10
5
  //# sourceMappingURL=withRNCloudStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withRNCloudStorage.d.ts","sourceRoot":"","sources":["../../../src/expo-plugin/withRNCloudStorage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,UAAU,iCAAiC;IACzC;;OAEG;IACH,0BAA0B,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CAC3D;AACD,QAAA,MAAM,kBAAkB,EAAE,YAAY,CAAC,iCAAiC,CACY,CAAC;AAErF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"withRNCloudStorage.d.ts","sourceRoot":"","sources":["../../../src/expo-plugin/withRNCloudStorage.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"}
@@ -1,4 +1,5 @@
1
- import type { ExpoConfig } from 'expo/config';
2
- declare const withRNCloudStorageIos: (config: ExpoConfig, iCloudContainerEnvironment: 'Production' | 'Development') => ExpoConfig;
1
+ import { type ConfigPlugin } from '@expo/config-plugins';
2
+ import type { RNCloudStorageConfigPluginOptions } from './types';
3
+ declare const withRNCloudStorageIos: ConfigPlugin<RNCloudStorageConfigPluginOptions>;
3
4
  export default withRNCloudStorageIos;
4
5
  //# sourceMappingURL=withRNCloudStorageIos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withRNCloudStorageIos.d.ts","sourceRoot":"","sources":["../../../src/expo-plugin/withRNCloudStorageIos.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuC9C,QAAA,MAAM,qBAAqB,WAAY,UAAU,8BAA8B,YAAY,GAAG,aAAa,eACY,CAAC;AAExH,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"withRNCloudStorageIos.d.ts","sourceRoot":"","sources":["../../../src/expo-plugin/withRNCloudStorageIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAqCjE,QAAA,MAAM,qBAAqB,EAAE,YAAY,CAAC,iCAAiC,CACyB,CAAC;AAErG,eAAe,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/google-drive/index.ts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AE,KAAK,IAAI,GAAG;QACjH,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB;IAUM,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAA0D;IAEzG,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,qBAAqB;IAiD7B;;;;OAIG;YACW,kBAAkB;YASlB,iBAAiB;IAS/B,OAAO,CAAC,gCAAgC;YAyB1B,SAAS;IAiDjB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC;IAUjF,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,8BAA8B,EACrC,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,IAAI,CAAC;IA2CV,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAajF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BnF,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC;IAM9E,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9E,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,iCAAiC,CAAC;CAgBhH"}
@@ -1,8 +1,19 @@
1
1
  import type { CloudStorageScope } from '../types/main';
2
- export declare const useCloudFile: (path: string, scope: CloudStorageScope) => {
2
+ /**
3
+ * A utility hook for reading and writing to a single file in the cloud.
4
+ * @param path The path to the file.
5
+ * @param scope The directory scope the path is in. If not provided, defaults to the default scope set in the library.
6
+ * @returns An object containing the file's contents and functions for reading, writing, and removing the file.
7
+ */
8
+ export declare const useCloudFile: (path: string, scope?: CloudStorageScope) => {
3
9
  content: string | null;
4
10
  read: () => Promise<void>;
5
- update: (newContent: string) => Promise<void>;
11
+ write: (newContent: string) => Promise<void>;
6
12
  remove: () => Promise<void>;
13
+ /**
14
+ * @deprecated Use `write` instead.
15
+ * @alias write
16
+ */
17
+ update: (newContent: string) => Promise<void>;
7
18
  };
8
19
  //# sourceMappingURL=useCloudFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCloudFile.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCloudFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIvD,eAAO,MAAM,YAAY,SAAU,MAAM,SAAS,iBAAiB;;;yBAiB5C,MAAM;;CAkB5B,CAAC"}
1
+ {"version":3,"file":"useCloudFile.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCloudFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIvD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,SAAU,MAAM,UAAU,iBAAiB;;;wBAiB7C,MAAM;;IAiBzB;;;OAGG;yBApBgB,MAAM;CAuB5B,CAAC"}
@@ -9,7 +9,7 @@ export interface NativeRNCloudCloudStorageFileStat {
9
9
  export declare enum CloudStorageErrorCode {
10
10
  FILE_NOT_FOUND = "ERR_FILE_NOT_FOUND",
11
11
  PATH_IS_DIRECTORY = "ERR_PATH_IS_DIRECTORY",
12
- DIRECTORY_NOT_FOUND = "ERR_NO_DIRECTORY_FOUND",
12
+ DIRECTORY_NOT_FOUND = "ERR_DIRECTORY_NOT_FOUND",
13
13
  FILE_ALREADY_EXISTS = "ERR_FILE_EXISTS",
14
14
  MULTIPLE_FILES_SAME_NAME = "ERR_MULTIPLE_FILES_SAME_NAME",
15
15
  AUTHENTICATION_FAILED = "ERR_AUTH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,MAAM,EAAE,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtF,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnF,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,iCAAiC,CAAC,CAAC;IAC9G,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Checks if the path starts with a leading slash and adds one if it doesn't to maintain backwards compatibility.
3
+ * Will log a warning to the console if it had to add a leading slash. Will throw an error in the future.
4
+ *
5
+ * @param path The path to check.
6
+ * @returns The path with a leading slash, if it didn't have one already.
7
+ * @private
8
+ */
9
+ export declare const verifyLeadingSlash: (path: string) => string;
10
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,WAQ9C,CAAC"}