@verii/common-fetchers 1.1.0-pre.1762324415 → 1.1.0-pre.1762939829
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verii/common-fetchers",
|
|
3
|
-
"version": "1.1.0-pre.
|
|
3
|
+
"version": "1.1.0-pre.1762939829",
|
|
4
4
|
"description": "Set of fetchers used by Velocity Network servers",
|
|
5
5
|
"repository": "https://github.com/LFDT-Verii/core",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"lib"
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "ded6dcc27c92b12b7c2c832cc42877318cf2282d"
|
|
40
40
|
}
|
package/src/fetch-json.js
CHANGED
|
@@ -14,11 +14,16 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const getCredentialDisplayDescriptor = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const getCredentialDisplayDescriptor = async (
|
|
18
|
+
schemaName,
|
|
19
|
+
{ libFetch, cache }
|
|
20
|
+
) => {
|
|
21
|
+
const response = await libFetch.get(
|
|
22
|
+
`display-descriptors/${schemaName}.descriptor.json`,
|
|
23
|
+
{ cache }
|
|
24
|
+
);
|
|
25
|
+
return response.json();
|
|
26
|
+
};
|
|
22
27
|
module.exports = {
|
|
23
28
|
getCredentialDisplayDescriptor,
|
|
24
29
|
};
|
|
@@ -16,17 +16,20 @@
|
|
|
16
16
|
|
|
17
17
|
const { flow, map, uniq } = require('lodash/fp');
|
|
18
18
|
|
|
19
|
-
const getCredentialSchemaUris = (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
const getCredentialSchemaUris = async (
|
|
20
|
+
credentialTypes,
|
|
21
|
+
{ registrarFetch, cache }
|
|
22
|
+
) => {
|
|
23
|
+
const response = await registrarFetch.get('api/v0.6/schemas/get-uri', {
|
|
24
|
+
searchParams: new URLSearchParams(
|
|
25
|
+
flow(
|
|
26
|
+
uniq,
|
|
27
|
+
map((type) => ['credentialTypes', type])
|
|
28
|
+
)(credentialTypes)
|
|
29
|
+
),
|
|
30
|
+
cache,
|
|
31
|
+
});
|
|
32
|
+
return response.json();
|
|
33
|
+
};
|
|
31
34
|
|
|
32
35
|
module.exports = { getCredentialSchemaUris };
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const resolveKid = ({ kid }, { registrarFetch }) =>
|
|
18
|
-
registrarFetch
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const resolveKid = async ({ kid }, { registrarFetch }) => {
|
|
18
|
+
const response = await registrarFetch.get(
|
|
19
|
+
`api/v0.6/resolve-kid/${encodeURIComponent(kid)}?format=jwk`
|
|
20
|
+
);
|
|
21
|
+
return response.json();
|
|
22
|
+
};
|
|
21
23
|
|
|
22
24
|
module.exports = {
|
|
23
25
|
resolveKid,
|