@procivis/react-native-one-core 1.98296.0 → 1.107844.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.
package/README.md CHANGED
@@ -122,7 +122,6 @@ and regulations mature and harden.
122
122
 
123
123
  - OpenID4VCI (Issuance)
124
124
  - [v1.0][vci1]
125
- - [ID-1][vci]
126
125
  - OpenID4VP (Verification)
127
126
  - [v1.0][vp1.0]
128
127
  - [Draft 25][vp25]
@@ -199,7 +198,6 @@ Version 2.0](./LICENSE).
199
198
  [tsl]: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-status-list-03
200
199
  [vcdi]: https://www.w3.org/TR/vc-data-integrity/
201
200
  [vcdm]: https://www.w3.org/TR/vc-data-model-2.0/
202
- [vci]: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-ID1.html
203
201
  [vci1]: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html
204
202
  [vp1.0]: https://openid.net/specs/openid-4-verifiable-presentations-1_0-final.html
205
203
  [vp20]: https://openid.net/specs/openid-4-verifiable-presentations-1_0-20.html
@@ -130,6 +130,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
130
130
  }
131
131
  }
132
132
 
133
+ @ReactMethod
134
+ fun getOrganisation(organisationId: String, promise: Promise) {
135
+ asyncCall(promise, scope) {
136
+ val organisation = getCore().getOrganisation(organisationId)
137
+ return@asyncCall convertToRN(organisation)
138
+ }
139
+ }
140
+
133
141
  @ReactMethod
134
142
  fun generateKey(keyRequest: ReadableMap, promise: Promise) {
135
143
  asyncCall(promise, scope) {
@@ -200,7 +208,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
200
208
  promise: Promise
201
209
  ) {
202
210
  asyncCall(promise, scope) {
203
- return@asyncCall getCore().holderAcceptCredential(construct(request))
211
+ val result = getCore().holderAcceptCredential(construct(request))
212
+ return@asyncCall convertToRN(result)
204
213
  }
205
214
  }
206
215
 
@@ -212,6 +221,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
212
221
  }
213
222
  }
214
223
 
224
+ @ReactMethod
225
+ fun holderRefreshCredential(interactionId: String, promise: Promise) {
226
+ asyncCall(promise, scope) {
227
+ val result = getCore().holderRefreshCredential(interactionId)
228
+ return@asyncCall convertToRN(result)
229
+ }
230
+ }
231
+
215
232
  @ReactMethod
216
233
  fun initiateIssuance(request: ReadableMap, promise: Promise) {
217
234
  asyncCall(promise, scope) {
@@ -343,6 +360,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
343
360
  }
344
361
  }
345
362
 
363
+ @ReactMethod
364
+ fun getCredentialTrustInformation(credentialId: String, promise: Promise) {
365
+ asyncCall(promise, scope) {
366
+ val result = getCore().getCredentialTrustInformation(credentialId)
367
+ return@asyncCall convertToRN(result)
368
+ }
369
+ }
370
+
346
371
  @ReactMethod
347
372
  fun deleteCredential(credentialId: String, promise: Promise) {
348
373
  asyncCall(promise, scope) {
@@ -366,6 +391,13 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
366
391
  }
367
392
  }
368
393
 
394
+ @ReactMethod
395
+ fun createCredentialSchema(request: ReadableMap, promise: Promise) {
396
+ asyncCall(promise, scope) {
397
+ return@asyncCall getCore().createCredentialSchema(construct(request))
398
+ }
399
+ }
400
+
369
401
  @ReactMethod
370
402
  fun listCredentialSchemas(query: ReadableMap, promise: Promise) {
371
403
  asyncCall(promise, scope) {
@@ -405,6 +437,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
405
437
  }
406
438
  }
407
439
 
440
+ @ReactMethod
441
+ fun getProofTrustInformation(proofId: String, promise: Promise) {
442
+ asyncCall(promise, scope) {
443
+ val result = getCore().getProofTrustInformation(proofId)
444
+ return@asyncCall convertToRN(result)
445
+ }
446
+ }
447
+
408
448
  @ReactMethod
409
449
  fun listProofs(query: ReadableMap, promise: Promise) {
410
450
  asyncCall(promise, scope) {
@@ -496,99 +536,6 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
496
536
  }
497
537
  }
498
538
 
499
- @ReactMethod
500
- fun createTrustAnchor(request: ReadableMap, promise: Promise) {
501
- asyncCall(promise, scope) {
502
- return@asyncCall getCore().createTrustAnchor(construct(request))
503
- }
504
- }
505
-
506
- @ReactMethod
507
- fun deleteTrustAnchor(trustAnchorId: String, promise: Promise) {
508
- asyncCall(promise, scope) {
509
- return@asyncCall getCore().deleteTrustAnchor(trustAnchorId)
510
- }
511
- }
512
-
513
- @ReactMethod
514
- fun getTrustAnchor(trustAnchorId: String, promise: Promise) {
515
- asyncCall(promise, scope) {
516
- val trustAnchor = getCore().getTrustAnchor(trustAnchorId)
517
- return@asyncCall convertToRN(trustAnchor)
518
- }
519
- }
520
-
521
- @ReactMethod
522
- fun listTrustAnchors(query: ReadableMap, promise: Promise) {
523
- asyncCall(promise, scope) {
524
- val trustAnchors = getCore().listTrustAnchors(construct(query))
525
- return@asyncCall convertToRN(trustAnchors)
526
- }
527
- }
528
-
529
- @ReactMethod
530
- fun createTrustEntity(request: ReadableMap, promise: Promise) {
531
- asyncCall(promise, scope) {
532
- return@asyncCall getCore().createTrustEntity(construct(request))
533
- }
534
- }
535
-
536
- @ReactMethod
537
- fun getTrustEntity(trustEntityId: String, promise: Promise) {
538
- asyncCall(promise, scope) {
539
- val trustEntity = getCore().getTrustEntity(trustEntityId)
540
- return@asyncCall convertToRN(trustEntity)
541
- }
542
- }
543
-
544
- @ReactMethod
545
- fun listTrustEntities(query: ReadableMap, promise: Promise) {
546
- asyncCall(promise, scope) {
547
- val trustEntity = getCore().listTrustEntities(construct(query))
548
- return@asyncCall convertToRN(trustEntity)
549
- }
550
- }
551
-
552
-
553
- @ReactMethod
554
- fun getTrustEntityByDid(didId: String, promise: Promise) {
555
- asyncCall(promise, scope) {
556
- val trustEntity = getCore().getTrustEntityByDid(didId)
557
- return@asyncCall convertToRN(trustEntity)
558
- }
559
- }
560
-
561
- @ReactMethod
562
- fun resolveTrustEntityByIdentifier(request: ReadableMap, promise: Promise) {
563
- asyncCall(promise, scope) {
564
- val trustEntities = getCore().resolveTrustEntityByIdentifier(construct(request))
565
- return@asyncCall convertToRN(trustEntities)
566
- }
567
- }
568
-
569
- @ReactMethod
570
- fun createRemoteTrustEntity(request: ReadableMap, promise: Promise) {
571
- asyncCall(promise, scope) {
572
- return@asyncCall getCore().createRemoteTrustEntity(construct(request))
573
- }
574
- }
575
-
576
- @ReactMethod
577
- fun updateRemoteTrustEntity(request: ReadableMap, promise: Promise) {
578
- asyncCall(promise, scope) {
579
- getCore().updateRemoteTrustEntity(construct(request))
580
- return@asyncCall null
581
- }
582
- }
583
-
584
- @ReactMethod
585
- fun getRemoteTrustEntity(didId: String, promise: Promise) {
586
- asyncCall(promise, scope) {
587
- val trustEntity = getCore().getRemoteTrustEntity(didId)
588
- return@asyncCall convertToRN(trustEntity)
589
- }
590
- }
591
-
592
539
  @ReactMethod
593
540
  fun createBackup(password: String, outputPath: String, promise: Promise) {
594
541
  asyncCall(promise, scope) {
@@ -74,11 +74,20 @@ object SerializeSpecific {
74
74
  result.putArray("value", values)
75
75
  }
76
76
 
77
- is HistoryMetadata.Certificate -> {
78
- result.putString("type_", "CERTIFICATE")
79
- val values = Arguments.createArray()
80
- values.pushString(metadata.v1)
81
- result.putArray("value", values)
77
+ is HistoryMetadata.WalletRelyingParty -> {
78
+ result.putString("type_", "WALLET_RELYING_PARTY")
79
+ result.putMap(
80
+ "value",
81
+ convertToRN(metadata.value) as ReadableMap
82
+ )
83
+ }
84
+
85
+ is HistoryMetadata.TrustResolution -> {
86
+ result.putString("type_", "TRUST_RESOLUTION")
87
+ result.putMap(
88
+ "value",
89
+ convertToRN(metadata.value) as ReadableMap
90
+ )
82
91
  }
83
92
  }
84
93
  return result
@@ -93,6 +102,12 @@ object SerializeSpecific {
93
102
  "applicableCredentials",
94
103
  convertToRN(query.applicableCredentials) as ReadableArray
95
104
  )
105
+ query.purpose?.let {
106
+ val purpose = Arguments.createMap()
107
+ it.forEach { (key, value) -> purpose.putString(key, value) }
108
+ result.putMap("purpose", purpose)
109
+ }
110
+
96
111
  }
97
112
 
98
113
  is ApplicableCredentialOrFailureHint.FailureHint -> {
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/98296/android/onecore-debug.aar",
5
- "sha1": "bda9f1358e75339000787c79cf5fa20bffe012ad"
4
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/107844/android/onecore-debug.aar",
5
+ "sha1": "266d4a4b4f16e414185907578e83ebd3f8fdd429"
6
6
  },
7
7
  "release": {
8
- "url": "https://onesdk.blob.core.windows.net/core-sdk/98296/android/onecore-release.aar",
9
- "sha1": "76b4d21931d5079b95d0a9ec780ec9b7ef4bd4cf"
8
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/107844/android/onecore-release.aar",
9
+ "sha1": "08fc02676a2aaad715e45f80750c847f49e7faad"
10
10
  }
11
11
  },
12
12
  "ios": {
13
- "url": "https://onesdk.blob.core.windows.net/core-sdk/98296/ios/deploy.zip",
14
- "sha1": "7b3cdd3c5192e99b7a906cd0d10311f20f539b5d"
13
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/107844/ios/deploy.zip",
14
+ "sha1": "a3f6525899a9e7e4bb5081621aee5562de57f2e9"
15
15
  }
16
16
  }
package/dist/index.js CHANGED
@@ -13,7 +13,11 @@ interfaceMethodNames.forEach((method) => ONE?.[method]);
13
13
  // Config entities are exposed as serialized JSON, here conversion to structs
14
14
  const originalGetConfig = ONE?.getConfig;
15
15
  if (originalGetConfig) {
16
- ONE.getConfig = () => originalGetConfig().then((config) => objectMap(config, (entities) => objectMap(entities, (json) => JSON.parse(json))));
16
+ ONE.getConfig = () => originalGetConfig().then((config) => objectMap(config, (entityValue) => {
17
+ return typeof entityValue === "string"
18
+ ? entityValue
19
+ : objectMap(entityValue, (json) => JSON.parse(json));
20
+ }));
17
21
  }
18
22
  /**
19
23
  * Initialize ONE Core
@@ -1,4 +1,4 @@
1
- import { TrustEntityType, IdentifierType } from "./one-core-uniffi-intf";
1
+ import { IdentifierType } from "./one-core-uniffi-intf";
2
2
  export declare enum KeyAlgorithmFeature {
3
3
  GENERATE_CSR = "GENERATE_CSR"
4
4
  }
@@ -140,14 +140,6 @@ export interface VerificationProtocolCapabilities {
140
140
  verifierIdentifierTypes: IdentifierType[];
141
141
  supportedPresentationDefinition: PresentationDefinitionVersion[];
142
142
  }
143
- export declare enum TrustOperation {
144
- Publish = "PUBLISH",
145
- Lookup = "LOOKUP"
146
- }
147
- export interface TrustCapabilities {
148
- operations: TrustOperation[];
149
- supportedTypes: TrustEntityType[];
150
- }
151
143
  export interface CoreConfig {
152
144
  format: ConfigEntities<FormatCapabilities>;
153
145
  issuanceProtocol: ConfigEntities<IssuanceProtocolCapabilities>;
@@ -159,10 +151,11 @@ export interface CoreConfig {
159
151
  datatype: ConfigEntities<undefined, DataTypeParams>;
160
152
  keyAlgorithm: ConfigEntities<KeyAlgorithmCapabilities, {}>;
161
153
  keyStorage: ConfigEntities<KeyStorageCapabilities>;
162
- trustManagement: ConfigEntities<TrustCapabilities>;
163
154
  cacheEntities: ConfigEntities;
164
155
  task: ConfigEntities;
165
156
  credentialIssuer: ConfigEntities<undefined, {}>;
166
157
  walletProvider: ConfigEntities;
158
+ verifierProvider: ConfigEntities<undefined, {}>;
159
+ defaultLanguage: string;
167
160
  }
168
161
  export {};
@@ -58,11 +58,6 @@ export var PresentationDefinitionVersion;
58
58
  PresentationDefinitionVersion["V1"] = "V1";
59
59
  PresentationDefinitionVersion["V2"] = "V2";
60
60
  })(PresentationDefinitionVersion || (PresentationDefinitionVersion = {}));
61
- export var TrustOperation;
62
- (function (TrustOperation) {
63
- TrustOperation["Publish"] = "PUBLISH";
64
- TrustOperation["Lookup"] = "LOOKUP";
65
- })(TrustOperation || (TrustOperation = {}));
66
61
  // Typescript automatic assertions to keep the fields of ONECore Config and typed Config in sync
67
62
  /** assert that all fields listed in {@link CoreConfig} exist in {@link Config} */
68
63
  const missingFieldsCheck = null;
@@ -10,4 +10,4 @@ export interface ONECore extends Omit<OneCore, "version" | "getConfig"> {
10
10
  * @hidden
11
11
  * New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
12
12
  */
13
- export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "listDids", "createIdentifier", "getIdentifier", "listIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinition", "getPresentationDefinitionV2", "holderRejectProof", "holderSubmitProof", "holderSubmitProofV2", "listCredentials", "runTask", "deleteProofClaims", "getCredential", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "listCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "listProofs", "deleteProof", "proposeProof", "createProofSchema", "listProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "createTrustAnchor", "deleteTrustAnchor", "getTrustAnchor", "listTrustAnchors", "createTrustEntity", "getTrustEntity", "listTrustEntities", "getTrustEntityByDid", "resolveTrustEntityByIdentifier", "createRemoteTrustEntity", "getRemoteTrustEntity", "updateRemoteTrustEntity", "listHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterWalletUnit", "holderWalletUnitStatus", "holderGetWalletUnit", "holderWalletUnitUpdate", "holderGetWalletUnitTrustCollections", "registerVerifierInstance", "updateVerifierInstance", "getVerifierInstanceTrustCollections", "nfcReadIsoMdlEngagement", "nfcStopIsoMdlEngagement", "uninitialize"];
13
+ export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "getOrganisation", "generateKey", "createDid", "listDids", "createIdentifier", "getIdentifier", "listIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "holderRefreshCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinition", "getPresentationDefinitionV2", "holderRejectProof", "holderSubmitProof", "holderSubmitProofV2", "listCredentials", "runTask", "deleteProofClaims", "getCredential", "getCredentialTrustInformation", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "createCredentialSchema", "listCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofTrustInformation", "listProofs", "deleteProof", "proposeProof", "createProofSchema", "listProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "listHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterWalletUnit", "holderWalletUnitStatus", "holderGetWalletUnit", "holderWalletUnitUpdate", "holderGetWalletUnitTrustCollections", "registerVerifierInstance", "updateVerifierInstance", "getVerifierInstanceTrustCollections", "nfcReadIsoMdlEngagement", "nfcStopIsoMdlEngagement", "uninitialize"];
package/dist/src/core.js CHANGED
@@ -9,6 +9,7 @@ export const interfaceMethodNames = [
9
9
  "getConfig",
10
10
  "createOrganisation",
11
11
  "upsertOrganisation",
12
+ "getOrganisation",
12
13
  "generateKey",
13
14
  "createDid",
14
15
  "listDids",
@@ -19,6 +20,7 @@ export const interfaceMethodNames = [
19
20
  "handleInvitation",
20
21
  "holderAcceptCredential",
21
22
  "holderRejectCredential",
23
+ "holderRefreshCredential",
22
24
  "initiateIssuance",
23
25
  "continueIssuance",
24
26
  "getPresentationDefinition",
@@ -30,9 +32,11 @@ export const interfaceMethodNames = [
30
32
  "runTask",
31
33
  "deleteProofClaims",
32
34
  "getCredential",
35
+ "getCredentialTrustInformation",
33
36
  "deleteCredential",
34
37
  "importCredentialSchema",
35
38
  "getCredentialSchema",
39
+ "createCredentialSchema",
36
40
  "listCredentialSchemas",
37
41
  "deleteCredentialSchema",
38
42
  "createProof",
@@ -40,6 +44,7 @@ export const interfaceMethodNames = [
40
44
  "shareProofSchema",
41
45
  "shareCredentialSchema",
42
46
  "getProof",
47
+ "getProofTrustInformation",
43
48
  "listProofs",
44
49
  "deleteProof",
45
50
  "proposeProof",
@@ -49,18 +54,6 @@ export const interfaceMethodNames = [
49
54
  "deleteProofSchema",
50
55
  "importProofSchema",
51
56
  "checkRevocation",
52
- "createTrustAnchor",
53
- "deleteTrustAnchor",
54
- "getTrustAnchor",
55
- "listTrustAnchors",
56
- "createTrustEntity",
57
- "getTrustEntity",
58
- "listTrustEntities",
59
- "getTrustEntityByDid",
60
- "resolveTrustEntityByIdentifier",
61
- "createRemoteTrustEntity",
62
- "getRemoteTrustEntity",
63
- "updateRemoteTrustEntity",
64
57
  "listHistory",
65
58
  "getHistoryEntry",
66
59
  "createBackup",