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

@geomatika/isigeo_http_api

v1.0.0

Published

Client HTTP API pour Isigeo

Readme

@geomatika/isigeo_http_api

SDK JavaScript/TypeScript pour communiquer avec les API Isigéo (authentification + accès aux données). Compatible navigateur, Node.js, et Cordova.

🚀 Installation Depuis npm npm install @geomatika/isigeo_http_api

Depuis une source locale (avant publication)

cd web/isigeo_http_api
npm run build
npm link
cd /path/to/your/project
npm link @geomatika/isigeo_http_api

⚙️ Formats disponibles Le SDK est livré sous plusieurs formats pour s’adapter à tous les contextes : FormatFichierUsage typiqueESMdist/isigeo_http_api.es.jsApplications Vite / Web modernesCJSdist/isigeo_http_api.cjs.jsNode.js ou outils CommonJSIIFEdist/isigeo_http_api.iife.jsCordova ou HTML classique (window.IsigeoHttpApi)

✨ Fonctionnalités

Authentification :

Par username/password

Par token permanent

Gestion automatique du JWT

Accès aux données (CRUD) :

Lecture (getData) avec pagination (page, limit, offset), colonnes (fields), filtres (eq., like., in. …), Geo-Format (geojson / wkt) et Geo-SRID

Création (createData, POST)

Mise à jour (updateData, PUT) avec filtre

Suppression (deleteData, DELETE) avec filtre

Compatible :

Navigateur / Cordova (WebView)

Node.js 18+

TypeScript

🧩 Utilisation Exemple complet (ESM) import { IsigeoApi } from "@geomatika/isigeo_http_api";

const api = new IsigeoApi({ baseUrl: "https://deploiement.geomatika.fr", version: 1, });

const { token } = await api.auth.authWithPassword("admin", "••••••");

const supports = await api.data.getData(token, "ep_support", { page: 1, geoFormat: "geojson", });

console.log("Résultats:", supports);

Authentification const { token, expires } = await api.auth.authWithPassword("admin", "-----"); console.log("JWT:", token); console.log("Expire:", new Date(expires * 1000).toLocaleString());

Ou via token permanent : const { token } = await api.auth.authWithToken("TOKEN_PERMANENT_GENERÉ_PAR_ISIGEO");

Requêtes data Pagination const rows = await api.data.getData(token, "ep_support", { page: 1, geoFormat: "geojson" });

Limit / Offset const rows = await api.data.getData(token, "ep_support", { limit: 10, offset: 0 });

Colonnes spécifiques const rows = await api.data.getData(token, "chiffrage_client_travaux", { columns: ["date_obs", "photo1", "photo2", "typ_desor", "obs"] });

Filtres const rows = await api.data.getData(token, "support", { filter: { idsup: "eq.18294" } });

SRID / Format const rows = await api.data.getData(token, "ep_support", { geoFormat: "wkt", geoSrid: 2154 });

Création (POST)

const created = await api.data.createData(token, "support", {
  ref_support: "SUP-001",
  nature_du_support: "Candélabres",
  idnature_du_support: "5",
});

Mise à jour (PUT)

await api.data.updateData(
  token,
  "support",
  { nature_du_support: "Poteau bois", idnature_du_support: "2" },
  { filter: { idsup: "eq.18294" } }
);

Suppression (DELETE)

const res = await api.data.deleteData(token, "support", {
  filter: { idsup: "eq.18294" },
});
// { status: 200, message: "Deleted ( support.18294 )" }

Format de réponse (lecture) Les appels getData retournent l'enveloppe renvoyée par le serveur :

{ "metadata": { "total": 1, "sent": 1, "range": { "start": 1, "end": 1 } }, "data": [ /* lignes */ ] }

📱 Utilisation dans Cordova 1️⃣ Ajouter au npmFileToImport.json { "@geomatika/isigeo_http_api": [ { "from": ["dist", "isigeo_http_api.iife.js"], "to": ["js", "extras", "isigeo", "isigeo-http-api.js"] } ] }

2️⃣ Inclure dans index.html

✅ window.IsigeoHttpApi est automatiquement défini par le bundle IIFE.

🧠 Types TypeScript Les méthodes sont typées. Tu peux typer les retours pour tes données : interface Support { idsup: number; geom: any; }

const rows = await api.data.getData<Support[]>(token, "support", { page: 1 });

🧪 Tests

Tests unitaires (mock fetch, pas de réseau) :

npm test

Tests d'intégration (round-trip réel insert → get → update → get → delete → get contre une instance Isigéo). Skippés automatiquement si les variables ci-dessous ne sont pas définies :

ISIGEO_TEST_URL="https://deploiement.geomatika.fr/dev6" \
ISIGEO_TEST_USER="monuser" \
ISIGEO_TEST_PASSWORD="monpass" \
ISIGEO_TEST_TABLE="support" \
npm run test:integration

ISIGEO_TEST_TABLE est optionnel (défaut : support). L'utilisateur doit avoir les droits POST/PUT/DELETE sur la table — chaque run crée puis supprime une ligne marquée ref_support = "npmtest-<timestamp>".

🛠️ Build local

Compilation TS + bundle Vite

npm run build

Produira : dist/ ├── isigeo_http_api.cjs.js ├── isigeo_http_api.es.js ├── isigeo_http_api.iife.js └── index.d.ts

🔧 Config build (vite.config.ts) import { defineConfig } from "vite";

export default defineConfig({ build: { lib: { entry: "src/index.ts", name: "IsigeoHttpApi", fileName: (format) => format === "iife" ? "isigeo_http_api.iife" : format === "es" ? "isigeo_http_api.es" : "isigeo_http_api.cjs", formats: ["es", "cjs", "iife"] }, minify: true } });

📦 Publication npm npm login npm version patch npm publish --access public

Vérifie le contenu publié npm pack

🧩 Exemple d’intégration dans Vite + Cordova // src/lib/isigeo.ts import { IsigeoApi } from "@geomatika/isigeo_http_api";

export const isigeo = new IsigeoApi({ baseUrl: import.meta.env.VITE_ISIGEO_URL, version: Number(import.meta.env.VITE_ISIGEO_VERSION ?? 1), });