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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oesp/all

v8.0.0

Published

Meta-package including all OESP TypeScript SDK modules

Readme

@oesp/all

Meta-package officiel regroupant l'intégralité du SDK OESP (Open Entrust & Sync Protocol) pour TypeScript.

Ce package est conçu pour offrir une expérience "tout-en-un", incluant le cœur du protocole, les implémentations cryptographiques, ainsi que les modules de transport (BLE) et de synchronisation asynchrone (HTTP).

Sommaire


Installation

npm install @oesp/all

Modules Inclus

En installant @oesp/all, vous accédez aux modules suivants :

  • @oesp/core : Logique cœur (agnostique) pour le packaging des données.
  • @oesp/crypto-sodium : Fournisseur cryptographique utilisant libsodium.
  • @oesp/transport-ble-gatt : Gestion du transport P2P via Bluetooth Low Energy.
  • @oesp/sync-http : Client asynchrone pour la synchronisation avec un serveur cloud.
  • @oesp/storage-memory : Gestionnaire de rejeu (anti-replay) en mémoire.

Tutoriel Complet : De l'Identité au Transfert

1. Initialisation

La première étape consiste à configurer votre client avec ses dépendances (Crypto, KeyStore, Storage).

import { 
  OESPClient, 
  createSodiumCryptoProvider, 
  MemoryReplayStore, 
  Identity 
} from '@oesp/all';

// 1. Initialiser le moteur de calcul (libsodium)
const crypto = await createSodiumCryptoProvider();

// 2. Créer un store pour éviter les attaques par rejeu
const replay = new MemoryReplayStore();

// 3. Définir un KeyStore (ici simplifié pour l'exemple)
const keystore = {
  getOrCreateIdentity: async () => ({
    ed25519Priv: new Uint8Array(64), // Votre clé privée persistée
    ed25519Pub: new Uint8Array(32),
    x25519Priv: new Uint8Array(32),
    x25519Pub: new Uint8Array(32),
  })
};

// 4. Créer le client OESP
const client = new OESPClient({ crypto, keystore, replay });

// Obtenir votre identifiant unique (DID)
const myDid = await client.getDid();
console.log(`Mon identité OESP : ${myDid}`);

2. Création du Message (Pack)

Chiffrez et signez une donnée pour un destinataire spécifique.

const recipientDid = "did:oesp:target-device-uuid";
const data = { temperature: 22.5, status: "ok" };

// Génère un token OESP1 sécurisé (chiffré pour le destinataire, signé par vous)
const token = await client.pack(recipientDid, data);
console.log("Token généré :", token);

3. Transfert Physique (Transport BLE)

Utilisez le transport Bluetooth pour envoyer le token à un appareil à proximité, même sans internet.

import { OESPBleGattTransport } from '@oesp/all';

// Initialiser le transport (nécessite une fonction de hashage pour les acquittements)
const transport = new OESPBleGattTransport({
  sha256: (data) => crypto.sha256(data)
});

// 'link' doit être une implémentation de l'interface BleGattLink adaptée à votre plateforme 
// (ex: Web Bluetooth, react-native-ble-plx)
await transport.sendToken(token, link);
console.log("Token envoyé via Bluetooth !");

4. Synchronisation Cloud (Async HTTP)

Si vous avez une connexion internet, vous pouvez synchroniser vos données avec un serveur central de manière asynchrone.

import { OESPSyncClient } from '@oesp/all';

const syncClient = new OESPSyncClient({
  baseUrl: "https://api.votre-serveur-oesp.com",
  sha256: async (data) => crypto.sha256(data)
});

// Envoi asynchrone de plusieurs tokens au serveur
const result = await syncClient.syncTokens([token], myDid);

if (result.success) {
  console.log(`Synchronisation réussie. Session ID: ${result.sessionId}`);
}

5. Réception et Lecture (Unpack)

À la réception d'un token (via BLE ou Sync), vérifiez sa provenance et déchiffrez-le.

try {
  const decoded = await client.unpack(receivedToken);
  
  console.log(`Message reçu de : ${decoded.fromDid}`);
  console.log(`Contenu :`, decoded.plaintext); // { temperature: 22.5, ... }
} catch (e) {
  console.error("Échec de la vérification ou du déchiffrement", e);
}

Support et Documentation

Pour plus de détails sur chaque module, consultez les dossiers individuels du dépôt :

Licence MIT.