@movmo_app/types 1.11.0 → 1.12.1
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
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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
|
|
21
|
-
*
|
|
22
|
-
*
|
|
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
|
|
@@ -58,7 +58,11 @@ exports.MOVMO_FLIGHTS_ORIGINS = {
|
|
|
58
58
|
*/
|
|
59
59
|
exports.MOVMO_PARTNER_ORIGINS = {
|
|
60
60
|
prod: [],
|
|
61
|
-
nonProd: [
|
|
61
|
+
nonProd: [
|
|
62
|
+
'https://mockairline-e2e.app.flyeasyapp.com',
|
|
63
|
+
'https://mockairline-e2e.app.movmoapp.com',
|
|
64
|
+
'http://localhost:3000',
|
|
65
|
+
],
|
|
62
66
|
};
|
|
63
67
|
/**
|
|
64
68
|
* Returns true when `origin` is trusted for the given allowlist and environment.
|
package/dist/users.d.ts
CHANGED