@verii/credentialing-hub-operator-api 0.0.0-stage → 1.3.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/src/limits.js ADDED
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright 2026 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
+
18
+ // The most items credentials/create-many takes in one request. A client
19
+ // splits a larger load into requests of at most this many items.
20
+ const CREDENTIALS_CREATE_MANY_MAX_ITEMS = 1000;
21
+
22
+ module.exports = { CREDENTIALS_CREATE_MANY_MAX_ITEMS };
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Copyright 2026 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
+
18
+ const { errorSchema } = require('@verii/common-schemas');
19
+
20
+ // Fastify serializes an error through a wrapper object, so only declared
21
+ // properties reach the body. errors has to be declared to be returned.
22
+ const credentialItemsErrorSchema = {
23
+ ...errorSchema,
24
+ $id: 'credential-items-error',
25
+ description:
26
+ 'error response that lists every invalid item. errorCode and message are those of the first error',
27
+ properties: {
28
+ ...errorSchema.properties,
29
+ errors: {
30
+ type: 'array',
31
+ description:
32
+ 'one entry per problem, in item order. Only present when items fail the depot, credential type or credentialSubject checks',
33
+ items: {
34
+ type: 'object',
35
+ properties: {
36
+ index: {
37
+ type: 'integer',
38
+ description: 'the position of the item in items',
39
+ },
40
+ path: {
41
+ type: 'string',
42
+ description:
43
+ 'a JSON pointer to the invalid field in the request body, such as /items/3/credential/content/credentialSubject/name',
44
+ },
45
+ errorCode: {
46
+ type: 'string',
47
+ },
48
+ message: {
49
+ type: 'string',
50
+ },
51
+ },
52
+ required: ['index', 'path', 'errorCode', 'message'],
53
+ },
54
+ },
55
+ },
56
+ };
57
+
58
+ module.exports = credentialItemsErrorSchema;
@@ -0,0 +1,107 @@
1
+ const { mutableEntitySchema } = require('@verii/common-schemas');
2
+ const newCredentialSchema = require('./new-credential.schema.json');
3
+
4
+ const credentialStatusSchema = {
5
+ type: 'object',
6
+ description: 'the issued credential status',
7
+ properties: {
8
+ id: {
9
+ type: 'string',
10
+ },
11
+ statusListCredential: {
12
+ type: 'string',
13
+ },
14
+ statusListIndex: {
15
+ type: 'integer',
16
+ },
17
+ type: {
18
+ type: 'string',
19
+ },
20
+ },
21
+ };
22
+
23
+ const credentialSchema = {
24
+ $id: 'Credential',
25
+ type: 'object',
26
+ properties: {
27
+ ...mutableEntitySchema.properties,
28
+ ...newCredentialSchema.properties,
29
+ depotId: {
30
+ type: 'string',
31
+ description: 'the depot that contains this credential',
32
+ },
33
+ did: {
34
+ type: 'string',
35
+ description: 'the issued credential id',
36
+ },
37
+ credentialSubjectId: {
38
+ type: 'string',
39
+ description: 'the issued credential subject id',
40
+ },
41
+ credentialStatus: {
42
+ description: 'the issued credential status',
43
+ anyOf: [
44
+ credentialStatusSchema,
45
+ {
46
+ type: 'array',
47
+ items: credentialStatusSchema,
48
+ },
49
+ ],
50
+ },
51
+ dataModelVersion: {
52
+ type: 'string',
53
+ enum: ['1.1', '2.0'],
54
+ description: 'the W3C Verifiable Credentials data model version',
55
+ },
56
+ contentHash: {
57
+ type: 'string',
58
+ description: 'the credential content hash',
59
+ },
60
+ acceptedAt: {
61
+ type: 'string',
62
+ description: 'when the credential was accepted',
63
+ format: 'date-time',
64
+ },
65
+ jwtVc: {
66
+ type: 'string',
67
+ description: 'the issued credential',
68
+ },
69
+ envelopeFormat: {
70
+ type: 'string',
71
+ enum: ['jwt_vc_json-ld', 'vc+jwt'],
72
+ description: 'the issued credential envelope format',
73
+ },
74
+ rejectedAt: {
75
+ type: 'string',
76
+ description: 'when the credential was rejected',
77
+ format: 'date-time',
78
+ },
79
+ rejectedReason: {
80
+ type: 'string',
81
+ description: 'an optional reason that was captured during rejection',
82
+ },
83
+ revokedAt: {
84
+ type: 'string',
85
+ description: 'when the issued credential was revoked',
86
+ format: 'date-time',
87
+ },
88
+ notifiedOfRevocationAt: {
89
+ type: 'string',
90
+ description: 'when the wallet was notified of revocation',
91
+ format: 'date-time',
92
+ },
93
+ signingAlgorithm: {
94
+ type: 'string',
95
+ description: 'the JOSE algorithm used to sign the credential',
96
+ },
97
+ },
98
+ required: [
99
+ ...mutableEntitySchema.required,
100
+ ...newCredentialSchema.required,
101
+ 'depotId',
102
+ 'contentHash',
103
+ ],
104
+ $defs: newCredentialSchema.$defs,
105
+ };
106
+
107
+ module.exports = credentialSchema;
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright 2026 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
+
18
+ const { errorSchema } = require('@verii/common-schemas');
19
+
20
+ // Fastify serializes an error through a wrapper object, so only declared
21
+ // properties reach the body. depotId has to be declared to be returned.
22
+ const depotConflictErrorSchema = {
23
+ ...errorSchema,
24
+ $id: 'depot-conflict-error',
25
+ description: 'error response when the depot conflicts with an existing one',
26
+ properties: {
27
+ ...errorSchema.properties,
28
+ depotId: {
29
+ type: 'string',
30
+ description: 'the id of the existing depot',
31
+ },
32
+ },
33
+ };
34
+
35
+ module.exports = depotConflictErrorSchema;
@@ -0,0 +1,28 @@
1
+ const { mutableEntitySchema } = require('@verii/common-schemas');
2
+ const newDepot = require('./new-depot.schema.json');
3
+
4
+ const depotSchema = {
5
+ $id: 'depot',
6
+ required: [
7
+ ...mutableEntitySchema.required,
8
+ ...newDepot.required,
9
+ 'serviceId',
10
+ ],
11
+ type: 'object',
12
+ properties: {
13
+ ...mutableEntitySchema.properties,
14
+ ...newDepot.properties,
15
+ serviceId: {
16
+ type: 'string',
17
+ description: 'the serviceId this depot is used for',
18
+ },
19
+ deferredCredentialsResolvedAt: {
20
+ type: 'string',
21
+ format: 'date-time',
22
+ description:
23
+ "the last time the issuer resolved the depot's deferred credentials",
24
+ },
25
+ },
26
+ };
27
+
28
+ module.exports = depotSchema;
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright 2026 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
+
18
+ const { OBJECT_ID_PATTERN } = require('./object-id-pattern');
19
+
20
+ const objectIdSchema = {
21
+ type: 'string',
22
+ pattern: OBJECT_ID_PATTERN,
23
+ };
24
+
25
+ const authValueSchema = {
26
+ anyOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }],
27
+ };
28
+
29
+ // One depot's auth values, as depots/create takes them
30
+ const authValuesTupleSchema = {
31
+ type: 'array',
32
+ minItems: 1,
33
+ maxItems: 10,
34
+ items: authValueSchema,
35
+ };
36
+
37
+ // authValues requires serviceId. OpenAPI 3.0.3 has no dependentRequired, so
38
+ // this says it with anyOf, not and required.
39
+ const serviceIdRequiredByAuthValues = [
40
+ { not: { required: ['authValues'] } },
41
+ { required: ['serviceId'] },
42
+ ];
43
+
44
+ const findDepotsRequestSchema = {
45
+ $id: 'find-depots-request',
46
+ type: 'object',
47
+ title: 'Find depots',
48
+ description:
49
+ // eslint-disable-next-line max-len
50
+ 'Payload schema for finding depots. The filters combine with AND, and mean what they mean in the depots/get query. authValues requires the serviceId of an internal verifiable_presentation issuer service',
51
+ additionalProperties: false,
52
+ properties: {
53
+ tenantId: {
54
+ type: 'string',
55
+ },
56
+ serviceId: objectIdSchema,
57
+ depotId: {
58
+ anyOf: [objectIdSchema, { type: 'array', items: objectIdSchema }],
59
+ },
60
+ authValues: {
61
+ type: 'array',
62
+ description:
63
+ // eslint-disable-next-line max-len
64
+ "Finds the depots whose auth values equal any of these. Each item holds one depot's auth values, as depots/create takes them: one value per auth rule, in valueIndex order. They match as authentication matches them: strings trimmed and lower-cased, numbers and booleans unchanged. Only depots created under the service's current auth rules match",
65
+ minItems: 1,
66
+ maxItems: 1000,
67
+ items: authValuesTupleSchema,
68
+ },
69
+ },
70
+ required: ['tenantId'],
71
+ anyOf: serviceIdRequiredByAuthValues,
72
+ };
73
+
74
+ module.exports = findDepotsRequestSchema;
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright 2026 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
+
18
+ const newIssuerServiceSchema = require('./new-issuer-service.schema');
19
+ const issuerServiceSchema = require('./issuer-service.schema');
20
+ const newDepotSchema = require('./new-depot.schema.json');
21
+ const depotSchema = require('./depot.schema');
22
+ const depotConflictErrorSchema = require('./depot-conflict-error.schema');
23
+ const findDepotsRequestSchema = require('./find-depots-request.schema');
24
+ const { OBJECT_ID_PATTERN } = require('./object-id-pattern');
25
+ const newCredentialSchema = require('./new-credential.schema.json');
26
+ const credentialSchema = require('./credential.schema');
27
+ const credentialItemsErrorSchema = require('./credential-items-error.schema');
28
+
29
+ module.exports = {
30
+ OBJECT_ID_PATTERN,
31
+ credentialItemsErrorSchema,
32
+ credentialSchema,
33
+ depotConflictErrorSchema,
34
+ depotSchema,
35
+ findDepotsRequestSchema,
36
+ issuerServiceSchema,
37
+ newCredentialSchema,
38
+ newDepotSchema,
39
+ newIssuerServiceSchema,
40
+ };
@@ -0,0 +1,26 @@
1
+ const { mutableEntitySchema } = require('@verii/common-schemas');
2
+ const newIssuerConfigurationSchema = require('./new-issuer-service.schema');
3
+
4
+ const issuerServiceSchema = {
5
+ title: 'issuer-service',
6
+ $id: 'issuer-service',
7
+ description: 'The issuer service',
8
+ type: 'object',
9
+ additionalProperties: false,
10
+ properties: {
11
+ genericRedirectUrl: {
12
+ type: 'string',
13
+ format: 'uri',
14
+ description:
15
+ 'only returned if authMethod include `verifiable_presentation`',
16
+ },
17
+ ...mutableEntitySchema.properties,
18
+ ...newIssuerConfigurationSchema.properties,
19
+ },
20
+ required: [
21
+ ...mutableEntitySchema.required,
22
+ ...newIssuerConfigurationSchema.required,
23
+ ],
24
+ };
25
+
26
+ module.exports = issuerServiceSchema;
@@ -0,0 +1,28 @@
1
+ {
2
+ "type": "object",
3
+ "$id": "new-credential",
4
+ "properties": {
5
+ "credentialReference": {
6
+ "type": "string",
7
+ "minLength": 1,
8
+ "maxLength": 64,
9
+ "description": "reference for the offer in the host system"
10
+ },
11
+ "content": {
12
+ "$ref": "https://velocitycareerlabs.io/w3c-vc.schema.json"
13
+ },
14
+ "tags": {
15
+ "type": "array",
16
+ "maxItems": 10,
17
+ "items": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 32
21
+ }
22
+ }
23
+ },
24
+ "required": [
25
+ "credentialReference",
26
+ "content"
27
+ ]
28
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$id": "new-depot",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": [
6
+ "userReference"
7
+ ],
8
+ "properties": {
9
+ "userReference": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "maxLength": 64,
13
+ "description": "The internal user reference for this depot. Typically a employee or student id of the system"
14
+ },
15
+ "authValues": {
16
+ "type": "array",
17
+ "description": "auth values to use for authenticating the user or session. For an issuer service with internal `verifiable_presentation` auth, one value per rule of its `verifiablePresentationAuthRules`, at the rule's `valueIndex`. Each value must have its rule's `valueType`, and its `valueFormat` if the rule has one, and a string must not be blank. Strings are trimmed and lower-cased before they are checked and matched, and numbers and booleans are used as they are. Values of different types never match, so `\"12345\"` never matches `12345`.",
18
+ "minItems": 1,
19
+ "maxItems": 10,
20
+ "items": {
21
+ "anyOf": [
22
+ {
23
+ "type": "number"
24
+ },
25
+ {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "pattern": "\\S"
29
+ },
30
+ {
31
+ "type": "boolean"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ "deferredCredentials": {
37
+ "type": "boolean",
38
+ "default": false,
39
+ "description": "Whether the depot's credentials may come later. A wallet with nothing to claim then waits until depots/resolve-deferred-credentials is called. Only allowed for issuer service depots, and can't be changed"
40
+ },
41
+ "expectedCredentialTypes": {
42
+ "type": "array",
43
+ "description": "The credential types the depot may receive",
44
+ "items": {
45
+ "type": "string",
46
+ "minLength": 1
47
+ },
48
+ "minItems": 1,
49
+ "uniqueItems": true
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,204 @@
1
+ const newIssuerServiceSchema = {
2
+ title: 'new-issuer-service',
3
+ $id: 'new-issuer-service',
4
+ type: 'object',
5
+ description: 'The issuer service describes how issuer is setup',
6
+ additionalProperties: false,
7
+ required: ['velocityNetworkServiceId', 'termsUrl', 'authMethods', 'authMode'],
8
+ properties: {
9
+ velocityNetworkServiceId: {
10
+ type: 'string',
11
+ description: 'Velocity Network Service Id',
12
+ },
13
+ description: {
14
+ type: 'string',
15
+ description: 'Description field for the issuer flow',
16
+ },
17
+ termsUrl: {
18
+ type: 'string',
19
+ description:
20
+ 'link to a online terms and coniditions for issuer or disclosure',
21
+ format: 'uri',
22
+ },
23
+ disclosureRequest: {
24
+ type: 'object',
25
+ description:
26
+ 'Required when `authMethods` include `verifiable_presentation`',
27
+ required: ['types', 'purpose', 'retentionPeriod'],
28
+ properties: {
29
+ types: {
30
+ type: 'array',
31
+ description: 'the set of types that are to be disclosed.',
32
+ minItems: 1,
33
+ items: {
34
+ type: 'object',
35
+ additionalProperties: false,
36
+ required: ['type'],
37
+ properties: {
38
+ type: {
39
+ type: 'string',
40
+ description: 'The credential type to be disclosed',
41
+ },
42
+ },
43
+ },
44
+ },
45
+ purpose: {
46
+ type: 'string',
47
+ description:
48
+ // eslint-disable-next-line max-len
49
+ 'purpose is a summary of the description\n\n*required*, if the `configurationType` is `inspection` or the `identificationMode` is `verifiable_presentation`',
50
+ },
51
+ retentionPeriod: {
52
+ type: 'string',
53
+ description:
54
+ // eslint-disable-next-line max-len
55
+ '*required*, if the `configurationType` is `inspection` or the `identificationMode` is `verifiable_presentation`\n\nLength of time the disclosure agreement will last. Duration can be any length of time.\n\nFollows the ISO 8601 standard on durations for time intervals.\n\nFormat:\n\nPxYxMxWxD\n\nWhere:\nx = an integer\nY = Years\nM = Months\nW = Weeks\nD = Days\n\nA valid format requires "P" plus at least one integer and time unit.\n\nExamples: \nP60D = 60 days\nP1Y30D = 1 year and 30 days.',
56
+ format: 'duration',
57
+ },
58
+ },
59
+ },
60
+ presentationDefinition: {
61
+ type: 'object',
62
+ description:
63
+ // eslint-disable-next-line max-len
64
+ 'A spec compliant presentation definition. https://identity.foundation/presentation-exchange/#presentation-definition. Not allowed when `authMethods` include `verifiable_presentation`',
65
+ additionalProperties: true,
66
+ },
67
+ deactivationDate: {
68
+ type: 'string',
69
+ format: 'date-time',
70
+ description:
71
+ 'can be configured to deactivate at a predetermined time or to be deactivated on demand by setting this to now',
72
+ },
73
+ authTokensExpireIn: {
74
+ type: 'number',
75
+ default: 604800,
76
+ },
77
+ authMethods: {
78
+ type: 'array',
79
+ minItems: 1,
80
+ description:
81
+ // eslint-disable-next-line max-len
82
+ 'the auth method indicates what authentication method(s) are supported for issuer. To use `preauth` requires the issuer to include a `vendorOriginContext` in the deep link. `verifiable_presentation` requires a `disclosureRequest` and at least one of `verifiablePresentationAuthRules`, and forbids a `presentationDefinition`.\nIn the future an issuer will be able to use both methods in one disclosure\n`authMethods` is required with at least one entry ',
83
+ items: {
84
+ type: 'string',
85
+ enum: ['preauth', 'verifiable_presentation'],
86
+ },
87
+ },
88
+ authMode: {
89
+ enum: ['internal'],
90
+ description: 'the auth mode. Currently only `internal` is supported',
91
+ },
92
+ verifiablePresentationAuthRules: {
93
+ description:
94
+ // eslint-disable-next-line max-len
95
+ 'verifiablePresentationAuthRules are the matcher rules that can be used to match an exchange with submitted presentation used for authentication. Required when the authMethods include `verifiable_presentation` and the authMode is `internal`. At most 10 rules.\n\nEach rule reads values of its `valueType` from the presented credentials of its `type`, and ignores values of any other type rather than converting them. Strings are trimmed and lower-cased, and numbers and booleans are used as they are. A depot matches when its `authValues`, normalized the same way, equal the values the rules read, each at its rule\'s `valueIndex`. Values of different types never match, so `"12345"` never matches `12345`.',
96
+ type: 'array',
97
+ maxItems: 10,
98
+ items: {
99
+ type: 'object',
100
+ required: ['path', 'rule', 'valueIndex', 'type', 'valueType'],
101
+ // valueFormat is only allowed on string rules. Each branch has its own
102
+ // type because fast-json-stringify compiles them on their own for the
103
+ // issuer-service response, and AJV's strictTypes logs untyped ones.
104
+ anyOf: [
105
+ { type: 'object', properties: { valueType: { enum: ['string'] } } },
106
+ {
107
+ type: 'object',
108
+ not: { type: 'object', required: ['valueFormat'] },
109
+ },
110
+ ],
111
+ properties: {
112
+ path: {
113
+ type: 'array',
114
+ minItems: 1,
115
+ maxItems: 10,
116
+ description:
117
+ // eslint-disable-next-line max-len
118
+ 'Claims path pointers (OpenID4VP 1.0, section 7), tried in order on each credential of the rule\'s `type`. The first pointer that selects anything supplies the values. A pointer is an array of segments: a string selects that key of an object, a non-negative integer selects that index of an array, and null selects every element of an array. Only string, number and boolean values are used. For example `[["credentialSubject", "email"], ["credentialSubject", "emails", null]]`',
119
+ items: {
120
+ type: 'array',
121
+ minItems: 1,
122
+ maxItems: 32,
123
+ items: {
124
+ anyOf: [
125
+ { type: 'string', minLength: 1, nullable: true },
126
+ { type: 'integer', minimum: 0 },
127
+ ],
128
+ },
129
+ },
130
+ },
131
+ rule: {
132
+ type: 'string',
133
+ description:
134
+ // eslint-disable-next-line max-len
135
+ 'how the rule uses the values its path finds. `pick` uses every value found. `equal` uses a value only when exactly one distinct value is found',
136
+ enum: ['pick', 'equal'],
137
+ },
138
+ valueIndex: {
139
+ type: 'integer',
140
+ minimum: 0,
141
+ maximum: 9,
142
+ description:
143
+ "the position of this rule's value in a depot's `authValues`. The rules' value indexes must be exactly 0 to n-1, each used once",
144
+ },
145
+ type: {
146
+ type: 'string',
147
+ minLength: 1,
148
+ description:
149
+ 'the credential type that the rule reads. It must be one of the `disclosureRequest` types',
150
+ },
151
+ valueType: {
152
+ type: 'string',
153
+ enum: ['string', 'number', 'boolean'],
154
+ description:
155
+ // eslint-disable-next-line max-len
156
+ "the JSON type of the rule's values. A depot's auth value at the rule's `valueIndex` must have this type. Values of another type that the rule reads from a credential are ignored, never converted",
157
+ },
158
+ valueFormat: {
159
+ type: 'string',
160
+ enum: ['email', 'e164'],
161
+ description:
162
+ // eslint-disable-next-line max-len
163
+ "the format of a `string` rule's values, which depots/create checks after trimming the value: `email` is an email address, checked as AJV's `email` format, and `e164` is a phone number in E.164 format, such as `+15556192191`. It doesn't change how values are read or matched. Only allowed when `valueType` is `string`",
164
+ },
165
+ },
166
+ },
167
+ },
168
+ challengesExpireIn: {
169
+ type: 'number',
170
+ default: 600,
171
+ description:
172
+ 'how many seconds before challenges issued by this service expire. Default is 10 minutes',
173
+ },
174
+ credentialTypesAvailable: {
175
+ type: 'array',
176
+ description: 'the types of credentials available from this service',
177
+ items: {
178
+ type: 'string',
179
+ },
180
+ },
181
+ autoCleanPII: {
182
+ type: 'boolean',
183
+ },
184
+ },
185
+ anyOf: [
186
+ {
187
+ description: 'preauth only',
188
+ properties: {
189
+ authMethods: { type: 'array', items: { enum: ['preauth'] } },
190
+ },
191
+ },
192
+ {
193
+ description: 'internal verifiable_presentation, alone or with preauth',
194
+ required: ['disclosureRequest', 'verifiablePresentationAuthRules'],
195
+ properties: {
196
+ authMode: { enum: ['internal'] },
197
+ verifiablePresentationAuthRules: { type: 'array', minItems: 1 },
198
+ },
199
+ not: { required: ['presentationDefinition'] },
200
+ },
201
+ ],
202
+ };
203
+
204
+ module.exports = newIssuerServiceSchema;