@velocitycareerlabs/server-webwallet 1.25.0-qa-build.1c54781f2 → 1.25.0-qa-build.17c026990
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/package.json +15 -15
- package/src/controllers/credentials/controller.js +12 -1
- package/src/controllers/disclosures/schemas/webwallet-accept-presentation-request-body.schema.js +1 -1
- package/src/controllers/issuing/deep-link/controller.js +9 -1
- package/src/controllers/issuing/identity-credentials/controller.js +8 -2
- package/src/entities/credentials/domains/offer-to-credential-mongo-dto.js +6 -29
- package/src/entities/credentials/schemas/webwallet-credential-response.schema.js +1 -0
- package/src/entities/credentials/schemas/webwallet-credentials-response.schemas.js +0 -95
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@velocitycareerlabs/server-webwallet",
|
3
|
-
"version": "1.25.0-qa-build.
|
3
|
+
"version": "1.25.0-qa-build.17c026990",
|
4
4
|
"description": "Web Wallet application",
|
5
5
|
"repository": "https://github.com/velocitycareerlabs/packages",
|
6
6
|
"engines": {
|
@@ -33,17 +33,17 @@
|
|
33
33
|
"@fastify/swagger": "^9.0.0",
|
34
34
|
"@fastify/swagger-ui": "^5.0.0",
|
35
35
|
"@spencejs/spence-mongo-repos": "^0.10.2",
|
36
|
-
"@velocitycareerlabs/auth": "1.26.0
|
37
|
-
"@velocitycareerlabs/common-functions": "1.26.0
|
38
|
-
"@velocitycareerlabs/common-schemas": "1.26.0
|
39
|
-
"@velocitycareerlabs/config": "1.26.0
|
40
|
-
"@velocitycareerlabs/fastify-plugins": "1.26.0
|
41
|
-
"@velocitycareerlabs/jwt": "1.26.0
|
42
|
-
"@velocitycareerlabs/migrations": "1.25.0-qa-build.
|
43
|
-
"@velocitycareerlabs/request": "1.26.0
|
44
|
-
"@velocitycareerlabs/server-provider": "1.26.0
|
45
|
-
"@velocitycareerlabs/vc-checks": "1.26.0
|
46
|
-
"@velocitycareerlabs/vnf-nodejs-wallet-sdk": "1.26.0
|
36
|
+
"@velocitycareerlabs/auth": "^1.26.0",
|
37
|
+
"@velocitycareerlabs/common-functions": "^1.26.0",
|
38
|
+
"@velocitycareerlabs/common-schemas": "^1.26.0",
|
39
|
+
"@velocitycareerlabs/config": "^1.26.0",
|
40
|
+
"@velocitycareerlabs/fastify-plugins": "^1.26.0",
|
41
|
+
"@velocitycareerlabs/jwt": "^1.26.0",
|
42
|
+
"@velocitycareerlabs/migrations": "1.25.0-qa-build.17c026990",
|
43
|
+
"@velocitycareerlabs/request": "^1.26.0",
|
44
|
+
"@velocitycareerlabs/server-provider": "^1.26.0",
|
45
|
+
"@velocitycareerlabs/vc-checks": "^1.26.0",
|
46
|
+
"@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^1.26.0",
|
47
47
|
"blueimp-md5": "2.19.0",
|
48
48
|
"env-var": "^7.0.0",
|
49
49
|
"fastify": "^5.0.0",
|
@@ -56,8 +56,8 @@
|
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
58
58
|
"@spencejs/spence-factories": "0.10.2",
|
59
|
-
"@velocitycareerlabs/crypto": "1.26.0
|
60
|
-
"@velocitycareerlabs/tests-helpers": "1.26.0
|
59
|
+
"@velocitycareerlabs/crypto": "^1.26.0",
|
60
|
+
"@velocitycareerlabs/tests-helpers": "^1.26.0",
|
61
61
|
"dotenv": "16.4.7",
|
62
62
|
"eslint": "8.57.1",
|
63
63
|
"eslint-config-airbnb-base": "14.2.1",
|
@@ -73,5 +73,5 @@
|
|
73
73
|
"nodemon": "3.1.10",
|
74
74
|
"prettier": "2.8.8"
|
75
75
|
},
|
76
|
-
"gitHead": "
|
76
|
+
"gitHead": "d909943878a953ad32529ad076903b66b2e4fdee"
|
77
77
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
const newError = require('http-errors');
|
2
|
+
const { omit, map } = require('lodash/fp');
|
2
3
|
const { loadAdditionalRenderInfo } = require('../../entities');
|
3
4
|
const { getCredentialCategories } = require('../../fetchers');
|
4
5
|
|
@@ -21,6 +22,7 @@ const credentialsController = async (fastify) => {
|
|
21
22
|
|
22
23
|
const credentials = await repos.credentials.find({
|
23
24
|
filter: { auth0UserId: req.user.sub },
|
25
|
+
projection: null,
|
24
26
|
});
|
25
27
|
|
26
28
|
const additionalRenderInfo = await loadAdditionalRenderInfo(
|
@@ -28,7 +30,16 @@ const credentialsController = async (fastify) => {
|
|
28
30
|
req
|
29
31
|
);
|
30
32
|
|
31
|
-
return {
|
33
|
+
return {
|
34
|
+
credentials: map(
|
35
|
+
(credential) => ({
|
36
|
+
...omit(['_id'], credential),
|
37
|
+
id: credential._id,
|
38
|
+
}),
|
39
|
+
credentials
|
40
|
+
),
|
41
|
+
...additionalRenderInfo,
|
42
|
+
};
|
32
43
|
}
|
33
44
|
);
|
34
45
|
|
package/src/controllers/disclosures/schemas/webwallet-accept-presentation-request-body.schema.js
CHANGED
@@ -18,7 +18,7 @@ const webWalletAcceptPresentationRequestBodySchema = {
|
|
18
18
|
},
|
19
19
|
minItems: 1,
|
20
20
|
},
|
21
|
-
type: { type: 'string', enum: ['public', 'linkedin'] },
|
21
|
+
type: { type: 'string', enum: ['public', 'linkedin', 'inspection'] },
|
22
22
|
},
|
23
23
|
required: ['link', 'credentials'],
|
24
24
|
};
|
@@ -9,6 +9,7 @@ const {
|
|
9
9
|
VCLVerifiedProfile,
|
10
10
|
VCLDidJwk,
|
11
11
|
} = require('@velocitycareerlabs/vnf-nodejs-wallet-sdk');
|
12
|
+
const { omit, map } = require('lodash/fp');
|
12
13
|
const {
|
13
14
|
loadAdditionalRenderInfo,
|
14
15
|
getCredentialsFromOffers,
|
@@ -174,7 +175,14 @@ const issuingController = async (fastify) => {
|
|
174
175
|
}
|
175
176
|
|
176
177
|
return {
|
177
|
-
passedCredentials:
|
178
|
+
passedCredentials:
|
179
|
+
map(
|
180
|
+
(credential) => ({
|
181
|
+
...omit(['_id'], credential),
|
182
|
+
id: credential._id,
|
183
|
+
}),
|
184
|
+
savedCredentials
|
185
|
+
) || [],
|
178
186
|
failedCredentials: verifiableCredentials.failedCredentials || [],
|
179
187
|
};
|
180
188
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
const newError = require('http-errors');
|
2
|
-
const { get } = require('lodash/fp');
|
2
|
+
const { get, omit, map } = require('lodash/fp');
|
3
3
|
const md5 = require('blueimp-md5');
|
4
4
|
const { jwtDecode } = require('@velocitycareerlabs/jwt');
|
5
5
|
|
@@ -161,7 +161,13 @@ const issueIdentityCredentialsController = async (fastify) => {
|
|
161
161
|
});
|
162
162
|
|
163
163
|
return {
|
164
|
-
credentials:
|
164
|
+
credentials: map(
|
165
|
+
(credential) => ({
|
166
|
+
...omit(['_id'], credential),
|
167
|
+
id: credential._id,
|
168
|
+
}),
|
169
|
+
savedCredentials
|
170
|
+
),
|
165
171
|
// trackingData is for Mixpanel tracking events
|
166
172
|
trackingData: { offers, disclosureId, issuerName },
|
167
173
|
};
|
@@ -1,37 +1,14 @@
|
|
1
|
+
const { omit } = require('lodash/fp');
|
2
|
+
|
1
3
|
const offerToCredentialMongoDTO = (auth0UserId, userDid, credential) => {
|
2
|
-
const {
|
3
|
-
vc: {
|
4
|
-
type,
|
5
|
-
id: did,
|
6
|
-
credentialStatus,
|
7
|
-
linkCodeCommitment,
|
8
|
-
issuer,
|
9
|
-
contentHash,
|
10
|
-
credentialSchema,
|
11
|
-
vnfProtocolVersion,
|
12
|
-
'@context': context,
|
13
|
-
credentialSubject,
|
14
|
-
relatedResource,
|
15
|
-
},
|
16
|
-
jti,
|
17
|
-
iss,
|
18
|
-
encodedCredential,
|
19
|
-
} = credential;
|
4
|
+
const { vc, jti, iss, encodedCredential } = credential;
|
20
5
|
|
21
6
|
return {
|
22
|
-
|
23
|
-
did,
|
7
|
+
...omit(['@context'], vc),
|
8
|
+
did: vc.id,
|
9
|
+
context: vc['@context'],
|
24
10
|
auth0UserId,
|
25
11
|
userDid,
|
26
|
-
credentialStatus,
|
27
|
-
linkCodeCommitment,
|
28
|
-
issuer,
|
29
|
-
relatedResource,
|
30
|
-
contentHash,
|
31
|
-
credentialSchema,
|
32
|
-
vnfProtocolVersion,
|
33
|
-
context,
|
34
|
-
credentialSubject,
|
35
12
|
jti,
|
36
13
|
iss,
|
37
14
|
encodedCredential,
|
@@ -1,95 +0,0 @@
|
|
1
|
-
const webWalletCredentialResponseSchema = {
|
2
|
-
$id: 'https://velocitycareerlabs.io/webwallet-credential-response.schema.json',
|
3
|
-
title: 'webwallet-credentials-response',
|
4
|
-
description: 'credentials response from webwallet',
|
5
|
-
type: 'object',
|
6
|
-
properties: {
|
7
|
-
type: {
|
8
|
-
type: 'array',
|
9
|
-
items: {
|
10
|
-
type: 'string',
|
11
|
-
},
|
12
|
-
},
|
13
|
-
did: {
|
14
|
-
type: 'string',
|
15
|
-
},
|
16
|
-
auth0UserId: {
|
17
|
-
type: 'string',
|
18
|
-
},
|
19
|
-
credentialStatus: {
|
20
|
-
type: 'object',
|
21
|
-
additionalProperties: true,
|
22
|
-
},
|
23
|
-
linkCodeCommitment: {
|
24
|
-
type: 'object',
|
25
|
-
additionalProperties: true,
|
26
|
-
},
|
27
|
-
issuer: {
|
28
|
-
type: 'object',
|
29
|
-
properties: {
|
30
|
-
id: {
|
31
|
-
type: 'string',
|
32
|
-
},
|
33
|
-
},
|
34
|
-
},
|
35
|
-
contentHash: {
|
36
|
-
type: 'object',
|
37
|
-
additionalProperties: true,
|
38
|
-
},
|
39
|
-
credentialSchema: {
|
40
|
-
type: 'object',
|
41
|
-
additionalProperties: true,
|
42
|
-
},
|
43
|
-
vnfProtocolVersion: {
|
44
|
-
type: 'number',
|
45
|
-
},
|
46
|
-
context: {
|
47
|
-
type: 'array',
|
48
|
-
items: {
|
49
|
-
type: 'string',
|
50
|
-
},
|
51
|
-
},
|
52
|
-
credentialSubject: {
|
53
|
-
type: 'object',
|
54
|
-
properties: {
|
55
|
-
hasCredential: {
|
56
|
-
type: 'object',
|
57
|
-
additionalProperties: true,
|
58
|
-
},
|
59
|
-
type: {
|
60
|
-
type: 'string',
|
61
|
-
},
|
62
|
-
'@context': {
|
63
|
-
type: 'array',
|
64
|
-
items: {
|
65
|
-
type: 'string',
|
66
|
-
},
|
67
|
-
},
|
68
|
-
},
|
69
|
-
additionalProperties: true,
|
70
|
-
},
|
71
|
-
jti: {
|
72
|
-
type: 'string',
|
73
|
-
},
|
74
|
-
iss: {
|
75
|
-
type: 'string',
|
76
|
-
},
|
77
|
-
createdAt: {
|
78
|
-
type: 'string',
|
79
|
-
},
|
80
|
-
updatedAt: {
|
81
|
-
type: 'string',
|
82
|
-
},
|
83
|
-
relatedResource: {
|
84
|
-
type: 'array',
|
85
|
-
items: {
|
86
|
-
type: 'object',
|
87
|
-
additionalProperties: true,
|
88
|
-
},
|
89
|
-
},
|
90
|
-
},
|
91
|
-
};
|
92
|
-
|
93
|
-
module.exports = {
|
94
|
-
webWalletCredentialResponseSchema,
|
95
|
-
};
|