@procivis/react-native-one-core 1.41710.0 → 1.52682.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/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +4 -2
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +45 -12
- package/android/src/main/java/ch/procivis/one/core/Serialize.kt +3 -1
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +13 -0
- package/core-sdk.json +6 -6
- package/dist/src/config.d.ts +17 -2
- package/dist/src/config.js +9 -0
- package/dist/src/core.d.ts +15 -9
- package/dist/src/core.js +6 -1
- package/dist/src/credential.d.ts +6 -6
- package/dist/src/history.d.ts +6 -3
- package/dist/src/history.js +3 -0
- package/dist/src/identifier.d.ts +125 -0
- package/dist/src/identifier.js +29 -0
- package/dist/src/key.d.ts +0 -3
- package/dist/src/organisation.d.ts +2 -1
- package/dist/src/proof.d.ts +11 -9
- package/dist/src/trust.d.ts +44 -4
- package/dist/src/trust.js +5 -0
- package/ios/Deserialize.swift +140 -813
- package/ios/EventEmitter.swift +84 -72
- package/ios/ProcivisOneCoreModule.m +23 -6
- package/ios/ProcivisOneCoreModule.swift +981 -805
- package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +9 -1
- package/ios/RNDecoder/RNDecoder.swift +191 -0
- package/ios/RNDecoder/RNDecodingStorage.swift +33 -0
- package/ios/RNDecoder/RNKeyedDecodingContainer.swift +133 -0
- package/ios/RNDecoder/RNUnkeyedDecodingContainer.swift +175 -0
- package/ios/RNEncoder/RNAnyCodingKey.swift +31 -0
- package/ios/RNEncoder/RNEncoder.swift +95 -0
- package/ios/RNEncoder/RNKeyedEncodingContainer.swift +81 -0
- package/ios/RNEncoder/RNSingleValueEncodingContainer.swift +78 -0
- package/ios/RNEncoder/RNUnkeyedEncodingContainer.swift +84 -0
- package/ios/Serialize.swift +46 -615
- package/ios/Util.swift +35 -25
- package/package.json +4 -2
|
@@ -57,13 +57,15 @@ object DeserializeSpecific {
|
|
|
57
57
|
pageSize = query.getUInt("pageSize")!!,
|
|
58
58
|
organisationId = query.getString("organisationId").toString(),
|
|
59
59
|
entityId = query.getString("entityId"),
|
|
60
|
-
|
|
60
|
+
actions = opt(query.getArray("actions")) { types ->
|
|
61
|
+
enumList(types, HistoryActionBindingEnum::valueOf)
|
|
62
|
+
},
|
|
61
63
|
entityTypes = opt(query.getArray("entityTypes")) { types ->
|
|
62
64
|
enumList(types, HistoryEntityTypeBindingEnum::valueOf)
|
|
63
65
|
},
|
|
64
66
|
createdDateFrom = query.getString("createdDateFrom"),
|
|
65
67
|
createdDateTo = query.getString("createdDateTo"),
|
|
66
|
-
|
|
68
|
+
identifierId = query.getString("identifierId"),
|
|
67
69
|
credentialId = query.getString("credentialId"),
|
|
68
70
|
credentialSchemaId = query.getString("credentialSchemaId"),
|
|
69
71
|
search = historySearch(
|
|
@@ -92,14 +92,6 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
@ReactMethod
|
|
96
|
-
fun checkCertificate(keyId: String, certificate: ReadableMap, promise: Promise) {
|
|
97
|
-
asyncCall(promise, scope) {
|
|
98
|
-
getCore().checkCertificate(keyId, construct(certificate))
|
|
99
|
-
return@asyncCall null
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
95
|
@ReactMethod
|
|
104
96
|
fun shareCredentialSchema(credentialSchemaId: String, promise: Promise) {
|
|
105
97
|
asyncCall(promise, scope) {
|
|
@@ -153,6 +145,37 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
153
145
|
}
|
|
154
146
|
}
|
|
155
147
|
|
|
148
|
+
@ReactMethod
|
|
149
|
+
fun createIdentifier(identifierRequest: ReadableMap, promise: Promise) {
|
|
150
|
+
asyncCall(promise, scope) {
|
|
151
|
+
return@asyncCall getCore().createIdentifier(construct(identifierRequest))
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@ReactMethod
|
|
156
|
+
fun getIdentifiers(query: ReadableMap, promise: Promise) {
|
|
157
|
+
asyncCall(promise, scope) {
|
|
158
|
+
val identifiers = getCore().listIdentifiers(construct(query))
|
|
159
|
+
return@asyncCall convertToRN(identifiers)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@ReactMethod
|
|
164
|
+
fun getIdentifier(identifierId: String, promise: Promise) {
|
|
165
|
+
asyncCall(promise, scope) {
|
|
166
|
+
val identifier = getCore().getIdentifier(identifierId)
|
|
167
|
+
return@asyncCall convertToRN(identifier)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@ReactMethod
|
|
172
|
+
fun deleteIdentifier(identifierId: String, promise: Promise) {
|
|
173
|
+
asyncCall(promise, scope) {
|
|
174
|
+
getCore().deleteIdentifier(identifierId)
|
|
175
|
+
return@asyncCall null
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
156
179
|
@ReactMethod
|
|
157
180
|
fun handleInvitation(
|
|
158
181
|
url: String,
|
|
@@ -170,13 +193,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
170
193
|
@ReactMethod
|
|
171
194
|
fun holderAcceptCredential(
|
|
172
195
|
interactionId: String,
|
|
173
|
-
didId: String
|
|
196
|
+
didId: String?,
|
|
197
|
+
identifierId: String?,
|
|
174
198
|
keyId: String?,
|
|
175
199
|
txCode: String?,
|
|
176
200
|
promise: Promise
|
|
177
201
|
) {
|
|
178
202
|
asyncCall(promise, scope) {
|
|
179
|
-
getCore().holderAcceptCredential(interactionId, didId, keyId, txCode)
|
|
203
|
+
getCore().holderAcceptCredential(interactionId, didId, identifierId, keyId, txCode)
|
|
180
204
|
return@asyncCall null
|
|
181
205
|
}
|
|
182
206
|
}
|
|
@@ -209,7 +233,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
209
233
|
fun holderSubmitProof(
|
|
210
234
|
interactionId: String,
|
|
211
235
|
credentials: ReadableMap,
|
|
212
|
-
didId: String
|
|
236
|
+
didId: String?,
|
|
237
|
+
identifierId: String?,
|
|
213
238
|
keyId: String?,
|
|
214
239
|
promise: Promise
|
|
215
240
|
) {
|
|
@@ -220,7 +245,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
220
245
|
val credential = entry.value as ReadableMap
|
|
221
246
|
submitCredentials[entry.key] = construct(credential)
|
|
222
247
|
}
|
|
223
|
-
getCore().holderSubmitProof(interactionId, submitCredentials, didId, keyId)
|
|
248
|
+
getCore().holderSubmitProof(interactionId, submitCredentials, didId, identifierId, keyId)
|
|
224
249
|
return@asyncCall null
|
|
225
250
|
}
|
|
226
251
|
}
|
|
@@ -457,6 +482,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
457
482
|
}
|
|
458
483
|
}
|
|
459
484
|
|
|
485
|
+
@ReactMethod
|
|
486
|
+
fun resolveTrustEntityByIdentifier(request: ReadableMap, promise: Promise) {
|
|
487
|
+
asyncCall(promise, scope) {
|
|
488
|
+
val trustEntities = getCore().resolveTrustEntityByIdentifier(construct(request))
|
|
489
|
+
return@asyncCall convertToRN(trustEntities)
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
460
493
|
@ReactMethod
|
|
461
494
|
fun createRemoteTrustEntity(request: ReadableMap, promise: Promise) {
|
|
462
495
|
asyncCall(promise, scope) {
|
|
@@ -43,7 +43,7 @@ object Serialize {
|
|
|
43
43
|
} else if (type == Int::class.java || type == java.lang.Integer::class.java) {
|
|
44
44
|
return Pair(RNType.INT, input as Int)
|
|
45
45
|
} else if (type == Byte::class.java || type == java.lang.Byte::class.java) {
|
|
46
|
-
return Pair(RNType.INT, (input as Byte).toInt())
|
|
46
|
+
return Pair(RNType.INT, (input as Byte).toUByte().toInt())
|
|
47
47
|
} else if (type == Short::class.java || type == java.lang.Short::class.java) {
|
|
48
48
|
return Pair(RNType.INT, (input as Short).toInt())
|
|
49
49
|
} else if (type == Long::class.java || type == java.lang.Long::class.java) {
|
|
@@ -56,6 +56,8 @@ object Serialize {
|
|
|
56
56
|
return Pair(RNType.STRING, (input as Char).toString())
|
|
57
57
|
} else if (SerializeSpecific.Str.isCustomConversionType(input)) {
|
|
58
58
|
return Pair(RNType.STRING, SerializeSpecific.Str.convertCustom(input))
|
|
59
|
+
} else if (SerializeSpecific.Arr.isCustomConversionType(input)) {
|
|
60
|
+
return Pair(RNType.ARRAY, SerializeSpecific.Arr.convertCustom(input))
|
|
59
61
|
} else {
|
|
60
62
|
return Pair(RNType.MAP, input)
|
|
61
63
|
}
|
|
@@ -130,4 +130,17 @@ object SerializeSpecific {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
+
|
|
134
|
+
object Arr {
|
|
135
|
+
fun isCustomConversionType(input: Any?): Boolean {
|
|
136
|
+
return ByteArray::class.isInstance(input)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
fun convertCustom(input: Any): List<*> {
|
|
140
|
+
if (input is ByteArray) {
|
|
141
|
+
return input.toList()
|
|
142
|
+
}
|
|
143
|
+
throw IllegalArgumentException("Invalid array conversion: $input")
|
|
144
|
+
}
|
|
145
|
+
}
|
|
133
146
|
}
|
package/core-sdk.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"android": {
|
|
3
3
|
"debug": {
|
|
4
|
-
"url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/android/
|
|
5
|
-
"sha1": "
|
|
4
|
+
"url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/android/52682/onecore-debug.aar",
|
|
5
|
+
"sha1": "6b72910470386a1547cb3a821f036bb1b7cb7260"
|
|
6
6
|
},
|
|
7
7
|
"release": {
|
|
8
|
-
"url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/android/
|
|
9
|
-
"sha1": "
|
|
8
|
+
"url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/android/52682/onecore-release.aar",
|
|
9
|
+
"sha1": "69e39d3831b9f0092d6641e75a2d996897492314"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"ios": {
|
|
13
|
-
"url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/ios/
|
|
14
|
-
"sha1": "
|
|
13
|
+
"url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/ios/52682/deploy.zip",
|
|
14
|
+
"sha1": "d54a48819dddf9800dacfc6fe3d4cc3d2c9696cd"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TrustEntityTypeEnum } from "./trust";
|
|
1
2
|
export declare enum KeyAlgorithmFeatureEnum {
|
|
2
3
|
GENERATE_CSR = "GENERATE_CSR"
|
|
3
4
|
}
|
|
@@ -47,6 +48,8 @@ export interface FormatCapabilities {
|
|
|
47
48
|
datatypes: Array<DataTypeEnum | string>;
|
|
48
49
|
allowedSchemaIds: string[];
|
|
49
50
|
forbiddenClaimNames: string[];
|
|
51
|
+
issuanceIdentifierTypes: string[];
|
|
52
|
+
verificationIdentifierTypes: string[];
|
|
50
53
|
}
|
|
51
54
|
export declare enum RevocationOperationEnum {
|
|
52
55
|
REVOKE = "REVOKE",
|
|
@@ -58,7 +61,7 @@ export interface RevocationCapabilities {
|
|
|
58
61
|
export interface ConfigEntity<Capabilities> {
|
|
59
62
|
enabled?: boolean;
|
|
60
63
|
capabilities: Capabilities;
|
|
61
|
-
display: string
|
|
64
|
+
display: string | Record<string, string>;
|
|
62
65
|
order: number;
|
|
63
66
|
}
|
|
64
67
|
export type ConfigEntities<Capabilities = undefined, Params = {
|
|
@@ -110,13 +113,25 @@ export type DataTypeParams = {
|
|
|
110
113
|
type: DataTypeEnum.Object;
|
|
111
114
|
params?: undefined;
|
|
112
115
|
};
|
|
116
|
+
export declare enum IssuanceProtocolFeatureEnum {
|
|
117
|
+
SupportsRejection = "SUPPORTS_REJECTION"
|
|
118
|
+
}
|
|
113
119
|
export interface IssuanceProtocolCapabilities {
|
|
114
120
|
didMethods: string[];
|
|
121
|
+
features: IssuanceProtocolFeatureEnum[];
|
|
115
122
|
}
|
|
116
123
|
export interface VerificationProtocolCapabilities {
|
|
117
124
|
didMethods: string[];
|
|
118
125
|
supportedTransports: string[];
|
|
119
126
|
}
|
|
127
|
+
export declare enum TrustOperation {
|
|
128
|
+
Publish = "PUBLISH",
|
|
129
|
+
Lookup = "LOOKUP"
|
|
130
|
+
}
|
|
131
|
+
export interface TrustCapabilities {
|
|
132
|
+
operations: TrustOperation[];
|
|
133
|
+
supportedTypes: TrustEntityTypeEnum[];
|
|
134
|
+
}
|
|
120
135
|
export interface Config {
|
|
121
136
|
format: ConfigEntities<FormatCapabilities>;
|
|
122
137
|
issuanceProtocol: ConfigEntities<IssuanceProtocolCapabilities>;
|
|
@@ -127,7 +142,7 @@ export interface Config {
|
|
|
127
142
|
datatype: ConfigEntities<undefined, DataTypeParams>;
|
|
128
143
|
keyAlgorithm: ConfigEntities<KeyAlgorithmCapabilities, {}>;
|
|
129
144
|
keyStorage: ConfigEntities<KeyStorageCapabilities>;
|
|
130
|
-
trustManagement: ConfigEntities
|
|
145
|
+
trustManagement: ConfigEntities<TrustCapabilities>;
|
|
131
146
|
cacheEntities: ConfigEntities;
|
|
132
147
|
}
|
|
133
148
|
export {};
|
package/dist/src/config.js
CHANGED
|
@@ -42,3 +42,12 @@ export var DataTypeEnum;
|
|
|
42
42
|
DataTypeEnum["Boolean"] = "BOOLEAN";
|
|
43
43
|
DataTypeEnum["Object"] = "OBJECT";
|
|
44
44
|
})(DataTypeEnum || (DataTypeEnum = {}));
|
|
45
|
+
export var IssuanceProtocolFeatureEnum;
|
|
46
|
+
(function (IssuanceProtocolFeatureEnum) {
|
|
47
|
+
IssuanceProtocolFeatureEnum["SupportsRejection"] = "SUPPORTS_REJECTION";
|
|
48
|
+
})(IssuanceProtocolFeatureEnum || (IssuanceProtocolFeatureEnum = {}));
|
|
49
|
+
export var TrustOperation;
|
|
50
|
+
(function (TrustOperation) {
|
|
51
|
+
TrustOperation["Publish"] = "PUBLISH";
|
|
52
|
+
TrustOperation["Lookup"] = "LOOKUP";
|
|
53
|
+
})(TrustOperation || (TrustOperation = {}));
|
package/dist/src/core.d.ts
CHANGED
|
@@ -4,19 +4,21 @@ import { CredentialDetail, CredentialListItem, CredentialListQuery, CredentialRe
|
|
|
4
4
|
import { CredentialSchema, CredentialSchemaDetail, CredentialSchemaListQuery, ImportCredentialSchemaRequest, ShareCredentialSchemaResponse } from "./credentialSchema";
|
|
5
5
|
import { DidListItem, DidListQuery, DidRequest } from "./did";
|
|
6
6
|
import { HistoryListItem, HistoryListQuery } from "./history";
|
|
7
|
-
import {
|
|
7
|
+
import { KeyRequest } from "./key";
|
|
8
8
|
import { ItemList } from "./list";
|
|
9
9
|
import { CreateProofRequest, InvitationResultProofRequest, PresentationDefinition, PresentationDefinitionRequestedCredential, PresentationSubmitCredentialRequest, ProofDetail, ProofListItem, ProofListQuery, ProposeProofResponse, ShareProofRequest, ShareProofResponse } from "./proof";
|
|
10
10
|
import { CreateProofSchemaRequest, ImportProofSchemaRequest, ProofSchema, ProofSchemaListItem, ProofSchemaListQuery, ShareProofSchemaResponse } from "./proofSchema";
|
|
11
|
-
import { CreateRemoteTrustEntityRequest, CreateTrustAnchorRequest, CreateTrustEntityRequest, TrustAnchor, TrustAnchorListItem, TrustAnchorListQuery, TrustEntity, TrustEntityListItem, TrustEntityListQuery, UpdateRemoteTrustEntityRequest } from "./trust";
|
|
11
|
+
import { CreateRemoteTrustEntityRequest, CreateTrustAnchorRequest, CreateTrustEntityRequest, RemoteTrustEntity, ResolvedIdentifierTrustEntity, ResolveTrustEntityByIdentifierRequest, TrustAnchor, TrustAnchorListItem, TrustAnchorListQuery, TrustEntity, TrustEntityListItem, TrustEntityListQuery, UpdateRemoteTrustEntityRequest } from "./trust";
|
|
12
12
|
import { CacheType } from "./cache";
|
|
13
13
|
import { CreateOrganisationRequest, UpsertOrganisationRequest } from "./organisation";
|
|
14
|
+
import { CreateIdentifierRequest, IdentifierDetail, IdentifierListItem, IdentifierListQuery } from "./identifier";
|
|
14
15
|
export * from "./backup";
|
|
15
16
|
export * from "./cache";
|
|
16
17
|
export * from "./config";
|
|
17
18
|
export * from "./credential";
|
|
18
19
|
export * from "./credentialSchema";
|
|
19
20
|
export * from "./did";
|
|
21
|
+
export * from "./identifier";
|
|
20
22
|
export * from "./history";
|
|
21
23
|
export * from "./key";
|
|
22
24
|
export * from "./list";
|
|
@@ -45,15 +47,18 @@ export interface ONECore {
|
|
|
45
47
|
generateKey(keyRequest: KeyRequest): Promise<string>;
|
|
46
48
|
createDid(didRequest: DidRequest): Promise<string>;
|
|
47
49
|
getDids(query: DidListQuery): Promise<ItemList<DidListItem>>;
|
|
50
|
+
createIdentifier(identifierRequest: CreateIdentifierRequest): Promise<string>;
|
|
51
|
+
getIdentifiers(query: IdentifierListQuery): Promise<ItemList<IdentifierListItem>>;
|
|
52
|
+
getIdentifier(identifierId: IdentifierListItem["id"]): Promise<IdentifierDetail>;
|
|
53
|
+
deleteIdentifier(identifierId: IdentifierListItem["id"]): Promise<void>;
|
|
48
54
|
handleInvitation(url: string, organisationId: string, transport: string[] | undefined): Promise<InvitationResult>;
|
|
49
|
-
holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId:
|
|
55
|
+
holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined, txCode: string | undefined): Promise<void>;
|
|
50
56
|
holderRejectCredential(interactionId: InvitationResultCredentialIssuance["interactionId"]): Promise<void>;
|
|
51
57
|
getPresentationDefinition(proofId: ProofDetail["id"]): Promise<PresentationDefinition>;
|
|
52
58
|
holderRejectProof(interactionId: InvitationResultProofRequest["interactionId"]): Promise<void>;
|
|
53
|
-
holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest>, didId:
|
|
59
|
+
holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest>, didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined): Promise<void>;
|
|
54
60
|
getCredentials(query: CredentialListQuery): Promise<ItemList<CredentialListItem>>;
|
|
55
61
|
runTask(task: string): Promise<string>;
|
|
56
|
-
checkCertificate(keyId: KeyListItem["id"], certificate: KeyCheckCertificateRequestBindingDto): Promise<void>;
|
|
57
62
|
deleteProofClaims(proofId: ProofDetail["id"]): Promise<void>;
|
|
58
63
|
getCredential(credentialId: CredentialListItem["id"]): Promise<CredentialDetail>;
|
|
59
64
|
deleteCredential(credentialId: CredentialListItem["id"]): Promise<void>;
|
|
@@ -80,11 +85,12 @@ export interface ONECore {
|
|
|
80
85
|
getTrustAnchor(trustAnchorId: TrustAnchor["id"]): Promise<TrustAnchor>;
|
|
81
86
|
getTrustAnchors(query: TrustAnchorListQuery): Promise<ItemList<TrustAnchorListItem>>;
|
|
82
87
|
createTrustEntity(request: CreateTrustEntityRequest): Promise<TrustEntity["id"]>;
|
|
83
|
-
getTrustEntity(trustEntityId:
|
|
88
|
+
getTrustEntity(trustEntityId: TrustEntityListItem["id"]): Promise<TrustEntity>;
|
|
84
89
|
getTrustEntities(query: TrustEntityListQuery): Promise<ItemList<TrustEntityListItem>>;
|
|
85
90
|
getTrustEntityByDid(didId: DidListItem["id"]): Promise<TrustEntity>;
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
resolveTrustEntityByIdentifier(request: ResolveTrustEntityByIdentifierRequest): Promise<Record<IdentifierListItem["id"], ResolvedIdentifierTrustEntity[]>>;
|
|
92
|
+
createRemoteTrustEntity(request: CreateRemoteTrustEntityRequest): Promise<RemoteTrustEntity["id"]>;
|
|
93
|
+
getRemoteTrustEntity(didId: DidListItem["id"]): Promise<RemoteTrustEntity>;
|
|
88
94
|
updateRemoteTrustEntity(request: UpdateRemoteTrustEntityRequest): Promise<void>;
|
|
89
95
|
getHistory(query: HistoryListQuery): Promise<ItemList<HistoryListItem>>;
|
|
90
96
|
getHistoryEntry(historyId: HistoryListItem["id"]): Promise<HistoryListItem>;
|
|
@@ -122,4 +128,4 @@ export interface ONECore {
|
|
|
122
128
|
*/
|
|
123
129
|
uninitialize(deleteData: boolean): Promise<void>;
|
|
124
130
|
}
|
|
125
|
-
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "getPresentationDefinition", "holderRejectProof", "holderSubmitProof", "getCredentials", "runTask", "
|
|
131
|
+
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "createIdentifier", "getIdentifier", "getIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "getPresentationDefinition", "holderRejectProof", "holderSubmitProof", "getCredentials", "runTask", "deleteProofClaims", "getCredential", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "getCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofs", "deleteProof", "proposeProof", "createProofSchema", "getProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "createTrustAnchor", "deleteTrustAnchor", "getTrustAnchor", "getTrustAnchors", "createTrustEntity", "getTrustEntity", "getTrustEntities", "getTrustEntityByDid", "resolveTrustEntityByIdentifier", "createRemoteTrustEntity", "getRemoteTrustEntity", "updateRemoteTrustEntity", "getHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "uninitialize"];
|
package/dist/src/core.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./config";
|
|
|
4
4
|
export * from "./credential";
|
|
5
5
|
export * from "./credentialSchema";
|
|
6
6
|
export * from "./did";
|
|
7
|
+
export * from "./identifier";
|
|
7
8
|
export * from "./history";
|
|
8
9
|
export * from "./key";
|
|
9
10
|
export * from "./list";
|
|
@@ -20,6 +21,10 @@ export const interfaceMethodNames = [
|
|
|
20
21
|
"generateKey",
|
|
21
22
|
"createDid",
|
|
22
23
|
"getDids",
|
|
24
|
+
"createIdentifier",
|
|
25
|
+
"getIdentifier",
|
|
26
|
+
"getIdentifiers",
|
|
27
|
+
"deleteIdentifier",
|
|
23
28
|
"handleInvitation",
|
|
24
29
|
"holderAcceptCredential",
|
|
25
30
|
"holderRejectCredential",
|
|
@@ -28,7 +33,6 @@ export const interfaceMethodNames = [
|
|
|
28
33
|
"holderSubmitProof",
|
|
29
34
|
"getCredentials",
|
|
30
35
|
"runTask",
|
|
31
|
-
"checkCertificate",
|
|
32
36
|
"deleteProofClaims",
|
|
33
37
|
"getCredential",
|
|
34
38
|
"deleteCredential",
|
|
@@ -58,6 +62,7 @@ export const interfaceMethodNames = [
|
|
|
58
62
|
"getTrustEntity",
|
|
59
63
|
"getTrustEntities",
|
|
60
64
|
"getTrustEntityByDid",
|
|
65
|
+
"resolveTrustEntityByIdentifier",
|
|
61
66
|
"createRemoteTrustEntity",
|
|
62
67
|
"getRemoteTrustEntity",
|
|
63
68
|
"updateRemoteTrustEntity",
|
package/dist/src/credential.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTypeEnum } from "./config";
|
|
2
2
|
import { CredentialSchema } from "./credentialSchema";
|
|
3
3
|
import { ListQuery, SortDirection } from "./list";
|
|
4
|
-
import {
|
|
4
|
+
import { IdentifierListItem } from "./identifier";
|
|
5
5
|
export declare enum CredentialStateEnum {
|
|
6
6
|
CREATED = "CREATED",
|
|
7
7
|
PENDING = "PENDING",
|
|
@@ -47,20 +47,20 @@ export interface CredentialListItem {
|
|
|
47
47
|
issuanceDate: string;
|
|
48
48
|
lastModified: string;
|
|
49
49
|
revocationDate?: string;
|
|
50
|
-
|
|
50
|
+
issuer?: IdentifierListItem["id"];
|
|
51
51
|
state: CredentialStateEnum;
|
|
52
52
|
schema: CredentialSchema;
|
|
53
53
|
role: CredentialRoleEnum;
|
|
54
54
|
suspendEndDate?: string;
|
|
55
|
-
|
|
55
|
+
protocol: string;
|
|
56
56
|
}
|
|
57
|
-
export interface CredentialDetail extends Omit<CredentialListItem, "issuerDid"> {
|
|
57
|
+
export interface CredentialDetail extends Omit<CredentialListItem, "issuerDid" | "issuer"> {
|
|
58
58
|
claims: Claim[];
|
|
59
59
|
redirectUri?: string;
|
|
60
60
|
lvvcIssuanceDate?: string;
|
|
61
61
|
mdocMsoValidity?: MdocMsoValidity;
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
issuer?: IdentifierListItem;
|
|
63
|
+
holder?: IdentifierListItem;
|
|
64
64
|
}
|
|
65
65
|
export interface MdocMsoValidity {
|
|
66
66
|
expiration: string;
|
package/dist/src/history.d.ts
CHANGED
|
@@ -23,11 +23,14 @@ export declare enum HistoryActionEnum {
|
|
|
23
23
|
REMOVED = "REMOVED",
|
|
24
24
|
UPDATED = "UPDATED",
|
|
25
25
|
REACTIVATED = "REACTIVATED",
|
|
26
|
-
CSR_GENERATED = "CSR_GENERATED"
|
|
26
|
+
CSR_GENERATED = "CSR_GENERATED",
|
|
27
|
+
EXPIRED = "EXPIRED"
|
|
27
28
|
}
|
|
28
29
|
export declare enum HistoryEntityTypeEnum {
|
|
29
30
|
KEY = "KEY",
|
|
30
31
|
DID = "DID",
|
|
32
|
+
IDENTIFIER = "IDENTIFIER",
|
|
33
|
+
CERTIFICATE = "CERTIFICATE",
|
|
31
34
|
CREDENTIAL = "CREDENTIAL",
|
|
32
35
|
CREDENTIAL_SCHEMA = "CREDENTIAL_SCHEMA",
|
|
33
36
|
PROOF = "PROOF",
|
|
@@ -49,13 +52,13 @@ export declare enum HistorySearchTypeEnum {
|
|
|
49
52
|
}
|
|
50
53
|
export interface HistoryListQuery extends ListQuery {
|
|
51
54
|
entityId?: string;
|
|
52
|
-
|
|
55
|
+
actions?: HistoryActionEnum[];
|
|
53
56
|
entityTypes?: HistoryEntityTypeEnum[];
|
|
54
57
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
55
58
|
createdDateFrom?: string;
|
|
56
59
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
57
60
|
createdDateTo?: string;
|
|
58
|
-
|
|
61
|
+
identifierId?: string;
|
|
59
62
|
credentialId?: string;
|
|
60
63
|
credentialSchemaId?: string;
|
|
61
64
|
proofSchemaId?: string;
|
package/dist/src/history.js
CHANGED
|
@@ -23,11 +23,14 @@ export var HistoryActionEnum;
|
|
|
23
23
|
HistoryActionEnum["UPDATED"] = "UPDATED";
|
|
24
24
|
HistoryActionEnum["REACTIVATED"] = "REACTIVATED";
|
|
25
25
|
HistoryActionEnum["CSR_GENERATED"] = "CSR_GENERATED";
|
|
26
|
+
HistoryActionEnum["EXPIRED"] = "EXPIRED";
|
|
26
27
|
})(HistoryActionEnum || (HistoryActionEnum = {}));
|
|
27
28
|
export var HistoryEntityTypeEnum;
|
|
28
29
|
(function (HistoryEntityTypeEnum) {
|
|
29
30
|
HistoryEntityTypeEnum["KEY"] = "KEY";
|
|
30
31
|
HistoryEntityTypeEnum["DID"] = "DID";
|
|
32
|
+
HistoryEntityTypeEnum["IDENTIFIER"] = "IDENTIFIER";
|
|
33
|
+
HistoryEntityTypeEnum["CERTIFICATE"] = "CERTIFICATE";
|
|
31
34
|
HistoryEntityTypeEnum["CREDENTIAL"] = "CREDENTIAL";
|
|
32
35
|
HistoryEntityTypeEnum["CREDENTIAL_SCHEMA"] = "CREDENTIAL_SCHEMA";
|
|
33
36
|
HistoryEntityTypeEnum["PROOF"] = "PROOF";
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { DidRequestKeys, DidTypeEnum, KeyRoleEnum } from "./did";
|
|
2
|
+
import { KeyListItem } from "./key";
|
|
3
|
+
import { ListQuery, SortDirection } from "./list";
|
|
4
|
+
export declare enum IdentifierStateEnum {
|
|
5
|
+
ACTIVE = "ACTIVE",
|
|
6
|
+
DEACTIVATED = "DEACTIVATED"
|
|
7
|
+
}
|
|
8
|
+
export declare enum IdentifierTypeEnum {
|
|
9
|
+
KEY = "KEY",
|
|
10
|
+
DID = "DID",
|
|
11
|
+
CERTIFICATE = "CERTIFICATE"
|
|
12
|
+
}
|
|
13
|
+
export interface CreateIdentifierRequest {
|
|
14
|
+
organisationId: string;
|
|
15
|
+
name: string;
|
|
16
|
+
keyId?: KeyListItem["id"];
|
|
17
|
+
did?: CreateIdentifierDidRequest;
|
|
18
|
+
certificates?: CreateIdentifierCertificateRequest[];
|
|
19
|
+
}
|
|
20
|
+
export interface CreateIdentifierDidRequest {
|
|
21
|
+
name?: string;
|
|
22
|
+
method: string;
|
|
23
|
+
keys: DidRequestKeys;
|
|
24
|
+
params: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateIdentifierCertificateRequest {
|
|
27
|
+
name?: string;
|
|
28
|
+
chain: string;
|
|
29
|
+
keyId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IdentifierListItem {
|
|
32
|
+
id: string;
|
|
33
|
+
createdDate: string;
|
|
34
|
+
lastModified: string;
|
|
35
|
+
name: string;
|
|
36
|
+
type: IdentifierTypeEnum;
|
|
37
|
+
isRemote: boolean;
|
|
38
|
+
state: IdentifierStateEnum;
|
|
39
|
+
organisationId?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface IdentifierDetail extends IdentifierListItem {
|
|
42
|
+
did?: IdentifierDidDetail;
|
|
43
|
+
key?: IdentifierKeyDetail;
|
|
44
|
+
certificates?: IdentifierCertificateDetail[];
|
|
45
|
+
}
|
|
46
|
+
export interface IdentifierDidDetail {
|
|
47
|
+
id: string;
|
|
48
|
+
createdDate: string;
|
|
49
|
+
lastModified: string;
|
|
50
|
+
name: string;
|
|
51
|
+
organisationId: string;
|
|
52
|
+
did: string;
|
|
53
|
+
didType: DidTypeEnum;
|
|
54
|
+
didMethod: string;
|
|
55
|
+
keys: {
|
|
56
|
+
authentication: KeyListItem[];
|
|
57
|
+
assertionMethod: KeyListItem[];
|
|
58
|
+
keyAgreement: KeyListItem[];
|
|
59
|
+
capabilityInvocation: KeyListItem[];
|
|
60
|
+
capabilityDelegation: KeyListItem[];
|
|
61
|
+
};
|
|
62
|
+
deactivated: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface IdentifierKeyDetail {
|
|
65
|
+
id: string;
|
|
66
|
+
createdDate: string;
|
|
67
|
+
lastModified: string;
|
|
68
|
+
organisationId: string;
|
|
69
|
+
name: string;
|
|
70
|
+
publicKey: number[];
|
|
71
|
+
keyType: string;
|
|
72
|
+
storageType: string;
|
|
73
|
+
}
|
|
74
|
+
export interface IdentifierCertificateDetail {
|
|
75
|
+
id: string;
|
|
76
|
+
createdDate: string;
|
|
77
|
+
lastModified: string;
|
|
78
|
+
state: CertificateStateEnum;
|
|
79
|
+
name: string;
|
|
80
|
+
chain: string;
|
|
81
|
+
key: KeyListItem;
|
|
82
|
+
x509Attributes: X509Attributes;
|
|
83
|
+
}
|
|
84
|
+
export declare enum CertificateStateEnum {
|
|
85
|
+
NOT_YET_ACTIVE = "NOT_YET_ACTIVE",
|
|
86
|
+
ACTIVE = "ACTIVE",
|
|
87
|
+
REVOKED = "REVOKED",
|
|
88
|
+
EXPIRED = "EXPIRED"
|
|
89
|
+
}
|
|
90
|
+
export interface X509Attributes {
|
|
91
|
+
serialNumber: string;
|
|
92
|
+
notBefore: string;
|
|
93
|
+
notAfter: string;
|
|
94
|
+
issuer: string;
|
|
95
|
+
subject: string;
|
|
96
|
+
fingerprint: string;
|
|
97
|
+
extensions: X509Extension[];
|
|
98
|
+
}
|
|
99
|
+
export interface X509Extension {
|
|
100
|
+
oid: string;
|
|
101
|
+
value: string;
|
|
102
|
+
critical: boolean;
|
|
103
|
+
}
|
|
104
|
+
export declare enum SortableIdentifierColumnEnum {
|
|
105
|
+
NAME = "NAME",
|
|
106
|
+
CREATED_DATE = "CREATED_DATE",
|
|
107
|
+
TYPE = "TYPE",
|
|
108
|
+
STATE = "STATE"
|
|
109
|
+
}
|
|
110
|
+
export declare enum ExactIdentifierFilterColumnEnum {
|
|
111
|
+
NAME = "NAME"
|
|
112
|
+
}
|
|
113
|
+
export interface IdentifierListQuery extends ListQuery {
|
|
114
|
+
sort?: SortableIdentifierColumnEnum;
|
|
115
|
+
sortDirection?: SortDirection;
|
|
116
|
+
name?: string;
|
|
117
|
+
types?: IdentifierTypeEnum[];
|
|
118
|
+
state?: IdentifierStateEnum;
|
|
119
|
+
exact?: ExactIdentifierFilterColumnEnum[];
|
|
120
|
+
didMethods?: string[];
|
|
121
|
+
isRemote?: boolean;
|
|
122
|
+
keyAlgorithms?: string[];
|
|
123
|
+
keyRoles?: KeyRoleEnum[];
|
|
124
|
+
keyStorages?: string[];
|
|
125
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export var IdentifierStateEnum;
|
|
2
|
+
(function (IdentifierStateEnum) {
|
|
3
|
+
IdentifierStateEnum["ACTIVE"] = "ACTIVE";
|
|
4
|
+
IdentifierStateEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
5
|
+
})(IdentifierStateEnum || (IdentifierStateEnum = {}));
|
|
6
|
+
export var IdentifierTypeEnum;
|
|
7
|
+
(function (IdentifierTypeEnum) {
|
|
8
|
+
IdentifierTypeEnum["KEY"] = "KEY";
|
|
9
|
+
IdentifierTypeEnum["DID"] = "DID";
|
|
10
|
+
IdentifierTypeEnum["CERTIFICATE"] = "CERTIFICATE";
|
|
11
|
+
})(IdentifierTypeEnum || (IdentifierTypeEnum = {}));
|
|
12
|
+
export var CertificateStateEnum;
|
|
13
|
+
(function (CertificateStateEnum) {
|
|
14
|
+
CertificateStateEnum["NOT_YET_ACTIVE"] = "NOT_YET_ACTIVE";
|
|
15
|
+
CertificateStateEnum["ACTIVE"] = "ACTIVE";
|
|
16
|
+
CertificateStateEnum["REVOKED"] = "REVOKED";
|
|
17
|
+
CertificateStateEnum["EXPIRED"] = "EXPIRED";
|
|
18
|
+
})(CertificateStateEnum || (CertificateStateEnum = {}));
|
|
19
|
+
export var SortableIdentifierColumnEnum;
|
|
20
|
+
(function (SortableIdentifierColumnEnum) {
|
|
21
|
+
SortableIdentifierColumnEnum["NAME"] = "NAME";
|
|
22
|
+
SortableIdentifierColumnEnum["CREATED_DATE"] = "CREATED_DATE";
|
|
23
|
+
SortableIdentifierColumnEnum["TYPE"] = "TYPE";
|
|
24
|
+
SortableIdentifierColumnEnum["STATE"] = "STATE";
|
|
25
|
+
})(SortableIdentifierColumnEnum || (SortableIdentifierColumnEnum = {}));
|
|
26
|
+
export var ExactIdentifierFilterColumnEnum;
|
|
27
|
+
(function (ExactIdentifierFilterColumnEnum) {
|
|
28
|
+
ExactIdentifierFilterColumnEnum["NAME"] = "NAME";
|
|
29
|
+
})(ExactIdentifierFilterColumnEnum || (ExactIdentifierFilterColumnEnum = {}));
|
package/dist/src/key.d.ts
CHANGED