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

@substrat-run/connector-planima

v0.2.44

Published

Substrat connector: Planima planned facility maintenance (Swedish). Reads a maintenance plan — facilities, buildings, components and actions — on a poll and lands it into a scope through the vertical's own operation. Auth is a static API token, so there i

Readme

@substrat-run/connector-planima

The Substrat connector for Planima — Swedish planned facility maintenance (underhållsplan). Reads a maintenance plan on a poll and lands it into a scope through the consuming vertical's own operation.

Full documentation: substrat.net/connectors/planima.

Not yet verified against a live account. Every claim here comes from Planima's published OpenAPI document and is held up by a mock that encodes the same reading — so mock and client can agree with each other while both disagree with Planima. test/live.test.ts is written and skips until PLANIMA_TOKEN is present.

What it is

  • Poll-only. No event handler, no dispatch. Nothing inside a scope initiates this — the plan changes in Planima and the platform finds out by looking.
  • Read-only. Every call is a GET. Planima's write endpoints exist and are not used.
  • Host code, never module code: it is swept on a ScopeHost, and module code cannot reach fetch at all.

Using it

import { bindPlanimaScope, sweepPlanimaPlan } from '@substrat-run/connector-planima';
import { globalFetch } from '@substrat-run/kernel';

// Once, per scope. Refuses if the connection does not hold the permission.
await bindPlanimaScope(host, {
  connectionId,
  tenantId,
  scopeId,
  vertical: 'maintenance',
  operation: 'maintenance/record-plan', // YOUR operation
  permission: 'plan:record',            // which it checks
  organizationId: null,                 // or one id
  currency: 'SEK',
  horizonYears: 10,
});

// On a timer, from the platform sweeper.
await sweepPlanimaPlan(host, connectionId, { fetch: globalFetch });

Your landing operation receives a PlanimaPlanPage. Pages are global across one sync and each names one facility: buildings and components ride the facility's first page (facilityHead), actions ride every page 500 at a time, and final marks the last page of the sync. Every page of one sync carries the same syncId, so an upsert keyed on it is idempotent.

The credential

One static API token, created in Planima under account settings → API.

Mint it as a read-only user. A Planima token carries the full access of whoever created it and there are no scopes to narrow it — so choosing the user is the only control there is, and this connector never writes.

Development

pnpm --filter @substrat-run/connector-planima test       # against the in-memory mock

The live suite runs when a token is present, in secrets/connectors.env at the repo root (canonical, shared by every connector), this package's .dev.vars, or PLANIMA_TOKEN in the environment. See .dev.vars.example.

PLANIMA_TOKEN=… pnpm --filter @substrat-run/connector-planima test

It is read-only and creates nothing, so it is safe against a real account — but it does spend requests against a 10-per-10-second budget.