@onekeyfe/react-native-bundle-update 1.1.21

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 (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/ReactNativeBundleUpdate.podspec +34 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +139 -0
  6. package/android/gradle.properties +4 -0
  7. package/android/src/main/AndroidManifest.xml +1 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt +1409 -0
  10. package/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdatePackage.kt +24 -0
  11. package/ios/Frameworks/Gopenpgp.xcframework/Info.plist +52 -0
  12. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Gopenpgp +0 -0
  13. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Armor.objc.h +96 -0
  14. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Constants.objc.h +197 -0
  15. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Crypto.objc.h +1963 -0
  16. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Gopenpgp.h +23 -0
  17. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Mime.objc.h +59 -0
  18. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Mobile.objc.h +252 -0
  19. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Profile.objc.h +107 -0
  20. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Universe.objc.h +29 -0
  21. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/ref.h +35 -0
  22. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Info.plist +20 -0
  23. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Modules/module.modulemap +13 -0
  24. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Gopenpgp +0 -0
  25. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Armor.objc.h +96 -0
  26. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Constants.objc.h +197 -0
  27. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Crypto.objc.h +1963 -0
  28. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Gopenpgp.h +23 -0
  29. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Mime.objc.h +59 -0
  30. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Mobile.objc.h +252 -0
  31. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Profile.objc.h +107 -0
  32. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Universe.objc.h +29 -0
  33. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/ref.h +35 -0
  34. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Info.plist +20 -0
  35. package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Modules/module.modulemap +13 -0
  36. package/ios/ReactNativeBundleUpdate.swift +1338 -0
  37. package/lib/module/ReactNativeBundleUpdate.nitro.js +4 -0
  38. package/lib/module/ReactNativeBundleUpdate.nitro.js.map +1 -0
  39. package/lib/module/index.js +6 -0
  40. package/lib/module/index.js.map +1 -0
  41. package/lib/module/package.json +1 -0
  42. package/lib/typescript/package.json +1 -0
  43. package/lib/typescript/src/ReactNativeBundleUpdate.nitro.d.ts +101 -0
  44. package/lib/typescript/src/ReactNativeBundleUpdate.nitro.d.ts.map +1 -0
  45. package/lib/typescript/src/index.d.ts +4 -0
  46. package/lib/typescript/src/index.d.ts.map +1 -0
  47. package/nitro.json +17 -0
  48. package/nitrogen/generated/android/c++/JAscFileInfo.hpp +65 -0
  49. package/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp +77 -0
  50. package/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp +65 -0
  51. package/nitrogen/generated/android/c++/JBundleDownloadParams.hpp +73 -0
  52. package/nitrogen/generated/android/c++/JBundleDownloadResult.hpp +73 -0
  53. package/nitrogen/generated/android/c++/JBundleInstallParams.hpp +69 -0
  54. package/nitrogen/generated/android/c++/JBundleSwitchParams.hpp +65 -0
  55. package/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp +73 -0
  56. package/nitrogen/generated/android/c++/JBundleVerifyParams.hpp +69 -0
  57. package/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp +65 -0
  58. package/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp +78 -0
  59. package/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp +486 -0
  60. package/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp +89 -0
  61. package/nitrogen/generated/android/c++/JLocalBundleInfo.hpp +61 -0
  62. package/nitrogen/generated/android/c++/JTestResult.hpp +61 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt +44 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt +53 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt +44 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt +50 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt +50 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt +47 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt +44 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt +50 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt +47 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt +44 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt +80 -0
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt +159 -0
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt +41 -0
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt +41 -0
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt +35 -0
  78. package/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake +81 -0
  79. package/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle +27 -0
  80. package/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp +46 -0
  81. package/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp +25 -0
  82. package/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb +60 -0
  83. package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp +113 -0
  84. package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp +513 -0
  85. package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp +83 -0
  86. package/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm +33 -0
  87. package/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift +25 -0
  88. package/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp +11 -0
  89. package/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp +304 -0
  90. package/nitrogen/generated/ios/swift/AscFileInfo.swift +58 -0
  91. package/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift +91 -0
  92. package/nitrogen/generated/ios/swift/BundleDownloadEvent.swift +58 -0
  93. package/nitrogen/generated/ios/swift/BundleDownloadParams.swift +80 -0
  94. package/nitrogen/generated/ios/swift/BundleDownloadResult.swift +80 -0
  95. package/nitrogen/generated/ios/swift/BundleInstallParams.swift +69 -0
  96. package/nitrogen/generated/ios/swift/BundleSwitchParams.swift +58 -0
  97. package/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift +80 -0
  98. package/nitrogen/generated/ios/swift/BundleVerifyParams.swift +69 -0
  99. package/nitrogen/generated/ios/swift/FallbackBundleInfo.swift +58 -0
  100. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  101. package/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift +47 -0
  102. package/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift +47 -0
  103. package/nitrogen/generated/ios/swift/Func_void_TestResult.swift +47 -0
  104. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  105. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  106. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  107. package/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift +47 -0
  108. package/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift +47 -0
  109. package/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift +47 -0
  110. package/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift +80 -0
  111. package/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift +595 -0
  112. package/nitrogen/generated/ios/swift/LocalBundleInfo.swift +47 -0
  113. package/nitrogen/generated/ios/swift/TestResult.swift +47 -0
  114. package/nitrogen/generated/shared/c++/AscFileInfo.hpp +83 -0
  115. package/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp +95 -0
  116. package/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp +83 -0
  117. package/nitrogen/generated/shared/c++/BundleDownloadParams.hpp +91 -0
  118. package/nitrogen/generated/shared/c++/BundleDownloadResult.hpp +91 -0
  119. package/nitrogen/generated/shared/c++/BundleInstallParams.hpp +87 -0
  120. package/nitrogen/generated/shared/c++/BundleSwitchParams.hpp +83 -0
  121. package/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp +91 -0
  122. package/nitrogen/generated/shared/c++/BundleVerifyParams.hpp +87 -0
  123. package/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp +83 -0
  124. package/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp +45 -0
  125. package/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp +124 -0
  126. package/nitrogen/generated/shared/c++/LocalBundleInfo.hpp +79 -0
  127. package/nitrogen/generated/shared/c++/TestResult.hpp +79 -0
  128. package/package.json +169 -0
  129. package/src/ReactNativeBundleUpdate.nitro.ts +143 -0
  130. package/src/index.tsx +8 -0
@@ -0,0 +1,91 @@
1
+ ///
2
+ /// BundleVerifyASCParams.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
+
30
+ namespace margelo::nitro::reactnativebundleupdate {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (BundleVerifyASCParams).
34
+ */
35
+ struct BundleVerifyASCParams {
36
+ public:
37
+ std::string downloadedFile SWIFT_PRIVATE;
38
+ std::string sha256 SWIFT_PRIVATE;
39
+ std::string latestVersion SWIFT_PRIVATE;
40
+ std::string bundleVersion SWIFT_PRIVATE;
41
+ std::string signature SWIFT_PRIVATE;
42
+
43
+ public:
44
+ BundleVerifyASCParams() = default;
45
+ explicit BundleVerifyASCParams(std::string downloadedFile, std::string sha256, std::string latestVersion, std::string bundleVersion, std::string signature): downloadedFile(downloadedFile), sha256(sha256), latestVersion(latestVersion), bundleVersion(bundleVersion), signature(signature) {}
46
+ };
47
+
48
+ } // namespace margelo::nitro::reactnativebundleupdate
49
+
50
+ namespace margelo::nitro {
51
+
52
+ // C++ BundleVerifyASCParams <> JS BundleVerifyASCParams (object)
53
+ template <>
54
+ struct JSIConverter<margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams> final {
55
+ static inline margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
56
+ jsi::Object obj = arg.asObject(runtime);
57
+ return margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams(
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")),
59
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sha256")),
60
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")),
61
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")),
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "signature"))
63
+ );
64
+ }
65
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams& arg) {
66
+ jsi::Object obj(runtime);
67
+ obj.setProperty(runtime, "downloadedFile", JSIConverter<std::string>::toJSI(runtime, arg.downloadedFile));
68
+ obj.setProperty(runtime, "sha256", JSIConverter<std::string>::toJSI(runtime, arg.sha256));
69
+ obj.setProperty(runtime, "latestVersion", JSIConverter<std::string>::toJSI(runtime, arg.latestVersion));
70
+ obj.setProperty(runtime, "bundleVersion", JSIConverter<std::string>::toJSI(runtime, arg.bundleVersion));
71
+ obj.setProperty(runtime, "signature", JSIConverter<std::string>::toJSI(runtime, arg.signature));
72
+ return obj;
73
+ }
74
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
75
+ if (!value.isObject()) {
76
+ return false;
77
+ }
78
+ jsi::Object obj = value.getObject(runtime);
79
+ if (!nitro::isPlainObject(runtime, obj)) {
80
+ return false;
81
+ }
82
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false;
83
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false;
84
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false;
85
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false;
86
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false;
87
+ return true;
88
+ }
89
+ };
90
+
91
+ } // namespace margelo::nitro
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// BundleVerifyParams.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
+
30
+ namespace margelo::nitro::reactnativebundleupdate {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (BundleVerifyParams).
34
+ */
35
+ struct BundleVerifyParams {
36
+ public:
37
+ std::string downloadedFile SWIFT_PRIVATE;
38
+ std::string sha256 SWIFT_PRIVATE;
39
+ std::string latestVersion SWIFT_PRIVATE;
40
+ std::string bundleVersion SWIFT_PRIVATE;
41
+
42
+ public:
43
+ BundleVerifyParams() = default;
44
+ explicit BundleVerifyParams(std::string downloadedFile, std::string sha256, std::string latestVersion, std::string bundleVersion): downloadedFile(downloadedFile), sha256(sha256), latestVersion(latestVersion), bundleVersion(bundleVersion) {}
45
+ };
46
+
47
+ } // namespace margelo::nitro::reactnativebundleupdate
48
+
49
+ namespace margelo::nitro {
50
+
51
+ // C++ BundleVerifyParams <> JS BundleVerifyParams (object)
52
+ template <>
53
+ struct JSIConverter<margelo::nitro::reactnativebundleupdate::BundleVerifyParams> final {
54
+ static inline margelo::nitro::reactnativebundleupdate::BundleVerifyParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ jsi::Object obj = arg.asObject(runtime);
56
+ return margelo::nitro::reactnativebundleupdate::BundleVerifyParams(
57
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")),
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sha256")),
59
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")),
60
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion"))
61
+ );
62
+ }
63
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleVerifyParams& arg) {
64
+ jsi::Object obj(runtime);
65
+ obj.setProperty(runtime, "downloadedFile", JSIConverter<std::string>::toJSI(runtime, arg.downloadedFile));
66
+ obj.setProperty(runtime, "sha256", JSIConverter<std::string>::toJSI(runtime, arg.sha256));
67
+ obj.setProperty(runtime, "latestVersion", JSIConverter<std::string>::toJSI(runtime, arg.latestVersion));
68
+ obj.setProperty(runtime, "bundleVersion", JSIConverter<std::string>::toJSI(runtime, arg.bundleVersion));
69
+ return obj;
70
+ }
71
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
72
+ if (!value.isObject()) {
73
+ return false;
74
+ }
75
+ jsi::Object obj = value.getObject(runtime);
76
+ if (!nitro::isPlainObject(runtime, obj)) {
77
+ return false;
78
+ }
79
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false;
80
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false;
81
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false;
82
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FallbackBundleInfo.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
+
30
+ namespace margelo::nitro::reactnativebundleupdate {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FallbackBundleInfo).
34
+ */
35
+ struct FallbackBundleInfo {
36
+ public:
37
+ std::string appVersion SWIFT_PRIVATE;
38
+ std::string bundleVersion SWIFT_PRIVATE;
39
+ std::string signature SWIFT_PRIVATE;
40
+
41
+ public:
42
+ FallbackBundleInfo() = default;
43
+ explicit FallbackBundleInfo(std::string appVersion, std::string bundleVersion, std::string signature): appVersion(appVersion), bundleVersion(bundleVersion), signature(signature) {}
44
+ };
45
+
46
+ } // namespace margelo::nitro::reactnativebundleupdate
47
+
48
+ namespace margelo::nitro {
49
+
50
+ // C++ FallbackBundleInfo <> JS FallbackBundleInfo (object)
51
+ template <>
52
+ struct JSIConverter<margelo::nitro::reactnativebundleupdate::FallbackBundleInfo> final {
53
+ static inline margelo::nitro::reactnativebundleupdate::FallbackBundleInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ jsi::Object obj = arg.asObject(runtime);
55
+ return margelo::nitro::reactnativebundleupdate::FallbackBundleInfo(
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "appVersion")),
57
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")),
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "signature"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::FallbackBundleInfo& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "appVersion", JSIConverter<std::string>::toJSI(runtime, arg.appVersion));
64
+ obj.setProperty(runtime, "bundleVersion", JSIConverter<std::string>::toJSI(runtime, arg.bundleVersion));
65
+ obj.setProperty(runtime, "signature", JSIConverter<std::string>::toJSI(runtime, arg.signature));
66
+ return obj;
67
+ }
68
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
69
+ if (!value.isObject()) {
70
+ return false;
71
+ }
72
+ jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
76
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "appVersion"))) return false;
77
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false;
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro
@@ -0,0 +1,45 @@
1
+ ///
2
+ /// HybridReactNativeBundleUpdateSpec.cpp
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
+ #include "HybridReactNativeBundleUpdateSpec.hpp"
9
+
10
+ namespace margelo::nitro::reactnativebundleupdate {
11
+
12
+ void HybridReactNativeBundleUpdateSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridMethod("downloadBundle", &HybridReactNativeBundleUpdateSpec::downloadBundle);
18
+ prototype.registerHybridMethod("verifyBundle", &HybridReactNativeBundleUpdateSpec::verifyBundle);
19
+ prototype.registerHybridMethod("verifyBundleASC", &HybridReactNativeBundleUpdateSpec::verifyBundleASC);
20
+ prototype.registerHybridMethod("downloadBundleASC", &HybridReactNativeBundleUpdateSpec::downloadBundleASC);
21
+ prototype.registerHybridMethod("installBundle", &HybridReactNativeBundleUpdateSpec::installBundle);
22
+ prototype.registerHybridMethod("clearBundle", &HybridReactNativeBundleUpdateSpec::clearBundle);
23
+ prototype.registerHybridMethod("clearAllJSBundleData", &HybridReactNativeBundleUpdateSpec::clearAllJSBundleData);
24
+ prototype.registerHybridMethod("getFallbackUpdateBundleData", &HybridReactNativeBundleUpdateSpec::getFallbackUpdateBundleData);
25
+ prototype.registerHybridMethod("setCurrentUpdateBundleData", &HybridReactNativeBundleUpdateSpec::setCurrentUpdateBundleData);
26
+ prototype.registerHybridMethod("getWebEmbedPath", &HybridReactNativeBundleUpdateSpec::getWebEmbedPath);
27
+ prototype.registerHybridMethod("getWebEmbedPathAsync", &HybridReactNativeBundleUpdateSpec::getWebEmbedPathAsync);
28
+ prototype.registerHybridMethod("getJsBundlePath", &HybridReactNativeBundleUpdateSpec::getJsBundlePath);
29
+ prototype.registerHybridMethod("getNativeAppVersion", &HybridReactNativeBundleUpdateSpec::getNativeAppVersion);
30
+ prototype.registerHybridMethod("testVerification", &HybridReactNativeBundleUpdateSpec::testVerification);
31
+ prototype.registerHybridMethod("isBundleExists", &HybridReactNativeBundleUpdateSpec::isBundleExists);
32
+ prototype.registerHybridMethod("verifyExtractedBundle", &HybridReactNativeBundleUpdateSpec::verifyExtractedBundle);
33
+ prototype.registerHybridMethod("listLocalBundles", &HybridReactNativeBundleUpdateSpec::listLocalBundles);
34
+ prototype.registerHybridMethod("listAscFiles", &HybridReactNativeBundleUpdateSpec::listAscFiles);
35
+ prototype.registerHybridMethod("getSha256FromFilePath", &HybridReactNativeBundleUpdateSpec::getSha256FromFilePath);
36
+ prototype.registerHybridMethod("testDeleteJsBundle", &HybridReactNativeBundleUpdateSpec::testDeleteJsBundle);
37
+ prototype.registerHybridMethod("testDeleteJsRuntimeDir", &HybridReactNativeBundleUpdateSpec::testDeleteJsRuntimeDir);
38
+ prototype.registerHybridMethod("testDeleteMetadataJson", &HybridReactNativeBundleUpdateSpec::testDeleteMetadataJson);
39
+ prototype.registerHybridMethod("testWriteEmptyMetadataJson", &HybridReactNativeBundleUpdateSpec::testWriteEmptyMetadataJson);
40
+ prototype.registerHybridMethod("addDownloadListener", &HybridReactNativeBundleUpdateSpec::addDownloadListener);
41
+ prototype.registerHybridMethod("removeDownloadListener", &HybridReactNativeBundleUpdateSpec::removeDownloadListener);
42
+ });
43
+ }
44
+
45
+ } // namespace margelo::nitro::reactnativebundleupdate
@@ -0,0 +1,124 @@
1
+ ///
2
+ /// HybridReactNativeBundleUpdateSpec.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/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+ // Forward declaration of `BundleDownloadResult` to properly resolve imports.
17
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; }
18
+ // Forward declaration of `BundleDownloadParams` to properly resolve imports.
19
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadParams; }
20
+ // Forward declaration of `BundleVerifyParams` to properly resolve imports.
21
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyParams; }
22
+ // Forward declaration of `BundleVerifyASCParams` to properly resolve imports.
23
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyASCParams; }
24
+ // Forward declaration of `BundleDownloadASCParams` to properly resolve imports.
25
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadASCParams; }
26
+ // Forward declaration of `BundleInstallParams` to properly resolve imports.
27
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleInstallParams; }
28
+ // Forward declaration of `TestResult` to properly resolve imports.
29
+ namespace margelo::nitro::reactnativebundleupdate { struct TestResult; }
30
+ // Forward declaration of `FallbackBundleInfo` to properly resolve imports.
31
+ namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; }
32
+ // Forward declaration of `BundleSwitchParams` to properly resolve imports.
33
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleSwitchParams; }
34
+ // Forward declaration of `LocalBundleInfo` to properly resolve imports.
35
+ namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; }
36
+ // Forward declaration of `AscFileInfo` to properly resolve imports.
37
+ namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; }
38
+ // Forward declaration of `BundleDownloadEvent` to properly resolve imports.
39
+ namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; }
40
+
41
+ #include "BundleDownloadResult.hpp"
42
+ #include <NitroModules/Promise.hpp>
43
+ #include "BundleDownloadParams.hpp"
44
+ #include "BundleVerifyParams.hpp"
45
+ #include "BundleVerifyASCParams.hpp"
46
+ #include "BundleDownloadASCParams.hpp"
47
+ #include "BundleInstallParams.hpp"
48
+ #include "TestResult.hpp"
49
+ #include "FallbackBundleInfo.hpp"
50
+ #include <vector>
51
+ #include "BundleSwitchParams.hpp"
52
+ #include <string>
53
+ #include "LocalBundleInfo.hpp"
54
+ #include "AscFileInfo.hpp"
55
+ #include "BundleDownloadEvent.hpp"
56
+ #include <functional>
57
+
58
+ namespace margelo::nitro::reactnativebundleupdate {
59
+
60
+ using namespace margelo::nitro;
61
+
62
+ /**
63
+ * An abstract base class for `ReactNativeBundleUpdate`
64
+ * Inherit this class to create instances of `HybridReactNativeBundleUpdateSpec` in C++.
65
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
66
+ * @example
67
+ * ```cpp
68
+ * class HybridReactNativeBundleUpdate: public HybridReactNativeBundleUpdateSpec {
69
+ * public:
70
+ * HybridReactNativeBundleUpdate(...): HybridObject(TAG) { ... }
71
+ * // ...
72
+ * };
73
+ * ```
74
+ */
75
+ class HybridReactNativeBundleUpdateSpec: public virtual HybridObject {
76
+ public:
77
+ // Constructor
78
+ explicit HybridReactNativeBundleUpdateSpec(): HybridObject(TAG) { }
79
+
80
+ // Destructor
81
+ ~HybridReactNativeBundleUpdateSpec() override = default;
82
+
83
+ public:
84
+ // Properties
85
+
86
+
87
+ public:
88
+ // Methods
89
+ virtual std::shared_ptr<Promise<BundleDownloadResult>> downloadBundle(const BundleDownloadParams& params) = 0;
90
+ virtual std::shared_ptr<Promise<void>> verifyBundle(const BundleVerifyParams& params) = 0;
91
+ virtual std::shared_ptr<Promise<void>> verifyBundleASC(const BundleVerifyASCParams& params) = 0;
92
+ virtual std::shared_ptr<Promise<void>> downloadBundleASC(const BundleDownloadASCParams& params) = 0;
93
+ virtual std::shared_ptr<Promise<void>> installBundle(const BundleInstallParams& params) = 0;
94
+ virtual std::shared_ptr<Promise<void>> clearBundle() = 0;
95
+ virtual std::shared_ptr<Promise<TestResult>> clearAllJSBundleData() = 0;
96
+ virtual std::shared_ptr<Promise<std::vector<FallbackBundleInfo>>> getFallbackUpdateBundleData() = 0;
97
+ virtual std::shared_ptr<Promise<void>> setCurrentUpdateBundleData(const BundleSwitchParams& params) = 0;
98
+ virtual std::string getWebEmbedPath() = 0;
99
+ virtual std::shared_ptr<Promise<std::string>> getWebEmbedPathAsync() = 0;
100
+ virtual std::shared_ptr<Promise<std::string>> getJsBundlePath() = 0;
101
+ virtual std::shared_ptr<Promise<std::string>> getNativeAppVersion() = 0;
102
+ virtual std::shared_ptr<Promise<bool>> testVerification() = 0;
103
+ virtual std::shared_ptr<Promise<bool>> isBundleExists(const std::string& appVersion, const std::string& bundleVersion) = 0;
104
+ virtual std::shared_ptr<Promise<void>> verifyExtractedBundle(const std::string& appVersion, const std::string& bundleVersion) = 0;
105
+ virtual std::shared_ptr<Promise<std::vector<LocalBundleInfo>>> listLocalBundles() = 0;
106
+ virtual std::shared_ptr<Promise<std::vector<AscFileInfo>>> listAscFiles() = 0;
107
+ virtual std::shared_ptr<Promise<std::string>> getSha256FromFilePath(const std::string& filePath) = 0;
108
+ virtual std::shared_ptr<Promise<TestResult>> testDeleteJsBundle(const std::string& appVersion, const std::string& bundleVersion) = 0;
109
+ virtual std::shared_ptr<Promise<TestResult>> testDeleteJsRuntimeDir(const std::string& appVersion, const std::string& bundleVersion) = 0;
110
+ virtual std::shared_ptr<Promise<TestResult>> testDeleteMetadataJson(const std::string& appVersion, const std::string& bundleVersion) = 0;
111
+ virtual std::shared_ptr<Promise<TestResult>> testWriteEmptyMetadataJson(const std::string& appVersion, const std::string& bundleVersion) = 0;
112
+ virtual double addDownloadListener(const std::function<void(const BundleDownloadEvent& /* event */)>& callback) = 0;
113
+ virtual void removeDownloadListener(double id) = 0;
114
+
115
+ protected:
116
+ // Hybrid Setup
117
+ void loadHybridMethods() override;
118
+
119
+ protected:
120
+ // Tag for logging
121
+ static constexpr auto TAG = "ReactNativeBundleUpdate";
122
+ };
123
+
124
+ } // namespace margelo::nitro::reactnativebundleupdate
@@ -0,0 +1,79 @@
1
+ ///
2
+ /// LocalBundleInfo.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
+
30
+ namespace margelo::nitro::reactnativebundleupdate {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (LocalBundleInfo).
34
+ */
35
+ struct LocalBundleInfo {
36
+ public:
37
+ std::string appVersion SWIFT_PRIVATE;
38
+ std::string bundleVersion SWIFT_PRIVATE;
39
+
40
+ public:
41
+ LocalBundleInfo() = default;
42
+ explicit LocalBundleInfo(std::string appVersion, std::string bundleVersion): appVersion(appVersion), bundleVersion(bundleVersion) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::reactnativebundleupdate
46
+
47
+ namespace margelo::nitro {
48
+
49
+ // C++ LocalBundleInfo <> JS LocalBundleInfo (object)
50
+ template <>
51
+ struct JSIConverter<margelo::nitro::reactnativebundleupdate::LocalBundleInfo> final {
52
+ static inline margelo::nitro::reactnativebundleupdate::LocalBundleInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ jsi::Object obj = arg.asObject(runtime);
54
+ return margelo::nitro::reactnativebundleupdate::LocalBundleInfo(
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "appVersion")),
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::LocalBundleInfo& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "appVersion", JSIConverter<std::string>::toJSI(runtime, arg.appVersion));
62
+ obj.setProperty(runtime, "bundleVersion", JSIConverter<std::string>::toJSI(runtime, arg.bundleVersion));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
73
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "appVersion"))) return false;
74
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false;
75
+ return true;
76
+ }
77
+ };
78
+
79
+ } // namespace margelo::nitro
@@ -0,0 +1,79 @@
1
+ ///
2
+ /// TestResult.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
+
30
+ namespace margelo::nitro::reactnativebundleupdate {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (TestResult).
34
+ */
35
+ struct TestResult {
36
+ public:
37
+ bool success SWIFT_PRIVATE;
38
+ std::string message SWIFT_PRIVATE;
39
+
40
+ public:
41
+ TestResult() = default;
42
+ explicit TestResult(bool success, std::string message): success(success), message(message) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::reactnativebundleupdate
46
+
47
+ namespace margelo::nitro {
48
+
49
+ // C++ TestResult <> JS TestResult (object)
50
+ template <>
51
+ struct JSIConverter<margelo::nitro::reactnativebundleupdate::TestResult> final {
52
+ static inline margelo::nitro::reactnativebundleupdate::TestResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ jsi::Object obj = arg.asObject(runtime);
54
+ return margelo::nitro::reactnativebundleupdate::TestResult(
55
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "success")),
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "message"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::TestResult& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "success", JSIConverter<bool>::toJSI(runtime, arg.success));
62
+ obj.setProperty(runtime, "message", JSIConverter<std::string>::toJSI(runtime, arg.message));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
73
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "success"))) return false;
74
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "message"))) return false;
75
+ return true;
76
+ }
77
+ };
78
+
79
+ } // namespace margelo::nitro