openvibers/openrestream Commits
Serve the release manifest (Track R, D43): GET /release.json on openre-api (release, contracts, openvibe-shared/sdk/contracts versions) through openvibe-shared release; test in drill-mode.test.js
Changes
@@@ -37,6 +37,8 @@ function createApp({ rt, auth, keys, log = console, fetchImpl }) {}app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openre-api', version: pkg.version, release: config.release }));++ // GET /release.json (ADR-016, D43): which release this API runs, its contracts and packages.++ require('openvibe-shared/release').createRelease({ service: 'openre', root: require('path').join(__dirname, '..'), packages: ['openvibe-shared', 'openvibe-sdk', 'openvibe-contracts'] }).mount(app);// Ready = the database answers and the Network key is loaded. Worker and coordinator state is// reported, not required: the API serves reads while a worker generation rolls over.@@@ -66,6 +66,9 @@ t('openre-api in a drill: reads work and match a normal instance; writes, /play/const normal = await bootApi({ dir });const created = await request(normal.base, 'POST', '/api/v1/streams', { token: reader, headers: { 'X-OV-Subject': 'usr_01J0000000000000000000000A' }, body: { title: 'Restored' } });assert.strictEqual(created.status, 201);++ const rel = await request(normal.base, 'GET', '/release.json');++ assert.strictEqual(rel.status, 200, 'the release manifest (D43) is served');++ assert.strictEqual((rel.json || JSON.parse(rel.text || rel.body || '{}')).service, 'openre');const health = await request(normal.base, 'GET', '/api/health');const list = await request(normal.base, 'GET', '/api/v1/streams', { token: reader });const outboxBefore = normal.rt.db.prepare('SELECT count(*) AS n FROM event_outbox').get().n;
@@ -37,6 +37,8 @@ function createApp({ rt, auth, keys, log = console, fetchImpl }) {
@@ -37,6 +37,8 @@ function createApp({ rt, auth, keys, log = console, fetchImpl }) {
}
}
app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openre-api', version: pkg.version, release: config.release }));
app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openre-api', version: pkg.version, release: config.release }));
+ // GET /release.json (ADR-016, D43): which release this API runs, its contracts and packages.
+ require('openvibe-shared/release').createRelease({ service: 'openre', root: require('path').join(__dirname, '..'), packages: ['openvibe-shared', 'openvibe-sdk', 'openvibe-contracts'] }).mount(app);
// Ready = the database answers and the Network key is loaded. Worker and coordinator state is
// Ready = the database answers and the Network key is loaded. Worker and coordinator state is
// reported, not required: the API serves reads while a worker generation rolls over.
// reported, not required: the API serves reads while a worker generation rolls over.
@@ -66,6 +66,9 @@ t('openre-api in a drill: reads work and match a normal instance; writes, /play/
@@ -66,6 +66,9 @@ t('openre-api in a drill: reads work and match a normal instance; writes, /play/
const normal = await bootApi({ dir });
const normal = await bootApi({ dir });
const created = await request(normal.base, 'POST', '/api/v1/streams', { token: reader, headers: { 'X-OV-Subject': 'usr_01J0000000000000000000000A' }, body: { title: 'Restored' } });
const created = await request(normal.base, 'POST', '/api/v1/streams', { token: reader, headers: { 'X-OV-Subject': 'usr_01J0000000000000000000000A' }, body: { title: 'Restored' } });
assert.strictEqual(created.status, 201);
assert.strictEqual(created.status, 201);
+ const rel = await request(normal.base, 'GET', '/release.json');
+ assert.strictEqual(rel.status, 200, 'the release manifest (D43) is served');
+ assert.strictEqual((rel.json || JSON.parse(rel.text || rel.body || '{}')).service, 'openre');
const health = await request(normal.base, 'GET', '/api/health');
const health = await request(normal.base, 'GET', '/api/health');
const list = await request(normal.base, 'GET', '/api/v1/streams', { token: reader });
const list = await request(normal.base, 'GET', '/api/v1/streams', { token: reader });
const outboxBefore = normal.rt.db.prepare('SELECT count(*) AS n FROM event_outbox').get().n;
const outboxBefore = normal.rt.db.prepare('SELECT count(*) AS n FROM event_outbox').get().n;