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

gov-finance-authorization-sdk

v1.0.0

Published

TypeScript SDK for the Ministry of Finance Jamaica — Government Financial Authorization & Governance Platform. Provides type-safe, immutable DTOs and semantic-conformance helpers for consuming systems.

Downloads

15

Readme

@mof-jamaica/gov-finance-authorization-sdk

TypeScript SDK for the Ministry of Finance Jamaica — Government Financial Authorization & Governance Platform.

Semantic Freeze: v1.0.0 | API Compatibility: v1.0.0+

Installation

# Pin to an exact version — SDKF-09 forbids wildcard version constraints
npm install @mof-jamaica/[email protected]

CRITICAL: SDK version must be pinned exactly (1.0.0), not loosely (^1.0.0, ~1.0.0, or latest). Wildcard constraints are unconditionally forbidden per SDK_SEMANTIC_CONFORMANCE.md SDKF-09 and will cause GATE-3 failure in consumer onboarding.

Quick Start

import { GovFinanceAuthorizationClient } from '@mof-jamaica/gov-finance-authorization-sdk';

const client = new GovFinanceAuthorizationClient({
  baseUrl: 'https://auth.mof.gov.jm',
  consumingSystemId: 'my-registered-system-id',  // Must be registered with the platform
});

// Single authorization
const result = await client.authorize({
  actorId: 'real-actor-uuid-here',      // OBL-02: real actor identity required
  action: 'debt.approve',
  resource: 'debt_instrument',
  correlationId: 'caller-uuid-here',    // OBL-01: must be caller-provided, unique per request
  amount: '5000000.00',                 // SDKF-02: MUST be a string, not a number
  currency: 'JMD',
});

// SDKF-01: decision is 'ALLOW' | 'DENY' — never use boolean helpers
if (result.decision === 'ALLOW') {
  // OBL-04: store explainability for every decision
  await myAuditStore.save({ correlationId, explainability: result.explainability });
  // proceed
}
// OBL-05: do NOT retry a DENY as an ALLOW
// OBL-08: do NOT cache this result — every call requires a live authorization check

Mandatory Consuming System Obligations

Before going to production, your system must satisfy all 4 onboarding gates. See CONSUMER_ONBOARDING_REQUIREMENTS.md for the full gate sequence.

| Obligation | Rule | |-----------|------| | OBL-01 | Always pass a real correlationId — do not auto-generate silently | | OBL-02 | Always pass a real actorId — not 'system', 'anonymous', etc. | | OBL-03 | Send amount as a decimal string, never a number | | OBL-04 | Store the full explainability block for every decision | | OBL-05 | Never retry a DENY as an ALLOW | | OBL-06 | If this SDK throws, treat the request as DENY (fail-closed) | | OBL-07 | Pin SDK to an exact version — no wildcards | | OBL-08 | Never cache authorization decisions |

Forbidden Patterns (SDKF-01 through SDKF-10)

| Code | Pattern | Consequence | |------|---------|-------------| | SDKF-01 | Boolean-only helpers (isAllowed()) | Hides decision context; audit gap | | SDKF-02 | Float/number for financial amounts | Decimal precision failure (INC-DEC SEV-1) | | SDKF-03 | Caching decisions | Stale authorization; access retained after revocation | | SDKF-04 | Silent correlationId generation | Breaks replay; audit tracing failure | | SDKF-05 | Stripping explainabilityComplete | Permanent explainability loss | | SDKF-06 | Retry masking (DENY→ALLOW) | Unauthorized access; FAA Act violation | | SDKF-07 | Hardcoded role checks alongside API | Policy bypass; security incident | | SDKF-08 | Placeholder actorId values | Actor identity loss; audit integrity failure | | SDKF-09 | Wildcard version constraints | Breaking change propagation without control | | SDKF-10 | Silent compatibility downgrade | Semantic drift; undetected breaking changes |

Replay API

// Verify a historical decision
const replay = await client.replayByCorrelation({
  correlationId: 'original-decision-correlation-id',
  mode: 'VERIFY',
});
// replay.result: 'MATCH' | 'DIVERGENCE' | 'INTEGRITY_VIOLATION' | 'AUDIT_RECORD_MISSING'

// Get a human-readable explanation for auditors
const explain = await client.replayByCorrelation({
  correlationId: 'original-decision-correlation-id',
  mode: 'EXPLAIN',
});
console.log(explain.explanation);

Version Contract

This SDK is governed by GOVERNANCE_COMPATIBILITY_MATRIX.md. Breaking changes require a Governance Change Review Board (GCRB) vote and a 90-day deprecation notice.

Current status: CURRENT (v1.0.0, Semantic Freeze v1.0.0)