npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@red-isbe/did-isbe-resolver

v1.4.4

Published

Resolver de did:isbe en TypeScript integrable por software de terceros

Downloads

864

Readme

did-isbe-resolver

Librería TypeScript para resolver DIDs del método did:isbe mediante la API pública del Registro ISBE.
Proporciona una interfaz simple basada en dos funciones:

import { resolve, getResolver } from "did-isbe-resolver";
  • resolve() > resolución directa (actual o histórica)
  • getResolver() > objeto preconfigurado con resolve() incorporado

No depende del resolutor DID universal (did-resolver). No requiere estructuras W3C. Es un cliente directo, ligero y rápido sobre la API REST ISBE.


Características

  • Resolución de DIDs ISBE actuales.

  • Resolución histórica por timestamp.

  • Soporte para formatos:

    • "jwk" (JSON Web Key)
    • "hex" (hexadecimal)
  • Soporte para JSON-LD (con @context) o JSON plano (sin @context).

  • Función resolve() configurable por llamada.

  • Función getResolver() que permite crear un resolver preconfigurado.

  • API muy simple y directa.


Instalación

npm install did-isbe-resolver

Uso básico con resolve()

import { resolve } from "did-isbe-resolver";
 
const doc = await resolve("did:isbe:network:123456", {
  apiBaseUrl: "https://example.com/api/v1",
  pubKeyFormat: "jwk",
  withContext: true
});

Ejemplos avanzados

Este example muestra cuatro combinaciones clave:

  1. resolve() > JWK + contexto + timestamp
  2. resolve() > HEX – contexto
  3. getResolver() > JWK – contexto
  4. getResolver() > HEX + contexto + timestamp
import { resolve, getResolver } from "did-isbe-resolver";
 
const API = "http://localhost:3000/api/v1";
const DID = "did:isbe:usecase-demo-07:0020ab4dbe88d839e341e25fe972d444ef4e9196";
const TIMESTAMP = Math.floor(Date.now() / 1000);
 
async function main() {
  // 1. resolve() > JWK + contexto + timestamp
  const r1 = await resolve(DID, {
    apiBaseUrl: API,
    pubKeyFormat: "jwk",
    withContext: true,
    timestamp: TIMESTAMP,
  });
 
  // 2. resolve() > HEX - contexto
  const r2 = await resolve(DID, {
    apiBaseUrl: API,
    pubKeyFormat: "hex",
    withContext: false,
  });
 
  // 3. getResolver() > JWK - contexto
  const resolverA = getResolver({
    apiBaseUrl: API,
    pubKeyFormat: "jwk",
    withContext: false,
  });
  const r3 = await resolverA.resolve(DID);
 
  // 4. getResolver() > HEX + contexto + timestamp
  const resolverB = getResolver({
    apiBaseUrl: API,
    pubKeyFormat: "hex",
    withContext: true,
    timestamp: TIMESTAMP,
  });
  const r4 = await resolverB.resolve(DID);
 
  console.log(r1, r2, r3, r4);
}
 
main();

Resolver

resolve(did, options)

| campo | tipo | requerido | descripción | | -------------- | --------------------- | --------- | ------------------------------------ | | apiBaseUrl | string | sí | URL base de ISBE-IDENTITY-DID-API | | pubKeyFormat | "jwk" \| "hex" | opcional | Formato de claves públicas | | withContext | boolean | opcional | Incluir @context en el documento | | timestamp | number \| undefined | opcional | Si se incluye > resolución histórica |

Ejemplo:

await resolve(did, {
  apiBaseUrl: API,
  timestamp: 1700000000,
  pubKeyFormat: "hex",
  withContext: false
});

getResolver(options)

Crea un resolver preconfigurado:

const r = getResolver({
  apiBaseUrl: API,
  pubKeyFormat: "jwk",
  withContext: true
});
 
const doc = await r.resolve(did);

Estructura del paquete

index.ts
src/
  isbeResolver.ts
  DidRegistryResolver.ts
  DidRegistryResolverConfig.ts
example.ts

Componentes principales

  • example.ts: Script de ejemplo ejecutable.
  • Pruebas unitarias: src/__test__/DidRegistryResolver.test.ts, src/__test__/DidRegistryResolverConfig.test.ts
  • Documentación: ISBE-ART-00001.md, README.md

Instalación

npm install

Pruebas

Las pruebas unitarias están implementadas con Jest. Ejecuta los tests con:

npm test

Documentación técnica

Consulta el documento ISBE-ART-00001.md para información detallada sobre arquitectura, reglas de negocio, ejemplos de código y criterios de validación.


Frameworks y dependencias

  • TypeScript (v5.9.2)
  • Node.js (v18 o superior recomendado; no compatible con versiones anteriores a la 16)
  • Axios (v1.6.7)
  • Jest (v29.x, para tests)

Copyright © 2025 Comunidad de Madrid & Alastria