@movmo_app/types 1.14.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.
@@ -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[];
@@ -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
@@ -14,3 +14,4 @@ export * from './booking_passenger';
14
14
  export * from './movmo_flight_offer';
15
15
  export * from './locale_preferences';
16
16
  export * from './postmessage_contracts';
17
+ export * from './identity';
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",