@movmo_app/types 1.17.0 → 1.18.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.
- package/README.md +37 -32
- package/dist/identity.d.ts +2 -0
- package/dist/identity.js +10 -6
- package/dist/scope_copy.js +4 -0
- package/package.json +1 -1
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 {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const dataSource:
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
- `
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- `
|
|
58
|
-
- `
|
|
59
|
-
-
|
|
60
|
-
|
|
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
|
|
package/dist/identity.d.ts
CHANGED
|
@@ -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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
}
|
package/dist/scope_copy.js
CHANGED
|
@@ -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: "Your membership in that airline's loyalty program",
|
|
52
|
+
},
|
|
49
53
|
'bookings.read': {
|
|
50
54
|
label: 'View your bookings and trip history',
|
|
51
55
|
},
|