openvibers/openvibe.sdk Commits
Add Shoes product SDK client (0.111.0) (#157)
Changes
@@@ -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.**@@@ -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).@@@ -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",@@@ -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,@@@ -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"},@@@ -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;nnew file mode 100644@@@ -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;@@@ -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'),@@@ -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"@@@ -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,@@@ -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,nnew file mode 100644@@@ -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 };@@@ -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 Windowsfor (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`);@@@ -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 });@@@ -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}`, meconst 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}`, meassert.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}`, meassert.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();@@@ -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';nnew file mode 100644@@@ -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;
@@ -1,5 +1,12 @@
@@ -1,5 +1,12 @@
# Changelog
# 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
## 0.110.0 — 2026-11-09
- **`openvibe-sdk/design`: a typed client for the Design glyph API.**
- **`openvibe-sdk/design`: a typed client for the Design glyph API.**
@@ -2,7 +2,7 @@
@@ -2,7 +2,7 @@
> Supported browser and server clients for the OpenVibe platform.
> 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.
**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.
**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 @@
@@ -11,7 +11,7 @@
After v0.97.1 is tagged:
After v0.97.1 is tagged:
```bash
```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).
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).
@@ -3,7 +3,7 @@
@@ -3,7 +3,7 @@
"stage": "alpha",
"stage": "alpha",
"code": true,
"code": true,
"wave": "W2",
"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",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30",
"deployed": false,
"deployed": false,
"deployment": "none: a package released as git tags; services and apps pin a tag",
"deployment": "none: a package released as git tags; services and apps pin a tag",
@@ -1,4 +1,4 @@
@@ -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
// 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.
// (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 */
/* eslint-disable */
@@ -52,7 +52,7 @@ const { paginate, offsetPager } = __load(7);
@@ -52,7 +52,7 @@ const { paginate, offsetPager } = __load(7);
const semver = __load(6);
const semver = __load(6);
/** The package version (test/version.test.js keeps it equal to package.json). */
/** 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 = {
module.exports = {
createClient,
createClient,
@@ -347,6 +347,11 @@
@@ -347,6 +347,11 @@
]
]
},
},
"share": "function",
"share": "function",
+ "shoes": {
+ "object": [
+ "createShoesClient"
+ ]
+ },
"space": {
"space": {
"object": [
"object": [
"createSpaceClient"
"createSpaceClient"
@@ -1065,6 +1070,9 @@
@@ -1065,6 +1070,9 @@
"shareOpenApi": "function",
"shareOpenApi": "function",
"sharesSchema": "function"
"sharesSchema": "function"
},
},
+ "openvibe-sdk/shoes": {
+ "createShoesClient": "function"
+ },
"openvibe-sdk/space": {
"openvibe-sdk/space": {
"createSpaceClient": "function"
"createSpaceClient": "function"
},
},
@@ -11,9 +11,9 @@ export const {
@@ -11,9 +11,9 @@ export const {
themes, redact, chat, chatApps, ai, credentials,
themes, redact, chat, chatApps, ai, credentials,
jobs, tools, projects, resources, vip, quest,
jobs, tools, projects, resources, vip, quest,
live, inventory, tips, blog, reviews, wiki,
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;
} = cjs;
export default cjs;
export default cjs;
new file mode 100644
new file mode 100644
@@ -0,0 +1,5 @@
@@ -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;
@@ -47,6 +47,7 @@ module.exports = {
@@ -47,6 +47,7 @@ module.exports = {
wiki: require('./src/wiki'),
wiki: require('./src/wiki'),
coupons: require('./src/coupons'),
coupons: require('./src/coupons'),
deals: require('./src/deals'),
deals: require('./src/deals'),
+ shoes: require('./src/shoes'),
trade: require('./src/trade'),
trade: require('./src/trade'),
space: require('./src/space'),
space: require('./src/space'),
host: require('./src/host'),
host: require('./src/host'),
@@ -1,12 +1,12 @@
@@ -1,12 +1,12 @@
{
{
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.110.0",
+ "version": "0.111.0",
"lockfileVersion": 3,
"lockfileVersion": 3,
"requires": true,
"requires": true,
"packages": {
"packages": {
"": {
"": {
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.110.0",
+ "version": "0.111.0",
"license": "MIT",
"license": "MIT",
"bin": {
"bin": {
"openvibe-download": "bin/openvibe-download.js"
"openvibe-download": "bin/openvibe-download.js"
@@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
{
{
"name": "openvibe-sdk",
"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.",
"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",
"main": "index.js",
"types": "types/index.d.ts",
"types": "types/index.d.ts",
@@ -435,6 +435,12 @@
@@ -435,6 +435,12 @@
"import": "./esm/deals.mjs",
"import": "./esm/deals.mjs",
"default": "./src/deals.js"
"default": "./src/deals.js"
},
},
+ "./shoes": {
+ "types": "./types/shoes.d.ts",
+ "browser": null,
+ "import": "./esm/shoes.mjs",
+ "default": "./src/shoes.js"
+ },
"./trade": {
"./trade": {
"types": "./types/trade.d.ts",
"types": "./types/trade.d.ts",
"browser": null,
"browser": null,
@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
const semver = require('./semver');
const semver = require('./semver');
/** The package version (test/version.test.js keeps it equal to package.json). */
/** 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 = {
module.exports = {
createClient,
createClient,
new file mode 100644
new file mode 100644
@@ -0,0 +1,25 @@
@@ -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 };
@@ -76,7 +76,7 @@ run([
@@ -76,7 +76,7 @@ run([
for (const [re, why] of FORBIDDEN) if (re.test(src)) problems.push(`${path.relative(ROOT, file)}: ${why}`);
for (const [re, why] of FORBIDDEN) if (re.test(src)) problems.push(`${path.relative(ROOT, file)}: ${why}`);
}
}
assert.deepEqual(problems, []);
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
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']) {
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`);
assert.ok(rel.includes(must), `${must} is scanned`);
@@ -72,7 +72,7 @@ run([
@@ -72,7 +72,7 @@ run([
})().catch((err) => { console.error(err); process.exit(1); });`;
})().catch((err) => { console.error(err); process.exit(1); });`;
const res = execFileSync(process.execPath, ['-e', script], { cwd: app, encoding: 'utf8' });
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.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');
assert.ok(!fs.existsSync(path.join(app, 'node_modules/openvibe-contracts')), 'the optional peer is not installed');
} finally {
} finally {
fs.rmSync(tmp, { recursive: true, force: true });
fs.rmSync(tmp, { recursive: true, force: true });
@@ -16,6 +16,7 @@ const { createReviewsClient } = require('../src/reviews');
@@ -16,6 +16,7 @@ const { createReviewsClient } = require('../src/reviews');
const { createWikiClient } = require('../src/wiki');
const { createWikiClient } = require('../src/wiki');
const { createCouponsClient } = require('../src/coupons');
const { createCouponsClient } = require('../src/coupons');
const { createDealsClient } = require('../src/deals');
const { createDealsClient } = require('../src/deals');
+const { createShoesClient } = require('../src/shoes');
const { createTradeClient } = require('../src/trade');
const { createTradeClient } = require('../src/trade');
const { createSpaceClient } = require('../src/space');
const { createSpaceClient } = require('../src/space');
const { createHostClient } = require('../src/host');
const { createHostClient } = require('../src/host');
@@ -54,7 +55,7 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
@@ -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 base = `http://127.0.0.1:${server.address().port}`;
const audiences = [];
const audiences = [];
const client = createClient({
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}`; },
getToken: ({ audience }) => { audiences.push(audience); return `tok-${audience}`; },
retries: 2, retryDelayMs: 1, maxRetryDelayMs: 2,
retries: 2, retryDelayMs: 1, maxRetryDelayMs: 2,
});
});
@@ -351,6 +352,21 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
@@ -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.flag('off_2', { kind: 'meh' }), /kind is one of/);
assert.throws(() => deals.offers.list({ sort: 'top' }), /hot/);
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 ─────────────────────────────────────────────
// ── Trade ─────────────────────────────────────────────
const trade = createTradeClient(client);
const trade = createTradeClient(client);
mark = since();
mark = since();
@@ -457,11 +473,11 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
@@ -457,11 +473,11 @@ const ids = { plan: `pln_${ULID}`, task: `tsk_${ULID}`, agent: `agt_${ULID}`, me
assert.throws(() => news.stories.get(''), /story/);
assert.throws(() => news.stories.get(''), /story/);
// Each product's token is for its own audience (Video's is the media hub's, openvibe.download).
// 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.
// 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');
console.log('product modules (food, actor, run, video, work, zone, blog, reviews, wiki, coupons, deals, trade, space, host, news): all checks passed');
} finally {
} finally {
server.close();
server.close();
@@ -38,6 +38,7 @@ export * as meme from './meme';
@@ -38,6 +38,7 @@ export * as meme from './meme';
export * as wiki from './wiki';
export * as wiki from './wiki';
export * as coupons from './coupons';
export * as coupons from './coupons';
export * as deals from './deals';
export * as deals from './deals';
+export * as shoes from './shoes';
export * as trade from './trade';
export * as trade from './trade';
export * as space from './space';
export * as space from './space';
export * as host from './host';
export * as host from './host';
new file mode 100644
new file mode 100644
@@ -0,0 +1,12 @@
@@ -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;