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

@astralibx/staff-types

v0.2.1

Published

Shared TypeScript type definitions, enums, and contracts for the staff module

Readme

@astralibx/staff-types

npm version License: MIT

Shared TypeScript type definitions, enums, and config contracts for the staff module.

Install

npm install @astralibx/staff-types

No runtime dependencies -- pure TypeScript declarations and const enums.

Enums

| Enum | Values | Description | |------|--------|-------------| | STAFF_ROLE | Owner, Staff | Role level for a staff account | | STAFF_STATUS | Active, Inactive, Pending | Account lifecycle status | | PERMISSION_TYPE | View, Edit, Action | Capability type for a permission entry |

Enum values

import { STAFF_ROLE, STAFF_STATUS, PERMISSION_TYPE } from '@astralibx/staff-types';

STAFF_ROLE.Owner      // 'owner'
STAFF_ROLE.Staff      // 'staff'

STAFF_STATUS.Active   // 'active'
STAFF_STATUS.Inactive // 'inactive'
STAFF_STATUS.Pending  // 'pending'

PERMISSION_TYPE.View   // 'view'
PERMISSION_TYPE.Edit   // 'edit'
PERMISSION_TYPE.Action // 'action'

Interfaces

| Interface | Source | Description | |-----------|--------|-------------| | IStaff | staff.types | Full staff document: name, email, hashed password, role, status, permissions, lastLoginAt, metadata, tenantId | | IStaffSummary | staff.types | Public staff projection (no password): name, email, role, status, permissions, lastLoginAt | | IStaffCreateInput | staff.types | Input for creating a staff member: name, email, password (plain), role, status, permissions, externalUserId, metadata | | IStaffUpdateInput | staff.types | Input for updating a staff member: name, email, metadata | | IStaffListFilters | staff.types | List query filters: status, role, page, limit | | IPaginatedResult<T> | staff.types | Paginated response wrapper: data[], pagination (page, limit, total, totalPages) | | IPermissionEntry | permission.types | Single permission entry: key, label, type | | IPermissionGroup | permission.types | Permission group document: groupId, label, permissions[], sortOrder, tenantId | | IPermissionGroupCreateInput | permission.types | Input for creating a permission group | | IPermissionGroupUpdateInput | permission.types | Input for updating a permission group | | StaffAdapters | adapter.types | Required adapters: hashPassword, comparePassword | | LogAdapter | config.types | Logger interface: info, warn, error | | StaffMetric | config.types | Metric event: name, value, labels, timestamp | | StaffHooks | config.types | Lifecycle hooks: onStaffCreated, onLogin, onLoginFailed, onPermissionsChanged, onStatusChanged, onMetric | | StaffEngineOptions | config.types | Engine options: requireEmailUniqueness, allowSelfPasswordChange, rateLimiter | | StaffEngineConfig | config.types | Full engine configuration: db, redis, logger, tenantId, auth, adapters, hooks, options | | ResolvedOptions | config.types | Resolved options with defaults applied | | DEFAULT_OPTIONS | config.types | Default values for all options |

Usage

import type {
  IStaff,
  IStaffSummary,
  IPermissionGroup,
  StaffEngineConfig,
} from '@astralibx/staff-types';
import { STAFF_ROLE, STAFF_STATUS, PERMISSION_TYPE } from '@astralibx/staff-types';

// Type a staff record
const staff: IStaffSummary = {
  _id: '...',
  name: 'Alice',
  email: '[email protected]',
  role: STAFF_ROLE.Owner,
  status: STAFF_STATUS.Active,
  permissions: ['contacts.view', 'contacts.edit'],
  createdAt: new Date(),
};

// Type a permission group
const group: IPermissionGroup = {
  _id: '...',
  groupId: 'crm',
  label: 'CRM',
  permissions: [
    { key: 'contacts.view', label: 'View Contacts', type: PERMISSION_TYPE.View },
    { key: 'contacts.edit', label: 'Edit Contacts', type: PERMISSION_TYPE.Edit },
  ],
  sortOrder: 1,
  createdAt: new Date(),
  updatedAt: new Date(),
};

Links

License

MIT