@movmo_app/types 1.13.0 → 1.15.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/dist/identity.d.ts +40 -0
- package/dist/identity.js +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/postmessage_contracts.d.ts +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A registered OAuth identity-partner client for an airline (MOVMO-522). The
|
|
3
|
+
* backend (`GET /v1/identity/partners`) is the source of truth for which
|
|
4
|
+
* airlines participate in cross-site recognition — this replaces the
|
|
5
|
+
* retired per-repo `config/identityPartners.ts` map. `clientId` is used to
|
|
6
|
+
* check OAuth consent and mint recognition tokens; `airlineName`/
|
|
7
|
+
* `airlineDomain` are display-only copy substitutions on consent-disclosure
|
|
8
|
+
* surfaces (recognition banner, booking-confirmation activation card, the
|
|
9
|
+
* Connected apps "Airlines" row and grant-disclosure modal). `providerId`
|
|
10
|
+
* joins a flight offer/booking's provider to the airline's OAuth client.
|
|
11
|
+
*/
|
|
12
|
+
export interface IdentityPartner {
|
|
13
|
+
clientId: string;
|
|
14
|
+
airlineName: string;
|
|
15
|
+
airlineDomain: string;
|
|
16
|
+
providerId: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Wire shape of a single entry in `GET /v1/identity/partners`'s `partners`
|
|
20
|
+
* array (snake_case, matches the Go backend).
|
|
21
|
+
*/
|
|
22
|
+
export interface IdentityPartnerWire {
|
|
23
|
+
client_id: string;
|
|
24
|
+
airline_name: string;
|
|
25
|
+
airline_domain: string;
|
|
26
|
+
provider_id: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Wire shape of the `GET /v1/identity/partners` response envelope.
|
|
30
|
+
*/
|
|
31
|
+
export interface GetIdentityPartnersResponse {
|
|
32
|
+
partners: IdentityPartnerWire[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Field-by-field renames a `GetIdentityPartnersResponse` envelope into
|
|
36
|
+
* camelCase `IdentityPartner`s. Pure and tolerant of a missing/malformed
|
|
37
|
+
* envelope (`null`/`undefined` response, or a response with no `partners`
|
|
38
|
+
* key) — always returns an array, never throws.
|
|
39
|
+
*/
|
|
40
|
+
export declare function mapIdentityPartners(response: GetIdentityPartnersResponse | null | undefined): IdentityPartner[];
|
package/dist/identity.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapIdentityPartners = mapIdentityPartners;
|
|
4
|
+
/**
|
|
5
|
+
* Field-by-field renames a `GetIdentityPartnersResponse` envelope into
|
|
6
|
+
* camelCase `IdentityPartner`s. Pure and tolerant of a missing/malformed
|
|
7
|
+
* envelope (`null`/`undefined` response, or a response with no `partners`
|
|
8
|
+
* key) — always returns an array, never throws.
|
|
9
|
+
*/
|
|
10
|
+
function mapIdentityPartners(response) {
|
|
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
|
+
}));
|
|
18
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,3 +30,4 @@ __exportStar(require("./booking_passenger"), exports);
|
|
|
30
30
|
__exportStar(require("./movmo_flight_offer"), exports);
|
|
31
31
|
__exportStar(require("./locale_preferences"), exports);
|
|
32
32
|
__exportStar(require("./postmessage_contracts"), exports);
|
|
33
|
+
__exportStar(require("./identity"), exports);
|
|
@@ -75,8 +75,13 @@ export interface MovmoBookingCompleteMessage {
|
|
|
75
75
|
* Rides on BOOKING_FAILED rather than a new message type so that parents
|
|
76
76
|
* built before v1.6.0 — which already close the overlay on BOOKING_FAILED —
|
|
77
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.
|
|
78
83
|
*/
|
|
79
|
-
export type MovmoExitReason = 'search_again' | 'offer_unavailable';
|
|
84
|
+
export type MovmoExitReason = 'search_again' | 'offer_unavailable' | 'booking_confirmed';
|
|
80
85
|
export interface MovmoBookingFailedMessage {
|
|
81
86
|
type: MovmoFrameMessageType.BOOKING_FAILED;
|
|
82
87
|
/**
|