@idos-network/credentials 1.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 idOS Network
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # idOS Credentials JavaScript SDK
2
+
3
+ This library is helper for VerifiableCredentials in idOS.
4
+
5
+ ## Generate a Ed25519VerificationKey2020
6
+
7
+ ```javascript
8
+ import { Ed25519VerificationKey2020 } from "@digitalbazaar/ed25519-verification-key-2020";
9
+
10
+ const issuer = "https://my-issuer.id/";
11
+
12
+ const key = await Ed25519VerificationKey2020.generate({
13
+ id: `${issuer}/keys/1`,
14
+ controller: `${issuer}/issuers/1`,
15
+ });
16
+
17
+ /* Ed25519VerificationKey2020 {
18
+ id: "https://my-issuer.id/keys/1",
19
+ controller: "https://my-issuer.id/issuers/1",
20
+ revoked: undefined,
21
+ type: 'Ed25519VerificationKey2020',
22
+ publicKeyMultibase: 'z6MkqozXNX5bbcs17yarKiwiZN1obZ3AR6evoubA2AyRnFnq',
23
+ privateKeyMultibase: 'zrv1yczBBXSupDwutYPAoi1fyZLi1cZTPdXHaJXLiKX68E4u1jRy7Npc4dp65hAbKuwTws79MoiAJFDs4XKscz7Sjh3'
24
+ } */
25
+ ```
26
+
27
+ ## Issue a credentials
28
+
29
+ ```javascript
30
+ import { buildCredential } from "@idos-network/credentials/builder";
31
+
32
+ const id = "z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3";
33
+
34
+ const data = await buildCredential(
35
+ {
36
+ id: `${issuer}/credentials/${id}`,
37
+ level: "human",
38
+ issued: new Date("2022-01-01"),
39
+ approvedAt: new Date("2022-01-01"),
40
+ expirationDate: new Date("2030-01-01"),
41
+ },
42
+ {
43
+ id: `uuid:${id}`,
44
+ applicantId: "1234567890",
45
+ inquiryId: "1234567890",
46
+ firstName: "John",
47
+ familyName: "Lennon",
48
+ governmentIdType: "SSN",
49
+ governmentId: "123-45-6789",
50
+ dateOfBirth: new Date("1980-01-01"),
51
+ placeOfBirth: "New York, NY",
52
+ idDocumentCountry: "US",
53
+ idDocumentNumber: "123456789",
54
+ idDocumentType: "PASSPORT",
55
+ idDocumentDateOfIssue: new Date("2022-01-01"),
56
+ idDocumentDateOfExpiry: new Date("2025-01-01"),
57
+ idDocumentFrontFile: Buffer.from("Front of ID document"),
58
+ idDocumentBackFile: Buffer.from("Back of ID document"),
59
+ selfieFile: Buffer.from("Selfie"),
60
+ residentialAddress: {
61
+ street: "Main St",
62
+ houseNumber: "123",
63
+ additionalAddressInfo: "Apt 1",
64
+ city: "New York",
65
+ postalCode: "10001",
66
+ country: "US",
67
+ },
68
+ residentialAddressProofCategory: "Utility Bill",
69
+ residentialAddressProofDateOfIssue: new Date("2022-01-01"),
70
+ residentialAddressProofFile: Buffer.from("Proof of address"),
71
+ },
72
+ key,
73
+ true, // Validation against schema
74
+ );
75
+
76
+ console.log(data);
77
+ ```
78
+
79
+ ## Verify a credentials
80
+
81
+ ```javascript
82
+ import { verifyCredential } from "@idos-network/credentials";
83
+
84
+ // We have a list of issuers we trust to
85
+ const allowedIssuers = [
86
+ {
87
+ issuer: "https://invalid-issuer.id/",
88
+ publicKeyMultibase: "z6MkfjxfHddp5Pf1GGUSJQ3m6PEycX2DFTVFruUMZsHPXoJx",
89
+ },
90
+ // Ed25519VerificationKey2020 instance, or issuer information are available
91
+ // You don't need a privateKeyMultibase for verification!
92
+ key,
93
+ ];
94
+
95
+ const [verified, resultsByIssuer] = await verifyCredential(credential, allowedIssuers);
96
+ console.log("Verified: ", verified);
97
+ console.log("Results by issuer: ", resultsByIssuer);
98
+ ```
99
+
100
+ ## Derive level
101
+
102
+ ```javascript
103
+ import { deriveLevel } from "@idos-network/credentials/utils";
104
+
105
+ const level = deriveLevel({
106
+ id: "uuid:1234",
107
+ firstName: "John",
108
+ familyName: "Doe",
109
+ idDocumentType: "PASSPORT",
110
+ dateOfBirth: new Date("1990-01-01"),
111
+ idDocumentCountry: "US",
112
+ idDocumentNumber: "123456789",
113
+ idDocumentFrontFile: Buffer.from("ID Document Front"),
114
+ });
115
+
116
+ // level = "basic"
117
+ ```
118
+
119
+ ## Filtering and matching levels
120
+
121
+ ```javascript
122
+ import {
123
+ pickHighestMatchingLevel,
124
+ matchLevelOrHigher,
125
+ highestMatchingCredential,
126
+ } from "@idos-network/credentials/utils";
127
+
128
+ const matched = matchLevelOrHigher("basic", ["liveness"], "basic+liveness");
129
+ // matched = true
130
+
131
+ const matched = matchLevelOrHigher("basic", ["liveness+email"], "basic+liveness");
132
+ // matched = false
133
+
134
+ const matched = matchLevelOrHigher("basic", ["liveness+email"], "plus+liveness");
135
+ // matched = true
136
+
137
+ const pickedLevel = pickHighestMatchingLevel(
138
+ ["basic+liveness", "plus+liveness+email", "plus+liveness+email+phoneNumber"],
139
+ "plus",
140
+ ["liveness", "email"],
141
+ );
142
+ // pickedLevel = plus+liveness+email+phoneNumber
143
+
144
+ const pickedCredential = highestMatchingCredential([...idOSCredentials], "basic", {
145
+ addons: ["email", "liveness"],
146
+ publicNotesConstraint: {
147
+ status: "approved",
148
+ type: "kyc",
149
+ },
150
+ });
151
+ // pickedCredential => for example plus+email+liveness etc...
152
+ // don't forget to verify credentials signature before usage!
153
+ ```
@@ -0,0 +1,271 @@
1
+ <?xml version="1.0"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3
+
4
+ <xs:annotation>
5
+ <xs:documentation>
6
+ Copyright (C) 2023 Trust Fractal GmbH
7
+
8
+ Apache License Version 2.0. See the accompanying LICENSE file.
9
+ </xs:documentation>
10
+ </xs:annotation>
11
+
12
+ <xs:simpleType name="ISO_3166-1_alpha-2" name="ISO_3166-1_alpha-2">
13
+ <xs:annotation>
14
+ <xs:documentation>
15
+ ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard[1] published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest.
16
+
17
+ Taken from https://web.archive.org/web/20230604173816/https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
18
+ </xs:documentation>
19
+ </xs:annotation>
20
+
21
+ <xs:restriction base="xs:string">
22
+ <xs:enumeration value="AD" /> <!-- Andorra -->
23
+ <xs:enumeration value="AE" /> <!-- United Arab Emirates -->
24
+ <xs:enumeration value="AF" /> <!-- Afghanistan -->
25
+ <xs:enumeration value="AG" /> <!-- Antigua and Barbuda -->
26
+ <xs:enumeration value="AI" /> <!-- Anguilla -->
27
+ <xs:enumeration value="AL" /> <!-- Albania -->
28
+ <xs:enumeration value="AM" /> <!-- Armenia -->
29
+ <xs:enumeration value="AO" /> <!-- Angola -->
30
+ <xs:enumeration value="AQ" /> <!-- Antarctica -->
31
+ <xs:enumeration value="AR" /> <!-- Argentina -->
32
+ <xs:enumeration value="AS" /> <!-- American Samoa -->
33
+ <xs:enumeration value="AT" /> <!-- Austria -->
34
+ <xs:enumeration value="AU" /> <!-- Australia -->
35
+ <xs:enumeration value="AW" /> <!-- Aruba -->
36
+ <xs:enumeration value="AX" /> <!-- Åland Islands -->
37
+ <xs:enumeration value="AZ" /> <!-- Azerbaijan -->
38
+ <xs:enumeration value="BA" /> <!-- Bosnia and Herzegovina -->
39
+ <xs:enumeration value="BB" /> <!-- Barbados -->
40
+ <xs:enumeration value="BD" /> <!-- Bangladesh -->
41
+ <xs:enumeration value="BE" /> <!-- Belgium -->
42
+ <xs:enumeration value="BF" /> <!-- Burkina Faso -->
43
+ <xs:enumeration value="BG" /> <!-- Bulgaria -->
44
+ <xs:enumeration value="BH" /> <!-- Kingdom of Bahrain -->
45
+ <xs:enumeration value="BI" /> <!-- Burundi -->
46
+ <xs:enumeration value="BJ" /> <!-- Benin -->
47
+ <xs:enumeration value="BL" /> <!-- Collectivity of Saint Barthélemy -->
48
+ <xs:enumeration value="BM" /> <!-- Bermuda -->
49
+ <xs:enumeration value="BN" /> <!-- Brunei -->
50
+ <xs:enumeration value="BO" /> <!-- Bolivia -->
51
+ <xs:enumeration value="BR" /> <!-- Brazil -->
52
+ <xs:enumeration value="BS" /> <!-- Commonwealth of the Bahamas -->
53
+ <xs:enumeration value="BT" /> <!-- Kingdom of Bhutan -->
54
+ <xs:enumeration value="BW" /> <!-- Botswana -->
55
+ <xs:enumeration value="BY" /> <!-- Belarus -->
56
+ <xs:enumeration value="BZ" /> <!-- Belize -->
57
+ <xs:enumeration value="CA" /> <!-- Canada -->
58
+ <xs:enumeration value="CC" /> <!-- Cocos (Keeling) Islands -->
59
+ <xs:enumeration value="CD" /> <!-- Democratic Republic of the Congo -->
60
+ <xs:enumeration value="CF" /> <!-- Central African Republic -->
61
+ <xs:enumeration value="CG" /> <!-- Congo -->
62
+ <xs:enumeration value="CH" /> <!-- Switzerland -->
63
+ <xs:enumeration value="CI" /> <!-- Côte d'Ivoire -->
64
+ <xs:enumeration value="CK" /> <!-- Cook Islands -->
65
+ <xs:enumeration value="CL" /> <!-- Chile -->
66
+ <xs:enumeration value="CM" /> <!-- Cameroon -->
67
+ <xs:enumeration value="CN" /> <!-- People's Republic of China -->
68
+ <xs:enumeration value="CO" /> <!-- Colombia -->
69
+ <xs:enumeration value="CR" /> <!-- Costa Rica -->
70
+ <xs:enumeration value="CU" /> <!-- Cuba -->
71
+ <xs:enumeration value="CV" /> <!-- Cabo Verde -->
72
+ <xs:enumeration value="CW" /> <!-- Curaçao -->
73
+ <xs:enumeration value="CX" /> <!-- Territory of Christmas Island -->
74
+ <xs:enumeration value="CY" /> <!-- Cyprus -->
75
+ <xs:enumeration value="CZ" /> <!-- Czech Republic -->
76
+ <xs:enumeration value="DE" /> <!-- Germany -->
77
+ <xs:enumeration value="DJ" /> <!-- Djibouti -->
78
+ <xs:enumeration value="DK" /> <!-- Denmark -->
79
+ <xs:enumeration value="DM" /> <!-- Commonwealth of Dominica -->
80
+ <xs:enumeration value="DO" /> <!-- Dominican Republic -->
81
+ <xs:enumeration value="DZ" /> <!-- Algeria -->
82
+ <xs:enumeration value="EC" /> <!-- Ecuador -->
83
+ <xs:enumeration value="EE" /> <!-- Estonia -->
84
+ <xs:enumeration value="EG" /> <!-- Egypt -->
85
+ <xs:enumeration value="EH" /> <!-- Sahrawi -->
86
+ <xs:enumeration value="ER" /> <!-- Eritrea -->
87
+ <xs:enumeration value="ES" /> <!-- Spain -->
88
+ <xs:enumeration value="ET" /> <!-- Ethiopia -->
89
+ <xs:enumeration value="FI" /> <!-- Finland -->
90
+ <xs:enumeration value="FJ" /> <!-- Fiji -->
91
+ <xs:enumeration value="FK" /> <!-- Falkland Islands -->
92
+ <xs:enumeration value="FM" /> <!-- Micronesia -->
93
+ <xs:enumeration value="FO" /> <!-- Faroe Islands -->
94
+ <xs:enumeration value="FR" /> <!-- France -->
95
+ <xs:enumeration value="GA" /> <!-- Gabonese Republic -->
96
+ <xs:enumeration value="GB" /> <!-- United Kingdom -->
97
+ <xs:enumeration value="GD" /> <!-- Grenada -->
98
+ <xs:enumeration value="GE" /> <!-- Georgia -->
99
+ <xs:enumeration value="GF" /> <!-- Guiana -->
100
+ <xs:enumeration value="GG" /> <!-- Bailiwick of Guernsey -->
101
+ <xs:enumeration value="GH" /> <!-- Ghana -->
102
+ <xs:enumeration value="GI" /> <!-- Gibraltar -->
103
+ <xs:enumeration value="GL" /> <!-- Greenland -->
104
+ <xs:enumeration value="GM" /> <!-- Gambia -->
105
+ <xs:enumeration value="GN" /> <!-- Guinea -->
106
+ <xs:enumeration value="GP" /> <!-- Guadeloupe -->
107
+ <xs:enumeration value="GQ" /> <!-- Equatorial Guinea -->
108
+ <xs:enumeration value="GR" /> <!-- Greece -->
109
+ <xs:enumeration value="GS" /> <!-- South Georgia and the South Sandwich Islands -->
110
+ <xs:enumeration value="GT" /> <!-- Guatemala -->
111
+ <xs:enumeration value="GU" /> <!-- Guam -->
112
+ <xs:enumeration value="GW" /> <!-- Guinea-Bissau -->
113
+ <xs:enumeration value="GY" /> <!-- Guyana -->
114
+ <xs:enumeration value="HK" /> <!-- Hong Kong -->
115
+ <xs:enumeration value="HM" /> <!-- Heard Island and McDonald Islands -->
116
+ <xs:enumeration value="HN" /> <!-- Honduras -->
117
+ <xs:enumeration value="HR" /> <!-- Croatia -->
118
+ <xs:enumeration value="HT" /> <!-- Haiti -->
119
+ <xs:enumeration value="HU" /> <!-- Hungary -->
120
+ <xs:enumeration value="ID" /> <!-- Indonesia -->
121
+ <xs:enumeration value="IE" /> <!-- Ireland -->
122
+ <xs:enumeration value="IL" /> <!-- Israel -->
123
+ <xs:enumeration value="IM" /> <!-- Isle of Man -->
124
+ <xs:enumeration value="IN" /> <!-- India -->
125
+ <xs:enumeration value="IO" /> <!-- British Indian Ocean Territory -->
126
+ <xs:enumeration value="IQ" /> <!-- Iraq -->
127
+ <xs:enumeration value="IR" /> <!-- Iran -->
128
+ <xs:enumeration value="IS" /> <!-- Iceland -->
129
+ <xs:enumeration value="IT" /> <!-- Italy -->
130
+ <xs:enumeration value="JE" /> <!-- Bailiwick of Jersey -->
131
+ <xs:enumeration value="JM" /> <!-- Jamaica -->
132
+ <xs:enumeration value="JO" /> <!-- Jordan -->
133
+ <xs:enumeration value="JP" /> <!-- Japan -->
134
+ <xs:enumeration value="KE" /> <!-- Kenya -->
135
+ <xs:enumeration value="KG" /> <!-- Kyrgyzstan -->
136
+ <xs:enumeration value="KH" /> <!-- Cambodia -->
137
+ <xs:enumeration value="KI" /> <!-- Kiribati -->
138
+ <xs:enumeration value="KM" /> <!-- Union of the Comoros -->
139
+ <xs:enumeration value="KN" /> <!-- Saint Christopher and Nevisa -->
140
+ <xs:enumeration value="KP" /> <!-- Democratic People's Republic of Korea -->
141
+ <xs:enumeration value="KR" /> <!-- Republic of Korea -->
142
+ <xs:enumeration value="KW" /> <!-- Kuwait -->
143
+ <xs:enumeration value="KY" /> <!-- Cayman Islands -->
144
+ <xs:enumeration value="KZ" /> <!-- Kazakhstan -->
145
+ <xs:enumeration value="LA" /> <!-- Lao People's Democratic Republic -->
146
+ <xs:enumeration value="LB" /> <!-- Lebanese Republic -->
147
+ <xs:enumeration value="LC" /> <!-- Saint Lucia -->
148
+ <xs:enumeration value="LI" /> <!-- Liechtenstein -->
149
+ <xs:enumeration value="LK" /> <!-- Sri Lanka -->
150
+ <xs:enumeration value="LR" /> <!-- Liberia -->
151
+ <xs:enumeration value="LS" /> <!-- Lesotho -->
152
+ <xs:enumeration value="LT" /> <!-- Lithuania -->
153
+ <xs:enumeration value="LU" /> <!-- Luxembourg -->
154
+ <xs:enumeration value="LV" /> <!-- Latvia -->
155
+ <xs:enumeration value="LY" /> <!-- Libya -->
156
+ <xs:enumeration value="MA" /> <!-- Morocco -->
157
+ <xs:enumeration value="MC" /> <!-- Monaco -->
158
+ <xs:enumeration value="MD" /> <!-- Moldova -->
159
+ <xs:enumeration value="ME" /> <!-- Montenegro -->
160
+ <xs:enumeration value="MF" /> <!-- Saint Martin -->
161
+ <xs:enumeration value="MG" /> <!-- Madagascar -->
162
+ <xs:enumeration value="MH" /> <!-- Marshall Islands -->
163
+ <xs:enumeration value="MK" /> <!-- Macedonia -->
164
+ <xs:enumeration value="ML" /> <!-- Mali -->
165
+ <xs:enumeration value="MM" /> <!-- Myanmar -->
166
+ <xs:enumeration value="MN" /> <!-- Mongolia -->
167
+ <xs:enumeration value="MO" /> <!-- Macao -->
168
+ <xs:enumeration value="MP" /> <!-- Northern Mariana Islands -->
169
+ <xs:enumeration value="MQ" /> <!-- Martinique -->
170
+ <xs:enumeration value="MR" /> <!-- Mauritania -->
171
+ <xs:enumeration value="MS" /> <!-- Montserrat -->
172
+ <xs:enumeration value="MT" /> <!-- Malta -->
173
+ <xs:enumeration value="MU" /> <!-- Mauritius -->
174
+ <xs:enumeration value="MV" /> <!-- Maldives -->
175
+ <xs:enumeration value="MW" /> <!-- Malawi -->
176
+ <xs:enumeration value="MX" /> <!-- Mexico -->
177
+ <xs:enumeration value="MY" /> <!-- Malaysia -->
178
+ <xs:enumeration value="MZ" /> <!-- Mozambique -->
179
+ <xs:enumeration value="NA" /> <!-- Namibia -->
180
+ <xs:enumeration value="NC" /> <!-- New Caledonia -->
181
+ <xs:enumeration value="NE" /> <!-- Niger -->
182
+ <xs:enumeration value="NF" /> <!-- Norfolk Island -->
183
+ <xs:enumeration value="NG" /> <!-- Nigeria -->
184
+ <xs:enumeration value="NI" /> <!-- Nicaragua -->
185
+ <xs:enumeration value="NL" /> <!-- Netherlands -->
186
+ <xs:enumeration value="NO" /> <!-- Norway -->
187
+ <xs:enumeration value="NP" /> <!-- Nepal -->
188
+ <xs:enumeration value="NR" /> <!-- Nauru -->
189
+ <xs:enumeration value="NU" /> <!-- Niue -->
190
+ <xs:enumeration value="NZ" /> <!-- New Zealand -->
191
+ <xs:enumeration value="OM" /> <!-- Oman -->
192
+ <xs:enumeration value="PA" /> <!-- Panama -->
193
+ <xs:enumeration value="PE" /> <!-- Peru -->
194
+ <xs:enumeration value="PF" /> <!-- French Polynesia -->
195
+ <xs:enumeration value="PG" /> <!-- Papua New Guinea -->
196
+ <xs:enumeration value="PH" /> <!-- Philippines -->
197
+ <xs:enumeration value="PK" /> <!-- Pakistan -->
198
+ <xs:enumeration value="PL" /> <!-- Poland -->
199
+ <xs:enumeration value="PM" /> <!-- Saint Pierre and Miquelon -->
200
+ <xs:enumeration value="PN" /> <!-- Pitcairn Group of Islands -->
201
+ <xs:enumeration value="PR" /> <!-- Puerto Rico -->
202
+ <xs:enumeration value="PS" /> <!-- Palestine -->
203
+ <xs:enumeration value="PT" /> <!-- Portugal -->
204
+ <xs:enumeration value="PW" /> <!-- Palau -->
205
+ <xs:enumeration value="PY" /> <!-- Paraguay -->
206
+ <xs:enumeration value="QA" /> <!-- Qatar -->
207
+ <xs:enumeration value="RE" /> <!-- Réunion Island -->
208
+ <xs:enumeration value="RO" /> <!-- Romania -->
209
+ <xs:enumeration value="RS" /> <!-- Serbia -->
210
+ <xs:enumeration value="RU" /> <!-- Russian Federation -->
211
+ <xs:enumeration value="RW" /> <!-- Rwanda -->
212
+ <xs:enumeration value="SA" /> <!-- Saudi Arabia -->
213
+ <xs:enumeration value="SB" /> <!-- Solomon Islands -->
214
+ <xs:enumeration value="SC" /> <!-- Seychelles -->
215
+ <xs:enumeration value="SD" /> <!-- Sudan -->
216
+ <xs:enumeration value="SE" /> <!-- Sweden -->
217
+ <xs:enumeration value="SG" /> <!-- Singapore -->
218
+ <xs:enumeration value="SI" /> <!-- Slovenia -->
219
+ <xs:enumeration value="SJ" /> <!-- Svalbard og Jan Mayen -->
220
+ <xs:enumeration value="SK" /> <!-- Slovakia -->
221
+ <xs:enumeration value="SL" /> <!-- Sierra Leone -->
222
+ <xs:enumeration value="SM" /> <!-- San Marino -->
223
+ <xs:enumeration value="SN" /> <!-- Senegal -->
224
+ <xs:enumeration value="SO" /> <!-- Somalia -->
225
+ <xs:enumeration value="SR" /> <!-- Suriname -->
226
+ <xs:enumeration value="SS" /> <!-- South Sudan -->
227
+ <xs:enumeration value="ST" /> <!-- São Tomé and Príncipe -->
228
+ <xs:enumeration value="SV" /> <!-- El Salvador -->
229
+ <xs:enumeration value="SX" /> <!-- Sint Maarten -->
230
+ <xs:enumeration value="SY" /> <!-- Syria -->
231
+ <xs:enumeration value="SZ" /> <!-- Swaziland -->
232
+ <xs:enumeration value="TC" /> <!-- Turks and Caicos Islands -->
233
+ <xs:enumeration value="TD" /> <!-- Chad -->
234
+ <xs:enumeration value="TF" /> <!-- French Southern and Antarctic Lands -->
235
+ <xs:enumeration value="TG" /> <!-- Togolese Republic -->
236
+ <xs:enumeration value="TH" /> <!-- Thailand -->
237
+ <xs:enumeration value="TJ" /> <!-- Tajikistan -->
238
+ <xs:enumeration value="TK" /> <!-- Tokelau -->
239
+ <xs:enumeration value="TL" /> <!-- Timor-Leste -->
240
+ <xs:enumeration value="TM" /> <!-- Turkmenistan -->
241
+ <xs:enumeration value="TN" /> <!-- Tunisia -->
242
+ <xs:enumeration value="TO" /> <!-- Tonga -->
243
+ <xs:enumeration value="TR" /> <!-- Turkey -->
244
+ <xs:enumeration value="TT" /> <!-- Trinidad and Tobago -->
245
+ <xs:enumeration value="TV" /> <!-- Tuvalu -->
246
+ <xs:enumeration value="TW" /> <!-- Republic of China (Taiwan) -->
247
+ <xs:enumeration value="TZ" /> <!-- Tanzania -->
248
+ <xs:enumeration value="UA" /> <!-- Ukraine -->
249
+ <xs:enumeration value="UG" /> <!-- Uganda -->
250
+ <xs:enumeration value="UM" /> <!-- United States Minor Outlying Islands -->
251
+ <xs:enumeration value="US" /> <!-- United States of America -->
252
+ <xs:enumeration value="UY" /> <!-- Uruguay -->
253
+ <xs:enumeration value="UZ" /> <!-- Uzbekistan -->
254
+ <xs:enumeration value="VA" /> <!-- Vatican -->
255
+ <xs:enumeration value="VC" /> <!-- Saint Vincent and the Grenadines -->
256
+ <xs:enumeration value="VE" /> <!-- Venezuela -->
257
+ <xs:enumeration value="VG" /> <!-- Virgin Islands -->
258
+ <xs:enumeration value="VI" /> <!-- Virgin Islands of the United States -->
259
+ <xs:enumeration value="VN" /> <!-- Vietnam -->
260
+ <xs:enumeration value="VU" /> <!-- Vanuatu -->
261
+ <xs:enumeration value="WF" /> <!-- Wallis and Futuna Islands -->
262
+ <xs:enumeration value="WS" /> <!-- Samoa -->
263
+ <xs:enumeration value="XK" /> <!-- Kosovo -->
264
+ <xs:enumeration value="YE" /> <!-- Yemen -->
265
+ <xs:enumeration value="YT" /> <!-- Department of Mayotte -->
266
+ <xs:enumeration value="ZA" /> <!-- South Africa -->
267
+ <xs:enumeration value="ZM" /> <!-- Zambia -->
268
+ <xs:enumeration value="ZW" /> <!-- Zimbabwe -->
269
+ </xs:restriction>
270
+ </xs:simpleType>
271
+ </xs:schema>
@@ -0,0 +1,93 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "proof": {
7
+ "@id": "https://w3id.org/security#proof",
8
+ "@type": "@id",
9
+ "@container": "@graph"
10
+ },
11
+ "Ed25519VerificationKey2020": {
12
+ "@id": "https://w3id.org/security#Ed25519VerificationKey2020",
13
+ "@context": {
14
+ "@protected": true,
15
+ "id": "@id",
16
+ "type": "@type",
17
+ "controller": {
18
+ "@id": "https://w3id.org/security#controller",
19
+ "@type": "@id"
20
+ },
21
+ "revoked": {
22
+ "@id": "https://w3id.org/security#revoked",
23
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
24
+ },
25
+ "publicKeyMultibase": {
26
+ "@id": "https://w3id.org/security#publicKeyMultibase",
27
+ "@type": "https://w3id.org/security#multibase"
28
+ }
29
+ }
30
+ },
31
+ "Ed25519Signature2020": {
32
+ "@id": "https://w3id.org/security#Ed25519Signature2020",
33
+ "@context": {
34
+ "@protected": true,
35
+ "id": "@id",
36
+ "type": "@type",
37
+ "challenge": "https://w3id.org/security#challenge",
38
+ "created": {
39
+ "@id": "http://purl.org/dc/terms/created",
40
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
41
+ },
42
+ "domain": "https://w3id.org/security#domain",
43
+ "expires": {
44
+ "@id": "https://w3id.org/security#expiration",
45
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
46
+ },
47
+ "nonce": "https://w3id.org/security#nonce",
48
+ "proofPurpose": {
49
+ "@id": "https://w3id.org/security#proofPurpose",
50
+ "@type": "@vocab",
51
+ "@context": {
52
+ "@protected": true,
53
+ "id": "@id",
54
+ "type": "@type",
55
+ "assertionMethod": {
56
+ "@id": "https://w3id.org/security#assertionMethod",
57
+ "@type": "@id",
58
+ "@container": "@set"
59
+ },
60
+ "authentication": {
61
+ "@id": "https://w3id.org/security#authenticationMethod",
62
+ "@type": "@id",
63
+ "@container": "@set"
64
+ },
65
+ "capabilityInvocation": {
66
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
67
+ "@type": "@id",
68
+ "@container": "@set"
69
+ },
70
+ "capabilityDelegation": {
71
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
72
+ "@type": "@id",
73
+ "@container": "@set"
74
+ },
75
+ "keyAgreement": {
76
+ "@id": "https://w3id.org/security#keyAgreementMethod",
77
+ "@type": "@id",
78
+ "@container": "@set"
79
+ }
80
+ }
81
+ },
82
+ "proofValue": {
83
+ "@id": "https://w3id.org/security#proofValue",
84
+ "@type": "https://w3id.org/security#multibase"
85
+ },
86
+ "verificationMethod": {
87
+ "@id": "https://w3id.org/security#verificationMethod",
88
+ "@type": "@id"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "faceSignUserId": "xsd:string"
7
+ }
8
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "aux": "https://raw.githubusercontent.com/idos-network/idos-sdk-js/168f449a799620123bc7b01fc224423739500f94/packages/issuer-sdk-js/assets/country-codes.xml",
7
+ "applicantId": "xsd:string",
8
+ "inquiryId": "xsd:string",
9
+ "firstName": "xsd:string",
10
+ "middleName": "xsd:string",
11
+ "nationality": "aux:ISO_3166-1_alpha-2",
12
+ "familyName": "xsd:string",
13
+ "maidenName": "xsd:string",
14
+ "gender": "xsd:string",
15
+ "governmentId": "xsd:string",
16
+ "governmentIdType": "xsd:string",
17
+ "email": "xsd:string",
18
+ "ssn": "xsd:string",
19
+ "phoneNumber": "xsd:string",
20
+ "dateOfBirth": "aux:date",
21
+ "placeOfBirth": "xsd:string",
22
+ "idDocumentCountry": "xsd:string",
23
+ "idDocumentNumber": "xsd:string",
24
+ "idDocumentType": "xsd:string",
25
+ "idDocumentDateOfIssue": "aux:date",
26
+ "idDocumentDateOfExpiry": "aux:date",
27
+ "idDocumentFrontFile": "xsd:string",
28
+ "idDocumentBackFile": "xsd:string",
29
+ "selfieFile": "xsd:string",
30
+ "residentialAddressStreet": "xsd:string",
31
+ "residentialAddressHouseNumber": "xsd:string",
32
+ "residentialAddressAdditionalAddressInfo": "xsd:string",
33
+ "residentialAddressRegion": "xsd:string",
34
+ "residentialAddressCity": "xsd:string",
35
+ "residentialAddressPostalCode": "xsd:string",
36
+ "residentialAddressCountry": "aux:ISO_3166-1_alpha-2",
37
+ "residentialAddressProofCategory": "xsd:string",
38
+ "residentialAddressProofDateOfIssue": "xsd:date",
39
+ "residentialAddressProofFile": "xsd:string"
40
+ }
41
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "aux": "https://raw.githubusercontent.com/idos-network/idos-sdk-js/168f449a799620123bc7b01fc224423739500f94/packages/issuer-sdk-js/assets/country-codes.xml",
7
+ "firstName": "xsd:string",
8
+ "middleName": "xsd:string",
9
+ "nationality": "aux:ISO_3166-1_alpha-2",
10
+ "familyName": "xsd:string",
11
+ "maidenName": "xsd:string",
12
+ "gender": "xsd:string",
13
+ "email": "xsd:string",
14
+ "phoneNumber": "xsd:string",
15
+ "ssn": "xsd:string",
16
+ "dateOfBirth": "aux:date",
17
+ "placeOfBirth": "xsd:string",
18
+ "idDocumentCountry": "xsd:string",
19
+ "idDocumentNumber": "xsd:string",
20
+ "idDocumentType": "xsd:string",
21
+ "idDocumentDateOfIssue": "aux:date",
22
+ "idDocumentDateOfExpiry": "aux:date",
23
+ "idDocumentFrontFile": "xsd:string",
24
+ "idDocumentBackFile": "xsd:string",
25
+ "selfieFile": "xsd:string",
26
+ "residentialAddressStreet": "xsd:string",
27
+ "residentialAddressHouseNumber": "xsd:string",
28
+ "residentialAddressAdditionalAddressInfo": "xsd:string",
29
+ "residentialAddressRegion": "xsd:string",
30
+ "residentialAddressCity": "xsd:string",
31
+ "residentialAddressPostalCode": "xsd:string",
32
+ "residentialAddressCountry": "aux:ISO_3166-1_alpha-2",
33
+ "residentialAddressProofCategory": "xsd:string",
34
+ "residentialAddressProofDateOfIssue": "xsd:date",
35
+ "residentialAddressProofFile": "xsd:string"
36
+ }
37
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "approvedAt": "xsd:date",
7
+ "level": "xsd:string"
8
+ }
9
+ }