Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

2.6 KB
Raw Blame

Core Models

This package serves as the single source of truth for data models across all AliasVault platforms.

What This Does

This package performs two key functions:

1. TypeScript Distribution (Linked as Source)

TypeScript models are consumed as the @aliasvault/models package:

  • Browser Extension: linked as source through @aliasvault/models (see core/client)
  • Mobile App: linked as source through @aliasvault/models (a file: dependency; metro.config.js watches core/)

2. Native Code Generation (Transformed)

Automatically generates platform-specific models from TypeScript sources:

Source Generated Output Language
src/vault/FieldKey.ts apps/mobile-app/ios/VaultModels/FieldKey.swift Swift
src/vault/FieldKey.ts apps/mobile-app/android/.../vaultstore/models/FieldKey.kt Kotlin

Icons (UI, item type and built-in logos) are generated from the SVG files in core/assets/icons by scripts/generate-icons.cjs; see core/assets/icons/README.md for more details.

3. Registry and Vocabulary Generators

Generator Source of truth Emits
scripts/generate-vault-table-registry.cjs src/vault/VaultTableRegistry.ts the Rust codec's datamodel registry, the C# VaultTableRegistry, and VaultDataBucketCategory (C#, Swift, Kotlin)
scripts/generate-key-vocabulary.cjs the VOCABULARIES table inside the script UnlockMethodType, ManifestKeyType, VaultKeyAlgorithm
scripts/generate-app-defaults.cjs src/defaults/AppDefaults.ts the Swift and Kotlin AppInfo (minimum server version, default URLs)
scripts/generate-colors.cjs core/assets/colors/palette.json the TS palette, the Tailwind preset, Swift ColorConstants and Android av_colors.xml; see core/assets/colors/README.md

The key vocabulary is the set of tokens naming how a vault key is protected, which unlock method encrypts a user's Account Key, how a manifest's VEK reaches a given user, and which algorithm a piece of key ciphertext uses. Each token is a contract shared by the API, the database and every client, so it is declared once and emitted per platform. A member's token is the only identifier that is persisted or transmitted; the C# enum ordinals follow declaration order and are cosmetic, so members can be reordered freely.