@procivis/react-native-one-core 1.26730.0 → 1.33398.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 +66 -17
- package/android/build.gradle +19 -7
- package/android/src/main/java/ch/procivis/one/core/Deserialize.kt +5 -1
- package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +10 -3
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +158 -73
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +7 -1
- package/android/src/main/java/ch/procivis/one/core/Util.kt +42 -10
- package/core-sdk.json +6 -6
- package/dist/index.d.ts +3 -8
- package/dist/index.js +22 -22
- package/dist/src/cache.d.ts +12 -0
- package/dist/src/cache.js +14 -0
- package/dist/src/config.d.ts +29 -4
- package/dist/src/config.js +19 -0
- package/dist/src/core.d.ts +18 -6
- package/dist/src/core.js +1 -0
- package/dist/src/credential.d.ts +14 -1
- package/dist/src/credential.js +5 -0
- package/dist/src/did.d.ts +9 -5
- package/dist/src/error.d.ts +10 -17
- package/dist/src/error.js +5 -14
- package/dist/src/history.d.ts +0 -1
- package/dist/src/history.js +0 -1
- package/dist/src/key.d.ts +3 -0
- package/dist/src/proof.d.ts +13 -1
- package/dist/src/proof.js +5 -0
- package/dist/src/proofSchema.d.ts +2 -0
- package/dist/src/trust.d.ts +85 -19
- package/dist/src/trust.js +28 -7
- package/ios/Deserialize.swift +162 -21
- package/ios/ProcivisOneCoreModule.m +46 -4
- package/ios/ProcivisOneCoreModule.swift +179 -82
- package/ios/Serialize.swift +72 -15
- package/ios/Util.swift +20 -24
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NativeModules } from "react-native";
|
|
2
|
-
import { OneError
|
|
2
|
+
import { OneError } from "./src/error";
|
|
3
3
|
export * from "./src/core";
|
|
4
4
|
export * from "./src/error";
|
|
5
5
|
const ONE = NativeModules.ProcivisOneCoreModule;
|
|
@@ -7,21 +7,13 @@ const ONE = NativeModules.ProcivisOneCoreModule;
|
|
|
7
7
|
const originalGetConfig = ONE.getConfig;
|
|
8
8
|
ONE.getConfig = () => originalGetConfig().then((config) => objectMap(config, (entities) => objectMap(entities, (json) => JSON.parse(json))));
|
|
9
9
|
/**
|
|
10
|
-
* Initialize ONE Core
|
|
10
|
+
* Initialize ONE Core
|
|
11
11
|
* @note Beware that only one instance can be initialized at a time, repeated calls will fail
|
|
12
|
+
* @param config one-core configuration
|
|
12
13
|
* @returns ONE Core instance
|
|
13
14
|
*/
|
|
14
|
-
export async function
|
|
15
|
-
await wrapFn(ONE.
|
|
16
|
-
return wrapObj(ONE);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Initialize ONE Core for Verifier
|
|
20
|
-
* @note Beware that only one instance can be initialized at a time, repeated calls will fail
|
|
21
|
-
* @returns ONE Core instance
|
|
22
|
-
*/
|
|
23
|
-
export async function initializeVerifierCore() {
|
|
24
|
-
await wrapFn(ONE.initializeVerifier, "initializeVerifierCore")();
|
|
15
|
+
export async function initializeCore(config = {}) {
|
|
16
|
+
await wrapFn(ONE.initialize, "initializeCore")(JSON.stringify(config));
|
|
25
17
|
return wrapObj(ONE);
|
|
26
18
|
}
|
|
27
19
|
// UTILS
|
|
@@ -29,24 +21,32 @@ export async function initializeVerifierCore() {
|
|
|
29
21
|
const objectMap = (obj, fn) => Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, fn(v)]));
|
|
30
22
|
// Function call arguments/Error transformation
|
|
31
23
|
// for devs: Beware to not declare function parameters as optional, otherwise automatic conversion to null will not be performed
|
|
32
|
-
function wrapFn(fn,
|
|
24
|
+
function wrapFn(fn, operation) {
|
|
33
25
|
return (...args) => {
|
|
34
|
-
const errHandler = (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
const errHandler = (e) => {
|
|
27
|
+
if (e instanceof Error && "code" in e) {
|
|
28
|
+
const userInfo = "userInfo" in e && typeof e.userInfo === "object"
|
|
29
|
+
? e.userInfo
|
|
30
|
+
: undefined;
|
|
31
|
+
const cause = userInfo && "cause" in userInfo && typeof userInfo.cause === "string"
|
|
32
|
+
? userInfo.cause
|
|
33
|
+
: undefined;
|
|
38
34
|
throw new OneError({
|
|
39
|
-
|
|
35
|
+
operation,
|
|
36
|
+
code: e.code,
|
|
37
|
+
message: e.message,
|
|
40
38
|
cause,
|
|
41
|
-
|
|
39
|
+
originalError: e,
|
|
42
40
|
});
|
|
41
|
+
// iOS additional fields: "nativeStackIOS"
|
|
42
|
+
// android additional fields: "nativeStackAndroid"
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
throw
|
|
45
|
+
throw e;
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
// set name on the err handler to display the original function name in callstack
|
|
49
|
-
Object.defineProperty(errHandler, "name", { value:
|
|
49
|
+
Object.defineProperty(errHandler, "name", { value: operation });
|
|
50
50
|
// convert undefined parameters to null for proper parameter matching in native code
|
|
51
51
|
return fn(...args.map((x) => (x === undefined ? null : x))).catch(errHandler);
|
|
52
52
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum CacheType {
|
|
2
|
+
DID_DOCUMENT = "DID_DOCUMENT",
|
|
3
|
+
JSON_LD_CONTEXT = "JSON_LD_CONTEXT",
|
|
4
|
+
STATUS_LIST_CREDENTIAL = "STATUS_LIST_CREDENTIAL",
|
|
5
|
+
VCT_METADATA = "VCT_METADATA",
|
|
6
|
+
JSON_SCHEMA = "JSON_SCHEMA",
|
|
7
|
+
TRUST_LIST = "TRUST_LIST"
|
|
8
|
+
}
|
|
9
|
+
export declare enum BypassCache {
|
|
10
|
+
DID_DOCUMENT = "DID_DOCUMENT",
|
|
11
|
+
STATUS_LIST_CREDENTIAL = "STATUS_LIST_CREDENTIAL"
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var CacheType;
|
|
2
|
+
(function (CacheType) {
|
|
3
|
+
CacheType["DID_DOCUMENT"] = "DID_DOCUMENT";
|
|
4
|
+
CacheType["JSON_LD_CONTEXT"] = "JSON_LD_CONTEXT";
|
|
5
|
+
CacheType["STATUS_LIST_CREDENTIAL"] = "STATUS_LIST_CREDENTIAL";
|
|
6
|
+
CacheType["VCT_METADATA"] = "VCT_METADATA";
|
|
7
|
+
CacheType["JSON_SCHEMA"] = "JSON_SCHEMA";
|
|
8
|
+
CacheType["TRUST_LIST"] = "TRUST_LIST";
|
|
9
|
+
})(CacheType || (CacheType = {}));
|
|
10
|
+
export var BypassCache;
|
|
11
|
+
(function (BypassCache) {
|
|
12
|
+
BypassCache["DID_DOCUMENT"] = "DID_DOCUMENT";
|
|
13
|
+
BypassCache["STATUS_LIST_CREDENTIAL"] = "STATUS_LIST_CREDENTIAL";
|
|
14
|
+
})(BypassCache || (BypassCache = {}));
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
|
+
export declare enum KeyAlgorithmFeatureEnum {
|
|
2
|
+
GENERATE_CSR = "GENERATE_CSR"
|
|
3
|
+
}
|
|
4
|
+
export interface KeyAlgorithmCapabilities {
|
|
5
|
+
features: KeyAlgorithmFeatureEnum[];
|
|
6
|
+
}
|
|
1
7
|
export declare enum KeyStorageSecurityEnum {
|
|
2
8
|
HARDWARE = "HARDWARE",
|
|
3
9
|
SOFTWARE = "SOFTWARE"
|
|
4
10
|
}
|
|
11
|
+
export declare enum KeyStorageFeatureEnum {
|
|
12
|
+
EXPORTABLE = "EXPORTABLE"
|
|
13
|
+
}
|
|
5
14
|
export interface KeyStorageCapabilities {
|
|
6
15
|
algorithms: string[];
|
|
16
|
+
features: KeyStorageFeatureEnum[];
|
|
7
17
|
security: KeyStorageSecurityEnum[];
|
|
8
18
|
}
|
|
19
|
+
export declare enum DidOperationEnum {
|
|
20
|
+
RESOLVE = "RESOLVE",
|
|
21
|
+
CREATE = "CREATE",
|
|
22
|
+
DEACTIVATE = "DEACTIVATE"
|
|
23
|
+
}
|
|
9
24
|
export interface DidCapabilities {
|
|
10
|
-
operations:
|
|
25
|
+
operations: DidOperationEnum[];
|
|
26
|
+
keyAlgorithms: string[];
|
|
11
27
|
}
|
|
12
28
|
export declare enum FormatFeatureEnum {
|
|
13
29
|
SelectiveDisclosure = "SELECTIVE_DISCLOSURE",
|
|
@@ -27,13 +43,21 @@ export interface FormatCapabilities {
|
|
|
27
43
|
revocationMethods: string[];
|
|
28
44
|
signingKeyAlgorithms: string[];
|
|
29
45
|
verificationKeyAlgorithms: string[];
|
|
46
|
+
verificationKeyStorages: string[];
|
|
30
47
|
datatypes: Array<DataTypeEnum | string>;
|
|
31
48
|
allowedSchemaIds: string[];
|
|
32
49
|
forbiddenClaimNames: string[];
|
|
33
50
|
}
|
|
51
|
+
export declare enum RevocationOperationEnum {
|
|
52
|
+
REVOKE = "REVOKE",
|
|
53
|
+
SUSPEND = "SUSPEND"
|
|
54
|
+
}
|
|
55
|
+
export interface RevocationCapabilities {
|
|
56
|
+
operations: RevocationOperationEnum[];
|
|
57
|
+
}
|
|
34
58
|
export interface ConfigEntity<Capabilities> {
|
|
35
59
|
disabled?: boolean;
|
|
36
|
-
capabilities
|
|
60
|
+
capabilities: Capabilities;
|
|
37
61
|
display: string;
|
|
38
62
|
order: number;
|
|
39
63
|
}
|
|
@@ -90,11 +114,12 @@ export interface Config {
|
|
|
90
114
|
format: ConfigEntities<FormatCapabilities>;
|
|
91
115
|
exchange: ConfigEntities;
|
|
92
116
|
transport: ConfigEntities;
|
|
93
|
-
revocation: ConfigEntities
|
|
117
|
+
revocation: ConfigEntities<RevocationCapabilities>;
|
|
94
118
|
did: ConfigEntities<DidCapabilities>;
|
|
95
119
|
datatype: ConfigEntities<undefined, DataTypeParams>;
|
|
96
|
-
keyAlgorithm: ConfigEntities
|
|
120
|
+
keyAlgorithm: ConfigEntities<KeyAlgorithmCapabilities>;
|
|
97
121
|
keyStorage: ConfigEntities<KeyStorageCapabilities>;
|
|
122
|
+
trustManagement: ConfigEntities;
|
|
98
123
|
cacheEntities: ConfigEntities;
|
|
99
124
|
}
|
|
100
125
|
export {};
|
package/dist/src/config.js
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
export var KeyAlgorithmFeatureEnum;
|
|
2
|
+
(function (KeyAlgorithmFeatureEnum) {
|
|
3
|
+
KeyAlgorithmFeatureEnum["GENERATE_CSR"] = "GENERATE_CSR";
|
|
4
|
+
})(KeyAlgorithmFeatureEnum || (KeyAlgorithmFeatureEnum = {}));
|
|
1
5
|
export var KeyStorageSecurityEnum;
|
|
2
6
|
(function (KeyStorageSecurityEnum) {
|
|
3
7
|
KeyStorageSecurityEnum["HARDWARE"] = "HARDWARE";
|
|
4
8
|
KeyStorageSecurityEnum["SOFTWARE"] = "SOFTWARE";
|
|
5
9
|
})(KeyStorageSecurityEnum || (KeyStorageSecurityEnum = {}));
|
|
10
|
+
export var KeyStorageFeatureEnum;
|
|
11
|
+
(function (KeyStorageFeatureEnum) {
|
|
12
|
+
KeyStorageFeatureEnum["EXPORTABLE"] = "EXPORTABLE";
|
|
13
|
+
})(KeyStorageFeatureEnum || (KeyStorageFeatureEnum = {}));
|
|
14
|
+
export var DidOperationEnum;
|
|
15
|
+
(function (DidOperationEnum) {
|
|
16
|
+
DidOperationEnum["RESOLVE"] = "RESOLVE";
|
|
17
|
+
DidOperationEnum["CREATE"] = "CREATE";
|
|
18
|
+
DidOperationEnum["DEACTIVATE"] = "DEACTIVATE";
|
|
19
|
+
})(DidOperationEnum || (DidOperationEnum = {}));
|
|
6
20
|
export var FormatFeatureEnum;
|
|
7
21
|
(function (FormatFeatureEnum) {
|
|
8
22
|
FormatFeatureEnum["SelectiveDisclosure"] = "SELECTIVE_DISCLOSURE";
|
|
@@ -14,6 +28,11 @@ export var FormatSelectiveDisclosureEnum;
|
|
|
14
28
|
FormatSelectiveDisclosureEnum["AnyLevel"] = "ANY_LEVEL";
|
|
15
29
|
FormatSelectiveDisclosureEnum["SecondLevel"] = "SECOND_LEVEL";
|
|
16
30
|
})(FormatSelectiveDisclosureEnum || (FormatSelectiveDisclosureEnum = {}));
|
|
31
|
+
export var RevocationOperationEnum;
|
|
32
|
+
(function (RevocationOperationEnum) {
|
|
33
|
+
RevocationOperationEnum["REVOKE"] = "REVOKE";
|
|
34
|
+
RevocationOperationEnum["SUSPEND"] = "SUSPEND";
|
|
35
|
+
})(RevocationOperationEnum || (RevocationOperationEnum = {}));
|
|
17
36
|
export var DataTypeEnum;
|
|
18
37
|
(function (DataTypeEnum) {
|
|
19
38
|
DataTypeEnum["String"] = "STRING";
|
package/dist/src/core.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ 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 { KeyRequest } from "./key";
|
|
7
|
+
import { KeyCheckCertificateRequestBindingDto, KeyListItem, KeyRequest } from "./key";
|
|
8
8
|
import { ItemList } from "./list";
|
|
9
|
-
import { CreateProofRequest, InvitationResultProofRequest, PresentationDefinition, PresentationDefinitionRequestedCredential, PresentationSubmitCredentialRequest, ProofDetail, ProofListItem, ProofListQuery, ProposeProofResponse, ShareProofResponse } from "./proof";
|
|
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 { CreateTrustAnchorRequest, TrustAnchor, TrustAnchorListItem, TrustAnchorListQuery } from "./trust";
|
|
11
|
+
import { CreateRemoteTrustEntityRequest, CreateTrustAnchorRequest, CreateTrustEntityRequest, TrustAnchor, TrustAnchorListItem, TrustAnchorListQuery, TrustEntity, TrustEntityListItem, TrustEntityListQuery, UpdateRemoteTrustEntityRequest } from "./trust";
|
|
12
|
+
import { BypassCache, CacheType } from "./cache";
|
|
12
13
|
export * from "./backup";
|
|
14
|
+
export * from "./cache";
|
|
13
15
|
export * from "./config";
|
|
14
16
|
export * from "./credential";
|
|
15
17
|
export * from "./credentialSchema";
|
|
@@ -41,13 +43,14 @@ export interface ONECore {
|
|
|
41
43
|
createDid(didRequest: DidRequest): Promise<string>;
|
|
42
44
|
getDids(query: DidListQuery): Promise<ItemList<DidListItem>>;
|
|
43
45
|
handleInvitation(url: string, organisationId: string, transport: string[] | undefined): Promise<InvitationResult>;
|
|
44
|
-
holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId: string, keyId: string | undefined): Promise<void>;
|
|
46
|
+
holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId: string, keyId: string | undefined, txCode: string | undefined): Promise<void>;
|
|
45
47
|
holderRejectCredential(interactionId: InvitationResultCredentialIssuance["interactionId"]): Promise<void>;
|
|
46
48
|
getPresentationDefinition(proofId: ProofDetail["id"]): Promise<PresentationDefinition>;
|
|
47
49
|
holderRejectProof(interactionId: InvitationResultProofRequest["interactionId"]): Promise<void>;
|
|
48
50
|
holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest>, didId: string, keyId: string | undefined): Promise<void>;
|
|
49
51
|
getCredentials(query: CredentialListQuery): Promise<ItemList<CredentialListItem>>;
|
|
50
52
|
runTask(task: string): Promise<string>;
|
|
53
|
+
checkCertificate(keyId: KeyListItem["id"], certificate: KeyCheckCertificateRequestBindingDto): Promise<void>;
|
|
51
54
|
deleteProofClaims(proofId: ProofDetail["id"]): Promise<void>;
|
|
52
55
|
getCredential(credentialId: CredentialListItem["id"]): Promise<CredentialDetail>;
|
|
53
56
|
deleteCredential(credentialId: CredentialListItem["id"]): Promise<void>;
|
|
@@ -56,7 +59,7 @@ export interface ONECore {
|
|
|
56
59
|
getCredentialSchemas(query: CredentialSchemaListQuery): Promise<ItemList<CredentialSchema>>;
|
|
57
60
|
deleteCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<void>;
|
|
58
61
|
createProof(request: CreateProofRequest): Promise<ProofDetail["id"]>;
|
|
59
|
-
shareProof(proofId: ProofDetail["id"]): Promise<ShareProofResponse>;
|
|
62
|
+
shareProof(proofId: ProofDetail["id"], request: ShareProofRequest): Promise<ShareProofResponse>;
|
|
60
63
|
shareProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ShareProofSchemaResponse>;
|
|
61
64
|
shareCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<ShareCredentialSchemaResponse>;
|
|
62
65
|
getProof(proofId: ProofDetail["id"]): Promise<ProofDetail>;
|
|
@@ -68,14 +71,23 @@ export interface ONECore {
|
|
|
68
71
|
getProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ProofSchema>;
|
|
69
72
|
deleteProofSchema(proofSchemaId: ProofSchema["id"]): Promise<void>;
|
|
70
73
|
importProofSchema(request: ImportProofSchemaRequest): Promise<ProofSchema["id"]>;
|
|
71
|
-
checkRevocation(credentialIds: Array<CredentialListItem["id"]
|
|
74
|
+
checkRevocation(credentialIds: Array<CredentialListItem["id"]>, bypassCache: BypassCache[] | undefined): Promise<CredentialRevocationCheckResponse[]>;
|
|
72
75
|
createTrustAnchor(request: CreateTrustAnchorRequest): Promise<TrustAnchor["id"]>;
|
|
76
|
+
deleteTrustAnchor(trustAnchorId: TrustAnchor["id"]): Promise<void>;
|
|
73
77
|
getTrustAnchor(trustAnchorId: TrustAnchor["id"]): Promise<TrustAnchor>;
|
|
74
78
|
getTrustAnchors(query: TrustAnchorListQuery): Promise<ItemList<TrustAnchorListItem>>;
|
|
79
|
+
createTrustEntity(request: CreateTrustEntityRequest): Promise<TrustEntity["id"]>;
|
|
80
|
+
getTrustEntity(trustEntityId: TrustEntity["id"]): Promise<TrustEntity>;
|
|
81
|
+
getTrustEntities(query: TrustEntityListQuery): Promise<ItemList<TrustEntityListItem>>;
|
|
82
|
+
getTrustEntityByDid(didId: DidListItem["id"]): Promise<TrustEntity>;
|
|
83
|
+
createRemoteTrustEntity(request: CreateRemoteTrustEntityRequest): Promise<TrustEntity["id"]>;
|
|
84
|
+
getRemoteTrustEntity(didId: DidListItem["id"]): Promise<TrustEntity>;
|
|
85
|
+
updateRemoteTrustEntity(request: UpdateRemoteTrustEntityRequest): Promise<void>;
|
|
75
86
|
getHistory(query: HistoryListQuery): Promise<ItemList<HistoryListItem>>;
|
|
76
87
|
getHistoryEntry(historyId: HistoryListItem["id"]): Promise<HistoryListItem>;
|
|
77
88
|
createBackup(password: string, outputPath: string): Promise<BackupCreate>;
|
|
78
89
|
backupInfo(): Promise<UnexportableEntities>;
|
|
90
|
+
deleteCache(types: CacheType[] | undefined): Promise<void>;
|
|
79
91
|
/**
|
|
80
92
|
* Start import procedure
|
|
81
93
|
*
|
package/dist/src/core.js
CHANGED
package/dist/src/credential.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DataTypeEnum } from "./config";
|
|
2
2
|
import { CredentialSchema } from "./credentialSchema";
|
|
3
3
|
import { ListQuery, SortDirection } from "./list";
|
|
4
|
+
import { DidListItem } from "./did";
|
|
4
5
|
export declare enum CredentialStateEnum {
|
|
5
6
|
CREATED = "CREATED",
|
|
6
7
|
PENDING = "PENDING",
|
|
@@ -52,11 +53,13 @@ export interface CredentialListItem {
|
|
|
52
53
|
role: CredentialRoleEnum;
|
|
53
54
|
suspendEndDate?: string;
|
|
54
55
|
}
|
|
55
|
-
export interface CredentialDetail extends CredentialListItem {
|
|
56
|
+
export interface CredentialDetail extends Omit<CredentialListItem, "issuerDid"> {
|
|
56
57
|
claims: Claim[];
|
|
57
58
|
redirectUri?: string;
|
|
58
59
|
lvvcIssuanceDate?: string;
|
|
59
60
|
mdocMsoValidity?: MdocMsoValidity;
|
|
61
|
+
issuerDid?: DidListItem;
|
|
62
|
+
holderDid?: DidListItem;
|
|
60
63
|
}
|
|
61
64
|
export interface MdocMsoValidity {
|
|
62
65
|
expiration: string;
|
|
@@ -112,4 +115,14 @@ export interface CredentialRevocationCheckResponse {
|
|
|
112
115
|
export interface InvitationResultCredentialIssuance {
|
|
113
116
|
interactionId: string;
|
|
114
117
|
credentialIds: Array<CredentialListItem["id"]>;
|
|
118
|
+
txCode?: OpenID4VCITxCode;
|
|
119
|
+
}
|
|
120
|
+
export interface OpenID4VCITxCode {
|
|
121
|
+
inputMode?: OpenID4VCITxCodeInputMode;
|
|
122
|
+
length?: number;
|
|
123
|
+
description?: string;
|
|
124
|
+
}
|
|
125
|
+
export declare enum OpenID4VCITxCodeInputMode {
|
|
126
|
+
NUMERIC = "NUMERIC",
|
|
127
|
+
TEXT = "TEXT"
|
|
115
128
|
}
|
package/dist/src/credential.js
CHANGED
|
@@ -37,3 +37,8 @@ export var CredentialListSearchType;
|
|
|
37
37
|
CredentialListSearchType["CLAIM_VALUE"] = "CLAIM_VALUE";
|
|
38
38
|
CredentialListSearchType["CREDENTIAL_SCHEMA_NAME"] = "CREDENTIAL_SCHEMA_NAME";
|
|
39
39
|
})(CredentialListSearchType || (CredentialListSearchType = {}));
|
|
40
|
+
export var OpenID4VCITxCodeInputMode;
|
|
41
|
+
(function (OpenID4VCITxCodeInputMode) {
|
|
42
|
+
OpenID4VCITxCodeInputMode["NUMERIC"] = "NUMERIC";
|
|
43
|
+
OpenID4VCITxCodeInputMode["TEXT"] = "TEXT";
|
|
44
|
+
})(OpenID4VCITxCodeInputMode || (OpenID4VCITxCodeInputMode = {}));
|
package/dist/src/did.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KeyListItem } from "./key";
|
|
1
2
|
import { ListQuery, SortDirection } from "./list";
|
|
2
3
|
export declare enum DidTypeEnum {
|
|
3
4
|
LOCAL = "LOCAL",
|
|
@@ -11,11 +12,11 @@ export interface DidRequest {
|
|
|
11
12
|
params: Record<string, string>;
|
|
12
13
|
}
|
|
13
14
|
export interface DidRequestKeys {
|
|
14
|
-
authentication:
|
|
15
|
-
assertionMethod:
|
|
16
|
-
keyAgreement:
|
|
17
|
-
capabilityInvocation:
|
|
18
|
-
capabilityDelegation:
|
|
15
|
+
authentication: Array<KeyListItem["id"]>;
|
|
16
|
+
assertionMethod: Array<KeyListItem["id"]>;
|
|
17
|
+
keyAgreement: Array<KeyListItem["id"]>;
|
|
18
|
+
capabilityInvocation: Array<KeyListItem["id"]>;
|
|
19
|
+
capabilityDelegation: Array<KeyListItem["id"]>;
|
|
19
20
|
}
|
|
20
21
|
export interface DidListItem {
|
|
21
22
|
id: string;
|
|
@@ -56,4 +57,7 @@ export interface DidListQuery extends ListQuery {
|
|
|
56
57
|
exact?: ExactDidFilterColumnEnum[];
|
|
57
58
|
keyAlgorithms?: string[];
|
|
58
59
|
keyRoles?: KeyRoleEnum[];
|
|
60
|
+
keyStorages?: string[];
|
|
61
|
+
keyIds?: Array<KeyListItem["id"]>;
|
|
62
|
+
didMethods?: string[];
|
|
59
63
|
}
|
package/dist/src/error.d.ts
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
export declare enum OneErrorCode {
|
|
2
|
-
AlreadyExists = "AlreadyExists",
|
|
3
|
-
NotFound = "NotFound",
|
|
4
|
-
NotSupported = "NotSupported",
|
|
5
|
-
ValidationError = "ValidationError",
|
|
6
|
-
ConfigValidationError = "ConfigValidationError",
|
|
7
|
-
Uninitialized = "Uninitialized",
|
|
8
|
-
DbErr = "DbErr",
|
|
9
|
-
IOError = "IOError",
|
|
10
|
-
Unknown = "Unknown"
|
|
11
|
-
}
|
|
12
1
|
/**
|
|
13
|
-
* Specific errors being
|
|
2
|
+
* Specific errors being thrown from the {@link ONECore} functions
|
|
14
3
|
*/
|
|
15
4
|
export declare class OneError extends Error {
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
5
|
+
readonly operation: string;
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly cause?: string;
|
|
8
|
+
readonly originalError: Error;
|
|
18
9
|
constructor(params: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
message
|
|
10
|
+
operation: string;
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
cause?: string;
|
|
14
|
+
originalError: Error;
|
|
22
15
|
});
|
|
23
16
|
}
|
package/dist/src/error.js
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
export var OneErrorCode;
|
|
2
|
-
(function (OneErrorCode) {
|
|
3
|
-
// BindingError
|
|
4
|
-
OneErrorCode["AlreadyExists"] = "AlreadyExists";
|
|
5
|
-
OneErrorCode["NotFound"] = "NotFound";
|
|
6
|
-
OneErrorCode["NotSupported"] = "NotSupported";
|
|
7
|
-
OneErrorCode["ValidationError"] = "ValidationError";
|
|
8
|
-
OneErrorCode["ConfigValidationError"] = "ConfigValidationError";
|
|
9
|
-
OneErrorCode["Uninitialized"] = "Uninitialized";
|
|
10
|
-
OneErrorCode["DbErr"] = "DbErr";
|
|
11
|
-
OneErrorCode["IOError"] = "IOError";
|
|
12
|
-
OneErrorCode["Unknown"] = "Unknown";
|
|
13
|
-
})(OneErrorCode || (OneErrorCode = {}));
|
|
14
1
|
/**
|
|
15
|
-
* Specific errors being
|
|
2
|
+
* Specific errors being thrown from the {@link ONECore} functions
|
|
16
3
|
*/
|
|
17
4
|
export class OneError extends Error {
|
|
5
|
+
operation;
|
|
18
6
|
code;
|
|
19
7
|
cause;
|
|
8
|
+
originalError;
|
|
20
9
|
constructor(params) {
|
|
21
10
|
super(params.message);
|
|
11
|
+
this.operation = params.operation;
|
|
22
12
|
this.code = params.code;
|
|
23
13
|
this.cause = params.cause;
|
|
14
|
+
this.originalError = params.originalError;
|
|
24
15
|
}
|
|
25
16
|
}
|
package/dist/src/history.d.ts
CHANGED
package/dist/src/history.js
CHANGED
|
@@ -6,7 +6,6 @@ export var HistoryActionEnum;
|
|
|
6
6
|
HistoryActionEnum["DELETED"] = "DELETED";
|
|
7
7
|
HistoryActionEnum["ISSUED"] = "ISSUED";
|
|
8
8
|
HistoryActionEnum["OFFERED"] = "OFFERED";
|
|
9
|
-
HistoryActionEnum["REACTIVATED"] = "REACTIVATED";
|
|
10
9
|
HistoryActionEnum["REJECTED"] = "REJECTED";
|
|
11
10
|
HistoryActionEnum["REQUESTED"] = "REQUESTED";
|
|
12
11
|
HistoryActionEnum["REVOKED"] = "REVOKED";
|
package/dist/src/key.d.ts
CHANGED
package/dist/src/proof.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CredentialDetail, CredentialListItem } from "./credential";
|
|
|
2
2
|
import { CredentialSchema } from "./credentialSchema";
|
|
3
3
|
import { ListQuery, SortDirection } from "./list";
|
|
4
4
|
import { ProofInputClaimSchema, ProofSchemaListItem } from "./proofSchema";
|
|
5
|
+
import { DidListItem } from "./did";
|
|
5
6
|
export declare enum ProofStateEnum {
|
|
6
7
|
CREATED = "CREATED",
|
|
7
8
|
PENDING = "PENDING",
|
|
@@ -27,7 +28,8 @@ export interface ProofDetail {
|
|
|
27
28
|
proofInputs: ProofInput[];
|
|
28
29
|
state: ProofStateEnum;
|
|
29
30
|
proofSchema?: ProofSchemaListItem;
|
|
30
|
-
verifierDid?:
|
|
31
|
+
verifierDid?: DidListItem;
|
|
32
|
+
holderDid?: DidListItem;
|
|
31
33
|
exchange: string;
|
|
32
34
|
redirectUri?: string;
|
|
33
35
|
retainUntilDate?: string;
|
|
@@ -135,3 +137,13 @@ export interface InvitationResultProofRequest {
|
|
|
135
137
|
interactionId: string;
|
|
136
138
|
proofId: ProofDetail["id"];
|
|
137
139
|
}
|
|
140
|
+
export interface ShareProofRequest {
|
|
141
|
+
params?: ShareProofRequestParams;
|
|
142
|
+
}
|
|
143
|
+
export interface ShareProofRequestParams {
|
|
144
|
+
clientIdSchema?: ShareProofRequestClientIdSchemaType;
|
|
145
|
+
}
|
|
146
|
+
export declare enum ShareProofRequestClientIdSchemaType {
|
|
147
|
+
REDIRECT_URI = "REDIRECT_URI",
|
|
148
|
+
VERIFIER_ATTESTATION = "VERIFIER_ATTESTATION"
|
|
149
|
+
}
|
package/dist/src/proof.js
CHANGED
|
@@ -28,3 +28,8 @@ export var ExactProofFilterColumnEnum;
|
|
|
28
28
|
(function (ExactProofFilterColumnEnum) {
|
|
29
29
|
ExactProofFilterColumnEnum["NAME"] = "NAME";
|
|
30
30
|
})(ExactProofFilterColumnEnum || (ExactProofFilterColumnEnum = {}));
|
|
31
|
+
export var ShareProofRequestClientIdSchemaType;
|
|
32
|
+
(function (ShareProofRequestClientIdSchemaType) {
|
|
33
|
+
ShareProofRequestClientIdSchemaType["REDIRECT_URI"] = "REDIRECT_URI";
|
|
34
|
+
ShareProofRequestClientIdSchemaType["VERIFIER_ATTESTATION"] = "VERIFIER_ATTESTATION";
|
|
35
|
+
})(ShareProofRequestClientIdSchemaType || (ShareProofRequestClientIdSchemaType = {}));
|
|
@@ -2,6 +2,7 @@ import { CredentialSchema, CredentialSchemaLayoutProperties, CredentialSchemaTyp
|
|
|
2
2
|
import { ListQuery, SortDirection } from "./list";
|
|
3
3
|
export interface ProofInputClaimSchema {
|
|
4
4
|
id: string;
|
|
5
|
+
requested: boolean;
|
|
5
6
|
required: boolean;
|
|
6
7
|
key: string;
|
|
7
8
|
dataType: string;
|
|
@@ -69,6 +70,7 @@ export interface ImportProofSchemaInputSchema {
|
|
|
69
70
|
}
|
|
70
71
|
export interface ImportProofSchemaClaimSchema {
|
|
71
72
|
id: string;
|
|
73
|
+
requested: boolean;
|
|
72
74
|
required: boolean;
|
|
73
75
|
key: string;
|
|
74
76
|
dataType: string;
|
package/dist/src/trust.d.ts
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import { ListQuery, SortDirection } from "./list";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
CLIENT = "CLIENT"
|
|
5
|
-
}
|
|
6
|
-
export interface CreateTrustAnchorRequest {
|
|
2
|
+
import { DidListItem } from "./did";
|
|
3
|
+
export type CreateTrustAnchorRequest = {
|
|
7
4
|
name: string;
|
|
8
5
|
type: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
} & ({
|
|
7
|
+
isPublisher: true;
|
|
8
|
+
publisherReference?: never;
|
|
9
|
+
} | {
|
|
10
|
+
isPublisher?: false;
|
|
11
|
+
publisherReference: string;
|
|
12
|
+
});
|
|
14
13
|
export interface TrustAnchor {
|
|
15
14
|
id: string;
|
|
16
15
|
createdDate: string;
|
|
17
16
|
lastModified: string;
|
|
18
17
|
name: string;
|
|
19
18
|
type: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
priority?: number;
|
|
23
|
-
organisationId: string;
|
|
19
|
+
isPublisher: boolean;
|
|
20
|
+
publisherReference: string;
|
|
24
21
|
}
|
|
25
22
|
export interface TrustAnchorListItem extends TrustAnchor {
|
|
26
23
|
entities: number;
|
|
@@ -28,19 +25,88 @@ export interface TrustAnchorListItem extends TrustAnchor {
|
|
|
28
25
|
export declare enum SortableTrustAnchorColumnEnum {
|
|
29
26
|
NAME = "NAME",
|
|
30
27
|
CREATED_DATE = "CREATED_DATE",
|
|
31
|
-
TYPE = "TYPE"
|
|
32
|
-
ROLE = "ROLE",
|
|
33
|
-
PRIORITY = "PRIORITY"
|
|
28
|
+
TYPE = "TYPE"
|
|
34
29
|
}
|
|
35
30
|
export declare enum ExactTrustAnchorFilterColumnEnum {
|
|
36
31
|
NAME = "NAME",
|
|
37
32
|
TYPE = "TYPE"
|
|
38
33
|
}
|
|
39
|
-
export interface TrustAnchorListQuery extends ListQuery {
|
|
34
|
+
export interface TrustAnchorListQuery extends Omit<ListQuery, "organisationId"> {
|
|
40
35
|
sort?: SortableTrustAnchorColumnEnum;
|
|
41
36
|
sortDirection?: SortDirection;
|
|
42
37
|
name?: string;
|
|
43
38
|
exact?: ExactTrustAnchorFilterColumnEnum[];
|
|
44
39
|
type?: string;
|
|
45
|
-
|
|
40
|
+
isPublisher?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface TrustEntityListItem {
|
|
43
|
+
id: string;
|
|
44
|
+
createdDate: string;
|
|
45
|
+
lastModified: string;
|
|
46
|
+
name: string;
|
|
47
|
+
logo?: string;
|
|
48
|
+
website?: string;
|
|
49
|
+
termsUrl?: string;
|
|
50
|
+
privacyUrl?: string;
|
|
51
|
+
role: TrustEntityRoleEnum;
|
|
52
|
+
state: TrustEntityStateEnum;
|
|
53
|
+
did: DidListItem;
|
|
54
|
+
trustAnchor: TrustAnchor;
|
|
55
|
+
}
|
|
56
|
+
export interface TrustEntity extends TrustEntityListItem {
|
|
57
|
+
organisationId: string;
|
|
58
|
+
}
|
|
59
|
+
export declare enum TrustEntityRoleEnum {
|
|
60
|
+
ISSUER = "ISSUER",
|
|
61
|
+
VERIFIER = "VERIFIER",
|
|
62
|
+
BOTH = "BOTH"
|
|
63
|
+
}
|
|
64
|
+
export declare enum TrustEntityStateEnum {
|
|
65
|
+
ACTIVE = "ACTIVE",
|
|
66
|
+
REMOVED = "REMOVED",
|
|
67
|
+
WITHDRAWN = "WITHDRAWN",
|
|
68
|
+
REMOVED_AND_WITHDRAWN = "REMOVED_AND_WITHDRAWN"
|
|
69
|
+
}
|
|
70
|
+
export interface CreateTrustEntityRequest {
|
|
71
|
+
name: string;
|
|
72
|
+
logo?: string;
|
|
73
|
+
website?: string;
|
|
74
|
+
termsUrl?: string;
|
|
75
|
+
privacyUrl?: string;
|
|
76
|
+
role: TrustEntityRoleEnum;
|
|
77
|
+
trustAnchorId: TrustAnchor["id"];
|
|
78
|
+
didId: DidListItem["id"];
|
|
79
|
+
}
|
|
80
|
+
export interface TrustEntityListQuery {
|
|
81
|
+
sort?: SortableTrustEntityColumnEnum;
|
|
82
|
+
sortDirection?: SortDirection;
|
|
83
|
+
name?: string;
|
|
84
|
+
exact?: ExactTrustEntityFilterColumnEnum[];
|
|
85
|
+
type?: string;
|
|
86
|
+
isPublisher?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export declare enum SortableTrustEntityColumnEnum {
|
|
89
|
+
NAME = "NAME",
|
|
90
|
+
ROLE = "ROLE"
|
|
91
|
+
}
|
|
92
|
+
export declare enum ExactTrustEntityFilterColumnEnum {
|
|
93
|
+
NAME = "NAME"
|
|
94
|
+
}
|
|
95
|
+
export interface CreateRemoteTrustEntityRequest extends Omit<CreateTrustEntityRequest, "trustAnchorId"> {
|
|
96
|
+
trustAnchorId?: TrustAnchor["id"];
|
|
97
|
+
}
|
|
98
|
+
export interface UpdateRemoteTrustEntityRequest {
|
|
99
|
+
didId: DidListItem["id"];
|
|
100
|
+
action?: TrustEntityUpdateActionEnum;
|
|
101
|
+
name?: string;
|
|
102
|
+
logo?: string | null;
|
|
103
|
+
website?: string | null;
|
|
104
|
+
termsUrl?: string | null;
|
|
105
|
+
privacyUrl?: string | null;
|
|
106
|
+
role?: TrustEntityRoleEnum;
|
|
107
|
+
}
|
|
108
|
+
export declare enum TrustEntityUpdateActionEnum {
|
|
109
|
+
ACTIVATE = "ACTIVATE",
|
|
110
|
+
WITHDRAW = "WITHDRAW",
|
|
111
|
+
REMOVE = "REMOVE"
|
|
46
112
|
}
|