@procivis/react-native-one-core 1.75488.0 → 1.81885.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +15 -14
  2. package/android/build.gradle +0 -11
  3. package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +1 -15
  4. package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +4 -4
  5. package/android/src/main/java/ch/procivis/one/core/Serialize.kt +0 -2
  6. package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +124 -107
  7. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt +5 -8
  8. package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +17 -222
  9. package/core-sdk.json +6 -6
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +2 -0
  12. package/dist/src/config.d.ts +3 -2
  13. package/dist/src/config.js +5 -0
  14. package/dist/src/core.d.ts +9 -182
  15. package/dist/src/core.js +9 -20
  16. package/dist/src/nfc.d.ts +0 -5
  17. package/dist/src/one-core-uniffi-intf.d.ts +1773 -0
  18. package/dist/src/one-core-uniffi-intf.js +356 -0
  19. package/ios/Deserialize.swift +0 -28
  20. package/ios/ProcivisOneCoreModule.m +4 -4
  21. package/ios/ProcivisOneCoreModule.swift +10 -10
  22. package/ios/RSEKeyStorage.swift +17 -571
  23. package/ios/RSEPinPad.swift +3 -56
  24. package/ios/Serialize.swift +80 -44
  25. package/package.json +4 -2
  26. package/react-native-one-core.podspec +1 -1
  27. package/android/build.gradle_opensource +0 -122
  28. package/android/libs/core-reactnative-compatible-2025.0305.1.aar +0 -0
  29. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadRunner.kt +0 -123
  30. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt_opensource +0 -20
  31. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadWrapper.kt +0 -396
  32. package/android/src/main/java/ch/procivis/one/core/ubiqu/RegistrationManager.kt +0 -59
  33. package/android/src/main/java/ch/procivis/one/core/ubiqu/TokenManager.kt +0 -48
  34. package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +0 -63
  35. package/android/src/main/java/ch/procivis/one/core/ubiqu/Util.kt +0 -74
  36. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityRequest.kt +0 -9
  37. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityResponse.kt +0 -9
  38. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/RegisterRSEResponse.kt +0 -10
  39. package/dist/src/backup.d.ts +0 -22
  40. package/dist/src/backup.js +0 -1
  41. package/dist/src/cache.d.ts +0 -11
  42. package/dist/src/cache.js +0 -12
  43. package/dist/src/credential.d.ts +0 -201
  44. package/dist/src/credential.js +0 -44
  45. package/dist/src/credentialSchema.d.ts +0 -135
  46. package/dist/src/credentialSchema.js +0 -34
  47. package/dist/src/did.d.ts +0 -63
  48. package/dist/src/did.js +0 -27
  49. package/dist/src/history.d.ts +0 -101
  50. package/dist/src/history.js +0 -63
  51. package/dist/src/identifier.d.ts +0 -133
  52. package/dist/src/identifier.js +0 -29
  53. package/dist/src/key.d.ts +0 -17
  54. package/dist/src/key.js +0 -1
  55. package/dist/src/list.d.ts +0 -14
  56. package/dist/src/list.js +0 -5
  57. package/dist/src/organisation.d.ts +0 -9
  58. package/dist/src/organisation.js +0 -1
  59. package/dist/src/proof.d.ts +0 -234
  60. package/dist/src/proof.js +0 -43
  61. package/dist/src/proofSchema.d.ts +0 -116
  62. package/dist/src/proofSchema.js +0 -9
  63. package/dist/src/trust.d.ts +0 -173
  64. package/dist/src/trust.js +0 -44
  65. package/dist/src/walletUnit.d.ts +0 -30
  66. package/dist/src/walletUnit.js +0 -11
  67. package/ios/RSEKeyStorage.swift_opensource +0 -61
  68. package/ios/RSEPinPad.swift_opensource +0 -21
  69. package/ios/UBQKit.xcframework/Info.plist +0 -44
  70. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Assets.car +0 -0
  71. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFCompatibilityMacros.h +0 -37
  72. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFHTTPSessionManager.h +0 -304
  73. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +0 -216
  74. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworking.h +0 -41
  75. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +0 -16
  76. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFSecurityPolicy.h +0 -156
  77. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLRequestSerialization.h +0 -479
  78. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLResponseSerialization.h +0 -310
  79. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLSessionManager.h +0 -501
  80. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/CardRequestProtocol.h +0 -72
  81. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Constants.h +0 -222
  82. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DeviceBindProtocol.h +0 -38
  83. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DomainSecurityModule.h +0 -43
  84. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ErrorDomains.h +0 -68
  85. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/FreeAssetProtocol.h +0 -40
  86. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/GDataXMLNode.h +0 -214
  87. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSDictionary+Utilities.h +0 -23
  88. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSFileManager+Utilities.h +0 -20
  89. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSString+Utilities.h +0 -23
  90. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSURL+Utilities.h +0 -12
  91. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ProtocolBase.h +0 -38
  92. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ResetPinProtocol.h +0 -45
  93. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Settings.h +0 -120
  94. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequest.h +0 -58
  95. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +0 -37
  96. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +0 -34
  97. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +0 -28
  98. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +0 -35
  99. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +0 -31
  100. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +0 -34
  101. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit-Swift.h +0 -761
  102. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit.h +0 -56
  103. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQPacket.h +0 -38
  104. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Info.plist +0 -0
  105. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.abi.json +0 -89006
  106. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -1099
  107. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  108. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftinterface +0 -1099
  109. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/module.modulemap +0 -11
  110. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/UBQKit +0 -0
  111. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/_CodeSignature/CodeResources +0 -597
  112. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/certs +0 -0
  113. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/checksums +0 -0
  114. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/pinning_pub +0 -0
  115. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/static +0 -0
  116. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/stream +0 -0
  117. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Assets.car +0 -0
  118. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFCompatibilityMacros.h +0 -37
  119. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFHTTPSessionManager.h +0 -304
  120. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +0 -216
  121. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworking.h +0 -41
  122. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +0 -16
  123. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFSecurityPolicy.h +0 -156
  124. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLRequestSerialization.h +0 -479
  125. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLResponseSerialization.h +0 -310
  126. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLSessionManager.h +0 -501
  127. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/CardRequestProtocol.h +0 -72
  128. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h +0 -222
  129. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DeviceBindProtocol.h +0 -38
  130. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DomainSecurityModule.h +0 -43
  131. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h +0 -68
  132. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/FreeAssetProtocol.h +0 -40
  133. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h +0 -214
  134. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSDictionary+Utilities.h +0 -23
  135. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSFileManager+Utilities.h +0 -20
  136. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSString+Utilities.h +0 -23
  137. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSURL+Utilities.h +0 -12
  138. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ProtocolBase.h +0 -38
  139. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ResetPinProtocol.h +0 -45
  140. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Settings.h +0 -120
  141. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequest.h +0 -58
  142. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +0 -37
  143. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +0 -34
  144. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +0 -28
  145. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +0 -35
  146. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +0 -31
  147. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +0 -34
  148. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit-Swift.h +0 -1522
  149. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit.h +0 -56
  150. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQPacket.h +0 -38
  151. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Info.plist +0 -0
  152. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -89006
  153. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -1099
  154. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  155. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -1099
  156. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -89006
  157. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -1099
  158. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  159. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -1099
  160. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/module.modulemap +0 -11
  161. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/UBQKit +0 -0
  162. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/_CodeSignature/CodeResources +0 -652
  163. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/certs +0 -0
  164. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/checksums +0 -0
  165. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/pinning_pub +0 -0
  166. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/static +0 -0
  167. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/stream +0 -0
@@ -1,74 +1,21 @@
1
1
  import UIKit
2
- import UBQKit
3
2
 
4
3
  @objc
5
4
  public class RSEPinPad: UIView {
6
5
 
7
6
  static let sharedPinPad: UBQPinPad = {
8
- let pinPad = UBQPinPad(biometricsButtonShown: false)
9
- fixSubviews(view: pinPad)
10
- return pinPad
7
+ fatalError("sharedPinPad() has not been implemented")
11
8
  }()
12
9
 
13
10
  override init(frame: CGRect) {
14
- super.init(frame: frame)
15
- let pinPad = RSEPinPad.self.sharedPinPad
16
- self.addSubview(pinPad)
17
- pinPad.frame = self.bounds
18
- pinPad.autoresizingMask = [.flexibleWidth, .flexibleHeight]
19
- pinPad.translatesAutoresizingMaskIntoConstraints = true
20
- pinPad.listener = self
11
+ fatalError("init(frame:) has not been implemented")
21
12
  }
22
13
 
23
14
  required init?(coder: NSCoder) {
24
15
  fatalError("init(coder:) has not been implemented")
25
16
  }
26
17
 
27
- public override func layoutSubviews() {
28
- super.layoutSubviews()
29
- RSEPinPad.fixSubviews(view: self)
30
- }
31
-
32
18
  public static func fixSubviews(view: UIView) {
33
- view.subviews.forEach { subview in
34
- if subview.isKind(of: UIStackView.self), let stackview = subview as? UIStackView {
35
- stackview.backgroundColor = .white
36
- stackview.layer.borderColor = .none
37
- }
38
- if subview.isKind(of: UIButton.self) {
39
- var constraintsToRemove: [NSLayoutConstraint] = []
40
- view.constraints.forEach { constraint in
41
- if constraint.firstAttribute == .width || constraint.firstAttribute == .height {
42
- constraintsToRemove.append(constraint)
43
- }
44
- }
45
- view.removeConstraints(constraintsToRemove)
46
- subview.autoresizingMask = []
47
- subview.translatesAutoresizingMaskIntoConstraints = false
48
- subview.removeConstraints(subview.constraints)
49
- subview.widthAnchor.constraint(equalToConstant: 72).isActive = true
50
- subview.heightAnchor.constraint(equalToConstant: 72).isActive = true
51
- subview.layer.cornerRadius = 36
52
- subview.backgroundColor = .systemGray5
53
- } else if subview.isKind(of: UILabel.self), let label = subview as? UILabel {
54
- label.textColor = .black
55
- label.highlightedTextColor = .black
56
- label.tintColor = .black
57
- } else {
58
- subview.backgroundColor = .clear
59
- subview.layer.borderColor = .none
60
- subview.layer.borderWidth = 0
61
- subview.tintColor = .black
62
- }
63
- fixSubviews(view: subview)
64
- }
65
- }
66
- }
67
-
68
- extension RSEPinPad: UBQPinPadReporting {
69
-
70
- public func amountOfDigitsDidChange(newAmount: Int) {
71
- ProcivisOneCoreEventEmitter.shared.sendDigitsEnteredEvent(amount: newAmount)
72
- RSEPinPad.fixSubviews(view: RSEPinPad.sharedPinPad)
19
+ fatalError("fixSubviews(view:) has not been implemented")
73
20
  }
74
21
  }
@@ -31,16 +31,14 @@ private func serializeSpecific(_ value: Encodable) throws -> Any? {
31
31
  switch value {
32
32
  case let data as HistoryMetadataBinding:
33
33
  return try serialize(historyMetadata: data)
34
- case let data as CredentialSchemaTypeBindingEnum:
35
- return serialize(credentialSchemaType: data)
36
34
  case let data as ClaimValueBindingDto:
37
35
  return try serialize(claimValue: data)
38
36
  case let data as ProofRequestClaimValueBindingDto:
39
37
  return try serialize(proofRequestClaimValue: data)
40
38
  case let data as HandleInvitationResponseBindingEnum:
41
39
  return try serialize(invitationResponse: data)
42
- case let data as CredentialQueryResponseBindingDto:
43
- return try serialize(credentialQuery: data)
40
+ case let data as ApplicableCredentialOrFailureHintBindingEnum:
41
+ return try serialize(applicableCredentialQuery: data)
44
42
  case let data as PresentationDefinitionV2ClaimValueBindingDto:
45
43
  return try serialize(presentationDefinitionV2ClaimValue: data)
46
44
 
@@ -49,53 +47,68 @@ private func serializeSpecific(_ value: Encodable) throws -> Any? {
49
47
  }
50
48
  }
51
49
 
52
- private func serialize(historyMetadata: HistoryMetadataBinding) throws -> Any {
50
+ private func serialize(historyMetadata: HistoryMetadataBinding) throws -> NSDictionary {
53
51
  switch (historyMetadata) {
54
52
  case let .unexportableEntities(value):
55
- return try serializeAny(value);
53
+ return [
54
+ "type_": "UNEXPORTABLE_ENTITIES",
55
+ "value": try serializeAny(value)
56
+ ];
56
57
  case let .errorMetadata(value):
57
- return try serializeAny(value);
58
+ return [
59
+ "type_": "ERROR_METADATA",
60
+ "value": try serializeAny(value)
61
+ ];
58
62
  case let .walletUnitJwt(value):
59
- return ["jwt": value] as NSDictionary;
60
- }
61
- }
62
-
63
- private func serialize(credentialSchemaType: CredentialSchemaTypeBindingEnum) -> String {
64
- switch (credentialSchemaType) {
65
- case .procivisOneSchema2024:
66
- return "PROCIVIS_ONE_SCHEMA2024";
67
- case .fallbackSchema2024:
68
- return "FALLBACK_SCHEMA2024";
69
- case .mdoc:
70
- return "MDOC";
71
- case .sdJwtVc:
72
- return "SD_JWT_VC";
73
- case let .other(value):
74
- return value;
63
+ return [
64
+ "type_": "WALLET_UNIT_JWT",
65
+ "value": [value]
66
+ ];
75
67
  }
76
68
  }
77
69
 
78
- private func serialize(claimValue: ClaimValueBindingDto) throws -> Any {
70
+ private func serialize(claimValue: ClaimValueBindingDto) throws -> NSDictionary {
79
71
  switch (claimValue) {
80
72
  case let .boolean(value):
81
- return value;
73
+ return [
74
+ "type_": "BOOLEAN",
75
+ "value": value
76
+ ];
82
77
  case let .float(value):
83
- return value;
78
+ return [
79
+ "type_": "FLOAT",
80
+ "value": value
81
+ ];
84
82
  case let .integer(value):
85
- return NSNumber(value: value);
83
+ return [
84
+ "type_": "INTEGER",
85
+ "value": NSNumber(value: value)
86
+ ];
86
87
  case let .string(value):
87
- return value;
88
+ return [
89
+ "type_": "STRING",
90
+ "value": value
91
+ ];
88
92
  case .nested(value: let values):
89
- return try values.map { try serializeAny($0) }
93
+ return [
94
+ "type_": "NESTED",
95
+ "value": try values.map { try serializeAny($0) }
96
+ ];
90
97
  }
91
98
  }
92
99
 
93
- private func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto) throws -> Any {
100
+ private func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto) throws -> NSDictionary {
94
101
  switch (proofRequestClaimValue) {
95
102
  case let .value(value):
96
- return value;
103
+ return [
104
+ "type_": "VALUE",
105
+ "value": value
106
+ ];
97
107
  case .claims(value: let values):
98
- return try values.map { try serializeAny($0)}
108
+ return [
109
+ "type_": "CLAIMS",
110
+ "value": try values.map { try serializeAny($0)}
111
+ ];
99
112
  }
100
113
  }
101
114
 
@@ -103,6 +116,7 @@ private func serialize(invitationResponse: HandleInvitationResponseBindingEnum)
103
116
  switch (invitationResponse) {
104
117
  case let .credentialIssuance(interactionId, keyStorageSecurityLevels, keyAlgorithms, txCode):
105
118
  var result: [String: Any] = [
119
+ "type_": "CREDENTIAL_ISSUANCE",
106
120
  "interactionId": interactionId
107
121
  ];
108
122
  if let keyStorageSecurityLevels = keyStorageSecurityLevels {
@@ -118,40 +132,62 @@ private func serialize(invitationResponse: HandleInvitationResponseBindingEnum)
118
132
 
119
133
  case let .proofRequest(interactionId, proofId):
120
134
  return [
135
+ "type_": "PROOF_REQUEST",
121
136
  "interactionId": interactionId,
122
137
  "proofId": proofId
123
138
  ];
124
139
 
125
140
  case let .authorizationCodeFlow(interactionId, authorizationCodeFlowUrl):
126
141
  return [
142
+ "type_": "AUTHORIZATION_CODE_FLOW",
127
143
  "interactionId": interactionId,
128
144
  "authorizationCodeFlowUrl": authorizationCodeFlowUrl
129
145
  ];
130
146
  }
131
147
  }
132
148
 
133
- private func serialize(credentialQuery: CredentialQueryResponseBindingDto) throws -> Any {
134
- var result: [String: Any] = ["multiple": credentialQuery.multiple]
135
- switch (credentialQuery.credentialOrFailureHint) {
149
+ private func serialize(applicableCredentialQuery: ApplicableCredentialOrFailureHintBindingEnum) throws -> NSDictionary {
150
+ switch (applicableCredentialQuery) {
136
151
  case let .applicableCredentials(applicableCredentials: value):
137
- result["applicableCredentials"] = try serializeAny(value);
152
+ return [
153
+ "type_": "APPLICABLE_CREDENTIALS",
154
+ "applicableCredentials": try serializeAny(value)
155
+ ];
156
+
138
157
  case let .failureHint(failureHint: value):
139
- result["failureHint"] = try serializeAny(value);
158
+ return [
159
+ "type_": "FAILURE_HINT",
160
+ "failureHint": try serializeAny(value)
161
+ ];
140
162
  }
141
- return result as NSDictionary;
142
163
  }
143
164
 
144
- private func serialize(presentationDefinitionV2ClaimValue: PresentationDefinitionV2ClaimValueBindingDto) throws -> Any {
165
+ private func serialize(presentationDefinitionV2ClaimValue: PresentationDefinitionV2ClaimValueBindingDto) throws -> NSDictionary {
145
166
  switch (presentationDefinitionV2ClaimValue) {
146
167
  case let .boolean(value):
147
- return value;
168
+ return [
169
+ "type_": "BOOLEAN",
170
+ "value": value
171
+ ];
148
172
  case let .float(value):
149
- return value;
173
+ return [
174
+ "type_": "FLOAT",
175
+ "value": value
176
+ ];
150
177
  case let .integer(value):
151
- return NSNumber(value: value);
178
+ return [
179
+ "type_": "INTEGER",
180
+ "value": NSNumber(value: value)
181
+ ];
152
182
  case let .string(value):
153
- return value;
183
+ return [
184
+ "type_": "STRING",
185
+ "value": value
186
+ ];
154
187
  case .nested(value: let values):
155
- return try values.map { try serializeAny($0) }
188
+ return [
189
+ "type_": "NESTED",
190
+ "value": try values.map { try serializeAny($0) }
191
+ ];
156
192
  }
157
193
  }
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@procivis/react-native-one-core",
3
- "version": "1.75488.0",
3
+ "version": "1.81885.0",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "ONE core bindings for React Native",
7
- "repository": "https://github.com/procivis/react-native-one-core",
7
+ "repository": {
8
+ "url": "git+https://github.com/procivis/react-native-one-core"
9
+ },
8
10
  "homepage": "https://procivis.ch",
9
11
  "main": "dist/index.js",
10
12
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source = { :git => "https://gitlab.procivis.ch/procivis/one/react-native-one-core.git" }
17
17
  s.source_files = "ios/**/*.{h,m,swift}"
18
18
  s.requires_arc = true
19
- s.ios.vendored_frameworks = "ios/ProcivisOneCore.xcframework", "ios/ProcivisOneCoreFFI.xcframework", "ios/UBQKit.xcframework"
19
+ s.ios.vendored_frameworks = "ios/ProcivisOneCore.xcframework", "ios/ProcivisOneCoreFFI.xcframework"
20
20
  s.prepare_command = <<-CMD
21
21
  FRAMEWORK_URL=#{sdk['url']}
22
22
  SHA_1_CHECKSUM=#{sdk['sha1']}
@@ -1,122 +0,0 @@
1
- import java.security.MessageDigest
2
- class Checksum {
3
- static getChecksum(file, type) {
4
- def digest = MessageDigest.getInstance(type)
5
- def inputStream = file.newInputStream()
6
- def buffer = new byte[16384]
7
- def len
8
-
9
- while((len=inputStream.read(buffer)) > 0) {
10
- digest.update(buffer, 0, len)
11
- }
12
-
13
- def result = ""
14
- for(byte b : digest.digest()) {
15
- result += toHex(b)
16
- }
17
- return result
18
- }
19
- private static hexChr(int b) {
20
- return Integer.toHexString(b & 0xF)
21
- }
22
- private static toHex(int b) {
23
- return hexChr((b & 0xF0) >> 4) + hexChr(b & 0x0F)
24
- }
25
- }
26
-
27
- buildscript {
28
- repositories {
29
- gradlePluginPortal()
30
- }
31
- dependencies {
32
- classpath 'org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin:1.9.0'
33
- }
34
- }
35
-
36
- apply plugin: 'com.android.library'
37
- apply plugin: 'kotlin-android'
38
- apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
39
-
40
- def safeExtGet(prop, fallback) {
41
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
42
- }
43
-
44
- android {
45
- compileSdkVersion safeExtGet('compileSdkVersion', 33)
46
- buildToolsVersion = "30.0.2"
47
-
48
- defaultConfig {
49
- minSdkVersion safeExtGet('minSdkVersion', 26)
50
- targetSdkVersion safeExtGet('targetSdkVersion', 33)
51
- versionCode 1
52
- versionName "1.0.0"
53
-
54
- consumerProguardFiles 'proguard-rules.pro'
55
- }
56
- lintOptions {
57
- abortOnError false
58
- }
59
- buildFeatures {
60
- dataBinding true
61
- }
62
- }
63
-
64
- repositories {
65
- mavenCentral()
66
- }
67
-
68
- dependencies {
69
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.9.0')}")
70
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
71
- implementation 'com.facebook.react:react-native:+'
72
-
73
- releaseApi(name: 'onecore-release', ext: 'aar')
74
- debugApi(name: 'onecore-debug', ext: 'aar')
75
- implementation 'net.java.dev.jna:jna:5.17.0@aar'
76
- implementation 'org.greenrobot:eventbus:3.3.1'
77
- implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.9.0')}")
78
- }
79
-
80
- def downloadFile = { url, file ->
81
- new URL(url).withInputStream { downloadStream ->
82
- file.withOutputStream { fileOut ->
83
- fileOut << downloadStream
84
- }
85
- }
86
- }
87
-
88
- def coreUrlAAR = { buildType ->
89
- def name = "onecore-${buildType}"
90
- def coreSdkJsonFile = file("$projectDir/../core-sdk.json")
91
- def coreSdkJson = new groovy.json.JsonSlurper().parseText(coreSdkJsonFile.text)
92
- def sdk = coreSdkJson.android[buildType]
93
-
94
- def url = sdk.url
95
- File file = new File("$projectDir/libs/${name}.aar")
96
- file.parentFile.mkdirs()
97
-
98
- def sha1Expected = sdk.sha1
99
- if (file.exists()) {
100
- if (Checksum.getChecksum(file, "SHA1") == sha1Expected) {
101
- // all good
102
- return
103
- }
104
- // The file is most likely just stale -> delete and download again
105
- file.delete()
106
- }
107
-
108
- downloadFile(url, file)
109
- def sha1sum = Checksum.getChecksum(file, "SHA1")
110
- if (sha1sum != sha1Expected) {
111
- // if the file hash still does not match then something is off
112
- println "URL($name): $url"
113
- println "sha1 expected: $sha1Expected"
114
- println "sha1 actual: $sha1sum"
115
- throw new Error("AAR file SHA1 mismatch: " + name)
116
- }
117
- }
118
-
119
- afterEvaluate {
120
- coreUrlAAR('debug')
121
- coreUrlAAR('release')
122
- }
@@ -1,123 +0,0 @@
1
- package ch.procivis.one.core.ubiqu
2
-
3
- import android.content.Intent
4
- import ch.procivis.one.core.NativeKeyStorageException
5
- import com.facebook.react.bridge.Arguments
6
- import com.facebook.react.bridge.ReactContext
7
- import com.facebook.react.bridge.WritableMap
8
- import com.facebook.react.modules.core.DeviceEventManagerModule
9
- import com.ubiqu.eid.sdk.requests.UbqRequestFlow
10
-
11
- object PinPadRunner {
12
- enum class RequestType {
13
- SUBSCRIBE,
14
- TRANSACTION,
15
- ADD_BIOMETRICS,
16
- CHANGE_PIN
17
- }
18
-
19
- enum class RNEvent {
20
- RSE_SHOW_PIN,
21
- RSE_HIDE_PIN,
22
- RSE_DIGITS_ENTERED,
23
- RSE_PIN_STAGE,
24
- RSE_INCORRECT_PIN
25
- }
26
-
27
- enum class RNEventParam {
28
- flowType,
29
- digitsEntered,
30
- stage,
31
- attemptsLeft,
32
- }
33
-
34
- enum class RNEventStage {
35
- CHECK_CURRENT_PIN,
36
- NEW_FIRST_PIN,
37
- NEW_SECOND_PIN,
38
- }
39
-
40
- data class Flow(
41
- val flow: UbqRequestFlow,
42
- val promise: Util.Promise<String?>,
43
- val type: RequestType
44
- )
45
-
46
- @Volatile
47
- private var activeFlow: Flow? = null
48
-
49
- @Synchronized
50
- fun getActiveFlow(): Flow {
51
- return activeFlow ?: throw NativeKeyStorageException.Unknown("No active flow")
52
- }
53
-
54
- private fun sendRNEvent(context: ReactContext, eventName: String, params: WritableMap?) {
55
- context
56
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
57
- .emit(eventName, params)
58
- }
59
-
60
- // ==== called from UbiquKeyStorage
61
- @Synchronized
62
- fun startPinPadFlow(
63
- context: ReactContext,
64
- flow: UbqRequestFlow,
65
- requestType: RequestType,
66
- promise: Util.Promise<String?>
67
- ) {
68
- if (activeFlow != null) {
69
- throw NativeKeyStorageException.Unknown("Another PinPad flow in progress")
70
- }
71
-
72
- activeFlow = Flow(flow, promise, requestType)
73
-
74
- val params = Arguments.createMap()
75
- params.putString(RNEventParam.flowType.name, requestType.name)
76
-
77
- val initialStage = when (requestType) {
78
- RequestType.SUBSCRIBE -> RNEventStage.NEW_FIRST_PIN
79
- else -> RNEventStage.CHECK_CURRENT_PIN
80
- }
81
- params.putString(RNEventParam.stage.name, initialStage.name)
82
- sendRNEvent(context, RNEvent.RSE_SHOW_PIN.name, params)
83
- }
84
-
85
- @Synchronized
86
- fun cancelPinPadFlow() {
87
- activeFlow?.promise?.fail(NativeKeyStorageException.Unknown("Canceled by user"))
88
- activeFlow = null
89
- }
90
-
91
- // ==== called from PinPadWrapper
92
- @Synchronized
93
- fun finishPinPadFlowSuccess(context: ReactContext, data: String?) {
94
- activeFlow?.promise?.succeed(data)
95
- activeFlow = null
96
- sendRNEvent(context, RNEvent.RSE_HIDE_PIN.name, null)
97
- }
98
-
99
- @Synchronized
100
- fun finishPinPadFlowFailure(context: ReactContext, error: Throwable) {
101
- activeFlow?.promise?.fail(error)
102
- activeFlow = null
103
- sendRNEvent(context, RNEvent.RSE_HIDE_PIN.name, null)
104
- }
105
-
106
- fun digitsEntered(context: ReactContext, numPins: Int) {
107
- val params = Arguments.createMap()
108
- params.putInt(RNEventParam.digitsEntered.name, numPins)
109
- sendRNEvent(context, RNEvent.RSE_DIGITS_ENTERED.name, params)
110
- }
111
-
112
- fun pinStage(context: ReactContext, stage: RNEventStage) {
113
- val params = Arguments.createMap()
114
- params.putString(RNEventParam.stage.name, stage.name)
115
- sendRNEvent(context, RNEvent.RSE_PIN_STAGE.name, params)
116
- }
117
-
118
- fun incorrectPin(context: ReactContext, attemptsLeft: Int) {
119
- val params = Arguments.createMap()
120
- params.putInt(RNEventParam.attemptsLeft.name, attemptsLeft)
121
- sendRNEvent(context, RNEvent.RSE_INCORRECT_PIN.name, params)
122
- }
123
- }
@@ -1,20 +0,0 @@
1
- package ch.procivis.one.core.ubiqu
2
-
3
- import android.view.View
4
- import ch.procivis.one.core.NativeKeyStorageException
5
- import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.uimanager.SimpleViewManager
7
- import com.facebook.react.uimanager.ThemedReactContext
8
-
9
- class PinPadViewManager(private val callerContext: ReactApplicationContext) :
10
- SimpleViewManager<View>() {
11
- companion object {
12
- const val REACT_CLASS = "RCTProcivisRSEPinPad"
13
- }
14
-
15
- override fun getName() = REACT_CLASS
16
-
17
- override fun createViewInstance(context: ThemedReactContext): View {
18
- throw NativeKeyStorageException.Unsupported()
19
- }
20
- }