@onekeyfe/react-native-range-downloader 3.0.81-alpha.0 → 3.0.81-alpha.10

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 (38) hide show
  1. package/ReactNativeRangeDownloader.podspec +1 -1
  2. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRules.kt +12 -5
  3. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactOrphanSweep.kt +111 -0
  4. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactStore.kt +185 -189
  5. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/ReactNativeRangeDownloader.kt +16 -20
  6. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRulesTest.kt +39 -0
  7. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDeadlineTest.kt +26 -0
  8. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactOrphanSweepTest.kt +107 -0
  9. package/ios/FirmwareArtifactStore.swift +662 -408
  10. package/ios/RangeDownloadLogic.swift +297 -0
  11. package/ios/ReactNativeRangeDownloader.swift +42 -471
  12. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts +3 -7
  13. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts.map +1 -1
  14. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializeParams.hpp +7 -6
  15. package/nitrogen/generated/android/c++/JFirmwareArtifactDownloadParams.hpp +7 -7
  16. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.cpp +0 -19
  17. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.hpp +0 -1
  18. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializeParams.kt +2 -2
  19. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDownloadParams.kt +3 -3
  20. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/HybridReactNativeRangeDownloaderSpec.kt +0 -4
  21. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Bridge.hpp +15 -0
  22. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Umbrella.hpp +0 -3
  23. package/nitrogen/generated/ios/c++/HybridReactNativeRangeDownloaderSpecSwift.hpp +0 -11
  24. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializeParams.swift +32 -13
  25. package/nitrogen/generated/ios/swift/FirmwareArtifactDownloadParams.swift +39 -8
  26. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec.swift +0 -1
  27. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec_cxx.swift +0 -19
  28. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializeParams.hpp +6 -5
  29. package/nitrogen/generated/shared/c++/FirmwareArtifactDownloadParams.hpp +9 -9
  30. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.cpp +0 -1
  31. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.hpp +0 -4
  32. package/package.json +2 -2
  33. package/src/ReactNativeRangeDownloader.nitro.ts +4 -11
  34. package/ios/FirmwareBackgroundSessionEventRouter.swift +0 -17
  35. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseReconcileParams.hpp +0 -76
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseReconcileParams.kt +0 -38
  37. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseReconcileParams.swift +0 -48
  38. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseReconcileParams.hpp +0 -76
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativeRangeDownloader.nitro.d.ts","sourceRoot":"","sources":["../../../src/ReactNativeRangeDownloader.nitro.ts"],"names":[],"mapp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BAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAKzC,eAAe,IAAI,MAAM,CAAC;IAE1B,+BAA+B,IAAI,4BAA4B,CAAC;IAChE,wBAAwB,CACtB,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACpC,+BAA+B,CAC7B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,uBAAuB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,oBAAoB,CAClB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACvC,oBAAoB,CAClB,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,qBAAqB,CACnB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,0BAA0B,CACxB,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC7C,2BAA2B,CACzB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClC,sBAAsB,CACpB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,4BAA4B,CAC1B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,+BAA+B,CAC7B,MAAM,EAAE,oCAAoC,GAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,4BAA4B,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACtE"}
1
+ {"version":3,"file":"ReactNativeRangeDownloader.nitro.d.ts","sourceRoot":"","sources":["../../../src/ReactNativeRangeDownloader.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM/D,MAAM,MAAM,eAAe,GA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AAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACpC,+BAA+B,CAC7B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,uBAAuB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,oBAAoB,CAClB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACvC,oBAAoB,CAClB,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,qBAAqB,CACnB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,0BAA0B,CACxB,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC7C,2BAA2B,CACzB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClC,sBAAsB,CACpB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,4BAA4B,CAC1B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,4BAA4B,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACtE"}
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "FirmwareArchiveExpectedEntry.hpp"
14
14
  #include "JFirmwareArchiveExpectedEntry.hpp"
15
+ #include <optional>
15
16
  #include <string>
16
17
  #include <vector>
17
18
 
@@ -43,7 +44,7 @@ namespace margelo::nitro::reactnativerangedownloader {
43
44
  return FirmwareArchiveMaterializeParams(
44
45
  leaseRef->toStdString(),
45
46
  archiveArtifactRef->toStdString(),
46
- [&]() {
47
+ expectedEntries != nullptr ? std::make_optional([&]() {
47
48
  size_t __size = expectedEntries->size();
48
49
  std::vector<FirmwareArchiveExpectedEntry> __vector;
49
50
  __vector.reserve(__size);
@@ -52,7 +53,7 @@ namespace margelo::nitro::reactnativerangedownloader {
52
53
  __vector.push_back(__element->toCpp());
53
54
  }
54
55
  return __vector;
55
- }()
56
+ }()) : std::nullopt
56
57
  );
57
58
  }
58
59
 
@@ -69,16 +70,16 @@ namespace margelo::nitro::reactnativerangedownloader {
69
70
  clazz,
70
71
  jni::make_jstring(value.leaseRef),
71
72
  jni::make_jstring(value.archiveArtifactRef),
72
- [&]() {
73
- size_t __size = value.expectedEntries.size();
73
+ value.expectedEntries.has_value() ? [&]() {
74
+ size_t __size = value.expectedEntries.value().size();
74
75
  jni::local_ref<jni::JArrayClass<JFirmwareArchiveExpectedEntry>> __array = jni::JArrayClass<JFirmwareArchiveExpectedEntry>::newArray(__size);
75
76
  for (size_t __i = 0; __i < __size; __i++) {
76
- const auto& __element = value.expectedEntries[__i];
77
+ const auto& __element = value.expectedEntries.value()[__i];
77
78
  auto __elementJni = JFirmwareArchiveExpectedEntry::fromCpp(__element);
78
79
  __array->setElement(__i, *__elementJni);
79
80
  }
80
81
  return __array;
81
- }()
82
+ }() : nullptr
82
83
  );
83
84
  }
84
85
  };
@@ -46,8 +46,8 @@ namespace margelo::nitro::reactnativerangedownloader {
46
46
  jni::local_ref<jni::JString> routeType = this->getFieldValue(fieldRouteType);
47
47
  static const auto fieldResolvedIp = clazz->getField<jni::JString>("resolvedIp");
48
48
  jni::local_ref<jni::JString> resolvedIp = this->getFieldValue(fieldResolvedIp);
49
- static const auto fieldExpectedSize = clazz->getField<double>("expectedSize");
50
- double expectedSize = this->getFieldValue(fieldExpectedSize);
49
+ static const auto fieldExpectedSize = clazz->getField<jni::JDouble>("expectedSize");
50
+ jni::local_ref<jni::JDouble> expectedSize = this->getFieldValue(fieldExpectedSize);
51
51
  static const auto fieldExpectedSha256 = clazz->getField<jni::JString>("expectedSha256");
52
52
  jni::local_ref<jni::JString> expectedSha256 = this->getFieldValue(fieldExpectedSha256);
53
53
  static const auto fieldMaxBytes = clazz->getField<double>("maxBytes");
@@ -62,8 +62,8 @@ namespace margelo::nitro::reactnativerangedownloader {
62
62
  url->toStdString(),
63
63
  routeType->toStdString(),
64
64
  resolvedIp != nullptr ? std::make_optional(resolvedIp->toStdString()) : std::nullopt,
65
- expectedSize,
66
- expectedSha256->toStdString(),
65
+ expectedSize != nullptr ? std::make_optional(expectedSize->value()) : std::nullopt,
66
+ expectedSha256 != nullptr ? std::make_optional(expectedSha256->toStdString()) : std::nullopt,
67
67
  maxBytes,
68
68
  overallDeadlineSeconds != nullptr ? std::make_optional(overallDeadlineSeconds->value()) : std::nullopt
69
69
  );
@@ -75,7 +75,7 @@ namespace margelo::nitro::reactnativerangedownloader {
75
75
  */
76
76
  [[maybe_unused]]
77
77
  static jni::local_ref<JFirmwareArtifactDownloadParams::javaobject> fromCpp(const FirmwareArtifactDownloadParams& value) {
78
- using JSignature = JFirmwareArtifactDownloadParams(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JDouble>);
78
+ using JSignature = JFirmwareArtifactDownloadParams(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JDouble>);
79
79
  static const auto clazz = javaClassStatic();
80
80
  static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
81
81
  return create(
@@ -87,8 +87,8 @@ namespace margelo::nitro::reactnativerangedownloader {
87
87
  jni::make_jstring(value.url),
88
88
  jni::make_jstring(value.routeType),
89
89
  value.resolvedIp.has_value() ? jni::make_jstring(value.resolvedIp.value()) : nullptr,
90
- value.expectedSize,
91
- jni::make_jstring(value.expectedSha256),
90
+ value.expectedSize.has_value() ? jni::JDouble::valueOf(value.expectedSize.value()) : nullptr,
91
+ value.expectedSha256.has_value() ? jni::make_jstring(value.expectedSha256.value()) : nullptr,
92
92
  value.maxBytes,
93
93
  value.overallDeadlineSeconds.has_value() ? jni::JDouble::valueOf(value.overallDeadlineSeconds.value()) : nullptr
94
94
  );
@@ -53,8 +53,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLe
53
53
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseRetainParams; }
54
54
  // Forward declaration of `FirmwareArtifactLeaseReleaseParams` to properly resolve imports.
55
55
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReleaseParams; }
56
- // Forward declaration of `FirmwareArtifactLeaseReconcileParams` to properly resolve imports.
57
- namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReconcileParams; }
58
56
 
59
57
  #include "RangeDownloadResult.hpp"
60
58
  #include <NitroModules/Promise.hpp>
@@ -113,8 +111,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLe
113
111
  #include "JFirmwareArtifactLeaseRetainParams.hpp"
114
112
  #include "FirmwareArtifactLeaseReleaseParams.hpp"
115
113
  #include "JFirmwareArtifactLeaseReleaseParams.hpp"
116
- #include "FirmwareArtifactLeaseReconcileParams.hpp"
117
- #include "JFirmwareArtifactLeaseReconcileParams.hpp"
118
114
 
119
115
  namespace margelo::nitro::reactnativerangedownloader {
120
116
 
@@ -368,21 +364,6 @@ namespace margelo::nitro::reactnativerangedownloader {
368
364
  return __promise;
369
365
  }();
370
366
  }
371
- std::shared_ptr<Promise<void>> JHybridReactNativeRangeDownloaderSpec::reconcileFirmwareArtifactLeases(const FirmwareArtifactLeaseReconcileParams& params) {
372
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JFirmwareArtifactLeaseReconcileParams> /* params */)>("reconcileFirmwareArtifactLeases");
373
- auto __result = method(_javaPart, JFirmwareArtifactLeaseReconcileParams::fromCpp(params));
374
- return [&]() {
375
- auto __promise = Promise<void>::create();
376
- __result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& /* unit */) {
377
- __promise->resolve();
378
- });
379
- __result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
380
- jni::JniException __jniError(__throwable);
381
- __promise->reject(std::make_exception_ptr(__jniError));
382
- });
383
- return __promise;
384
- }();
385
- }
386
367
  std::shared_ptr<Promise<FirmwareArtifactSweepResult>> JHybridReactNativeRangeDownloaderSpec::sweepFirmwareArtifactOrphans() {
387
368
  static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("sweepFirmwareArtifactOrphans");
388
369
  auto __result = method(_javaPart);
@@ -71,7 +71,6 @@ namespace margelo::nitro::reactnativerangedownloader {
71
71
  std::shared_ptr<Promise<FirmwareArtifactLease>> createFirmwareArtifactLease(const FirmwareArtifactLeaseCreateParams& params) override;
72
72
  std::shared_ptr<Promise<void>> retainFirmwareArtifact(const FirmwareArtifactLeaseRetainParams& params) override;
73
73
  std::shared_ptr<Promise<void>> releaseFirmwareArtifactLease(const FirmwareArtifactLeaseReleaseParams& params) override;
74
- std::shared_ptr<Promise<void>> reconcileFirmwareArtifactLeases(const FirmwareArtifactLeaseReconcileParams& params) override;
75
74
  std::shared_ptr<Promise<FirmwareArtifactSweepResult>> sweepFirmwareArtifactOrphans() override;
76
75
 
77
76
  private:
@@ -25,7 +25,7 @@ data class FirmwareArchiveMaterializeParams(
25
25
  val archiveArtifactRef: String,
26
26
  @DoNotStrip
27
27
  @Keep
28
- val expectedEntries: Array<FirmwareArchiveExpectedEntry>
28
+ val expectedEntries: Array<FirmwareArchiveExpectedEntry>?
29
29
  ) {
30
30
  /* primary constructor */
31
31
 
@@ -37,7 +37,7 @@ data class FirmwareArchiveMaterializeParams(
37
37
  @Keep
38
38
  @Suppress("unused")
39
39
  @JvmStatic
40
- private fun fromCpp(leaseRef: String, archiveArtifactRef: String, expectedEntries: Array<FirmwareArchiveExpectedEntry>): FirmwareArchiveMaterializeParams {
40
+ private fun fromCpp(leaseRef: String, archiveArtifactRef: String, expectedEntries: Array<FirmwareArchiveExpectedEntry>?): FirmwareArchiveMaterializeParams {
41
41
  return FirmwareArchiveMaterializeParams(leaseRef, archiveArtifactRef, expectedEntries)
42
42
  }
43
43
  }
@@ -40,10 +40,10 @@ data class FirmwareArtifactDownloadParams(
40
40
  val resolvedIp: String?,
41
41
  @DoNotStrip
42
42
  @Keep
43
- val expectedSize: Double,
43
+ val expectedSize: Double?,
44
44
  @DoNotStrip
45
45
  @Keep
46
- val expectedSha256: String,
46
+ val expectedSha256: String?,
47
47
  @DoNotStrip
48
48
  @Keep
49
49
  val maxBytes: Double,
@@ -61,7 +61,7 @@ data class FirmwareArtifactDownloadParams(
61
61
  @Keep
62
62
  @Suppress("unused")
63
63
  @JvmStatic
64
- private fun fromCpp(taskId: String, transactionId: String, leaseRef: String, artifactId: String, url: String, routeType: String, resolvedIp: String?, expectedSize: Double, expectedSha256: String, maxBytes: Double, overallDeadlineSeconds: Double?): FirmwareArtifactDownloadParams {
64
+ private fun fromCpp(taskId: String, transactionId: String, leaseRef: String, artifactId: String, url: String, routeType: String, resolvedIp: String?, expectedSize: Double?, expectedSha256: String?, maxBytes: Double, overallDeadlineSeconds: Double?): FirmwareArtifactDownloadParams {
65
65
  return FirmwareArtifactDownloadParams(taskId, transactionId, leaseRef, artifactId, url, routeType, resolvedIp, expectedSize, expectedSha256, maxBytes, overallDeadlineSeconds)
66
66
  }
67
67
  }
@@ -120,10 +120,6 @@ abstract class HybridReactNativeRangeDownloaderSpec: HybridObject() {
120
120
  @Keep
121
121
  abstract fun releaseFirmwareArtifactLease(params: FirmwareArtifactLeaseReleaseParams): Promise<Unit>
122
122
 
123
- @DoNotStrip
124
- @Keep
125
- abstract fun reconcileFirmwareArtifactLeases(params: FirmwareArtifactLeaseReconcileParams): Promise<Unit>
126
-
127
123
  @DoNotStrip
128
124
  @Keep
129
125
  abstract fun sweepFirmwareArtifactOrphans(): Promise<FirmwareArtifactSweepResult>
@@ -402,6 +402,21 @@ namespace margelo::nitro::reactnativerangedownloader::bridge::swift {
402
402
  return vector;
403
403
  }
404
404
 
405
+ // pragma MARK: std::optional<std::vector<FirmwareArchiveExpectedEntry>>
406
+ /**
407
+ * Specialized version of `std::optional<std::vector<FirmwareArchiveExpectedEntry>>`.
408
+ */
409
+ using std__optional_std__vector_FirmwareArchiveExpectedEntry__ = std::optional<std::vector<FirmwareArchiveExpectedEntry>>;
410
+ inline std::optional<std::vector<FirmwareArchiveExpectedEntry>> create_std__optional_std__vector_FirmwareArchiveExpectedEntry__(const std::vector<FirmwareArchiveExpectedEntry>& value) noexcept {
411
+ return std::optional<std::vector<FirmwareArchiveExpectedEntry>>(value);
412
+ }
413
+ inline bool has_value_std__optional_std__vector_FirmwareArchiveExpectedEntry__(const std::optional<std::vector<FirmwareArchiveExpectedEntry>>& optional) noexcept {
414
+ return optional.has_value();
415
+ }
416
+ inline std::vector<FirmwareArchiveExpectedEntry> get_std__optional_std__vector_FirmwareArchiveExpectedEntry__(const std::optional<std::vector<FirmwareArchiveExpectedEntry>>& optional) noexcept {
417
+ return *optional;
418
+ }
419
+
405
420
  // pragma MARK: std::shared_ptr<Promise<FirmwareArtifactLease>>
406
421
  /**
407
422
  * Specialized version of `std::shared_ptr<Promise<FirmwareArtifactLease>>`.
@@ -26,8 +26,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactCa
26
26
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactDownloadParams; }
27
27
  // Forward declaration of `FirmwareArtifactLeaseCreateParams` to properly resolve imports.
28
28
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseCreateParams; }
29
- // Forward declaration of `FirmwareArtifactLeaseReconcileParams` to properly resolve imports.
30
- namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReconcileParams; }
31
29
  // Forward declaration of `FirmwareArtifactLeaseReleaseParams` to properly resolve imports.
32
30
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReleaseParams; }
33
31
  // Forward declaration of `FirmwareArtifactLeaseRetainParams` to properly resolve imports.
@@ -70,7 +68,6 @@ namespace margelo::nitro::reactnativerangedownloader { enum class RangeFallbackK
70
68
  #include "FirmwareArtifactDownloadParams.hpp"
71
69
  #include "FirmwareArtifactLease.hpp"
72
70
  #include "FirmwareArtifactLeaseCreateParams.hpp"
73
- #include "FirmwareArtifactLeaseReconcileParams.hpp"
74
71
  #include "FirmwareArtifactLeaseReleaseParams.hpp"
75
72
  #include "FirmwareArtifactLeaseRetainParams.hpp"
76
73
  #include "FirmwareArtifactReaderCloseParams.hpp"
@@ -58,8 +58,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLe
58
58
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseRetainParams; }
59
59
  // Forward declaration of `FirmwareArtifactLeaseReleaseParams` to properly resolve imports.
60
60
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReleaseParams; }
61
- // Forward declaration of `FirmwareArtifactLeaseReconcileParams` to properly resolve imports.
62
- namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReconcileParams; }
63
61
  // Forward declaration of `FirmwareArtifactSweepResult` to properly resolve imports.
64
62
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactSweepResult; }
65
63
 
@@ -92,7 +90,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactSw
92
90
  #include "FirmwareArtifactLeaseCreateParams.hpp"
93
91
  #include "FirmwareArtifactLeaseRetainParams.hpp"
94
92
  #include "FirmwareArtifactLeaseReleaseParams.hpp"
95
- #include "FirmwareArtifactLeaseReconcileParams.hpp"
96
93
  #include "FirmwareArtifactSweepResult.hpp"
97
94
 
98
95
  #include "ReactNativeRangeDownloader-Swift-Cxx-Umbrella.hpp"
@@ -273,14 +270,6 @@ namespace margelo::nitro::reactnativerangedownloader {
273
270
  auto __value = std::move(__result.value());
274
271
  return __value;
275
272
  }
276
- inline std::shared_ptr<Promise<void>> reconcileFirmwareArtifactLeases(const FirmwareArtifactLeaseReconcileParams& params) override {
277
- auto __result = _swiftPart.reconcileFirmwareArtifactLeases(std::forward<decltype(params)>(params));
278
- if (__result.hasError()) [[unlikely]] {
279
- std::rethrow_exception(__result.error());
280
- }
281
- auto __value = std::move(__result.value());
282
- return __value;
283
- }
284
273
  inline std::shared_ptr<Promise<FirmwareArtifactSweepResult>> sweepFirmwareArtifactOrphans() override {
285
274
  auto __result = _swiftPart.sweepFirmwareArtifactOrphans();
286
275
  if (__result.hasError()) [[unlikely]] {
@@ -19,13 +19,19 @@ public extension FirmwareArchiveMaterializeParams {
19
19
  /**
20
20
  * Create a new instance of `FirmwareArchiveMaterializeParams`.
21
21
  */
22
- init(leaseRef: String, archiveArtifactRef: String, expectedEntries: [FirmwareArchiveExpectedEntry]) {
23
- self.init(std.string(leaseRef), std.string(archiveArtifactRef), { () -> bridge.std__vector_FirmwareArchiveExpectedEntry_ in
24
- var __vector = bridge.create_std__vector_FirmwareArchiveExpectedEntry_(expectedEntries.count)
25
- for __item in expectedEntries {
26
- __vector.push_back(__item)
22
+ init(leaseRef: String, archiveArtifactRef: String, expectedEntries: [FirmwareArchiveExpectedEntry]?) {
23
+ self.init(std.string(leaseRef), std.string(archiveArtifactRef), { () -> bridge.std__optional_std__vector_FirmwareArchiveExpectedEntry__ in
24
+ if let __unwrappedValue = expectedEntries {
25
+ return bridge.create_std__optional_std__vector_FirmwareArchiveExpectedEntry__({ () -> bridge.std__vector_FirmwareArchiveExpectedEntry_ in
26
+ var __vector = bridge.create_std__vector_FirmwareArchiveExpectedEntry_(__unwrappedValue.count)
27
+ for __item in __unwrappedValue {
28
+ __vector.push_back(__item)
29
+ }
30
+ return __vector
31
+ }())
32
+ } else {
33
+ return .init()
27
34
  }
28
- return __vector
29
35
  }())
30
36
  }
31
37
 
@@ -51,19 +57,32 @@ public extension FirmwareArchiveMaterializeParams {
51
57
  }
52
58
  }
53
59
 
54
- var expectedEntries: [FirmwareArchiveExpectedEntry] {
60
+ var expectedEntries: [FirmwareArchiveExpectedEntry]? {
55
61
  @inline(__always)
56
62
  get {
57
- return self.__expectedEntries.map({ __item in __item })
63
+ return { () -> [FirmwareArchiveExpectedEntry]? in
64
+ if bridge.has_value_std__optional_std__vector_FirmwareArchiveExpectedEntry__(self.__expectedEntries) {
65
+ let __unwrapped = bridge.get_std__optional_std__vector_FirmwareArchiveExpectedEntry__(self.__expectedEntries)
66
+ return __unwrapped.map({ __item in __item })
67
+ } else {
68
+ return nil
69
+ }
70
+ }()
58
71
  }
59
72
  @inline(__always)
60
73
  set {
61
- self.__expectedEntries = { () -> bridge.std__vector_FirmwareArchiveExpectedEntry_ in
62
- var __vector = bridge.create_std__vector_FirmwareArchiveExpectedEntry_(newValue.count)
63
- for __item in newValue {
64
- __vector.push_back(__item)
74
+ self.__expectedEntries = { () -> bridge.std__optional_std__vector_FirmwareArchiveExpectedEntry__ in
75
+ if let __unwrappedValue = newValue {
76
+ return bridge.create_std__optional_std__vector_FirmwareArchiveExpectedEntry__({ () -> bridge.std__vector_FirmwareArchiveExpectedEntry_ in
77
+ var __vector = bridge.create_std__vector_FirmwareArchiveExpectedEntry_(__unwrappedValue.count)
78
+ for __item in __unwrappedValue {
79
+ __vector.push_back(__item)
80
+ }
81
+ return __vector
82
+ }())
83
+ } else {
84
+ return .init()
65
85
  }
66
- return __vector
67
86
  }()
68
87
  }
69
88
  }
@@ -19,14 +19,26 @@ public extension FirmwareArtifactDownloadParams {
19
19
  /**
20
20
  * Create a new instance of `FirmwareArtifactDownloadParams`.
21
21
  */
22
- init(taskId: String, transactionId: String, leaseRef: String, artifactId: String, url: String, routeType: String, resolvedIp: String?, expectedSize: Double, expectedSha256: String, maxBytes: Double, overallDeadlineSeconds: Double?) {
22
+ init(taskId: String, transactionId: String, leaseRef: String, artifactId: String, url: String, routeType: String, resolvedIp: String?, expectedSize: Double?, expectedSha256: String?, maxBytes: Double, overallDeadlineSeconds: Double?) {
23
23
  self.init(std.string(taskId), std.string(transactionId), std.string(leaseRef), std.string(artifactId), std.string(url), std.string(routeType), { () -> bridge.std__optional_std__string_ in
24
24
  if let __unwrappedValue = resolvedIp {
25
25
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
26
26
  } else {
27
27
  return .init()
28
28
  }
29
- }(), expectedSize, std.string(expectedSha256), maxBytes, { () -> bridge.std__optional_double_ in
29
+ }(), { () -> bridge.std__optional_double_ in
30
+ if let __unwrappedValue = expectedSize {
31
+ return bridge.create_std__optional_double_(__unwrappedValue)
32
+ } else {
33
+ return .init()
34
+ }
35
+ }(), { () -> bridge.std__optional_std__string_ in
36
+ if let __unwrappedValue = expectedSha256 {
37
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
38
+ } else {
39
+ return .init()
40
+ }
41
+ }(), maxBytes, { () -> bridge.std__optional_double_ in
30
42
  if let __unwrappedValue = overallDeadlineSeconds {
31
43
  return bridge.create_std__optional_double_(__unwrappedValue)
32
44
  } else {
@@ -125,25 +137,44 @@ public extension FirmwareArtifactDownloadParams {
125
137
  }
126
138
  }
127
139
 
128
- var expectedSize: Double {
140
+ var expectedSize: Double? {
129
141
  @inline(__always)
130
142
  get {
131
- return self.__expectedSize
143
+ return self.__expectedSize.value
132
144
  }
133
145
  @inline(__always)
134
146
  set {
135
- self.__expectedSize = newValue
147
+ self.__expectedSize = { () -> bridge.std__optional_double_ in
148
+ if let __unwrappedValue = newValue {
149
+ return bridge.create_std__optional_double_(__unwrappedValue)
150
+ } else {
151
+ return .init()
152
+ }
153
+ }()
136
154
  }
137
155
  }
138
156
 
139
- var expectedSha256: String {
157
+ var expectedSha256: String? {
140
158
  @inline(__always)
141
159
  get {
142
- return String(self.__expectedSha256)
160
+ return { () -> String? in
161
+ if bridge.has_value_std__optional_std__string_(self.__expectedSha256) {
162
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__expectedSha256)
163
+ return String(__unwrapped)
164
+ } else {
165
+ return nil
166
+ }
167
+ }()
143
168
  }
144
169
  @inline(__always)
145
170
  set {
146
- self.__expectedSha256 = std.string(newValue)
171
+ self.__expectedSha256 = { () -> bridge.std__optional_std__string_ in
172
+ if let __unwrappedValue = newValue {
173
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
174
+ } else {
175
+ return .init()
176
+ }
177
+ }()
147
178
  }
148
179
  }
149
180
 
@@ -31,7 +31,6 @@ public protocol HybridReactNativeRangeDownloaderSpec_protocol: HybridObject {
31
31
  func createFirmwareArtifactLease(params: FirmwareArtifactLeaseCreateParams) throws -> Promise<FirmwareArtifactLease>
32
32
  func retainFirmwareArtifact(params: FirmwareArtifactLeaseRetainParams) throws -> Promise<Void>
33
33
  func releaseFirmwareArtifactLease(params: FirmwareArtifactLeaseReleaseParams) throws -> Promise<Void>
34
- func reconcileFirmwareArtifactLeases(params: FirmwareArtifactLeaseReconcileParams) throws -> Promise<Void>
35
34
  func sweepFirmwareArtifactOrphans() throws -> Promise<FirmwareArtifactSweepResult>
36
35
  }
37
36
 
@@ -416,25 +416,6 @@ open class HybridReactNativeRangeDownloaderSpec_cxx {
416
416
  }
417
417
  }
418
418
 
419
- @inline(__always)
420
- public final func reconcileFirmwareArtifactLeases(params: FirmwareArtifactLeaseReconcileParams) -> bridge.Result_std__shared_ptr_Promise_void___ {
421
- do {
422
- let __result = try self.__implementation.reconcileFirmwareArtifactLeases(params: params)
423
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
424
- let __promise = bridge.create_std__shared_ptr_Promise_void__()
425
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
426
- __result
427
- .then({ __result in __promiseHolder.resolve() })
428
- .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
429
- return __promise
430
- }()
431
- return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
432
- } catch (let __error) {
433
- let __exceptionPtr = __error.toCpp()
434
- return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
435
- }
436
- }
437
-
438
419
  @inline(__always)
439
420
  public final func sweepFirmwareArtifactOrphans() -> bridge.Result_std__shared_ptr_Promise_FirmwareArtifactSweepResult___ {
440
421
  do {
@@ -29,6 +29,7 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArchiveExp
29
29
  #include <string>
30
30
  #include "FirmwareArchiveExpectedEntry.hpp"
31
31
  #include <vector>
32
+ #include <optional>
32
33
 
33
34
  namespace margelo::nitro::reactnativerangedownloader {
34
35
 
@@ -39,11 +40,11 @@ namespace margelo::nitro::reactnativerangedownloader {
39
40
  public:
40
41
  std::string leaseRef SWIFT_PRIVATE;
41
42
  std::string archiveArtifactRef SWIFT_PRIVATE;
42
- std::vector<FirmwareArchiveExpectedEntry> expectedEntries SWIFT_PRIVATE;
43
+ std::optional<std::vector<FirmwareArchiveExpectedEntry>> expectedEntries SWIFT_PRIVATE;
43
44
 
44
45
  public:
45
46
  FirmwareArchiveMaterializeParams() = default;
46
- explicit FirmwareArchiveMaterializeParams(std::string leaseRef, std::string archiveArtifactRef, std::vector<FirmwareArchiveExpectedEntry> expectedEntries): leaseRef(leaseRef), archiveArtifactRef(archiveArtifactRef), expectedEntries(expectedEntries) {}
47
+ explicit FirmwareArchiveMaterializeParams(std::string leaseRef, std::string archiveArtifactRef, std::optional<std::vector<FirmwareArchiveExpectedEntry>> expectedEntries): leaseRef(leaseRef), archiveArtifactRef(archiveArtifactRef), expectedEntries(expectedEntries) {}
47
48
  };
48
49
 
49
50
  } // namespace margelo::nitro::reactnativerangedownloader
@@ -58,14 +59,14 @@ namespace margelo::nitro {
58
59
  return margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeParams(
59
60
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "leaseRef")),
60
61
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "archiveArtifactRef")),
61
- JSIConverter<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>::fromJSI(runtime, obj.getProperty(runtime, "expectedEntries"))
62
+ JSIConverter<std::optional<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>>::fromJSI(runtime, obj.getProperty(runtime, "expectedEntries"))
62
63
  );
63
64
  }
64
65
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeParams& arg) {
65
66
  jsi::Object obj(runtime);
66
67
  obj.setProperty(runtime, "leaseRef", JSIConverter<std::string>::toJSI(runtime, arg.leaseRef));
67
68
  obj.setProperty(runtime, "archiveArtifactRef", JSIConverter<std::string>::toJSI(runtime, arg.archiveArtifactRef));
68
- obj.setProperty(runtime, "expectedEntries", JSIConverter<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>::toJSI(runtime, arg.expectedEntries));
69
+ obj.setProperty(runtime, "expectedEntries", JSIConverter<std::optional<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>>::toJSI(runtime, arg.expectedEntries));
69
70
  return obj;
70
71
  }
71
72
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -78,7 +79,7 @@ namespace margelo::nitro {
78
79
  }
79
80
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "leaseRef"))) return false;
80
81
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "archiveArtifactRef"))) return false;
81
- if (!JSIConverter<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>::canConvert(runtime, obj.getProperty(runtime, "expectedEntries"))) return false;
82
+ if (!JSIConverter<std::optional<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>>::canConvert(runtime, obj.getProperty(runtime, "expectedEntries"))) return false;
82
83
  return true;
83
84
  }
84
85
  };
@@ -42,14 +42,14 @@ namespace margelo::nitro::reactnativerangedownloader {
42
42
  std::string url SWIFT_PRIVATE;
43
43
  std::string routeType SWIFT_PRIVATE;
44
44
  std::optional<std::string> resolvedIp SWIFT_PRIVATE;
45
- double expectedSize SWIFT_PRIVATE;
46
- std::string expectedSha256 SWIFT_PRIVATE;
45
+ std::optional<double> expectedSize SWIFT_PRIVATE;
46
+ std::optional<std::string> expectedSha256 SWIFT_PRIVATE;
47
47
  double maxBytes SWIFT_PRIVATE;
48
48
  std::optional<double> overallDeadlineSeconds SWIFT_PRIVATE;
49
49
 
50
50
  public:
51
51
  FirmwareArtifactDownloadParams() = default;
52
- explicit FirmwareArtifactDownloadParams(std::string taskId, std::string transactionId, std::string leaseRef, std::string artifactId, std::string url, std::string routeType, std::optional<std::string> resolvedIp, double expectedSize, std::string expectedSha256, double maxBytes, std::optional<double> overallDeadlineSeconds): taskId(taskId), transactionId(transactionId), leaseRef(leaseRef), artifactId(artifactId), url(url), routeType(routeType), resolvedIp(resolvedIp), expectedSize(expectedSize), expectedSha256(expectedSha256), maxBytes(maxBytes), overallDeadlineSeconds(overallDeadlineSeconds) {}
52
+ explicit FirmwareArtifactDownloadParams(std::string taskId, std::string transactionId, std::string leaseRef, std::string artifactId, std::string url, std::string routeType, std::optional<std::string> resolvedIp, std::optional<double> expectedSize, std::optional<std::string> expectedSha256, double maxBytes, std::optional<double> overallDeadlineSeconds): taskId(taskId), transactionId(transactionId), leaseRef(leaseRef), artifactId(artifactId), url(url), routeType(routeType), resolvedIp(resolvedIp), expectedSize(expectedSize), expectedSha256(expectedSha256), maxBytes(maxBytes), overallDeadlineSeconds(overallDeadlineSeconds) {}
53
53
  };
54
54
 
55
55
  } // namespace margelo::nitro::reactnativerangedownloader
@@ -69,8 +69,8 @@ namespace margelo::nitro {
69
69
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "url")),
70
70
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "routeType")),
71
71
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "resolvedIp")),
72
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "expectedSize")),
73
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "expectedSha256")),
72
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "expectedSize")),
73
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "expectedSha256")),
74
74
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "maxBytes")),
75
75
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "overallDeadlineSeconds"))
76
76
  );
@@ -84,8 +84,8 @@ namespace margelo::nitro {
84
84
  obj.setProperty(runtime, "url", JSIConverter<std::string>::toJSI(runtime, arg.url));
85
85
  obj.setProperty(runtime, "routeType", JSIConverter<std::string>::toJSI(runtime, arg.routeType));
86
86
  obj.setProperty(runtime, "resolvedIp", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.resolvedIp));
87
- obj.setProperty(runtime, "expectedSize", JSIConverter<double>::toJSI(runtime, arg.expectedSize));
88
- obj.setProperty(runtime, "expectedSha256", JSIConverter<std::string>::toJSI(runtime, arg.expectedSha256));
87
+ obj.setProperty(runtime, "expectedSize", JSIConverter<std::optional<double>>::toJSI(runtime, arg.expectedSize));
88
+ obj.setProperty(runtime, "expectedSha256", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.expectedSha256));
89
89
  obj.setProperty(runtime, "maxBytes", JSIConverter<double>::toJSI(runtime, arg.maxBytes));
90
90
  obj.setProperty(runtime, "overallDeadlineSeconds", JSIConverter<std::optional<double>>::toJSI(runtime, arg.overallDeadlineSeconds));
91
91
  return obj;
@@ -105,8 +105,8 @@ namespace margelo::nitro {
105
105
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "url"))) return false;
106
106
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "routeType"))) return false;
107
107
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "resolvedIp"))) return false;
108
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "expectedSize"))) return false;
109
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "expectedSha256"))) return false;
108
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "expectedSize"))) return false;
109
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "expectedSha256"))) return false;
110
110
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "maxBytes"))) return false;
111
111
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "overallDeadlineSeconds"))) return false;
112
112
  return true;
@@ -31,7 +31,6 @@ namespace margelo::nitro::reactnativerangedownloader {
31
31
  prototype.registerHybridMethod("createFirmwareArtifactLease", &HybridReactNativeRangeDownloaderSpec::createFirmwareArtifactLease);
32
32
  prototype.registerHybridMethod("retainFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::retainFirmwareArtifact);
33
33
  prototype.registerHybridMethod("releaseFirmwareArtifactLease", &HybridReactNativeRangeDownloaderSpec::releaseFirmwareArtifactLease);
34
- prototype.registerHybridMethod("reconcileFirmwareArtifactLeases", &HybridReactNativeRangeDownloaderSpec::reconcileFirmwareArtifactLeases);
35
34
  prototype.registerHybridMethod("sweepFirmwareArtifactOrphans", &HybridReactNativeRangeDownloaderSpec::sweepFirmwareArtifactOrphans);
36
35
  });
37
36
  }
@@ -49,8 +49,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLe
49
49
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseRetainParams; }
50
50
  // Forward declaration of `FirmwareArtifactLeaseReleaseParams` to properly resolve imports.
51
51
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReleaseParams; }
52
- // Forward declaration of `FirmwareArtifactLeaseReconcileParams` to properly resolve imports.
53
- namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReconcileParams; }
54
52
  // Forward declaration of `FirmwareArtifactSweepResult` to properly resolve imports.
55
53
  namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactSweepResult; }
56
54
 
@@ -76,7 +74,6 @@ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactSw
76
74
  #include "FirmwareArtifactLeaseCreateParams.hpp"
77
75
  #include "FirmwareArtifactLeaseRetainParams.hpp"
78
76
  #include "FirmwareArtifactLeaseReleaseParams.hpp"
79
- #include "FirmwareArtifactLeaseReconcileParams.hpp"
80
77
  #include "FirmwareArtifactSweepResult.hpp"
81
78
 
82
79
  namespace margelo::nitro::reactnativerangedownloader {
@@ -127,7 +124,6 @@ namespace margelo::nitro::reactnativerangedownloader {
127
124
  virtual std::shared_ptr<Promise<FirmwareArtifactLease>> createFirmwareArtifactLease(const FirmwareArtifactLeaseCreateParams& params) = 0;
128
125
  virtual std::shared_ptr<Promise<void>> retainFirmwareArtifact(const FirmwareArtifactLeaseRetainParams& params) = 0;
129
126
  virtual std::shared_ptr<Promise<void>> releaseFirmwareArtifactLease(const FirmwareArtifactLeaseReleaseParams& params) = 0;
130
- virtual std::shared_ptr<Promise<void>> reconcileFirmwareArtifactLeases(const FirmwareArtifactLeaseReconcileParams& params) = 0;
131
127
  virtual std::shared_ptr<Promise<FirmwareArtifactSweepResult>> sweepFirmwareArtifactOrphans() = 0;
132
128
 
133
129
  protected:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-range-downloader",
3
- "version": "3.0.81-alpha.0",
3
+ "version": "3.0.81-alpha.10",
4
4
  "description": "react-native-range-downloader",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -88,7 +88,7 @@
88
88
  "typescript": "^5.9.2"
89
89
  },
90
90
  "peerDependencies": {
91
- "@onekeyfe/react-native-sni-connect": "3.0.81",
91
+ "@onekeyfe/react-native-sni-connect": "3.0.81-alpha.8",
92
92
  "react": "*",
93
93
  "react-native": "*",
94
94
  "react-native-nitro-modules": "0.33.2"