react-native-blob-util 0.19.1 → 0.19.2

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 (91) hide show
  1. package/.eslintrc.js +56 -56
  2. package/LICENSE +21 -21
  3. package/Migration.md +41 -41
  4. package/README.md +1071 -1071
  5. package/android/gradle.properties +1 -1
  6. package/android/proguard-rules.pro +17 -17
  7. package/android/src/main/AndroidManifest.xml +39 -40
  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/ReactNativeBlobUtilFS.java +2 -2
  11. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFileTransformer.java +9 -9
  12. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilImpl.java +431 -431
  13. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilProgressConfig.java +39 -39
  14. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java +972 -968
  15. package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilDefaultResp.java +98 -98
  16. package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java +157 -157
  17. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileDescription.java +19 -19
  18. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileProvider.java +4 -4
  19. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/MimeType.java +70 -70
  20. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/PathResolver.java +223 -223
  21. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/Tls12SocketFactory.java +68 -68
  22. package/android/src/main/res/values/strings.xml +3 -3
  23. package/android/src/main/res/xml/provider_paths.xml +12 -12
  24. package/android/src/newarch/java/com/ReactNativeBlobUtil/ReactNativeBlobUtil.java +1 -1
  25. package/android.js +58 -58
  26. package/class/ReactNativeBlobUtilCanceledFetchError.js +9 -9
  27. package/class/ReactNativeBlobUtilFile.js +5 -5
  28. package/class/ReactNativeBlobUtilReadStream.js +84 -84
  29. package/class/ReactNativeBlobUtilSession.js +68 -68
  30. package/class/ReactNativeBlobUtilWriteStream.js +50 -50
  31. package/class/StatefulPromise.js +7 -7
  32. package/codegenSpecs/NativeBlobUtils.js +86 -82
  33. package/components/Fetch.onPress.js +10 -10
  34. package/components/Fetch.when.js +15 -15
  35. package/fetch.js +344 -344
  36. package/fs.js +480 -480
  37. package/index.d.ts +871 -871
  38. package/index.js +64 -64
  39. package/index.js.flow +191 -191
  40. package/index.web.js +1 -1
  41. package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.h +55 -55
  42. package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm +993 -993
  43. package/ios/ReactNativeBlobUtil.xcodeproj/project.pbxproj +403 -403
  44. package/ios/ReactNativeBlobUtilConst.h +58 -58
  45. package/ios/ReactNativeBlobUtilConst.mm +47 -47
  46. package/ios/ReactNativeBlobUtilFS.h +108 -108
  47. package/ios/ReactNativeBlobUtilFS.mm +977 -977
  48. package/ios/ReactNativeBlobUtilFileTransformer.h +23 -23
  49. package/ios/ReactNativeBlobUtilFileTransformer.mm +20 -20
  50. package/ios/ReactNativeBlobUtilNetwork.h +49 -49
  51. package/ios/ReactNativeBlobUtilNetwork.mm +159 -159
  52. package/ios/ReactNativeBlobUtilProgress.h +32 -32
  53. package/ios/ReactNativeBlobUtilProgress.mm +57 -57
  54. package/ios/ReactNativeBlobUtilReqBuilder.h +37 -37
  55. package/ios/ReactNativeBlobUtilReqBuilder.mm +292 -292
  56. package/ios/ReactNativeBlobUtilRequest.h +48 -48
  57. package/ios/ReactNativeBlobUtilRequest.mm +535 -535
  58. package/ios.js +61 -61
  59. package/json-stream.js +42 -42
  60. package/lib/oboe-browser.js +2703 -2703
  61. package/mediacollection.js +36 -36
  62. package/package.json +55 -55
  63. package/polyfill/Blob.js +362 -362
  64. package/polyfill/Event.js +11 -11
  65. package/polyfill/EventTarget.js +78 -78
  66. package/polyfill/Fetch.js +219 -219
  67. package/polyfill/File.js +27 -27
  68. package/polyfill/FileReader.js +91 -91
  69. package/polyfill/ProgressEvent.js +32 -32
  70. package/polyfill/XMLHttpRequest.js +466 -466
  71. package/polyfill/XMLHttpRequestEventTarget.js +126 -126
  72. package/polyfill/index.js +11 -11
  73. package/react-native-blob-util.podspec +45 -45
  74. package/types.js +69 -69
  75. package/utils/log.js +40 -40
  76. package/utils/unicode.js +7 -7
  77. package/utils/uri.js +33 -33
  78. package/utils/uuid.js +4 -4
  79. package/windows/README.md +2 -2
  80. package/windows/ReactNativeBlobUtil/PropertySheet.props +15 -15
  81. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.cpp +1701 -1693
  82. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.def +3 -3
  83. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.h +379 -366
  84. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj +181 -181
  85. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj.filters +31 -31
  86. package/windows/ReactNativeBlobUtil/ReactPackageProvider.cpp +15 -15
  87. package/windows/ReactNativeBlobUtil/ReactPackageProvider.h +20 -20
  88. package/windows/ReactNativeBlobUtil/ReactPackageProvider.idl +9 -9
  89. package/windows/ReactNativeBlobUtil/packages.config +3 -3
  90. package/windows/ReactNativeBlobUtil/pch.cpp +1 -1
  91. package/windows/ReactNativeBlobUtil/pch.h +3 -3
@@ -1,57 +1,57 @@
1
- //
2
- // ReactNativeBlobUtilProgress.m
3
- // ReactNativeBlobUtil
4
- //
5
- // Created by Ben Hsieh on 2016/9/25.
6
- // Copyright © 2016年 wkh237.github.io. All rights reserved.
7
- //
8
-
9
- #import "ReactNativeBlobUtilProgress.h"
10
-
11
- @interface ReactNativeBlobUtilProgress ()
12
- {
13
- float progress;
14
- int tick;
15
- double lastTick;
16
- }
17
- @end
18
-
19
- @implementation ReactNativeBlobUtilProgress
20
-
21
- -(id)initWithType:(ProgressType)type interval:(NSNumber *)interval count:(NSNumber *)count
22
- {
23
- self = [super init];
24
- self.count = count;
25
- self.interval = [NSNumber numberWithFloat:[interval floatValue] /1000];
26
- self.type = type;
27
- self.enable = YES;
28
- lastTick = 0;
29
- tick = 1;
30
- return self;
31
- }
32
-
33
- -(BOOL)shouldReport:(NSNumber *)nextProgress
34
- {
35
- BOOL result = YES;
36
- float countF = [self.count floatValue];
37
- if(countF > 0 && [nextProgress floatValue] > 0)
38
- {
39
- result = (int)(floorf([nextProgress floatValue]*countF)) >= tick;
40
- }
41
-
42
- NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
43
- // NSTimeInterval is defined as double
44
- NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp];
45
- float delta = [timeStampObj doubleValue] - lastTick;
46
- BOOL shouldReport = delta > [self.interval doubleValue] && self.enable && result;
47
- if(shouldReport)
48
- {
49
- tick++;
50
- lastTick = [timeStampObj doubleValue];
51
- }
52
- return shouldReport;
53
-
54
- }
55
-
56
-
57
- @end
1
+ //
2
+ // ReactNativeBlobUtilProgress.m
3
+ // ReactNativeBlobUtil
4
+ //
5
+ // Created by Ben Hsieh on 2016/9/25.
6
+ // Copyright © 2016年 wkh237.github.io. All rights reserved.
7
+ //
8
+
9
+ #import "ReactNativeBlobUtilProgress.h"
10
+
11
+ @interface ReactNativeBlobUtilProgress ()
12
+ {
13
+ float progress;
14
+ int tick;
15
+ double lastTick;
16
+ }
17
+ @end
18
+
19
+ @implementation ReactNativeBlobUtilProgress
20
+
21
+ -(id)initWithType:(ProgressType)type interval:(NSNumber *)interval count:(NSNumber *)count
22
+ {
23
+ self = [super init];
24
+ self.count = count;
25
+ self.interval = [NSNumber numberWithFloat:[interval floatValue] /1000];
26
+ self.type = type;
27
+ self.enable = YES;
28
+ lastTick = 0;
29
+ tick = 1;
30
+ return self;
31
+ }
32
+
33
+ -(BOOL)shouldReport:(NSNumber *)nextProgress
34
+ {
35
+ BOOL result = YES;
36
+ float countF = [self.count floatValue];
37
+ if(countF > 0 && [nextProgress floatValue] > 0)
38
+ {
39
+ result = (int)(floorf([nextProgress floatValue]*countF)) >= tick;
40
+ }
41
+
42
+ NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
43
+ // NSTimeInterval is defined as double
44
+ NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp];
45
+ float delta = [timeStampObj doubleValue] - lastTick;
46
+ BOOL shouldReport = delta > [self.interval doubleValue] && self.enable && result;
47
+ if(shouldReport)
48
+ {
49
+ tick++;
50
+ lastTick = [timeStampObj doubleValue];
51
+ }
52
+ return shouldReport;
53
+
54
+ }
55
+
56
+
57
+ @end
@@ -1,37 +1,37 @@
1
- //
2
- // ReactNativeBlobUtilReqBuilder.h
3
- // ReactNativeBlobUtil
4
- //
5
- // Created by Ben Hsieh on 2016/7/9.
6
- // Copyright © 2016年 wkh237. All rights reserved.
7
- //
8
-
9
- #ifndef ReactNativeBlobUtilReqBuilder_h
10
- #define ReactNativeBlobUtilReqBuilder_h
11
-
12
- #import <Foundation/Foundation.h>
13
-
14
- @interface ReactNativeBlobUtilReqBuilder : NSObject;
15
-
16
- +(void) buildMultipartRequest:(NSDictionary *)options
17
- taskId:(NSString *)taskId
18
- method:(NSString *)method
19
- url:(NSString *)url
20
- headers:(NSDictionary *)headers
21
- form:(NSArray *)form
22
- onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete;
23
-
24
- +(void) buildOctetRequest:(NSDictionary *)options
25
- taskId:(NSString *)taskId
26
- method:(NSString *)method
27
- url:(NSString *)url
28
- headers:(NSDictionary *)headers
29
- body:(NSString *)body
30
- onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete;
31
-
32
- +(NSString *) getHeaderIgnoreCases:(NSString *)field fromHeaders:(NSDictionary *) headers;
33
-
34
-
35
- @end
36
-
37
- #endif /* ReactNativeBlobUtilReqBuilder_h */
1
+ //
2
+ // ReactNativeBlobUtilReqBuilder.h
3
+ // ReactNativeBlobUtil
4
+ //
5
+ // Created by Ben Hsieh on 2016/7/9.
6
+ // Copyright © 2016年 wkh237. All rights reserved.
7
+ //
8
+
9
+ #ifndef ReactNativeBlobUtilReqBuilder_h
10
+ #define ReactNativeBlobUtilReqBuilder_h
11
+
12
+ #import <Foundation/Foundation.h>
13
+
14
+ @interface ReactNativeBlobUtilReqBuilder : NSObject;
15
+
16
+ +(void) buildMultipartRequest:(NSDictionary *)options
17
+ taskId:(NSString *)taskId
18
+ method:(NSString *)method
19
+ url:(NSString *)url
20
+ headers:(NSDictionary *)headers
21
+ form:(NSArray *)form
22
+ onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete;
23
+
24
+ +(void) buildOctetRequest:(NSDictionary *)options
25
+ taskId:(NSString *)taskId
26
+ method:(NSString *)method
27
+ url:(NSString *)url
28
+ headers:(NSDictionary *)headers
29
+ body:(NSString *)body
30
+ onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete;
31
+
32
+ +(NSString *) getHeaderIgnoreCases:(NSString *)field fromHeaders:(NSDictionary *) headers;
33
+
34
+
35
+ @end
36
+
37
+ #endif /* ReactNativeBlobUtilReqBuilder_h */