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

auxwall-hr-module

v1.1.0

Published

HR Documents Module for Auxwall Integration

Readme

HR Document Management Module

A comprehensive, modular sub-system for Sequelize + Express applications.
This module handles document storage, hierarchical categorization, and activity logging by injecting itself into a host application.


🚀 Quick Start (Integration)

To use this module, call the initializeHRModule function in your main app.js or server startup file.
This will automatically set up models, associations, and API routes.

import { initializeHRModule } from 'auxwall-hr-module';
import path from 'path';

// Inside your server startup logic
await initializeHRModule({
    app,            // Your Express instance
    sequelize,      // Your Sequelize connection
    models: { 
        Company,    // Host Company model
        Staff       // Host Staff model
    },
    uploadPath: path.resolve('./uploads/hr_documents'),
    path: '/api/hr', // Base prefix for all module routes
    autoSync: true   // Set to true to automatically create/sync tables
});

🏗 Schema Architecture

The module extends your database with three core tables.
It establishes a Dual-Staff Relationship to differentiate between:

  • Who a document belongs to
  • Who uploaded the document

📦 Core Tables

| Model | Description | Primary Key | |----------|-----------------------------------------------------------------|-------------| | Document | Stores file metadata, expiry dates, status, and relationships | id | | Category | Hierarchical document types (Resume, ID, Visa, etc.) | id | | Activity | Audit logs for all document-related actions | id |


🔗 Association Aliases

When querying the Document model directly, you must use these aliases to avoid ambiguity errors caused by multiple foreign keys pointing to the same table.

| Alias | Description | Foreign Key | |------------------|-----------------------------------------------|------------------------| | assignedStaff | The person the document belongs to | hr_staff_id | | uploader | The person who uploaded the document | hr_uploaded_by_id | | category | The linked document category | hr_category_id |


📡 API Endpoints

Once initialized, the following endpoints become available under your configured base path
(e.g. /api/hr).


📊 Summary & Analytics

GET /api/hr/summary

Returns:

  • Total number of categories
  • Document count grouped by category

Notes:

  • Uses raw SQL queries
  • Bypasses ORM association overhead
  • Prevents "multiple association" ambiguity errors

🔍 Search & Filtering

GET /api/hr/documents

Query Parameters

| Parameter | Description | |-----------------|-------------------------------------------| | categoryName | Filter by category name | | documentName | Search by document name | | expiryStart | Filter documents expiring after date | | expiryEnd | Filter documents expiring before date |

Response Features:

  • Paginated results
  • Automatically mapped staffName
  • Automatically mapped categoryName

🛠 Advanced Configuration

📁 uploadPath

  • Uses Multer internally for file uploads
  • Ensure the directory has write permissions
  • Directory is auto-created if it does not exist

🔄 autoSync

If set to true, the module runs:

model.sync()

for:

  • Documents
  • Categories
  • Activities

⚠️ WARNING
In a production environment with existing migrations,
it is strongly recommended to set autoSync to false.


📜 Requirements

| Requirement | Supported Version / Details | |---------------|--------------------------------------------| | Express.js | v4.x | | Sequelize | v6.x | | Database | PostgreSQL (recommended) or MySQL | | Host Models | Staff model must contain a name field |


✅ Summary

  • Plug-and-play HR document management module
  • Clean separation from host application
  • Safe dual-staff relationship handling
  • Optimized analytics using raw SQL
  • Production-ready with controlled auto-sync

Happy Building 🚀