managarten/packages/shared-branding/src/index.ts
Till JS 166d6c6ffb feat(spaces): validate space metadata on Better Auth organization hooks
Moves the canonical SpaceType + SPACE_MODULE_ALLOWLIST to @mana/shared-types
(framework-free) so the Bun services can consume them without pulling in
Svelte. shared-branding keeps only the UI-facing labels and descriptions
and re-exports the canonical types for frontend convenience.

Wires two Better Auth organization hooks in mana-auth:
- beforeCreateOrganization asserts metadata.type is a valid SpaceType,
  rejecting the create with a BAD_REQUEST otherwise.
- beforeDeleteOrganization rejects deletion of the personal space.

Covered by bun tests (11 assertions) for the helper module.

No migration and no schema change — type lives in the existing
organization.metadata jsonb column.

Plan: docs/plans/spaces-foundation.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 16:05:38 +02:00

86 lines
1.8 KiB
TypeScript

/**
* Shared branding components and configuration for the Mana ecosystem
*
* This package provides:
* - App logos (AppLogo, AppLogoWithName)
* - Pre-configured app logos (MemoroLogo, ManaLogo, etc.)
* - Mana icon (ManaIcon)
* - Branding configuration (colors, names, taglines)
*/
// Generic Components
export { default as AppLogo } from './AppLogo.svelte';
export { default as AppLogoWithName } from './AppLogoWithName.svelte';
export { default as ManaIcon } from './ManaIcon.svelte';
// Pre-configured App Logos
export {
MemoroLogo,
ManaLogo,
CardsLogo,
UloadLogo,
ChatLogo,
PresiLogo,
FoodLogo,
QuotesLogo,
ContactsLogo,
CalendarLogo,
StorageLogo,
TodoLogo,
MailLogo,
MoodlitLogo,
InventoryLogo,
ClockLogo,
QuestionsLogo,
SkillTreeLogo,
PlantsLogo,
LightWriteLogo,
MusicLogo,
ContextLogo,
CitycornersLogo,
} from './logos';
// Configuration
export { APP_BRANDING, getAppBranding, getAllAppBrandings } from './config';
// App Icons (SVG data URLs)
export { APP_ICONS, type AppIconId } from './app-icons';
// Mana Apps Configuration
export {
MANA_APPS,
getManaApp,
getManaAppsByStatus,
getAvailableManaApps,
getActiveManaApps,
getAccessibleManaApps,
hasAppAccess,
getTierLevel,
APP_STATUS_LABELS,
APP_SLIDER_LABELS,
APP_URLS,
ACCESS_TIER_LABELS,
getPillAppItems,
type ManaApp,
type AppStatus,
type AccessTier,
type PillAppItemConfig,
} from './mana-apps';
// Types
export type { AppId, AppBranding, LogoProps, AppLogoWithNameProps } from './types';
// Spaces (multi-tenancy primitive — see docs/plans/spaces-foundation.md)
// Canonical types live in @mana/shared-types; branding adds only UI strings.
export {
SPACE_TYPES,
SPACE_TYPE_LABELS,
SPACE_TYPE_DESCRIPTIONS,
SPACE_MODULE_ALLOWLIST,
isModuleAllowedInSpace,
isSpaceType,
parseSpaceMetadata,
type SpaceType,
type SpaceModuleId,
type SpaceMetadata,
} from './spaces';