@duffel/components 3.1.3--prototype.8 → 3.1.3--prototype.10
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 +68 -0
- package/package.json +7 -7
- package/{index.js → react-dist/index.js} +2 -2
- package/components/DuffelAncillaries/Card.d.ts +0 -14
- package/components/DuffelAncillaries/Counter.d.ts +0 -10
- package/components/DuffelAncillaries/DuffelAncillaries.d.ts +0 -3
- package/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +0 -12
- package/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +0 -11
- package/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +0 -13
- package/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +0 -11
- package/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +0 -11
- package/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +0 -13
- package/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +0 -14
- package/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +0 -9
- package/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +0 -7
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +0 -10
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +0 -11
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +0 -7
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +0 -4
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +0 -11
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +0 -2
- package/components/DuffelAncillaries/seats/Amenity.d.ts +0 -6
- package/components/DuffelAncillaries/seats/DeckSelect.d.ts +0 -15
- package/components/DuffelAncillaries/seats/Element.d.ts +0 -15
- package/components/DuffelAncillaries/seats/EmptyElement.d.ts +0 -2
- package/components/DuffelAncillaries/seats/ExitElement.d.ts +0 -6
- package/components/DuffelAncillaries/seats/Legend.d.ts +0 -12
- package/components/DuffelAncillaries/seats/Row.d.ts +0 -13
- package/components/DuffelAncillaries/seats/RowSection.d.ts +0 -17
- package/components/DuffelAncillaries/seats/SeatElement.d.ts +0 -13
- package/components/DuffelAncillaries/seats/SeatInfo.d.ts +0 -7
- package/components/DuffelAncillaries/seats/SeatMap.d.ts +0 -12
- package/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +0 -2
- package/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +0 -13
- package/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +0 -13
- package/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +0 -4
- package/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +0 -16
- package/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +0 -10
- package/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +0 -5
- package/components/DuffelPayments/DuffelPayments.d.ts +0 -11
- package/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +0 -13
- package/components/PlacesLookup/PlacesLookup.d.ts +0 -20
- package/components/shared/AnimatedLoaderEllipsis.d.ts +0 -2
- package/components/shared/Button.d.ts +0 -23
- package/components/shared/ErrorBoundary.d.ts +0 -13
- package/components/shared/FetchOfferErrorState.d.ts +0 -5
- package/components/shared/Icon.d.ts +0 -46
- package/components/shared/IconButton.d.ts +0 -16
- package/components/shared/Modal.d.ts +0 -11
- package/components/shared/NonIdealState.d.ts +0 -4
- package/components/shared/Stamp.d.ts +0 -7
- package/components/shared/Tabs.d.ts +0 -16
- package/custom-elements.d.ts +0 -6
- package/custom-elements.js +0 -40
- package/custom-elements.js.map +0 -7
- package/index.d.ts +0 -7
- package/index.js.map +0 -7
- package/lib/captureErrorInSentry.d.ts +0 -1
- package/lib/compileCreateOrderPayload.d.ts +0 -14
- package/lib/createPriceFormatters.d.ts +0 -12
- package/lib/fetchFromDuffelAPI.d.ts +0 -8
- package/lib/fetchFromFixtures.d.ts +0 -4
- package/lib/formatAvailableServices.d.ts +0 -12
- package/lib/formatDate.d.ts +0 -2
- package/lib/formatSeatMaps.d.ts +0 -4
- package/lib/getBaggageServiceDescription.d.ts +0 -2
- package/lib/getCabinsForSegmentAndDeck.d.ts +0 -2
- package/lib/getCurrencyForSeatMaps.d.ts +0 -10
- package/lib/getCurrencyForServices.d.ts +0 -11
- package/lib/getFirstSeatElementMatchingCriteria.d.ts +0 -3
- package/lib/getPassengerBySegmentList.d.ts +0 -6
- package/lib/getPassengerInitials.d.ts +0 -1
- package/lib/getPassengerMapById.d.ts +0 -3
- package/lib/getPassengerName.d.ts +0 -3
- package/lib/getRowNumber.d.ts +0 -2
- package/lib/getSegmentList.d.ts +0 -2
- package/lib/getServicePriceMapById.d.ts +0 -3
- package/lib/getSymbols.d.ts +0 -2
- package/lib/getTotalAmountForServices.d.ts +0 -6
- package/lib/getTotalQuantity.d.ts +0 -2
- package/lib/hasHighLuminance.d.ts +0 -1
- package/lib/hasService.d.ts +0 -2
- package/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +0 -3
- package/lib/hasWings.d.ts +0 -2
- package/lib/isBaggageService.d.ts +0 -2
- package/lib/isCancelForAnyReasonService.d.ts +0 -2
- package/lib/isFixtureOfferId.d.ts +0 -2
- package/lib/isPayloadComplete.d.ts +0 -2
- package/lib/isSeatElement.d.ts +0 -2
- package/lib/logging.d.ts +0 -46
- package/lib/moneyStringFormatter.d.ts +0 -8
- package/lib/offerIsExpired.d.ts +0 -2
- package/lib/retrieveOffer.d.ts +0 -2
- package/lib/retrieveOfferFromDuffelAPI.d.ts +0 -1
- package/lib/retrieveSeatMaps.d.ts +0 -2
- package/lib/retrieveSeatMapsFromDuffelAPI.d.ts +0 -1
- package/lib/setBodyScrollability.d.ts +0 -1
- package/lib/validateProps.d.ts +0 -7
- package/lib/withPlural.d.ts +0 -1
- package/scripts/generate-fixture.d.ts +0 -3
- package/scripts/setup-suggestion-data.d.ts +0 -28
- package/tsconfig.tsbuildinfo +0 -1
- package/types/Aircraft.d.ts +0 -14
- package/types/Airline.d.ts +0 -14
- package/types/Airport.d.ts +0 -44
- package/types/City.d.ts +0 -18
- package/types/CreateOrderPayload.d.ts +0 -72
- package/types/CurrencyConversion.d.ts +0 -10
- package/types/DuffelAncillariesProps.d.ts +0 -70
- package/types/Offer.d.ts +0 -711
- package/types/Order.d.ts +0 -8
- package/types/Place.d.ts +0 -8
- package/types/SeatMap.d.ts +0 -190
- package/types/index.d.ts +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const captureErrorInSentry: (error: Error) => string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CreateOrderPayload, CreateOrderPayloadServices } from "../types/CreateOrderPayload";
|
|
2
|
-
import { DuffelAncillariesProps } from "../types/DuffelAncillariesProps";
|
|
3
|
-
import { Offer } from "../types/Offer";
|
|
4
|
-
import { SeatMap } from "../types/SeatMap";
|
|
5
|
-
interface CompileCreateOrderPayloadInput {
|
|
6
|
-
offer: Offer;
|
|
7
|
-
passengers: DuffelAncillariesProps["passengers"];
|
|
8
|
-
baggageSelectedServices: CreateOrderPayloadServices;
|
|
9
|
-
seatSelectedServices: CreateOrderPayloadServices;
|
|
10
|
-
cfarSelectedServices: CreateOrderPayloadServices;
|
|
11
|
-
seatMaps?: SeatMap[];
|
|
12
|
-
}
|
|
13
|
-
export declare const compileCreateOrderPayload: ({ baggageSelectedServices, seatSelectedServices, cfarSelectedServices, offer, seatMaps, passengers, }: CompileCreateOrderPayloadInput) => Partial<CreateOrderPayload>;
|
|
14
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DuffelAncillariesMarkup, DuffelAncillariesPriceFormatters } from "src/types/DuffelAncillariesProps";
|
|
2
|
-
/**
|
|
3
|
-
* Creates price formatters from the markup and priceFormatters passed in.
|
|
4
|
-
* Throws an error if both are supplied.
|
|
5
|
-
* If neither are supplied, the priceFormatters will be undefined.
|
|
6
|
-
*
|
|
7
|
-
* @param markup The markup to be applied to the prices of the available services of an offer.
|
|
8
|
-
* @param priceFormatters Price formatters to apply to the prices of the available services of an offer.
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
declare const createPriceFormatters: (markup?: DuffelAncillariesMarkup, priceFormatters?: DuffelAncillariesPriceFormatters) => DuffelAncillariesPriceFormatters;
|
|
12
|
-
export { createPriceFormatters };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface ErrorResponse extends Response {
|
|
2
|
-
data: {
|
|
3
|
-
meta: any;
|
|
4
|
-
errors: any[];
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
export declare const isErrorResponse: (response: any) => response is ErrorResponse;
|
|
8
|
-
export declare function fetchFromDuffelAPI(withClientKey: string, path: string, method?: string, body?: string): Promise<any>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DuffelAncillariesPriceFormatters } from "../types/DuffelAncillariesProps";
|
|
2
|
-
import { Offer } from "../types/Offer";
|
|
3
|
-
/**
|
|
4
|
-
* Formats the prices of the available services of an offer according to the
|
|
5
|
-
* priceFormatters passed in.
|
|
6
|
-
*
|
|
7
|
-
* @param offer An offer from the Duffel API
|
|
8
|
-
* @param priceFormatters Optional price formatting functions. If not passed in, the offer will be returned unchanged.
|
|
9
|
-
* @returns An offer with the prices of its available services formatted according to the priceFormatters passed in.
|
|
10
|
-
*/
|
|
11
|
-
declare const formatAvailableServices: (offer: Offer, priceFormatters?: DuffelAncillariesPriceFormatters) => Offer;
|
|
12
|
-
export { formatAvailableServices };
|
package/lib/formatDate.d.ts
DELETED
package/lib/formatSeatMaps.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DuffelAncillariesPriceFormatterForSeats } from "../types/DuffelAncillariesProps";
|
|
2
|
-
import { SeatMap } from "../types/SeatMap";
|
|
3
|
-
declare const formatSeatMaps: (seatMaps: SeatMap[], priceFormatter?: DuffelAncillariesPriceFormatterForSeats) => SeatMap[];
|
|
4
|
-
export { formatSeatMaps };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SeatMap } from "../types/SeatMap";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* Returns the currency of the first service of the given seat maps.
|
|
5
|
-
*
|
|
6
|
-
* @param seatMaps[] Array of seat maps
|
|
7
|
-
* @returns A string representing the currency of the seat maps in the offer.
|
|
8
|
-
*/
|
|
9
|
-
declare const getCurrencyForSeatMaps: (seatMaps: SeatMap[]) => string | undefined;
|
|
10
|
-
export { getCurrencyForSeatMaps };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Offer } from "../types/Offer";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* Returns the currency of the first service of the given type in the offer.
|
|
5
|
-
*
|
|
6
|
-
* @param offer An offer
|
|
7
|
-
* @returns A string representing the currency of the services in the offer.
|
|
8
|
-
* @throws If there are no services, or none of the services are of the given type.
|
|
9
|
-
*/
|
|
10
|
-
declare const getCurrencyForServices: (offer: Offer, serviceType: string) => string;
|
|
11
|
-
export { getCurrencyForServices };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SeatMap, SeatMapCabinRowSectionElement } from "../types/SeatMap";
|
|
2
|
-
declare const getFirstSeatElementMatchingCriteria: (seatMaps: SeatMap[], matcher: (element: SeatMapCabinRowSectionElement) => boolean) => SeatMapCabinRowSectionElement | undefined;
|
|
3
|
-
export { getFirstSeatElementMatchingCriteria };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getPassengerInitials: (passengerName?: string) => string;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CreateOrderPayloadPassenger, CreateOrderPayloadPassengers } from "../types/CreateOrderPayload";
|
|
2
|
-
export type PassengerMapById = Record<CreateOrderPayloadPassenger["id"], CreateOrderPayloadPassenger>;
|
|
3
|
-
export declare const getPassengerMapById: (passengers: CreateOrderPayloadPassengers) => PassengerMapById;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CreateOrderPayloadPassenger } from "../types/CreateOrderPayload";
|
|
2
|
-
import { OfferPassenger } from "../types/Offer";
|
|
3
|
-
export declare const getPassengerName: (createOrderPayloadPassenger: CreateOrderPayloadPassenger, offerPassenger: OfferPassenger | undefined, fallbackIndex: number) => string;
|
package/lib/getRowNumber.d.ts
DELETED
package/lib/getSegmentList.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { OfferAvailableService } from "../types/Offer";
|
|
2
|
-
export type ServicePriceMapById = Record<OfferAvailableService["id"], Pick<OfferAvailableService, "total_amount" | "total_currency">>;
|
|
3
|
-
export declare const getServicePriceMapById: (availableServices: OfferAvailableService[]) => ServicePriceMapById;
|
package/lib/getSymbols.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CreateOrderPayloadServices } from "../types/CreateOrderPayload";
|
|
2
|
-
import { Offer } from "../types/Offer";
|
|
3
|
-
import { SeatMap } from "../types/SeatMap";
|
|
4
|
-
import { ServicePriceMapById } from "./getServicePriceMapById";
|
|
5
|
-
export declare const getTotalAmountForServices: (offer: Offer, selectedServices: CreateOrderPayloadServices, seatMaps?: SeatMap[]) => number;
|
|
6
|
-
export declare const getTotalAmountForServicesWithPriceMap: (servicePriceMap: ServicePriceMapById, selectedServices: CreateOrderPayloadServices, seatMaps?: SeatMap[]) => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const hasHighLuminance: (accentColor: string) => boolean;
|
package/lib/hasService.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CreateOrderPayloadServices } from "../types/CreateOrderPayload";
|
|
2
|
-
import { OfferAvailableServiceBaggage } from "../types/Offer";
|
|
3
|
-
export declare const hasServiceOfSameMetadataTypeAlreadyBeenSelected: (selectedServices: CreateOrderPayloadServices, segmentId: string, passengerId: string, availableService: OfferAvailableServiceBaggage) => boolean;
|
package/lib/hasWings.d.ts
DELETED
package/lib/isSeatElement.d.ts
DELETED
package/lib/logging.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The functions in this file are used to enable logging.
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
*
|
|
6
|
-
* In your app's outermost container, import the LogContext and wrap your app in it:
|
|
7
|
-
*
|
|
8
|
-
* ```jsx
|
|
9
|
-
* import { LogContext, initializeLogger } from '@lib/logging'
|
|
10
|
-
*
|
|
11
|
-
* const logger = initializeLogger(props.debugMode || false)
|
|
12
|
-
*
|
|
13
|
-
* <LogContext.Provider value={logger}>
|
|
14
|
-
* ...
|
|
15
|
-
* </LogContext.Provider>
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* Then in your components nested within the above container, import the useLog hook and use it:
|
|
19
|
-
*
|
|
20
|
-
* import { useLog } from '@lib/logging'
|
|
21
|
-
*
|
|
22
|
-
* const { log, logGroup } = useLog()
|
|
23
|
-
* log('This is a log message')
|
|
24
|
-
* logGroup('These messages will be grouped together', ['This is a log message', 'This is another log message'])
|
|
25
|
-
*/
|
|
26
|
-
declare const initializeLogger: (debugMode: boolean) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Log a message to the console. Messages will be prefixed with "[Duffel Ancillaries]".
|
|
29
|
-
* @param message The message to print to the console.
|
|
30
|
-
*/
|
|
31
|
-
declare const log: (message: any) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Log a series of messages to the console inside a collapsible group.
|
|
34
|
-
* @param groupName The name of the group of messages. This will be prefixed with "[Duffel Ancillaries]".
|
|
35
|
-
* @param messages An array of messages to print to the console, inside the group.
|
|
36
|
-
*/
|
|
37
|
-
declare function logGroup(groupName: string, messages: any[]): void;
|
|
38
|
-
/**
|
|
39
|
-
* Log a series of messages to the console inside a collapsible group.
|
|
40
|
-
* @param groupName The name of the group of messages. This will be prefixed with "[Duffel Ancillaries]".
|
|
41
|
-
* @param object An object to print to the console, inside the group.
|
|
42
|
-
*/
|
|
43
|
-
declare function logGroup(groupName: string, object: {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
}): void;
|
|
46
|
-
export { initializeLogger, log, logGroup };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return a function to format a number into a money amount for a given currency
|
|
3
|
-
*
|
|
4
|
-
* @param currency The ISO-4217 currency code to be used by the formatter
|
|
5
|
-
*/
|
|
6
|
-
export declare const moneyStringFormatter: (currency: string, locale?: string, options?: {
|
|
7
|
-
[option: string]: string;
|
|
8
|
-
}) => (value: number) => string;
|
package/lib/offerIsExpired.d.ts
DELETED
package/lib/retrieveOffer.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function retrieveOfferFromDuffelAPI(offer_id: string, client_key: string): Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function retrieveSeatMapsFromDuffelAPI(offer_id: string, client_key: string): Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const setBodyScrollability: (shouldScroll: boolean) => void;
|
package/lib/validateProps.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DuffelAncillariesProps, DuffelAncillariesPropsWithClientKeyAndOfferId, DuffelAncillariesPropsWithOfferIdForFixture, DuffelAncillariesPropsWithOffersAndSeatMaps, DuffelAncillariesPropWithOfferAndClientKey } from "../types/DuffelAncillariesProps";
|
|
2
|
-
export declare const areDuffelAncillariesPropsValid: (props: DuffelAncillariesProps) => boolean;
|
|
3
|
-
export declare const hasCommonRequiredProps: (props: DuffelAncillariesProps) => boolean;
|
|
4
|
-
export declare const isDuffelAncillariesPropsWithOfferIdForFixture: (props: DuffelAncillariesProps) => props is DuffelAncillariesPropsWithOfferIdForFixture;
|
|
5
|
-
export declare const isDuffelAncillariesPropsWithClientKeyAndOfferId: (props: DuffelAncillariesProps) => props is DuffelAncillariesPropsWithClientKeyAndOfferId;
|
|
6
|
-
export declare const isDuffelAncillariesPropsWithOfferAndSeatMaps: (props: DuffelAncillariesProps) => props is DuffelAncillariesPropsWithOffersAndSeatMaps;
|
|
7
|
-
export declare const isDuffelAncillariesPropsWithOfferAndClientKey: (props: DuffelAncillariesProps) => props is DuffelAncillariesPropWithOfferAndClientKey;
|
package/lib/withPlural.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const withPlural: (totalQuantity: number, singular: string, plural: string) => string;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export interface CityCsvRow {
|
|
2
|
-
id: string;
|
|
3
|
-
iata_code: string;
|
|
4
|
-
iata_country_code: string;
|
|
5
|
-
name: string;
|
|
6
|
-
inserted_at: string;
|
|
7
|
-
updated_at: string;
|
|
8
|
-
metropolitan_area: string;
|
|
9
|
-
}
|
|
10
|
-
export interface AirportCsvRow {
|
|
11
|
-
id: string;
|
|
12
|
-
iata_code: string;
|
|
13
|
-
iata_city_code: string;
|
|
14
|
-
iata_country_code: string;
|
|
15
|
-
name: string;
|
|
16
|
-
inserted_at: string;
|
|
17
|
-
updated_at: string;
|
|
18
|
-
source_type: string;
|
|
19
|
-
alternative_names: string;
|
|
20
|
-
icao_code: string;
|
|
21
|
-
disabled_at: string;
|
|
22
|
-
city_name: string;
|
|
23
|
-
latitude: string;
|
|
24
|
-
longitude: string;
|
|
25
|
-
time_zone: string;
|
|
26
|
-
}
|
|
27
|
-
declare const _default: Promise<void>;
|
|
28
|
-
export default _default;
|