@movmo_app/types
v1.18.1
Published
A collection of Movmo's types
Readme
@movmo_app/types
This package provides all of the TypeScript type definitions used across the Movmo ecosystem.
Overview
The @movmo_app/types package serves as a central repository for shared TypeScript types, interfaces, and enums that are used across various Movmo packages and applications. By centralizing these types, we ensure consistency across our codebase and reduce duplication.
Installation
# npm
npm install @movmo_app/types
# yarn
yarn add @movmo_app/types
# pnpm
pnpm add @movmo_app/typesUsage
Import the types you need in your TypeScript files:
import {
MovmoFlightOffer,
FlightOfferDataSource,
MovmoFrameMessageType,
isTrustedOrigin,
} from '@movmo_app/types';
const dataSource: FlightOfferDataSource = FlightOfferDataSource.Amadeus;Field names are snake_case to match the Go backend's JSON — with one deliberate exception: the
cross-frame postMessage payloads in postmessage_contracts are camelCase (browser convention).
Available Modules
Everything below is re-exported from the package root (see src/index.ts):
movmo_flight_offer—MovmoFlightOfferand its slice/segment/fare structures (the canonical offer model; the bareFlightOfferinbookingis legacy)booking— booking DTOs and the legacyFlightOffermodelbooking_passenger— passenger records attached to bookingsusers/customers/auth/sessions— user, customer, auth, and session DTOspayments— payment method DTOsidentity_documents— passport / KTN document typesloyalty_programs— loyalty program membership typestravel_preferences/locale_preferences— preference DTOstrip_summary— trip summary structuresreferrals— referral typesidentity— identity-partner directory types (IdentityPartner,mapIdentityPartners)scope_copy— shared OAuth scope display copy (one source of truth for consent-screen wording)postmessage_contracts— the cross-framepostMessagecontract shared by flights-ui and the@movmo/express-checkout-button/@movmo/connect-buttonembeds:MovmoFrameMessageType(READY/INIT handshake, booking outcomes,RECOGNITION_STATE/RECOGNITION_TOKEN/RECOGNITION_RESIZE/RECOGNITION_CONNECT/RECOGNITION_ERROR), the per-message payload interfaces, the origin allowlists, andisTrustedOrigintypes— small shared helpers
Conventions: type for DTOs, interface for extensible contracts, enum for fixed value sets
(e.g. FlightOfferDataSource, TravelerType), and Create*Payload / Update*Payload for API
request bodies.
Development
Building the Package
# Install dependencies
pnpm install
# Build
pnpm buildAdding New Types
When adding new types to this package:
- Place the type definitions in the appropriate file under the
src/directory - Export them from the main
index.tsfile - Ensure proper documentation is added for each type
- Update this README if adding significant new types or categories
Version Control
This package follows semantic versioning:
- Major version: Breaking changes to existing types
- Minor version: New types added (non-breaking)
- Patch version: Bug fixes, documentation updates
Internal Usage Guidelines
- Avoid duplicating these types in other packages or applications
- If you need a modified version of an existing type, consider extending it
- If you find yourself copy-pasting types between projects, consider adding them here instead
- For types that are only used in a single package, keep them in that package
Deployment
This package is automatically published to npm when changes are merged to the main branch via GitHub Actions.
License
Internal use only. © Movmo
