@react-native-firebase/storage 25.1.0 → 26.0.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.
- package/CHANGELOG.md +21 -0
- package/RNFBStorage.podspec +17 -6
- package/android/build.gradle +23 -0
- package/android/src/main/java/io/invertase/firebase/storage/{ReactNativeFirebaseStorageModule.java → NativeRNFBTurboStorage.java} +72 -131
- package/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStoragePackage.java +1 -1
- package/android/src/main/java/io/invertase/firebase/storage/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboStorageSpec.java +125 -0
- package/android/src/main/java/io/invertase/firebase/storage/generated/jni/CMakeLists.txt +36 -0
- package/android/src/main/java/io/invertase/firebase/storage/generated/jni/RNFBStorageTurboModules-generated.cpp +116 -0
- package/android/src/main/java/io/invertase/firebase/storage/generated/jni/RNFBStorageTurboModules.h +31 -0
- package/android/src/main/java/io/invertase/firebase/storage/generated/jni/react/renderer/components/RNFBStorageTurboModules/RNFBStorageTurboModulesJSI-generated.cpp +153 -0
- package/android/src/main/java/io/invertase/firebase/storage/generated/jni/react/renderer/components/RNFBStorageTurboModules/RNFBStorageTurboModulesJSI.h +246 -0
- package/dist/module/StorageReference.js +4 -7
- package/dist/module/StorageReference.js.map +1 -1
- package/dist/module/StorageTask.js.map +1 -1
- package/dist/module/index.js +384 -6
- package/dist/module/index.js.map +1 -1
- package/dist/module/types/storage.js +6 -2
- package/dist/module/types/storage.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/web/RNFBStorageModule.js +9 -11
- package/dist/module/web/RNFBStorageModule.js.map +1 -1
- package/dist/typescript/lib/StorageReference.d.ts.map +1 -1
- package/dist/typescript/lib/StorageTask.d.ts +7 -8
- package/dist/typescript/lib/StorageTask.d.ts.map +1 -1
- package/dist/typescript/lib/index.d.ts +150 -4
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +5 -5
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/types/storage.d.ts +15 -10
- package/dist/typescript/lib/types/storage.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/dist/typescript/lib/web/RNFBStorageModule.d.ts +3 -3
- package/dist/typescript/lib/web/RNFBStorageModule.d.ts.map +1 -1
- package/ios/RNFBStorage/RNFBStorageModule.h +2 -2
- package/ios/RNFBStorage/{RNFBStorageModule.m → RNFBStorageModule.mm} +193 -130
- package/ios/RNFBStorage.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBStorageTurboModules/RNFBStorageTurboModules-generated.mm +142 -0
- package/ios/generated/RNFBStorageTurboModules/RNFBStorageTurboModules.h +198 -0
- package/ios/generated/RNFBStorageTurboModulesJSI-generated.cpp +153 -0
- package/ios/generated/RNFBStorageTurboModulesJSI.h +246 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/StorageReference.ts +3 -8
- package/lib/StorageTask.ts +13 -15
- package/lib/index.ts +501 -7
- package/lib/types/internal.ts +5 -5
- package/lib/types/storage.ts +17 -10
- package/lib/version.ts +1 -1
- package/lib/web/RNFBStorageModule.ts +10 -12
- package/package.json +22 -4
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboStorage.ts +46 -0
- package/typedoc.json +2 -3
- package/dist/module/modular.js +0 -270
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -192
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -64
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -154
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -12
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/dist/typescript/lib/types/namespaced.d.ts +0 -1122
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/lib/modular.ts +0 -401
- package/lib/namespaced.ts +0 -264
- package/lib/types/namespaced.ts +0 -1248
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
#pragma mark - NativeRNFBTurboStorageStorageListOptions
|
|
20
|
+
|
|
21
|
+
template <typename P0, typename P1>
|
|
22
|
+
struct NativeRNFBTurboStorageStorageListOptions {
|
|
23
|
+
P0 maxResults;
|
|
24
|
+
P1 pageToken;
|
|
25
|
+
bool operator==(const NativeRNFBTurboStorageStorageListOptions &other) const {
|
|
26
|
+
return maxResults == other.maxResults && pageToken == other.pageToken;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
template <typename T>
|
|
31
|
+
struct NativeRNFBTurboStorageStorageListOptionsBridging {
|
|
32
|
+
static T types;
|
|
33
|
+
|
|
34
|
+
static T fromJs(
|
|
35
|
+
jsi::Runtime &rt,
|
|
36
|
+
const jsi::Object &value,
|
|
37
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
38
|
+
T result{
|
|
39
|
+
bridging::fromJs<decltype(types.maxResults)>(rt, value.getProperty(rt, "maxResults"), jsInvoker),
|
|
40
|
+
bridging::fromJs<decltype(types.pageToken)>(rt, value.getProperty(rt, "pageToken"), jsInvoker)};
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#ifdef DEBUG
|
|
45
|
+
static double maxResultsToJs(jsi::Runtime &rt, decltype(types.maxResults) value) {
|
|
46
|
+
return bridging::toJs(rt, value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static std::optional<jsi::String> pageTokenToJs(jsi::Runtime &rt, decltype(types.pageToken) value) {
|
|
50
|
+
return bridging::toJs(rt, value);
|
|
51
|
+
}
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
static jsi::Object toJs(
|
|
55
|
+
jsi::Runtime &rt,
|
|
56
|
+
const T &value,
|
|
57
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
58
|
+
auto result = facebook::jsi::Object(rt);
|
|
59
|
+
result.setProperty(rt, "maxResults", bridging::toJs(rt, value.maxResults, jsInvoker));
|
|
60
|
+
if (value.pageToken) {
|
|
61
|
+
result.setProperty(rt, "pageToken", bridging::toJs(rt, value.pageToken.value(), jsInvoker));
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
class JSI_EXPORT NativeRNFBTurboStorageCxxSpecJSI : public TurboModule {
|
|
68
|
+
protected:
|
|
69
|
+
NativeRNFBTurboStorageCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
70
|
+
|
|
71
|
+
public:
|
|
72
|
+
virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
|
|
73
|
+
virtual jsi::Value deleteObject(jsi::Runtime &rt, jsi::String appName, jsi::String url) = 0;
|
|
74
|
+
virtual jsi::Value getDownloadURL(jsi::Runtime &rt, jsi::String appName, jsi::String url) = 0;
|
|
75
|
+
virtual jsi::Value getMetadata(jsi::Runtime &rt, jsi::String appName, jsi::String url) = 0;
|
|
76
|
+
virtual jsi::Value updateMetadata(jsi::Runtime &rt, jsi::String appName, jsi::String url, std::optional<jsi::Object> metadata) = 0;
|
|
77
|
+
virtual jsi::Value list(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::Object listOptions) = 0;
|
|
78
|
+
virtual jsi::Value listAll(jsi::Runtime &rt, jsi::String appName, jsi::String url) = 0;
|
|
79
|
+
virtual jsi::Value setMaxDownloadRetryTime(jsi::Runtime &rt, jsi::String appName, double milliseconds) = 0;
|
|
80
|
+
virtual jsi::Value setMaxOperationRetryTime(jsi::Runtime &rt, jsi::String appName, double milliseconds) = 0;
|
|
81
|
+
virtual jsi::Value setMaxUploadRetryTime(jsi::Runtime &rt, jsi::String appName, double milliseconds) = 0;
|
|
82
|
+
virtual void useEmulator(jsi::Runtime &rt, jsi::String appName, jsi::String host, double port, jsi::String bucketUrl) = 0;
|
|
83
|
+
virtual jsi::Value writeToFile(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::String localFilePath, double taskId) = 0;
|
|
84
|
+
virtual jsi::Value putFile(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::String localFilePath, std::optional<jsi::Object> metadata, double taskId) = 0;
|
|
85
|
+
virtual jsi::Value putString(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::String string, jsi::String format, std::optional<jsi::Object> metadata, double taskId) = 0;
|
|
86
|
+
virtual bool setTaskStatus(jsi::Runtime &rt, jsi::String appName, double taskId, double status) = 0;
|
|
87
|
+
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
template <typename T>
|
|
91
|
+
class JSI_EXPORT NativeRNFBTurboStorageCxxSpec : public TurboModule {
|
|
92
|
+
public:
|
|
93
|
+
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
94
|
+
return delegate_.create(rt, propName);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
98
|
+
return delegate_.getPropertyNames(runtime);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
static constexpr std::string_view kModuleName = "NativeRNFBTurboStorage";
|
|
102
|
+
|
|
103
|
+
protected:
|
|
104
|
+
NativeRNFBTurboStorageCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
105
|
+
: TurboModule(std::string{NativeRNFBTurboStorageCxxSpec::kModuleName}, jsInvoker),
|
|
106
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
private:
|
|
110
|
+
class Delegate : public NativeRNFBTurboStorageCxxSpecJSI {
|
|
111
|
+
public:
|
|
112
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
113
|
+
NativeRNFBTurboStorageCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
jsi::Object getConstants(jsi::Runtime &rt) override {
|
|
118
|
+
static_assert(
|
|
119
|
+
bridging::getParameterCount(&T::getConstants) == 1,
|
|
120
|
+
"Expected getConstants(...) to have 1 parameters");
|
|
121
|
+
|
|
122
|
+
return bridging::callFromJs<jsi::Object>(
|
|
123
|
+
rt, &T::getConstants, jsInvoker_, instance_);
|
|
124
|
+
}
|
|
125
|
+
jsi::Value deleteObject(jsi::Runtime &rt, jsi::String appName, jsi::String url) override {
|
|
126
|
+
static_assert(
|
|
127
|
+
bridging::getParameterCount(&T::deleteObject) == 3,
|
|
128
|
+
"Expected deleteObject(...) to have 3 parameters");
|
|
129
|
+
|
|
130
|
+
return bridging::callFromJs<jsi::Value>(
|
|
131
|
+
rt, &T::deleteObject, jsInvoker_, instance_, std::move(appName), std::move(url));
|
|
132
|
+
}
|
|
133
|
+
jsi::Value getDownloadURL(jsi::Runtime &rt, jsi::String appName, jsi::String url) override {
|
|
134
|
+
static_assert(
|
|
135
|
+
bridging::getParameterCount(&T::getDownloadURL) == 3,
|
|
136
|
+
"Expected getDownloadURL(...) to have 3 parameters");
|
|
137
|
+
|
|
138
|
+
return bridging::callFromJs<jsi::Value>(
|
|
139
|
+
rt, &T::getDownloadURL, jsInvoker_, instance_, std::move(appName), std::move(url));
|
|
140
|
+
}
|
|
141
|
+
jsi::Value getMetadata(jsi::Runtime &rt, jsi::String appName, jsi::String url) override {
|
|
142
|
+
static_assert(
|
|
143
|
+
bridging::getParameterCount(&T::getMetadata) == 3,
|
|
144
|
+
"Expected getMetadata(...) to have 3 parameters");
|
|
145
|
+
|
|
146
|
+
return bridging::callFromJs<jsi::Value>(
|
|
147
|
+
rt, &T::getMetadata, jsInvoker_, instance_, std::move(appName), std::move(url));
|
|
148
|
+
}
|
|
149
|
+
jsi::Value updateMetadata(jsi::Runtime &rt, jsi::String appName, jsi::String url, std::optional<jsi::Object> metadata) override {
|
|
150
|
+
static_assert(
|
|
151
|
+
bridging::getParameterCount(&T::updateMetadata) == 4,
|
|
152
|
+
"Expected updateMetadata(...) to have 4 parameters");
|
|
153
|
+
|
|
154
|
+
return bridging::callFromJs<jsi::Value>(
|
|
155
|
+
rt, &T::updateMetadata, jsInvoker_, instance_, std::move(appName), std::move(url), std::move(metadata));
|
|
156
|
+
}
|
|
157
|
+
jsi::Value list(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::Object listOptions) override {
|
|
158
|
+
static_assert(
|
|
159
|
+
bridging::getParameterCount(&T::list) == 4,
|
|
160
|
+
"Expected list(...) to have 4 parameters");
|
|
161
|
+
|
|
162
|
+
return bridging::callFromJs<jsi::Value>(
|
|
163
|
+
rt, &T::list, jsInvoker_, instance_, std::move(appName), std::move(url), std::move(listOptions));
|
|
164
|
+
}
|
|
165
|
+
jsi::Value listAll(jsi::Runtime &rt, jsi::String appName, jsi::String url) override {
|
|
166
|
+
static_assert(
|
|
167
|
+
bridging::getParameterCount(&T::listAll) == 3,
|
|
168
|
+
"Expected listAll(...) to have 3 parameters");
|
|
169
|
+
|
|
170
|
+
return bridging::callFromJs<jsi::Value>(
|
|
171
|
+
rt, &T::listAll, jsInvoker_, instance_, std::move(appName), std::move(url));
|
|
172
|
+
}
|
|
173
|
+
jsi::Value setMaxDownloadRetryTime(jsi::Runtime &rt, jsi::String appName, double milliseconds) override {
|
|
174
|
+
static_assert(
|
|
175
|
+
bridging::getParameterCount(&T::setMaxDownloadRetryTime) == 3,
|
|
176
|
+
"Expected setMaxDownloadRetryTime(...) to have 3 parameters");
|
|
177
|
+
|
|
178
|
+
return bridging::callFromJs<jsi::Value>(
|
|
179
|
+
rt, &T::setMaxDownloadRetryTime, jsInvoker_, instance_, std::move(appName), std::move(milliseconds));
|
|
180
|
+
}
|
|
181
|
+
jsi::Value setMaxOperationRetryTime(jsi::Runtime &rt, jsi::String appName, double milliseconds) override {
|
|
182
|
+
static_assert(
|
|
183
|
+
bridging::getParameterCount(&T::setMaxOperationRetryTime) == 3,
|
|
184
|
+
"Expected setMaxOperationRetryTime(...) to have 3 parameters");
|
|
185
|
+
|
|
186
|
+
return bridging::callFromJs<jsi::Value>(
|
|
187
|
+
rt, &T::setMaxOperationRetryTime, jsInvoker_, instance_, std::move(appName), std::move(milliseconds));
|
|
188
|
+
}
|
|
189
|
+
jsi::Value setMaxUploadRetryTime(jsi::Runtime &rt, jsi::String appName, double milliseconds) override {
|
|
190
|
+
static_assert(
|
|
191
|
+
bridging::getParameterCount(&T::setMaxUploadRetryTime) == 3,
|
|
192
|
+
"Expected setMaxUploadRetryTime(...) to have 3 parameters");
|
|
193
|
+
|
|
194
|
+
return bridging::callFromJs<jsi::Value>(
|
|
195
|
+
rt, &T::setMaxUploadRetryTime, jsInvoker_, instance_, std::move(appName), std::move(milliseconds));
|
|
196
|
+
}
|
|
197
|
+
void useEmulator(jsi::Runtime &rt, jsi::String appName, jsi::String host, double port, jsi::String bucketUrl) override {
|
|
198
|
+
static_assert(
|
|
199
|
+
bridging::getParameterCount(&T::useEmulator) == 5,
|
|
200
|
+
"Expected useEmulator(...) to have 5 parameters");
|
|
201
|
+
|
|
202
|
+
return bridging::callFromJs<void>(
|
|
203
|
+
rt, &T::useEmulator, jsInvoker_, instance_, std::move(appName), std::move(host), std::move(port), std::move(bucketUrl));
|
|
204
|
+
}
|
|
205
|
+
jsi::Value writeToFile(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::String localFilePath, double taskId) override {
|
|
206
|
+
static_assert(
|
|
207
|
+
bridging::getParameterCount(&T::writeToFile) == 5,
|
|
208
|
+
"Expected writeToFile(...) to have 5 parameters");
|
|
209
|
+
|
|
210
|
+
return bridging::callFromJs<jsi::Value>(
|
|
211
|
+
rt, &T::writeToFile, jsInvoker_, instance_, std::move(appName), std::move(url), std::move(localFilePath), std::move(taskId));
|
|
212
|
+
}
|
|
213
|
+
jsi::Value putFile(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::String localFilePath, std::optional<jsi::Object> metadata, double taskId) override {
|
|
214
|
+
static_assert(
|
|
215
|
+
bridging::getParameterCount(&T::putFile) == 6,
|
|
216
|
+
"Expected putFile(...) to have 6 parameters");
|
|
217
|
+
|
|
218
|
+
return bridging::callFromJs<jsi::Value>(
|
|
219
|
+
rt, &T::putFile, jsInvoker_, instance_, std::move(appName), std::move(url), std::move(localFilePath), std::move(metadata), std::move(taskId));
|
|
220
|
+
}
|
|
221
|
+
jsi::Value putString(jsi::Runtime &rt, jsi::String appName, jsi::String url, jsi::String string, jsi::String format, std::optional<jsi::Object> metadata, double taskId) override {
|
|
222
|
+
static_assert(
|
|
223
|
+
bridging::getParameterCount(&T::putString) == 7,
|
|
224
|
+
"Expected putString(...) to have 7 parameters");
|
|
225
|
+
|
|
226
|
+
return bridging::callFromJs<jsi::Value>(
|
|
227
|
+
rt, &T::putString, jsInvoker_, instance_, std::move(appName), std::move(url), std::move(string), std::move(format), std::move(metadata), std::move(taskId));
|
|
228
|
+
}
|
|
229
|
+
bool setTaskStatus(jsi::Runtime &rt, jsi::String appName, double taskId, double status) override {
|
|
230
|
+
static_assert(
|
|
231
|
+
bridging::getParameterCount(&T::setTaskStatus) == 4,
|
|
232
|
+
"Expected setTaskStatus(...) to have 4 parameters");
|
|
233
|
+
|
|
234
|
+
return bridging::callFromJs<bool>(
|
|
235
|
+
rt, &T::setTaskStatus, jsInvoker_, instance_, std::move(appName), std::move(taskId), std::move(status));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
private:
|
|
239
|
+
friend class NativeRNFBTurboStorageCxxSpec;
|
|
240
|
+
T *instance_;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
Delegate delegate_;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.78.3"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
package/lib/StorageReference.ts
CHANGED
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
pathParent,
|
|
30
30
|
ReferenceBase,
|
|
31
31
|
toFilePath,
|
|
32
|
-
isModularCall,
|
|
33
32
|
} from '@react-native-firebase/app/dist/module/common';
|
|
34
33
|
import StorageDownloadTask from './StorageDownloadTask';
|
|
35
34
|
import StorageListResult, { provideStorageReferenceClass } from './StorageListResult';
|
|
@@ -113,7 +112,7 @@ export default class Reference extends ReferenceBase implements StorageReference
|
|
|
113
112
|
* @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#delete
|
|
114
113
|
*/
|
|
115
114
|
delete(): Promise<void> {
|
|
116
|
-
return this._storage.native.
|
|
115
|
+
return this._storage.native.deleteObject(this.toString());
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
/**
|
|
@@ -144,13 +143,10 @@ export default class Reference extends ReferenceBase implements StorageReference
|
|
|
144
143
|
maxResults: 1000,
|
|
145
144
|
};
|
|
146
145
|
|
|
147
|
-
const isModular = isModularCall(arguments);
|
|
148
|
-
|
|
149
146
|
if (options) {
|
|
150
147
|
if (hasOwnProperty(options, 'maxResults')) {
|
|
151
148
|
const maxResults = options.maxResults;
|
|
152
|
-
|
|
153
|
-
if (isModular && (maxResults === null || isUndefined(maxResults))) {
|
|
149
|
+
if (maxResults === null || isUndefined(maxResults)) {
|
|
154
150
|
// no-op (keep default)
|
|
155
151
|
} else {
|
|
156
152
|
if (!isNumber(maxResults) || !isInteger(maxResults)) {
|
|
@@ -171,8 +167,7 @@ export default class Reference extends ReferenceBase implements StorageReference
|
|
|
171
167
|
|
|
172
168
|
if (hasOwnProperty(options, 'pageToken')) {
|
|
173
169
|
const pageToken = options.pageToken;
|
|
174
|
-
|
|
175
|
-
if (isModular && (pageToken === null || isUndefined(pageToken))) {
|
|
170
|
+
if (pageToken === null || isUndefined(pageToken)) {
|
|
176
171
|
// no-op
|
|
177
172
|
} else if (!isUndefined(pageToken) && pageToken !== null) {
|
|
178
173
|
if (!isString(pageToken)) {
|
package/lib/StorageTask.ts
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
import { isFunction, isNull, isObject } from '@react-native-firebase/app/dist/module/common';
|
|
19
19
|
import type { EmitterSubscription } from 'react-native';
|
|
20
20
|
import { TaskEvent } from './StorageStatics';
|
|
21
|
-
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
22
21
|
import type {
|
|
23
22
|
FullMetadata,
|
|
23
|
+
StorageError,
|
|
24
24
|
StorageObserver,
|
|
25
25
|
StorageReference,
|
|
26
26
|
Subscribe,
|
|
@@ -50,7 +50,7 @@ function createEmptyMetadata(ref: StorageReference): FullMetadata {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function wrapErrorEventListener(
|
|
53
|
-
listenerFn: ((error:
|
|
53
|
+
listenerFn: ((error: StorageError) => void) | null | undefined,
|
|
54
54
|
unsubscribe: (() => void) | null | undefined,
|
|
55
55
|
): (snapshot: TaskSnapshot) => void {
|
|
56
56
|
return (snapshot: TaskSnapshot) => {
|
|
@@ -59,7 +59,7 @@ function wrapErrorEventListener(
|
|
|
59
59
|
} // 1 frame = 16ms, pushing to next frame
|
|
60
60
|
if (isFunction(listenerFn)) {
|
|
61
61
|
const errorEvent = snapshot as TaskSnapshot & {
|
|
62
|
-
error?:
|
|
62
|
+
error?: StorageError;
|
|
63
63
|
};
|
|
64
64
|
if (errorEvent.error) {
|
|
65
65
|
listenerFn(errorEvent.error);
|
|
@@ -123,7 +123,7 @@ function addTaskEventListener(
|
|
|
123
123
|
function subscribeToEvents(
|
|
124
124
|
task: StorageTask,
|
|
125
125
|
nextOrObserver?: ((snapshot: TaskSnapshot) => unknown) | StorageObserver<TaskSnapshot> | null,
|
|
126
|
-
error?: ((error:
|
|
126
|
+
error?: ((error: StorageError) => unknown) | null,
|
|
127
127
|
complete?: (() => unknown) | null,
|
|
128
128
|
): () => void {
|
|
129
129
|
let _error: ((snapshot: TaskSnapshot) => void) | undefined;
|
|
@@ -215,7 +215,7 @@ export default class StorageTask {
|
|
|
215
215
|
*/
|
|
216
216
|
get then(): (
|
|
217
217
|
onFulfilled?: ((snapshot: TaskSnapshot) => TaskSnapshot) | null,
|
|
218
|
-
onRejected?: ((error:
|
|
218
|
+
onRejected?: ((error: StorageError) => any) | null,
|
|
219
219
|
) => Promise<TaskSnapshot> {
|
|
220
220
|
if (!this._promise) {
|
|
221
221
|
this._promise = this._beginTask(this);
|
|
@@ -224,7 +224,7 @@ export default class StorageTask {
|
|
|
224
224
|
const promise = this._promise;
|
|
225
225
|
return (
|
|
226
226
|
onFulfilled?: ((snapshot: TaskSnapshot) => any) | null,
|
|
227
|
-
onRejected?: ((error:
|
|
227
|
+
onRejected?: ((error: StorageError) => any) | null,
|
|
228
228
|
) => {
|
|
229
229
|
return new Promise((resolve, reject) => {
|
|
230
230
|
promise
|
|
@@ -242,7 +242,7 @@ export default class StorageTask {
|
|
|
242
242
|
resolve(response);
|
|
243
243
|
}
|
|
244
244
|
})
|
|
245
|
-
.catch((error:
|
|
245
|
+
.catch((error: StorageError) => {
|
|
246
246
|
if (onRejected) {
|
|
247
247
|
resolve(onRejected(error));
|
|
248
248
|
} else {
|
|
@@ -256,9 +256,7 @@ export default class StorageTask {
|
|
|
256
256
|
/**
|
|
257
257
|
* @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#catch
|
|
258
258
|
*/
|
|
259
|
-
get catch(): (
|
|
260
|
-
onRejected: (error: ReactNativeFirebase.NativeFirebaseError) => any,
|
|
261
|
-
) => Promise<any> {
|
|
259
|
+
get catch(): (onRejected: (error: StorageError) => any) => Promise<any> {
|
|
262
260
|
if (!this._promise) {
|
|
263
261
|
this._promise = this._beginTask(this);
|
|
264
262
|
}
|
|
@@ -285,13 +283,13 @@ export default class StorageTask {
|
|
|
285
283
|
on(
|
|
286
284
|
event: TaskEventType,
|
|
287
285
|
nextOrObserver?: StorageObserver<TaskSnapshot> | null | ((snapshot: TaskSnapshot) => unknown),
|
|
288
|
-
error?: ((error:
|
|
286
|
+
error?: ((error: StorageError) => unknown) | null,
|
|
289
287
|
complete?: (() => unknown) | null,
|
|
290
288
|
): Unsubscribe;
|
|
291
289
|
on(
|
|
292
290
|
event: TaskEventType,
|
|
293
291
|
nextOrObserver?: StorageObserver<TaskSnapshot> | null | ((snapshot: TaskSnapshot) => unknown),
|
|
294
|
-
error?: ((error:
|
|
292
|
+
error?: ((error: StorageError) => unknown) | null,
|
|
295
293
|
complete?: (() => unknown) | null,
|
|
296
294
|
): Unsubscribe | Subscribe<TaskSnapshot> {
|
|
297
295
|
if (event !== TaskEvent.STATE_CHANGED) {
|
|
@@ -316,21 +314,21 @@ export default class StorageTask {
|
|
|
316
314
|
/**
|
|
317
315
|
* @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#pause
|
|
318
316
|
*/
|
|
319
|
-
pause():
|
|
317
|
+
pause(): boolean {
|
|
320
318
|
return this._storage.native.setTaskStatus(this._id, 0);
|
|
321
319
|
}
|
|
322
320
|
|
|
323
321
|
/**
|
|
324
322
|
* @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#pause
|
|
325
323
|
*/
|
|
326
|
-
resume():
|
|
324
|
+
resume(): boolean {
|
|
327
325
|
return this._storage.native.setTaskStatus(this._id, 1);
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
/**
|
|
331
329
|
* @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#cancel
|
|
332
330
|
*/
|
|
333
|
-
cancel():
|
|
331
|
+
cancel(): boolean {
|
|
334
332
|
return this._storage.native.setTaskStatus(this._id, 2);
|
|
335
333
|
}
|
|
336
334
|
}
|