@verii/common-fetchers 1.1.0-pre.1762297666 → 1.1.0-pre.1762411615

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.1762297666",
3
+ "version": "1.1.0-pre.1762411615",
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": "59df273cfec3582c963d9c0f6883965649d39ebd"
39
+ "gitHead": "17ec78f18fc30282fe1de5579edde0f7598ebb5f"
40
40
  }
package/src/fetch-json.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const fetchJson = async (link, { fetch }) => {
2
2
  const response = await fetch.get(link, {});
3
-
4
3
  return response.json();
5
4
  };
6
5
 
@@ -14,11 +14,16 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const getCredentialDisplayDescriptor = (schemaName, { libFetch, cache }) =>
18
- libFetch
19
- .get(`display-descriptors/${schemaName}.descriptor.json`, { cache })
20
- .json();
21
- // registrarFetch.get('api/v0.6/credential-type-descriptors/{credentialType}').json();
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 = (credentialTypes, { registrarFetch, cache }) =>
20
- registrarFetch
21
- .get('api/v0.6/schemas/get-uri', {
22
- searchParams: new URLSearchParams(
23
- flow(
24
- uniq,
25
- map((type) => ['credentialTypes', type])
26
- )(credentialTypes)
27
- ),
28
- cache,
29
- })
30
- .json();
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
- .get(`api/v0.6/resolve-kid/${encodeURIComponent(kid)}?format=jwk`)
20
- .json();
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,