Adjacent work: PDF receipts, encrypted blob+share mock, NATS tunnel, SHA256 Zapier action

Around remaining blockers (Zapier login, live Verae): generate PDF receipts
without extra deps; AES-256-GCM object store with tenant isolation and share
tokens; scripts/nats-tunnel.sh to NS1; SHA256 Hash Text local Zapier action;
scripts/test-offline.sh for the no-login suite.

Learned: other-tenant object GET is 403; share token is the mock unwrap path.
This commit is contained in:
George Lambert 2026-09-09 02:59:06 -04:00
parent c8f9d01a04
commit 645a24909a
45 changed files with 1053 additions and 24 deletions

View file

@ -0,0 +1,55 @@
# `verae-zapier-middleware/store/blobs`
**Package:** `verae-zapier-middleware`
**Source:** `packages/verae-zapier-middleware/src/store/blobs.js`
**Lines:** 137
## What this module is
Implementation module in `verae-zapier-middleware`. The tables below are extracted from the source (signatures + JSDoc).
## Exports
`decryptBlob`, `putBlob`, `getBlobRecord`, `readBlobPlaintext`, `createShare`, `redeemShare`
## Types / interfaces / classes
_None extracted._
## Functions
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|------|------------|---------------------|---------|-----------------------------|
| `ensure` | `(none)` | — | `unknown` | see Call graph |
| `encrypt` | `plaintext, key` | plaintext: `Buffer`, key: `Buffer` | `unknown` | see Call graph |
| `decryptBlob` | `enc, key` | key: `Buffer` | `unknown` | see Call graph |
| `putBlob` | `{ tenantId, sha256, filename, bytes, publicMetadata = {}, privateMetadata = {} }` | params: `object`, params.tenantId: `string`, params.sha256: `string`, params.filename: `string`, params.bytes: `Buffer`, params.publicMetadata: `object`, params.privateMetadata: `object` | `unknown` | see Call graph |
| `getBlobRecord` | `id` | — | `unknown` | see Call graph |
| `readBlobPlaintext` | `id, tenantId` | id: `string`, tenantId: `string` | `unknown` | see Call graph |
| `createShare` | `{ blobId, fromTenantId, label }` | — | `unknown` | see Call graph |
| `redeemShare` | `token` | token: `string` | `unknown` | see Call graph |
## Methods (class / object)
| Name | Parameters |
|------|------------|
| `persist` | `(none)` |
| `persist` | `(none)` |
## What it imports / requires
- `node:crypto`
- `./db.js`
## Call graph (identifiers invoked)
`ensure`, `getStore`, `encrypt`, `randomBytes`, `createCipheriv`, `concat`, `update`, `final`, `getAuthTag`, `toString`, `decryptBlob`, `createDecipheriv`, `from`, `setAuthTag`, `putBlob`, `randomUUID`, `toISOString`, `persist`, `getBlobRecord`, `readBlobPlaintext`, `createShare`, `redeemShare`
Each identifier is a call site in this file. Follow the import list to see the defining module; open that modules MD for parameter and return types.
## Return values (how to read this)
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
- Pricing functions return integer **cents** on `Quote.totalCents`.

View file

@ -0,0 +1,7 @@
verae-zapier-middleware.store.blobs
===================================
Generated API sheet for ``verae-zapier-middleware/store/blobs``.
.. include:: blobs.md
:literal:

View file

@ -2,7 +2,7 @@
**Package:** `verae-zapier-middleware`
**Source:** `packages/verae-zapier-middleware/src/store/db.js`
**Lines:** 115
**Lines:** 117
## What this module is