openvibers/openvibe.sdk Commits

0.124.0: openvibe-sdk/blog writes a body of Markdown or of blocks (#165)

OP OpenVibers committed 4 days ago · 0710cd6ede · 10 files, +30 −14

* 0.109.0: openvibe-sdk/blog writes a body of Markdown or of blocks

posts.create(handle, { title, markdown | blocks }) — the Markdown is what the post keeps, so
blocks are written back as the Markdown they parse from — and posts.blocks(id) reads the
blocks of a post, parsed (GET /posts/:id?format=blocks).

* 0.124.0: openvibe-sdk/blog writes a body of Markdown or of blocks

Merge main (0.123.0) and re-version this release above it: posts.create(handle, { title, markdown | blocks }) and posts.blocks(id) (GET /posts/:id?format=blocks).

* 0.125.0

* locker test: two phrases differ, not their first words (1 in 256 flake)

Changes

ddiff --git a/CHANGELOG.md b/CHANGELOG.md
iindex 409a236..4b6f4f5 100644
---- a/CHANGELOG.md
++++ b/CHANGELOG.md
@@@ -1,5 +1,9 @@
# Changelog
++## 0.125.0 (2026-11-09)
++
++- openvibe-sdk/blog: posts are written and read as Markdown or as blocks (publishing.block@1), ?format=blocks
++
## 0.124.0 (2026-11-09)
- OpenVibe Link: `openvibe-sdk/node` is `openvibe-sdk/link` (`ov.node` is `ov.link`), building
ddiff --git a/README.md b/README.md
iindex 906569e..9152ddf 100644
---- a/README.md
++++ b/README.md
@@@ -10,7 +10,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags
> Supported browser and server clients for the OpenVibe platform.
--**Status:** alpha, v0.124.0 (the five 1.0 core entries — `core`, `auth`, `events`, `db` and `media` — are frozen: their exported names change only with a major release; roadmap Wave 2; developer apps from Wave 20; Media objects v2 from Wave 4; the Tools platform API; Search, Chat, AI, Vision and consent clients; sign-in with recovery and a client health check). Every release is tagged (see [CHANGELOG.md](CHANGELOG.md)). Tested against local stub servers and the built-in mock platform only, never against the live platform. Services pin release tags; each repository's `STATUS.json` names the one it uses.
++**Status:** alpha, v0.125.0 (the five 1.0 core entries — `core`, `auth`, `events`, `db` and `media` — are frozen: their exported names change only with a major release; roadmap Wave 2; developer apps from Wave 20; Media objects v2 from Wave 4; the Tools platform API; Search, Chat, AI, Vision and consent clients; sign-in with recovery and a client health check). Every release is tagged (see [CHANGELOG.md](CHANGELOG.md)). Tested against local stub servers and the built-in mock platform only, never against the live platform. Services pin release tags; each repository's `STATUS.json` names the one it uses.
**Plan:** OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30.
**License:** MIT ([LICENSE](LICENSE)). This package is a library that apps outside the network embed, so it uses MIT. The OpenVibe services themselves stay AGPL-3.0.
@@@ -19,7 +19,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags
After v0.97.1 is tagged:
```bash
--npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.124.0
++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.125.0
```
It has no runtime dependencies. It needs Node ≥ 20, or any browser with `fetch`, Web Crypto and `TextDecoder`. There is no build step. The package is CommonJS with ESM entry points (`import` works). Each subpath has its own `.d.ts`. For a page with no bundler, `browser/openvibe-sdk.mjs` is one self-contained ES module of the browser-safe subpaths (see [Browser without a bundler](#browser-without-a-bundler)). It does not depend on `openvibe-contracts` at runtime: it copies the contract types it uses (from the temporary Contracts sharing branch, a devDependency the tests check them against).
ddiff --git a/STATUS.json b/STATUS.json
iindex 3a978d3..39ef9cd 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -3,7 +3,7 @@
"stage": "alpha",
"code": true,
"wave": "W2",
-- "version": "0.124.0",
++ "version": "0.125.0",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30",
"deployed": false,
"deployment": "none: a package released as git tags; services and apps pin a tag",
ddiff --git a/browser/openvibe-sdk.mjs b/browser/openvibe-sdk.mjs
iindex b896ef6..ab292e7 100644
---- a/browser/openvibe-sdk.mjs
++++ b/browser/openvibe-sdk.mjs
@@@ -1,4 +1,4 @@
--// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.124.0, MIT). Do not edit.
++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.125.0, MIT). Do not edit.
// One self-contained ES module: core at the top level plus the browser-safe subpaths as namespaces
// (auth, locker, registry, trust, modules, realtime, media, cam, mediaUpload, ui, community, homeFeed, bot, search, bench, meme, vision, themes, design, redact, chat, ai, credentials, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
/* eslint-disable */
@@@ -56,7 +56,7 @@ const { paginate, offsetPager } = __load(7);
const semver = __load(6);
/** The package version (test/version.test.js keeps it equal to package.json). */
--const SDK_VERSION = '0.124.0';
++const SDK_VERSION = '0.125.0';
module.exports = {
createClient,
ddiff --git a/package-lock.json b/package-lock.json
iindex a208330..2c943e3 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -1,12 +1,12 @@
{
"name": "openvibe-sdk",
-- "version": "0.124.0",
++ "version": "0.125.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openvibe-sdk",
-- "version": "0.124.0",
++ "version": "0.125.0",
"license": "MIT",
"bin": {
"openvibe-download": "bin/openvibe-download.js"
ddiff --git a/package.json b/package.json
iindex 255d4a3..2522844 100644
---- a/package.json
++++ b/package.json
@@@ -1,6 +1,6 @@
{
"name": "openvibe-sdk",
-- "version": "0.124.0",
++ "version": "0.125.0",
"description": "Supported browser and server clients for the OpenVibe platform: auth (incl. developer apps), registry discovery, identity, user modules, events, realtime, media, community, Bot robots, search, chat, AI runs, Tools (registry, run API and jobs), VIP memberships and developer projects, the async PostgreSQL data layer (db) and the Valkey cache, limits store, queue and pub/sub, with deadlines, safe retries, problem errors and trace propagation.",
"main": "index.js",
"types": "types/index.d.ts",
ddiff --git a/src/blog.js b/src/blog.js
iindex dbcf670..db8d771 100644
---- a/src/blog.js
++++ b/src/blog.js
@@@ -8,6 +8,7 @@
* const blog = createBlogClient(createClient({ tokenProvider }));
* const { posts, total } = await blog.blogs.posts('goosely', { limit: 10 }); // published, public
* const { post } = await blog.posts.create('goosely', { title: 'Tonight on stream', body: '…', visibility: 'public' });
++ * const { post } = await blog.posts.create('goosely', { title: 'With blocks', blocks: { type: 'root', children: [] } });
* await blog.posts.update(post.id, { body: '… (edited)', expected_revision: 1 }); // a new revision
* await blog.posts.publish(post.id); // the latest revision
* await blog.posts.schedule(post.id, { at: '2026-10-21T18:00:00Z' });
@@@ -48,12 +49,22 @@ function createBlogClient(client, { baseUrl } = {}) {
feed: (h, { signal } = {}) => call({ path: `${handle(h)}/feed`, signal }),
},
posts: {
-- /** A draft on a blog the person belongs to (blog.post-create-request@1: title required) → { post, revision }. */
++ /**
++ * A draft on a blog the person belongs to (blog.post-create-request@1: title required) → { post, revision }.
++ * The body is Markdown, or the blocks of a body: posts.create(handle, { title, markdown }) or
++ * posts.create(handle, { title, blocks }). The Markdown is what the post keeps, so blocks are
++ * written back as the Markdown they parse from.
++ */
create: (h, fields, { signal } = {}) => {
if (!fields || typeof fields.title !== 'string' || !fields.title.trim()) throw new TypeError('blog.posts.create: a title');
++ if (fields.blocks !== undefined && fields.blocks !== null && fields.body === undefined && fields.markdown === undefined) {
++ if (typeof fields.blocks !== 'object') throw new TypeError('blog.posts.create: blocks is a block tree');
++ }
return call({ method: 'POST', path: `${handle(h)}/posts`, json: fields, idempotencyKey: false, signal });
},
get: (id, { signal } = {}) => call({ path: post(id), signal }),
++ /** The blocks of a post, parsed (GET /posts/:id?format=blocks). */
++ blocks: (id, { signal } = {}) => call({ path: post(id, '?format=blocks'), signal }),
/** Edit: a new revision unless nothing changed ({ post, revision, created }); expected_revision guards a race. */
update: (id, fields, { signal } = {}) => call({ method: 'PATCH', path: post(id), json: fields, idempotent: true, signal }),
/** Publish a revision (the latest when omitted). */
ddiff --git a/src/core/index.js b/src/core/index.js
iindex d3df9d7..8495981 100644
---- a/src/core/index.js
++++ b/src/core/index.js
@@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
const semver = require('./semver');
/** The package version (test/version.test.js keeps it equal to package.json). */
--const SDK_VERSION = '0.124.0';
++const SDK_VERSION = '0.125.0';
module.exports = {
createClient,
ddiff --git a/test/locker.test.js b/test/locker.test.js
iindex 21149de..6cf3513 100644
---- a/test/locker.test.js
++++ b/test/locker.test.js
@@@ -137,9 +137,9 @@ run([
const words = phrase.split(' ');
assert.equal(words.length, 24, 'the phrase has 24 words');
for (const word of words) assert.ok(locker.WORDS.includes(word), `${word} is one of the 256`);
-- // Two phrases are never the same: the words come from the platform's CSPRNG.
++ // Two phrases are never the same: the words come from the platform's CSPRNG. (Not the first words alone: two
++ // phrases share one 1 time in 256, which failed SDK #165's macOS run on 2026-11-09.)
assert.notEqual(phrase, locker.recoveryWords());
-- assert.notEqual(phrase.split(' ')[0], locker.recoveryWords().split(' ')[0]);
// Another number of words, and the same check on a typed phrase.
assert.equal(locker.recoveryWords(12).split(' ').length, 12);
assert.equal(locker.isRecoveryPhrase(phrase), true);
ddiff --git a/test/product-modules.test.js b/test/product-modules.test.js
iindex d8c30bf..a94b09a 100644
---- a/test/product-modules.test.js
++++ b/test/product-modules.test.js
@@@ -239,6 +239,7 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
await blog.blogs.feed('goosely');
await busyOnce(() => blog.posts.create('goosely', { title: 'Tonight on stream', body: 'Hi', visibility: 'public' }));
await blog.posts.get(ids.post);
++ await blog.posts.blocks(ids.post);
await blog.posts.update(ids.post, { body: 'Hi again', expected_revision: 1 });
await blog.posts.publish(ids.post);
await blog.posts.unpublish(ids.post);
@@@ -252,11 +253,11 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
const P = `/api/v1/posts/${ids.post}`;
assert.deepStrictEqual(b.map((x) => `${x.method} ${x.url}`), [
'GET /api/v1/blogs/goosely', 'GET /api/v1/blogs/goosely/posts?limit=10&all=1', 'GET /api/v1/blogs/goosely/feed',
-- 'POST /api/v1/blogs/goosely/posts', `GET ${P}`, `PATCH ${P}`, `PATCH ${P}`, `POST ${P}/publish`, `POST ${P}/publish`,
++ 'POST /api/v1/blogs/goosely/posts', `GET ${P}`, `GET ${P}?format=blocks`, `PATCH ${P}`, `PATCH ${P}`, `POST ${P}/publish`, `POST ${P}/publish`,
`POST ${P}/unpublish`, `POST ${P}/unpublish`, `POST ${P}/schedule`, `POST ${P}/schedule`, `DELETE ${P}/schedule`,
`DELETE ${P}/schedule`, `POST ${P}/revert`, `GET ${P}/revisions`, `GET ${P}/revisions/2`, `DELETE ${P}`, `DELETE ${P}`,
]);
-- assert.deepStrictEqual(b[11].body, { at: '2026-10-21T18:00:00Z', revision: 2 });
++ assert.deepStrictEqual(b[12].body, { at: '2026-10-21T18:00:00Z', revision: 2 });
assert.throws(() => blog.posts.get('post_1'), /pst_/);
assert.throws(() => blog.posts.create('goosely', { body: 'no title' }), /title/);
assert.throws(() => blog.posts.schedule(ids.post, { at: 'tomorrow' }), /ISO 8601/);