react-native-blob-util 0.22.0 → 0.22.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.
- package/.eslintrc.js +56 -56
- package/LICENSE +21 -21
- package/Migration.md +41 -41
- package/NuGet.config +11 -11
- package/README.md +1109 -1104
- package/android/gradle.properties +1 -1
- package/android/src/main/AndroidManifest.xml +37 -37
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConfig.java +57 -57
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConst.java +20 -20
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFileTransformer.java +9 -9
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilImpl.java +431 -431
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilProgressConfig.java +39 -39
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java +1014 -1014
- package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilDefaultResp.java +98 -98
- package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java +166 -166
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileDescription.java +19 -19
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileProvider.java +4 -4
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/MimeType.java +70 -70
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/PathResolver.java +223 -223
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/Tls12SocketFactory.java +68 -68
- package/android/src/main/res/values/strings.xml +3 -3
- package/android/src/main/res/xml/provider_paths.xml +12 -12
- package/android.js +58 -58
- package/class/ReactNativeBlobUtilCanceledFetchError.js +9 -9
- package/class/ReactNativeBlobUtilFile.js +5 -5
- package/class/ReactNativeBlobUtilReadStream.js +84 -84
- package/class/ReactNativeBlobUtilSession.js +68 -68
- package/class/ReactNativeBlobUtilWriteStream.js +50 -50
- package/class/StatefulPromise.js +7 -7
- package/codegenSpecs/NativeBlobUtils.js +86 -86
- package/components/Fetch.onPress.js +10 -10
- package/components/Fetch.when.js +15 -15
- package/fetch.js +350 -350
- package/fs.js +480 -480
- package/index.js +64 -64
- package/index.js.flow +192 -192
- package/index.web.js +1 -1
- package/ios/PrivacyInfo.xcprivacy +28 -28
- package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.h +55 -55
- package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm +992 -992
- package/ios/ReactNativeBlobUtil.xcodeproj/project.pbxproj +405 -405
- package/ios/ReactNativeBlobUtilConst.h +58 -58
- package/ios/ReactNativeBlobUtilConst.mm +47 -47
- package/ios/ReactNativeBlobUtilFS.h +108 -108
- package/ios/ReactNativeBlobUtilFS.mm +1064 -1064
- package/ios/ReactNativeBlobUtilFileTransformer.h +23 -23
- package/ios/ReactNativeBlobUtilFileTransformer.mm +20 -20
- package/ios/ReactNativeBlobUtilNetwork.h +49 -49
- package/ios/ReactNativeBlobUtilNetwork.mm +159 -159
- package/ios/ReactNativeBlobUtilProgress.h +32 -32
- package/ios/ReactNativeBlobUtilProgress.mm +57 -57
- package/ios/ReactNativeBlobUtilReqBuilder.h +37 -37
- package/ios/ReactNativeBlobUtilReqBuilder.mm +292 -292
- package/ios/ReactNativeBlobUtilRequest.h +48 -48
- package/ios/ReactNativeBlobUtilRequest.mm +584 -584
- package/ios.js +61 -61
- package/json-stream.js +42 -42
- package/lib/oboe-browser.js +2703 -2703
- package/mediacollection.js +36 -36
- package/package.json +68 -68
- package/polyfill/Blob.js +362 -362
- package/polyfill/Event.js +11 -11
- package/polyfill/EventTarget.js +78 -78
- package/polyfill/Fetch.js +219 -219
- package/polyfill/File.js +27 -27
- package/polyfill/FileReader.js +91 -91
- package/polyfill/ProgressEvent.js +32 -32
- package/polyfill/XMLHttpRequest.js +466 -466
- package/polyfill/XMLHttpRequestEventTarget.js +126 -126
- package/polyfill/index.js +11 -11
- package/react-native-blob-util.podspec +48 -48
- package/types.js +69 -69
- package/utils/log.js +40 -40
- package/utils/unicode.js +7 -7
- package/utils/uri.js +33 -33
- package/utils/uuid.js +4 -4
- package/windows/ExperimentalFeatures.props +33 -33
- package/windows/README.md +2 -2
- package/windows/ReactNativeBlobUtil/PropertySheet.props +15 -15
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.cpp +1836 -1836
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.def +3 -3
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.h +372 -372
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj +139 -139
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj.filters +43 -43
- package/windows/ReactNativeBlobUtil/ReactPackageProvider.cpp +20 -20
- package/windows/ReactNativeBlobUtil/ReactPackageProvider.h +24 -24
- package/windows/ReactNativeBlobUtil/ReactPackageProvider.idl +9 -9
- package/windows/ReactNativeBlobUtil/codegen/.clang-format +1 -1
- package/windows/ReactNativeBlobUtil/codegen/NativeBlobUtilsDataTypes.g.h +42 -42
- package/windows/ReactNativeBlobUtil/codegen/NativeBlobUtilsSpec.g.h +353 -353
- package/windows/ReactNativeBlobUtil/packages.config +3 -3
- package/windows/ReactNativeBlobUtil/packages.lock.json +59 -59
- package/windows/ReactNativeBlobUtil/pch.cpp +1 -1
- package/windows/ReactNativeBlobUtil/pch.h +30 -30
- package/windows/ReactNativeBlobUtil/resource.h +5 -5
- package/windows/ReactNativeBlobUtil/targetver.h +8 -8
- package/windows/ReactNativeBlobUtil.sln +43 -43
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
// Copyright 2016 wkh237@github. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a MIT-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import EventTarget from './EventTarget.js';
|
|
6
|
-
import Log from '../utils/log.js';
|
|
7
|
-
|
|
8
|
-
const log = new Log('XMLHttpRequestEventTarget');
|
|
9
|
-
|
|
10
|
-
log.disable();
|
|
11
|
-
// log.level(3)
|
|
12
|
-
|
|
13
|
-
export default class XMLHttpRequestEventTarget extends EventTarget {
|
|
14
|
-
|
|
15
|
-
_onabort: (e: Event) => void = () => {
|
|
16
|
-
};
|
|
17
|
-
_onerror: (e: Event) => void = () => {
|
|
18
|
-
};
|
|
19
|
-
_onload: (e: Event) => void = () => {
|
|
20
|
-
};
|
|
21
|
-
_onloadstart: (e: Event) => void = () => {
|
|
22
|
-
};
|
|
23
|
-
_onprogress: (e: Event) => void = () => {
|
|
24
|
-
};
|
|
25
|
-
_ontimeout: (e: Event) => void = () => {
|
|
26
|
-
};
|
|
27
|
-
_onloadend: (e: Event) => void = () => {
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
constructor() {
|
|
31
|
-
super();
|
|
32
|
-
log.info('constructor called');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
dispatchEvent(event: string, e: Event) {
|
|
36
|
-
log.debug('dispatch event', event, e);
|
|
37
|
-
super.dispatchEvent(event, e);
|
|
38
|
-
switch (event) {
|
|
39
|
-
case 'abort' :
|
|
40
|
-
this._onabort(e);
|
|
41
|
-
break;
|
|
42
|
-
case 'error' :
|
|
43
|
-
this._onerror(e);
|
|
44
|
-
break;
|
|
45
|
-
case 'load' :
|
|
46
|
-
this._onload(e);
|
|
47
|
-
break;
|
|
48
|
-
case 'loadstart' :
|
|
49
|
-
this._onloadstart(e);
|
|
50
|
-
break;
|
|
51
|
-
case 'loadend' :
|
|
52
|
-
this._onloadend(e);
|
|
53
|
-
break;
|
|
54
|
-
case 'progress' :
|
|
55
|
-
this._onprogress(e);
|
|
56
|
-
break;
|
|
57
|
-
case 'timeout' :
|
|
58
|
-
this._ontimeout(e);
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
set onabort(fn: (e: Event) => void) {
|
|
64
|
-
log.info('set onabort');
|
|
65
|
-
this._onabort = fn;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
get onabort() {
|
|
69
|
-
return this._onabort;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
set onerror(fn: (e: Event) => void) {
|
|
73
|
-
log.info('set onerror');
|
|
74
|
-
this._onerror = fn;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
get onerror() {
|
|
78
|
-
return this._onerror;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
set onload(fn: (e: Event) => void) {
|
|
82
|
-
log.info('set onload', fn);
|
|
83
|
-
this._onload = fn;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
get onload() {
|
|
87
|
-
return this._onload;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
set onloadstart(fn: (e: Event) => void) {
|
|
91
|
-
log.info('set onloadstart');
|
|
92
|
-
this._onloadstart = fn;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
get onloadstart() {
|
|
96
|
-
return this._onloadstart;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
set onprogress(fn: (e: Event) => void) {
|
|
100
|
-
log.info('set onprogress');
|
|
101
|
-
this._onprogress = fn;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
get onprogress() {
|
|
105
|
-
return this._onprogress;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
set ontimeout(fn: (e: Event) => void) {
|
|
109
|
-
log.info('set ontimeout');
|
|
110
|
-
this._ontimeout = fn;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
get ontimeout() {
|
|
114
|
-
return this._ontimeout;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
set onloadend(fn: (e: Event) => void) {
|
|
118
|
-
log.info('set onloadend');
|
|
119
|
-
this._onloadend = fn;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
get onloadend() {
|
|
123
|
-
return this._onloadend;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
}
|
|
1
|
+
// Copyright 2016 wkh237@github. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a MIT-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import EventTarget from './EventTarget.js';
|
|
6
|
+
import Log from '../utils/log.js';
|
|
7
|
+
|
|
8
|
+
const log = new Log('XMLHttpRequestEventTarget');
|
|
9
|
+
|
|
10
|
+
log.disable();
|
|
11
|
+
// log.level(3)
|
|
12
|
+
|
|
13
|
+
export default class XMLHttpRequestEventTarget extends EventTarget {
|
|
14
|
+
|
|
15
|
+
_onabort: (e: Event) => void = () => {
|
|
16
|
+
};
|
|
17
|
+
_onerror: (e: Event) => void = () => {
|
|
18
|
+
};
|
|
19
|
+
_onload: (e: Event) => void = () => {
|
|
20
|
+
};
|
|
21
|
+
_onloadstart: (e: Event) => void = () => {
|
|
22
|
+
};
|
|
23
|
+
_onprogress: (e: Event) => void = () => {
|
|
24
|
+
};
|
|
25
|
+
_ontimeout: (e: Event) => void = () => {
|
|
26
|
+
};
|
|
27
|
+
_onloadend: (e: Event) => void = () => {
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
log.info('constructor called');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dispatchEvent(event: string, e: Event) {
|
|
36
|
+
log.debug('dispatch event', event, e);
|
|
37
|
+
super.dispatchEvent(event, e);
|
|
38
|
+
switch (event) {
|
|
39
|
+
case 'abort' :
|
|
40
|
+
this._onabort(e);
|
|
41
|
+
break;
|
|
42
|
+
case 'error' :
|
|
43
|
+
this._onerror(e);
|
|
44
|
+
break;
|
|
45
|
+
case 'load' :
|
|
46
|
+
this._onload(e);
|
|
47
|
+
break;
|
|
48
|
+
case 'loadstart' :
|
|
49
|
+
this._onloadstart(e);
|
|
50
|
+
break;
|
|
51
|
+
case 'loadend' :
|
|
52
|
+
this._onloadend(e);
|
|
53
|
+
break;
|
|
54
|
+
case 'progress' :
|
|
55
|
+
this._onprogress(e);
|
|
56
|
+
break;
|
|
57
|
+
case 'timeout' :
|
|
58
|
+
this._ontimeout(e);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
set onabort(fn: (e: Event) => void) {
|
|
64
|
+
log.info('set onabort');
|
|
65
|
+
this._onabort = fn;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get onabort() {
|
|
69
|
+
return this._onabort;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
set onerror(fn: (e: Event) => void) {
|
|
73
|
+
log.info('set onerror');
|
|
74
|
+
this._onerror = fn;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get onerror() {
|
|
78
|
+
return this._onerror;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
set onload(fn: (e: Event) => void) {
|
|
82
|
+
log.info('set onload', fn);
|
|
83
|
+
this._onload = fn;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
get onload() {
|
|
87
|
+
return this._onload;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set onloadstart(fn: (e: Event) => void) {
|
|
91
|
+
log.info('set onloadstart');
|
|
92
|
+
this._onloadstart = fn;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get onloadstart() {
|
|
96
|
+
return this._onloadstart;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
set onprogress(fn: (e: Event) => void) {
|
|
100
|
+
log.info('set onprogress');
|
|
101
|
+
this._onprogress = fn;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
get onprogress() {
|
|
105
|
+
return this._onprogress;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
set ontimeout(fn: (e: Event) => void) {
|
|
109
|
+
log.info('set ontimeout');
|
|
110
|
+
this._ontimeout = fn;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get ontimeout() {
|
|
114
|
+
return this._ontimeout;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
set onloadend(fn: (e: Event) => void) {
|
|
118
|
+
log.info('set onloadend');
|
|
119
|
+
this._onloadend = fn;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
get onloadend() {
|
|
123
|
+
return this._onloadend;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
package/polyfill/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Blob from './Blob.js';
|
|
2
|
-
import File from './File.js';
|
|
3
|
-
import XMLHttpRequest from './XMLHttpRequest.js';
|
|
4
|
-
import ProgressEvent from './ProgressEvent';
|
|
5
|
-
import Event from './Event';
|
|
6
|
-
import FileReader from './FileReader';
|
|
7
|
-
import Fetch from './Fetch';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
Blob, File, XMLHttpRequest, ProgressEvent, Event, FileReader, Fetch
|
|
11
|
-
};
|
|
1
|
+
import Blob from './Blob.js';
|
|
2
|
+
import File from './File.js';
|
|
3
|
+
import XMLHttpRequest from './XMLHttpRequest.js';
|
|
4
|
+
import ProgressEvent from './ProgressEvent';
|
|
5
|
+
import Event from './Event';
|
|
6
|
+
import FileReader from './FileReader';
|
|
7
|
+
import Fetch from './Fetch';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
Blob, File, XMLHttpRequest, ProgressEvent, Event, FileReader, Fetch
|
|
11
|
+
};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
4
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
5
|
-
|
|
6
|
-
Pod::Spec.new do |s|
|
|
7
|
-
s.name = package['name']
|
|
8
|
-
s.version = package['version']
|
|
9
|
-
s.summary = package['description']
|
|
10
|
-
s.requires_arc = true
|
|
11
|
-
s.license = 'MIT'
|
|
12
|
-
s.homepage = 'n/a'
|
|
13
|
-
s.source = { :git => "https://github.com/RonRadtke/react-native-blob-util", :tag => "v#{s.version.to_s}" }
|
|
14
|
-
s.author = 'RonRadtke'
|
|
15
|
-
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
16
|
-
s.resource_bundles = {
|
|
17
|
-
'ReactNativeBlobUtilPrivacyInfo' => ['ios/PrivacyInfo.xcprivacy'],
|
|
18
|
-
}
|
|
19
|
-
s.platforms = { :ios => "11.0" }
|
|
20
|
-
s.framework = 'AssetsLibrary'
|
|
21
|
-
|
|
22
|
-
if fabric_enabled
|
|
23
|
-
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
24
|
-
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
25
|
-
if respond_to?(:install_modules_dependencies, true)
|
|
26
|
-
install_modules_dependencies(s)
|
|
27
|
-
else
|
|
28
|
-
# just for backward compatibility: if React Native version <= 0.70.x
|
|
29
|
-
s.compiler_flags = "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRCT_NEW_ARCH_ENABLED=1"
|
|
30
|
-
s.pod_target_xcconfig = {
|
|
31
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
32
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
33
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
s.dependency 'React-Core'
|
|
37
|
-
s.dependency "React-Codegen"
|
|
38
|
-
s.dependency "React-RCTFabric"
|
|
39
|
-
s.dependency "RCT-Folly"
|
|
40
|
-
s.dependency "RCTRequired"
|
|
41
|
-
s.dependency "RCTTypeSafety"
|
|
42
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
43
|
-
end
|
|
44
|
-
else
|
|
45
|
-
s.dependency 'React-Core'
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
end
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
4
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = package['name']
|
|
8
|
+
s.version = package['version']
|
|
9
|
+
s.summary = package['description']
|
|
10
|
+
s.requires_arc = true
|
|
11
|
+
s.license = 'MIT'
|
|
12
|
+
s.homepage = 'n/a'
|
|
13
|
+
s.source = { :git => "https://github.com/RonRadtke/react-native-blob-util", :tag => "v#{s.version.to_s}" }
|
|
14
|
+
s.author = 'RonRadtke'
|
|
15
|
+
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
16
|
+
s.resource_bundles = {
|
|
17
|
+
'ReactNativeBlobUtilPrivacyInfo' => ['ios/PrivacyInfo.xcprivacy'],
|
|
18
|
+
}
|
|
19
|
+
s.platforms = { :ios => "11.0" }
|
|
20
|
+
s.framework = 'AssetsLibrary'
|
|
21
|
+
|
|
22
|
+
if fabric_enabled
|
|
23
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
24
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
25
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
26
|
+
install_modules_dependencies(s)
|
|
27
|
+
else
|
|
28
|
+
# just for backward compatibility: if React Native version <= 0.70.x
|
|
29
|
+
s.compiler_flags = "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRCT_NEW_ARCH_ENABLED=1"
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
32
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
33
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
s.dependency 'React-Core'
|
|
37
|
+
s.dependency "React-Codegen"
|
|
38
|
+
s.dependency "React-RCTFabric"
|
|
39
|
+
s.dependency "RCT-Folly"
|
|
40
|
+
s.dependency "RCTRequired"
|
|
41
|
+
s.dependency "RCTTypeSafety"
|
|
42
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
43
|
+
end
|
|
44
|
+
else
|
|
45
|
+
s.dependency 'React-Core'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
package/types.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
export type ReactNativeBlobUtilConfig = {
|
|
3
|
-
Progress: any,
|
|
4
|
-
UploadProgress: any,
|
|
5
|
-
fileCache : boolean,
|
|
6
|
-
transformFile: boolean;
|
|
7
|
-
path : string,
|
|
8
|
-
appendExt : string,
|
|
9
|
-
session : string,
|
|
10
|
-
addAndroidDownloads : any,
|
|
11
|
-
indicator : boolean,
|
|
12
|
-
followRedirect : boolean,
|
|
13
|
-
trusty : boolean,
|
|
14
|
-
wifiOnly : boolean
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type ReactNativeBlobUtilNative = {
|
|
18
|
-
// API for fetch octet-stream data
|
|
19
|
-
fetchBlob : (
|
|
20
|
-
options:fetchConfig,
|
|
21
|
-
taskId:string,
|
|
22
|
-
method:string,
|
|
23
|
-
url:string,
|
|
24
|
-
headers:any,
|
|
25
|
-
body:any,
|
|
26
|
-
callback:(err:any, ...data:any) => void
|
|
27
|
-
) => void,
|
|
28
|
-
// API for fetch form data
|
|
29
|
-
fetchBlobForm : (
|
|
30
|
-
options:fetchConfig,
|
|
31
|
-
taskId:string,
|
|
32
|
-
method:string,
|
|
33
|
-
url:string,
|
|
34
|
-
headers:any,
|
|
35
|
-
form:Array<any>,
|
|
36
|
-
callback:(err:any, ...data:any) => void
|
|
37
|
-
) => void,
|
|
38
|
-
// open file stream
|
|
39
|
-
readStream : (
|
|
40
|
-
path:string,
|
|
41
|
-
encode:'utf8' | 'ascii' | 'base64'
|
|
42
|
-
) => void,
|
|
43
|
-
// get system folders
|
|
44
|
-
getEnvironmentDirs : (dirs:any) => void,
|
|
45
|
-
// unlink file by path
|
|
46
|
-
unlink : (path:string, callback: (err:any) => void) => void,
|
|
47
|
-
removeSession : (paths:Array<string>, callback: (err:any) => void) => void,
|
|
48
|
-
ls : (path:string, callback: (err:any) => void) => void,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type ReactNativeBlobUtilResponseInfo = {
|
|
52
|
-
taskId : string,
|
|
53
|
-
state : number,
|
|
54
|
-
headers : any,
|
|
55
|
-
status : number,
|
|
56
|
-
respType : 'text' | 'blob' | '' | 'json',
|
|
57
|
-
rnfbEncode : 'path' | 'base64' | 'ascii' | 'utf8'
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type ReactNativeBlobUtilStream = {
|
|
61
|
-
onData : () => void,
|
|
62
|
-
onError : () => void,
|
|
63
|
-
onEnd : () => void,
|
|
64
|
-
_onData : () => void,
|
|
65
|
-
_onEnd : () => void,
|
|
66
|
-
_onError : () => void,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
|
|
2
|
+
export type ReactNativeBlobUtilConfig = {
|
|
3
|
+
Progress: any,
|
|
4
|
+
UploadProgress: any,
|
|
5
|
+
fileCache : boolean,
|
|
6
|
+
transformFile: boolean;
|
|
7
|
+
path : string,
|
|
8
|
+
appendExt : string,
|
|
9
|
+
session : string,
|
|
10
|
+
addAndroidDownloads : any,
|
|
11
|
+
indicator : boolean,
|
|
12
|
+
followRedirect : boolean,
|
|
13
|
+
trusty : boolean,
|
|
14
|
+
wifiOnly : boolean
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ReactNativeBlobUtilNative = {
|
|
18
|
+
// API for fetch octet-stream data
|
|
19
|
+
fetchBlob : (
|
|
20
|
+
options:fetchConfig,
|
|
21
|
+
taskId:string,
|
|
22
|
+
method:string,
|
|
23
|
+
url:string,
|
|
24
|
+
headers:any,
|
|
25
|
+
body:any,
|
|
26
|
+
callback:(err:any, ...data:any) => void
|
|
27
|
+
) => void,
|
|
28
|
+
// API for fetch form data
|
|
29
|
+
fetchBlobForm : (
|
|
30
|
+
options:fetchConfig,
|
|
31
|
+
taskId:string,
|
|
32
|
+
method:string,
|
|
33
|
+
url:string,
|
|
34
|
+
headers:any,
|
|
35
|
+
form:Array<any>,
|
|
36
|
+
callback:(err:any, ...data:any) => void
|
|
37
|
+
) => void,
|
|
38
|
+
// open file stream
|
|
39
|
+
readStream : (
|
|
40
|
+
path:string,
|
|
41
|
+
encode:'utf8' | 'ascii' | 'base64'
|
|
42
|
+
) => void,
|
|
43
|
+
// get system folders
|
|
44
|
+
getEnvironmentDirs : (dirs:any) => void,
|
|
45
|
+
// unlink file by path
|
|
46
|
+
unlink : (path:string, callback: (err:any) => void) => void,
|
|
47
|
+
removeSession : (paths:Array<string>, callback: (err:any) => void) => void,
|
|
48
|
+
ls : (path:string, callback: (err:any) => void) => void,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type ReactNativeBlobUtilResponseInfo = {
|
|
52
|
+
taskId : string,
|
|
53
|
+
state : number,
|
|
54
|
+
headers : any,
|
|
55
|
+
status : number,
|
|
56
|
+
respType : 'text' | 'blob' | '' | 'json',
|
|
57
|
+
rnfbEncode : 'path' | 'base64' | 'ascii' | 'utf8'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type ReactNativeBlobUtilStream = {
|
|
61
|
+
onData : () => void,
|
|
62
|
+
onError : () => void,
|
|
63
|
+
onEnd : () => void,
|
|
64
|
+
_onData : () => void,
|
|
65
|
+
_onEnd : () => void,
|
|
66
|
+
_onError : () => void,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
70
|
export type filedescriptor = { path: string, parentFolder: string, mimeType: string }
|
package/utils/log.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
export default class Log {
|
|
2
|
-
|
|
3
|
-
_name:string;
|
|
4
|
-
_isEnable:boolean = true
|
|
5
|
-
_level:number = 0
|
|
6
|
-
|
|
7
|
-
constructor(name:string) {
|
|
8
|
-
this._name = name;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
level(val:number) {
|
|
12
|
-
this._isEnable = true;
|
|
13
|
-
this._level = val;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
enable() {
|
|
17
|
-
this._isEnable = true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
disable() {
|
|
21
|
-
this._isEnable = false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
verbose(...args) {
|
|
25
|
-
this._isEnable && this._level > 2 && console.log(this._name, 'verbose:', ...args);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
debug(...args) {
|
|
29
|
-
this._isEnable && this._level > 1 && console.log(this._name, 'debug:', ...args);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
info(...args) {
|
|
33
|
-
this._isEnable && this._level > 0 && console.log(this._name, 'info:', ...args);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
error(...args) {
|
|
37
|
-
this._isEnable && this._level > -1 && console.warn(this._name, 'error:', ...args);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}
|
|
1
|
+
export default class Log {
|
|
2
|
+
|
|
3
|
+
_name:string;
|
|
4
|
+
_isEnable:boolean = true
|
|
5
|
+
_level:number = 0
|
|
6
|
+
|
|
7
|
+
constructor(name:string) {
|
|
8
|
+
this._name = name;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
level(val:number) {
|
|
12
|
+
this._isEnable = true;
|
|
13
|
+
this._level = val;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
enable() {
|
|
17
|
+
this._isEnable = true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
disable() {
|
|
21
|
+
this._isEnable = false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
verbose(...args) {
|
|
25
|
+
this._isEnable && this._level > 2 && console.log(this._name, 'verbose:', ...args);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
debug(...args) {
|
|
29
|
+
this._isEnable && this._level > 1 && console.log(this._name, 'debug:', ...args);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
info(...args) {
|
|
33
|
+
this._isEnable && this._level > 0 && console.log(this._name, 'info:', ...args);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
error(...args) {
|
|
37
|
+
this._isEnable && this._level > -1 && console.warn(this._name, 'error:', ...args);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
package/utils/unicode.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default function(x) {
|
|
2
|
-
var r = /\\u([\d\w]{4})/gi;
|
|
3
|
-
x = x.replace(r, function (match, grp) {
|
|
4
|
-
return String.fromCharCode(parseInt(grp, 16));
|
|
5
|
-
});
|
|
6
|
-
return unescape(x);
|
|
7
|
-
}
|
|
1
|
+
export default function(x) {
|
|
2
|
+
var r = /\\u([\d\w]{4})/gi;
|
|
3
|
+
x = x.replace(r, function (match, grp) {
|
|
4
|
+
return String.fromCharCode(parseInt(grp, 16));
|
|
5
|
+
});
|
|
6
|
+
return unescape(x);
|
|
7
|
+
}
|
package/utils/uri.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
|
|
3
|
-
isFileURI: (uri: string): boolean => {
|
|
4
|
-
if (typeof uri !== 'string')
|
|
5
|
-
return false;
|
|
6
|
-
return /^ReactNativeBlobUtil-file\:\/\//.test(uri);
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
isJSONStreamURI: (uri: string): boolean => {
|
|
10
|
-
if (typeof uri !== 'string')
|
|
11
|
-
return false;
|
|
12
|
-
return /^JSONStream\:\/\//.test(uri);
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
removeURIScheme: (uri: string, iterations: number): string => {
|
|
16
|
-
iterations = iterations || 1;
|
|
17
|
-
let result = uri;
|
|
18
|
-
for (let i = 0; i < iterations; i++) {
|
|
19
|
-
result = String(result).replace(/^[^\:]+\:\/\//, '');
|
|
20
|
-
}
|
|
21
|
-
return String(result);
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
unwrapFileURI: (uri: string): string => {
|
|
25
|
-
return String(uri).replace(/^ReactNativeBlobUtil-file\:\/\//, '');
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
wrap: (path: string): string => {
|
|
29
|
-
const prefix = path.startsWith('content://') ? 'ReactNativeBlobUtil-content://' : 'ReactNativeBlobUtil-file://';
|
|
30
|
-
return prefix + path;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
|
|
3
|
+
isFileURI: (uri: string): boolean => {
|
|
4
|
+
if (typeof uri !== 'string')
|
|
5
|
+
return false;
|
|
6
|
+
return /^ReactNativeBlobUtil-file\:\/\//.test(uri);
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
isJSONStreamURI: (uri: string): boolean => {
|
|
10
|
+
if (typeof uri !== 'string')
|
|
11
|
+
return false;
|
|
12
|
+
return /^JSONStream\:\/\//.test(uri);
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
removeURIScheme: (uri: string, iterations: number): string => {
|
|
16
|
+
iterations = iterations || 1;
|
|
17
|
+
let result = uri;
|
|
18
|
+
for (let i = 0; i < iterations; i++) {
|
|
19
|
+
result = String(result).replace(/^[^\:]+\:\/\//, '');
|
|
20
|
+
}
|
|
21
|
+
return String(result);
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
unwrapFileURI: (uri: string): string => {
|
|
25
|
+
return String(uri).replace(/^ReactNativeBlobUtil-file\:\/\//, '');
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
wrap: (path: string): string => {
|
|
29
|
+
const prefix = path.startsWith('content://') ? 'ReactNativeBlobUtil-content://' : 'ReactNativeBlobUtil-file://';
|
|
30
|
+
return prefix + path;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
};
|