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

@glideco/compliance-export

v0.2.0

Published

Compliance export primitives — JSON sync + PDF async pipeline + retention-tier S3 storage adapters (STANDARD / GLACIER_IR / DEEP_ARCHIVE). Schema, range validator (1-year cap, monthly shard helper), envelope builder, signed-URL re-signing helper. Operator

Readme

@glideco/compliance-export

Compliance export primitives for Glide's agent activity log:

  • Range validator — enforces the 1-year-per-export cap.
  • Monthly shard splitter — splits multi-year ranges into UTC calendar-month shards (one compliance_exports row per shard).
  • Envelope schema + builder — JSON shape that ships in compliance.exportJson (sync) and inside the PDF body (async).
  • Signed-URL refresh helper — operator brings their own S3 client; this package handles the cache-and-refresh logic.

DB-agnostic and S3-client-agnostic. The operator wires the executor / signer.

Install

npm install @glideco/compliance-export

Usage

Build a JSON envelope

import { buildEnvelope } from '@glideco/compliance-export';

const envelope = buildEnvelope({
  entityId: 'entity_abc',
  entityName: 'Glide Operator Co',
  range: {
    since: new Date('2026-01-01T00:00:00Z'),
    until: new Date('2026-01-31T23:59:59Z'),
  },
  rows: dbRows.map((r) => ({
    id: r.id,
    createdAt: r.createdAt,
    action: r.action,
    riskVerdict: r.riskVerdict,
    vendorUsed: r.vendorUsed,
    onChainTx: r.onChainTx,
    policyVersion: r.policyVersion,
    redactedFieldsBitmap: r.redactedFieldsBitmap,
  })),
});

// ↓ ships as application/json or embedded in the async PDF
return Response.json(envelope);

Validate + shard a long range

import {
  validateRange,
  splitIntoMonthlyShards,
} from '@glideco/compliance-export';

const range = { since: parseISO(input.since), until: parseISO(input.until) };
const v = validateRange(range);
if (v.ok) {
  // single-shot export
  return enqueueExport(range);
}
if (v.reason === 'exceeds-one-year') {
  const shards = splitIntoMonthlyShards(range);
  for (const shard of shards) await enqueueExport(shard);
  return { fragmented: true, count: shards.length };
}
throw new Error(v.message);

Refresh signed S3 URLs

import { GetObjectCommand, S3Client } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { refreshSignedUrl, type Signer } from '@glideco/compliance-export';

const s3 = new S3Client({ region: 'us-east-1' });

const signer: Signer = async ({ bucket, key, expiresInSeconds }) => {
  const url = await getSignedUrl(
    s3,
    new GetObjectCommand({ Bucket: bucket, Key: key }),
    { expiresIn: expiresInSeconds }
  );
  return {
    url,
    expiresAt: new Date(Date.now() + expiresInSeconds * 1000),
  };
};

// In the admin polling endpoint:
const fresh = await refreshSignedUrl({
  signer,
  bucket: process.env.S3_EXPORTS_BUCKET!,
  key: row.s3Key,
  current: row.cachedUrl
    ? { url: row.cachedUrl, expiresAt: row.cachedUrlExpiresAt }
    : null,
});
await db
  .update(complianceExports)
  .set({ cachedUrl: fresh.url, cachedUrlExpiresAt: fresh.expiresAt })
  .where(eq(complianceExports.id, row.id));

Quotas

The OSS plan §M4 specifies:

  • Max 10 exports/tenant/day — enforced at the tRPC router layer; not in this package.
  • Max range 1 year per export — enforced by validateRange.
  • Long-range fragmentation — UI calls splitIntoMonthlyShards and enqueues one shard per row.

License

MIT.