@movmo_app/types 1.11.0 → 1.12.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.
@@ -16,9 +16,9 @@
16
16
  * origin, targeted at the iframe's origin. The iframe captures that origin so every
17
17
  * subsequent message goes to a specific origin instead of `"*"`.
18
18
  *
19
- * Adoption status: flights-ui (iframe) consumes this contract. The parent side
20
- * (`@movmo/express-checkout-button`) adopts it in MOVMO-437 Part 2 (v1.4.0); until then
21
- * the published parent uses its own hardcoded origin list and performs no handshake.
19
+ * Adoption: both flights-ui (iframe) and `@movmo/express-checkout-button` (parent, as of
20
+ * v1.4.0) consume this contract. Parent versions before v1.4.0 use their own hardcoded
21
+ * origin list and perform no handshake.
22
22
  *
23
23
  * Note: payload field names are camelCase (browser `postMessage` data), a deliberate
24
24
  * departure from the snake_case Go-DTO convention used elsewhere in this package. Keep
@@ -50,9 +50,26 @@ export interface MovmoBookingCompleteMessage {
50
50
  airlineRef?: string;
51
51
  providerId?: string;
52
52
  }
53
+ /**
54
+ * Why the iframe is handing control back to the airline page (MOVMO-474).
55
+ * Rides on BOOKING_FAILED rather than a new message type so that parents
56
+ * built before v1.6.0 — which already close the overlay on BOOKING_FAILED —
57
+ * keep working when a newer flights-ui sends an exit they don't understand.
58
+ */
59
+ export type MovmoExitReason = 'search_again' | 'offer_unavailable';
53
60
  export interface MovmoBookingFailedMessage {
54
61
  type: MovmoFrameMessageType.BOOKING_FAILED;
62
+ /**
63
+ * @deprecated Legacy constant no handler reads; kept so pre-1.6.0 parent
64
+ * typings keep compiling against this interface. Use `reason` instead.
65
+ */
55
66
  action: 'search_again';
67
+ /**
68
+ * Optional so the field is additive: parents ≤1.5.0 ignore it and still
69
+ * close the overlay; parents ≥1.6.0 pass it to the airline's onExit
70
+ * callback. Absent means 'search_again' (messages from older flights-ui).
71
+ */
72
+ reason?: MovmoExitReason;
56
73
  }
57
74
  /** Discriminated union of every message exchanged across the frame boundary. */
58
75
  export type MovmoFrameMessage = MovmoReadyMessage | MovmoInitMessage | MovmoBookingCompleteMessage | MovmoBookingFailedMessage;
@@ -17,9 +17,9 @@
17
17
  * origin, targeted at the iframe's origin. The iframe captures that origin so every
18
18
  * subsequent message goes to a specific origin instead of `"*"`.
19
19
  *
20
- * Adoption status: flights-ui (iframe) consumes this contract. The parent side
21
- * (`@movmo/express-checkout-button`) adopts it in MOVMO-437 Part 2 (v1.4.0); until then
22
- * the published parent uses its own hardcoded origin list and performs no handshake.
20
+ * Adoption: both flights-ui (iframe) and `@movmo/express-checkout-button` (parent, as of
21
+ * v1.4.0) consume this contract. Parent versions before v1.4.0 use their own hardcoded
22
+ * origin list and perform no handshake.
23
23
  *
24
24
  * Note: payload field names are camelCase (browser `postMessage` data), a deliberate
25
25
  * departure from the snake_case Go-DTO convention used elsewhere in this package. Keep
package/dist/users.d.ts CHANGED
@@ -11,6 +11,7 @@ export type User = {
11
11
  last_name?: string;
12
12
  suffix?: string;
13
13
  email: string;
14
+ /** Empty string when the user has no phone on file (phone is optional since MOVMO-445). */
14
15
  phone_number: string;
15
16
  date_of_birth?: string;
16
17
  gender?: Gender;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",