@movmo_app/types 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,40 +24,45 @@ pnpm add @movmo_app/types
24
24
  Import the types you need in your TypeScript files:
25
25
 
26
26
  ```typescript
27
- import { FlightOffer, DataSource, BookingStatus } from '@movmo_app/types';
28
-
29
- // Example usage
30
- const offer: FlightOffer = {
31
- // ...
32
- };
33
-
34
- const dataSource: DataSource = "amadeus";
35
-
36
- const status: BookingStatus = "CONFIRMED";
27
+ import {
28
+ MovmoFlightOffer,
29
+ FlightOfferDataSource,
30
+ MovmoFrameMessageType,
31
+ isTrustedOrigin,
32
+ } from '@movmo_app/types';
33
+
34
+ const dataSource: FlightOfferDataSource = FlightOfferDataSource.Amadeus;
37
35
  ```
38
36
 
39
- ## Available Types
40
-
41
- ### Core Types
42
-
43
- - `FlightOffer`: Represents a flight offer from a data source
44
- - `BookingData`: Contains booking details
45
- - `PassengerInfo`: Passenger information
46
- - `PricingInfo`: Flight pricing details
47
-
48
- ### Enums
49
-
50
- - `DataSource`: Available data sources (e.g., "amadeus", "sabre")
51
- - `BookingStatus`: Status of a booking (e.g., "PENDING", "CONFIRMED", "CANCELLED")
52
- - `PaymentMethod`: Available payment methods
53
- - `FlightClass`: Flight class types (e.g., "ECONOMY", "BUSINESS", "FIRST")
54
-
55
- ### API Request/Response Types
56
-
57
- - `FlightOfferRequest`: Request format for retrieving flight offers
58
- - `FlightOfferResponse`: Response format for flight offers
59
- - `BookingRequest`: Request format for creating a booking
60
- - `BookingResponse`: Response format for booking creation
37
+ Field names are **snake_case** to match the Go backend's JSON — with one deliberate exception: the
38
+ cross-frame `postMessage` payloads in `postmessage_contracts` are camelCase (browser convention).
39
+
40
+ ## Available Modules
41
+
42
+ Everything below is re-exported from the package root (see `src/index.ts`):
43
+
44
+ - `movmo_flight_offer` — `MovmoFlightOffer` and its slice/segment/fare structures (the canonical offer model; the bare `FlightOffer` in `booking` is legacy)
45
+ - `booking` — booking DTOs and the legacy `FlightOffer` model
46
+ - `booking_passenger` — passenger records attached to bookings
47
+ - `users` / `customers` / `auth` / `sessions` — user, customer, auth, and session DTOs
48
+ - `payments` — payment method DTOs
49
+ - `identity_documents` — passport / KTN document types
50
+ - `loyalty_programs` — loyalty program membership types
51
+ - `travel_preferences` / `locale_preferences` — preference DTOs
52
+ - `trip_summary` — trip summary structures
53
+ - `referrals` — referral types
54
+ - `identity` — identity-partner directory types (`IdentityPartner`, `mapIdentityPartners`)
55
+ - `scope_copy` — shared OAuth scope display copy (one source of truth for consent-screen wording)
56
+ - `postmessage_contracts` — the cross-frame `postMessage` contract shared by flights-ui and the
57
+ `@movmo/express-checkout-button` / `@movmo/connect-button` embeds: `MovmoFrameMessageType`
58
+ (READY/INIT handshake, booking outcomes, `RECOGNITION_STATE`/`RECOGNITION_TOKEN`/
59
+ `RECOGNITION_RESIZE`/`RECOGNITION_CONNECT`/`RECOGNITION_ERROR`), the per-message payload
60
+ interfaces, the origin allowlists, and `isTrustedOrigin`
61
+ - `types` — small shared helpers
62
+
63
+ Conventions: `type` for DTOs, `interface` for extensible contracts, `enum` for fixed value sets
64
+ (e.g. `FlightOfferDataSource`, `TravelerType`), and `Create*Payload` / `Update*Payload` for API
65
+ request bodies.
61
66
 
62
67
  ## Development
63
68
 
@@ -14,6 +14,7 @@ export interface IdentityPartner {
14
14
  airlineName: string;
15
15
  airlineDomain: string;
16
16
  providerId: string;
17
+ supportedScopes: string[];
17
18
  }
18
19
  /**
19
20
  * Wire shape of a single entry in `GET /v1/identity/partners`'s `partners`
@@ -24,6 +25,7 @@ export interface IdentityPartnerWire {
24
25
  airline_name: string;
25
26
  airline_domain: string;
26
27
  provider_id: string;
28
+ supported_scopes?: string[];
27
29
  }
28
30
  /**
29
31
  * Wire shape of the `GET /v1/identity/partners` response envelope.
package/dist/identity.js CHANGED
@@ -9,10 +9,14 @@ exports.mapIdentityPartners = mapIdentityPartners;
9
9
  */
10
10
  function mapIdentityPartners(response) {
11
11
  var _a;
12
- return ((_a = response === null || response === void 0 ? void 0 : response.partners) !== null && _a !== void 0 ? _a : []).map((partner) => ({
13
- clientId: partner.client_id,
14
- airlineName: partner.airline_name,
15
- airlineDomain: partner.airline_domain,
16
- providerId: partner.provider_id,
17
- }));
12
+ return ((_a = response === null || response === void 0 ? void 0 : response.partners) !== null && _a !== void 0 ? _a : []).map((partner) => {
13
+ var _a;
14
+ return ({
15
+ clientId: partner.client_id,
16
+ airlineName: partner.airline_name,
17
+ airlineDomain: partner.airline_domain,
18
+ providerId: partner.provider_id,
19
+ supportedScopes: (_a = partner.supported_scopes) !== null && _a !== void 0 ? _a : [],
20
+ });
21
+ });
18
22
  }
@@ -46,6 +46,10 @@ exports.SCOPE_COPY = {
46
46
  label: 'Update or remove saved payment methods',
47
47
  detail: 'Cannot add new cards',
48
48
  },
49
+ 'loyalty.read': {
50
+ label: 'View your loyalty status',
51
+ detail: 'Loyalty program status and membership with the airline and their alliance, if applicable',
52
+ },
49
53
  'bookings.read': {
50
54
  label: 'View your bookings and trip history',
51
55
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",