@procivis/react-native-one-core 1.26730.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/LICENSE +201 -0
- package/README.md +202 -0
- package/android/build.gradle +96 -0
- package/android/proguard-rules.pro +4 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/ch/procivis/one/core/Deserialize.kt +118 -0
- package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +94 -0
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +444 -0
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCorePackage.kt +19 -0
- package/android/src/main/java/ch/procivis/one/core/Serialize.kt +115 -0
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +121 -0
- package/android/src/main/java/ch/procivis/one/core/Util.kt +23 -0
- package/bin/postinstall +12 -0
- package/core-sdk.json +16 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +59 -0
- package/dist/src/backup.d.ts +22 -0
- package/dist/src/backup.js +1 -0
- package/dist/src/config.d.ts +100 -0
- package/dist/src/config.js +25 -0
- package/dist/src/core.d.ts +109 -0
- package/dist/src/core.js +11 -0
- package/dist/src/credential.d.ts +115 -0
- package/dist/src/credential.js +39 -0
- package/dist/src/credentialSchema.d.ts +130 -0
- package/dist/src/credentialSchema.js +37 -0
- package/dist/src/did.d.ts +59 -0
- package/dist/src/did.js +27 -0
- package/dist/src/error.d.ts +23 -0
- package/dist/src/error.js +25 -0
- package/dist/src/history.d.ts +66 -0
- package/dist/src/history.js +42 -0
- package/dist/src/key.d.ts +17 -0
- package/dist/src/key.js +1 -0
- package/dist/src/list.d.ts +14 -0
- package/dist/src/list.js +5 -0
- package/dist/src/proof.d.ts +137 -0
- package/dist/src/proof.js +30 -0
- package/dist/src/proofSchema.d.ts +106 -0
- package/dist/src/proofSchema.js +9 -0
- package/dist/src/trust.d.ts +46 -0
- package/dist/src/trust.js +18 -0
- package/ios/Deserialize.swift +655 -0
- package/ios/ProcivisOneCoreModule.m +216 -0
- package/ios/ProcivisOneCoreModule.swift +600 -0
- package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +318 -0
- package/ios/Serialize.swift +607 -0
- package/ios/Util.swift +47 -0
- package/ios/react-native-one-core-Bridging-Header.h +1 -0
- package/package.json +40 -0
- package/react-native-one-core.podspec +46 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export var CredentialStateEnum;
|
|
2
|
+
(function (CredentialStateEnum) {
|
|
3
|
+
CredentialStateEnum["CREATED"] = "CREATED";
|
|
4
|
+
CredentialStateEnum["PENDING"] = "PENDING";
|
|
5
|
+
CredentialStateEnum["OFFERED"] = "OFFERED";
|
|
6
|
+
CredentialStateEnum["ACCEPTED"] = "ACCEPTED";
|
|
7
|
+
CredentialStateEnum["REJECTED"] = "REJECTED";
|
|
8
|
+
CredentialStateEnum["REVOKED"] = "REVOKED";
|
|
9
|
+
CredentialStateEnum["SUSPENDED"] = "SUSPENDED";
|
|
10
|
+
CredentialStateEnum["ERROR"] = "ERROR";
|
|
11
|
+
})(CredentialStateEnum || (CredentialStateEnum = {}));
|
|
12
|
+
export var CredentialRoleEnum;
|
|
13
|
+
(function (CredentialRoleEnum) {
|
|
14
|
+
CredentialRoleEnum["HOLDER"] = "HOLDER";
|
|
15
|
+
CredentialRoleEnum["ISSUER"] = "ISSUER";
|
|
16
|
+
CredentialRoleEnum["VERIFIER"] = "VERIFIER";
|
|
17
|
+
})(CredentialRoleEnum || (CredentialRoleEnum = {}));
|
|
18
|
+
export var CredentialListQueryExactColumnEnum;
|
|
19
|
+
(function (CredentialListQueryExactColumnEnum) {
|
|
20
|
+
CredentialListQueryExactColumnEnum["NAME"] = "NAME";
|
|
21
|
+
})(CredentialListQueryExactColumnEnum || (CredentialListQueryExactColumnEnum = {}));
|
|
22
|
+
export var SortableCredentialColumnEnum;
|
|
23
|
+
(function (SortableCredentialColumnEnum) {
|
|
24
|
+
SortableCredentialColumnEnum["CREATED_DATE"] = "CREATED_DATE";
|
|
25
|
+
SortableCredentialColumnEnum["SCHEMA_NAME"] = "SCHEMA_NAME";
|
|
26
|
+
SortableCredentialColumnEnum["ISSUER_DID"] = "ISSUER_DID";
|
|
27
|
+
SortableCredentialColumnEnum["STATE"] = "STATE";
|
|
28
|
+
})(SortableCredentialColumnEnum || (SortableCredentialColumnEnum = {}));
|
|
29
|
+
export var CredentialListIncludeEntityType;
|
|
30
|
+
(function (CredentialListIncludeEntityType) {
|
|
31
|
+
CredentialListIncludeEntityType["LAYOUT_PROPERTIES"] = "LAYOUT_PROPERTIES";
|
|
32
|
+
CredentialListIncludeEntityType["CREDENTIAL"] = "CREDENTIAL";
|
|
33
|
+
})(CredentialListIncludeEntityType || (CredentialListIncludeEntityType = {}));
|
|
34
|
+
export var CredentialListSearchType;
|
|
35
|
+
(function (CredentialListSearchType) {
|
|
36
|
+
CredentialListSearchType["CLAIM_NAME"] = "CLAIM_NAME";
|
|
37
|
+
CredentialListSearchType["CLAIM_VALUE"] = "CLAIM_VALUE";
|
|
38
|
+
CredentialListSearchType["CREDENTIAL_SCHEMA_NAME"] = "CREDENTIAL_SCHEMA_NAME";
|
|
39
|
+
})(CredentialListSearchType || (CredentialListSearchType = {}));
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ListQuery, SortDirection } from "./list";
|
|
2
|
+
export interface ImportCredentialSchemaRequest {
|
|
3
|
+
organisationId: string;
|
|
4
|
+
schema: ImportCredentialSchemaRequestSchema;
|
|
5
|
+
}
|
|
6
|
+
export interface ImportCredentialSchemaRequestSchema {
|
|
7
|
+
id: string;
|
|
8
|
+
createdDate: string;
|
|
9
|
+
lastModified: string;
|
|
10
|
+
name: string;
|
|
11
|
+
format: string;
|
|
12
|
+
revocationMethod: string;
|
|
13
|
+
organisationId: string;
|
|
14
|
+
importedSourceUrl: string;
|
|
15
|
+
claims: ImportCredentialSchemaClaimSchema[];
|
|
16
|
+
walletStorageType?: WalletStorageType;
|
|
17
|
+
schemaId: string;
|
|
18
|
+
schemaType: CredentialSchemaType;
|
|
19
|
+
layoutType?: LayoutType;
|
|
20
|
+
layoutProperties?: ImportCredentialSchemaLayoutProperties;
|
|
21
|
+
allowSuspension?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ImportCredentialSchemaClaimSchema {
|
|
24
|
+
id: string;
|
|
25
|
+
createdDate: string;
|
|
26
|
+
lastModified: string;
|
|
27
|
+
required: boolean;
|
|
28
|
+
key: string;
|
|
29
|
+
datatype: string;
|
|
30
|
+
claims?: ImportCredentialSchemaClaimSchema[];
|
|
31
|
+
array?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ImportCredentialSchemaLayoutProperties {
|
|
34
|
+
background?: CredentialSchemaBackgroundProperties;
|
|
35
|
+
logo?: CredentialSchemaLogoProperties;
|
|
36
|
+
primaryAttribute?: string;
|
|
37
|
+
secondaryAttribute?: string;
|
|
38
|
+
pictureAttribute?: string;
|
|
39
|
+
code?: CredentialSchemaCodeProperties;
|
|
40
|
+
}
|
|
41
|
+
export interface ShareCredentialSchemaResponse {
|
|
42
|
+
url: string;
|
|
43
|
+
}
|
|
44
|
+
export declare enum CredentialSchemaListIncludeEntityType {
|
|
45
|
+
LAYOUT_PROPERTIES = "LAYOUT_PROPERTIES"
|
|
46
|
+
}
|
|
47
|
+
export declare enum SortableCredentialSchemaColumnEnum {
|
|
48
|
+
NAME = "NAME",
|
|
49
|
+
FORMAT = "FORMAT",
|
|
50
|
+
CREATED_DATE = "CREATED_DATE"
|
|
51
|
+
}
|
|
52
|
+
export declare enum ExactCredentialSchemaFilterColumnEnum {
|
|
53
|
+
NAME = "NAME"
|
|
54
|
+
}
|
|
55
|
+
export interface CredentialSchemaListQuery extends ListQuery {
|
|
56
|
+
sort?: SortableCredentialSchemaColumnEnum;
|
|
57
|
+
sortDirection?: SortDirection;
|
|
58
|
+
name?: string;
|
|
59
|
+
ids?: string[];
|
|
60
|
+
exact?: ExactCredentialSchemaFilterColumnEnum[];
|
|
61
|
+
include?: CredentialSchemaListIncludeEntityType[];
|
|
62
|
+
}
|
|
63
|
+
export declare enum WalletStorageType {
|
|
64
|
+
HARDWARE = "HARDWARE",
|
|
65
|
+
SOFTWARE = "SOFTWARE"
|
|
66
|
+
}
|
|
67
|
+
export declare enum KnownCredentialSchemaType {
|
|
68
|
+
PROCIVIS_ONE_SCHEMA2024 = "PROCIVIS_ONE_SCHEMA2024",
|
|
69
|
+
FALLBACK_SCHEMA2024 = "FALLBACK_SCHEMA2024",
|
|
70
|
+
MDOC = "MDOC"
|
|
71
|
+
}
|
|
72
|
+
export type CredentialSchemaType = KnownCredentialSchemaType | string;
|
|
73
|
+
export declare enum LayoutType {
|
|
74
|
+
CARD = "CARD",
|
|
75
|
+
DOCUMENT = "DOCUMENT",
|
|
76
|
+
SINGLE_ATTRIBUTE = "SINGLE_ATTRIBUTE"
|
|
77
|
+
}
|
|
78
|
+
export interface CredentialSchema {
|
|
79
|
+
id: string;
|
|
80
|
+
createdDate: string;
|
|
81
|
+
lastModified: string;
|
|
82
|
+
name: string;
|
|
83
|
+
format: string;
|
|
84
|
+
revocationMethod: string;
|
|
85
|
+
walletStorageType?: WalletStorageType;
|
|
86
|
+
schemaId: string;
|
|
87
|
+
importedSourceUrl: string;
|
|
88
|
+
schemaType: CredentialSchemaType;
|
|
89
|
+
layoutType?: LayoutType;
|
|
90
|
+
layoutProperties?: CredentialSchemaLayoutProperties;
|
|
91
|
+
}
|
|
92
|
+
export interface CredentialSchemaDetail extends CredentialSchema {
|
|
93
|
+
claims: ClaimSchema[];
|
|
94
|
+
}
|
|
95
|
+
export interface ClaimSchema {
|
|
96
|
+
id: string;
|
|
97
|
+
createdDate: string;
|
|
98
|
+
lastModified: string;
|
|
99
|
+
key: string;
|
|
100
|
+
datatype: string;
|
|
101
|
+
required: boolean;
|
|
102
|
+
array: boolean;
|
|
103
|
+
claims: ClaimSchema[];
|
|
104
|
+
}
|
|
105
|
+
export interface CredentialSchemaLayoutProperties {
|
|
106
|
+
background?: CredentialSchemaBackgroundProperties;
|
|
107
|
+
logo?: CredentialSchemaLogoProperties;
|
|
108
|
+
primaryAttribute?: string;
|
|
109
|
+
secondaryAttribute?: string;
|
|
110
|
+
pictureAttribute?: string;
|
|
111
|
+
code?: CredentialSchemaCodeProperties;
|
|
112
|
+
}
|
|
113
|
+
export interface CredentialSchemaBackgroundProperties {
|
|
114
|
+
color?: string;
|
|
115
|
+
image?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface CredentialSchemaLogoProperties {
|
|
118
|
+
fontColor?: string;
|
|
119
|
+
backgroundColor?: string;
|
|
120
|
+
image?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface CredentialSchemaCodeProperties {
|
|
123
|
+
attribute: string;
|
|
124
|
+
type: CredentialSchemaCodeType;
|
|
125
|
+
}
|
|
126
|
+
export declare enum CredentialSchemaCodeType {
|
|
127
|
+
BARCODE = "BARCODE",
|
|
128
|
+
MRZ = "MRZ",
|
|
129
|
+
QR_CODE = "QR_CODE"
|
|
130
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export var CredentialSchemaListIncludeEntityType;
|
|
2
|
+
(function (CredentialSchemaListIncludeEntityType) {
|
|
3
|
+
CredentialSchemaListIncludeEntityType["LAYOUT_PROPERTIES"] = "LAYOUT_PROPERTIES";
|
|
4
|
+
})(CredentialSchemaListIncludeEntityType || (CredentialSchemaListIncludeEntityType = {}));
|
|
5
|
+
export var SortableCredentialSchemaColumnEnum;
|
|
6
|
+
(function (SortableCredentialSchemaColumnEnum) {
|
|
7
|
+
SortableCredentialSchemaColumnEnum["NAME"] = "NAME";
|
|
8
|
+
SortableCredentialSchemaColumnEnum["FORMAT"] = "FORMAT";
|
|
9
|
+
SortableCredentialSchemaColumnEnum["CREATED_DATE"] = "CREATED_DATE";
|
|
10
|
+
})(SortableCredentialSchemaColumnEnum || (SortableCredentialSchemaColumnEnum = {}));
|
|
11
|
+
export var ExactCredentialSchemaFilterColumnEnum;
|
|
12
|
+
(function (ExactCredentialSchemaFilterColumnEnum) {
|
|
13
|
+
ExactCredentialSchemaFilterColumnEnum["NAME"] = "NAME";
|
|
14
|
+
})(ExactCredentialSchemaFilterColumnEnum || (ExactCredentialSchemaFilterColumnEnum = {}));
|
|
15
|
+
export var WalletStorageType;
|
|
16
|
+
(function (WalletStorageType) {
|
|
17
|
+
WalletStorageType["HARDWARE"] = "HARDWARE";
|
|
18
|
+
WalletStorageType["SOFTWARE"] = "SOFTWARE";
|
|
19
|
+
})(WalletStorageType || (WalletStorageType = {}));
|
|
20
|
+
export var KnownCredentialSchemaType;
|
|
21
|
+
(function (KnownCredentialSchemaType) {
|
|
22
|
+
KnownCredentialSchemaType["PROCIVIS_ONE_SCHEMA2024"] = "PROCIVIS_ONE_SCHEMA2024";
|
|
23
|
+
KnownCredentialSchemaType["FALLBACK_SCHEMA2024"] = "FALLBACK_SCHEMA2024";
|
|
24
|
+
KnownCredentialSchemaType["MDOC"] = "MDOC";
|
|
25
|
+
})(KnownCredentialSchemaType || (KnownCredentialSchemaType = {}));
|
|
26
|
+
export var LayoutType;
|
|
27
|
+
(function (LayoutType) {
|
|
28
|
+
LayoutType["CARD"] = "CARD";
|
|
29
|
+
LayoutType["DOCUMENT"] = "DOCUMENT";
|
|
30
|
+
LayoutType["SINGLE_ATTRIBUTE"] = "SINGLE_ATTRIBUTE";
|
|
31
|
+
})(LayoutType || (LayoutType = {}));
|
|
32
|
+
export var CredentialSchemaCodeType;
|
|
33
|
+
(function (CredentialSchemaCodeType) {
|
|
34
|
+
CredentialSchemaCodeType["BARCODE"] = "BARCODE";
|
|
35
|
+
CredentialSchemaCodeType["MRZ"] = "MRZ";
|
|
36
|
+
CredentialSchemaCodeType["QR_CODE"] = "QR_CODE";
|
|
37
|
+
})(CredentialSchemaCodeType || (CredentialSchemaCodeType = {}));
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ListQuery, SortDirection } from "./list";
|
|
2
|
+
export declare enum DidTypeEnum {
|
|
3
|
+
LOCAL = "LOCAL",
|
|
4
|
+
REMOTE = "REMOTE"
|
|
5
|
+
}
|
|
6
|
+
export interface DidRequest {
|
|
7
|
+
organisationId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
didMethod: string;
|
|
10
|
+
keys: DidRequestKeys;
|
|
11
|
+
params: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface DidRequestKeys {
|
|
14
|
+
authentication: string[];
|
|
15
|
+
assertionMethod: string[];
|
|
16
|
+
keyAgreement: string[];
|
|
17
|
+
capabilityInvocation: string[];
|
|
18
|
+
capabilityDelegation: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface DidListItem {
|
|
21
|
+
id: string;
|
|
22
|
+
createdDate: string;
|
|
23
|
+
lastModified: string;
|
|
24
|
+
name: string;
|
|
25
|
+
did: string;
|
|
26
|
+
didType: DidTypeEnum;
|
|
27
|
+
didMethod: string;
|
|
28
|
+
deactivated: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare enum SortableDidColumnEnum {
|
|
31
|
+
NAME = "NAME",
|
|
32
|
+
CREATED_DATE = "CREATED_DATE",
|
|
33
|
+
METHOD = "METHOD",
|
|
34
|
+
TYPE = "TYPE",
|
|
35
|
+
DID = "DID",
|
|
36
|
+
DEACTIVATED = "DEACTIVATED"
|
|
37
|
+
}
|
|
38
|
+
export declare enum ExactDidFilterColumnEnum {
|
|
39
|
+
NAME = "NAME",
|
|
40
|
+
DID = "DID"
|
|
41
|
+
}
|
|
42
|
+
export declare enum KeyRoleEnum {
|
|
43
|
+
AUTHENTICATION = "AUTHENTICATION",
|
|
44
|
+
ASSERTION_METHOD = "ASSERTION_METHOD",
|
|
45
|
+
KEY_AGREEMENT = "KEY_AGREEMENT",
|
|
46
|
+
CAPABILITY_INVOCATION = "CAPABILITY_INVOCATION",
|
|
47
|
+
CAPABILITY_DELEGATION = "CAPABILITY_DELEGATION"
|
|
48
|
+
}
|
|
49
|
+
export interface DidListQuery extends ListQuery {
|
|
50
|
+
sort?: SortableDidColumnEnum;
|
|
51
|
+
sortDirection?: SortDirection;
|
|
52
|
+
name?: string;
|
|
53
|
+
did?: string;
|
|
54
|
+
type?: DidTypeEnum;
|
|
55
|
+
deactivated?: boolean;
|
|
56
|
+
exact?: ExactDidFilterColumnEnum[];
|
|
57
|
+
keyAlgorithms?: string[];
|
|
58
|
+
keyRoles?: KeyRoleEnum[];
|
|
59
|
+
}
|
package/dist/src/did.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export var DidTypeEnum;
|
|
2
|
+
(function (DidTypeEnum) {
|
|
3
|
+
DidTypeEnum["LOCAL"] = "LOCAL";
|
|
4
|
+
DidTypeEnum["REMOTE"] = "REMOTE";
|
|
5
|
+
})(DidTypeEnum || (DidTypeEnum = {}));
|
|
6
|
+
export var SortableDidColumnEnum;
|
|
7
|
+
(function (SortableDidColumnEnum) {
|
|
8
|
+
SortableDidColumnEnum["NAME"] = "NAME";
|
|
9
|
+
SortableDidColumnEnum["CREATED_DATE"] = "CREATED_DATE";
|
|
10
|
+
SortableDidColumnEnum["METHOD"] = "METHOD";
|
|
11
|
+
SortableDidColumnEnum["TYPE"] = "TYPE";
|
|
12
|
+
SortableDidColumnEnum["DID"] = "DID";
|
|
13
|
+
SortableDidColumnEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
14
|
+
})(SortableDidColumnEnum || (SortableDidColumnEnum = {}));
|
|
15
|
+
export var ExactDidFilterColumnEnum;
|
|
16
|
+
(function (ExactDidFilterColumnEnum) {
|
|
17
|
+
ExactDidFilterColumnEnum["NAME"] = "NAME";
|
|
18
|
+
ExactDidFilterColumnEnum["DID"] = "DID";
|
|
19
|
+
})(ExactDidFilterColumnEnum || (ExactDidFilterColumnEnum = {}));
|
|
20
|
+
export var KeyRoleEnum;
|
|
21
|
+
(function (KeyRoleEnum) {
|
|
22
|
+
KeyRoleEnum["AUTHENTICATION"] = "AUTHENTICATION";
|
|
23
|
+
KeyRoleEnum["ASSERTION_METHOD"] = "ASSERTION_METHOD";
|
|
24
|
+
KeyRoleEnum["KEY_AGREEMENT"] = "KEY_AGREEMENT";
|
|
25
|
+
KeyRoleEnum["CAPABILITY_INVOCATION"] = "CAPABILITY_INVOCATION";
|
|
26
|
+
KeyRoleEnum["CAPABILITY_DELEGATION"] = "CAPABILITY_DELEGATION";
|
|
27
|
+
})(KeyRoleEnum || (KeyRoleEnum = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Specific errors being throw from the {@link ONECore} functions
|
|
14
|
+
*/
|
|
15
|
+
export declare class OneError extends Error {
|
|
16
|
+
readonly code: OneErrorCode;
|
|
17
|
+
readonly cause: unknown;
|
|
18
|
+
constructor(params: {
|
|
19
|
+
code: OneErrorCode;
|
|
20
|
+
cause: unknown;
|
|
21
|
+
message?: string;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* Specific errors being throw from the {@link ONECore} functions
|
|
16
|
+
*/
|
|
17
|
+
export class OneError extends Error {
|
|
18
|
+
code;
|
|
19
|
+
cause;
|
|
20
|
+
constructor(params) {
|
|
21
|
+
super(params.message);
|
|
22
|
+
this.code = params.code;
|
|
23
|
+
this.cause = params.cause;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { UnexportableEntities } from "./backup";
|
|
2
|
+
import { ListQuery } from "./list";
|
|
3
|
+
export declare enum HistoryActionEnum {
|
|
4
|
+
ACCEPTED = "ACCEPTED",
|
|
5
|
+
CREATED = "CREATED",
|
|
6
|
+
DEACTIVATED = "DEACTIVATED",
|
|
7
|
+
DELETED = "DELETED",
|
|
8
|
+
ISSUED = "ISSUED",
|
|
9
|
+
OFFERED = "OFFERED",
|
|
10
|
+
REACTIVATED = "REACTIVATED",
|
|
11
|
+
REJECTED = "REJECTED",
|
|
12
|
+
REQUESTED = "REQUESTED",
|
|
13
|
+
REVOKED = "REVOKED",
|
|
14
|
+
PENDING = "PENDING",
|
|
15
|
+
SUSPENDED = "SUSPENDED",
|
|
16
|
+
RESTORED = "RESTORED",
|
|
17
|
+
ERRORED = "ERRORED",
|
|
18
|
+
SHARED = "SHARED",
|
|
19
|
+
IMPORTED = "IMPORTED",
|
|
20
|
+
CLAIMS_REMOVED = "CLAIMS_REMOVED"
|
|
21
|
+
}
|
|
22
|
+
export declare enum HistoryEntityTypeEnum {
|
|
23
|
+
KEY = "KEY",
|
|
24
|
+
DID = "DID",
|
|
25
|
+
CREDENTIAL = "CREDENTIAL",
|
|
26
|
+
CREDENTIAL_SCHEMA = "CREDENTIAL_SCHEMA",
|
|
27
|
+
PROOF = "PROOF",
|
|
28
|
+
PROOF_SCHEMA = "PROOF_SCHEMA",
|
|
29
|
+
ORGANISATION = "ORGANISATION",
|
|
30
|
+
BACKUP = "BACKUP"
|
|
31
|
+
}
|
|
32
|
+
export declare enum HistorySearchTypeEnum {
|
|
33
|
+
CLAIM_NAME = "CLAIM_NAME",
|
|
34
|
+
CLAIM_VALUE = "CLAIM_VALUE",
|
|
35
|
+
CREDENTIAL_SCHEMA_NAME = "CREDENTIAL_SCHEMA_NAME",
|
|
36
|
+
ISSUER_DID = "ISSUER_DID",
|
|
37
|
+
ISSUER_NAME = "ISSUER_NAME",
|
|
38
|
+
VERIFIER_DID = "VERIFIER_DID",
|
|
39
|
+
VERIFIER_NAME = "VERIFIER_NAME",
|
|
40
|
+
PROOF_SCHEMA_NAME = "PROOF_SCHEMA_NAME"
|
|
41
|
+
}
|
|
42
|
+
export interface HistoryListQuery extends ListQuery {
|
|
43
|
+
entityId?: string;
|
|
44
|
+
action?: HistoryActionEnum;
|
|
45
|
+
entityTypes?: HistoryEntityTypeEnum[];
|
|
46
|
+
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
47
|
+
createdDateFrom?: string;
|
|
48
|
+
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
49
|
+
createdDateTo?: string;
|
|
50
|
+
didId?: string;
|
|
51
|
+
credentialId?: string;
|
|
52
|
+
credentialSchemaId?: string;
|
|
53
|
+
proofSchemaId?: string;
|
|
54
|
+
searchText?: string;
|
|
55
|
+
searchType?: HistorySearchTypeEnum;
|
|
56
|
+
}
|
|
57
|
+
export type HistoryMetadata = UnexportableEntities;
|
|
58
|
+
export interface HistoryListItem {
|
|
59
|
+
id: string;
|
|
60
|
+
createdDate: string;
|
|
61
|
+
action: HistoryActionEnum;
|
|
62
|
+
entityId?: string;
|
|
63
|
+
entityType: HistoryEntityTypeEnum;
|
|
64
|
+
organisationId: string;
|
|
65
|
+
metadata?: HistoryMetadata;
|
|
66
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export var HistoryActionEnum;
|
|
2
|
+
(function (HistoryActionEnum) {
|
|
3
|
+
HistoryActionEnum["ACCEPTED"] = "ACCEPTED";
|
|
4
|
+
HistoryActionEnum["CREATED"] = "CREATED";
|
|
5
|
+
HistoryActionEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
6
|
+
HistoryActionEnum["DELETED"] = "DELETED";
|
|
7
|
+
HistoryActionEnum["ISSUED"] = "ISSUED";
|
|
8
|
+
HistoryActionEnum["OFFERED"] = "OFFERED";
|
|
9
|
+
HistoryActionEnum["REACTIVATED"] = "REACTIVATED";
|
|
10
|
+
HistoryActionEnum["REJECTED"] = "REJECTED";
|
|
11
|
+
HistoryActionEnum["REQUESTED"] = "REQUESTED";
|
|
12
|
+
HistoryActionEnum["REVOKED"] = "REVOKED";
|
|
13
|
+
HistoryActionEnum["PENDING"] = "PENDING";
|
|
14
|
+
HistoryActionEnum["SUSPENDED"] = "SUSPENDED";
|
|
15
|
+
HistoryActionEnum["RESTORED"] = "RESTORED";
|
|
16
|
+
HistoryActionEnum["ERRORED"] = "ERRORED";
|
|
17
|
+
HistoryActionEnum["SHARED"] = "SHARED";
|
|
18
|
+
HistoryActionEnum["IMPORTED"] = "IMPORTED";
|
|
19
|
+
HistoryActionEnum["CLAIMS_REMOVED"] = "CLAIMS_REMOVED";
|
|
20
|
+
})(HistoryActionEnum || (HistoryActionEnum = {}));
|
|
21
|
+
export var HistoryEntityTypeEnum;
|
|
22
|
+
(function (HistoryEntityTypeEnum) {
|
|
23
|
+
HistoryEntityTypeEnum["KEY"] = "KEY";
|
|
24
|
+
HistoryEntityTypeEnum["DID"] = "DID";
|
|
25
|
+
HistoryEntityTypeEnum["CREDENTIAL"] = "CREDENTIAL";
|
|
26
|
+
HistoryEntityTypeEnum["CREDENTIAL_SCHEMA"] = "CREDENTIAL_SCHEMA";
|
|
27
|
+
HistoryEntityTypeEnum["PROOF"] = "PROOF";
|
|
28
|
+
HistoryEntityTypeEnum["PROOF_SCHEMA"] = "PROOF_SCHEMA";
|
|
29
|
+
HistoryEntityTypeEnum["ORGANISATION"] = "ORGANISATION";
|
|
30
|
+
HistoryEntityTypeEnum["BACKUP"] = "BACKUP";
|
|
31
|
+
})(HistoryEntityTypeEnum || (HistoryEntityTypeEnum = {}));
|
|
32
|
+
export var HistorySearchTypeEnum;
|
|
33
|
+
(function (HistorySearchTypeEnum) {
|
|
34
|
+
HistorySearchTypeEnum["CLAIM_NAME"] = "CLAIM_NAME";
|
|
35
|
+
HistorySearchTypeEnum["CLAIM_VALUE"] = "CLAIM_VALUE";
|
|
36
|
+
HistorySearchTypeEnum["CREDENTIAL_SCHEMA_NAME"] = "CREDENTIAL_SCHEMA_NAME";
|
|
37
|
+
HistorySearchTypeEnum["ISSUER_DID"] = "ISSUER_DID";
|
|
38
|
+
HistorySearchTypeEnum["ISSUER_NAME"] = "ISSUER_NAME";
|
|
39
|
+
HistorySearchTypeEnum["VERIFIER_DID"] = "VERIFIER_DID";
|
|
40
|
+
HistorySearchTypeEnum["VERIFIER_NAME"] = "VERIFIER_NAME";
|
|
41
|
+
HistorySearchTypeEnum["PROOF_SCHEMA_NAME"] = "PROOF_SCHEMA_NAME";
|
|
42
|
+
})(HistorySearchTypeEnum || (HistorySearchTypeEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface KeyRequest {
|
|
2
|
+
organisationId: string;
|
|
3
|
+
keyType: string;
|
|
4
|
+
keyParams: Record<string, string>;
|
|
5
|
+
name: string;
|
|
6
|
+
storageType: string;
|
|
7
|
+
storageParams: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface KeyListItem {
|
|
10
|
+
id: string;
|
|
11
|
+
createdDate: string;
|
|
12
|
+
lastModified: string;
|
|
13
|
+
name: string;
|
|
14
|
+
publicKey: number[];
|
|
15
|
+
keyType: string;
|
|
16
|
+
storageType: string;
|
|
17
|
+
}
|
package/dist/src/key.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum SortDirection {
|
|
2
|
+
ASCENDING = "ASCENDING",
|
|
3
|
+
DESCENDING = "DESCENDING"
|
|
4
|
+
}
|
|
5
|
+
export interface ListQuery {
|
|
6
|
+
page: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
organisationId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ItemList<Item> {
|
|
11
|
+
totalItems: number;
|
|
12
|
+
totalPages: number;
|
|
13
|
+
values: Item[];
|
|
14
|
+
}
|
package/dist/src/list.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { CredentialDetail, CredentialListItem } from "./credential";
|
|
2
|
+
import { CredentialSchema } from "./credentialSchema";
|
|
3
|
+
import { ListQuery, SortDirection } from "./list";
|
|
4
|
+
import { ProofInputClaimSchema, ProofSchemaListItem } from "./proofSchema";
|
|
5
|
+
export declare enum ProofStateEnum {
|
|
6
|
+
CREATED = "CREATED",
|
|
7
|
+
PENDING = "PENDING",
|
|
8
|
+
REQUESTED = "REQUESTED",
|
|
9
|
+
ACCEPTED = "ACCEPTED",
|
|
10
|
+
REJECTED = "REJECTED",
|
|
11
|
+
ERROR = "ERROR"
|
|
12
|
+
}
|
|
13
|
+
export interface ProofInput {
|
|
14
|
+
claims: ProofInputClaim[];
|
|
15
|
+
credential?: CredentialDetail;
|
|
16
|
+
credentialSchema: CredentialSchema;
|
|
17
|
+
validityConstraint?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ProofInputClaim {
|
|
20
|
+
schema: ProofInputClaimSchema;
|
|
21
|
+
value?: string | ProofInputClaim[];
|
|
22
|
+
}
|
|
23
|
+
export interface ProofDetail {
|
|
24
|
+
id: string;
|
|
25
|
+
createdDate: string;
|
|
26
|
+
lastModified: string;
|
|
27
|
+
proofInputs: ProofInput[];
|
|
28
|
+
state: ProofStateEnum;
|
|
29
|
+
proofSchema?: ProofSchemaListItem;
|
|
30
|
+
verifierDid?: string;
|
|
31
|
+
exchange: string;
|
|
32
|
+
redirectUri?: string;
|
|
33
|
+
retainUntilDate?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ProofListItem {
|
|
36
|
+
id: string;
|
|
37
|
+
createdDate: string;
|
|
38
|
+
lastModified: string;
|
|
39
|
+
issuanceDate: string;
|
|
40
|
+
requestedDate?: string;
|
|
41
|
+
completedDate?: string;
|
|
42
|
+
verifierDid?: string;
|
|
43
|
+
exchange: string;
|
|
44
|
+
transport: string;
|
|
45
|
+
state: ProofStateEnum;
|
|
46
|
+
schema?: ProofSchemaListItem;
|
|
47
|
+
retainUntilDate?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CreateProofRequest {
|
|
50
|
+
proofSchemaId: string;
|
|
51
|
+
verifierDidId: string;
|
|
52
|
+
exchange: string;
|
|
53
|
+
redirectUri?: string;
|
|
54
|
+
verifierKey?: string;
|
|
55
|
+
scanToVerify?: ScanToVerifyRequest;
|
|
56
|
+
isoMdlEngagement?: string;
|
|
57
|
+
transport?: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface ScanToVerifyRequest {
|
|
60
|
+
credential: string;
|
|
61
|
+
barcode: string;
|
|
62
|
+
barcodeType: ScanToVerifyBarcodeTypeEnum;
|
|
63
|
+
}
|
|
64
|
+
export declare enum ScanToVerifyBarcodeTypeEnum {
|
|
65
|
+
MRZ = "MRZ",
|
|
66
|
+
PDF417 = "PDF417"
|
|
67
|
+
}
|
|
68
|
+
export interface ShareProofResponse {
|
|
69
|
+
url: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PresentationDefinition {
|
|
72
|
+
requestGroups: PresentationDefinitionRequestGroup[];
|
|
73
|
+
}
|
|
74
|
+
export interface PresentationDefinitionRequestGroup {
|
|
75
|
+
id: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
purpose?: string;
|
|
78
|
+
rule: PresentationDefinitionRule;
|
|
79
|
+
requestedCredentials: PresentationDefinitionRequestedCredential[];
|
|
80
|
+
}
|
|
81
|
+
export interface PresentationDefinitionRule {
|
|
82
|
+
type: PresentationDefinitionRuleTypeEnum;
|
|
83
|
+
min?: number;
|
|
84
|
+
max?: number;
|
|
85
|
+
count?: number;
|
|
86
|
+
}
|
|
87
|
+
export declare enum PresentationDefinitionRuleTypeEnum {
|
|
88
|
+
ALL = "ALL",
|
|
89
|
+
PICK = "PICK"
|
|
90
|
+
}
|
|
91
|
+
export interface PresentationDefinitionRequestedCredential {
|
|
92
|
+
id: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
purpose?: string;
|
|
95
|
+
fields: PresentationDefinitionField[];
|
|
96
|
+
applicableCredentials: Array<CredentialListItem["id"]>;
|
|
97
|
+
inapplicableCredentials: Array<CredentialListItem["id"]>;
|
|
98
|
+
validityCredentialNbf?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface PresentationDefinitionField {
|
|
101
|
+
id: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
purpose?: string;
|
|
104
|
+
required: boolean;
|
|
105
|
+
keyMap: Record<string, string>;
|
|
106
|
+
}
|
|
107
|
+
export interface PresentationSubmitCredentialRequest {
|
|
108
|
+
credentialId: CredentialListItem["id"];
|
|
109
|
+
submitClaims: Array<PresentationDefinitionField["id"]>;
|
|
110
|
+
}
|
|
111
|
+
export declare enum SortableProofColumnEnum {
|
|
112
|
+
SCHEMA_NAME = "SCHEMA_NAME",
|
|
113
|
+
VERIFIER_DID = "VERIFIER_DID",
|
|
114
|
+
CREATED_DATE = "CREATED_DATE",
|
|
115
|
+
STATE = "STATE"
|
|
116
|
+
}
|
|
117
|
+
export declare enum ExactProofFilterColumnEnum {
|
|
118
|
+
NAME = "NAME"
|
|
119
|
+
}
|
|
120
|
+
export interface ProofListQuery extends ListQuery {
|
|
121
|
+
sort?: SortableProofColumnEnum;
|
|
122
|
+
sortDirection?: SortDirection;
|
|
123
|
+
name?: string;
|
|
124
|
+
ids?: string[];
|
|
125
|
+
proofStates?: ProofStateEnum[];
|
|
126
|
+
proofSchemaIds?: string[];
|
|
127
|
+
exact?: ExactProofFilterColumnEnum[];
|
|
128
|
+
}
|
|
129
|
+
export interface ProposeProofResponse {
|
|
130
|
+
proofId: string;
|
|
131
|
+
interactionId: string;
|
|
132
|
+
url: string;
|
|
133
|
+
}
|
|
134
|
+
export interface InvitationResultProofRequest {
|
|
135
|
+
interactionId: string;
|
|
136
|
+
proofId: ProofDetail["id"];
|
|
137
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export var ProofStateEnum;
|
|
2
|
+
(function (ProofStateEnum) {
|
|
3
|
+
ProofStateEnum["CREATED"] = "CREATED";
|
|
4
|
+
ProofStateEnum["PENDING"] = "PENDING";
|
|
5
|
+
ProofStateEnum["REQUESTED"] = "REQUESTED";
|
|
6
|
+
ProofStateEnum["ACCEPTED"] = "ACCEPTED";
|
|
7
|
+
ProofStateEnum["REJECTED"] = "REJECTED";
|
|
8
|
+
ProofStateEnum["ERROR"] = "ERROR";
|
|
9
|
+
})(ProofStateEnum || (ProofStateEnum = {}));
|
|
10
|
+
export var ScanToVerifyBarcodeTypeEnum;
|
|
11
|
+
(function (ScanToVerifyBarcodeTypeEnum) {
|
|
12
|
+
ScanToVerifyBarcodeTypeEnum["MRZ"] = "MRZ";
|
|
13
|
+
ScanToVerifyBarcodeTypeEnum["PDF417"] = "PDF417";
|
|
14
|
+
})(ScanToVerifyBarcodeTypeEnum || (ScanToVerifyBarcodeTypeEnum = {}));
|
|
15
|
+
export var PresentationDefinitionRuleTypeEnum;
|
|
16
|
+
(function (PresentationDefinitionRuleTypeEnum) {
|
|
17
|
+
PresentationDefinitionRuleTypeEnum["ALL"] = "ALL";
|
|
18
|
+
PresentationDefinitionRuleTypeEnum["PICK"] = "PICK";
|
|
19
|
+
})(PresentationDefinitionRuleTypeEnum || (PresentationDefinitionRuleTypeEnum = {}));
|
|
20
|
+
export var SortableProofColumnEnum;
|
|
21
|
+
(function (SortableProofColumnEnum) {
|
|
22
|
+
SortableProofColumnEnum["SCHEMA_NAME"] = "SCHEMA_NAME";
|
|
23
|
+
SortableProofColumnEnum["VERIFIER_DID"] = "VERIFIER_DID";
|
|
24
|
+
SortableProofColumnEnum["CREATED_DATE"] = "CREATED_DATE";
|
|
25
|
+
SortableProofColumnEnum["STATE"] = "STATE";
|
|
26
|
+
})(SortableProofColumnEnum || (SortableProofColumnEnum = {}));
|
|
27
|
+
export var ExactProofFilterColumnEnum;
|
|
28
|
+
(function (ExactProofFilterColumnEnum) {
|
|
29
|
+
ExactProofFilterColumnEnum["NAME"] = "NAME";
|
|
30
|
+
})(ExactProofFilterColumnEnum || (ExactProofFilterColumnEnum = {}));
|