@procivis/react-native-one-core 1.126524.0 → 1.134079.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/134079/android/onecore-debug.aar",
5
+ "sha1": "20b32091288c6ec07e8f92e016ce9824badb4f5d"
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/134079/android/onecore-release.aar",
9
+ "sha1": "6333d2e66b1677a5769863cf502c963894d030b8"
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/134079/ios/deploy.zip",
14
+ "sha1": "5a619709874ecd86916d7797ca97ce65194d6f82"
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>;
@@ -110,7 +114,7 @@ export interface Config {
110
114
  globalSettings: GlobalSettings;
111
115
  }
112
116
  export interface ContinueIssuanceResponse {
113
- /** For reference. */
117
+ /** Use with `holderAcceptCredential` and `holderRejectCredential`. */
114
118
  interactionId: string;
115
119
  /** Key storage required to complete issuance. */
116
120
  keyStorageSecurityLevels?: Array<KeyStorageSecurity>;
@@ -120,6 +124,7 @@ export interface ContinueIssuanceResponse {
120
124
  requiresWalletInstanceAttestation: boolean;
121
125
  /** Protocol used for issuance. */
122
126
  protocol: string;
127
+ /** Ecosystem applied to this interaction. */
123
128
  ecosystem?: string;
124
129
  }
125
130
  export interface CreateCertificateAuthorityRequest {
@@ -139,12 +144,11 @@ export interface CreateCredentialSchemaRequest {
139
144
  formats: Array<CredentialSchemaFormatRequest>;
140
145
  organisationId: string;
141
146
  claims: Array<CredentialClaimSchemaRequest>;
142
- keyStorageSecurity?: KeyStorageSecurity;
147
+ walletAttestation?: CredentialSchemaWalletAttestation;
143
148
  layoutProperties?: CredentialSchemaLayoutProperties;
144
149
  allowSuspension?: boolean;
145
150
  allowRevocation?: boolean;
146
151
  batchSize?: number;
147
- requiresWalletInstanceAttestation: boolean;
148
152
  transactionCode?: CredentialSchemaTransactionCodeRequest;
149
153
  translations?: CredentialSchemaTranslations;
150
154
  embeddedDisclosurePolicy?: DisclosurePolicyCreateRequest;
@@ -188,20 +192,26 @@ export interface CreateOrganisationRequest {
188
192
  /** If no UUID is passed, one will be created. */
189
193
  id?: string;
190
194
  parentOrganisation?: string;
195
+ /** Policy-level configuration for this organization. */
196
+ configuration?: SetOrganisationConfiguration;
191
197
  }
192
198
  /**
193
- * If protocol is `ISO_MDL`, specify the device engagement type
194
- * by referencing an entry from `verificationEngagement` of your
195
- * configuration. `iso_mdl_engagement` accepts either QR code content
196
- * (for QR device engagement) or NFC engagement parameters from
197
- * `nfc_read_iso_mdl_engagement`.
199
+ * If `protocol` is `ISO_MDL`, also set `engagement`, `isoMdlEngagement`,
200
+ * and `transport`.
198
201
  */
199
202
  export interface CreateProofRequest {
200
203
  /** Choose a proof schema to use. */
201
204
  proofSchemaId: string;
202
205
  /** Deprecated. Use `verifierIdentifierId`. */
203
206
  verifierDidId?: string;
204
- /** Choose the identifier to use to make the request. */
207
+ /**
208
+ * Choose the identifier to use to make the request. Either this or
209
+ * the deprecated `verifierDidId` must be set.
210
+ *
211
+ * For `ISO_MDL`, a certificate identifier enables reader
212
+ * authentication, so the wallet can verify who is asking. Key
213
+ * identifiers are not allowed.
214
+ */
205
215
  verifierIdentifierId?: string;
206
216
  /**
207
217
  * Choose the protocol to use for verification. Check the
@@ -223,27 +233,56 @@ export interface CreateProofRequest {
223
233
  verifierKey?: string;
224
234
  /**
225
235
  * If the identifier contains multiple certificates, use this to
226
- * specify which key to use. If omitted, the first suitable
236
+ * specify which certificate to use. If omitted, the first suitable
227
237
  * certificate is used.
228
238
  */
229
239
  verifierCertificate?: string;
230
- /** Use to specify device engagement type. */
240
+ /**
241
+ * For `ISO_MDL`, the device engagement data received from the
242
+ * wallet: the scanned QR code content, or the result of
243
+ * `nfcReadIsoMdlEngagement`.
244
+ */
231
245
  isoMdlEngagement?: string;
232
246
  /**
233
247
  * Choose the transport protocol for the exchange. Check the
234
248
  * `transport` object of your configuration for supported
235
- * options and reference the configuration instance.
249
+ * options and reference the configuration instance. For
250
+ * `ISO_MDL`, use `BLE`.
236
251
  */
237
252
  transport?: Array<string>;
238
- /** Country profile to associate with this request. */
253
+ /**
254
+ * Country profile to associate with this request. See
255
+ * [Country Profiles](https://docs.procivis.ch/profiles) for more
256
+ * information.
257
+ */
239
258
  profile?: string;
240
- /** Use for ISO mDL verification over BLE. */
259
+ /**
260
+ * For `ISO_MDL`, the device engagement method used to receive
261
+ * `isoMdlEngagement`, such as `NFC` or `QR_CODE`. Reference an
262
+ * entry from the `verificationEngagement` object of your configuration.
263
+ */
241
264
  engagement?: string;
242
- /** Optional transaction data to request authorization for. */
265
+ /**
266
+ * Optional transaction data to request authorization for. Only
267
+ * supported for OpenID4VP. See
268
+ * [Transaction Authorization for Verifiers](https://docs.procivis.ch/verify/transaction-authorization)
269
+ * for more information.
270
+ */
243
271
  transactionData?: Array<ProofRequestTransactionData>;
272
+ /**
273
+ * Use this to enforce the constraints of a regulatory ecosystem
274
+ * for this request. See
275
+ * [Enforcing an Ecosystem as a Verifier](https://docs.procivis.ch/verify/ecosystem-enforcement)
276
+ * for more information.
277
+ */
244
278
  ecosystem?: string;
245
279
  }
246
280
  export interface CreateProofSchemaInput {
281
+ /**
282
+ * Formatter provider names selected for this input. If omitted, all
283
+ * formats of the credential schema are selected.
284
+ */
285
+ formats?: Array<string>;
247
286
  credentialSchemaId: string;
248
287
  claimSchemas: Array<CreateProofSchemaInputClaim>;
249
288
  }
@@ -331,7 +370,8 @@ export interface CredentialDetail {
331
370
  trustInformation?: TrustInformation;
332
371
  consumedAt?: string;
333
372
  type: CredentialType;
334
- remainingBatchItemCount?: number;
373
+ remainingBatchItemCount?: Record<string, number>;
374
+ format?: string;
335
375
  parentId?: string;
336
376
  ecosystem?: string;
337
377
  }
@@ -368,6 +408,7 @@ export interface CredentialListItem {
368
408
  profile?: string;
369
409
  consumedAt?: string;
370
410
  type: CredentialType;
411
+ format?: string;
371
412
  parentId?: string;
372
413
  redirectUri?: string;
373
414
  ecosystem?: string;
@@ -387,6 +428,8 @@ export interface CredentialListQuery {
387
428
  name?: string;
388
429
  /** Filter by one or more country profiles. */
389
430
  profiles?: Array<string>;
431
+ /** Filter by one or more formatter configuration names. */
432
+ formats?: Array<string>;
390
433
  /** Search for a string. */
391
434
  searchText?: string;
392
435
  /**
@@ -459,7 +502,12 @@ export interface CredentialListQuery {
459
502
  revocationDateBefore?: string;
460
503
  }
461
504
  export interface CredentialQuery {
505
+ /** Whether more than one credential can be submitted for this query. */
462
506
  multiple: boolean;
507
+ /**
508
+ * Either the wallet's credentials that match this query, or the
509
+ * reason no credential matches.
510
+ */
463
511
  credentialOrFailureHint: ApplicableCredentialOrFailureHint;
464
512
  }
465
513
  export interface CredentialQueryFailureHint {
@@ -488,13 +536,12 @@ export interface CredentialSchemaDetail {
488
536
  formats: Array<CredentialSchemaFormatResponse>;
489
537
  organisationId: string;
490
538
  claims: Array<ClaimSchema>;
491
- keyStorageSecurity?: KeyStorageSecurity;
539
+ walletAttestation: CredentialSchemaWalletAttestation;
492
540
  importedSourceUrl: string;
493
541
  layoutProperties?: CredentialSchemaLayoutProperties;
494
542
  allowSuspension: boolean;
495
543
  allowRevocation?: boolean;
496
544
  batchSize?: number;
497
- requiresWalletInstanceAttestation: boolean;
498
545
  transactionCode?: CredentialSchemaTransactionCode;
499
546
  translations: CredentialSchemaTranslations;
500
547
  expiration?: number;
@@ -558,13 +605,12 @@ export interface CredentialSchemaListItem {
558
605
  lastModified: string;
559
606
  name: string;
560
607
  formats: Array<CredentialSchemaFormatResponse>;
561
- keyStorageSecurity?: KeyStorageSecurity;
608
+ walletAttestation: CredentialSchemaWalletAttestation;
562
609
  importedSourceUrl: string;
563
610
  layoutProperties?: CredentialSchemaLayoutProperties;
564
611
  allowSuspension: boolean;
565
612
  allowRevocation?: boolean;
566
613
  batchSize?: number;
567
- requiresWalletInstanceAttestation: boolean;
568
614
  expiration?: number;
569
615
  ecosystem?: string;
570
616
  translations?: CredentialSchemaTranslations;
@@ -611,8 +657,22 @@ export interface CredentialSchemaTranslations {
611
657
  name: Record<string, string>;
612
658
  description?: Record<string, string>;
613
659
  }
660
+ export interface CredentialSchemaWalletAttestation {
661
+ requireInstanceAttestation: boolean;
662
+ keyStorageSecurityLevel?: KeyStorageSecurity;
663
+ preferredKeyStorageAttestationLifetime?: number;
664
+ preferredInstanceAttestationLifetime?: number;
665
+ }
614
666
  export interface CredentialSet {
667
+ /**
668
+ * Whether this set must be satisfied for the request to be
669
+ * satisfied.
670
+ */
615
671
  required: boolean;
672
+ /**
673
+ * Alternative combinations of credential query IDs. Satisfying any
674
+ * one combination satisfies the set.
675
+ */
616
676
  options: Array<Array<string>>;
617
677
  }
618
678
  export interface DeviceInfo {
@@ -723,15 +783,21 @@ export interface EcosystemOutcome {
723
783
  /** Why the provider did not trust the interaction. `None` when it did. */
724
784
  error?: HistoryErrorMetadata;
725
785
  }
786
+ export interface ErrorData {
787
+ ecosystemErrors?: Record<string, EcosystemOutcome>;
788
+ }
726
789
  export interface ErrorResponse {
727
790
  code: string;
728
791
  message: string;
729
792
  cause?: Cause;
793
+ /** Only set when ecosystems rejected the interaction */
794
+ data?: ErrorData;
730
795
  }
731
796
  export interface EudiIntermediary {
732
797
  name?: string;
733
798
  identifier: string;
734
- website: string;
799
+ supportUrl?: string;
800
+ infoUrl?: string;
735
801
  email?: string;
736
802
  phone?: string;
737
803
  country: string;
@@ -743,7 +809,9 @@ export interface EudiSupervisoryAuthority {
743
809
  }
744
810
  export interface EudiTrustInformation {
745
811
  name: string;
746
- website: string;
812
+ supportUrl?: string;
813
+ infoUrl?: string;
814
+ privacyPolicyUrl?: string;
747
815
  email?: string;
748
816
  phone?: string;
749
817
  country: string;
@@ -800,6 +868,13 @@ export interface HandleInvitationRequest {
800
868
  * "myapp://example".
801
869
  */
802
870
  redirectUri?: string;
871
+ /**
872
+ * Use this to enforce the constraints of a regulatory ecosystem
873
+ * for this interaction. If omitted, every ecosystem available to
874
+ * the wallet checks the interaction. See
875
+ * [Enforcing an Ecosystem as a Wallet](https://docs.procivis.ch/hold/ecosystem-enforcement)
876
+ * for more information.
877
+ */
803
878
  ecosystem?: string;
804
879
  }
805
880
  export interface HistoryErrorMetadata {
@@ -901,6 +976,15 @@ export interface HolderAcceptCredentialRequest {
901
976
  interactionId: string;
902
977
  /** Deprecated. Use `identifierId`. */
903
978
  didId?: string;
979
+ /**
980
+ * Pass nothing here for the recommended key auto-generation. See
981
+ * [Auto-generate Keys for Issuance](https://docs.procivis.ch/configure/auto-generate-keys)
982
+ * for more information.
983
+ *
984
+ * Alternatively, choose an existing identifier to hold the credential.
985
+ * If neither this nor the deprecated `didId` is set, the system generates
986
+ * a new identifier that matches the issuer's restrictions.
987
+ */
904
988
  identifierId?: string;
905
989
  /**
906
990
  * If you are using an identifier with multiple keys for authentication,
@@ -919,7 +1003,7 @@ export interface HolderAcceptCredentialResponse {
919
1003
  * Only set when several configurations were offered.
920
1004
  */
921
1005
  partiallySuccessful?: boolean;
922
- /** One entry per ecosystem provider consulted, keyed by provider id. */
1006
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
923
1007
  ecosystemErrors: Record<string, EcosystemOutcome>;
924
1008
  }
925
1009
  export interface HolderActivateInstanceRequest {
@@ -1086,11 +1170,10 @@ export interface ImportCredentialSchemaRequestSchema {
1086
1170
  formats: Array<ImportCredentialSchemaFormat>;
1087
1171
  organisationId: string;
1088
1172
  claims: Array<ImportCredentialSchemaClaimSchema>;
1089
- keyStorageSecurity?: KeyStorageSecurity;
1173
+ walletAttestation?: CredentialSchemaWalletAttestation;
1090
1174
  importedSourceUrl: string;
1091
1175
  layoutProperties?: ImportCredentialSchemaLayoutProperties;
1092
1176
  allowSuspension?: boolean;
1093
- requiresWalletInstanceAttestation?: boolean;
1094
1177
  transactionCode?: ImportCredentialSchemaTransactionCode;
1095
1178
  allowRevocation?: boolean;
1096
1179
  batchSize?: number;
@@ -1121,6 +1204,7 @@ export interface ImportProofSchema {
1121
1204
  importedSourceUrl: string;
1122
1205
  /** Set of all claims to request. */
1123
1206
  proofInputSchemas: Array<ImportProofSchemaInputSchema>;
1207
+ ecosystem?: string;
1124
1208
  }
1125
1209
  export interface ImportProofSchemaClaimSchema {
1126
1210
  id: string;
@@ -1145,8 +1229,14 @@ export interface ImportProofSchemaCredentialSchema {
1145
1229
  layoutProperties?: CredentialSchemaLayoutProperties;
1146
1230
  allowSuspension?: boolean;
1147
1231
  requiresWalletInstanceAttestation?: boolean;
1232
+ ecosystem?: string;
1148
1233
  }
1149
1234
  export interface ImportProofSchemaInputSchema {
1235
+ /**
1236
+ * Formatter provider names selected for this input. Defaulting
1237
+ * to all formats of the resolved credential schema if omitted.
1238
+ */
1239
+ formats?: Array<string>;
1150
1240
  claimSchemas: Array<ImportProofSchemaClaimSchema>;
1151
1241
  credentialSchema: ImportProofSchemaCredentialSchema;
1152
1242
  }
@@ -1185,6 +1275,12 @@ export interface InitiateIssuanceRequest {
1185
1275
  scope?: Array<string>;
1186
1276
  /** OpenID4VCI authorization request parameter. */
1187
1277
  authorizationDetails?: Array<InitiateIssuanceAuthorizationDetail>;
1278
+ /**
1279
+ * Use this to enforce the constraints of a regulatory ecosystem
1280
+ * for this issuance. See
1281
+ * [Enforcing an Ecosystem as a Wallet](https://docs.procivis.ch/hold/ecosystem-enforcement)
1282
+ * for more information.
1283
+ */
1188
1284
  ecosystem?: string;
1189
1285
  }
1190
1286
  export interface InitiateIssuanceResponse {
@@ -1313,16 +1409,39 @@ export interface PresentationDefinitionTransactionData {
1313
1409
  type: string;
1314
1410
  credentialQueryIds: Array<string>;
1315
1411
  }
1412
+ /**
1413
+ * What a proof request asks for, together with the wallet's credentials
1414
+ * that can satisfy it.
1415
+ */
1316
1416
  export interface PresentationDefinitionV2 {
1417
+ /**
1418
+ * One entry per requested credential, keyed by credential query ID.
1419
+ * Use these IDs as the keys of the submission for
1420
+ * `holderSubmitProofV2`.
1421
+ */
1317
1422
  credentialQueries: Record<string, CredentialQuery>;
1423
+ /** Combinations of credential queries that satisfy the request. */
1318
1424
  credentialSets: Array<CredentialSet>;
1425
+ /**
1426
+ * Transaction data entries attached to the request. Get the details
1427
+ * of an entry with `holderGetTransactionData`.
1428
+ */
1319
1429
  transactionData: Array<PresentationDefinitionTransactionData>;
1320
1430
  }
1321
1431
  export interface PresentationDefinitionV2Claim {
1432
+ /** Path of the claim. Use it in `userSelections` when submitting. */
1322
1433
  path: string;
1323
1434
  schema: ClaimSchemaInfo;
1324
1435
  value: PresentationDefinitionV2ClaimValue;
1436
+ /**
1437
+ * Whether the holder can choose whether to share this claim. To
1438
+ * share it, include its `path` in `userSelections` when submitting.
1439
+ */
1325
1440
  userSelection: boolean;
1441
+ /**
1442
+ * Whether the verifier marked this claim as required. Always
1443
+ * `false` for `ISO_MDL` requests.
1444
+ */
1326
1445
  required: boolean;
1327
1446
  }
1328
1447
  export interface PresentationDefinitionV2Credential {
@@ -1343,6 +1462,7 @@ export interface PresentationDefinitionV2Credential {
1343
1462
  mdocMsoValidity?: MdocMsoValidity;
1344
1463
  protocol: string;
1345
1464
  profile?: string;
1465
+ format?: string;
1346
1466
  /**
1347
1467
  * Present when the relying party's certificates do not satisfy
1348
1468
  * the embedded disclosure policy attached to the requested
@@ -1364,9 +1484,11 @@ export interface PresentationSubmitV2CredentialRequest {
1364
1484
  userSelections?: Array<string>;
1365
1485
  /**
1366
1486
  * Optional ids of transaction-data entries to bind to this credential.
1367
- * Entries not listed here are auto-assigned. Ids must reference transaction
1487
+ * Entries not listed here are auto-assigned. IDs must reference transaction
1368
1488
  * data applicable to this credential. Omit entirely or use an empty array
1369
- * to auto-assign all transaction data.
1489
+ * to auto-assign all transaction data. See
1490
+ * [Transaction Authorization for Wallets](https://docs.procivis.ch/hold/transaction-authorization)
1491
+ * for more information.
1370
1492
  */
1371
1493
  transactionDataIds?: Array<string>;
1372
1494
  }
@@ -1419,12 +1541,26 @@ export interface ProofDetail {
1419
1541
  completedDate?: string;
1420
1542
  /** When claim data was deleted. */
1421
1543
  claimsRemovedAt?: string;
1422
- /** Country profile associated with this request. */
1544
+ /**
1545
+ * Country profile associated with this request. See
1546
+ * [Country Profiles](https://docs.procivis.ch/profiles) for more
1547
+ * information.
1548
+ */
1423
1549
  profile?: string;
1424
1550
  /** Trust information of the verifier, if any. */
1425
1551
  trustInformation?: TrustInformation;
1426
- /** Transaction data attached to this proof request. Present only if the proof role is `VERIFIER`. */
1552
+ /**
1553
+ * Transaction data attached to this proof request. Present only if the proof
1554
+ * role is `VERIFIER`. See
1555
+ * [Transaction Authorization for Verifiers](https://docs.procivis.ch/verify/transaction-authorization)
1556
+ * for more information.
1557
+ */
1427
1558
  transactionData?: Array<TransactionDataResponse>;
1559
+ /**
1560
+ * Ecosystem applied to this request. See
1561
+ * [Ecosystems](https://docs.procivis.ch/ecosystems)
1562
+ * for more information.
1563
+ */
1428
1564
  ecosystem?: string;
1429
1565
  }
1430
1566
  export interface ProofInput {
@@ -1438,6 +1574,8 @@ export interface ProofInput {
1438
1574
  trustInformation?: TrustInformation;
1439
1575
  }
1440
1576
  export interface ProofInputSchema {
1577
+ /** Formatter provider names saved for this proof input. */
1578
+ formats: Array<string>;
1441
1579
  claimSchemas: Array<ProofClaimSchema>;
1442
1580
  credentialSchema: CredentialSchemaInfo;
1443
1581
  }
@@ -1471,8 +1609,17 @@ export interface ProofListItem {
1471
1609
  * proof schema.
1472
1610
  */
1473
1611
  retainUntilDate?: string;
1474
- /** Country profile associated with this request. */
1612
+ /**
1613
+ * Country profile associated with this request. See
1614
+ * [Country Profiles](https://docs.procivis.ch/profiles) for more
1615
+ * information.
1616
+ */
1475
1617
  profile?: string;
1618
+ /**
1619
+ * Ecosystem applied to this request. See
1620
+ * [Ecosystems](https://docs.procivis.ch/ecosystems)
1621
+ * for more information.
1622
+ */
1476
1623
  ecosystem?: string;
1477
1624
  redirectUri?: string;
1478
1625
  }
@@ -1489,8 +1636,17 @@ export interface ProofListQuery {
1489
1636
  sortDirection?: SortDirection;
1490
1637
  /** Return only proof requests with a name starting with this string. */
1491
1638
  name?: string;
1492
- /** Filter by one or more country profiles. */
1639
+ /**
1640
+ * Filter by one or more country profiles. See
1641
+ * [Country Profiles](https://docs.procivis.ch/profiles) for more
1642
+ * information.
1643
+ */
1493
1644
  profiles?: Array<string>;
1645
+ /**
1646
+ * Filter by ecosystem applied to proof. See
1647
+ * [Ecosystems](https://docs.procivis.ch/ecosystems)
1648
+ * for more information.
1649
+ */
1494
1650
  ecosystems?: Array<string>;
1495
1651
  /** Filter by one or more UUIDs. */
1496
1652
  ids?: Array<string>;
@@ -1536,12 +1692,12 @@ export interface ProofListQuery {
1536
1692
  */
1537
1693
  requestedDateBefore?: string;
1538
1694
  /**
1539
- * Return only proofs requested completed after this time. Timestamp in
1695
+ * Return only proofs completed after this time. Timestamp in
1540
1696
  * RFC 3339 format (for example `2023-06-09T14:19:57.000Z`).
1541
1697
  */
1542
1698
  completedDateAfter?: string;
1543
1699
  /**
1544
- * Return only proofs requested completed before this time. Timestamp in
1700
+ * Return only proofs completed before this time. Timestamp in
1545
1701
  * RFC 3339 format (for example `2023-06-09T14:19:57.000Z`).
1546
1702
  */
1547
1703
  completedDateBefore?: string;
@@ -1633,15 +1789,44 @@ export interface ProofTransactionData {
1633
1789
  rawTransactionData?: string;
1634
1790
  }
1635
1791
  export interface ProposeProofRequest {
1792
+ /**
1793
+ * Choose the protocol to use. Check the `verificationProtocol`
1794
+ * object of your configuration for supported options and reference
1795
+ * the configuration instance.
1796
+ */
1636
1797
  protocol: string;
1798
+ /** Specifies the organizational context for this operation. */
1637
1799
  organisationId: string;
1800
+ /**
1801
+ * The device engagement method to offer. Reference one or more entries
1802
+ * from the `verificationEngagement` object of your configuration.
1803
+ */
1638
1804
  engagement: Array<string>;
1805
+ /**
1806
+ * Text shown on the iOS system overlay during NFC engagement. Has
1807
+ * no effect for QR code engagement or on Android.
1808
+ */
1639
1809
  uiMessage?: string;
1810
+ /**
1811
+ * Use this to enforce the constraints of a regulatory ecosystem
1812
+ * for this presentation. See
1813
+ * [Enforcing an Ecosystem as a Wallet](https://docs.procivis.ch/hold/ecosystem-enforcement)
1814
+ * for more information.
1815
+ */
1640
1816
  ecosystem?: string;
1641
1817
  }
1642
1818
  export interface ProposeProofResponse {
1819
+ /**
1820
+ * ID of the proof, created in `PENDING` state. Use it with
1821
+ * `getProof` and `getPresentationDefinitionV2`.
1822
+ */
1643
1823
  proofId: string;
1824
+ /** Use with `holderSubmitProofV2` and `holderRejectProof`. */
1644
1825
  interactionId: string;
1826
+ /**
1827
+ * For QR code engagement, the device engagement data to display as a
1828
+ * QR code. Not returned for NFC engagement.
1829
+ */
1645
1830
  url?: string;
1646
1831
  }
1647
1832
  export interface QesAuthorizeRequest {
@@ -1698,6 +1883,25 @@ export interface ServiceDescription {
1698
1883
  advertisedServiceData?: number[];
1699
1884
  characteristics: Array<CharacteristicSettings>;
1700
1885
  }
1886
+ export interface SetOrganisationConfiguration {
1887
+ selectedEcosystems?: Array<string>;
1888
+ /**
1889
+ * When true, the issuer will only issue credentials to wallet units of one of
1890
+ * the selected ecosystems.
1891
+ */
1892
+ enforceEcosystemAsIssuer?: boolean;
1893
+ /**
1894
+ * When true, the wallet only accepts issuance and presentation requests
1895
+ * from members of one of the selected ecosystems.
1896
+ */
1897
+ enforceEcosystemAsHolder?: boolean;
1898
+ /**
1899
+ * When true, the verifier will only accept presentations of credentials
1900
+ * issued by issuers of the selected ecosystems. Ecosystems must be consistent
1901
+ * across presentations belonging to the same proof request.
1902
+ */
1903
+ enforceEcosystemAsVerifier?: boolean;
1904
+ }
1701
1905
  export interface ShareProofRequest {
1702
1906
  params?: ShareProofRequestParams;
1703
1907
  }
@@ -1734,14 +1938,14 @@ export interface TrustInformation {
1734
1938
  receivedAt: string;
1735
1939
  name?: string;
1736
1940
  result: TrustResolutionResult;
1737
- /** One entry per ecosystem provider consulted, keyed by provider id. */
1941
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
1738
1942
  ecosystemErrors: Record<string, EcosystemOutcome>;
1739
1943
  }
1740
1944
  export interface TrustInformationDetail {
1741
1945
  ecosystem?: string;
1742
1946
  issuer?: TrustInformationDetailInfo;
1743
1947
  verifier?: TrustInformationDetailInfo;
1744
- /** One entry per ecosystem provider consulted, keyed by provider id. */
1948
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
1745
1949
  ecosystemErrors: Record<string, EcosystemOutcome>;
1746
1950
  }
1747
1951
  export interface TrustResolutionMetadata {
@@ -1757,25 +1961,6 @@ export interface UnexportableEntities {
1757
1961
  totalDids: number;
1758
1962
  totalIdentifiers: number;
1759
1963
  }
1760
- export interface UpsertOrganisationConfiguration {
1761
- selectedEcosystems?: Array<string>;
1762
- /**
1763
- * When true, the issuer will only issue credentials to wallet units of one of
1764
- * the selected ecosystems.
1765
- */
1766
- enforceEcosystemAsIssuer?: boolean;
1767
- /**
1768
- * When true, the wallet only accepts issuance and presentation requests
1769
- * from members of one of the selected ecosystems.
1770
- */
1771
- enforceEcosystemAsHolder?: boolean;
1772
- /**
1773
- * When true, the verifier will only accept presentations of credentials
1774
- * issued by issuers of the selected ecosystems. Ecosystems must be consistent
1775
- * across presentations belonging to the same proof request.
1776
- */
1777
- enforceEcosystemAsVerifier?: boolean;
1778
- }
1779
1964
  export interface UpsertOrganisationRequest {
1780
1965
  /** Unique identifier of the organization to create or update. */
1781
1966
  id: string;
@@ -1790,7 +1975,7 @@ export interface UpsertOrganisationRequest {
1790
1975
  /** Verifier Provider use only. */
1791
1976
  verifierProviderIssuer?: string | null;
1792
1977
  /** Policy-level configuration for this organization. */
1793
- configuration?: UpsertOrganisationConfiguration;
1978
+ configuration?: SetOrganisationConfiguration;
1794
1979
  /**
1795
1980
  * The trust collections this organization's wallet subscribes to,
1796
1981
  * selected from those made available by the Wallet Provider. Omit to
@@ -1862,11 +2047,15 @@ export interface WalletProviderDetail {
1862
2047
  export interface WalletRelyingPartyMetadata {
1863
2048
  name?: string;
1864
2049
  }
1865
- export type ApplicableCredentialOrFailureHint = {
2050
+ export type ApplicableCredentialOrFailureHint =
2051
+ /** The wallet's credentials that match the query. */
2052
+ {
1866
2053
  type_: "APPLICABLE_CREDENTIALS";
1867
2054
  applicableCredentials: Array<PresentationDefinitionV2Credential>;
1868
2055
  purpose?: Record<string, string>;
1869
- } | {
2056
+ }
2057
+ /** Why no credential in the wallet matches the query. */
2058
+ | {
1870
2059
  type_: "FAILURE_HINT";
1871
2060
  failureHint: CredentialQueryFailureHint;
1872
2061
  };
@@ -2012,8 +2201,17 @@ export declare enum CredentialListQuerySearchType {
2012
2201
  CREDENTIAL_SCHEMA_NAME = "CREDENTIAL_SCHEMA_NAME"
2013
2202
  }
2014
2203
  export declare enum CredentialQueryFailureReason {
2204
+ /** The wallet holds no credential of the requested type. */
2015
2205
  NO_CREDENTIAL = "NO_CREDENTIAL",
2206
+ /**
2207
+ * Credentials of the requested type exist, but none is currently
2208
+ * valid.
2209
+ */
2016
2210
  VALIDITY = "VALIDITY",
2211
+ /**
2212
+ * Credentials of the requested type exist, but none satisfies the
2213
+ * constraints of the request.
2214
+ */
2017
2215
  CONSTRAINT = "CONSTRAINT"
2018
2216
  }
2019
2217
  export declare enum CredentialRole {
@@ -2074,7 +2272,7 @@ export declare enum EcosystemTrustResult {
2074
2272
  }
2075
2273
  export type HandleInvitationResponse = {
2076
2274
  type_: "CREDENTIAL_ISSUANCE";
2077
- /** For reference. */
2275
+ /** Use with `holderAcceptCredential` and `holderRejectCredential`. */
2078
2276
  interactionId: string;
2079
2277
  /** Key storage required to complete issuance. */
2080
2278
  keyStorageSecurityLevels?: Array<KeyStorageSecurity>;
@@ -2091,8 +2289,9 @@ export type HandleInvitationResponse = {
2091
2289
  protocol: string;
2092
2290
  /** Whether a valid WIA is required to complete issuance. */
2093
2291
  requiresWalletInstanceAttestation: boolean;
2292
+ /** Ecosystem applied to this interaction. */
2094
2293
  ecosystem?: string;
2095
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2294
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
2096
2295
  ecosystemErrors: Record<string, EcosystemOutcome>;
2097
2296
  } | {
2098
2297
  type_: "AUTHORIZATION_CODE_FLOW";
@@ -2105,19 +2304,24 @@ export type HandleInvitationResponse = {
2105
2304
  authorizationCodeFlowUrl: string;
2106
2305
  /** Protocol used for issuance. */
2107
2306
  protocol: string;
2307
+ /** Ecosystem applied to this interaction. */
2108
2308
  ecosystem?: string;
2109
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2309
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
2110
2310
  ecosystemErrors: Record<string, EcosystemOutcome>;
2111
2311
  } | {
2112
2312
  type_: "PROOF_REQUEST";
2113
- /** For reference. */
2313
+ /** Use with `holderSubmitProofV2` and `holderRejectProof`. */
2114
2314
  interactionId: string;
2115
- /** Proof request. */
2315
+ /**
2316
+ * ID of the proof request. Use it with `getProof` and
2317
+ * `getPresentationDefinitionV2`.
2318
+ */
2116
2319
  proofId: string;
2117
2320
  /** Protocol used for issuance. */
2118
2321
  protocol: string;
2322
+ /** Ecosystem applied to this interaction. */
2119
2323
  ecosystem?: string;
2120
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2324
+ /** One entry per ecosystem provider that rejected the artifact, keyed by provider id. */
2121
2325
  ecosystemErrors: Record<string, EcosystemOutcome>;
2122
2326
  };
2123
2327
  export declare enum HistoryAction {
@@ -2156,7 +2360,10 @@ export declare enum HistoryAction {
2156
2360
  TRUST_RESOLVED = "TRUST_RESOLVED",
2157
2361
  ECOSYSTEMS_RESOLVED = "ECOSYSTEMS_RESOLVED",
2158
2362
  REFRESHED = "REFRESHED",
2159
- SIGNED = "SIGNED"
2363
+ SIGNED = "SIGNED",
2364
+ KA_CREATED = "KA_CREATED",
2365
+ WIA_CREATED = "WIA_CREATED",
2366
+ CLIENT_SECRET_REGENERATED = "CLIENT_SECRET_REGENERATED"
2160
2367
  }
2161
2368
  export declare enum HistoryEntityType {
2162
2369
  KEY = "KEY",
@@ -2169,7 +2376,8 @@ export declare enum HistoryEntityType {
2169
2376
  PROOF_SCHEMA = "PROOF_SCHEMA",
2170
2377
  ORGANISATION = "ORGANISATION",
2171
2378
  BACKUP = "BACKUP",
2172
- WALLET_UNIT = "WALLET_UNIT",
2379
+ INSTANCE = "INSTANCE",
2380
+ MANAGED_INSTANCE = "MANAGED_INSTANCE",
2173
2381
  USER = "USER",
2174
2382
  PROVIDER = "PROVIDER",
2175
2383
  WALLET_RELYING_PARTY = "WALLET_RELYING_PARTY",
@@ -2193,7 +2401,10 @@ export type HistoryMetadata = {
2193
2401
  type_: "ERROR_METADATA";
2194
2402
  value: HistoryErrorMetadata;
2195
2403
  } | {
2196
- type_: "WALLET_UNIT_JWT";
2404
+ type_: "MANAGED_INSTANCE_ATTESTATION";
2405
+ value: [string];
2406
+ } | {
2407
+ type_: "WALLET_ATTESTATION";
2197
2408
  value: [string];
2198
2409
  } | {
2199
2410
  type_: "WALLET_RELYING_PARTY";
@@ -2201,10 +2412,9 @@ export type HistoryMetadata = {
2201
2412
  } | {
2202
2413
  type_: "TRUST_RESOLUTION";
2203
2414
  value: TrustResolutionMetadata;
2204
- }
2205
- /** One entry per ecosystem provider consulted, keyed by provider id. */
2206
- | {
2415
+ } | {
2207
2416
  type_: "ECOSYSTEMS_RESOLVED";
2417
+ /** One entry per ecosystem provider consulted, keyed by provider id. */
2208
2418
  value: Record<string, EcosystemOutcome>;
2209
2419
  };
2210
2420
  export declare enum HistorySearchType {
@@ -2328,20 +2538,62 @@ export declare enum ProofListQueryExactColumn {
2328
2538
  NAME = "NAME"
2329
2539
  }
2330
2540
  export declare enum ProofRole {
2541
+ /** The system received this request. */
2331
2542
  HOLDER = "HOLDER",
2543
+ /** The system made this request. */
2332
2544
  VERIFIER = "VERIFIER"
2333
2545
  }
2334
2546
  export declare enum ProofSchemaListQueryExactColumn {
2335
2547
  NAME = "NAME"
2336
2548
  }
2549
+ /**
2550
+ * State of a proof request. Some states mean something different
2551
+ * depending on whether the system is the holder or the verifier of the
2552
+ * request. See [Proof States as a Verifier](https://docs.procivis.ch/verify/states)
2553
+ * and [Proof States as a Holder](https://docs.procivis.ch/hold/manage-credentials-requests#proof-request-states-as-a-holder)
2554
+ * for complete state diagrams.
2555
+ */
2337
2556
  export declare enum ProofState {
2557
+ /**
2558
+ * For verifiers, the request was created but not yet shared with a
2559
+ * wallet.
2560
+ */
2338
2561
  CREATED = "CREATED",
2562
+ /**
2563
+ * Waiting for the other party. For verifiers, the request was shared
2564
+ * or, for `ISO_MDL`, created from the wallet's engagement data. For
2565
+ * holders, device engagement was started with `proposeProof`.
2566
+ */
2339
2567
  PENDING = "PENDING",
2568
+ /**
2569
+ * The request reached the wallet and is waiting for the holder to
2570
+ * respond.
2571
+ */
2340
2572
  REQUESTED = "REQUESTED",
2573
+ /**
2574
+ * For verifiers, the presentation was received and verified. For
2575
+ * holders, the presentation was submitted.
2576
+ */
2341
2577
  ACCEPTED = "ACCEPTED",
2578
+ /**
2579
+ * The holder rejected the request. Not all protocols report a
2580
+ * rejection to the verifier.
2581
+ */
2342
2582
  REJECTED = "REJECTED",
2583
+ /**
2584
+ * The request was cancelled with `deleteProof` after it reached
2585
+ * `REQUESTED`. The history of the interaction is retained.
2586
+ */
2343
2587
  RETRACTED = "RETRACTED",
2588
+ /**
2589
+ * A technical error occurred or, for verifiers, the presentation
2590
+ * could not be verified.
2591
+ */
2344
2592
  ERROR = "ERROR",
2593
+ /**
2594
+ * For verifiers, the shared request expired before a wallet
2595
+ * connected. Share it again with `shareProof`.
2596
+ */
2345
2597
  INTERACTION_EXPIRED = "INTERACTION_EXPIRED"
2346
2598
  }
2347
2599
  export declare enum SortDirection {
@@ -2526,9 +2778,15 @@ export interface OneCore {
2526
2778
  /** Creates an organization. */
2527
2779
  createOrganisation(request: CreateOrganisationRequest): Promise<string>;
2528
2780
  /**
2529
- * For verifiers, creates a proof request. Choose what information to
2530
- * request via a proof schema, an identifier, and which protocol to use
2531
- * for making the request.
2781
+ * For verifiers, creates a proof request and returns its ID. Choose
2782
+ * what information to request via a proof schema, an identifier, and
2783
+ * which protocol to use for making the request.
2784
+ *
2785
+ * For online protocols, the request is created in `CREATED` state;
2786
+ * share it with the wallet using `shareProof`. For `ISO_MDL`, the
2787
+ * wallet starts the exchange: pass the device engagement data from the
2788
+ * wallet in `isoMdlEngagement`. The request is created directly in
2789
+ * `PENDING` state and needs no sharing.
2532
2790
  */
2533
2791
  createProof(request: CreateProofRequest): Promise<string>;
2534
2792
  /**
@@ -2551,8 +2809,16 @@ export interface OneCore {
2551
2809
  /**
2552
2810
  * Deletes an incomplete proof request. If the request is in `REQUESTED`
2553
2811
  * state the proof is retracted instead, retaining history of the interaction.
2812
+ *
2813
+ * For `ISO_MDL`, this also closes the BLE session.
2554
2814
  */
2555
2815
  deleteProof(proofId: string): Promise<void>;
2816
+ /**
2817
+ * Deletes the claim data shared by the wallet holder for a proof
2818
+ * request, without waiting for the retention period set by the
2819
+ * `expireDuration` of the proof schema. The proof request itself is
2820
+ * kept, and `claimsRemovedAt` records when the claims were deleted.
2821
+ */
2556
2822
  deleteProofClaims(proofId: string): Promise<void>;
2557
2823
  deleteProofSchema(proofSchemaId: string): Promise<void>;
2558
2824
  /**
@@ -2587,8 +2853,21 @@ export interface OneCore {
2587
2853
  * offered to it.
2588
2854
  */
2589
2855
  getOrganisation(id: string): Promise<OrganisationDetail>;
2856
+ /**
2857
+ * For wallets, returns what a proof request asks for and which of the
2858
+ * wallet's credentials can satisfy it. Use the result to build the
2859
+ * submission for `holderSubmitProofV2`.
2860
+ *
2861
+ * For `ISO_MDL` requests, every claim has `required: false`, since the
2862
+ * protocol cannot mark claims as mandatory. An incomplete submission
2863
+ * may be rejected if the verifier requires claims not submitted.
2864
+ */
2590
2865
  getPresentationDefinitionV2(proofId: string): Promise<PresentationDefinitionV2>;
2591
- /** Returns detailed information about a proof request. */
2866
+ /**
2867
+ * Returns detailed information about a proof request.
2868
+ *
2869
+ * Poll this method to follow the state of the request.
2870
+ */
2592
2871
  getProof(proofId: string): Promise<ProofDetail>;
2593
2872
  getProofSchema(proofSchemaId: string): Promise<ProofSchemaDetail>;
2594
2873
  /**
@@ -2600,6 +2879,9 @@ export interface OneCore {
2600
2879
  * For a wallet, handles the interaction once the wallet connects to a share
2601
2880
  * endpoint URL (for example, scans the QR code of an offered credential or
2602
2881
  * request for proof).
2882
+ *
2883
+ * Not for use with `ISO_MDL` proximity flows, where the wallet initiates the
2884
+ * flow using `proposeProof` instead.
2603
2885
  */
2604
2886
  handleInvitation(request: HandleInvitationRequest): Promise<HandleInvitationResponse>;
2605
2887
  /**
@@ -2616,25 +2898,41 @@ export interface OneCore {
2616
2898
  * For wallets; returns the details of a single transaction data entry of a
2617
2899
  * proof request, including human-readable display data and the raw
2618
2900
  * transaction data received from the verifier. The `transactionDataId` is
2619
- * obtained from `getPresentationDefinitionv2`.
2901
+ * obtained from `getPresentationDefinitionV2`. See
2902
+ * [Transaction Authorization for Wallets](https://docs.procivis.ch/hold/transaction-authorization)
2903
+ * for more information.
2620
2904
  */
2621
2905
  holderGetTransactionData(proofId: string, transactionDataId: string): Promise<ProofTransactionData>;
2622
2906
  /**
2623
- * Check status of the instance with the provider. Will return an error
2624
- * if the instance has been revoked.
2907
+ * Checks the status of an instance with the provider. Successful calls return `204`.
2908
+ * To see the result, call `holderGetInstance`.
2625
2909
  */
2626
2910
  holderInstanceStatus(id: string): Promise<void>;
2627
- /** Receive a new credential batch */
2911
+ /** Request a new credential batch. */
2628
2912
  holderRefreshCredential(interactionId: string): Promise<HolderRefreshCredentialResponse>;
2629
2913
  /** Registers the instance with a Wallet or Verifier Provider. */
2630
2914
  holderRegisterInstance(request: HolderRegisterInstanceRequest): Promise<HolderRegisterInstanceResponse>;
2631
- /** Rejects offered credentials. Without `credential_ids`, all credentials of the interaction are rejected. */
2915
+ /**
2916
+ * Rejects credentials or individual batch items. Selecting a batch parent rejects all its items.
2917
+ * Without `credential_ids`, all credentials of the interaction are rejected.
2918
+ * A batch format is notified as rejected and excluded from refreshes only when all its items are rejected.
2919
+ */
2632
2920
  holderRejectCredential(interactionId: string, credentialIds: Array<string> | undefined): Promise<void>;
2633
- /** Rejects a proof request. */
2921
+ /**
2922
+ * For wallets, rejects a proof request. Pass the `interactionId` of
2923
+ * the request, not the proof ID.
2924
+ *
2925
+ * For `ISO_MDL`, the wallet sends an empty response to the verifier and
2926
+ * closes the BLE session.
2927
+ */
2634
2928
  holderRejectProof(interactionId: string): Promise<void>;
2635
2929
  /**
2636
- * Submits a presentation using DCQL as a query language; this should
2637
- * be used after `getPresentationDefinitionv2`.
2930
+ * For wallets, submits a presentation using DCQL as a query language.
2931
+ * Use this after `getPresentationDefinitionV2`. Pass the
2932
+ * `interactionId` of the request, not the proof ID.
2933
+ *
2934
+ * `submission` maps each credential query ID from the presentation
2935
+ * definition to the credentials chosen for it.
2638
2936
  */
2639
2937
  holderSubmitProofV2(interactionId: string, submission: Record<string, Array<PresentationSubmitV2CredentialRequest>>): Promise<void>;
2640
2938
  /**
@@ -2666,6 +2964,11 @@ export interface OneCore {
2666
2964
  * For wallets, initiates device engagement for offline flows. Reference
2667
2965
  * the `verificationEngagement` entry of your configuration for your
2668
2966
  * options for `engagement`.
2967
+ *
2968
+ * For `ISO_MDL`, this creates a proof in `PENDING` state and starts BLE
2969
+ * according to the `bleMode` set in your configuration. Poll `getProof`
2970
+ * until the state is `REQUESTED`, then call
2971
+ * `getPresentationDefinitionV2`.
2669
2972
  */
2670
2973
  proposeProof(request: ProposeProofRequest): Promise<ProposeProofResponse>;
2671
2974
  /**
@@ -2701,7 +3004,7 @@ export interface OneCore {
2701
3004
  shareCredentialSchema(credentialSchemaId: string): Promise<CredentialSchemaShareResponse>;
2702
3005
  /**
2703
3006
  * Creates a share URL from a proof request. A wallet holder can use this
2704
- * URL to access the request.
3007
+ * URL to access the request. Not used for the `ISO_MDL` proximity flow.
2705
3008
  */
2706
3009
  shareProof(proofId: string, params: ShareProofRequest): Promise<ShareProofResponse>;
2707
3010
  shareProofSchema(proofSchemaId: string): Promise<ProofSchemaShareResponse>;
@@ -89,8 +89,17 @@ export var CredentialListQuerySearchType;
89
89
  })(CredentialListQuerySearchType || (CredentialListQuerySearchType = {}));
90
90
  export var CredentialQueryFailureReason;
91
91
  (function (CredentialQueryFailureReason) {
92
+ /** The wallet holds no credential of the requested type. */
92
93
  CredentialQueryFailureReason["NO_CREDENTIAL"] = "NO_CREDENTIAL";
94
+ /**
95
+ * Credentials of the requested type exist, but none is currently
96
+ * valid.
97
+ */
93
98
  CredentialQueryFailureReason["VALIDITY"] = "VALIDITY";
99
+ /**
100
+ * Credentials of the requested type exist, but none satisfies the
101
+ * constraints of the request.
102
+ */
94
103
  CredentialQueryFailureReason["CONSTRAINT"] = "CONSTRAINT";
95
104
  })(CredentialQueryFailureReason || (CredentialQueryFailureReason = {}));
96
105
  export var CredentialRole;
@@ -197,6 +206,9 @@ export var HistoryAction;
197
206
  HistoryAction["ECOSYSTEMS_RESOLVED"] = "ECOSYSTEMS_RESOLVED";
198
207
  HistoryAction["REFRESHED"] = "REFRESHED";
199
208
  HistoryAction["SIGNED"] = "SIGNED";
209
+ HistoryAction["KA_CREATED"] = "KA_CREATED";
210
+ HistoryAction["WIA_CREATED"] = "WIA_CREATED";
211
+ HistoryAction["CLIENT_SECRET_REGENERATED"] = "CLIENT_SECRET_REGENERATED";
200
212
  })(HistoryAction || (HistoryAction = {}));
201
213
  export var HistoryEntityType;
202
214
  (function (HistoryEntityType) {
@@ -210,7 +222,8 @@ export var HistoryEntityType;
210
222
  HistoryEntityType["PROOF_SCHEMA"] = "PROOF_SCHEMA";
211
223
  HistoryEntityType["ORGANISATION"] = "ORGANISATION";
212
224
  HistoryEntityType["BACKUP"] = "BACKUP";
213
- HistoryEntityType["WALLET_UNIT"] = "WALLET_UNIT";
225
+ HistoryEntityType["INSTANCE"] = "INSTANCE";
226
+ HistoryEntityType["MANAGED_INSTANCE"] = "MANAGED_INSTANCE";
214
227
  HistoryEntityType["USER"] = "USER";
215
228
  HistoryEntityType["PROVIDER"] = "PROVIDER";
216
229
  HistoryEntityType["WALLET_RELYING_PARTY"] = "WALLET_RELYING_PARTY";
@@ -307,22 +320,64 @@ export var ProofListQueryExactColumn;
307
320
  })(ProofListQueryExactColumn || (ProofListQueryExactColumn = {}));
308
321
  export var ProofRole;
309
322
  (function (ProofRole) {
323
+ /** The system received this request. */
310
324
  ProofRole["HOLDER"] = "HOLDER";
325
+ /** The system made this request. */
311
326
  ProofRole["VERIFIER"] = "VERIFIER";
312
327
  })(ProofRole || (ProofRole = {}));
313
328
  export var ProofSchemaListQueryExactColumn;
314
329
  (function (ProofSchemaListQueryExactColumn) {
315
330
  ProofSchemaListQueryExactColumn["NAME"] = "NAME";
316
331
  })(ProofSchemaListQueryExactColumn || (ProofSchemaListQueryExactColumn = {}));
332
+ /**
333
+ * State of a proof request. Some states mean something different
334
+ * depending on whether the system is the holder or the verifier of the
335
+ * request. See [Proof States as a Verifier](https://docs.procivis.ch/verify/states)
336
+ * and [Proof States as a Holder](https://docs.procivis.ch/hold/manage-credentials-requests#proof-request-states-as-a-holder)
337
+ * for complete state diagrams.
338
+ */
317
339
  export var ProofState;
318
340
  (function (ProofState) {
341
+ /**
342
+ * For verifiers, the request was created but not yet shared with a
343
+ * wallet.
344
+ */
319
345
  ProofState["CREATED"] = "CREATED";
346
+ /**
347
+ * Waiting for the other party. For verifiers, the request was shared
348
+ * or, for `ISO_MDL`, created from the wallet's engagement data. For
349
+ * holders, device engagement was started with `proposeProof`.
350
+ */
320
351
  ProofState["PENDING"] = "PENDING";
352
+ /**
353
+ * The request reached the wallet and is waiting for the holder to
354
+ * respond.
355
+ */
321
356
  ProofState["REQUESTED"] = "REQUESTED";
357
+ /**
358
+ * For verifiers, the presentation was received and verified. For
359
+ * holders, the presentation was submitted.
360
+ */
322
361
  ProofState["ACCEPTED"] = "ACCEPTED";
362
+ /**
363
+ * The holder rejected the request. Not all protocols report a
364
+ * rejection to the verifier.
365
+ */
323
366
  ProofState["REJECTED"] = "REJECTED";
367
+ /**
368
+ * The request was cancelled with `deleteProof` after it reached
369
+ * `REQUESTED`. The history of the interaction is retained.
370
+ */
324
371
  ProofState["RETRACTED"] = "RETRACTED";
372
+ /**
373
+ * A technical error occurred or, for verifiers, the presentation
374
+ * could not be verified.
375
+ */
325
376
  ProofState["ERROR"] = "ERROR";
377
+ /**
378
+ * For verifiers, the shared request expired before a wallet
379
+ * connected. Share it again with `shareProof`.
380
+ */
326
381
  ProofState["INTERACTION_EXPIRED"] = "INTERACTION_EXPIRED";
327
382
  })(ProofState || (ProofState = {}));
328
383
  export var SortDirection;
@@ -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.134079.0",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "ONE core bindings for React Native",