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

@slickteam/nestjs-warp10

v2.2.2

Published

Module for Warp10 with Nestjs

Readme

Slick NestJS Warp10

npm version License

Module NestJS pour intégrer facilement le client Warp 10 dans vos applications.

Installation

npm install @slickteam/nestjs-warp10
# ou
pnpm add @slickteam/nestjs-warp10

Configuration

Ajoutez les variables d'environnement suivantes :

| Variable | Description | Valeur par défaut | | ------------------------ | ------------------------------------ | ----------------------- | | WARP10_URL | URL du serveur Warp 10 | http://localhost:8080 | | WARP10_READ_TOKEN | Token de lecture | - | | WARP10_WRITE_TOKEN | Token d'écriture | - | | WARP10_HTTP_TIMEOUT | Timeout des requêtes HTTP (ms) | 5000 | | WARP10_BASE_CLASS_NAME | Préfixe pour les noms de classes GTS | fr.slickteam.wattson |

Exemple de fichier .env :

WARP10_URL=http://localhost:8080
WARP10_READ_TOKEN=your_read_token
WARP10_WRITE_TOKEN=your_write_token
WARP10_HTTP_TIMEOUT=5000
WARP10_BASE_CLASS_NAME=fr.slickteam.example

Utilisation

Import du module

import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { Warp10Module } from '@slickteam/nestjs-warp10';

@Module({
  imports: [ConfigModule.forRoot(), Warp10Module],
})
export class AppModule {}

Injection du service

import { Injectable } from '@nestjs/common';
import { DataPoint, GTS, Warp10Service } from '@slickteam/nestjs-warp10';

@Injectable()
export class MyService {
  constructor(private readonly warp10Service: Warp10Service) {}

  // Écrire des données
  async writeData(): Promise<void> {
    const dataPoint: DataPoint = {
      className: 'my.sensor.temperature',
      labels: { location: 'office' },
      value: 23.5,
      timestamp: Date.now() * 1000, // microsecondes
    };

    await this.warp10Service.update(undefined, [dataPoint]);
  }

  // Lire des données
  async readData(): Promise<GTS[]> {
    const result = await this.warp10Service.fetch(
      undefined, // utilise le token par défaut
      '~my.sensor.*', // classe (regex supportée)
      { location: 'office' },
      'now', // début
      -100, // 100 derniers points
    );
    return result.result;
  }

  // Exécuter du WarpScript
  async executeWarpScript(): Promise<any> {
    const script = `
      [ $rt 'my.sensor.temperature' { 'location' 'office' } NOW -100 ] FETCH
    `;
    return this.warp10Service.exec(script, true); // true = injecte les tokens
  }
}

API

Warp10Service

| Méthode | Description | | ------------------------- | -------------------------------------------------- | | fetch() | Récupère des GTS depuis Warp 10 | | update() | Écrit des DataPoints dans Warp 10 | | delete() | Supprime des données sur une plage de temps | | deleteByTimestamp() | Supprime des données à un timestamp précis | | meta() | Met à jour les métadonnées des GTS | | exec() | Exécute du WarpScript | | execWithGtsListResult() | Exécute du WarpScript et retourne une liste de GTS |

Accès direct au client Warp 10

Le client @senx/warp10 est exposé via warp10Service.w10 pour les cas d'usage avancés.

Exports

Modèles

  • DataPoint - Point de données à écrire
  • DataPointResult - Résultat de lecture
  • GTS - Geo Time Series
  • UpdatedWarp10Result - Résultat d'une opération d'écriture

Types (enums WarpScript)

  • BuckertizerWarp10Type - Fonctions de bucketization (mean, max, min, sum...)
  • MapperWarp10Type - Fonctions de mapping (abs, delta, rate...)
  • ReducerWarp10Type - Fonctions de réduction (mean, max, min, sum...)
  • TimeUnits - Unités de temps (US, MS, NS)

Dépendances

| Package | Version | | ---------------- | ---------- | | @nestjs/common | ^11.1.12 | | @nestjs/config | ^4.0.2 | | @senx/warp10 | ^2.0.3 |

Licence

Apache 2.0