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

@creezio/automations

v0.26.1

Published

Lifecycle automations ONLY (plugins/org/factory/obs) — V3 prototype ≠ Database row-level (@creezio/database)

Readme

@creezio/automations

Rôle

@creezio/automations est le moteur d'automations lifecycle-only du kit Creezio. Il reagit aux evenements de cycle de vie plugin.*, org.*, factory.* et observability.*.

Important : ce package n'est pas le moteur Admin Database row-level. Les automations declenchees par insert/update/delete SQLite vivent dans @creezio/database.

Périmètre

Inclus :

  • definition des triggers lifecycle (plugin.installed, factory.materialized, etc.) ;
  • moteur en memoire avec persistance SQLite facultative ;
  • execution d'actions emit_observability, log, webhook, n8n_tag_hint ;
  • mount API /api/v1/platform/automations/... pour lister, creer, supprimer et dispatcher ;
  • regles sandbox defaultDemobrandAutomationRules().

Hors perimetre :

  • CRUD Admin Database, triggers SQLite row-level, vues sauvegardees ;
  • orchestration cloud, retry durable de webhooks, ACL metier marque ;
  • ecriture directe dans les repos marques.

Installation/build

npm install
npm run build -w @creezio/automations
npm run typecheck -w @creezio/automations

Le package publie dist et dist-cjs. L'entree ESM/CJS est @creezio/automations.

Configuration

Le moteur accepte des adapters injectes au boot :

import {
  createAutomationEngine,
  createSqliteAutomationPersist,
} from "@creezio/automations";

const persist = createSqliteAutomationPersist({
  coreDbPath: "/path/to/core.db",
});

const engine = createAutomationEngine({
  persist,
  defaultWebhookUrl: process.env.N8N_AUTOMATION_WEBHOOK_URL,
  n8nTagPrefix: "mybrand-plugin:",
  emitObservability: (event) => observability.record(event),
  postWebhook: (url, body) => fetch(url, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(body),
  }).then((res) => ({ ok: res.ok, status: res.status })),
  log: (level, message, meta) => logger[level](message, meta),
});

Sans persist, les regles sont chargees vides et les runs restent en memoire. Avec persist, le schema AUTOMATIONS_CORE_SQL cree creezio_automation_rules et creezio_automation_runs.

API publique + exemples

Exports principaux :

  • types : AutomationRule, AutomationTriggerEvent, AutomationAction, AutomationRunResult, AutomationEngineAdapters ;
  • constantes : AUTOMATION_TRIGGER_TYPES, AUTOMATION_ACTION_TYPES, AUTOMATIONS_CORE_SQL ;
  • fonctions : createAutomationEngine, defaultDemobrandAutomationRules, ruleMatches, createAutomationsApiMount, createSqliteAutomationPersist.

Creer et dispatcher une regle :

import { createAutomationEngine } from "@creezio/automations";

const engine = createAutomationEngine({
  log: (level, message) => console[level](message),
});

engine.addRule({
  name: "Notifier installation plugin",
  enabled: true,
  trigger: "plugin.installed",
  filter: { dataLayer: "plugin" },
  actions: [
    { type: "log", message: "Plugin installe" },
    { type: "n8n_tag_hint" },
  ],
});

const results = await engine.dispatch({
  type: "plugin.installed",
  brandId: "demobrand",
  orgId: "org_1",
  pluginId: "crm-helper",
  dataLayer: "plugin",
});

Monter l'API :

import { createAutomationsApiMount } from "@creezio/automations";

apiKernel.mount("/api/v1/platform/automations", createAutomationsApiMount(engine));

Routes exposees par le mount :

  • GET rules ou GET "" ;
  • POST rules ;
  • DELETE rules/:id ;
  • POST dispatch ;
  • GET runs?limit=50.

Flux

  1. Une marque cree le moteur et injecte les adapters.
  2. Les regles sont chargees depuis la persistance optionnelle.
  3. Un evenement lifecycle est dispatché.
  4. ruleMatches filtre par trigger, pluginId, orgId et dataLayer.
  5. Les actions s'executent sequentiellement.
  6. Le run est conserve en memoire et, si configure, append dans SQLite.

Les actions webhook sans URL ou sans adapter postWebhook sont considerees comme sautees, pas comme fatales.

Intégration marques

La marque fournit :

  • un prefixe n8n (n8nTagPrefix) coherent avec Product Hub ;
  • les bridges observability et webhook ;
  • le chemin de DB core si la persistance est souhaitee ;
  • le montage API via @creezio/api-kernel.

Ne pas importer de modules verticaux metier depuis ce package. Les informations marque doivent arriver par adapters.

Dépendances

  • @creezio/api-kernel pour ApiMount ;
  • @creezio/platform-core pour l'ouverture SQLite Node ;
  • @creezio/product-hub pour pluginN8nTag ;
  • @creezio/observability comme surface d'integration attendue cote adapter.

Voir aussi

  • AGENTS.md
  • docs/FILES.md
  • @creezio/database pour les automations row-level Admin Database