Split NATS modules: splitter, WORM bloom archive, aggregator, docs-master
Some checks are pending
offline / test (push) Waiting to run

Each module has SUMMARY.md and NATS.md (who sends/receives, subject
addresses, payload). Tests: splitter 3, worm 3, aggregator 2.
Forgejo repos pushed separately; this commit keeps them in the monorepo.
This commit is contained in:
George Lambert 2026-09-11 12:33:40 -04:00
parent ca693366dc
commit 8f9707a3b7
39 changed files with 893 additions and 0 deletions

View file

@ -0,0 +1,32 @@
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { splitRequest, sha256Hex } from '../src/splitRequest.js';
describe('splitRequest', () => {
it('hash-only has no archive puts', () => {
const out = splitRequest({ data: 'hello' });
assert.equal(out.chain.sha256, sha256Hex('hello'));
assert.equal(out.archivePuts.length, 0);
assert.equal(out.includeAttached, false);
});
it('splits public metadata and two files onto archive puts', () => {
const out = splitRequest({
data: 'hello',
publicMetadata: { title: 't' },
files: [
{ path: 'a.txt', data: 'A' },
{ path: 'b.txt', data: 'B' },
],
includeAttached: true,
});
assert.equal(out.archivePuts.length, 3);
assert.equal(out.archivePuts.filter((p) => p.kind === 'file').length, 2);
assert.equal(out.includeAttached, true);
assert.equal(out.chain.sha256, sha256Hex('hello'));
});
it('throws without data or sha256', () => {
assert.throws(() => splitRequest({}), /data or sha256/);
});
});