@procivis/react-native-one-core 1.126524.0 → 1.133039.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.
@@ -30,6 +30,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
30
30
  ErrorResponse(
31
31
  "BR_0184",
32
32
  "core not initialized",
33
+ null,
33
34
  null
34
35
  )
35
36
  )
@@ -41,6 +42,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
41
42
  ErrorResponse(
42
43
  "BR_0184",
43
44
  "ubiqu not initialized",
45
+ null,
44
46
  null
45
47
  )
46
48
  )
@@ -71,8 +71,15 @@ object SerializeSpecific {
71
71
  )
72
72
  }
73
73
 
74
- is HistoryMetadata.WalletUnitJwt -> {
75
- result.putString("type_", "WALLET_UNIT_JWT")
74
+ is HistoryMetadata.ManagedInstanceAttestation -> {
75
+ result.putString("type_", "MANAGED_INSTANCE_ATTESTATION")
76
+ val values = Arguments.createArray()
77
+ values.pushString(metadata.v1)
78
+ result.putArray("value", values)
79
+ }
80
+
81
+ is HistoryMetadata.WalletAttestation -> {
82
+ result.putString("type_", "WALLET_ATTESTATION")
76
83
  val values = Arguments.createArray()
77
84
  values.pushString(metadata.v1)
78
85
  result.putArray("value", values)
@@ -1,12 +1,18 @@
1
1
  package ch.procivis.one.core
2
2
 
3
+ import android.annotation.SuppressLint
4
+ import android.util.Log
5
+ import ch.procivis.one.core.Serialize.convertToRN
3
6
  import com.facebook.react.bridge.Arguments
4
7
  import com.facebook.react.bridge.Promise
5
8
  import com.facebook.react.bridge.ReadableMap
6
9
  import kotlinx.coroutines.CoroutineScope
7
10
  import kotlinx.coroutines.launch
8
11
 
12
+ @SuppressLint("LogNotTimber")
9
13
  object Util {
14
+ private const val TAG = "ch.procivis.one.core.Util"
15
+
10
16
  // error handling + running core code outside JS thread
11
17
  fun syncCall(promise: Promise, function: () -> Any?) {
12
18
  object : Thread() {
@@ -36,11 +42,19 @@ object Util {
36
42
 
37
43
  private fun handleBindingException(promise: Promise, error: OneCoreException.Response) {
38
44
  val userInfo = Arguments.createMap()
39
- val cause = error.data.cause?.message
40
- if (!cause.isNullOrEmpty()) {
41
- userInfo.putString("cause", cause)
42
- }
43
45
 
46
+ try {
47
+ error.data.cause?.let { cause ->
48
+ userInfo.putMap("cause", convertToRN(cause) as ReadableMap)
49
+ }
50
+
51
+ error.data.data?.let { data ->
52
+ userInfo.putMap("data", convertToRN(data) as ReadableMap)
53
+ }
54
+ } catch (error: Throwable) {
55
+ Log.w(TAG, "Failed to parse error userInfo: $error")
56
+ }
57
+
44
58
  promise.reject(
45
59
  error.data.code,
46
60
  error.data.message,
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/126524/android/onecore-debug.aar",
5
- "sha1": "feef82a3e79882cda0339fdcf8fd9e086fb7a349"
4
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/133039/android/onecore-debug.aar",
5
+ "sha1": "784656f7849f8ad2898a52815c4bad4a2285efab"
6
6
  },
7
7
  "release": {
8
- "url": "https://onesdk.blob.core.windows.net/core-sdk/126524/android/onecore-release.aar",
9
- "sha1": "fce0244e6bcb8abb19495818adbed33f17688326"
8
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/133039/android/onecore-release.aar",
9
+ "sha1": "d6d85c3b594dd214905f366bc80451e7b06c6601"
10
10
  }
11
11
  },
12
12
  "ios": {
13
- "url": "https://onesdk.blob.core.windows.net/core-sdk/126524/ios/deploy.zip",
14
- "sha1": "2b1b11c6f9d1ead1713b92a0819f1d97c58de114"
13
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/133039/ios/deploy.zip",
14
+ "sha1": "b0a910facc05bdfa239b31a1c7f09c8c9feb0092"
15
15
  }
16
16
  }
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NativeModules } from "react-native";
2
2
  import { OneError } from "./src/error";
3
- import { interfaceMethodNames } from "./src/core";
3
+ 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";
@@ -18,7 +18,7 @@ if (originalGetConfig) {
18
18
  const parsed = objectMap(providers, (entityValue) => objectMap(entityValue, (json) => JSON.parse(json)));
19
19
  return {
20
20
  globalSettings,
21
- ...parsed
21
+ ...parsed,
22
22
  };
23
23
  });
24
24
  }
@@ -40,18 +40,22 @@ const objectMap = (obj, fn) => Object.fromEntries(Object.entries(obj).map(([k, v
40
40
  function wrapFn(fn, operation) {
41
41
  return (...args) => {
42
42
  const errHandler = (e) => {
43
- if (e instanceof Error && "code" in e) {
43
+ if (e instanceof Error && "code" in e && typeof e.code === "string") {
44
44
  const userInfo = "userInfo" in e && typeof e.userInfo === "object"
45
45
  ? e.userInfo
46
46
  : undefined;
47
- const cause = userInfo && "cause" in userInfo && typeof userInfo.cause === "string"
47
+ const cause = userInfo && "cause" in userInfo && typeof userInfo.cause === "object"
48
48
  ? userInfo.cause
49
49
  : undefined;
50
+ const data = userInfo && "data" in userInfo && typeof userInfo.data === "object"
51
+ ? userInfo.data
52
+ : undefined;
50
53
  throw new OneError({
51
54
  operation,
52
55
  code: e.code,
53
56
  message: e.message,
54
57
  cause,
58
+ data,
55
59
  originalError: e,
56
60
  });
57
61
  // iOS additional fields: "nativeStackIOS"
@@ -1,16 +1,19 @@
1
+ import { ErrorData, Cause } from "./core";
1
2
  /**
2
3
  * Specific errors being thrown from the {@link ONECore} functions
3
4
  */
4
5
  export declare class OneError extends Error {
5
6
  readonly operation: string;
6
7
  readonly code: string;
7
- readonly cause?: string;
8
+ readonly cause?: Cause;
9
+ readonly data?: ErrorData;
8
10
  readonly originalError: Error;
9
11
  constructor(params: {
10
12
  operation: string;
11
13
  code: string;
12
14
  message: string;
13
- cause?: string;
15
+ cause?: Cause;
16
+ data?: ErrorData;
14
17
  originalError: Error;
15
18
  });
16
19
  }
package/dist/src/error.js CHANGED
@@ -5,12 +5,14 @@ export class OneError extends Error {
5
5
  operation;
6
6
  code;
7
7
  cause;
8
+ data;
8
9
  originalError;
9
10
  constructor(params) {
10
11
  super(params.message);
11
12
  this.operation = params.operation;
12
13
  this.code = params.code;
13
14
  this.cause = params.cause;
15
+ this.data = params.data;
14
16
  this.originalError = params.originalError;
15
17
  }
16
18
  }
@@ -102,6 +102,10 @@ export interface Config {
102
102
  * management, trust collections, and feature flags.
103
103
  */
104
104
  walletProvider: Record<string, string>;
105
+ /**
106
+ * Configurations from the Verifier Provider, incluiding
107
+ * version management, ecosystems, and feature flags.
108
+ */
105
109
  verifierProvider: Record<string, string>;
106
110
  /** Transaction data types and their capabilities. */
107
111
  transactionDataProvider: Record<string, string>;
@@ -139,12 +143,11 @@ export interface CreateCredentialSchemaRequest {
139
143
  formats: Array<CredentialSchemaFormatRequest>;
140
144
  organisationId: string;
141
145
  claims: Array<CredentialClaimSchemaRequest>;
142
- keyStorageSecurity?: KeyStorageSecurity;
146
+ walletAttestation?: CredentialSchemaWalletAttestation;
143
147
  layoutProperties?: CredentialSchemaLayoutProperties;
144
148
  allowSuspension?: boolean;
145
149
  allowRevocation?: boolean;
146
150
  batchSize?: number;
147
- requiresWalletInstanceAttestation: boolean;
148
151
  transactionCode?: CredentialSchemaTransactionCodeRequest;
149
152
  translations?: CredentialSchemaTranslations;
150
153
  embeddedDisclosurePolicy?: DisclosurePolicyCreateRequest;
@@ -244,6 +247,11 @@ export interface CreateProofRequest {
244
247
  ecosystem?: string;
245
248
  }
246
249
  export interface CreateProofSchemaInput {
250
+ /**
251
+ * Formatter provider names selected for this input. If omitted, all
252
+ * formats of the credential schema are selected.
253
+ */
254
+ formats?: Array<string>;
247
255
  credentialSchemaId: string;
248
256
  claimSchemas: Array<CreateProofSchemaInputClaim>;
249
257
  }
@@ -331,7 +339,8 @@ export interface CredentialDetail {
331
339
  trustInformation?: TrustInformation;
332
340
  consumedAt?: string;
333
341
  type: CredentialType;
334
- remainingBatchItemCount?: number;
342
+ remainingBatchItemCount?: Record<string, number>;
343
+ format?: string;
335
344
  parentId?: string;
336
345
  ecosystem?: string;
337
346
  }
@@ -368,6 +377,7 @@ export interface CredentialListItem {
368
377
  profile?: string;
369
378
  consumedAt?: string;
370
379
  type: CredentialType;
380
+ format?: string;
371
381
  parentId?: string;
372
382
  redirectUri?: string;
373
383
  ecosystem?: string;
@@ -387,6 +397,8 @@ export interface CredentialListQuery {
387
397
  name?: string;
388
398
  /** Filter by one or more country profiles. */
389
399
  profiles?: Array<string>;
400
+ /** Filter by one or more formatter configuration names. */
401
+ formats?: Array<string>;
390
402
  /** Search for a string. */
391
403
  searchText?: string;
392
404
  /**
@@ -488,13 +500,12 @@ export interface CredentialSchemaDetail {
488
500
  formats: Array<CredentialSchemaFormatResponse>;
489
501
  organisationId: string;
490
502
  claims: Array<ClaimSchema>;
491
- keyStorageSecurity?: KeyStorageSecurity;
503
+ walletAttestation: CredentialSchemaWalletAttestation;
492
504
  importedSourceUrl: string;
493
505
  layoutProperties?: CredentialSchemaLayoutProperties;
494
506
  allowSuspension: boolean;
495
507
  allowRevocation?: boolean;
496
508
  batchSize?: number;
497
- requiresWalletInstanceAttestation: boolean;
498
509
  transactionCode?: CredentialSchemaTransactionCode;
499
510
  translations: CredentialSchemaTranslations;
500
511
  expiration?: number;
@@ -558,13 +569,12 @@ export interface CredentialSchemaListItem {
558
569
  lastModified: string;
559
570
  name: string;
560
571
  formats: Array<CredentialSchemaFormatResponse>;
561
- keyStorageSecurity?: KeyStorageSecurity;
572
+ walletAttestation: CredentialSchemaWalletAttestation;
562
573
  importedSourceUrl: string;
563
574
  layoutProperties?: CredentialSchemaLayoutProperties;
564
575
  allowSuspension: boolean;
565
576
  allowRevocation?: boolean;
566
577
  batchSize?: number;
567
- requiresWalletInstanceAttestation: boolean;
568
578
  expiration?: number;
569
579
  ecosystem?: string;
570
580
  translations?: CredentialSchemaTranslations;
@@ -611,6 +621,12 @@ export interface CredentialSchemaTranslations {
611
621
  name: Record<string, string>;
612
622
  description?: Record<string, string>;
613
623
  }
624
+ export interface CredentialSchemaWalletAttestation {
625
+ requireInstanceAttestation: boolean;
626
+ keyStorageSecurityLevel?: KeyStorageSecurity;
627
+ preferredKeyStorageAttestationLifetime?: number;
628
+ preferredInstanceAttestationLifetime?: number;
629
+ }
614
630
  export interface CredentialSet {
615
631
  required: boolean;
616
632
  options: Array<Array<string>>;
@@ -723,15 +739,21 @@ export interface EcosystemOutcome {
723
739
  /** Why the provider did not trust the interaction. `None` when it did. */
724
740
  error?: HistoryErrorMetadata;
725
741
  }
742
+ export interface ErrorData {
743
+ ecosystemErrors?: Record<string, EcosystemOutcome>;
744
+ }
726
745
  export interface ErrorResponse {
727
746
  code: string;
728
747
  message: string;
729
748
  cause?: Cause;
749
+ /** Only set when ecosystems rejected the interaction */
750
+ data?: ErrorData;
730
751
  }
731
752
  export interface EudiIntermediary {
732
753
  name?: string;
733
754
  identifier: string;
734
- website: string;
755
+ supportUrl?: string;
756
+ infoUrl?: string;
735
757
  email?: string;
736
758
  phone?: string;
737
759
  country: string;
@@ -743,7 +765,9 @@ export interface EudiSupervisoryAuthority {
743
765
  }
744
766
  export interface EudiTrustInformation {
745
767
  name: string;
746
- website: string;
768
+ supportUrl?: string;
769
+ infoUrl?: string;
770
+ privacyPolicyUrl?: string;
747
771
  email?: string;
748
772
  phone?: string;
749
773
  country: string;
@@ -919,7 +943,7 @@ export interface HolderAcceptCredentialResponse {
919
943
  * Only set when several configurations were offered.
920
944
  */
921
945
  partiallySuccessful?: boolean;
922
- /** One entry per ecosystem provider consulted, keyed by provider id. */
946
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
923
947
  ecosystemErrors: Record<string, EcosystemOutcome>;
924
948
  }
925
949
  export interface HolderActivateInstanceRequest {
@@ -1086,11 +1110,10 @@ export interface ImportCredentialSchemaRequestSchema {
1086
1110
  formats: Array<ImportCredentialSchemaFormat>;
1087
1111
  organisationId: string;
1088
1112
  claims: Array<ImportCredentialSchemaClaimSchema>;
1089
- keyStorageSecurity?: KeyStorageSecurity;
1113
+ walletAttestation?: CredentialSchemaWalletAttestation;
1090
1114
  importedSourceUrl: string;
1091
1115
  layoutProperties?: ImportCredentialSchemaLayoutProperties;
1092
1116
  allowSuspension?: boolean;
1093
- requiresWalletInstanceAttestation?: boolean;
1094
1117
  transactionCode?: ImportCredentialSchemaTransactionCode;
1095
1118
  allowRevocation?: boolean;
1096
1119
  batchSize?: number;
@@ -1121,6 +1144,7 @@ export interface ImportProofSchema {
1121
1144
  importedSourceUrl: string;
1122
1145
  /** Set of all claims to request. */
1123
1146
  proofInputSchemas: Array<ImportProofSchemaInputSchema>;
1147
+ ecosystem?: string;
1124
1148
  }
1125
1149
  export interface ImportProofSchemaClaimSchema {
1126
1150
  id: string;
@@ -1145,8 +1169,14 @@ export interface ImportProofSchemaCredentialSchema {
1145
1169
  layoutProperties?: CredentialSchemaLayoutProperties;
1146
1170
  allowSuspension?: boolean;
1147
1171
  requiresWalletInstanceAttestation?: boolean;
1172
+ ecosystem?: string;
1148
1173
  }
1149
1174
  export interface ImportProofSchemaInputSchema {
1175
+ /**
1176
+ * Formatter provider names selected for this input. Defaulting
1177
+ * to all formats of the resolved credential schema if omitted.
1178
+ */
1179
+ formats?: Array<string>;
1150
1180
  claimSchemas: Array<ImportProofSchemaClaimSchema>;
1151
1181
  credentialSchema: ImportProofSchemaCredentialSchema;
1152
1182
  }
@@ -1343,6 +1373,7 @@ export interface PresentationDefinitionV2Credential {
1343
1373
  mdocMsoValidity?: MdocMsoValidity;
1344
1374
  protocol: string;
1345
1375
  profile?: string;
1376
+ format?: string;
1346
1377
  /**
1347
1378
  * Present when the relying party's certificates do not satisfy
1348
1379
  * the embedded disclosure policy attached to the requested
@@ -1438,6 +1469,8 @@ export interface ProofInput {
1438
1469
  trustInformation?: TrustInformation;
1439
1470
  }
1440
1471
  export interface ProofInputSchema {
1472
+ /** Formatter provider names saved for this proof input. */
1473
+ formats: Array<string>;
1441
1474
  claimSchemas: Array<ProofClaimSchema>;
1442
1475
  credentialSchema: CredentialSchemaInfo;
1443
1476
  }
@@ -1734,14 +1767,14 @@ export interface TrustInformation {
1734
1767
  receivedAt: string;
1735
1768
  name?: string;
1736
1769
  result: TrustResolutionResult;
1737
- /** One entry per ecosystem provider consulted, keyed by provider id. */
1770
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
1738
1771
  ecosystemErrors: Record<string, EcosystemOutcome>;
1739
1772
  }
1740
1773
  export interface TrustInformationDetail {
1741
1774
  ecosystem?: string;
1742
1775
  issuer?: TrustInformationDetailInfo;
1743
1776
  verifier?: TrustInformationDetailInfo;
1744
- /** One entry per ecosystem provider consulted, keyed by provider id. */
1777
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
1745
1778
  ecosystemErrors: Record<string, EcosystemOutcome>;
1746
1779
  }
1747
1780
  export interface TrustResolutionMetadata {
@@ -2092,7 +2125,7 @@ export type HandleInvitationResponse = {
2092
2125
  /** Whether a valid WIA is required to complete issuance. */
2093
2126
  requiresWalletInstanceAttestation: boolean;
2094
2127
  ecosystem?: string;
2095
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2128
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
2096
2129
  ecosystemErrors: Record<string, EcosystemOutcome>;
2097
2130
  } | {
2098
2131
  type_: "AUTHORIZATION_CODE_FLOW";
@@ -2106,7 +2139,7 @@ export type HandleInvitationResponse = {
2106
2139
  /** Protocol used for issuance. */
2107
2140
  protocol: string;
2108
2141
  ecosystem?: string;
2109
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2142
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
2110
2143
  ecosystemErrors: Record<string, EcosystemOutcome>;
2111
2144
  } | {
2112
2145
  type_: "PROOF_REQUEST";
@@ -2117,7 +2150,7 @@ export type HandleInvitationResponse = {
2117
2150
  /** Protocol used for issuance. */
2118
2151
  protocol: string;
2119
2152
  ecosystem?: string;
2120
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2153
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
2121
2154
  ecosystemErrors: Record<string, EcosystemOutcome>;
2122
2155
  };
2123
2156
  export declare enum HistoryAction {
@@ -2156,7 +2189,10 @@ export declare enum HistoryAction {
2156
2189
  TRUST_RESOLVED = "TRUST_RESOLVED",
2157
2190
  ECOSYSTEMS_RESOLVED = "ECOSYSTEMS_RESOLVED",
2158
2191
  REFRESHED = "REFRESHED",
2159
- SIGNED = "SIGNED"
2192
+ SIGNED = "SIGNED",
2193
+ KA_CREATED = "KA_CREATED",
2194
+ WIA_CREATED = "WIA_CREATED",
2195
+ CLIENT_SECRET_REGENERATED = "CLIENT_SECRET_REGENERATED"
2160
2196
  }
2161
2197
  export declare enum HistoryEntityType {
2162
2198
  KEY = "KEY",
@@ -2169,7 +2205,8 @@ export declare enum HistoryEntityType {
2169
2205
  PROOF_SCHEMA = "PROOF_SCHEMA",
2170
2206
  ORGANISATION = "ORGANISATION",
2171
2207
  BACKUP = "BACKUP",
2172
- WALLET_UNIT = "WALLET_UNIT",
2208
+ INSTANCE = "INSTANCE",
2209
+ MANAGED_INSTANCE = "MANAGED_INSTANCE",
2173
2210
  USER = "USER",
2174
2211
  PROVIDER = "PROVIDER",
2175
2212
  WALLET_RELYING_PARTY = "WALLET_RELYING_PARTY",
@@ -2193,7 +2230,10 @@ export type HistoryMetadata = {
2193
2230
  type_: "ERROR_METADATA";
2194
2231
  value: HistoryErrorMetadata;
2195
2232
  } | {
2196
- type_: "WALLET_UNIT_JWT";
2233
+ type_: "MANAGED_INSTANCE_ATTESTATION";
2234
+ value: [string];
2235
+ } | {
2236
+ type_: "WALLET_ATTESTATION";
2197
2237
  value: [string];
2198
2238
  } | {
2199
2239
  type_: "WALLET_RELYING_PARTY";
@@ -2201,10 +2241,9 @@ export type HistoryMetadata = {
2201
2241
  } | {
2202
2242
  type_: "TRUST_RESOLUTION";
2203
2243
  value: TrustResolutionMetadata;
2204
- }
2205
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2206
- | {
2244
+ } | {
2207
2245
  type_: "ECOSYSTEMS_RESOLVED";
2246
+ /** One entry per ecosystem provider consulted, keyed by provider id. */
2208
2247
  value: Record<string, EcosystemOutcome>;
2209
2248
  };
2210
2249
  export declare enum HistorySearchType {
@@ -2620,15 +2659,19 @@ export interface OneCore {
2620
2659
  */
2621
2660
  holderGetTransactionData(proofId: string, transactionDataId: string): Promise<ProofTransactionData>;
2622
2661
  /**
2623
- * Check status of the instance with the provider. Will return an error
2624
- * if the instance has been revoked.
2662
+ * Checks the status of an instance with the provider. Successful calls return `204`.
2663
+ * To see the result, call `holderGetInstance`.
2625
2664
  */
2626
2665
  holderInstanceStatus(id: string): Promise<void>;
2627
2666
  /** Receive a new credential batch */
2628
2667
  holderRefreshCredential(interactionId: string): Promise<HolderRefreshCredentialResponse>;
2629
2668
  /** Registers the instance with a Wallet or Verifier Provider. */
2630
2669
  holderRegisterInstance(request: HolderRegisterInstanceRequest): Promise<HolderRegisterInstanceResponse>;
2631
- /** Rejects offered credentials. Without `credential_ids`, all credentials of the interaction are rejected. */
2670
+ /**
2671
+ * Rejects credentials or individual batch items. Selecting a batch parent rejects all its items.
2672
+ * Without `credential_ids`, all credentials of the interaction are rejected.
2673
+ * A batch format is notified as rejected and excluded from refreshes only when all its items are rejected.
2674
+ */
2632
2675
  holderRejectCredential(interactionId: string, credentialIds: Array<string> | undefined): Promise<void>;
2633
2676
  /** Rejects a proof request. */
2634
2677
  holderRejectProof(interactionId: string): Promise<void>;
@@ -197,6 +197,9 @@ export var HistoryAction;
197
197
  HistoryAction["ECOSYSTEMS_RESOLVED"] = "ECOSYSTEMS_RESOLVED";
198
198
  HistoryAction["REFRESHED"] = "REFRESHED";
199
199
  HistoryAction["SIGNED"] = "SIGNED";
200
+ HistoryAction["KA_CREATED"] = "KA_CREATED";
201
+ HistoryAction["WIA_CREATED"] = "WIA_CREATED";
202
+ HistoryAction["CLIENT_SECRET_REGENERATED"] = "CLIENT_SECRET_REGENERATED";
200
203
  })(HistoryAction || (HistoryAction = {}));
201
204
  export var HistoryEntityType;
202
205
  (function (HistoryEntityType) {
@@ -210,7 +213,8 @@ export var HistoryEntityType;
210
213
  HistoryEntityType["PROOF_SCHEMA"] = "PROOF_SCHEMA";
211
214
  HistoryEntityType["ORGANISATION"] = "ORGANISATION";
212
215
  HistoryEntityType["BACKUP"] = "BACKUP";
213
- HistoryEntityType["WALLET_UNIT"] = "WALLET_UNIT";
216
+ HistoryEntityType["INSTANCE"] = "INSTANCE";
217
+ HistoryEntityType["MANAGED_INSTANCE"] = "MANAGED_INSTANCE";
214
218
  HistoryEntityType["USER"] = "USER";
215
219
  HistoryEntityType["PROVIDER"] = "PROVIDER";
216
220
  HistoryEntityType["WALLET_RELYING_PARTY"] = "WALLET_RELYING_PARTY";
@@ -35,7 +35,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
35
35
  data: ErrorResponse(
36
36
  code: "BR_0183",
37
37
  message: "core already initialized",
38
- cause: nil
38
+ cause: nil,
39
+ data: nil
39
40
  )
40
41
  )
41
42
  }
@@ -70,7 +71,7 @@ class ProcivisOneCoreModule: RCTEventEmitter {
70
71
  private func getCore() throws -> OneCoreProtocol {
71
72
  guard let result = core else {
72
73
  throw OneCoreError.Response(
73
- data: ErrorResponse(code: "BR_0184", message: "core not initialized", cause: nil)
74
+ data: ErrorResponse(code: "BR_0184", message: "core not initialized", cause: nil, data: nil)
74
75
  )
75
76
  }
76
77
  return result
@@ -906,7 +907,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
906
907
  data: ErrorResponse(
907
908
  code: "BR_0184",
908
909
  message: "ubiqu not initialized",
909
- cause: nil
910
+ cause: nil,
911
+ data: nil
910
912
  )
911
913
  )
912
914
  }
@@ -926,7 +928,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
926
928
  data: ErrorResponse(
927
929
  code: "BR_0184",
928
930
  message: "ubiqu not initialized",
929
- cause: nil
931
+ cause: nil,
932
+ data: nil
930
933
  )
931
934
  )
932
935
  }
@@ -945,7 +948,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
945
948
  data: ErrorResponse(
946
949
  code: "BR_0184",
947
950
  message: "ubiqu not initialized",
948
- cause: nil
951
+ cause: nil,
952
+ data: nil
949
953
  )
950
954
  )
951
955
  }
@@ -965,7 +969,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
965
969
  data: ErrorResponse(
966
970
  code: "BR_0184",
967
971
  message: "ubiqu not initialized",
968
- cause: nil
972
+ cause: nil,
973
+ data: nil
969
974
  )
970
975
  )
971
976
  }
@@ -1002,7 +1007,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
1002
1007
  data: ErrorResponse(
1003
1008
  code: "BR_0184",
1004
1009
  message: "ubiqu not initialized",
1005
- cause: nil
1010
+ cause: nil,
1011
+ data: nil
1006
1012
  )
1007
1013
  )
1008
1014
  }
@@ -61,9 +61,14 @@ private func serialize(historyMetadata: HistoryMetadata) throws -> NSDictionary
61
61
  "type_": "ERROR_METADATA",
62
62
  "value": try serializeAny(value)
63
63
  ];
64
- case let .walletUnitJwt(value):
64
+ case let .managedInstanceAttestation(value):
65
65
  return [
66
- "type_": "WALLET_UNIT_JWT",
66
+ "type_": "MANAGED_INSTANCE_ATTESTATION",
67
+ "value": [value]
68
+ ];
69
+ case let .walletAttestation(value):
70
+ return [
71
+ "type_": "WALLET_ATTESTATION",
67
72
  "value": [value]
68
73
  ];
69
74
  case let .walletRelyingParty(value):
package/ios/Util.swift CHANGED
@@ -38,8 +38,15 @@ func asyncCall<Result>(
38
38
  private func handleError(error: Error, _ reject: @escaping RCTPromiseRejectBlock) {
39
39
  if case OneCoreError.Response(data: let errorResponse) = error {
40
40
  var userInfo: [String: Any] = [NSUnderlyingErrorKey: error]
41
- if let cause = errorResponse.cause?.message {
42
- userInfo["cause"] = cause
41
+ do {
42
+ if let cause = errorResponse.cause {
43
+ userInfo["cause"] = try serializeAny(cause)
44
+ }
45
+ if let data = errorResponse.data {
46
+ userInfo["data"] = try serializeAny(data)
47
+ }
48
+ } catch {
49
+ print("error: while parsing OneCoreError: \(error).")
43
50
  }
44
51
 
45
52
  reject(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procivis/react-native-one-core",
3
- "version": "1.126524.0",
3
+ "version": "1.133039.0",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "ONE core bindings for React Native",