openvibers/openvibe.sdk Commits

Add Shoes product SDK client (0.111.0) (#157)

OP OpenVibers committed 4 days ago · 98c543756f · 17 files, +100 −19

* Add Design glyph API client

* Add Shoes product SDK client

* Merge remote-tracking branch 'origin/main' into feature/icon-sdk

# Conflicts:
#	esm/index.mjs
#	test/pack.test.js

* Release 0.110.0

* Merge remote-tracking branch 'origin/main' into feature/icon-sdk

# Conflicts:
#	CHANGELOG.md
#	README.md
#	STATUS.json
#	browser/openvibe-sdk.mjs
#	package-lock.json
#	package.json
#	src/core/index.js

* Merge remote-tracking branch 'origin/feature/icon-sdk' into shoes-sdk-1109

# Conflicts:
#	esm/index.mjs

* Release 0.111.0

* Add shoes to the browser-blocked subpath list

* Merge main (the release below is in it)

Changes

ddiff --git a/CHANGELOG.md b/CHANGELOG.md
iindex cf60145..00acd96 100644
---- a/CHANGELOG.md
++++ b/CHANGELOG.md
@@@ -1,5 +1,12 @@
# Changelog
++## 0.111.0 — 2026-11-09
++
++- **`openvibe-sdk/shoes`: the Open.Shoes catalogue and sizing tools.**
++ - `createShoesClient(client)` (server-side; `./shoes` is browser-blocked) exposes public reads only:
++ `products.list({ kind, q, size })`, `products.get(id)`, `products.offers(id)`, `tools.laceLength({...})`
++ and `sizes.convert({ system, size, brand })`.
++
## 0.110.0 — 2026-11-09
- **`openvibe-sdk/design`: a typed client for the Design glyph API.**
ddiff --git a/README.md b/README.md
iindex d87ef6e..05b3f87 100644
---- a/README.md
++++ b/README.md
@@@ -2,7 +2,7 @@
> Supported browser and server clients for the OpenVibe platform.
--**Status:** alpha, v0.110.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.111.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.
@@@ -11,7 +11,7 @@
After v0.97.1 is tagged:
```bash
--npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.110.0
++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.111.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 1809b8e..90e3af0 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -3,7 +3,7 @@
"stage": "alpha",
"code": true,
"wave": "W2",
-- "version": "0.110.0",
++ "version": "0.111.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 7c163a9..9d586b8 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.110.0, MIT). Do not edit.
++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.111.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, community, homeFeed, bot, search, bench, meme, vision, themes, redact, chat, ai, credentials, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
/* eslint-disable */
@@@ -52,7 +52,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.110.0';
++const SDK_VERSION = '0.111.0';
module.exports = {
createClient,
ddiff --git a/docs/api-surface.json b/docs/api-surface.json
iindex c0ea8c2..fbc30b3 100644
---- a/docs/api-surface.json
++++ b/docs/api-surface.json
@@@ -347,6 +347,11 @@
]
},
"share": "function",
++ "shoes": {
++ "object": [
++ "createShoesClient"
++ ]
++ },
"space": {
"object": [
"createSpaceClient"
@@@ -1065,6 +1070,9 @@
"shareOpenApi": "function",
"sharesSchema": "function"
},
++ "openvibe-sdk/shoes": {
++ "createShoesClient": "function"
++ },
"openvibe-sdk/space": {
"createSpaceClient": "function"
},
ddiff --git a/esm/index.mjs b/esm/index.mjs
iindex 5511152..16ce6bd 100644
---- a/esm/index.mjs
++++ b/esm/index.mjs
@@@ -11,9 +11,9 @@ export const {
themes, redact, chat, chatApps, ai, credentials,
jobs, tools, projects, resources, vip, quest,
live, inventory, tips, blog, reviews, wiki,
-- coupons, deals, trade, space, host, news,
-- food, actor, run, video, work, zone,
-- play, download, openre, geo, usage, commerce,
-- telemetry, design,
++ coupons, deals, shoes, trade, space, host,
++ news, food, actor, run, video, work,
++ zone, play, download, openre, geo, usage,
++ commerce, telemetry, design,
} = cjs;
export default cjs;
ddiff --git a/esm/shoes.mjs b/esm/shoes.mjs
nnew file mode 100644
iindex 0000000..f196b1a
---- /dev/null
++++ b/esm/shoes.mjs
@@@ -0,0 +1,5 @@
++// Generated by scripts/esm.js from src/shoes.js. Do not edit.
++import cjs from '../src/shoes.js';
++
++export const { createShoesClient } = cjs;
++export default cjs;
ddiff --git a/index.js b/index.js
iindex 7309e02..6507a8e 100644
---- a/index.js
++++ b/index.js
@@@ -47,6 +47,7 @@ module.exports = {
wiki: require('./src/wiki'),
coupons: require('./src/coupons'),
deals: require('./src/deals'),
++ shoes: require('./src/shoes'),
trade: require('./src/trade'),
space: require('./src/space'),
host: require('./src/host'),
ddiff --git a/package-lock.json b/package-lock.json
iindex e7f64d8..b197748 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -1,12 +1,12 @@
{
"name": "openvibe-sdk",
-- "version": "0.110.0",
++ "version": "0.111.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openvibe-sdk",
-- "version": "0.110.0",
++ "version": "0.111.0",
"license": "MIT",
"bin": {
"openvibe-download": "bin/openvibe-download.js"
ddiff --git a/package.json b/package.json
iindex 2b03294..ba7e4db 100644
---- a/package.json
++++ b/package.json
@@@ -1,6 +1,6 @@
{
"name": "openvibe-sdk",
-- "version": "0.110.0",
++ "version": "0.111.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",
@@@ -435,6 +435,12 @@
"import": "./esm/deals.mjs",
"default": "./src/deals.js"
},
++ "./shoes": {
++ "types": "./types/shoes.d.ts",
++ "browser": null,
++ "import": "./esm/shoes.mjs",
++ "default": "./src/shoes.js"
++ },
"./trade": {
"types": "./types/trade.d.ts",
"browser": null,
ddiff --git a/src/core/index.js b/src/core/index.js
iindex a8d350f..ec031c3 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.110.0';
++const SDK_VERSION = '0.111.0';
module.exports = {
createClient,
ddiff --git a/src/shoes.js b/src/shoes.js
nnew file mode 100644
iindex 0000000..94232ad
---- /dev/null
++++ b/src/shoes.js
@@@ -0,0 +1,25 @@
++'use strict';
++
++/** Open.Shoes public catalogue and size tools. All methods are public reads. */
++function createShoesClient(client, { baseUrl } = {}) {
++ if (!client || typeof client.json !== 'function') throw new TypeError('createShoesClient: pass an openvibe-sdk/core client');
++ const at = { service: 'shoes', baseUrl, audience: 'open.shoes' };
++ const call = (opts) => client.json({ ...at, ...opts });
++ return {
++ products: {
++ list: ({ kind, q, size, signal } = {}) => call({ path: '/api/v1/products', query: { kind, q, size }, signal }),
++ get: (id, { signal } = {}) => call({ path: `/api/v1/products/${encodeURIComponent(String(id))}`, signal }),
++ offers: (id, { signal } = {}) => call({ path: `/api/v1/products/${encodeURIComponent(String(id))}/offers`, signal }),
++ },
++ tools: {
++ laceLength: ({ eyelet_pairs, method, horizontal_cm, vertical_cm, ends_cm, signal } = {}) => call({
++ path: '/api/v1/tools/lace-length', query: { eyelet_pairs, method, horizontal_cm, vertical_cm, ends_cm }, signal,
++ }),
++ },
++ sizes: {
++ convert: ({ system, size, brand, signal } = {}) => call({ path: '/api/v1/sizes/convert', query: { system, size, brand }, signal }),
++ },
++ };
++}
++
++module.exports = { createShoesClient };
ddiff --git a/test/browser-entries.test.js b/test/browser-entries.test.js
iindex 2853905..3e63b17 100644
---- a/test/browser-entries.test.js
++++ b/test/browser-entries.test.js
@@@ -76,7 +76,7 @@ run([
for (const [re, why] of FORBIDDEN) if (re.test(src)) problems.push(`${path.relative(ROOT, file)}: ${why}`);
}
assert.deepEqual(problems, []);
-- assert.deepEqual(blocked.sort(), ['./account-data', './actor', './app-signin', './assertions', './blog', './cache', './chat-apps', './commerce', './compute', './consent', './cost', './coupons', './db', './deals', './delivery', './design', './download', './events', './exchange', './food', './govern', './host', './identity', './inventory', './limits', './live', './menu', './news', './node', './notifications', './openre', './placement', './play', './pubsub', './quest', './queue', './reports', './resources', './reviews', './run', './runtime', './service', './share', './space', './sso', './storage', './streams', './telemetry', './testing', './tips', './trade', './usage', './valkey', './vibes', './video', './vip', './wiki', './work', './zone']);
++ assert.deepEqual(blocked.sort(), ['./account-data', './actor', './app-signin', './assertions', './blog', './cache', './chat-apps', './commerce', './compute', './consent', './cost', './coupons', './db', './deals', './delivery', './design', './download', './events', './exchange', './food', './govern', './host', './identity', './inventory', './limits', './live', './menu', './news', './node', './notifications', './openre', './placement', './play', './pubsub', './quest', './queue', './reports', './resources', './reviews', './run', './runtime', './service', './share', './shoes', './space', './sso', './storage', './streams', './telemetry', './testing', './tips', './trade', './usage', './valkey', './vibes', './video', './vip', './wiki', './work', './zone']);
const rel = [...scanned].map((f) => path.relative(ROOT, f).split(path.sep).join('/')); // the same names on Windows
for (const must of ['browser.js', 'src/core/client.js', 'src/auth/browser.js', 'src/cam/index.js', 'src/realtime.js', 'src/media.js', 'src/community.js', 'src/bot.js', 'src/modules.js', 'src/registry.js', 'src/jobs.js', 'src/tools.js', 'src/core/form.js', 'src/projects.js', 'browser/openvibe-sdk.mjs']) {
assert.ok(rel.includes(must), `${must} is scanned`);
ddiff --git a/test/pack.test.js b/test/pack.test.js
iindex b289d99..0d2b576 100644
---- a/test/pack.test.js
++++ b/test/pack.test.js
@@@ -72,7 +72,7 @@ run([
})().catch((err) => { console.error(err); process.exit(1); });`;
const res = execFileSync(process.execPath, ['-e', script], { cwd: app, encoding: 'utf8' });
assert.match(res, new RegExp(`consumer ok: ${subpaths.length} subpaths \\+ the browser bundle`));
-- assert.equal(subpaths.length, 94); // Adds the Design icon client.
++ assert.equal(subpaths.length, 95); // Adds the Shoes product client.
assert.ok(!fs.existsSync(path.join(app, 'node_modules/openvibe-contracts')), 'the optional peer is not installed');
} finally {
fs.rmSync(tmp, { recursive: true, force: true });
ddiff --git a/test/product-modules.test.js b/test/product-modules.test.js
iindex a093b95..d8c30bf 100644
---- a/test/product-modules.test.js
++++ b/test/product-modules.test.js
@@@ -16,6 +16,7 @@ const { createReviewsClient } = require('../src/reviews');
const { createWikiClient } = require('../src/wiki');
const { createCouponsClient } = require('../src/coupons');
const { createDealsClient } = require('../src/deals');
++const { createShoesClient } = require('../src/shoes');
const { createTradeClient } = require('../src/trade');
const { createSpaceClient } = require('../src/space');
const { createHostClient } = require('../src/host');
@@@ -54,7 +55,7 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
const base = `http://127.0.0.1:${server.address().port}`;
const audiences = [];
const client = createClient({
-- baseUrls: { food: `${base}/food`, actor: `${base}/actor`, run: `${base}/run`, 'media-hub': `${base}/video`, work: `${base}/work`, zone: `${base}/zone`, blog: `${base}/blog`, reviews: `${base}/reviews`, wiki: `${base}/wiki`, coupons: `${base}/coupons`, deals: `${base}/deals`, trade: `${base}/trade`, space: `${base}/space`, host: `${base}/host`, news: `${base}/news` },
++ baseUrls: { food: `${base}/food`, actor: `${base}/actor`, run: `${base}/run`, 'media-hub': `${base}/video`, work: `${base}/work`, zone: `${base}/zone`, blog: `${base}/blog`, reviews: `${base}/reviews`, wiki: `${base}/wiki`, coupons: `${base}/coupons`, deals: `${base}/deals`, shoes: `${base}/shoes`, trade: `${base}/trade`, space: `${base}/space`, host: `${base}/host`, news: `${base}/news` },
getToken: ({ audience }) => { audiences.push(audience); return `tok-${audience}`; },
retries: 2, retryDelayMs: 1, maxRetryDelayMs: 2,
});
@@@ -351,6 +352,21 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
assert.throws(() => deals.offers.flag('off_2', { kind: 'meh' }), /kind is one of/);
assert.throws(() => deals.offers.list({ sort: 'top' }), /hot/);
++ // ── Shoes ─────────────────────────────────────────────
++ const shoes = createShoesClient(client);
++ mark = since();
++ await shoes.products.list({ kind: 'kids', q: 'sneaker', size: '2' });
++ await shoes.products.get('stride-rite-runner');
++ await shoes.products.offers('stride-rite-runner');
++ await shoes.tools.laceLength({ eyelet_pairs: 6, method: 'criss-cross' });
++ await shoes.sizes.convert({ brand: 'darn-tough', system: 'women', size: '8' });
++ const shoesCalls = mark();
++ assert.deepStrictEqual(shoesCalls.map((x) => `${x.method} ${x.url}`), [
++ 'GET /api/v1/products?kind=kids&q=sneaker&size=2', 'GET /api/v1/products/stride-rite-runner',
++ 'GET /api/v1/products/stride-rite-runner/offers', 'GET /api/v1/tools/lace-length?eyelet_pairs=6&method=criss-cross',
++ 'GET /api/v1/sizes/convert?system=women&size=8&brand=darn-tough',
++ ]);
++
// ── Trade ─────────────────────────────────────────────
const trade = createTradeClient(client);
mark = since();
@@@ -457,11 +473,11 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
assert.throws(() => news.stories.get(''), /story/);
// Each product's token is for its own audience (Video's is the media hub's, openvibe.download).
-- assert.deepStrictEqual([...new Set(audiences)].sort(), ['openvibe.actor', 'openvibe.blog', 'openvibe.coupons', 'openvibe.deals', 'openvibe.download', 'openvibe.food', 'openvibe.reviews', 'openvibe.run', 'openvibe.space', 'openvibe.trade', 'openvibe.wiki', 'openvibe.work', 'openvibe.zone']);
-- assert.ok(seen.filter((x) => x.svc !== 'host' && x.svc !== 'news').every((x) => x.auth === `Bearer tok-${{ food: 'openvibe.food', actor: 'openvibe.actor', run: 'openvibe.run', video: 'openvibe.download', work: 'openvibe.work', zone: 'openvibe.zone', blog: 'openvibe.blog', reviews: 'openvibe.reviews', wiki: 'openvibe.wiki', coupons: 'openvibe.coupons', deals: 'openvibe.deals', trade: 'openvibe.trade', space: 'openvibe.space' }[x.svc]}`));
++ assert.deepStrictEqual([...new Set(audiences)].sort(), ['open.shoes', 'openvibe.actor', 'openvibe.blog', 'openvibe.coupons', 'openvibe.deals', 'openvibe.download', 'openvibe.food', 'openvibe.reviews', 'openvibe.run', 'openvibe.space', 'openvibe.trade', 'openvibe.wiki', 'openvibe.work', 'openvibe.zone']);
++ assert.ok(seen.filter((x) => x.svc !== 'host' && x.svc !== 'news').every((x) => x.auth === `Bearer tok-${{ food: 'openvibe.food', actor: 'openvibe.actor', run: 'openvibe.run', video: 'openvibe.download', work: 'openvibe.work', zone: 'openvibe.zone', blog: 'openvibe.blog', reviews: 'openvibe.reviews', wiki: 'openvibe.wiki', coupons: 'openvibe.coupons', deals: 'openvibe.deals', shoes: 'open.shoes', trade: 'openvibe.trade', space: 'openvibe.space' }[x.svc]}`));
// Each client needs a core client.
-- for (const make of [createFoodClient, createActorClient, createRunClient, createVideoClient, createWorkClient, createZoneClient, createBlogClient, createReviewsClient, createWikiClient, createCouponsClient, createDealsClient, createTradeClient, createSpaceClient, createHostClient, createNewsClient]) assert.throws(() => make({}), /core client/);
++ for (const make of [createFoodClient, createActorClient, createRunClient, createVideoClient, createWorkClient, createZoneClient, createBlogClient, createReviewsClient, createWikiClient, createCouponsClient, createDealsClient, createShoesClient, createTradeClient, createSpaceClient, createHostClient, createNewsClient]) assert.throws(() => make({}), /core client/);
console.log('product modules (food, actor, run, video, work, zone, blog, reviews, wiki, coupons, deals, trade, space, host, news): all checks passed');
} finally {
server.close();
ddiff --git a/types/index.d.ts b/types/index.d.ts
iindex f963f1a..e2b3146 100644
---- a/types/index.d.ts
++++ b/types/index.d.ts
@@@ -38,6 +38,7 @@ export * as meme from './meme';
export * as wiki from './wiki';
export * as coupons from './coupons';
export * as deals from './deals';
++export * as shoes from './shoes';
export * as trade from './trade';
export * as space from './space';
export * as host from './host';
ddiff --git a/types/shoes.d.ts b/types/shoes.d.ts
nnew file mode 100644
iindex 0000000..0585c8e
---- /dev/null
++++ b/types/shoes.d.ts
@@@ -0,0 +1,12 @@
++/** openvibe-sdk/shoes: Open.Shoes public catalog and tools. */
++export type ProductKind = 'shoe' | 'laces' | 'socks' | 'care' | 'insoles' | 'kids';
++export interface ShoesClient {
++ products: {
++ list(args?: { kind?: ProductKind; q?: string; size?: string; signal?: AbortSignal }): Promise<{ products: unknown[]; total: number }>;
++ get(id: string, options?: { signal?: AbortSignal }): Promise<{ product: unknown }>;
++ offers(id: string, options?: { signal?: AbortSignal }): Promise<{ offers: unknown[] }>;
++ };
++ tools: { laceLength(args: { eyelet_pairs: number; method?: string; horizontal_cm?: number; vertical_cm?: number; ends_cm?: number; signal?: AbortSignal }): Promise<{ cm: number; inches: number; method: string }> };
++ sizes: { convert(args: { system: string; size: string; brand?: string; signal?: AbortSignal }): Promise<{ conversions: unknown[] }> };
++}
++export function createShoesClient(client: { json(opts: Record<string, unknown>): Promise<any> }, options?: { baseUrl?: string }): ShoesClient;