@ossy/profile
v3.9.0
Published
Profile feature package — professional profile schema, hooks, and account management pages
Readme
@ossy/profile
Profile feature package for the Ossy platform — canonical professional profile schema, data hooks, display helpers, and account management pages.
Platform profile
| Export | Description |
|---|---|
| ProfileSchema | Canonical schema id (@ossy/profile/schema/profile) |
| profileSchema | Schema definition (fields for name, role, summary, contact, tags) |
| location | Resource namespace (/@ossy/profile/) |
| shapeProfile | Map a profile resource (+ image) to @ossy/design-system Profile props |
| useProfile(resourceId) | Load and shape a profile by resource id |
| useWorkspaceProfile(resourceId?) | Resolve the current workspace profile by id, route param, or first resource at location |
| ProfileView | useProfile + Profile for standalone profile pages |
Presentation UI lives in @ossy/design-system (Profile). Feature packages (@ossy/resumes, @ossy/consulting, …) compose around the shared profile primitive.
Schemas
| Schema id | Location | Purpose |
|---|---|---|
| @ossy/profile/schema/profile | /@ossy/profile/ | Public professional profile (name, role, summary, contact, tags) |
| @ossy/profile/schema/create-api-token | — | Create-token form fields (name, description, scopes) |
Import location and schema ids from @ossy/profile when creating or listing profile documents.
Account pages
Auto-discovered by @ossy/app via the "ossy": { "src": "./src" } field in package.json. Each page is wrapped in ProfileLayout (side nav, logo, sign-out).
| File | Page id | Default paths |
|---|---|---|
| ProfileDetails.page.jsx | profile | /profile (en), /profil (sv) |
| ProfileWorkspaces.page.jsx | profile/workspaces | /profile/workspaces (en), /profil/arbetsytor (sv) |
| ProfileWorkspacesCreate.page.jsx | profile/workspaces/create | /profile/workspaces/create (en), /profil/arbetsytor/skapa (sv) |
| ProfileApiTokens.page.jsx | profile/api-tokens | /profile/api-tokens (en), /profil/api-nycklar (sv) |
| ProfileApiTokensCreate.page.jsx | profile/api-tokens/create | /profile/api-tokens/create (en), /profil/api-nycklar/skapa (sv) |
ProfileDetails reads and updates the authenticated user (GetCurrentUser / UpdateUserDetails / RequestEmailChange). Edit/save and the details form use @ossy/users action + form POJOs (EditProfileDetails, SaveProfileDetails, UpdateProfileDetailsForm) so flows can drive the page via data-action / form[id]. Workspace professional profile resources (/@ossy/profile/) remain available via useWorkspaceProfile for feature packages.
Other exports
| Export | Description |
|---|---|
| ProfileLayout | Side-nav shell for account pages |
| ApiTokens / CreateApiToken | API token management |
| Definition | Feature metadata |
| profileMenuItems | Profile context menu items |
Usage
npm install @ossy/profile @ossy/design-system
npm run buildimport { Profile } from '@ossy/design-system'
import { useProfile, useWorkspaceProfile, ProfileView } from '@ossy/profile'
// By explicit resource id
const { profile, status } = useProfile(resourceId)
return <Profile {...profile} />
// Current workspace profile (details page pattern)
const { profile, hasProfile, profileId } = useWorkspaceProfile()
// Convenience wrapper
return <ProfileView resourceId={resourceId} />Preview
Profile pages are exercised in @ossy/app-test on the production build path:
cd packages/app-test
npm run build && npm run start # http://localhost:3006Sign in, then open profile routes from the sidebar or inspect capabilities at /packages/profile. See packages/app-test/README.md.
Breaking changes
ProfileCard was removed. Use Profile from @ossy/design-system with shapeProfile or ProfileView from this package instead.
Peer dependencies
| Package | Version |
|---|---|
| @ossy/design-system | >=1.0.0 |
| @ossy/resources | >=1.0.0 |
| @ossy/router-react | >=1.0.0 |
| @ossy/schema | * |
| @ossy/sdk-react | >=1.0.0 |
| @ossy/workspaces | >=1.0.0 |
| react | >=19.0.0 <20.0.0 |
