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

@omichalo/ffttapi-node

v0.0.9

Published

🏓 API Node.js/TypeScript pour la FFTT (FĂ©dĂ©ration Française de Tennis de Table) - Consommateur de l'API officielle Smartping 2.0

Downloads

136

Readme

🏓 FFTT API - Node.js/TypeScript

npm version License: MIT TypeScript Node.js Tests

FFTT API permet de consommer facilement l'API officielle Smartping 2.0 de la Fédération Française de Tennis de Table en utilisant Node.js et TypeScript.

✹ FonctionnalitĂ©s

🏱 Gestion des Clubs et Organismes

  • Liste des organismes par type
  • Liste des clubs par dĂ©partement
  • Liste des clubs par nom
  • DĂ©tail complet d'un club
  • Divisions par Ă©preuve

đŸ‘€ Gestion des Joueurs

  • Recherche de joueurs par nom/prĂ©nom
  • DĂ©tail complet d'un joueur par licence
  • Classement d'un joueur
  • Historique des parties
  • Points virtuels et classement

🏆 Gestion des CompĂ©titions

  • Liste des Ă©preuves par organisme
  • RĂ©sultats individuels par division
  • Classement critĂ©rium
  • Gestion des Ă©quipes et poules
  • DĂ©tail des rencontres

🔐 Authentification et SĂ©curitĂ©

  • Authentification MD5 + HMAC-SHA1
  • Gestion des timestamps FFTT
  • Validation des rĂ©ponses API
  • Gestion des erreurs robuste

🚀 Installation

Avec npm

npm install @omichalo/ffttapi-node

Avec yarn

yarn add @omichalo/ffttapi-node

📋 Configuration

1. Créez un fichier .env à la racine de votre projet :

cp env.example .env

2. Configurez vos identifiants FFTT :

FFTT_TEST_ID=your_fftt_id_here
FFTT_TEST_PASSWORD=your_fftt_password_here

⚠ Important : Vous devez obtenir vos identifiants auprĂšs de la FFTT pour accĂ©der Ă  l'API officielle.

đŸ’» Exemples d'utilisation

🔐 Initialisation et Authentification

import { FFTTAPI } from "@omichalo/ffttapi-node";

// Initialisation de l'API
const api = new FFTTAPI("identifiant", "password");

// Authentification
try {
  const result = await api.initialize();
  console.log("✅ API initialisĂ©e avec succĂšs");
} catch (error) {
  console.error("❌ Erreur d'authentification:", error);
}

🏱 Gestion des Clubs

// Récupération des détails d'un club
const clubDetails = await api.getClubDetails("75010001");
console.log("Club:", clubDetails.nom, "Ă ", clubDetails.ville);

// Recherche de clubs par nom
const clubs = await api.getClubsByName("TENNIS");
clubs.forEach(club => console.log(`- ${club.nom} (${club.numero})`));

đŸ‘€ Gestion des Joueurs

// Recherche de joueurs par nom
const joueurs = await api.getJoueursByNom("DUPONT");
joueurs.forEach(joueur => {
  console.log(`${joueur.nom} ${joueur.prenom} - Licence: ${joueur.licence}`);
});

// Détail d'un joueur par licence
const joueur = await api.getJoueurDetailsByLicence("1234567");
console.log("Points:", joueur.points, "Classement:", joueur.classement);

🏆 Gestion des CompĂ©titions

// Liste des épreuves
const epreuves = await api.getEpreuves(75, "E"); // Organisme 75, type Équipes
epreuves.forEach(epreuve => {
  console.log(`${epreuve.libelle} (ID: ${epreuve.id})`);
});

// Résultats individuels
const resultats = await api.getResultatsIndividuels(257, 7501, "poule");
console.log(`${resultats.length} résultats trouvés`);

// Classement critérium
const classements = await api.getClassementCriterium();
classements.slice(0, 5).forEach((clt, index) => {
  console.log(`${index + 1}. ${clt.nom} - ${clt.points} pts`);
});

đŸ§Ș Tests

Tests Unitaires

# Tests avec couverture complĂšte
npm test

# Tests en mode watch
npm run test:watch

# Tests pour CI/CD
npm run test:ci

Tests d'Intégration

# Tests avec l'API FFTT réelle
npm run test:integration:real

# Tests d'intégration en mode watch
npm run test:integration:watch

📩 Scripts disponibles

  • npm run build - Compilation TypeScript
  • npm test - ExĂ©cution des tests avec couverture
  • npm run test:watch - Tests en mode watch
  • npm run test:ci - Tests pour l'intĂ©gration continue
  • npm run test:integration - Tests d'intĂ©gration
  • npm run lint - VĂ©rification du code avec ESLint
  • npm run format - Formatage du code avec Prettier

đŸ—ïž Architecture

source/
├── Core/
│   ├── FFTTAPI.ts              # Classe principale de l'API
│   └── ApiRequest.ts           # Gestion des requĂȘtes HTTP
├── Models/
│   ├── FFTTInterfaces.ts       # Interfaces TypeScript
│   └── ResponseData.interface.ts
├── Services/
│   ├── Utils.service.ts        # Utilitaires
│   └── RencontreDetailsFactory.service.ts
└── Tests/
    ├── Core/                   # Tests des fonctionnalitĂ©s principales
    ├── Integration/            # Tests d'intĂ©gration
    ├── Models/                 # Tests des modùles
    └── Services/               # Tests des services

🔧 Configuration TypeScript

Le package inclut des définitions TypeScript complÚtes pour une expérience de développement optimale :

// Types fortement typés pour toutes les réponses API
interface ClubDetails {
  idClub: string;
  nom: string;
  numero: string;
  ville: string;
  // ... autres propriétés
}

interface JoueurDetails {
  nom: string;
  prenom: string;
  licence: string;
  points: number;
  // ... autres propriétés
}

📚 Documentation

đŸ€ Contribution

Les contributions sont les bienvenues ! N'hésitez pas à :

  1. Fork le projet
  2. Créer une branche feature (git checkout -b feature/AmazingFeature)
  3. Commit vos changements (git commit -m 'Add some AmazingFeature')
  4. Push vers la branche (git push origin feature/AmazingFeature)
  5. Ouvrir une Pull Request

📄 Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.

🙏 Remerciements

  • FFTT pour l'API officielle Smartping 2.0
  • StephSako pour le projet original
  • CommunautĂ© TypeScript/Node.js pour les outils et bibliothĂšques

📞 Support


🏓 DĂ©veloppĂ© avec ❀ pour la communautĂ© du tennis de table français !