react-native-cloud-storage 1.5.0 → 1.5.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 (106) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -6
  3. package/ios/CloudStorage.swift +262 -52
  4. package/ios/CloudStorage.xcodeproj/project.pbxproj +0 -28
  5. package/ios/CloudStorage.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  6. package/ios/CloudStorage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  7. package/ios/CloudStorage.xcodeproj/project.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  8. package/ios/CloudStorage.xcodeproj/xcuserdata/max.xcuserdatad/xcschemes/xcschememanagement.plist +22 -0
  9. package/ios/CloudStorageEventEmitter.swift +4 -4
  10. package/lib/commonjs/RNCloudStorage.js +66 -361
  11. package/lib/commonjs/RNCloudStorage.js.map +1 -1
  12. package/lib/commonjs/createRNCloudStorage.js +48 -0
  13. package/lib/commonjs/createRNCloudStorage.js.map +1 -0
  14. package/lib/commonjs/expo-plugin/types/index.js.map +1 -1
  15. package/lib/commonjs/expo-plugin/withRNCloudStorage.js +3 -2
  16. package/lib/commonjs/expo-plugin/withRNCloudStorage.js.map +1 -1
  17. package/lib/commonjs/expo-plugin/withRNCloudStorageIos.js +7 -4
  18. package/lib/commonjs/expo-plugin/withRNCloudStorageIos.js.map +1 -1
  19. package/lib/commonjs/google-drive/client.js +20 -16
  20. package/lib/commonjs/google-drive/client.js.map +1 -1
  21. package/lib/commonjs/google-drive/index.js +64 -42
  22. package/lib/commonjs/google-drive/index.js.map +1 -1
  23. package/lib/commonjs/google-drive/types.js +2 -1
  24. package/lib/commonjs/google-drive/types.js.map +1 -1
  25. package/lib/commonjs/hooks/useCloudFile.js +17 -14
  26. package/lib/commonjs/hooks/useCloudFile.js.map +1 -1
  27. package/lib/commonjs/hooks/useIsCloudAvailable.js +21 -11
  28. package/lib/commonjs/hooks/useIsCloudAvailable.js.map +1 -1
  29. package/lib/commonjs/index.js +7 -1
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/types/main.js +3 -8
  32. package/lib/commonjs/types/main.js.map +1 -1
  33. package/lib/commonjs/types/native.js +3 -3
  34. package/lib/commonjs/types/native.js.map +1 -1
  35. package/lib/commonjs/utils/CloudStorageError.js +2 -1
  36. package/lib/commonjs/utils/CloudStorageError.js.map +1 -1
  37. package/lib/commonjs/utils/helpers.js +15 -8
  38. package/lib/commonjs/utils/helpers.js.map +1 -1
  39. package/lib/module/RNCloudStorage.js +65 -362
  40. package/lib/module/RNCloudStorage.js.map +1 -1
  41. package/lib/module/createRNCloudStorage.js +41 -0
  42. package/lib/module/createRNCloudStorage.js.map +1 -0
  43. package/lib/module/expo-plugin/types/index.js +1 -1
  44. package/lib/module/expo-plugin/types/index.js.map +1 -1
  45. package/lib/module/expo-plugin/withRNCloudStorage.js +0 -2
  46. package/lib/module/expo-plugin/withRNCloudStorage.js.map +1 -1
  47. package/lib/module/expo-plugin/withRNCloudStorageIos.js +5 -5
  48. package/lib/module/expo-plugin/withRNCloudStorageIos.js.map +1 -1
  49. package/lib/module/google-drive/client.js +20 -18
  50. package/lib/module/google-drive/client.js.map +1 -1
  51. package/lib/module/google-drive/index.js +62 -41
  52. package/lib/module/google-drive/index.js.map +1 -1
  53. package/lib/module/google-drive/types.js +0 -2
  54. package/lib/module/google-drive/types.js.map +1 -1
  55. package/lib/module/hooks/useCloudFile.js +16 -15
  56. package/lib/module/hooks/useCloudFile.js.map +1 -1
  57. package/lib/module/hooks/useIsCloudAvailable.js +21 -13
  58. package/lib/module/hooks/useIsCloudAvailable.js.map +1 -1
  59. package/lib/module/index.js +5 -2
  60. package/lib/module/index.js.map +1 -1
  61. package/lib/module/types/main.js +0 -9
  62. package/lib/module/types/main.js.map +1 -1
  63. package/lib/module/types/native.js +1 -4
  64. package/lib/module/types/native.js.map +1 -1
  65. package/lib/module/utils/CloudStorageError.js +0 -2
  66. package/lib/module/utils/CloudStorageError.js.map +1 -1
  67. package/lib/module/utils/helpers.js +13 -8
  68. package/lib/module/utils/helpers.js.map +1 -1
  69. package/lib/typescript/RNCloudStorage.d.ts +39 -159
  70. package/lib/typescript/RNCloudStorage.d.ts.map +1 -1
  71. package/lib/typescript/createRNCloudStorage.d.ts +3 -0
  72. package/lib/typescript/createRNCloudStorage.d.ts.map +1 -0
  73. package/lib/typescript/google-drive/client.d.ts +3 -3
  74. package/lib/typescript/google-drive/client.d.ts.map +1 -1
  75. package/lib/typescript/google-drive/index.d.ts +18 -6
  76. package/lib/typescript/google-drive/index.d.ts.map +1 -1
  77. package/lib/typescript/hooks/useCloudFile.d.ts +7 -4
  78. package/lib/typescript/hooks/useCloudFile.d.ts.map +1 -1
  79. package/lib/typescript/hooks/useIsCloudAvailable.d.ts +2 -3
  80. package/lib/typescript/hooks/useIsCloudAvailable.d.ts.map +1 -1
  81. package/lib/typescript/index.d.ts +4 -0
  82. package/lib/typescript/index.d.ts.map +1 -1
  83. package/lib/typescript/types/main.d.ts +0 -33
  84. package/lib/typescript/types/main.d.ts.map +1 -1
  85. package/lib/typescript/types/native.d.ts +1 -2
  86. package/lib/typescript/types/native.d.ts.map +1 -1
  87. package/lib/typescript/utils/helpers.d.ts +9 -2
  88. package/lib/typescript/utils/helpers.d.ts.map +1 -1
  89. package/package.json +11 -9
  90. package/src/RNCloudStorage.ts +68 -387
  91. package/src/createRNCloudStorage.ts +53 -0
  92. package/src/google-drive/client.ts +7 -8
  93. package/src/google-drive/index.ts +63 -38
  94. package/src/hooks/useCloudFile.ts +16 -13
  95. package/src/hooks/useIsCloudAvailable.ts +25 -12
  96. package/src/index.ts +5 -0
  97. package/src/types/main.ts +0 -38
  98. package/src/types/native.ts +1 -2
  99. package/src/utils/helpers.ts +15 -8
  100. package/ios/Utils/CloudKitUtils.swift +0 -112
  101. package/ios/Utils/CloudStorageError.swift +0 -78
  102. package/ios/Utils/FileUtils.swift +0 -132
  103. package/ios/Utils/Promise.swift +0 -58
  104. package/ios/Utils/Types.swift +0 -36
  105. package/lib/commonjs/package.json +0 -1
  106. package/lib/module/package.json +0 -1
@@ -1,17 +1,20 @@
1
1
  import type { CloudStorageScope } from '../types/main';
2
- import RNCloudStorage from '../RNCloudStorage';
3
2
  /**
4
3
  * A utility hook for reading and writing to a single file in the cloud.
5
4
  * @param path The path to the file.
6
- * @param scope The directory scope the path is in. Defaults to the default scope set for the current provider.
7
- * @param cloudStorageInstance An optional instance of RNCloudStorage to use instead of the default instance.
5
+ * @param scope The directory scope the path is in. If not provided, defaults to the default scope set in the library.
8
6
  * @returns An object containing the file's contents and functions for downloading, reading, writing, and removing the file.
9
7
  */
10
- export declare const useCloudFile: (path: string, scope?: CloudStorageScope, cloudStorageInstance?: RNCloudStorage) => {
8
+ export declare const useCloudFile: (path: string, scope?: CloudStorageScope) => {
11
9
  content: string | null;
12
10
  read: () => Promise<void>;
13
11
  write: (newContent: string) => Promise<void>;
14
12
  remove: () => Promise<void>;
13
+ /**
14
+ * @deprecated Use `write` instead.
15
+ * @alias write
16
+ */
17
+ update: (newContent: string) => Promise<void>;
15
18
  /**
16
19
  * Downloads the file from iCloud to the device. Needed if the file hasn't been synced yet. Has no effect on
17
20
  * Google Drive.
@@ -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;AACvD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAG/C;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,SAAU,MAAM,UAAU,iBAAiB,yBAAyB,cAAc;;;wBAkBpF,MAAM;;IAqBzB;;;OAGG;;CAGN,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;;IAqBzB;;;OAGG;yBAxBgB,MAAM;IA0BzB;;;OAGG;;CAGN,CAAC"}
@@ -1,8 +1,7 @@
1
- import RNCloudStorage from '../RNCloudStorage';
2
1
  /**
3
2
  * A hook that tests whether or not the cloud storage is available.
4
- * @param cloudStorageInstance - An optional instance of RNCloudStorage to use instead of the default instance.
3
+ * @param _iCloudTimeout DEPRECATED: This parameter is deprecated and has no effect. It will be removed in a future version.
5
4
  * @returns A boolean indicating whether or not the cloud storage is available.
6
5
  */
7
- export declare const useIsCloudAvailable: (cloudStorageInstance?: RNCloudStorage) => boolean;
6
+ export declare const useIsCloudAvailable: (_iCloudTimeout?: number) => boolean;
8
7
  //# sourceMappingURL=useIsCloudAvailable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsCloudAvailable.d.ts","sourceRoot":"","sources":["../../../src/hooks/useIsCloudAvailable.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,0BAA2B,cAAc,YAqBxE,CAAC"}
1
+ {"version":3,"file":"useIsCloudAvailable.d.ts","sourceRoot":"","sources":["../../../src/hooks/useIsCloudAvailable.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oBAAqB,MAAM,YAiC1D,CAAC"}
@@ -5,4 +5,8 @@ export * from './hooks/useCloudFile';
5
5
  export * from './hooks/useIsCloudAvailable';
6
6
  import CloudStorageError from './utils/CloudStorageError';
7
7
  export { RNCloudStorage as CloudStorage, CloudStorageError, CloudStorageErrorCode };
8
+ /**
9
+ * @deprecated Use the named export `CloudStorage` instead.
10
+ */
11
+ export default RNCloudStorage;
8
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,cAAc,IAAI,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,cAAc,IAAI,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;AAEpF;;GAEG;AACH,eAAe,cAAc,CAAC"}
@@ -1,6 +1,3 @@
1
- export type DeepRequired<T> = {
2
- [P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : T[P];
3
- };
4
1
  export declare enum CloudStorageScope {
5
2
  Documents = "documents",
6
3
  AppData = "app_data"
@@ -14,34 +11,4 @@ export interface CloudStorageFileStat {
14
11
  isDirectory: () => boolean;
15
12
  isFile: () => boolean;
16
13
  }
17
- export declare enum CloudStorageProvider {
18
- ICloud = "icloud",
19
- GoogleDrive = "googledrive"
20
- }
21
- export interface CloudStorageProviderOptions {
22
- [CloudStorageProvider.ICloud]: {
23
- /**
24
- * The directory scope to use for iCloud operations. Defaults to 'app_data'.
25
- */
26
- scope?: CloudStorageScope;
27
- };
28
- [CloudStorageProvider.GoogleDrive]: {
29
- /**
30
- * The directory scope to use for Google Drive operations. Defaults to 'app_data'.
31
- */
32
- scope?: CloudStorageScope;
33
- /**
34
- * The access token to use for Google Drive operations.
35
- */
36
- accessToken?: string | null;
37
- /**
38
- * Whether or not to throw an error if multiple files with the same filename are found. Defaults to false.
39
- */
40
- strictFilenames?: boolean;
41
- /**
42
- * The timeout in milliseconds after which to cancel an API request. Defaults to 3000.
43
- */
44
- timeout?: number;
45
- };
46
- }
47
14
  //# sourceMappingURL=main.d.ts.map
@@ -1 +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,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;KAC3B,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"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/types/main.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,SAAS,cAAc;IACvB,OAAO,aAAa;CACrB;AAED,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"}
@@ -7,7 +7,6 @@ export interface NativeRNCloudCloudStorageFileStat {
7
7
  isFile: boolean;
8
8
  }
9
9
  export declare enum CloudStorageErrorCode {
10
- INVALID_SCOPE = "ERR_INVALID_SCOPE",
11
10
  FILE_NOT_FOUND = "ERR_FILE_NOT_FOUND",
12
11
  PATH_IS_FILE = "ERR_PATH_IS_FILE",
13
12
  PATH_IS_DIRECTORY = "ERR_PATH_IS_DIRECTORY",
@@ -22,7 +21,7 @@ export declare enum CloudStorageErrorCode {
22
21
  STAT_ERROR = "ERR_STAT_ERROR",
23
22
  UNKNOWN = "ERR_UNKNOWN",
24
23
  FILE_NOT_DOWNLOADABLE = "ERR_FILE_NOT_DOWNLOADABLE",
25
- ACCESS_TOKEN_MISSING = "ERR_ACCESS_TOKEN_MISSING"
24
+ GOOGLE_DRIVE_ACCESS_TOKEN_MISSING = "ERR_GOOGLE_DRIVE_ACCESS_TOKEN_MISSING"
26
25
  }
27
26
  export default interface NativeRNCloudStorage {
28
27
  fileExists: (path: string, scope: NativeRNCloudCloudStorageScope) => Promise<boolean>;
@@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AC,IAAI,CAAC,CAAC;IAC9G,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"}
@@ -1,3 +1,10 @@
1
- import { CloudStorageProvider } from '../types/main';
2
- export declare const isProviderSupported: (provider: CloudStorageProvider) => boolean;
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;
3
10
  //# sourceMappingURL=helpers.d.ts.map
@@ -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;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,WAQ9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-cloud-storage",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Save to & read from iCloud and Google Drive using React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -35,8 +35,7 @@
35
35
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
36
36
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
37
  "prepare": "bob build",
38
- "release": "release-it",
39
- "check": "yarn lint && scripts/swiftformat.sh"
38
+ "release": "release-it"
40
39
  },
41
40
  "keywords": [
42
41
  "react-native",
@@ -58,24 +57,28 @@
58
57
  "@evilmartians/lefthook": "^1.5.0",
59
58
  "@expo/config-plugins": "^7.2.5",
60
59
  "@react-native-community/eslint-config": "^3.2.0",
61
- "@react-native/eslint-config": "0.74.87",
60
+ "@react-native/eslint-config": "^0.72.2",
62
61
  "@release-it/conventional-changelog": "^5.0.0",
63
62
  "@types/jest": "^28.1.2",
64
- "@types/react": "^18.2.6",
63
+ "@types/react": "~17.0.21",
64
+ "@types/react-native": "0.70.0",
65
65
  "commitlint": "^17.0.2",
66
66
  "del-cli": "^5.0.0",
67
67
  "eslint": "^8.4.1",
68
68
  "eslint-config-prettier": "^8.5.0",
69
69
  "eslint-plugin-prettier": "^4.0.0",
70
70
  "jest": "^28.1.1",
71
- "pod-install": "^0.2.2",
71
+ "pod-install": "^0.1.0",
72
72
  "prettier": "^2.0.5",
73
73
  "react": "18.2.0",
74
- "react-native": "0.74.5",
75
- "react-native-builder-bob": "^0.28.0",
74
+ "react-native": "0.72.5",
75
+ "react-native-builder-bob": "^0.20.0",
76
76
  "release-it": "^15.0.0",
77
77
  "typescript": "^5.0.2"
78
78
  },
79
+ "resolutions": {
80
+ "@types/react": "17.0.21"
81
+ },
79
82
  "peerDependencies": {
80
83
  "expo": ">=48.0.0",
81
84
  "react": "*",
@@ -130,7 +133,6 @@
130
133
  "prettier"
131
134
  ],
132
135
  "rules": {
133
- "react-native/no-inline-styles": "off",
134
136
  "prettier/prettier": [
135
137
  "error",
136
138
  {