Docs
/

@leumas/schemas

Canonical Leumas data model — Drizzle (libSQL/SQLite) tables + drizzle-zod validators + enums. DB-agnostic definitions, no runtime connection.

@leumas/schemas

The canonical Leumas data model — one source of truth for every product/engine/service.

  • Drizzle tables (src/schema/*) for libSQL/SQLite (drizzle-orm/sqlite-core).
  • drizzle-zod validators (src/validators.js) — insert/select schemas derived from the tables.
  • Enums (src/enums.js) — role/status/type vocabularies shared as arrays.

DB-agnostic definitions only — no connection. The runtime client, migrations, seed, and the generic repository live in @leumas/db. The dynamic (schema-less) CRUD connector lives in shared/engines/middleware. Both point at the same libSQL file.

import * as schema from '@leumas/schemas/schema';   // drizzle(client, { schema })
import { users, memberships, ROLES, insertUserSchema } from '@leumas/schemas';

Tables (grouped)

  • identityusers, admins, temporary_users, leumas_ids, sessions
  • rbacroles, permissions, user_roles, role_permissions
  • monetizationmemberships, dev_api_keys, token_transactions
  • gamificationlevel_badge_definitions, user_badge_unlocks, user_experience_events
  • socialposts, post_media, comments, post_likes, comment_likes, friendships,

friend_requests, conversations, conversation_members, messages, message_reads, notifications

Conventions

  • Text UUID primary keys (crypto.randomUUID()); timestamps as epoch-ms integers.
  • Mongo embedded arrays → child/join tables (post_media, post_likes, conversation_members, …).
  • Tokens are whole integers ($1 each); token_transactions is an append-only ledger.
  • Supersedes the legacy Mongoose @leumas-tech/leumas-schemas and leumas-schema-library.

What it exports

204 exports: 86 components, 0 hooks, 118 helpers. Import from @leumas/schemas.

ACCOUNT_STATUSACTION_IDSACTIONSAPI_KEY_ENVAPI_KEY_SCOPESAPI_KEY_STATUSARTIFACT_KINDSARTIFACT_SCOPESARTIFACT_SCRATCH_ROOTARTIFACT_SOURCE_TYPESARTIFACT_VERSIONBADGE_REQUIREMENT_TYPECAPABILITY_POLICY_MODESCAPTURE_SOURCESCAPTURE_TRIGGERSCONTROL_PLANE_DEPLOYMENTSCONTROL_PLANE_ROLESCONVERSATION_KINDCOSMETIC_SOURCECOSMETIC_UNLOCK_TYPECSS_NAMED_COLORSDECLARED_FROMDOC_COLLECTIONSDOC_SCHEMASENTITY_IDSENTITY_TYPESEXECUTOR_KINDSFRIEND_REQUEST_STATUSGROUP_VISIBILITYGYM_BOOKING_STATUSGYM_COACHING_STATUSGYM_EFFORT_SCALEGYM_GOAL_KINDGYM_JOIN_POLICYGYM_KINDGYM_LOGGING_MODEGYM_MEMBER_ROLEGYM_MEMBER_STATUSGYM_PLAN_INTERVALGYM_POLICYGYM_SESSION_STATUSGYM_SUBSCRIPTION_SOURCEGYM_SUBSCRIPTION_STATUSGYM_VISIT_SOURCEHOUSE_COLOR_TABLELEUMAS_ID_STATUSLICENSE_ACTIVATION_STATUSLICENSE_STATUSLISTING_STATUSMEDIA_KINDMEDIA_TYPEMEMBERSHIP_STATUSMESSAGE_KINDMOD_ACTIONNOTIFICATION_TYPEORDER_STATUSPASSNODE_TYPESPAYOUT_STATUSPERMISSIONSPOST_TYPEPOST_VISIBILITYPUBLIC_DEPLOYMENTSQR_CODE_KINDQR_CODE_STATUSQR_REPORT_STATUSQUEST_STATUSRARITY_KEYSREPORT_STATUSREPORT_TARGETROLESRUNTIMESSALE_TYPESCRATCH_ABANDONED_TTL_MSSCRATCH_TTL_MSSERVICE_IDSSERVICESSHAPE_IDSSHAPESSING_CHALLENGE_STATUSSING_GRADESING_MODESUBDIVISIONSTOKEN_TXN_SOURCETOKEN_TXN_TYPETRUSTED_FROMVOICE_ENGINESactionDocSchemaappointmentsapprovalsartifactKindOfassetToArtifactavailabilityRulesaxesOfbucketOfcapabilitySchemacaseParticipantscaseschatbotSchemacheckClosedOptionscreateOptionsCachecreateOptionsResolverdescribeCallabledescribeOutputsdisplayNamedocInputsdocumentsemploymentsentityIdOfentityLabelOfentityOfextensionForfieldTypeForfillLabelfillTokensformDefinitionsformSubmissionsfromBase64functioncallSchemagradeClassificationhintedEntityinferEntityinputsToFieldsinputsToJsonSchemainsertCategorySchemainsertCommentSchemainsertDevApiKeySchemainsertFriendRequestSchemainsertGroupSchemainsertListingSchemainsertMediaAssetSchemainsertMembershipSchemainsertMessageSchemainsertNotificationSchemainsertPermissionSchemainsertPlaylistSchemainsertPostSchemainsertProfileSchemainsertReportSchemainsertReviewSchemainsertRoleSchemainsertRoomSchemainsertUserSchemainsertValidatorsinstitutionEventsisActionisControlPlaneisDeclaredisExpiredisPublicDeploymentisServiceisShapeisTrustedjournalsjsonSchemaShapejsonSchemaToDescriptorsknownColorsOfknownSubdivisionledgerAccountsledgerEntriesmakeArtifactMetamanifestSchemanormalizeInputsnormalizeOutputsoptionFilterFacetsoptionsCacheKeyoptionsDependenciesoptionsReadyoptionsSourceOforganizationsoutputPathsoutputsToJsonSchemaoutputsToRowspassnodeRuleSchemapersonProfilespersonspositionsprefersPositionalprojectOptionsproviderManifestSchemareadOnlyOperationsreasonForBareIdresolveEntityresolveFunctionSpecresourcesresultSchemaroleGrantsruleSchemascratchBundleKeyscratchFolderForseedFromInputsselectionNoteselectUserSchemaselectVariantsshapeOfsubdivisionsOfswatchCoverageswatchFortableInputstoBase64toolbankSchema

Showing 200 of 204. See them all in the component index.

Source shared/packages/schemas/README.md (no-git)markdownjson
Generated from the Leumas repository. Every page cites the file it came from.leumas.techllms.txt