@mylifematter/shared-types (1.5.0)
Installation
@mylifematter:registry=https://git.mylifematter.ru/api/packages/mlm/npm/npm install @mylifematter/shared-types@1.5.0"@mylifematter/shared-types": "1.5.0"About this package
@mylifematter/shared-types
Shared TypeScript types and event contracts used by the MyLifeMatter api and web
services. Published as a private npm package to the Gitea registry of the mlm org.
Part of the MyLifeMatter platform — see mlm/infra
for the overall architecture and how the services fit together.
Build
pnpm install
pnpm build # tsc -> dist/ (index.js + index.d.ts)
pnpm typecheck # tsc --noEmit
pnpm test # golden vectors of the E2EE envelope (node --test)
Specs
spec/ holds cross-client wire contracts that no single client owns — they are
kept here because all of mlm/web, mlm/desktop and mlm/android must agree on
them byte for byte.
spec/e2ee-envelope-v2.md— chat E2EE message envelope (per-device keys), with pseudocode and a pitfalls section.spec/e2ee-envelope-v2.golden.json— machine-readable golden vectors every client must reproduce.spec/e2ee-attachment-v1.md— encrypted chat attachments: the 1 MiB AES-256-GCM frame stream, the encrypted descriptor (name, mime, dimensions, thumbnail) and what the server still learns.spec/e2ee-attachment-v1.golden.json— golden vectors for the frame stream, range reads, tampering and key wrapping.spec/notes-markup/— golden-фикстуры разбора разметки «Заметок 2.0» ([[ссылки]],#теги, frontmatter): токенайзеры web/desktop/android обязаны совпасть с api по ссылкам и тегам. Формат кейса и правила — вREADME.md.spec/reference/— the executable spec (TypeScript reference implementation) and the test that pins the vectors. Not published in the package.
Publishing
The package is published to https://git.mylifematter.ru/api/packages/mlm/npm/
(see publishConfig in package.json). You need a Gitea token with write:package.
Create a ~/.npmrc (do not commit it) with:
@mylifematter:registry=https://git.mylifematter.ru/api/packages/mlm/npm/
//git.mylifematter.ru/api/packages/mlm/npm/:_authToken=<YOUR_GITEA_TOKEN>
Then:
npm publish
Consuming
Consumers (mlm/api, mlm/web) depend on @mylifematter/shared-types at a fixed
version and ship a repo-local .npmrc pointing the @mylifematter scope at the
registry above. The auth token is supplied via a personal ~/.npmrc or a CI secret,
never committed.
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| @types/node | ^20.14.0 |
| typescript | ^5.4.0 |