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

summit1

v1.3.5

Published

Lightweight SDK for bridging base44 applications with Azure PostgreSQL Flexible Server. Includes HIPAA/GDPR compliant audit ledger with field-level hash deltas.

Downloads

1,531

Readme

Summit1 SDK v1.3.5

🔥 CRITICAL UPDATE: Version 1.3.5 fixes a critical bug in RLS (Row-Level Security) operations. If you're using RLS, update immediately. See CRITICAL_FIX_v1.3.5.md for details.

A lightweight SDK for bridging base44 applications with Azure PostgreSQL Flexible Server. Includes HIPAA/GDPR compliant audit ledger with field-level hash deltas.

Features

  • base44-Compatible API: Familiar entity-based access patterns
  • Full CRUD Operations: Create, Read, Update, Delete with filtering, sorting, and pagination
  • Row-Level Security (RLS): Multi-tenant data isolation with automatic org_id injection
  • HIPAA/GDPR Audit Ledger: Tamper-evident, PHI-free audit trail with cryptographic hash chaining
  • Synchronous & Asynchronous Audit: Choose direct DB writes or Azure Service Bus for high volume
  • Bulk Operations: Efficient batch create and delete operations
  • Connection Pooling: Built-in connection pool for optimal performance
  • SSL/TLS Support: Secure connections with certificate validation
  • Audit Trail: Automatic tracking of created_by, updated_by, and timestamps

Installation

npm install summit1

For asynchronous audit mode (optional):

npm install @azure/service-bus

Quick Start

Basic Usage (No Audit)

import { createClient } from 'summit1';

const summit1 = createClient({
  host: 'your-db.postgres.database.azure.com',
  user: 'your_user',
  password: 'your_password',
  database: 'your_db'
});

const task = await summit1.entities.tasks.create({ title: 'Hello', status: 'pending' });
const tasks = await summit1.entities.tasks.list();

With RLS

const summit1 = createClient({
  host: 'your-db.postgres.database.azure.com',
  user: 'your_user',
  password: 'your_password',
  database: 'your_db',
  rls: {
    enabled: true,
    userContext: {
      org_id: 'org-123',
      id: 'user-456',
      role: 'admin',
      email: '[email protected]'
    }
  }
});

With Audit Ledger (Synchronous Mode)

const summit1 = createClient({
  host: 'your-db.postgres.database.azure.com',
  user: 'your_user',
  password: 'your_password',
  database: 'your_db',
  rls: {
    enabled: true,
    userContext: {
      org_id: 'org-123',
      id: 'user-456',
      role: 'clinician',
      email: '[email protected]'
    }
  },
  audit: {
    enabled: true,
    mode: 'sync',
    hmacSecret: process.env.HMAC_SECRET
  }
});

// Set per-request context
summit1.setAuditContext({
  requestId: 'req-abc-123',
  clientIp: '203.0.113.50',
  userAgent: 'Mozilla/5.0...'
});

// All CRUD operations are now automatically audited.
// NO PHI is written to the audit ledger - only HMAC-SHA256 hashes.
const patient = await summit1.entities.patients.create({
  name: 'Jane Doe',
  dob: '1985-03-15',
  diagnosis: 'Routine checkup'
});

With Audit Ledger (Asynchronous Mode)

const summit1 = createClient({
  host: 'your-db.postgres.database.azure.com',
  user: 'your_user',
  password: 'your_password',
  database: 'your_db',
  rls: {
    enabled: true,
    userContext: { org_id: 'org-123', id: 'user-456', role: 'clinician', email: '[email protected]' }
  },
  audit: {
    enabled: true,
    mode: 'async',
    hmacSecret: process.env.HMAC_SECRET,
    serviceBusConnectionString: process.env.SERVICE_BUS_CONNECTION_STRING,
    serviceBusQueueName: 'audit-events',
    fallbackToSync: true
  }
});

See AUDIT_SETUP_GUIDE.md for complete setup instructions.

Audit Verification

// Verify a record matches its audit hash
const isValid = await summit1.verifyRecordHash(patient, storedHash, 'patients');

// Verify the entire audit chain for a record
const result = await summit1.verifyAuditChain('patients', 'patient-123');
// { valid: true, totalEntries: 5 }

// Get audit history (metadata only, no PHI)
const history = await summit1.getAuditHistory('patients', 'patient-123');

Database Setup

Run the audit schema migration:

psql -h your-db-host -U your-user -d your-db -f sql/001_create_audit_ledger.sql

API Reference

Client Creation

createClient(config)

Creates a new Summit1 client. See the JSDoc in client.js for all configuration options.

Entity Operations

| Method | Description | |---|---| | create(data) | Create a record | | get(id) | Get a record by ID | | list(options) | List records with filtering, sorting, pagination | | filter(filters, options) | Filter records | | update(id, data) | Update a record | | delete(id) | Delete a record | | deleteMany(filters) | Delete multiple records | | bulkCreate(records) | Create multiple records | | query(sql, params) | Execute raw SQL | | count(filters) | Count matching records |

RLS Methods

| Method | Description | |---|---| | setUserContext(context) | Set RLS user context | | getUserContext() | Get current user context | | isRLSEnabled() | Check if RLS is enabled |

Audit Methods

| Method | Description | |---|---| | setAuditContext(context) | Set per-request audit metadata | | getAuditContext() | Get current audit context | | isAuditEnabled() | Check if audit is enabled | | getAuditMode() | Get audit mode ('sync' or 'async') | | verifyRecordHash(record, hash, table) | Verify record integrity | | verifyAuditChain(table, recordId) | Verify hash chain integrity | | getAuditHistory(table, recordId) | Get audit trail |

Compliance

The audit ledger meets or exceeds:

| Requirement | Status | |---|---| | HIPAA §164.312(b) - Audit Controls | ✅ Exceeded | | HIPAA §164.312(e)(1) - Integrity Controls | ✅ Exceeded | | HIPAA §164.312(c)(1) - Authentication | ✅ Met | | GDPR Article 5(1)(f) - Integrity & Confidentiality | ✅ Exceeded | | GDPR Article 32 - Security of Processing | ✅ Exceeded | | GDPR Article 30 - Record of Processing Activities | ✅ Met |

File Structure

summit1-sdk-v1.3.0/
├── index.js                          # Main entry point
├── client.js                         # Core SDK with RLS + audit hooks
├── package.json                      # v1.3.0
├── LICENSE                           # MIT
├── README.md                         # This file
├── CHANGELOG.md                      # Version history
├── AUDIT_SETUP_GUIDE.md              # Sync vs Async setup guide
├── .env.example                      # Environment variable template
├── .gitignore
├── .npmignore
├── src/
│   └── audit/
│       ├── index.js                  # Audit module exports
│       ├── audit-logger.js           # Core audit engine
│       ├── async-audit-logger.js     # Async wrapper with Service Bus
│       ├── service-bus-publisher.js   # Service Bus publisher
│       └── service-bus-consumer.js    # Service Bus consumer worker
└── sql/
    └── 001_create_audit_ledger.sql   # Database schema migration

License

MIT