@movmo_app/types 1.12.1 → 1.14.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.
@@ -33,7 +33,27 @@ export declare enum MovmoFrameMessageType {
33
33
  /** iframe → parent: a booking finished successfully. */
34
34
  BOOKING_COMPLETE = "MOVMO_BOOKING_COMPLETE",
35
35
  /** iframe → parent: a booking failed in a non-retryable way. */
36
- BOOKING_FAILED = "MOVMO_BOOKING_FAILED"
36
+ BOOKING_FAILED = "MOVMO_BOOKING_FAILED",
37
+ /**
38
+ * iframe → parent: the recognition surface's current state. Carries NO identity data by
39
+ * design — PII and the durable GUID never cross the browser. Parents use this purely to
40
+ * decide what to render (nothing / anonymous chip / recognized chip).
41
+ */
42
+ RECOGNITION_STATE = "MOVMO_RECOGNITION_STATE",
43
+ /**
44
+ * iframe → parent: the short-lived (120s), single-use recognition token the airline page
45
+ * forwards to its own backend. This is the ONLY identity-bearing value that ever crosses
46
+ * the frame boundary, and it is opaque to the parent — the parent cannot read identity out
47
+ * of it, only redeem it server-side.
48
+ */
49
+ RECOGNITION_TOKEN = "MOVMO_RECOGNITION_TOKEN",
50
+ /** iframe → parent: requested wrapper size for banner/chip transitions. */
51
+ RECOGNITION_RESIZE = "MOVMO_RECOGNITION_RESIZE",
52
+ /**
53
+ * iframe → parent: a user gesture requesting the parent start the Movmo OAuth (Flow A)
54
+ * redirect.
55
+ */
56
+ RECOGNITION_CONNECT = "MOVMO_RECOGNITION_CONNECT"
37
57
  }
38
58
  export interface MovmoReadyMessage {
39
59
  type: MovmoFrameMessageType.READY;
@@ -55,8 +75,13 @@ export interface MovmoBookingCompleteMessage {
55
75
  * Rides on BOOKING_FAILED rather than a new message type so that parents
56
76
  * built before v1.6.0 — which already close the overlay on BOOKING_FAILED —
57
77
  * keep working when a newer flights-ui sends an exit they don't understand.
78
+ *
79
+ * 'booking_confirmed' (MOVMO-521) is the success-path exit: the traveler
80
+ * clicked "Return to {airline}" on the booking confirmation. Despite riding
81
+ * on BOOKING_FAILED, the booking itself succeeded — a BOOKING_COMPLETE was
82
+ * already sent for it.
58
83
  */
59
- export type MovmoExitReason = 'search_again' | 'offer_unavailable';
84
+ export type MovmoExitReason = 'search_again' | 'offer_unavailable' | 'booking_confirmed';
60
85
  export interface MovmoBookingFailedMessage {
61
86
  type: MovmoFrameMessageType.BOOKING_FAILED;
62
87
  /**
@@ -71,8 +96,24 @@ export interface MovmoBookingFailedMessage {
71
96
  */
72
97
  reason?: MovmoExitReason;
73
98
  }
99
+ export interface MovmoRecognitionStateMessage {
100
+ type: MovmoFrameMessageType.RECOGNITION_STATE;
101
+ state: 'recognized' | 'anonymous' | 'none';
102
+ }
103
+ export interface MovmoRecognitionTokenMessage {
104
+ type: MovmoFrameMessageType.RECOGNITION_TOKEN;
105
+ token: string;
106
+ }
107
+ export interface MovmoRecognitionResizeMessage {
108
+ type: MovmoFrameMessageType.RECOGNITION_RESIZE;
109
+ width: number;
110
+ height: number;
111
+ }
112
+ export interface MovmoRecognitionConnectMessage {
113
+ type: MovmoFrameMessageType.RECOGNITION_CONNECT;
114
+ }
74
115
  /** Discriminated union of every message exchanged across the frame boundary. */
75
- export type MovmoFrameMessage = MovmoReadyMessage | MovmoInitMessage | MovmoBookingCompleteMessage | MovmoBookingFailedMessage;
116
+ export type MovmoFrameMessage = MovmoReadyMessage | MovmoInitMessage | MovmoBookingCompleteMessage | MovmoBookingFailedMessage | MovmoRecognitionStateMessage | MovmoRecognitionTokenMessage | MovmoRecognitionResizeMessage | MovmoRecognitionConnectMessage;
76
117
  /** A per-environment origin allowlist (production vs. everything else). */
77
118
  export interface MovmoOriginAllowlist {
78
119
  prod: readonly string[];
@@ -39,6 +39,26 @@ var MovmoFrameMessageType;
39
39
  MovmoFrameMessageType["BOOKING_COMPLETE"] = "MOVMO_BOOKING_COMPLETE";
40
40
  /** iframe → parent: a booking failed in a non-retryable way. */
41
41
  MovmoFrameMessageType["BOOKING_FAILED"] = "MOVMO_BOOKING_FAILED";
42
+ /**
43
+ * iframe → parent: the recognition surface's current state. Carries NO identity data by
44
+ * design — PII and the durable GUID never cross the browser. Parents use this purely to
45
+ * decide what to render (nothing / anonymous chip / recognized chip).
46
+ */
47
+ MovmoFrameMessageType["RECOGNITION_STATE"] = "MOVMO_RECOGNITION_STATE";
48
+ /**
49
+ * iframe → parent: the short-lived (120s), single-use recognition token the airline page
50
+ * forwards to its own backend. This is the ONLY identity-bearing value that ever crosses
51
+ * the frame boundary, and it is opaque to the parent — the parent cannot read identity out
52
+ * of it, only redeem it server-side.
53
+ */
54
+ MovmoFrameMessageType["RECOGNITION_TOKEN"] = "MOVMO_RECOGNITION_TOKEN";
55
+ /** iframe → parent: requested wrapper size for banner/chip transitions. */
56
+ MovmoFrameMessageType["RECOGNITION_RESIZE"] = "MOVMO_RECOGNITION_RESIZE";
57
+ /**
58
+ * iframe → parent: a user gesture requesting the parent start the Movmo OAuth (Flow A)
59
+ * redirect.
60
+ */
61
+ MovmoFrameMessageType["RECOGNITION_CONNECT"] = "MOVMO_RECOGNITION_CONNECT";
42
62
  })(MovmoFrameMessageType || (exports.MovmoFrameMessageType = MovmoFrameMessageType = {}));
43
63
  /**
44
64
  * Origins served by Movmo's flights-ui iframe. The PARENT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.12.1",
3
+ "version": "1.14.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",