react-native-blob-util 0.21.3 → 0.22.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 (98) hide show
  1. package/.eslintrc.js +56 -56
  2. package/LICENSE +21 -21
  3. package/Migration.md +41 -41
  4. package/NuGet.config +11 -0
  5. package/README.md +1104 -1104
  6. package/android/gradle.properties +1 -1
  7. package/android/src/main/AndroidManifest.xml +37 -37
  8. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConfig.java +57 -57
  9. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConst.java +20 -20
  10. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFileTransformer.java +9 -9
  11. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilImpl.java +431 -431
  12. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilProgressConfig.java +39 -39
  13. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java +1014 -1014
  14. package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilDefaultResp.java +98 -98
  15. package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java +166 -166
  16. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileDescription.java +19 -19
  17. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileProvider.java +4 -4
  18. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/MimeType.java +70 -70
  19. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/PathResolver.java +223 -223
  20. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/Tls12SocketFactory.java +68 -68
  21. package/android/src/main/res/values/strings.xml +3 -3
  22. package/android/src/main/res/xml/provider_paths.xml +12 -12
  23. package/android.js +58 -58
  24. package/class/ReactNativeBlobUtilCanceledFetchError.js +9 -9
  25. package/class/ReactNativeBlobUtilFile.js +5 -5
  26. package/class/ReactNativeBlobUtilReadStream.js +84 -84
  27. package/class/ReactNativeBlobUtilSession.js +68 -68
  28. package/class/ReactNativeBlobUtilWriteStream.js +50 -50
  29. package/class/StatefulPromise.js +7 -7
  30. package/codegenSpecs/NativeBlobUtils.js +86 -86
  31. package/components/Fetch.onPress.js +10 -10
  32. package/components/Fetch.when.js +15 -15
  33. package/fetch.js +350 -350
  34. package/fs.js +480 -480
  35. package/index.js +64 -64
  36. package/index.js.flow +192 -192
  37. package/index.web.js +1 -1
  38. package/ios/PrivacyInfo.xcprivacy +28 -28
  39. package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.h +55 -55
  40. package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm +992 -992
  41. package/ios/ReactNativeBlobUtil.xcodeproj/project.pbxproj +405 -405
  42. package/ios/ReactNativeBlobUtilConst.h +58 -58
  43. package/ios/ReactNativeBlobUtilConst.mm +47 -47
  44. package/ios/ReactNativeBlobUtilFS.h +108 -108
  45. package/ios/ReactNativeBlobUtilFS.mm +1064 -1064
  46. package/ios/ReactNativeBlobUtilFileTransformer.h +23 -23
  47. package/ios/ReactNativeBlobUtilFileTransformer.mm +20 -20
  48. package/ios/ReactNativeBlobUtilNetwork.h +49 -49
  49. package/ios/ReactNativeBlobUtilNetwork.mm +159 -159
  50. package/ios/ReactNativeBlobUtilProgress.h +32 -32
  51. package/ios/ReactNativeBlobUtilProgress.mm +57 -57
  52. package/ios/ReactNativeBlobUtilReqBuilder.h +37 -37
  53. package/ios/ReactNativeBlobUtilReqBuilder.mm +292 -292
  54. package/ios/ReactNativeBlobUtilRequest.h +48 -48
  55. package/ios/ReactNativeBlobUtilRequest.mm +584 -584
  56. package/ios.js +61 -61
  57. package/json-stream.js +42 -42
  58. package/lib/oboe-browser.js +2703 -2703
  59. package/mediacollection.js +36 -36
  60. package/package.json +68 -55
  61. package/polyfill/Blob.js +362 -362
  62. package/polyfill/Event.js +11 -11
  63. package/polyfill/EventTarget.js +78 -78
  64. package/polyfill/Fetch.js +219 -219
  65. package/polyfill/File.js +27 -27
  66. package/polyfill/FileReader.js +91 -91
  67. package/polyfill/ProgressEvent.js +32 -32
  68. package/polyfill/XMLHttpRequest.js +466 -466
  69. package/polyfill/XMLHttpRequestEventTarget.js +126 -126
  70. package/polyfill/index.js +11 -11
  71. package/react-native-blob-util.podspec +48 -48
  72. package/types.js +69 -69
  73. package/utils/log.js +40 -40
  74. package/utils/unicode.js +7 -7
  75. package/utils/uri.js +33 -33
  76. package/utils/uuid.js +4 -4
  77. package/windows/ExperimentalFeatures.props +33 -0
  78. package/windows/README.md +2 -2
  79. package/windows/ReactNativeBlobUtil/PropertySheet.props +15 -15
  80. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.cpp +1837 -1701
  81. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.def +3 -3
  82. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.h +373 -379
  83. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.rc +0 -0
  84. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj +140 -181
  85. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj.filters +43 -31
  86. package/windows/ReactNativeBlobUtil/ReactPackageProvider.cpp +20 -15
  87. package/windows/ReactNativeBlobUtil/ReactPackageProvider.h +24 -20
  88. package/windows/ReactNativeBlobUtil/ReactPackageProvider.idl +9 -9
  89. package/windows/ReactNativeBlobUtil/codegen/.clang-format +2 -0
  90. package/windows/ReactNativeBlobUtil/codegen/NativeBlobUtilsDataTypes.g.h +42 -0
  91. package/windows/ReactNativeBlobUtil/codegen/NativeBlobUtilsSpec.g.h +353 -0
  92. package/windows/ReactNativeBlobUtil/packages.config +3 -3
  93. package/windows/ReactNativeBlobUtil/packages.lock.json +60 -0
  94. package/windows/ReactNativeBlobUtil/pch.cpp +1 -1
  95. package/windows/ReactNativeBlobUtil/pch.h +30 -4
  96. package/windows/ReactNativeBlobUtil/resource.h +5 -0
  97. package/windows/ReactNativeBlobUtil/targetver.h +8 -0
  98. package/windows/ReactNativeBlobUtil.sln +43 -0
package/.eslintrc.js CHANGED
@@ -1,56 +1,56 @@
1
- module.exports = {
2
- root: true,
3
- extends: '@react-native-community',
4
- rules: {
5
- 'prettier/prettier': 0,
6
- "eqeqeq": 2,
7
- "comma-dangle": 0,
8
- curly: 0,
9
- "no-console": 1,
10
- "no-debugger": 1,
11
- "no-extra-semi": 2,
12
- "no-extra-parens": 1,
13
- "no-extra-boolean-cast": 1,
14
- "no-cond-assign": 2,
15
- "no-irregular-whitespace": 2,
16
- "no-undef": 0,
17
- "no-unused-vars": 0,
18
- "semi": 2,
19
- "semi-spacing": 2,
20
- "valid-jsdoc": [
21
- 1,
22
- {
23
- "requireReturn": false,
24
- "requireParamDescription": false,
25
- "requireReturnDescription": false
26
- }
27
- ],
28
- "radix": 0,
29
-
30
- "react/display-name": 2,
31
- "react/forbid-prop-types": 1,
32
- "react/jsx-boolean-value": 1,
33
- "react/jsx-closing-bracket-location": 1,
34
- "react/jsx-curly-spacing": 1,
35
- "react/jsx-indent-props": 0,
36
- "react/jsx-max-props-per-line": 0,
37
- "react/jsx-no-duplicate-props": 1,
38
- "react/jsx-no-literals": 0,
39
- "react/jsx-no-undef": 1,
40
- "react/jsx-sort-props": 0,
41
- "react/jsx-uses-react": 1,
42
- "react/jsx-uses-vars": 1,
43
- "react/jsx-wrap-multilines": 1,
44
- "react/no-danger": 1,
45
- "react/no-did-mount-set-state": 1,
46
- "react/no-did-update-set-state": 1,
47
- "react/no-direct-mutation-state": 1,
48
- "react/no-multi-comp": 1,
49
- "react/no-set-state": 0,
50
- "react/no-unknown-property": 1,
51
- "react/prop-types": 0,
52
- "react/react-in-jsx-scope": 0,
53
- "react/self-closing-comp": 1,
54
- "react/sort-comp": 1,
55
- },
56
- };
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native-community',
4
+ rules: {
5
+ 'prettier/prettier': 0,
6
+ "eqeqeq": 2,
7
+ "comma-dangle": 0,
8
+ curly: 0,
9
+ "no-console": 1,
10
+ "no-debugger": 1,
11
+ "no-extra-semi": 2,
12
+ "no-extra-parens": 1,
13
+ "no-extra-boolean-cast": 1,
14
+ "no-cond-assign": 2,
15
+ "no-irregular-whitespace": 2,
16
+ "no-undef": 0,
17
+ "no-unused-vars": 0,
18
+ "semi": 2,
19
+ "semi-spacing": 2,
20
+ "valid-jsdoc": [
21
+ 1,
22
+ {
23
+ "requireReturn": false,
24
+ "requireParamDescription": false,
25
+ "requireReturnDescription": false
26
+ }
27
+ ],
28
+ "radix": 0,
29
+
30
+ "react/display-name": 2,
31
+ "react/forbid-prop-types": 1,
32
+ "react/jsx-boolean-value": 1,
33
+ "react/jsx-closing-bracket-location": 1,
34
+ "react/jsx-curly-spacing": 1,
35
+ "react/jsx-indent-props": 0,
36
+ "react/jsx-max-props-per-line": 0,
37
+ "react/jsx-no-duplicate-props": 1,
38
+ "react/jsx-no-literals": 0,
39
+ "react/jsx-no-undef": 1,
40
+ "react/jsx-sort-props": 0,
41
+ "react/jsx-uses-react": 1,
42
+ "react/jsx-uses-vars": 1,
43
+ "react/jsx-wrap-multilines": 1,
44
+ "react/no-danger": 1,
45
+ "react/no-did-mount-set-state": 1,
46
+ "react/no-did-update-set-state": 1,
47
+ "react/no-direct-mutation-state": 1,
48
+ "react/no-multi-comp": 1,
49
+ "react/no-set-state": 0,
50
+ "react/no-unknown-property": 1,
51
+ "react/prop-types": 0,
52
+ "react/react-in-jsx-scope": 0,
53
+ "react/self-closing-comp": 1,
54
+ "react/sort-comp": 1,
55
+ },
56
+ };
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 xeiyan@gmail.com
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2017 xeiyan@gmail.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/Migration.md CHANGED
@@ -1,41 +1,41 @@
1
- # Migration to the New Architecture
2
-
3
- This file is a tracker for what has been done to work on the migration of this library and to keep also track of the various todo:
4
-
5
- ## TODO
6
-
7
- - [] Write JS spec in Flow for the New Architecture
8
- - [] Implent the new Native Code on iOS
9
- - [] Implent the new Native Code on Android
10
- - [] Test on OldArch app (iOS)
11
- - [] Test on OldArch app (Android)
12
- - [] Test on NewArch app (iOS)
13
- - [] Test on NewArch app (Android)
14
- - [] Open PR
15
-
16
- ## Done
17
-
18
- ### Setup
19
- 1. Forked and cloned the repo
20
- 1. Checked the list of APIs to migrate.
21
- 1. Created an `OldArch` app (0.70) configured for the Old Architecture.
22
- 1. Run the app to make sure that it works properly.
23
- 1. Created a `NewArch` app (0.70) configured for the New Architecture.
24
- 1. Switched the flags for iOS and Android to have the new arch enabled by default
25
- 1. Run the app to make sure that it works properly.
26
- 1. Moved the apps in the `examples` folder
27
-
28
- ### Installing blob-utils
29
- 1. Move to `OldArch`
30
- 1. Run `yarn add ../..` to install the blob utils.
31
- 1. `cd ios`
32
- 1. `bundle install && bundle exec pod install`
33
- 1. `cd ..`
34
- 1. `npx react-native run-ios`
35
- 1. Copy the app JS code from `examples/ReactNativeBlobUtil/App.js` to `examples/OldArch/App.js`
36
- 1. Fixed various JS issues
37
- 1. The app depends on the `Picker`. *Note:* It does not support the New Arch, we need to figure out another way to choose.
38
- 1. run `yarn add @react-native-picker/picker`
39
- 1. run `bundle exec pod install` from the iOS folder
40
- 1. re-run the app
41
- 1. Repeat the above steps for `NewArch`
1
+ # Migration to the New Architecture
2
+
3
+ This file is a tracker for what has been done to work on the migration of this library and to keep also track of the various todo:
4
+
5
+ ## TODO
6
+
7
+ - [] Write JS spec in Flow for the New Architecture
8
+ - [] Implent the new Native Code on iOS
9
+ - [] Implent the new Native Code on Android
10
+ - [] Test on OldArch app (iOS)
11
+ - [] Test on OldArch app (Android)
12
+ - [] Test on NewArch app (iOS)
13
+ - [] Test on NewArch app (Android)
14
+ - [] Open PR
15
+
16
+ ## Done
17
+
18
+ ### Setup
19
+ 1. Forked and cloned the repo
20
+ 1. Checked the list of APIs to migrate.
21
+ 1. Created an `OldArch` app (0.70) configured for the Old Architecture.
22
+ 1. Run the app to make sure that it works properly.
23
+ 1. Created a `NewArch` app (0.70) configured for the New Architecture.
24
+ 1. Switched the flags for iOS and Android to have the new arch enabled by default
25
+ 1. Run the app to make sure that it works properly.
26
+ 1. Moved the apps in the `examples` folder
27
+
28
+ ### Installing blob-utils
29
+ 1. Move to `OldArch`
30
+ 1. Run `yarn add ../..` to install the blob utils.
31
+ 1. `cd ios`
32
+ 1. `bundle install && bundle exec pod install`
33
+ 1. `cd ..`
34
+ 1. `npx react-native run-ios`
35
+ 1. Copy the app JS code from `examples/ReactNativeBlobUtil/App.js` to `examples/OldArch/App.js`
36
+ 1. Fixed various JS issues
37
+ 1. The app depends on the `Picker`. *Note:* It does not support the New Arch, we need to figure out another way to choose.
38
+ 1. run `yarn add @react-native-picker/picker`
39
+ 1. run `bundle exec pod install` from the iOS folder
40
+ 1. re-run the app
41
+ 1. Repeat the above steps for `NewArch`
package/NuGet.config ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <configuration>
3
+ <packageSources>
4
+ <clear />
5
+ <add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" />
6
+ <add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
7
+ </packageSources>
8
+ <disabledPackageSources>
9
+ <clear />
10
+ </disabledPackageSources>
11
+ </configuration>