feat(api): @xenia/api + @xenia/access; the manager logs in and loads bootstrap through them
Platform-v2 step 2.5 (APPS_PLATFORM D-7, D-10, §9): - @xenia/api: createApiClient (app passes its axios; session/device headers, err.xenia codes, 401/offline hooks, manager-override retry: ask PIN, grant, retry once with X-Xenia-Override); errorMessage; createLiveClient = the waiter's WebSocket logic (cursor replay, backoff, online) moved unchanged - @xenia/access: AccessProvider (bootstrap per session token, language + venue formats, translated ui labels, approval dialog), useAccess/useCan/ useModule, Can, RequireModule - i18n: errors namespace for every backend code (en/el, test vs core/errors.py), override/access texts - manager: client from createApiClient, AccessProvider in a layout route, /kds behind RequireModule, usePermissions from bootstrap keys; login and unlock no longer treat a wrong password/PIN as "session ended" (a wrong lock-screen PIN used to log the manager out) - waiter: useWebSocket is a thin wrapper over createLiveClient - tests: api/access unit tests; new e2e suite tests/e2e/manager.mjs; CS-18 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
// @xenia/access — Bootstrap provider and module/permission hooks: useModule, useCan, <Can>, <RequireModule> (plan step 2.5).
|
||||
// Imported from source by Vite (no build step). Filled in by its plan step.
|
||||
export {}
|
||||
// @xenia/access — what this venue has turned on and what the signed-in user may do,
|
||||
// for every frontend (plan step 2.5, APPS_PLATFORM §5, §6, §9). React; imported from source.
|
||||
//
|
||||
// <AccessProvider client={client} token={token} i18n={i18n}> loads bootstrap, sets language,
|
||||
// … mounts the manager-approval dialog
|
||||
// useAccess() → { venue, user, permissions, modules, license, refresh }
|
||||
// useModule('kds') · useCan('catalog.menu.manage') · useCan([a, b]) (any) · useCan([a, b], { all: true })
|
||||
// <Can perm="…" fallback={…}> · <RequireModule module="…">
|
||||
//
|
||||
// UI hiding only: the backend checks every request (CS-14).
|
||||
|
||||
export { AccessProvider } from './AccessProvider.jsx'
|
||||
export { useAccess, useModule, useCan, can } from './hooks.js'
|
||||
export { Can, RequireModule, ModuleOff, NoAccess } from './guards.jsx'
|
||||
export { OverrideHost } from './OverrideHost.jsx'
|
||||
|
||||
Reference in New Issue
Block a user