@procivis/react-native-one-core 1.33398.0 → 1.43299.1

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 (167) hide show
  1. package/README.md +8 -26
  2. package/android/build.gradle +27 -3
  3. package/android/build.gradle_opensource +121 -0
  4. package/android/libs/core-reactnative-compatible-2025.0305.1.aar +0 -0
  5. package/android/src/main/AndroidManifest.xml +5 -2
  6. package/android/src/main/java/ch/procivis/one/core/Deserialize.kt +5 -5
  7. package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +4 -3
  8. package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +136 -16
  9. package/android/src/main/java/ch/procivis/one/core/ProcivisOneCorePackage.kt +3 -4
  10. package/android/src/main/java/ch/procivis/one/core/Serialize.kt +3 -1
  11. package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +19 -0
  12. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadRunner.kt +123 -0
  13. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt +23 -0
  14. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt_opensource +20 -0
  15. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadWrapper.kt +396 -0
  16. package/android/src/main/java/ch/procivis/one/core/ubiqu/RegistrationManager.kt +59 -0
  17. package/android/src/main/java/ch/procivis/one/core/ubiqu/TokenManager.kt +48 -0
  18. package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +256 -0
  19. package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +51 -0
  20. package/android/src/main/java/ch/procivis/one/core/ubiqu/Util.kt +74 -0
  21. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityRequest.kt +9 -0
  22. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityResponse.kt +9 -0
  23. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/RegisterRSEResponse.kt +10 -0
  24. package/core-sdk.json +6 -6
  25. package/dist/index.d.ts +7 -0
  26. package/dist/index.js +10 -4
  27. package/dist/src/cache.d.ts +0 -4
  28. package/dist/src/cache.js +0 -5
  29. package/dist/src/config.d.ts +14 -4
  30. package/dist/src/core.d.ts +16 -6
  31. package/dist/src/core.js +72 -0
  32. package/dist/src/credential.d.ts +7 -2
  33. package/dist/src/credentialSchema.d.ts +5 -2
  34. package/dist/src/credentialSchema.js +2 -0
  35. package/dist/src/history.d.ts +23 -5
  36. package/dist/src/history.js +13 -1
  37. package/dist/src/identifier.d.ts +132 -0
  38. package/dist/src/identifier.js +29 -0
  39. package/dist/src/organisation.d.ts +8 -0
  40. package/dist/src/organisation.js +1 -0
  41. package/dist/src/proof.d.ts +26 -6
  42. package/dist/src/proof.js +13 -5
  43. package/dist/src/trust.d.ts +1 -1
  44. package/dist/src/ubiqu.d.ts +49 -0
  45. package/dist/src/ubiqu.js +69 -0
  46. package/ios/Deserialize.swift +141 -776
  47. package/ios/EventEmitter.swift +91 -0
  48. package/ios/ProcivisOneCoreModule.m +49 -5
  49. package/ios/ProcivisOneCoreModule.swift +994 -687
  50. package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +37 -27
  51. package/ios/RNDecoder/RNDecoder.swift +191 -0
  52. package/ios/RNDecoder/RNDecodingStorage.swift +33 -0
  53. package/ios/RNDecoder/RNKeyedDecodingContainer.swift +133 -0
  54. package/ios/RNDecoder/RNUnkeyedDecodingContainer.swift +175 -0
  55. package/ios/RNEncoder/RNAnyCodingKey.swift +31 -0
  56. package/ios/RNEncoder/RNEncoder.swift +95 -0
  57. package/ios/RNEncoder/RNKeyedEncodingContainer.swift +81 -0
  58. package/ios/RNEncoder/RNSingleValueEncodingContainer.swift +78 -0
  59. package/ios/RNEncoder/RNUnkeyedEncodingContainer.swift +84 -0
  60. package/ios/RSEKeyStorage.swift +587 -0
  61. package/ios/RSEKeyStorage.swift_opensource +49 -0
  62. package/ios/RSEPinPad.swift +74 -0
  63. package/ios/RSEPinPad.swift_opensource +21 -0
  64. package/ios/RSEPinPadManager.m +19 -0
  65. package/ios/Serialize.swift +46 -596
  66. package/ios/UBQKit.xcframework/Info.plist +44 -0
  67. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Assets.car +0 -0
  68. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFCompatibilityMacros.h +37 -0
  69. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFHTTPSessionManager.h +304 -0
  70. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +216 -0
  71. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworking.h +41 -0
  72. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +16 -0
  73. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFSecurityPolicy.h +156 -0
  74. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLRequestSerialization.h +479 -0
  75. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLResponseSerialization.h +310 -0
  76. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLSessionManager.h +501 -0
  77. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/CardRequestProtocol.h +72 -0
  78. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Constants.h +222 -0
  79. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DeviceBindProtocol.h +38 -0
  80. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DomainSecurityModule.h +43 -0
  81. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ErrorDomains.h +68 -0
  82. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/FreeAssetProtocol.h +40 -0
  83. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/GDataXMLNode.h +214 -0
  84. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSDictionary+Utilities.h +23 -0
  85. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSFileManager+Utilities.h +20 -0
  86. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSString+Utilities.h +23 -0
  87. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSURL+Utilities.h +12 -0
  88. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ProtocolBase.h +38 -0
  89. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ResetPinProtocol.h +45 -0
  90. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Settings.h +120 -0
  91. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequest.h +58 -0
  92. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +37 -0
  93. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +34 -0
  94. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +28 -0
  95. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +35 -0
  96. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +31 -0
  97. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +34 -0
  98. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit-Swift.h +761 -0
  99. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit.h +56 -0
  100. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQPacket.h +38 -0
  101. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Info.plist +0 -0
  102. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.abi.json +89006 -0
  103. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.private.swiftinterface +1099 -0
  104. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  105. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftinterface +1099 -0
  106. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/module.modulemap +11 -0
  107. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/UBQKit +0 -0
  108. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/_CodeSignature/CodeResources +597 -0
  109. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/certs +0 -0
  110. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/checksums +0 -0
  111. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/pinning_pub +0 -0
  112. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/static +0 -0
  113. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/stream +0 -0
  114. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Assets.car +0 -0
  115. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFCompatibilityMacros.h +37 -0
  116. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFHTTPSessionManager.h +304 -0
  117. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +216 -0
  118. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworking.h +41 -0
  119. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +16 -0
  120. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFSecurityPolicy.h +156 -0
  121. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLRequestSerialization.h +479 -0
  122. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLResponseSerialization.h +310 -0
  123. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLSessionManager.h +501 -0
  124. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/CardRequestProtocol.h +72 -0
  125. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h +222 -0
  126. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DeviceBindProtocol.h +38 -0
  127. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DomainSecurityModule.h +43 -0
  128. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h +68 -0
  129. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/FreeAssetProtocol.h +40 -0
  130. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h +214 -0
  131. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSDictionary+Utilities.h +23 -0
  132. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSFileManager+Utilities.h +20 -0
  133. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSString+Utilities.h +23 -0
  134. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSURL+Utilities.h +12 -0
  135. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ProtocolBase.h +38 -0
  136. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ResetPinProtocol.h +45 -0
  137. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Settings.h +120 -0
  138. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequest.h +58 -0
  139. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +37 -0
  140. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +34 -0
  141. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +28 -0
  142. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +35 -0
  143. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +31 -0
  144. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +34 -0
  145. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit-Swift.h +1522 -0
  146. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit.h +56 -0
  147. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQPacket.h +38 -0
  148. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Info.plist +0 -0
  149. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.abi.json +89006 -0
  150. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1099 -0
  151. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  152. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1099 -0
  153. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +89006 -0
  154. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1099 -0
  155. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  156. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1099 -0
  157. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/module.modulemap +11 -0
  158. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/UBQKit +0 -0
  159. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/_CodeSignature/CodeResources +652 -0
  160. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/certs +0 -0
  161. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/checksums +0 -0
  162. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/pinning_pub +0 -0
  163. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/static +0 -0
  164. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/stream +0 -0
  165. package/ios/Util.swift +36 -25
  166. package/package.json +5 -4
  167. package/react-native-one-core.podspec +4 -5
@@ -3,19 +3,20 @@
3
3
  archiveVersion = 1;
4
4
  classes = {
5
5
  };
6
- objectVersion = 54;
6
+ objectVersion = 70;
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 339DE1322A4EB16400F68DE2 /* one_coreFFI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 339DE1312A4EB16300F68DE2 /* one_coreFFI.xcframework */; };
11
- 339DE1342A4EB17E00F68DE2 /* one_core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 339DE1332A4EB17E00F68DE2 /* one_core.swift */; };
10
+ 1522CCF12D5C909D002AC200 /* EventEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1522CCF02D5C9095002AC200 /* EventEmitter.swift */; };
11
+ 15260DE82D561D4300797D80 /* UBQKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15260DE72D561D4300797D80 /* UBQKit.xcframework */; };
12
+ 15260DEA2D561D6900797D80 /* RSEKeyStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15260DE92D561D6900797D80 /* RSEKeyStorage.swift */; };
13
+ 15260DEC2D561D8900797D80 /* RSEPinPadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 15260DEB2D561D7F00797D80 /* RSEPinPadManager.m */; };
14
+ 15260DF02D56203600797D80 /* RSEPinPad.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15260DEF2D56203000797D80 /* RSEPinPad.swift */; };
15
+ 339DE1322A4EB16400F68DE2 /* ProcivisOneCoreFFI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 339DE1312A4EB16300F68DE2 /* ProcivisOneCoreFFI.xcframework */; };
16
+ 339DE1322A4EB16400F68DE2 /* ProcivisOneCore.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 339DE1312A4EB16300F68DE2 /* ProcivisOneCore.xcframework */; };
12
17
  339E6C092A7265970085D7EE /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = 339E6C082A7265970085D7EE /* Util.swift */; };
13
18
  33A474252A86532B00C94287 /* Serialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33A474242A86532B00C94287 /* Serialize.swift */; };
14
19
  33AFE82E2ADD59F000137FCD /* Deserialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33AFE82D2ADD59F000137FCD /* Deserialize.swift */; };
15
- 33CB57402C3E6ED400A303BB /* IOSBLEModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CB573D2C3E6ED400A303BB /* IOSBLEModels.swift */; };
16
- 33CB57412C3E6ED400A303BB /* IOSBLEPeripheral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CB573E2C3E6ED400A303BB /* IOSBLEPeripheral.swift */; };
17
- 33CB57422C3E6ED400A303BB /* IOSBLECentral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CB573F2C3E6ED400A303BB /* IOSBLECentral.swift */; };
18
- 33CB57442C3E6EE600A303BB /* SecureEnclaveKeyStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CB57432C3E6EE600A303BB /* SecureEnclaveKeyStorage.swift */; };
19
20
  33F2711B292F97400090E4DB /* ProcivisOneCoreModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F27119292F97400090E4DB /* ProcivisOneCoreModule.m */; };
20
21
  33F2711C292F97400090E4DB /* ProcivisOneCoreModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33F2711A292F97400090E4DB /* ProcivisOneCoreModule.swift */; };
21
22
  /* End PBXBuildFile section */
@@ -34,26 +35,32 @@
34
35
 
35
36
  /* Begin PBXFileReference section */
36
37
  134814201AA4EA6300B7C361 /* libProcivisRNOneCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libProcivisRNOneCore.a; sourceTree = BUILT_PRODUCTS_DIR; };
38
+ 1522CCF02D5C9095002AC200 /* EventEmitter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventEmitter.swift; sourceTree = "<group>"; };
39
+ 15260DE72D561D4300797D80 /* UBQKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = UBQKit.xcframework; sourceTree = "<group>"; };
40
+ 15260DE92D561D6900797D80 /* RSEKeyStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSEKeyStorage.swift; sourceTree = "<group>"; };
41
+ 15260DEB2D561D7F00797D80 /* RSEPinPadManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RSEPinPadManager.m; sourceTree = "<group>"; };
42
+ 15260DEF2D56203000797D80 /* RSEPinPad.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSEPinPad.swift; sourceTree = "<group>"; };
37
43
  1542F7E72832BE9B005D3C06 /* react-native-one-core-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "react-native-one-core-Bridging-Header.h"; sourceTree = "<group>"; };
38
- 339DE1312A4EB16300F68DE2 /* one_coreFFI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = one_coreFFI.xcframework; sourceTree = "<group>"; };
39
- 339DE1332A4EB17E00F68DE2 /* one_core.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = one_core.swift; sourceTree = "<group>"; };
44
+ 339DE1312A4EB16300F68DE2 /* ProcivisOneCore.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = ProcivisOneCore.xcframework; sourceTree = "<group>"; };
40
45
  339E6C082A7265970085D7EE /* Util.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Util.swift; sourceTree = "<group>"; };
41
46
  33A474242A86532B00C94287 /* Serialize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Serialize.swift; sourceTree = "<group>"; };
42
47
  33AFE82D2ADD59F000137FCD /* Deserialize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Deserialize.swift; sourceTree = "<group>"; };
43
- 33CB573D2C3E6ED400A303BB /* IOSBLEModels.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IOSBLEModels.swift; sourceTree = "<group>"; };
44
- 33CB573E2C3E6ED400A303BB /* IOSBLEPeripheral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IOSBLEPeripheral.swift; sourceTree = "<group>"; };
45
- 33CB573F2C3E6ED400A303BB /* IOSBLECentral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IOSBLECentral.swift; sourceTree = "<group>"; };
46
- 33CB57432C3E6EE600A303BB /* SecureEnclaveKeyStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecureEnclaveKeyStorage.swift; sourceTree = "<group>"; };
47
48
  33F27119292F97400090E4DB /* ProcivisOneCoreModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProcivisOneCoreModule.m; sourceTree = "<group>"; };
48
49
  33F2711A292F97400090E4DB /* ProcivisOneCoreModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProcivisOneCoreModule.swift; sourceTree = "<group>"; };
49
50
  /* End PBXFileReference section */
50
51
 
52
+ /* Begin PBXFileSystemSynchronizedRootGroup section */
53
+ 33CF268B2CB97A5700E95B65 /* RNEncoder */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = RNEncoder; sourceTree = "<group>"; };
54
+ /* End PBXFileSystemSynchronizedRootGroup section */
55
+
51
56
  /* Begin PBXFrameworksBuildPhase section */
52
57
  58B511D81A9E6C8500147676 /* Frameworks */ = {
53
58
  isa = PBXFrameworksBuildPhase;
54
59
  buildActionMask = 2147483647;
55
60
  files = (
56
- 339DE1322A4EB16400F68DE2 /* one_coreFFI.xcframework in Frameworks */,
61
+ 339DE1322A4EB16400F68DE2 /* ProcivisOneCoreFFI.xcframework in Frameworks */,
62
+ 15260DE82D561D4300797D80 /* UBQKit.xcframework in Frameworks */,
63
+ 339DE1322A4EB16400F68DE2 /* ProcivisOneCore.xcframework in Frameworks */,
57
64
  );
58
65
  runOnlyForDeploymentPostprocessing = 0;
59
66
  };
@@ -71,16 +78,17 @@
71
78
  58B511D21A9E6C8500147676 = {
72
79
  isa = PBXGroup;
73
80
  children = (
81
+ 1522CCF02D5C9095002AC200 /* EventEmitter.swift */,
82
+ 15260DEF2D56203000797D80 /* RSEPinPad.swift */,
83
+ 15260DEB2D561D7F00797D80 /* RSEPinPadManager.m */,
84
+ 15260DE92D561D6900797D80 /* RSEKeyStorage.swift */,
85
+ 15260DE72D561D4300797D80 /* UBQKit.xcframework */,
86
+ 33CF268B2CB97A5700E95B65 /* RNEncoder */,
74
87
  33F27119292F97400090E4DB /* ProcivisOneCoreModule.m */,
75
- 339DE1312A4EB16300F68DE2 /* one_coreFFI.xcframework */,
76
- 339DE1332A4EB17E00F68DE2 /* one_core.swift */,
88
+ 339DE1312A4EB16300F68DE2 /* ProcivisOneCore.xcframework */,
77
89
  33F2711A292F97400090E4DB /* ProcivisOneCoreModule.swift */,
78
90
  339E6C082A7265970085D7EE /* Util.swift */,
79
91
  33AFE82D2ADD59F000137FCD /* Deserialize.swift */,
80
- 33CB573F2C3E6ED400A303BB /* IOSBLECentral.swift */,
81
- 33CB573D2C3E6ED400A303BB /* IOSBLEModels.swift */,
82
- 33CB573E2C3E6ED400A303BB /* IOSBLEPeripheral.swift */,
83
- 33CB57432C3E6EE600A303BB /* SecureEnclaveKeyStorage.swift */,
84
92
  33A474242A86532B00C94287 /* Serialize.swift */,
85
93
  1542F7E72832BE9B005D3C06 /* react-native-one-core-Bridging-Header.h */,
86
94
  134814211AA4EA7D00B7C361 /* Products */,
@@ -102,6 +110,9 @@
102
110
  );
103
111
  dependencies = (
104
112
  );
113
+ fileSystemSynchronizedGroups = (
114
+ 33CF268B2CB97A5700E95B65 /* RNEncoder */,
115
+ );
105
116
  name = ProcivisRNOneCore;
106
117
  productName = RCTDataManager;
107
118
  productReference = 134814201AA4EA6300B7C361 /* libProcivisRNOneCore.a */;
@@ -145,16 +156,15 @@
145
156
  isa = PBXSourcesBuildPhase;
146
157
  buildActionMask = 2147483647;
147
158
  files = (
159
+ 15260DEC2D561D8900797D80 /* RSEPinPadManager.m in Sources */,
148
160
  33F2711C292F97400090E4DB /* ProcivisOneCoreModule.swift in Sources */,
149
161
  33F2711B292F97400090E4DB /* ProcivisOneCoreModule.m in Sources */,
150
- 33CB57422C3E6ED400A303BB /* IOSBLECentral.swift in Sources */,
151
- 339DE1342A4EB17E00F68DE2 /* one_core.swift in Sources */,
152
- 33CB57412C3E6ED400A303BB /* IOSBLEPeripheral.swift in Sources */,
162
+ 15260DEA2D561D6900797D80 /* RSEKeyStorage.swift in Sources */,
163
+ 1522CCF12D5C909D002AC200 /* EventEmitter.swift in Sources */,
164
+ 15260DF02D56203600797D80 /* RSEPinPad.swift in Sources */,
153
165
  33AFE82E2ADD59F000137FCD /* Deserialize.swift in Sources */,
154
166
  339E6C092A7265970085D7EE /* Util.swift in Sources */,
155
167
  33A474252A86532B00C94287 /* Serialize.swift in Sources */,
156
- 33CB57402C3E6ED400A303BB /* IOSBLEModels.swift in Sources */,
157
- 33CB57442C3E6EE600A303BB /* SecureEnclaveKeyStorage.swift in Sources */,
158
168
  );
159
169
  runOnlyForDeploymentPostprocessing = 0;
160
170
  };
@@ -261,7 +271,7 @@
261
271
  OTHER_LDFLAGS = "-ObjC";
262
272
  PRODUCT_NAME = ProcivisRNOneCore;
263
273
  SKIP_INSTALL = YES;
264
- SWIFT_OBJC_BRIDGING_HEADER = "react-native-jwt-Bridging-Header.h";
274
+ SWIFT_OBJC_BRIDGING_HEADER = "react-native-one-core-Bridging-Header.h";
265
275
  SWIFT_OPTIMIZATION_LEVEL = "-Onone";
266
276
  SWIFT_VERSION = 5.0;
267
277
  };
@@ -286,7 +296,7 @@
286
296
  OTHER_LDFLAGS = "-ObjC";
287
297
  PRODUCT_NAME = ProcivisRNOneCore;
288
298
  SKIP_INSTALL = YES;
289
- SWIFT_OBJC_BRIDGING_HEADER = "react-native-jwt-Bridging-Header.h";
299
+ SWIFT_OBJC_BRIDGING_HEADER = "react-native-one-core-Bridging-Header.h";
290
300
  SWIFT_VERSION = 5.0;
291
301
  };
292
302
  name = Release;
@@ -0,0 +1,191 @@
1
+ import Foundation
2
+
3
+ public typealias CustomDecoder = (_ value: Any, _ type: Any.Type, _ codingPath: [CodingKey]) throws
4
+ -> Any?
5
+ public let customDecoderKey = CodingUserInfoKey(rawValue: "customDecoder")!
6
+
7
+ final public class RNDecoder {
8
+ public init() {}
9
+
10
+ public var userInfo: [CodingUserInfoKey: Any] = [:]
11
+
12
+ public func decode<T: Decodable>(_ value: Any) throws -> T {
13
+ return try decode(T.self, from: value)
14
+ }
15
+
16
+ public func decode<T: Decodable>(_ type: T.Type, from data: Any) throws -> T {
17
+ let decoder = RNInternalDecoder(referencing: data, userInfo: self.userInfo)
18
+
19
+ guard let value = try decoder.unbox(data, as: type) else {
20
+ throw DecodingError.valueNotFound(
21
+ type,
22
+ DecodingError.Context(
23
+ codingPath: [],
24
+ debugDescription: "The given data did not contain a top-level value."
25
+ )
26
+ )
27
+ }
28
+
29
+ return value
30
+ }
31
+ }
32
+
33
+ // MARK: - TopLevelDecoder
34
+
35
+ #if canImport(Combine)
36
+ import Combine
37
+
38
+ extension RNDecoder: TopLevelDecoder {
39
+ public typealias Input = Any
40
+ }
41
+ #endif
42
+
43
+ // MARK: -
44
+
45
+ class RNInternalDecoder {
46
+ internal var storage: RNDecodingStorage
47
+ internal let userInfo: [CodingUserInfoKey: Any]
48
+ internal(set) public var codingPath: [CodingKey]
49
+
50
+ internal init(
51
+ referencing container: Any,
52
+ at codingPath: [CodingKey] = [],
53
+ userInfo: [CodingUserInfoKey: Any]
54
+ ) {
55
+ self.storage = RNDecodingStorage()
56
+ self.storage.push(container: container)
57
+ self.codingPath = codingPath
58
+ self.userInfo = userInfo
59
+ }
60
+ }
61
+
62
+ extension RNInternalDecoder: Decoder {
63
+ func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key>
64
+ where Key: CodingKey {
65
+ guard !(self.storage.topContainer is NSNull) else {
66
+ throw DecodingError.valueNotFound(
67
+ KeyedDecodingContainer<Key>.self,
68
+ DecodingError.Context(
69
+ codingPath: self.codingPath,
70
+ debugDescription: "Cannot get keyed decoding container -- found null value instead."
71
+ )
72
+ )
73
+ }
74
+
75
+ guard let topContainer = self.storage.topContainer as? [String: Any] else {
76
+ let description =
77
+ "Expected to decode \([String : Any].self) but found '\(self.storage.topContainer)' instead."
78
+ throw DecodingError.typeMismatch(
79
+ [String: Any].self,
80
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
81
+ )
82
+ }
83
+
84
+ let container = RNKeyedDecodingContainer<Key>(referencing: self, wrapping: topContainer)
85
+ return KeyedDecodingContainer(container)
86
+ }
87
+
88
+ func unkeyedContainer() throws -> any UnkeyedDecodingContainer {
89
+ guard !(self.storage.topContainer is NSNull) else {
90
+ throw DecodingError.valueNotFound(
91
+ UnkeyedDecodingContainer.self,
92
+ DecodingError.Context(
93
+ codingPath: self.codingPath,
94
+ debugDescription: "Cannot get unkeyed decoding container -- found null value instead."
95
+ )
96
+ )
97
+ }
98
+
99
+ let topContainer: [Any]
100
+
101
+ if let container = self.storage.topContainer as? [Any] {
102
+ topContainer = container
103
+ } else if let container = self.storage.topContainer as? [AnyHashable: Any] {
104
+ topContainer = [container]
105
+ } else {
106
+ let description =
107
+ "Expected to decode \([Any].self) but found '\(self.storage.topContainer)' instead."
108
+ throw DecodingError.typeMismatch(
109
+ [Any].self,
110
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
111
+ )
112
+ }
113
+
114
+ return RNUnkeyedDecodingContainer(referencing: self, wrapping: topContainer)
115
+ }
116
+
117
+ public func singleValueContainer() throws -> SingleValueDecodingContainer {
118
+ return self
119
+ }
120
+ }
121
+
122
+ extension RNInternalDecoder: SingleValueDecodingContainer {
123
+ private func expectNonNull<T>(_ type: T.Type) throws {
124
+ guard !self.decodeNil() else {
125
+ throw DecodingError.valueNotFound(
126
+ type,
127
+ DecodingError.Context(
128
+ codingPath: self.codingPath,
129
+ debugDescription: "Expected \(type) but found null value instead."
130
+ )
131
+ )
132
+ }
133
+ }
134
+
135
+ public func decodeNil() -> Bool {
136
+ return self.storage.topContainer is NSNull
137
+ }
138
+
139
+ public func decode<T: Decodable>(_ type: T.Type) throws -> T {
140
+ try expectNonNull(type)
141
+ return try self.unbox(self.storage.topContainer, as: type)!
142
+ }
143
+ }
144
+
145
+ extension RNInternalDecoder {
146
+ internal func unbox<T: Decodable>(_ value: Any, as type: T.Type) throws -> T? {
147
+ if let customDecoder = self.userInfo[customDecoderKey] {
148
+ if let result = try (customDecoder as! CustomDecoder)(value, type, self.codingPath) {
149
+ return (result as! T)
150
+ }
151
+ }
152
+
153
+ if type == String.self || type == Bool.self || type is any Numeric.Type {
154
+ guard let data = value as? T else {
155
+ let description = "Expected to decode \(type) but found '\(value)' instead."
156
+ throw DecodingError.typeMismatch(
157
+ type,
158
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
159
+ )
160
+ }
161
+ return data
162
+ }
163
+
164
+ if let enumType = type as? any CaseIterable.Type {
165
+ guard let data = value as? String else {
166
+ let description = "Expected to decode \(type) but found '\(value)' instead."
167
+ throw DecodingError.typeMismatch(
168
+ type,
169
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
170
+ )
171
+ }
172
+
173
+ let match = enumType.allCases.first {
174
+ return serializeEnumValue(value: $0) == data
175
+ }
176
+
177
+ guard let result = match as? T else {
178
+ let description = "Expected to decode \(type) but found '\(value)' instead."
179
+ throw DecodingError.typeMismatch(
180
+ type,
181
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
182
+ )
183
+ }
184
+ return result
185
+ }
186
+
187
+ self.storage.push(container: value)
188
+ defer { self.storage.popContainer() }
189
+ return try type.init(from: self)
190
+ }
191
+ }
@@ -0,0 +1,33 @@
1
+ import Foundation
2
+
3
+ internal struct RNDecodingStorage {
4
+ // MARK: Properties
5
+
6
+ /// The container stack.
7
+ private(set) internal var containers: [Any] = []
8
+
9
+ // MARK: - Initialization
10
+
11
+ /// Initializes `self` with no containers.
12
+ internal init() {}
13
+
14
+ // MARK: - Modifying the Stack
15
+
16
+ internal var count: Int {
17
+ return self.containers.count
18
+ }
19
+
20
+ internal var topContainer: Any {
21
+ precondition(!self.containers.isEmpty, "Empty container stack.")
22
+ return self.containers.last!
23
+ }
24
+
25
+ internal mutating func push(container: Any) {
26
+ self.containers.append(container)
27
+ }
28
+
29
+ internal mutating func popContainer() {
30
+ precondition(!self.containers.isEmpty, "Empty container stack.")
31
+ self.containers.removeLast()
32
+ }
33
+ }
@@ -0,0 +1,133 @@
1
+ import Foundation
2
+
3
+ internal class RNKeyedDecodingContainer<Key: CodingKey> {
4
+ private let decoder: RNInternalDecoder
5
+ private let container: [String: Any]
6
+ private(set) public var codingPath: [CodingKey]
7
+
8
+ internal init(referencing decoder: RNInternalDecoder, wrapping container: [String: Any]) {
9
+ self.decoder = decoder
10
+ self.container = container
11
+ self.codingPath = decoder.codingPath
12
+ }
13
+ }
14
+
15
+ extension RNKeyedDecodingContainer: KeyedDecodingContainerProtocol {
16
+ public var allKeys: [Key] {
17
+ return self.container.keys.compactMap { Key(stringValue: $0) }
18
+ }
19
+
20
+ public func contains(_ key: Key) -> Bool {
21
+ return self.container[key.stringValue] != nil
22
+ }
23
+
24
+ public func decodeNil(forKey key: Key) throws -> Bool {
25
+ return !self.contains(key)
26
+ }
27
+
28
+ private func _errorDescription(of key: CodingKey) -> String {
29
+ return "\(key) (\"\(key.stringValue)\")"
30
+ }
31
+
32
+ func decode<T: Decodable>(_ type: T.Type, forKey key: Key) throws -> T {
33
+ guard let entry = self.container[key.stringValue] else {
34
+ throw DecodingError.keyNotFound(
35
+ key,
36
+ DecodingError.Context(
37
+ codingPath: self.decoder.codingPath,
38
+ debugDescription: "No value associated with key \(_errorDescription(of: key))."
39
+ )
40
+ )
41
+ }
42
+
43
+ self.decoder.codingPath.append(key)
44
+ defer { self.decoder.codingPath.removeLast() }
45
+
46
+ guard let value = try self.decoder.unbox(entry, as: type) else {
47
+ throw DecodingError.valueNotFound(
48
+ type,
49
+ DecodingError.Context(
50
+ codingPath: self.decoder.codingPath,
51
+ debugDescription: "Expected \(type) value but found null instead."
52
+ )
53
+ )
54
+ }
55
+
56
+ return value
57
+ }
58
+
59
+ func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type, forKey key: Key) throws
60
+ -> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey
61
+ {
62
+ self.decoder.codingPath.append(key)
63
+ defer { self.decoder.codingPath.removeLast() }
64
+
65
+ guard let value = self.container[key.stringValue] else {
66
+ throw DecodingError.keyNotFound(
67
+ key,
68
+ DecodingError.Context(
69
+ codingPath: self.codingPath,
70
+ debugDescription:
71
+ "Cannot get \(KeyedDecodingContainer<NestedKey>.self) -- no value found for key \"\(key.stringValue)\""
72
+ )
73
+ )
74
+ }
75
+
76
+ guard let dictionary = value as? [String: Any] else {
77
+ let description = "Expected to decode \([String : Any].self) but found '\(value)' instead."
78
+ throw DecodingError.typeMismatch(
79
+ [String: Any].self,
80
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
81
+ )
82
+ }
83
+
84
+ let container = RNKeyedDecodingContainer<NestedKey>(
85
+ referencing: self.decoder,
86
+ wrapping: dictionary
87
+ )
88
+ return KeyedDecodingContainer(container)
89
+ }
90
+
91
+ func nestedUnkeyedContainer(forKey key: Key) throws -> any UnkeyedDecodingContainer {
92
+ self.decoder.codingPath.append(key)
93
+ defer { self.decoder.codingPath.removeLast() }
94
+
95
+ guard let value = self.container[key.stringValue] else {
96
+ throw DecodingError.keyNotFound(
97
+ key,
98
+ DecodingError.Context(
99
+ codingPath: self.codingPath,
100
+ debugDescription:
101
+ "Cannot get UnkeyedDecodingContainer -- no value found for key \"\(key.stringValue)\""
102
+ )
103
+ )
104
+ }
105
+
106
+ guard let array = value as? [Any] else {
107
+ let description = "Expected to decode \([Any].self) but found '\(value)' instead."
108
+ throw DecodingError.typeMismatch(
109
+ [Any].self,
110
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
111
+ )
112
+ }
113
+
114
+ return RNUnkeyedDecodingContainer(referencing: self.decoder, wrapping: array)
115
+ }
116
+
117
+ private func _superDecoder(forKey key: CodingKey) throws -> Decoder {
118
+ let value: Any = self.container[key.stringValue] ?? NSNull()
119
+ return RNInternalDecoder(
120
+ referencing: value,
121
+ at: self.decoder.codingPath + [key],
122
+ userInfo: self.decoder.userInfo
123
+ )
124
+ }
125
+
126
+ public func superDecoder() throws -> Decoder {
127
+ fatalError("Unimplemented")
128
+ }
129
+
130
+ public func superDecoder(forKey key: Key) throws -> Decoder {
131
+ return try _superDecoder(forKey: key)
132
+ }
133
+ }
@@ -0,0 +1,175 @@
1
+ import Foundation
2
+
3
+ internal class RNUnkeyedDecodingContainer {
4
+ private let decoder: RNInternalDecoder
5
+ private let container: [Any]
6
+ private(set) public var codingPath: [CodingKey]
7
+ private(set) public var currentIndex: Int
8
+
9
+ internal init(referencing decoder: RNInternalDecoder, wrapping container: [Any]) {
10
+ self.decoder = decoder
11
+ self.container = container
12
+ self.codingPath = decoder.codingPath
13
+ self.currentIndex = 0
14
+ }
15
+ }
16
+
17
+ extension RNUnkeyedDecodingContainer: UnkeyedDecodingContainer {
18
+ var count: Int? {
19
+ return self.container.count
20
+ }
21
+
22
+ var isAtEnd: Bool {
23
+ return self.currentIndex >= self.container.count
24
+ }
25
+
26
+ func decodeNil() throws -> Bool {
27
+ guard !self.isAtEnd else {
28
+ throw DecodingError.valueNotFound(
29
+ Any?.self,
30
+ DecodingError.Context(
31
+ codingPath: self.decoder.codingPath + [RNAnyCodingKey(intValue: self.currentIndex)],
32
+ debugDescription: "Unkeyed container is at end."
33
+ )
34
+ )
35
+ }
36
+
37
+ if self.container[self.currentIndex] is NSNull {
38
+ self.currentIndex += 1
39
+ return true
40
+ } else {
41
+ return false
42
+ }
43
+ }
44
+
45
+ func decode<T: Decodable>(_ type: T.Type) throws -> T {
46
+ guard !self.isAtEnd else {
47
+ throw DecodingError.valueNotFound(
48
+ type,
49
+ DecodingError.Context(
50
+ codingPath: self.decoder.codingPath + [RNAnyCodingKey(intValue: self.currentIndex)],
51
+ debugDescription: "Unkeyed container is at end."
52
+ )
53
+ )
54
+ }
55
+
56
+ self.decoder.codingPath.append(RNAnyCodingKey(intValue: self.currentIndex))
57
+ defer { self.decoder.codingPath.removeLast() }
58
+
59
+ guard let decoded = try self.decoder.unbox(self.container[self.currentIndex], as: type) else {
60
+ throw DecodingError.valueNotFound(
61
+ type,
62
+ DecodingError.Context(
63
+ codingPath: self.decoder.codingPath + [RNAnyCodingKey(intValue: self.currentIndex)],
64
+ debugDescription: "Expected \(type) but found null instead."
65
+ )
66
+ )
67
+ }
68
+
69
+ self.currentIndex += 1
70
+ return decoded
71
+ }
72
+
73
+ func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type) throws -> KeyedDecodingContainer<
74
+ NestedKey
75
+ > where NestedKey: CodingKey {
76
+ self.decoder.codingPath.append(RNAnyCodingKey(intValue: self.currentIndex))
77
+ defer { self.decoder.codingPath.removeLast() }
78
+
79
+ guard !self.isAtEnd else {
80
+ throw DecodingError.valueNotFound(
81
+ KeyedDecodingContainer<NestedKey>.self,
82
+ DecodingError.Context(
83
+ codingPath: self.codingPath,
84
+ debugDescription: "Cannot get nested keyed container -- unkeyed container is at end."
85
+ )
86
+ )
87
+ }
88
+
89
+ let value = self.container[self.currentIndex]
90
+ guard !(value is NSNull) else {
91
+ throw DecodingError.valueNotFound(
92
+ KeyedDecodingContainer<NestedKey>.self,
93
+ DecodingError.Context(
94
+ codingPath: self.codingPath,
95
+ debugDescription: "Cannot get keyed decoding container -- found null value instead."
96
+ )
97
+ )
98
+ }
99
+
100
+ guard let dictionary = value as? [String: Any] else {
101
+ let description = "Expected to decode \([String : Any].self) but found '\(value)' instead."
102
+ throw DecodingError.typeMismatch(
103
+ [String: Any].self,
104
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
105
+ )
106
+ }
107
+
108
+ self.currentIndex += 1
109
+ let container = RNKeyedDecodingContainer<NestedKey>(
110
+ referencing: self.decoder,
111
+ wrapping: dictionary
112
+ )
113
+ return KeyedDecodingContainer(container)
114
+ }
115
+
116
+ func nestedUnkeyedContainer() throws -> any UnkeyedDecodingContainer {
117
+ self.decoder.codingPath.append(RNAnyCodingKey(intValue: self.currentIndex))
118
+ defer { self.decoder.codingPath.removeLast() }
119
+
120
+ guard !self.isAtEnd else {
121
+ throw DecodingError.valueNotFound(
122
+ UnkeyedDecodingContainer.self,
123
+ DecodingError.Context(
124
+ codingPath: self.codingPath,
125
+ debugDescription: "Cannot get nested keyed container -- unkeyed container is at end."
126
+ )
127
+ )
128
+ }
129
+
130
+ let value = self.container[self.currentIndex]
131
+ guard !(value is NSNull) else {
132
+ throw DecodingError.valueNotFound(
133
+ UnkeyedDecodingContainer.self,
134
+ DecodingError.Context(
135
+ codingPath: self.codingPath,
136
+ debugDescription: "Cannot get keyed decoding container -- found null value instead."
137
+ )
138
+ )
139
+ }
140
+
141
+ guard let array = value as? [Any] else {
142
+ let description = "Expected to decode \([Any].self) but found '\(value)' instead."
143
+ throw DecodingError.typeMismatch(
144
+ [Any].self,
145
+ DecodingError.Context(codingPath: self.codingPath, debugDescription: description)
146
+ )
147
+ }
148
+
149
+ self.currentIndex += 1
150
+ return RNUnkeyedDecodingContainer(referencing: self.decoder, wrapping: array)
151
+ }
152
+
153
+ func superDecoder() throws -> any Decoder {
154
+ self.decoder.codingPath.append(RNAnyCodingKey(intValue: self.currentIndex))
155
+ defer { self.decoder.codingPath.removeLast() }
156
+
157
+ guard !self.isAtEnd else {
158
+ throw DecodingError.valueNotFound(
159
+ Decoder.self,
160
+ DecodingError.Context(
161
+ codingPath: self.codingPath,
162
+ debugDescription: "Cannot get superDecoder() -- unkeyed container is at end."
163
+ )
164
+ )
165
+ }
166
+
167
+ let value = self.container[self.currentIndex]
168
+ self.currentIndex += 1
169
+ return RNInternalDecoder(
170
+ referencing: value,
171
+ at: self.decoder.codingPath,
172
+ userInfo: self.decoder.userInfo
173
+ )
174
+ }
175
+ }