@onekeyfe/react-native-range-downloader 3.0.81-alpha.1 → 3.0.81-alpha.11

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 (43) hide show
  1. package/ReactNativeRangeDownloader.podspec +1 -2
  2. package/android/build.gradle +0 -1
  3. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRules.kt +12 -5
  4. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactOrphanSweep.kt +111 -0
  5. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactStore.kt +194 -214
  6. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/ReactNativeRangeDownloader.kt +21 -21
  7. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRulesTest.kt +39 -0
  8. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDeadlineTest.kt +26 -0
  9. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactOrphanSweepTest.kt +107 -0
  10. package/ios/FirmwareArtifactStore.swift +667 -435
  11. package/ios/RangeDownloadLogic.swift +317 -0
  12. package/ios/ReactNativeRangeDownloader.swift +60 -484
  13. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts +4 -7
  14. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts.map +1 -1
  15. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializeParams.hpp +7 -6
  16. package/nitrogen/generated/android/c++/JFirmwareArtifactDownloadParams.hpp +7 -7
  17. package/nitrogen/generated/android/c++/JFirmwareArtifactReceipt.hpp +7 -3
  18. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.cpp +0 -19
  19. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.hpp +0 -1
  20. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializeParams.kt +2 -2
  21. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDownloadParams.kt +3 -3
  22. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReceipt.kt +6 -3
  23. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/HybridReactNativeRangeDownloaderSpec.kt +0 -4
  24. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Bridge.hpp +15 -0
  25. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Umbrella.hpp +0 -3
  26. package/nitrogen/generated/ios/c++/HybridReactNativeRangeDownloaderSpecSwift.hpp +0 -11
  27. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializeParams.swift +32 -13
  28. package/nitrogen/generated/ios/swift/FirmwareArtifactDownloadParams.swift +39 -8
  29. package/nitrogen/generated/ios/swift/FirmwareArtifactReceipt.swift +13 -2
  30. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec.swift +0 -1
  31. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec_cxx.swift +0 -19
  32. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializeParams.hpp +6 -5
  33. package/nitrogen/generated/shared/c++/FirmwareArtifactDownloadParams.hpp +9 -9
  34. package/nitrogen/generated/shared/c++/FirmwareArtifactReceipt.hpp +6 -2
  35. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.cpp +0 -1
  36. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.hpp +0 -4
  37. package/package.json +1 -2
  38. package/src/ReactNativeRangeDownloader.nitro.ts +7 -11
  39. package/ios/FirmwareBackgroundSessionEventRouter.swift +0 -17
  40. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseReconcileParams.hpp +0 -76
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseReconcileParams.kt +0 -38
  42. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseReconcileParams.swift +0 -48
  43. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseReconcileParams.hpp +0 -76
@@ -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;
@@ -37,10 +37,11 @@ namespace margelo::nitro::reactnativerangedownloader {
37
37
  std::string artifactRef SWIFT_PRIVATE;
38
38
  double size SWIFT_PRIVATE;
39
39
  std::string sha256 SWIFT_PRIVATE;
40
+ bool expectedSha256Verified SWIFT_PRIVATE;
40
41
 
41
42
  public:
42
43
  FirmwareArtifactReceipt() = default;
43
- explicit FirmwareArtifactReceipt(std::string artifactRef, double size, std::string sha256): artifactRef(artifactRef), size(size), sha256(sha256) {}
44
+ explicit FirmwareArtifactReceipt(std::string artifactRef, double size, std::string sha256, bool expectedSha256Verified): artifactRef(artifactRef), size(size), sha256(sha256), expectedSha256Verified(expectedSha256Verified) {}
44
45
  };
45
46
 
46
47
  } // namespace margelo::nitro::reactnativerangedownloader
@@ -55,7 +56,8 @@ namespace margelo::nitro {
55
56
  return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt(
56
57
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "artifactRef")),
57
58
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "size")),
58
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sha256"))
59
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sha256")),
60
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "expectedSha256Verified"))
59
61
  );
60
62
  }
61
63
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt& arg) {
@@ -63,6 +65,7 @@ namespace margelo::nitro {
63
65
  obj.setProperty(runtime, "artifactRef", JSIConverter<std::string>::toJSI(runtime, arg.artifactRef));
64
66
  obj.setProperty(runtime, "size", JSIConverter<double>::toJSI(runtime, arg.size));
65
67
  obj.setProperty(runtime, "sha256", JSIConverter<std::string>::toJSI(runtime, arg.sha256));
68
+ obj.setProperty(runtime, "expectedSha256Verified", JSIConverter<bool>::toJSI(runtime, arg.expectedSha256Verified));
66
69
  return obj;
67
70
  }
68
71
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -76,6 +79,7 @@ namespace margelo::nitro {
76
79
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "artifactRef"))) return false;
77
80
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "size"))) return false;
78
81
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false;
82
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "expectedSha256Verified"))) return false;
79
83
  return true;
80
84
  }
81
85
  };
@@ -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.1",
3
+ "version": "3.0.81-alpha.11",
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,6 @@
88
88
  "typescript": "^5.9.2"
89
89
  },
90
90
  "peerDependencies": {
91
- "@onekeyfe/react-native-sni-connect": "3.0.81-alpha.1",
92
91
  "react": "*",
93
92
  "react-native": "*",
94
93
  "react-native-nitro-modules": "0.33.2"
@@ -76,16 +76,19 @@ export interface FirmwareArtifactDownloadParams {
76
76
  url: string;
77
77
  routeType: string;
78
78
  resolvedIp?: string;
79
- expectedSize: number;
80
- expectedSha256: string;
79
+ expectedSize?: number;
80
+ expectedSha256?: string;
81
81
  maxBytes: number;
82
- overallDeadlineSeconds?: number;
82
+ overallDeadlineSeconds?: number; // defaults to 180; must be > 0 and <= 24 hours
83
83
  }
84
84
 
85
85
  export interface FirmwareArtifactReceipt {
86
86
  artifactRef: string;
87
87
  size: number;
88
88
  sha256: string;
89
+ // True only when sha256 was compared with expectedSha256 supplied by the caller.
90
+ // A locally computed content-address digest without that expectation is not trusted integrity.
91
+ expectedSha256Verified: boolean;
89
92
  }
90
93
 
91
94
  export interface FirmwareArtifactCapabilities {
@@ -121,7 +124,7 @@ export interface FirmwareArtifactReaderCloseParams {
121
124
  export interface FirmwareArchiveMaterializeParams {
122
125
  leaseRef: string;
123
126
  archiveArtifactRef: string;
124
- expectedEntries: FirmwareArchiveExpectedEntry[];
127
+ expectedEntries?: FirmwareArchiveExpectedEntry[];
125
128
  }
126
129
 
127
130
  export interface FirmwareArchiveExpectedEntry {
@@ -158,10 +161,6 @@ export interface FirmwareArtifactLeaseReleaseParams {
158
161
  disposition: string;
159
162
  }
160
163
 
161
- export interface FirmwareArtifactLeaseReconcileParams {
162
- activeLeaseRefs: string[];
163
- }
164
-
165
164
  export interface FirmwareArtifactSweepResult {
166
165
  deletedFiles: number;
167
166
  deletedBytes: number;
@@ -231,8 +230,5 @@ export interface ReactNativeRangeDownloader
231
230
  releaseFirmwareArtifactLease(
232
231
  params: FirmwareArtifactLeaseReleaseParams
233
232
  ): Promise<void>;
234
- reconcileFirmwareArtifactLeases(
235
- params: FirmwareArtifactLeaseReconcileParams
236
- ): Promise<void>;
237
233
  sweepFirmwareArtifactOrphans(): Promise<FirmwareArtifactSweepResult>;
238
234
  }
@@ -1,17 +0,0 @@
1
- import Foundation
2
-
3
- @objc(FirmwareBackgroundSessionEventRouter)
4
- public final class FirmwareBackgroundSessionEventRouter: NSObject {
5
- @objc(routeEventsForBackgroundURLSession:completionHandler:)
6
- public static func routeEvents(
7
- forBackgroundURLSession identifier: String,
8
- completionHandler: @escaping () -> Void
9
- ) -> NSNumber {
10
- NSNumber(
11
- value: RangeDownloader.routeFirmwareBackgroundEvents(
12
- identifier: identifier,
13
- completionHandler: completionHandler
14
- )
15
- )
16
- }
17
- }
@@ -1,76 +0,0 @@
1
- ///
2
- /// JFirmwareArtifactLeaseReconcileParams.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #include <fbjni/fbjni.h>
11
- #include "FirmwareArtifactLeaseReconcileParams.hpp"
12
-
13
- #include <string>
14
- #include <vector>
15
-
16
- namespace margelo::nitro::reactnativerangedownloader {
17
-
18
- using namespace facebook;
19
-
20
- /**
21
- * The C++ JNI bridge between the C++ struct "FirmwareArtifactLeaseReconcileParams" and the the Kotlin data class "FirmwareArtifactLeaseReconcileParams".
22
- */
23
- struct JFirmwareArtifactLeaseReconcileParams final: public jni::JavaClass<JFirmwareArtifactLeaseReconcileParams> {
24
- public:
25
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseReconcileParams;";
26
-
27
- public:
28
- /**
29
- * Convert this Java/Kotlin-based struct to the C++ struct FirmwareArtifactLeaseReconcileParams by copying all values to C++.
30
- */
31
- [[maybe_unused]]
32
- [[nodiscard]]
33
- FirmwareArtifactLeaseReconcileParams toCpp() const {
34
- static const auto clazz = javaClassStatic();
35
- static const auto fieldActiveLeaseRefs = clazz->getField<jni::JArrayClass<jni::JString>>("activeLeaseRefs");
36
- jni::local_ref<jni::JArrayClass<jni::JString>> activeLeaseRefs = this->getFieldValue(fieldActiveLeaseRefs);
37
- return FirmwareArtifactLeaseReconcileParams(
38
- [&]() {
39
- size_t __size = activeLeaseRefs->size();
40
- std::vector<std::string> __vector;
41
- __vector.reserve(__size);
42
- for (size_t __i = 0; __i < __size; __i++) {
43
- auto __element = activeLeaseRefs->getElement(__i);
44
- __vector.push_back(__element->toStdString());
45
- }
46
- return __vector;
47
- }()
48
- );
49
- }
50
-
51
- public:
52
- /**
53
- * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
54
- */
55
- [[maybe_unused]]
56
- static jni::local_ref<JFirmwareArtifactLeaseReconcileParams::javaobject> fromCpp(const FirmwareArtifactLeaseReconcileParams& value) {
57
- using JSignature = JFirmwareArtifactLeaseReconcileParams(jni::alias_ref<jni::JArrayClass<jni::JString>>);
58
- static const auto clazz = javaClassStatic();
59
- static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
60
- return create(
61
- clazz,
62
- [&]() {
63
- size_t __size = value.activeLeaseRefs.size();
64
- jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
65
- for (size_t __i = 0; __i < __size; __i++) {
66
- const auto& __element = value.activeLeaseRefs[__i];
67
- auto __elementJni = jni::make_jstring(__element);
68
- __array->setElement(__i, *__elementJni);
69
- }
70
- return __array;
71
- }()
72
- );
73
- }
74
- };
75
-
76
- } // namespace margelo::nitro::reactnativerangedownloader
@@ -1,38 +0,0 @@
1
- ///
2
- /// FirmwareArtifactLeaseReconcileParams.kt
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
6
- ///
7
-
8
- package com.margelo.nitro.reactnativerangedownloader
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.proguard.annotations.DoNotStrip
12
-
13
-
14
- /**
15
- * Represents the JavaScript object/struct "FirmwareArtifactLeaseReconcileParams".
16
- */
17
- @DoNotStrip
18
- @Keep
19
- data class FirmwareArtifactLeaseReconcileParams(
20
- @DoNotStrip
21
- @Keep
22
- val activeLeaseRefs: Array<String>
23
- ) {
24
- /* primary constructor */
25
-
26
- private companion object {
27
- /**
28
- * Constructor called from C++
29
- */
30
- @DoNotStrip
31
- @Keep
32
- @Suppress("unused")
33
- @JvmStatic
34
- private fun fromCpp(activeLeaseRefs: Array<String>): FirmwareArtifactLeaseReconcileParams {
35
- return FirmwareArtifactLeaseReconcileParams(activeLeaseRefs)
36
- }
37
- }
38
- }
@@ -1,48 +0,0 @@
1
- ///
2
- /// FirmwareArtifactLeaseReconcileParams.swift
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
6
- ///
7
-
8
- import Foundation
9
- import NitroModules
10
-
11
- /**
12
- * Represents an instance of `FirmwareArtifactLeaseReconcileParams`, backed by a C++ struct.
13
- */
14
- public typealias FirmwareArtifactLeaseReconcileParams = margelo.nitro.reactnativerangedownloader.FirmwareArtifactLeaseReconcileParams
15
-
16
- public extension FirmwareArtifactLeaseReconcileParams {
17
- private typealias bridge = margelo.nitro.reactnativerangedownloader.bridge.swift
18
-
19
- /**
20
- * Create a new instance of `FirmwareArtifactLeaseReconcileParams`.
21
- */
22
- init(activeLeaseRefs: [String]) {
23
- self.init({ () -> bridge.std__vector_std__string_ in
24
- var __vector = bridge.create_std__vector_std__string_(activeLeaseRefs.count)
25
- for __item in activeLeaseRefs {
26
- __vector.push_back(std.string(__item))
27
- }
28
- return __vector
29
- }())
30
- }
31
-
32
- var activeLeaseRefs: [String] {
33
- @inline(__always)
34
- get {
35
- return self.__activeLeaseRefs.map({ __item in String(__item) })
36
- }
37
- @inline(__always)
38
- set {
39
- self.__activeLeaseRefs = { () -> bridge.std__vector_std__string_ in
40
- var __vector = bridge.create_std__vector_std__string_(newValue.count)
41
- for __item in newValue {
42
- __vector.push_back(std.string(__item))
43
- }
44
- return __vector
45
- }()
46
- }
47
- }
48
- }
@@ -1,76 +0,0 @@
1
- ///
2
- /// FirmwareArtifactLeaseReconcileParams.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #if __has_include(<NitroModules/JSIConverter.hpp>)
11
- #include <NitroModules/JSIConverter.hpp>
12
- #else
13
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
- #endif
15
- #if __has_include(<NitroModules/NitroDefines.hpp>)
16
- #include <NitroModules/NitroDefines.hpp>
17
- #else
18
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
- #endif
20
- #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
- #include <NitroModules/JSIHelpers.hpp>
22
- #else
23
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
- #endif
25
-
26
-
27
-
28
- #include <string>
29
- #include <vector>
30
-
31
- namespace margelo::nitro::reactnativerangedownloader {
32
-
33
- /**
34
- * A struct which can be represented as a JavaScript object (FirmwareArtifactLeaseReconcileParams).
35
- */
36
- struct FirmwareArtifactLeaseReconcileParams {
37
- public:
38
- std::vector<std::string> activeLeaseRefs SWIFT_PRIVATE;
39
-
40
- public:
41
- FirmwareArtifactLeaseReconcileParams() = default;
42
- explicit FirmwareArtifactLeaseReconcileParams(std::vector<std::string> activeLeaseRefs): activeLeaseRefs(activeLeaseRefs) {}
43
- };
44
-
45
- } // namespace margelo::nitro::reactnativerangedownloader
46
-
47
- namespace margelo::nitro {
48
-
49
- // C++ FirmwareArtifactLeaseReconcileParams <> JS FirmwareArtifactLeaseReconcileParams (object)
50
- template <>
51
- struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReconcileParams> final {
52
- static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReconcileParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
- jsi::Object obj = arg.asObject(runtime);
54
- return margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReconcileParams(
55
- JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "activeLeaseRefs"))
56
- );
57
- }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReconcileParams& arg) {
59
- jsi::Object obj(runtime);
60
- obj.setProperty(runtime, "activeLeaseRefs", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.activeLeaseRefs));
61
- return obj;
62
- }
63
- static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
64
- if (!value.isObject()) {
65
- return false;
66
- }
67
- jsi::Object obj = value.getObject(runtime);
68
- if (!nitro::isPlainObject(runtime, obj)) {
69
- return false;
70
- }
71
- if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "activeLeaseRefs"))) return false;
72
- return true;
73
- }
74
- };
75
-
76
- } // namespace margelo::nitro