@procivis/react-native-one-core 1.75488.0 → 1.77931.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.
@@ -6,7 +6,7 @@ import kotlin.reflect.KClass
6
6
 
7
7
  object DeserializeSpecific {
8
8
  object Obj {
9
- private val CustomConversionTypes = arrayOf(CredentialSchemaTypeBindingEnum::class, OptionalString::class)
9
+ private val CustomConversionTypes = arrayOf(OptionalString::class)
10
10
 
11
11
  fun isCustomConversionType(type: KClass<*>): Boolean {
12
12
  return CustomConversionTypes.contains(type)
@@ -14,8 +14,6 @@ object DeserializeSpecific {
14
14
 
15
15
  fun convertCustom(type: KClass<*>, input: ReadableMap, field: String): Any? {
16
16
  return when (type) {
17
- CredentialSchemaTypeBindingEnum::class -> input.getString(field)
18
- ?.let { credentialSchemaType(it) }
19
17
  OptionalString::class -> {
20
18
  val value = input.getString(field)
21
19
  if (value == null) {
@@ -31,18 +29,6 @@ object DeserializeSpecific {
31
29
  }
32
30
  }
33
31
 
34
- private fun credentialSchemaType(
35
- credentialSchemaType: String
36
- ): CredentialSchemaTypeBindingEnum {
37
- return when (credentialSchemaType) {
38
- "PROCIVIS_ONE_SCHEMA2024" -> CredentialSchemaTypeBindingEnum.ProcivisOneSchema2024
39
- "FALLBACK_SCHEMA2024" -> CredentialSchemaTypeBindingEnum.FallbackSchema2024
40
- "MDOC" -> CredentialSchemaTypeBindingEnum.Mdoc
41
- "SD_JWT_VC" -> CredentialSchemaTypeBindingEnum.SdJwtVc
42
- else -> CredentialSchemaTypeBindingEnum.Other(credentialSchemaType)
43
- }
44
- }
45
-
46
32
  fun ids(ids: ReadableArray): List<String> {
47
33
  val result = mutableListOf<String>()
48
34
  for (n in 0 until ids.size()) {
@@ -54,8 +54,6 @@ object Serialize {
54
54
  return Pair(RNType.DOUBLE, input as Double)
55
55
  } else if (type == Char::class.java || type == java.lang.Character::class.java) {
56
56
  return Pair(RNType.STRING, (input as Char).toString())
57
- } else if (SerializeSpecific.Str.isCustomConversionType(input)) {
58
- return Pair(RNType.STRING, SerializeSpecific.Str.convertCustom(input))
59
57
  } else if (SerializeSpecific.Arr.isCustomConversionType(input)) {
60
58
  return Pair(RNType.ARRAY, SerializeSpecific.Arr.convertCustom(input))
61
59
  } else {
@@ -79,10 +79,8 @@ object SerializeSpecific {
79
79
 
80
80
  private fun claim(c: ClaimBindingDto): ReadableMap {
81
81
  val result = Arguments.createMap()
82
- result.putString("id", c.id)
83
- result.putString("key", c.key)
84
- result.putString("dataType", c.dataType)
85
- result.putBoolean("array", c.array)
82
+ result.putString("path", c.path)
83
+ result.putMap("schema", convertToRN(c.schema) as ReadableMap)
86
84
 
87
85
  when (val value = c.value) {
88
86
  is ClaimValueBindingDto.Boolean -> result.putBoolean("value", value.value)
@@ -159,48 +157,6 @@ object SerializeSpecific {
159
157
  }
160
158
  }
161
159
 
162
- object Str {
163
- private val CustomConversionTypes =
164
- arrayOf(
165
- CredentialSchemaTypeBindingEnum::class.java,
166
- )
167
-
168
- fun isCustomConversionType(input: Any?): Boolean {
169
- for (customType in CustomConversionTypes) {
170
- if (customType.isInstance(input)) {
171
- return true
172
- }
173
- }
174
- return false
175
- }
176
-
177
- fun convertCustom(input: Any): String {
178
- if (input is CredentialSchemaTypeBindingEnum) {
179
- return credentialSchemaType(input)
180
- }
181
- throw IllegalArgumentException("Invalid string conversion: $input")
182
- }
183
-
184
- private fun credentialSchemaType(type: CredentialSchemaTypeBindingEnum): String {
185
- return when (type) {
186
- is CredentialSchemaTypeBindingEnum.ProcivisOneSchema2024 ->
187
- "PROCIVIS_ONE_SCHEMA2024"
188
-
189
- is CredentialSchemaTypeBindingEnum.FallbackSchema2024 ->
190
- "FALLBACK_SCHEMA2024"
191
-
192
- is CredentialSchemaTypeBindingEnum.Mdoc ->
193
- "MDOC"
194
-
195
- is CredentialSchemaTypeBindingEnum.SdJwtVc ->
196
- "SD_JWT_VC"
197
-
198
- is CredentialSchemaTypeBindingEnum.Other ->
199
- type.value
200
- }
201
- }
202
- }
203
-
204
160
  object Arr {
205
161
  fun isCustomConversionType(input: Any?): Boolean {
206
162
  return ByteArray::class.isInstance(input)
package/core-sdk.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "android": {
3
3
  "debug": {
4
- "url": "https://onesdk.blob.core.windows.net/core-sdk/75488/android/onecore-debug.aar",
5
- "sha1": "82090e020b12f7dd20ee474659fb195016db809e"
4
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/77931/android/onecore-debug.aar",
5
+ "sha1": "ea1734095aaa959d507e9520e8756a387f468517"
6
6
  },
7
7
  "release": {
8
- "url": "https://onesdk.blob.core.windows.net/core-sdk/75488/android/onecore-release.aar",
9
- "sha1": "1dc1697ac7f869476111fb5eb82cc59efa4fd671"
8
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/77931/android/onecore-release.aar",
9
+ "sha1": "ebe7d4bdf25d3a15c50685e1c9a3be0ba8147ba5"
10
10
  }
11
11
  },
12
12
  "ios": {
13
- "url": "https://onesdk.blob.core.windows.net/core-sdk/75488/ios/deploy.zip",
14
- "sha1": "c54194bbcc1c6907324360121b079af3c406a455"
13
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/77931/ios/deploy.zip",
14
+ "sha1": "c9332d8e6216f8c96c579180046b6fda567109b0"
15
15
  }
16
16
  }
package/dist/index.d.ts CHANGED
@@ -2,7 +2,9 @@ import { ONECore } from "./src/core";
2
2
  import * as ubiqu from "./src/ubiqu";
3
3
  export * from "./src/core";
4
4
  export * from "./src/error";
5
+ /** @hidden */
5
6
  export declare const Ubiqu: typeof ubiqu;
7
+ /** @hidden */
6
8
  export declare namespace Ubiqu {
7
9
  type PinEventType = ubiqu.PinEventType;
8
10
  type PinFlowType = ubiqu.PinFlowType;
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { interfaceMethodNames } from "./src/core";
4
4
  import * as ubiqu from "./src/ubiqu";
5
5
  export * from "./src/core";
6
6
  export * from "./src/error";
7
+ /** @hidden */
7
8
  export const Ubiqu = ubiqu;
8
9
  const ONE = NativeModules.ProcivisOneCoreModule;
9
10
  // New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
@@ -183,4 +183,8 @@ export interface ONECore {
183
183
  */
184
184
  uninitialize(deleteData: boolean): Promise<void>;
185
185
  }
186
+ /**
187
+ * @hidden
188
+ * New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
189
+ */
186
190
  export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "createIdentifier", "getIdentifier", "getIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinition", "getPresentationDefinitionV2", "holderRejectProof", "holderSubmitProof", "holderSubmitProofV2", "getCredentials", "runTask", "deleteProofClaims", "getCredential", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "getCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofs", "deleteProof", "proposeProof", "createProofSchema", "getProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "createTrustAnchor", "deleteTrustAnchor", "getTrustAnchor", "getTrustAnchors", "createTrustEntity", "getTrustEntity", "getTrustEntities", "getTrustEntityByDid", "resolveTrustEntityByIdentifier", "createRemoteTrustEntity", "getRemoteTrustEntity", "updateRemoteTrustEntity", "getHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterWalletUnit", "holderWalletUnitStatus", "holderGetWalletUnit", "nfcReadIsoMdlEngagement", "nfcStopIsoMdlEngagement", "uninitialize"];
package/dist/src/core.js CHANGED
@@ -14,7 +14,10 @@ export * from "./proof";
14
14
  export * from "./proofSchema";
15
15
  export * from "./trust";
16
16
  export * from "./walletUnit";
17
- // New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
17
+ /**
18
+ * @hidden
19
+ * New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
20
+ */
18
21
  export const interfaceMethodNames = [
19
22
  "getVersion",
20
23
  "getConfig",
@@ -1,5 +1,4 @@
1
- import { DataTypeEnum } from "./config";
2
- import { CredentialSchema, KeyStorageSecurity } from "./credentialSchema";
1
+ import { ClaimSchema, CredentialSchema, KeyStorageSecurity } from "./credentialSchema";
3
2
  import { ListQuery, SortDirection } from "./list";
4
3
  import { IdentifierListItem } from "./identifier";
5
4
  export declare enum CredentialStateEnum {
@@ -12,35 +11,12 @@ export declare enum CredentialStateEnum {
12
11
  SUSPENDED = "SUSPENDED",
13
12
  ERROR = "ERROR"
14
13
  }
15
- export type ClaimValue = {
16
- dataType: DataTypeEnum.String | DataTypeEnum.Date | DataTypeEnum.Picture | DataTypeEnum.SwiyuPicture;
17
- value: string;
18
- array: false;
19
- } | {
20
- dataType: DataTypeEnum.Number;
21
- value: number;
22
- array: false;
23
- } | {
24
- dataType: DataTypeEnum.Boolean;
25
- value: boolean;
26
- array: false;
27
- } | {
28
- dataType: DataTypeEnum.Object;
29
- value: Claim[];
30
- array: false;
31
- } | {
32
- dataType: string;
33
- value: string | number | boolean;
34
- array: false;
35
- } | {
36
- dataType: string;
37
- value: Claim[];
38
- array: true;
39
- };
40
- export type Claim = ClaimValue & {
41
- id: string;
42
- key: string;
43
- };
14
+ export interface Claim {
15
+ path: string;
16
+ schema: ClaimSchema;
17
+ value: ClaimValue;
18
+ }
19
+ export type ClaimValue = string | number | boolean | Claim[];
44
20
  export interface CredentialListItem {
45
21
  id: string;
46
22
  createdDate: string;
@@ -129,7 +129,7 @@ export interface PresentationDefinitionField {
129
129
  name?: string;
130
130
  purpose?: string;
131
131
  required: boolean;
132
- keyMap: Record<CredentialListItem["id"], Claim["key"]>;
132
+ keyMap: Record<CredentialListItem["id"], Claim["path"]>;
133
133
  }
134
134
  export interface PresentationSubmitCredentialRequest {
135
135
  credentialId: CredentialListItem["id"];
@@ -68,17 +68,6 @@ func deserializeOpt<T: Decodable>(_ value: Any?) throws -> T? {
68
68
  private func deserializeSpecific(_ value: Any, _ type: Any.Type, _ codingPath: [CodingKey]) throws
69
69
  -> Any?
70
70
  {
71
- if type == CredentialSchemaTypeBindingEnum.self {
72
- guard let data = value as? String else {
73
- let description = "Expected to decode \(type) but found '\(value)' instead."
74
- throw DecodingError.typeMismatch(
75
- type,
76
- DecodingError.Context(codingPath: codingPath, debugDescription: description)
77
- )
78
- }
79
- return deserializeCredentialSchemaTypeBindingEnum(data)
80
- }
81
-
82
71
  if type == OptionalString.self {
83
72
  if value is NSNull {
84
73
  return OptionalString.none
@@ -96,20 +85,3 @@ private func deserializeSpecific(_ value: Any, _ type: Any.Type, _ codingPath: [
96
85
 
97
86
  return nil
98
87
  }
99
-
100
- private func deserializeCredentialSchemaTypeBindingEnum(_ credentialSchemaType: String)
101
- -> CredentialSchemaTypeBindingEnum
102
- {
103
- switch credentialSchemaType {
104
- case "PROCIVIS_ONE_SCHEMA2024":
105
- return .procivisOneSchema2024
106
- case "FALLBACK_SCHEMA2024":
107
- return .fallbackSchema2024
108
- case "MDOC":
109
- return .mdoc
110
- case "SD_JWT_VC":
111
- return .sdJwtVc
112
- case let other:
113
- return .other(value: other)
114
- }
115
- }
@@ -31,8 +31,6 @@ 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:
@@ -60,21 +58,6 @@ private func serialize(historyMetadata: HistoryMetadataBinding) throws -> Any {
60
58
  }
61
59
  }
62
60
 
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;
75
- }
76
- }
77
-
78
61
  private func serialize(claimValue: ClaimValueBindingDto) throws -> Any {
79
62
  switch (claimValue) {
80
63
  case let .boolean(value):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procivis/react-native-one-core",
3
- "version": "1.75488.0",
3
+ "version": "1.77931.0",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "ONE core bindings for React Native",