@velocitycareerlabs/common-schemas 1.17.0-dev-build.1bc6fcace

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.
Files changed (54) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +1 -0
  3. package/index.js +28 -0
  4. package/package.json +16 -0
  5. package/src/credential-type/credential-type.schema.json +9 -0
  6. package/src/credential-type/index.js +23 -0
  7. package/src/credential-type/new-credential-type.schema.json +96 -0
  8. package/src/did/did-doc.schema.json +148 -0
  9. package/src/did/did-key.schema.json +62 -0
  10. package/src/did/did-proof.schema.json +44 -0
  11. package/src/did/did-service.schema.json +44 -0
  12. package/src/did/index.js +29 -0
  13. package/src/did/modify-did-service.schema.json +14 -0
  14. package/src/entity/immutable-entity.schema.json +15 -0
  15. package/src/entity/index.js +20 -0
  16. package/src/entity/mutable-entity.schema.json +19 -0
  17. package/src/error/error.schema.json +19 -0
  18. package/src/error/index.js +19 -0
  19. package/src/general/address.schema.json +33 -0
  20. package/src/general/date.schema.json +23 -0
  21. package/src/general/email.schema.json +13 -0
  22. package/src/general/error-response.schema.json +20 -0
  23. package/src/general/index.js +37 -0
  24. package/src/general/location.schema.json +20 -0
  25. package/src/general/multilingual-string.schema.json +40 -0
  26. package/src/general/page-body.schema.json +28 -0
  27. package/src/general/page-query.schema.json +29 -0
  28. package/src/general/phone.schema.json +13 -0
  29. package/src/identity/id-document.schema.json +39 -0
  30. package/src/identity/index.js +21 -0
  31. package/src/issuing/holder-offer.schema.json +142 -0
  32. package/src/issuing/index.js +23 -0
  33. package/src/issuing/issuer-data.schema.json +26 -0
  34. package/src/jwts/index.js +31 -0
  35. package/src/jwts/jwt-decode.response.200.schema.json +20 -0
  36. package/src/jwts/jwt-decode.schema.json +15 -0
  37. package/src/jwts/jwt-sign.response.200.schema.json +14 -0
  38. package/src/jwts/jwt-sign.schema.json +40 -0
  39. package/src/jwts/jwt-verify.response.200.schema.json +17 -0
  40. package/src/jwts/jwt-verify.schema.json +19 -0
  41. package/src/organization/index.js +39 -0
  42. package/src/organization/organization-profile-modification.schema.json +172 -0
  43. package/src/organization/organization-profile-public-response.schema.js +16 -0
  44. package/src/organization/organization-profile-verifiable-credential.schema.json +25 -0
  45. package/src/organization/organization-profile.schema.json +57 -0
  46. package/src/organization/organization-verified-profile.schema.json +125 -0
  47. package/src/organization/organization.search-profile.query-params.schema.json +50 -0
  48. package/src/organization/organization.search.query-params.schema.json +42 -0
  49. package/src/organization/public-key.schema.json +99 -0
  50. package/src/organization/registrar-message-response.json +9 -0
  51. package/src/organization/registrar-message.json +84 -0
  52. package/src/verification/identify-webhook.request.body.schema.json +113 -0
  53. package/src/verification/index.js +23 -0
  54. package/src/verification/verification.identify.response.200.schema.json +12 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright 2023 Velocity Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ const jwtSignSchema = require('./jwt-sign.schema.json');
18
+ const jwtSignResponse200Schema = require('./jwt-sign.response.200.schema.json');
19
+ const jwtDecodeSchema = require('./jwt-decode.schema.json');
20
+ const jwtDecodeResponse200Schema = require('./jwt-decode.response.200.schema.json');
21
+ const jwtVerifySchema = require('./jwt-verify.schema.json');
22
+ const jwtVerifyResponse200Schema = require('./jwt-verify.response.200.schema.json');
23
+
24
+ module.exports = {
25
+ jwtSignSchema,
26
+ jwtSignResponse200Schema,
27
+ jwtDecodeSchema,
28
+ jwtDecodeResponse200Schema,
29
+ jwtVerifySchema,
30
+ jwtVerifyResponse200Schema,
31
+ };
@@ -0,0 +1,20 @@
1
+ {
2
+ "title": "jwt-decode-response-200",
3
+ "$id": "jwt-decode-response-200",
4
+ "type": "object",
5
+ "properties": {
6
+ "payload": {
7
+ "type": "object",
8
+ "additionalProperties": true
9
+ },
10
+ "header": {
11
+ "type": "object",
12
+ "additionalProperties": true
13
+ }
14
+ },
15
+ "required": [
16
+ "payload",
17
+ "header"
18
+ ],
19
+ "additionalProperties": false
20
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "title": "jwts-decode",
3
+ "$id": "jwts-decode",
4
+ "type": "object",
5
+ "properties": {
6
+ "jwt": {
7
+ "type": "string",
8
+ "description": "a jwt string."
9
+ }
10
+ },
11
+ "required": [
12
+ "jwt"
13
+ ],
14
+ "additionalProperties": false
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "title": "jwt-sign-response-200",
3
+ "$id": "jwt-sign-response-200",
4
+ "type": "object",
5
+ "properties": {
6
+ "jwt": {
7
+ "type": "string"
8
+ }
9
+ },
10
+ "required": [
11
+ "jwt"
12
+ ],
13
+ "additionalProperties": false
14
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "title": "jwt-sign",
3
+ "$id": "jwt-sign",
4
+ "type": "object",
5
+ "properties": {
6
+ "payload": {
7
+ "type": "object"
8
+ },
9
+ "options": {
10
+ "type": "object",
11
+ "properties": {
12
+ "issuer": {
13
+ "type": "string",
14
+ "description": "did or random uuid of the issuer"
15
+ },
16
+ "audience": {
17
+ "type": "string",
18
+ "description": "did or random uuid of the audience"
19
+ },
20
+ "subject": {
21
+ "type": "string",
22
+ "description": "did or random uuid of the subject"
23
+ },
24
+ "expiresIn": {
25
+ "type": "string",
26
+ "description": "a ISO 8601 formatted duration string"
27
+ }
28
+ },
29
+ "required": [
30
+ "issuer",
31
+ "subject"
32
+ ]
33
+ }
34
+ },
35
+ "required": [
36
+ "payload",
37
+ "options"
38
+ ],
39
+ "additionalProperties": false
40
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "title": "jwt-verify-response-200",
3
+ "$id": "jwt-verify-response-200",
4
+ "type": "object",
5
+ "properties": {
6
+ "verified": {
7
+ "type": "boolean"
8
+ },
9
+ "error": {
10
+ "type": "string"
11
+ }
12
+ },
13
+ "required": [
14
+ "verified"
15
+ ],
16
+ "additionalProperties": false
17
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "title": "jwts-verify",
3
+ "$id": "jwts-verify",
4
+ "type": "object",
5
+ "properties": {
6
+ "jwt": {
7
+ "type": "string",
8
+ "description": "jwt string"
9
+ },
10
+ "publicKey": {
11
+ "type": "object",
12
+ "description": "jwk public key"
13
+ }
14
+ },
15
+ "required": [
16
+ "jwt"
17
+ ],
18
+ "additionalProperties": false
19
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright 2023 Velocity Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ const organizationProfileModificationSchema = require('./organization-profile-modification.schema.json');
18
+ const organizationProfilePublicResponseSchema = require('./organization-profile-public-response.schema');
19
+ const organizationProfileSchema = require('./organization-profile.schema.json');
20
+ const organizationSearchQueryParamsSchema = require('./organization.search.query-params.schema.json');
21
+ const organizationSearchQueryProfileParamsSchema = require('./organization.search-profile.query-params.schema.json');
22
+ const organizationProfileVerifiableCredentialSchema = require('./organization-profile-verifiable-credential.schema.json');
23
+ const organizationVerifiedProfileSchema = require('./organization-verified-profile.schema.json');
24
+ const publicKeySchema = require('./public-key.schema.json');
25
+ const registrarMessage = require('./registrar-message.json');
26
+ const registrarMessageResponse = require('./registrar-message-response.json');
27
+
28
+ module.exports = {
29
+ organizationProfileModificationSchema,
30
+ organizationProfilePublicResponseSchema,
31
+ organizationProfileSchema,
32
+ organizationSearchQueryParamsSchema,
33
+ organizationSearchQueryProfileParamsSchema,
34
+ organizationProfileVerifiableCredentialSchema,
35
+ organizationVerifiedProfileSchema,
36
+ publicKeySchema,
37
+ registrarMessage,
38
+ registrarMessageResponse,
39
+ };
@@ -0,0 +1,172 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "organization-profile-modification",
4
+ "title": "Editable Organization Profile Information",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "description": "Profile info for an org that can be set in a \"form\"",
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "description": "the name of the of",
12
+ "maxLength": 100
13
+ },
14
+ "location": {
15
+ "$ref": "https://velocitynetwork.foundation/schemas/location.schema.json#"
16
+ },
17
+ "logo": {
18
+ "type": "string",
19
+ "description": "the logo to be used for the org",
20
+ "format": "uri"
21
+ },
22
+ "website": {
23
+ "type": "string",
24
+ "format": "uri"
25
+ },
26
+ "secureMessagesUrl": {
27
+ "type": "string"
28
+ },
29
+ "contactEmail": {
30
+ "type": "string",
31
+ "format": "email"
32
+ },
33
+ "technicalEmail": {
34
+ "type": "string",
35
+ "format": "email"
36
+ },
37
+ "description": {
38
+ "type": "string"
39
+ },
40
+ "founded": {
41
+ "type": "string",
42
+ "format": "regex",
43
+ "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
44
+ },
45
+ "closed": {
46
+ "type": "string",
47
+ "format": "regex",
48
+ "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
49
+ },
50
+ "type": {
51
+ "type": "string",
52
+ "enum": [
53
+ "company",
54
+ "non-profit"
55
+ ],
56
+ "default": "company"
57
+ },
58
+ "registrationNumbers": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "object",
62
+ "properties": {
63
+ "authority": {
64
+ "type": "string",
65
+ "enum": [
66
+ "NationalAuthority",
67
+ "DunnAndBradstreet",
68
+ "GLEIF",
69
+ "LinkedIn"
70
+ ]
71
+ },
72
+ "number": {
73
+ "type": "string"
74
+ },
75
+ "uri": {
76
+ "type": "string",
77
+ "format": "uri"
78
+ }
79
+ },
80
+ "required": [
81
+ "authority",
82
+ "number"
83
+ ]
84
+ }
85
+ },
86
+ "commercialEntities": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "properties": {
91
+ "type": {
92
+ "type": "string",
93
+ "description": "the type of commericial entity",
94
+ "enum": [
95
+ "Brand",
96
+ "Department"
97
+ ]
98
+ },
99
+ "name": {
100
+ "type": "string",
101
+ "description": "the commercial name of the org",
102
+ "maxLength": 100
103
+ },
104
+ "logo": {
105
+ "type": "string",
106
+ "description": "the commercial logo to be used for the org",
107
+ "format": "uri"
108
+ },
109
+ "description": {
110
+ "type": "string",
111
+ "description": "a description associated with this entity"
112
+ }
113
+ },
114
+ "required": [
115
+ "type",
116
+ "name",
117
+ "logo"
118
+ ]
119
+ }
120
+ },
121
+ "adminName": {
122
+ "type": "string",
123
+ "description": "Name of the admin"
124
+ },
125
+ "adminTitle": {
126
+ "type": "string",
127
+ "description": "Title of the admin"
128
+ },
129
+ "adminEmail": {
130
+ "type": "string",
131
+ "format": "email",
132
+ "description": "Email of the admin"
133
+ },
134
+ "signatoryName": {
135
+ "type": "string",
136
+ "description": "Name of the signatory"
137
+ },
138
+ "signatoryTitle": {
139
+ "type": "string",
140
+ "description": "Title of the signatory"
141
+ },
142
+ "signatoryEmail": {
143
+ "type": "string",
144
+ "format": "email",
145
+ "description": "Email of the signatory"
146
+ },
147
+ "physicalAddress": {
148
+ "$ref": "https://velocitynetwork.foundation/schemas/address.schema.json#"
149
+ },
150
+ "linkedInProfile": {
151
+ "type": "string",
152
+ "format": "uri"
153
+ }
154
+ },
155
+ "required": [
156
+ "name",
157
+ "location",
158
+ "logo",
159
+ "type",
160
+ "adminName",
161
+ "adminTitle",
162
+ "adminEmail",
163
+ "signatoryName",
164
+ "signatoryTitle",
165
+ "signatoryEmail",
166
+ "physicalAddress",
167
+ "linkedInProfile",
168
+ "contactEmail",
169
+ "technicalEmail",
170
+ "description"
171
+ ]
172
+ }
@@ -0,0 +1,16 @@
1
+ const { filter } = require('lodash/fp');
2
+ const profileModificationSchema = require('./organization-profile-modification.schema.json');
3
+
4
+ module.exports = {
5
+ $schema: 'http://json-schema.org/draft-07/schema#',
6
+ $id: 'organization-profile-public-response',
7
+ title: 'Organization Public Profile Response',
8
+ type: 'object',
9
+ additionalProperties: false,
10
+ description: 'Profile info for an org in the response',
11
+ properties: profileModificationSchema.properties,
12
+ required: filter(
13
+ ['name', 'location', 'logo', 'type', 'physicalAddress', 'linkedInProfile'],
14
+ profileModificationSchema.required
15
+ ),
16
+ };
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "organization-profile-verifiable-credential",
4
+ "type": "object",
5
+ "title": "Organization Profile Verifiable Credential",
6
+ "description": "An organization's profile as a verifiable credential",
7
+ "properties": {
8
+ "format": {
9
+ "type": "string",
10
+ "enum": [
11
+ "jwt_vc"
12
+ ],
13
+ "description": "the format of the verifiable credential"
14
+ },
15
+ "vc": {
16
+ "type": "string",
17
+ "description": "the verifiable credential containing the organization's profile"
18
+ }
19
+ },
20
+ "required": [
21
+ "format",
22
+ "vc"
23
+ ]
24
+
25
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "organization-profile",
4
+ "type": "object",
5
+ "title": "An organization in persistent storage",
6
+ "description": "Profile info for an organization",
7
+ "allOf": [
8
+ {
9
+ "$ref": "organization-profile-public-response#"
10
+ },
11
+ {
12
+ "type": "object",
13
+ "properties": {
14
+ "id": {
15
+ "type": "string",
16
+ "pattern": "^did:[a-z0-9]+:[A-Za-z0-9--_:?=&;]+$",
17
+ "description": "the did of the organization"
18
+ },
19
+ "verifiableCredentialJwt": {
20
+ "type": "string",
21
+ "format": "uri",
22
+ "description": "the jwt of the vc that has the profile information encoded with in"
23
+ },
24
+ "permittedVelocityServiceCategory": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string",
28
+ "enum": [
29
+ "Issuer",
30
+ "Inspector",
31
+ "CredentialAgentOperator",
32
+ "NodeOperator",
33
+ "NotaryIssuer",
34
+ "HolderAppProvider",
35
+ "TrustRoot",
36
+ "IdentityIssuer",
37
+ "IdDocumentIssuer",
38
+ "NotaryIdDocumentIssuer",
39
+ "ContactIssuer",
40
+ "NotaryContactIssuer"
41
+ ]
42
+ }
43
+ },
44
+ "createdAt": {
45
+ "type": "string"
46
+ },
47
+ "updatedAt": {
48
+ "type": "string"
49
+ }
50
+ },
51
+ "required": [
52
+ "id",
53
+ "permittedVelocityServiceCategory"
54
+ ]
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "organization-verified-profile",
4
+ "type": "object",
5
+ "title": "An organization verified profile",
6
+ "description": "Verified profile information for an organization",
7
+ "allOf": [
8
+ {
9
+ "type": "object",
10
+ "properties": {
11
+ "id": {
12
+ "type": "string",
13
+ "description": "A unique id for the credential that was disclosed at this time."
14
+ },
15
+ "type": {
16
+ "type": "array",
17
+ "description": "type is identical to the standard based type found on verifiable credentials but does not accept a string, it only accepts an array to indicate an unordered set of type URIs",
18
+ "items": {
19
+ "type": "string"
20
+ }
21
+ },
22
+ "issuer": {
23
+ "type": "object",
24
+ "description": "DID of the issuer",
25
+ "properties": {
26
+ "id": {
27
+ "type": "string"
28
+ }
29
+ }
30
+ },
31
+ "credentialSubject": {
32
+ "allOf": [
33
+ {
34
+ "$ref": "organization-profile-public-response#"
35
+ },
36
+ {
37
+ "properties": {
38
+ "id": {
39
+ "type": "string"
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ "credentialSchema": {
46
+ "type": "object",
47
+ "properties": {
48
+ "id": {
49
+ "type": "string"
50
+ },
51
+ "type": {
52
+ "type": "string"
53
+ }
54
+ }
55
+ },
56
+ "validFrom": {
57
+ "type": "string",
58
+ "format": "date-time",
59
+ "description": "when the credential will start being valid"
60
+ },
61
+ "validUntil": {
62
+ "type": "string",
63
+ "format": "date-time",
64
+ "description": "when the credential will expire"
65
+ },
66
+ "issued": {
67
+ "type": "string",
68
+ "format": "date-time",
69
+ "description": "when did the issuer actually issue the verified credential"
70
+ },
71
+ "credentialChecks": {
72
+ "type": "object",
73
+ "properties": {
74
+ "checked": {
75
+ "type": "string",
76
+ "format": "date-time",
77
+ "description": "when did the system last run checks on the profile VC"
78
+ },
79
+ "TRUSTED_ISSUER": {
80
+ "type": "string",
81
+ "enum": [
82
+ "PASS",
83
+ "FAIL",
84
+ "NOT_CHECKED",
85
+ "SELF_SIGNED"
86
+ ]
87
+ },
88
+ "UNREVOKED": {
89
+ "type": "string",
90
+ "enum": [
91
+ "PASS",
92
+ "FAIL",
93
+ "NOT_CHECKED"
94
+ ]
95
+ },
96
+ "UNEXPIRED": {
97
+ "type": "string",
98
+ "enum": [
99
+ "PASS",
100
+ "FAIL",
101
+ "NOT_CHECKED",
102
+ "NOT_APPLICABLE"
103
+ ]
104
+ },
105
+ "UNTAMPERED": {
106
+ "type": "string",
107
+ "enum": [
108
+ "PASS",
109
+ "FAIL",
110
+ "NOT_CHECKED"
111
+ ]
112
+ }
113
+ }
114
+ }
115
+ },
116
+ "required": [
117
+ "type",
118
+ "issuer",
119
+ "credentialSubject",
120
+ "issued",
121
+ "credentialChecks"
122
+ ]
123
+ }
124
+ ]
125
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "title": "organization-search-query-params",
3
+ "type": "object",
4
+ "$id": "organization-search-profile-query-params",
5
+ "description": "Query parameters used for searching organizations",
6
+ "properties": {
7
+ "filter": {
8
+ "type": "object",
9
+ "properties": {
10
+ "serviceTypes": {
11
+ "type": "array",
12
+ "items": {"type": "string"}
13
+ },
14
+ "did": {
15
+ "type": "array",
16
+ "items": {"type": "string"}
17
+ }
18
+ }
19
+ },
20
+ "page": {
21
+ "type": "object",
22
+ "properties": {
23
+ "size": {
24
+ "type": "integer",
25
+ "minimum": 1
26
+ },
27
+ "skip": {
28
+ "type": "integer",
29
+ "minimum": 0
30
+ }
31
+ }
32
+ },
33
+ "q": {
34
+ "type": "string"
35
+ },
36
+ "sort": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "array",
40
+ "minItems": 2,
41
+ "maxItems": 2
42
+ }
43
+ },
44
+ "no-service-endpoint-transform": {
45
+ "type": "string",
46
+ "enum": ["1", "true"]
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ }