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

@haneinfo/list-view

v0.11.8

Published

Permission-filtered instance queries and private or shared saved views.

Downloads

2,853

Readme

@haneinfo/list-view

Permission-filtered lists of StateMachine instances, saved views and bounded queries for future exports. UI HTTP requests and MCP use the same query shape:

{
  "filter": {
    "kind": "PREDICATE", "operator": "GT",
    "left": { "kind": "FIELD", "fieldId": "data.duration" },
    "right": { "kind": "LITERAL", "value": 3 }
  },
  "sort": [{ "fieldId": "data.duration", "direction": "desc" }],
  "offset": 0, "limit": 50,
  "columns": ["$number", "$state", "data.duration"]
}

The StateMachine declares spec.listView.fields: [{ fieldId: "duration", filterable: true, sortable: true }]. Form ids are stable identifiers, defaulting to keys. $state, $number, $submitterId and $createdAt are always available. Extra fields must be top-level text, textarea, number, date or datetime fields.

Install the plugin and migrate prisma/list-view.prisma. ListViewModule.register() exports ListViewService and ListViewMcpTools; the plugin factory is listView() from @haneinfo/list-view/plugin. Register MCP tools into the App's existing internal registry with commands({ scopeNamespace }). No extra endpoint or auth provider is created.

See agent-guide.md for all routes, semantics and export limitations.

Snapshot exports resolve sourceFor(userId, source) once, then pass { tx } as the fourth batchesFor argument. The caller owns a read-only RepeatableRead transaction; every page joins it. This mode aborts if effective read-all authorization changes between batches. Without tx, the existing live scan and per-page saved-view visibility checks remain available. Import-export owns file generation, limits and expiry. See package.json for the current package version.

Instance readers and stored query values

SQL filters by submitter ownership, state-machine:instance:read, or an indexed EXISTS lookup in state_machine_instance_readers before counting or paging. Count and page keep the existing RepeatableRead transaction. Exports use the same query through batchesFor; shared views grant no extra instance access. Apply the state-machine reader-table migration and existing-task backfill before upgrading.

Top-level text, textarea, number, date and datetime formula fields can be declared filterable or sortable. They use the stored JSONB result just like ordinary fields. Missing historical values follow the existing missing-input exclusion and NULLS LAST sorting rules. Queries never recompute or backfill them. Select, switch, nested and container fields remain unsupported.

Date comparisons

GT/GTE/LT/LTE compare numbers, valid calendar dates (YYYY-MM-DD), or timezone-qualified datetimes (YYYY-MM-DDTHH:mm:ss with optional fractional seconds and Z or +/-HH:mm). Both operands must have the same category. Dates use calendar order; datetimes compare UTC instants at millisecond precision. Invalid dates, mixed categories and empty operands yield false. EQ/NEQ/IN retain strict scalar equality; matching instants with different textual offsets are still unequal for those operators.

Frontend metadata

GET /list-view/views and GET /list-view/views/:id attach canShare: boolean to each visible view. Creation also returns it. The same ADMIN-only helper controls PATCH sharing; ALLOW_ALL and instance:read alone cannot share. MCP list_my_views, get_my_view and create_my_view preserve canShare, while retaining their own-view visibility boundary.

GET /list-view/machines/:code/fields returns only query metadata: { id, label, type, filterable, sortable, dataKey? }. Subject labels and exact widget types (including textarea) come from the latest published Form, without definition-management permission. No locale-specific label mechanism exists, so labels are returned verbatim. System metadata is $state/State/text, $number/Number/text, $submitterId/Submitter/text and $createdAt/Created at/datetime. No workflow rules, permissions or definition envelope is returned. The existing interactive identity guard remains; no definition-management guard is added. Query MCP responses wrap field labels in $userContent.

Submitter names

Query results and batchesFor rows always include submitterName: string | null beside submitterId. After instance authorization filters the page, optional identity-store findActiveNamesByIds performs one lookup of unique non-null ids per nonempty batch. Export transactions are forwarded to that lookup. Missing/inactive/deleted users and older or absent providers yield null, with no per-row fallback and no public people-lookup endpoint.

Names are display metadata, not new filter/sort fields or selectable query columns. query_instance_list wraps the top-level name in $userContent, including null. Import-export inserts $submitterName directly after each selected $submitterId; selecting other columns alone does not add names. batchesFor preserves the same row metadata regardless of selected columns; exporters read the name from the row, not values.

Instance access lists (implementation)

Implemented against approved decision 202610-c8e3.

queryFor, saved-view queries and batchesFor resolve effective RBAC role names once per database page. One parameterized EXISTS matches USER/id or ROLE/ANY(text[]) without joining RBAC tables. Filtering precedes count, sorting and pagination. Snapshot exports abort on changes to readAll or role names with EXPORT_AUTHORIZATION_CHANGED; view visibility continues to be checked per page. Different sources for the same principal never duplicate result rows. Names still use one identity batch after authorization. Shared views supply query settings and cannot grant instance access.

Upgrade the affected mechanisms together after applying the App migration. The maintained model, HTTP routes, read-only list_instance_access MCP tool, errors and permission contract are documented in @haneinfo/state-machine/agent-guide.md. Its prisma/instance-access.sql migrates the existing reader table to USER/ROLE, READ/WRITE and ASSIGNED/DELEGATED/GRANTED rows while retaining timestamps. The maintainer selected (instanceId, principalType, principalId, source) uniqueness. Manual grants are limited to 100 by default; permanent READ entries survive manual removal. See the package repository validation/equipment-loan/instance-access/report.md for SQL, tests and App restoration evidence.

Instance lifecycle (approved decision 202610-f1a8)

Implemented from approved decision 202610-f1a8. Upgrade state-machine, list-view, collaboration, attachments, import-export, assignment and timer together. No frontend, automatic archive or bulk lifecycle operations are included. Permanently purged data cannot be restored by this API: database and private file backups must cover the entire deletion retention period and be restored consistently.

ListQuery and schemas/query.json add archived: EXCLUDE (default), INCLUDE or ONLY. Strict runtime validation rejects other values. Saved query JSON preserves it; sourceFor/queryFor/queryViewFor/ batchesFor and CSV/xlsx exports use the same setting. PostgreSQL applies deleted_at IS NULL and the archive predicate before count, sorting and paging, including global readers. Each result includes archived: boolean. query_instance_list accepts query.archived and returns archived; existing scope and user-content wrapping remain unchanged. Single and exact-number reads are unaffected by archive filtering. Empty filtered collections return total=0/items=[] as before.

Instance tags (approved decision 202610-2c5d)

Implemented from approved decision 202610-2c5d. See @haneinfo/tags/agent-guide.md for data, migration and authorization. Query tags accepts up to 10 inputs with tagMatch ALL (default) or ANY; writes and filters share plugin-api normalization. Saved queries/exports preserve these conditions. Result tags is one batched display-label query per authorized page; no port means [] and TAGS_NOT_AVAILABLE/409 for nonempty filters. readableInstancePredicates is exported for permission-safe suggestion SQL. query_instance_list wraps result tags with $userContent.

Instance analytics (approved decision 202610-c7b4)

Implemented under the approved decision. New exports for @haneinfo/instance-analytics, with list behavior and SQL unchanged: queryFieldsFor(spec, subject) (system fields plus spec.listView.fields, INVALID_LIST_VIEW_DEFINITION as before; ListViewService.fields uses it), dataFieldSql(key, bind) (bound top-level data key), scalarJsonSql(value) (Form scalar conversion) and typedJsonSql(value, 'number' | 'string' | 'boolean') (strict JSON type guard before the cast; strings use COLLATE "C"; anything else is NULL). Reports filters call compileQuery directly, so their validation, parameterized SQL and readership equal list queries. The state-machine peer range accepts 0.19.

Localized labels and state display (approved decision 202610-a8d3)

Implemented under the approved decision. GET /list-view/machines/:code/fields, POST …/query and POST /list-view/views/:id/query read ?locale= (zh-TW or en, else INVALID_LOCALE/400) or Accept-Language, default zh-TW. Field labels, the system labels included (狀態/State, 單號/Number, 送件人/Submitter, 建立時間/Created at; SYSTEM_FIELD_LABELS), are resolved in that locale (queryFieldsFor(spec, subject, locale?)). Every item adds stateLabel and stateTone, read in the same SQL from the instance's own pinned machine; a store that does not provide stateDefinition falls back to the latest published machine, then to the key. MCP query_instance_list uses zh-TW and wraps stateLabel as $userContent. Exports keep using the same items. Requires plugin API 1.26.0.