@ossy/web
v3.0.9
Published
Web schema package — page, link, profile, and page-view document types for Ossy web properties
Readme
@ossy/web
Web schema package for the Ossy platform — document types for pages, links, profiles, and page-view analytics.
Schemas (ADR 0006)
Schema definitions live in *.schema.js and are discovered at build time.
| Schema | Id | Purpose |
|---|---|---|
| Link | @ossy/web/schema/link | Navigation links (label, url, icon) |
| Page | @ossy/web/schema/page | Web pages (title, description, body) |
| Page View | @ossy/web/schema/page-view | Analytics events (path, referrer, visitorId, eventAt, …) |
| Profile | @ossy/web/schema/profile | Public profile content (name, bio) |
Page-view documents are typically written to /@ossy/analytics/page-views/ by @ossy/resources tasks.
Exports
| Export | Description |
|---|---|
| linkSchema | Link schema definition |
| pageSchema | Page schema definition |
| pageViewSchema | Page-view analytics schema definition |
| profileSchema | Profile schema definition |
Usage
npm install @ossy/web
npm run buildimport { pageSchema, pageViewSchema } from '@ossy/web'
pageSchema.id
// => '@ossy/web/schema/page'Migration from resource templates
This package migrated from *.resource.js to ADR 0006 schemas. Stored resource.type values and export names changed:
| Before | After |
|---|---|
| @ossy/web/link | @ossy/web/schema/link |
| @ossy/web/page | @ossy/web/schema/page |
| @ossy/web/page-view | @ossy/web/schema/page-view |
| @ossy/web/profile | @ossy/web/schema/profile |
| linkResource export | linkSchema |
| pageResource export | pageSchema |
| pageViewResource export | pageViewSchema |
| profileResource export | profileSchema |
