@kwirthmagnify/kwirth-provider-http-pull-push 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/back.js +12 -0
  2. package/package.json +1 -1
package/back.js CHANGED
@@ -331,6 +331,17 @@ var HttpPullPushProvider = class {
331
331
  this.configRouter = import_express.default.Router();
332
332
  this.configs = /* @__PURE__ */ new Map();
333
333
  this.subscribers = /* @__PURE__ */ new Map();
334
+ /*
335
+ Lo que este provider sabe de si mismo: cuantos consumidores tiene AHORA. El contrato
336
+ (IProvider.getStats, opcional desde kwirth-common-back 0.5.50) pide que sea BARATO — se devuelve
337
+ lo que ya se tiene, no se calcula —, y de aqui sale que kwirth pueda decir si esto esta siendo
338
+ consumido o emitiendo para nadie.
339
+ */
340
+ /*
341
+ Entregas desde que arranco: una por llamada a un suscriptor. Filtra por configuracion antes de entregar.
342
+ */
343
+ this.deliveries = 0;
344
+ this.getStats = () => ({ subscribers: this.subscribers.size, events: this.deliveries });
334
345
  this.pollers = /* @__PURE__ */ new Map();
335
346
  this.started = false;
336
347
  // ── IProvider ───────────────────────────────────────────────────────────────
@@ -577,6 +588,7 @@ Gotchas:
577
588
  for (const [subscriber, entry] of this.subscribers) {
578
589
  if (entry.configs !== void 0 && !entry.configs.has(event.config)) continue;
579
590
  try {
591
+ this.deliveries++;
580
592
  subscriber.processProviderEvent(this.id, event);
581
593
  } catch (err) {
582
594
  console.error(`[http-pull-push] Subscriber failed processing '${event.config}': ${err}`);
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "id": "http-pull-push",
8
8
  "name": "@kwirthmagnify/kwirth-provider-http-pull-push",
9
9
  "displayName": "HTTP Pull-Push Provider",
10
- "version": "0.1.3",
10
+ "version": "0.1.5",
11
11
  "description": "HTTP polling provider for Kwirth — pulls remote HTTP endpoints on a schedule and pushes each result to the subscribed channels",
12
12
  "website": "https://kwirthmagnify.dev",
13
13
  "requiresRestart": true,