@duffel/components 2.7.20 → 3.0.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/.circleci/config.yml +67 -0
- package/.eslintrc.js +47 -0
- package/.github/renovate.json +16 -0
- package/.github/workflows/autoapprove.yml +18 -0
- package/.github/workflows/release.yml +89 -0
- package/.husky/post-commit +4 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/.prettierignore +2 -0
- package/.storybook/Storyshots.test.js +3 -0
- package/.storybook/__snapshots__/Storyshots.test.js.snap +48318 -0
- package/.storybook/main.ts +33 -0
- package/.storybook/preview.tsx +28 -0
- package/.tool-versions +1 -0
- package/CONTRIBUTING.md +83 -0
- package/README.md +53 -15
- package/__mocks__/styleMock.js +6 -0
- package/babel.config.js +20 -0
- package/commitlint.config.js +4 -0
- package/config/esbuild.base.config.js +18 -0
- package/config/esbuild.cdn.config.js +51 -0
- package/config/esbuild.dev.config.js +46 -0
- package/config/esbuild.react.config.js +42 -0
- package/jest.config.ts +14 -0
- package/package.json +135 -193
- package/react-dist/components/DuffelAncillaries/Card.d.ts +14 -0
- package/react-dist/components/DuffelAncillaries/Counter.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/DuffelAncillaries.d.ts +3 -0
- package/react-dist/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +14 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +9 -0
- package/react-dist/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +4 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/Amenity.d.ts +6 -0
- package/react-dist/components/DuffelAncillaries/seats/DeckSelect.d.ts +15 -0
- package/react-dist/components/DuffelAncillaries/seats/Element.d.ts +15 -0
- package/react-dist/components/DuffelAncillaries/seats/EmptyElement.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/ExitElement.d.ts +6 -0
- package/react-dist/components/DuffelAncillaries/seats/Legend.d.ts +12 -0
- package/react-dist/components/DuffelAncillaries/seats/Row.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/RowSection.d.ts +17 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatElement.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatInfo.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatMap.d.ts +12 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +4 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +16 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +5 -0
- package/react-dist/components/DuffelPayments/DuffelPayments.d.ts +11 -0
- package/react-dist/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +14 -0
- package/react-dist/components/shared/AnimatedLoaderEllipsis.d.ts +2 -0
- package/react-dist/components/shared/Button.d.ts +23 -0
- package/react-dist/components/shared/ErrorBoundary.d.ts +13 -0
- package/react-dist/components/shared/FetchOfferErrorState.d.ts +5 -0
- package/react-dist/components/shared/Icon.d.ts +44 -0
- package/react-dist/components/shared/IconButton.d.ts +16 -0
- package/react-dist/components/shared/Modal.d.ts +11 -0
- package/react-dist/components/shared/NonIdealState.d.ts +4 -0
- package/react-dist/components/shared/Stamp.d.ts +7 -0
- package/react-dist/components/shared/Tabs.d.ts +16 -0
- package/react-dist/custom-elements.d.ts +6 -0
- package/react-dist/custom-elements.js +37 -0
- package/react-dist/custom-elements.js.map +7 -0
- package/react-dist/index.d.ts +7 -0
- package/react-dist/index.js +37 -0
- package/react-dist/index.js.map +7 -0
- package/react-dist/lib/captureErrorInSentry.d.ts +1 -0
- package/react-dist/lib/compileCreateOrderPayload.d.ts +14 -0
- package/react-dist/lib/createPriceFormatters.d.ts +12 -0
- package/react-dist/lib/fetchFromDuffelAPI.d.ts +8 -0
- package/react-dist/lib/fetchFromFixtures.d.ts +4 -0
- package/react-dist/lib/formatAvailableServices.d.ts +12 -0
- package/react-dist/lib/formatDate.d.ts +2 -0
- package/react-dist/lib/formatSeatMaps.d.ts +4 -0
- package/react-dist/lib/getBaggageServiceDescription.d.ts +2 -0
- package/react-dist/lib/getCabinsForSegmentAndDeck.d.ts +2 -0
- package/react-dist/lib/getCurrencyForSeatMaps.d.ts +10 -0
- package/react-dist/lib/getCurrencyForServices.d.ts +11 -0
- package/react-dist/lib/getFirstSeatElementMatchingCriteria.d.ts +3 -0
- package/react-dist/lib/getPassengerBySegmentList.d.ts +6 -0
- package/react-dist/lib/getPassengerInitials.d.ts +1 -0
- package/react-dist/lib/getPassengerMapById.d.ts +3 -0
- package/react-dist/lib/getPassengerName.d.ts +3 -0
- package/react-dist/lib/getRowNumber.d.ts +2 -0
- package/react-dist/lib/getSegmentList.d.ts +2 -0
- package/react-dist/lib/getServicePriceMapById.d.ts +3 -0
- package/react-dist/lib/getSymbols.d.ts +2 -0
- package/react-dist/lib/getTotalAmountForServices.d.ts +6 -0
- package/react-dist/lib/getTotalQuantity.d.ts +2 -0
- package/react-dist/lib/hasService.d.ts +2 -0
- package/react-dist/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +3 -0
- package/react-dist/lib/hasWings.d.ts +2 -0
- package/react-dist/lib/isBaggageService.d.ts +2 -0
- package/react-dist/lib/isCancelForAnyReasonService.d.ts +2 -0
- package/react-dist/lib/isFixtureOfferId.d.ts +2 -0
- package/react-dist/lib/isPayloadComplete.d.ts +2 -0
- package/react-dist/lib/isSeatElement.d.ts +2 -0
- package/react-dist/lib/logging.d.ts +46 -0
- package/react-dist/lib/moneyStringFormatter.d.ts +8 -0
- package/react-dist/lib/offerIsExpired.d.ts +2 -0
- package/react-dist/lib/retrieveOffer.d.ts +2 -0
- package/react-dist/lib/retrieveOfferFromDuffelAPI.d.ts +1 -0
- package/react-dist/lib/retrieveSeatMaps.d.ts +2 -0
- package/react-dist/lib/retrieveSeatMapsFromDuffelAPI.d.ts +1 -0
- package/react-dist/lib/setBodyScrollability.d.ts +1 -0
- package/react-dist/lib/validateProps.d.ts +7 -0
- package/react-dist/lib/withPlural.d.ts +1 -0
- package/react-dist/types/Aircraft.d.ts +14 -0
- package/react-dist/types/Airline.d.ts +14 -0
- package/react-dist/types/Airport.d.ts +44 -0
- package/react-dist/types/City.d.ts +18 -0
- package/react-dist/types/CreateOrderPayload.d.ts +72 -0
- package/react-dist/types/CurrencyConversion.d.ts +10 -0
- package/react-dist/types/DuffelAncillariesProps.d.ts +70 -0
- package/react-dist/types/Offer.d.ts +711 -0
- package/react-dist/types/Order.d.ts +8 -0
- package/react-dist/types/Place.d.ts +8 -0
- package/react-dist/types/SeatMap.d.ts +190 -0
- package/react-dist/types/index.d.ts +11 -0
- package/scripts/generate-fixture.ts +200 -0
- package/scripts/upload-to-cdn.sh +34 -0
- package/scripts.tsconfig.json +11 -0
- package/src/components/DuffelAncillaries/Card.tsx +126 -0
- package/src/components/DuffelAncillaries/Counter.tsx +40 -0
- package/src/components/DuffelAncillaries/DuffelAncillaries.tsx +344 -0
- package/src/components/DuffelAncillaries/DuffelAncillariesCustomElement.tsx +124 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionCard.tsx +96 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionController.tsx +88 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModal.tsx +81 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.tsx +60 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.tsx +122 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.tsx +81 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.tsx +76 -0
- package/src/components/DuffelAncillaries/bags/IncludedBaggageBanner.tsx +51 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.tsx +90 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.tsx +63 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.tsx +56 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx +11 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.tsx +74 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.tsx +9 -0
- package/src/components/DuffelAncillaries/seats/Amenity.tsx +21 -0
- package/src/components/DuffelAncillaries/seats/DeckSelect.tsx +27 -0
- package/src/components/DuffelAncillaries/seats/Element.tsx +52 -0
- package/src/components/DuffelAncillaries/seats/EmptyElement.tsx +5 -0
- package/src/components/DuffelAncillaries/seats/ExitElement.tsx +17 -0
- package/src/components/DuffelAncillaries/seats/Legend.tsx +60 -0
- package/src/components/DuffelAncillaries/seats/Row.tsx +47 -0
- package/src/components/DuffelAncillaries/seats/RowSection.tsx +78 -0
- package/src/components/DuffelAncillaries/seats/SeatElement.tsx +120 -0
- package/src/components/DuffelAncillaries/seats/SeatInfo.tsx +32 -0
- package/src/components/DuffelAncillaries/seats/SeatMap.tsx +81 -0
- package/src/components/DuffelAncillaries/seats/SeatMapUnavailable.tsx +21 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionCard.tsx +103 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModal.tsx +142 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalBody.tsx +13 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.tsx +82 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.tsx +87 -0
- package/src/components/DuffelAncillaries/seats/SeatUnavailable.tsx +14 -0
- package/src/components/DuffelPayments/DuffelPayments.tsx +218 -0
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +130 -0
- package/src/components/shared/AnimatedLoaderEllipsis.tsx +5 -0
- package/src/components/shared/Button.tsx +63 -0
- package/src/components/shared/ErrorBoundary.tsx +54 -0
- package/src/components/shared/FetchOfferErrorState.tsx +35 -0
- package/src/components/shared/Icon.tsx +152 -0
- package/src/components/shared/IconButton.tsx +42 -0
- package/src/components/shared/Modal.tsx +40 -0
- package/src/components/shared/NonIdealState.tsx +28 -0
- package/src/components/shared/Stamp.tsx +29 -0
- package/src/components/shared/Tabs.tsx +36 -0
- package/src/custom-elements.ts +13 -0
- package/src/examples/client-side/README.md +30 -0
- package/src/examples/client-side/index.html +57 -0
- package/src/examples/full-stack/README.md +34 -0
- package/src/examples/full-stack/index.html +48 -0
- package/src/examples/full-stack/server.mjs +158 -0
- package/src/examples/just-typescript/README.md +37 -0
- package/src/examples/just-typescript/package.json +16 -0
- package/src/examples/just-typescript/src/index.html +23 -0
- package/src/examples/just-typescript/src/index.ts +36 -0
- package/src/examples/just-typescript/yarn.lock +154 -0
- package/src/examples/payments-custom-element/README.md +17 -0
- package/src/examples/payments-custom-element/index.html +43 -0
- package/src/examples/payments-just-typescript/README.md +37 -0
- package/src/examples/payments-just-typescript/package.json +16 -0
- package/src/examples/payments-just-typescript/src/index.html +23 -0
- package/src/examples/payments-just-typescript/src/index.ts +18 -0
- package/src/examples/payments-just-typescript/yarn.lock +154 -0
- package/src/examples/react-app/README.md +37 -0
- package/src/examples/react-app/package.json +20 -0
- package/src/examples/react-app/src/index.html +19 -0
- package/src/examples/react-app/src/index.tsx +48 -0
- package/src/examples/react-app/yarn.lock +219 -0
- package/src/fixtures/offers/off_0000AUde3KwTztSRK1cznH.json +497 -0
- package/src/fixtures/offers/off_0000AVx4lUFFKW8PsPeQeQ.json +307 -0
- package/src/fixtures/offers/off_1.json +497 -0
- package/src/fixtures/passengers/mock_passengers.ts +26 -0
- package/src/fixtures/seat-maps/off_0000AUde3KwTztSRK1cznH.json +6852 -0
- package/src/fixtures/seat-maps/off_0000AVx4lUFFKW8PsPeQeQ.json +1 -0
- package/src/fixtures/seat-maps/off_1.json +6852 -0
- package/src/index.ts +7 -0
- package/src/lib/captureErrorInSentry.ts +42 -0
- package/src/lib/compileCreateOrderPayload.ts +63 -0
- package/src/lib/createPriceFormatters.ts +73 -0
- package/src/lib/fetchFromDuffelAPI.ts +54 -0
- package/src/lib/fetchFromFixtures.ts +18 -0
- package/src/lib/formatAvailableServices.ts +91 -0
- package/src/lib/formatDate.ts +20 -0
- package/src/lib/formatSeatMaps.ts +81 -0
- package/src/lib/getBaggageServiceDescription.ts +42 -0
- package/src/lib/getCabinsForSegmentAndDeck.ts +4 -0
- package/src/lib/getCurrencyForSeatMaps.ts +22 -0
- package/src/lib/getCurrencyForServices.ts +24 -0
- package/src/lib/getFirstSeatElementMatchingCriteria.ts +22 -0
- package/src/lib/getPassengerBySegmentList.ts +10 -0
- package/src/lib/getPassengerInitials.ts +6 -0
- package/src/lib/getPassengerMapById.ts +17 -0
- package/src/lib/getPassengerName.ts +37 -0
- package/src/lib/getRowNumber.ts +16 -0
- package/src/lib/getSegmentList.ts +7 -0
- package/src/lib/getServicePriceMapById.ts +20 -0
- package/src/lib/getSymbols.ts +22 -0
- package/src/lib/getTotalAmountForServices.ts +72 -0
- package/src/lib/getTotalQuantity.ts +5 -0
- package/src/lib/hasService.ts +24 -0
- package/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.ts +35 -0
- package/src/lib/hasWings.ts +8 -0
- package/src/lib/isBaggageService.ts +8 -0
- package/src/lib/isCancelForAnyReasonService.ts +9 -0
- package/src/lib/isFixtureOfferId.ts +4 -0
- package/src/lib/isPayloadComplete.ts +11 -0
- package/src/lib/isSeatElement.ts +10 -0
- package/src/lib/logging.ts +120 -0
- package/src/lib/moneyStringFormatter.ts +34 -0
- package/src/lib/offerIsExpired.ts +5 -0
- package/src/lib/retrieveOffer.ts +54 -0
- package/src/lib/retrieveOfferFromDuffelAPI.ts +13 -0
- package/src/lib/retrieveSeatMaps.ts +55 -0
- package/src/lib/retrieveSeatMapsFromDuffelAPI.ts +13 -0
- package/src/lib/setBodyScrollability.ts +7 -0
- package/src/lib/validateProps.ts +37 -0
- package/src/lib/withPlural.ts +8 -0
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +21 -0
- package/src/stories/Button.stories.tsx +69 -0
- package/src/stories/DuffelAncillaries.stories.tsx +126 -0
- package/src/stories/DuffelPayments.stories.tsx +34 -0
- package/src/stories/Icon.stories.tsx +35 -0
- package/src/stories/IconButton.stories.tsx +25 -0
- package/src/styles/colors.css +22 -0
- package/src/styles/components/Amenity.css +23 -0
- package/src/styles/components/BaggageDisplay.css +25 -0
- package/src/styles/components/Button.css +161 -0
- package/src/styles/components/Card.css +52 -0
- package/src/styles/components/CfarSelectionModal.css +34 -0
- package/src/styles/components/Counter.css +18 -0
- package/src/styles/components/DuffelPayments.css +42 -0
- package/src/styles/components/IconButton.css +63 -0
- package/src/styles/components/Legend.css +58 -0
- package/src/styles/components/Loader.css +37 -0
- package/src/styles/components/LoadingState.css +81 -0
- package/src/styles/components/Modal.css +84 -0
- package/src/styles/components/PassengerSelect.css +93 -0
- package/src/styles/components/PassengersLayout.css +90 -0
- package/src/styles/components/Row.css +70 -0
- package/src/styles/components/Seat.css +57 -0
- package/src/styles/components/SeatInfo.css +61 -0
- package/src/styles/components/SeatMap.css +24 -0
- package/src/styles/components/SeatSelect.css +92 -0
- package/src/styles/components/Segment.css +17 -0
- package/src/styles/components/SelectionSegment.css +10 -0
- package/src/styles/components/Summary.css +70 -0
- package/src/styles/components/Tabs.css +49 -0
- package/src/styles/flex.css +5 -0
- package/src/styles/font-families.css +47 -0
- package/src/styles/global.css +51 -0
- package/src/styles/margin.css +3 -0
- package/src/styles/spacing.css +18 -0
- package/src/styles/transitions.css +3 -0
- package/src/styles/typography.css +13 -0
- package/src/tests/components/DuffelAncillaries.test.tsx +342 -0
- package/src/tests/lib/createPriceFormatters.test.tsx +152 -0
- package/src/tests/lib/formatAvailableServices.test.tsx +79 -0
- package/src/tests/lib/formatSeatMaps.test.tsx +49 -0
- package/src/tests/lib/getCurrencyForServices.test.tsx +44 -0
- package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +86 -0
- package/src/tests/lib/logging.test.tsx +32 -0
- package/src/tests/lib/moneyStringFormatter.test.tsx +12 -0
- package/src/tests/lib/validateProps.test.tsx +57 -0
- package/src/types/Aircraft.ts +16 -0
- package/src/types/Airline.ts +16 -0
- package/src/types/Airport.ts +54 -0
- package/src/types/City.ts +21 -0
- package/src/types/CreateOrderPayload.ts +99 -0
- package/src/types/CurrencyConversion.ts +10 -0
- package/src/types/DuffelAncillariesProps.ts +108 -0
- package/src/types/Offer.ts +851 -0
- package/src/types/Order.ts +6 -0
- package/src/types/Place.ts +6 -0
- package/src/types/SeatMap.ts +231 -0
- package/src/types/index.ts +11 -0
- package/tsconfig.json +52 -0
- package/LICENSE +0 -21
- package/dist/AdditionalBaggage.esm.js +0 -1
- package/dist/AdditionalBaggage.js +0 -1
- package/dist/AdditionalBaggage.min.css +0 -408
- package/dist/AdditionalBaggage.umd.min.js +0 -2
- package/dist/AdditionalBaggage.umd.min.js.LICENSE.txt +0 -60
- package/dist/AdditionalBaggageSelection.esm.js +0 -1
- package/dist/AdditionalBaggageSelection.js +0 -1
- package/dist/AdditionalBaggageSelection.min.css +0 -744
- package/dist/AdditionalBaggageSelection.umd.min.js +0 -2
- package/dist/AdditionalBaggageSelection.umd.min.js.LICENSE.txt +0 -93
- package/dist/CardPayment.esm.js +0 -2
- package/dist/CardPayment.esm.js.LICENSE.txt +0 -6
- package/dist/CardPayment.js +0 -2
- package/dist/CardPayment.js.LICENSE.txt +0 -6
- package/dist/CardPayment.min.css +0 -233
- package/dist/CardPayment.umd.min.js +0 -2
- package/dist/CardPayment.umd.min.js.LICENSE.txt +0 -61
- package/dist/SeatSelection.esm.js +0 -1
- package/dist/SeatSelection.js +0 -1
- package/dist/SeatSelection.min.css +0 -1127
- package/dist/SeatSelection.umd.min.js +0 -2
- package/dist/SeatSelection.umd.min.js.LICENSE.txt +0 -60
- package/dist/duffel-components.d.ts +0 -1614
- package/dist/duffel-components.esm.js +0 -2
- package/dist/duffel-components.esm.js.LICENSE.txt +0 -6
- package/dist/duffel-components.js +0 -2
- package/dist/duffel-components.js.LICENSE.txt +0 -6
- package/dist/duffel-components.min.css +0 -1280
- package/dist/duffel-components.umd.min.js +0 -2
- package/dist/duffel-components.umd.min.js.LICENSE.txt +0 -102
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import { Aircraft } from "./Aircraft";
|
|
2
|
+
import { Airline } from "./Airline";
|
|
3
|
+
import { Airport } from "./Airport";
|
|
4
|
+
import { City } from "./City";
|
|
5
|
+
export declare const CabinClassMap: {
|
|
6
|
+
economy: string;
|
|
7
|
+
premium_economy: string;
|
|
8
|
+
business: string;
|
|
9
|
+
first: string;
|
|
10
|
+
any: string;
|
|
11
|
+
};
|
|
12
|
+
export type CabinClass = keyof typeof CabinClassMap;
|
|
13
|
+
export type PassengerIdentityDocumentType = "passport";
|
|
14
|
+
/**
|
|
15
|
+
* Each offer represents flights you can buy from an airline at a particular price that meet your search criteria.
|
|
16
|
+
*/
|
|
17
|
+
export type PaymentType = "arc_bsp_cash" | "balance" | "payments" | "card";
|
|
18
|
+
export type BaggageType = "carry_on" | "checked";
|
|
19
|
+
export declare const PassengerTypeMap: {
|
|
20
|
+
adult: string;
|
|
21
|
+
child: string;
|
|
22
|
+
infant_without_seat: string;
|
|
23
|
+
};
|
|
24
|
+
export type PassengerType = keyof typeof PassengerTypeMap;
|
|
25
|
+
export type PlaceType = "airport" | "city";
|
|
26
|
+
export interface PaymentRequirements {
|
|
27
|
+
/**
|
|
28
|
+
* The ISO 8601 datetime by which you must pay for this offer. At this
|
|
29
|
+
* time, if still unpaid, the reserved space on the flight(s) will be
|
|
30
|
+
* released and you will have to create a new order. This will be `null`
|
|
31
|
+
* when the offer requires immediate payment - that is, when
|
|
32
|
+
* `requires_instant_payment` is `true`.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* "2020-01-17T10:42:14Z"
|
|
36
|
+
*/
|
|
37
|
+
payment_required_by?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* The ISO 8601 datetime at which the price associated with the order will
|
|
40
|
+
* no longer be guaranteed by the airline and may change before payment.
|
|
41
|
+
* This will be null when `requires_instant_payment` is `true`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* "2020-01-17T10:42:14"
|
|
45
|
+
*/
|
|
46
|
+
price_guarantee_expires_at?: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* When payment is required at the time of booking this will be `true` and
|
|
49
|
+
* `payment_required_by` and `price_guarantee_expires_at` will be `null`.
|
|
50
|
+
* When payment can be made at a time after booking, this will be false
|
|
51
|
+
* and the time limits on the payment will be provided in
|
|
52
|
+
* `payment_required_by` and `price_guarantee_expires_at`.
|
|
53
|
+
*/
|
|
54
|
+
requires_instant_payment: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface OfferAvailableServiceCommon {
|
|
57
|
+
/**
|
|
58
|
+
* Duffel's unique identifier for the service.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* "ase_00009UhD4ongolulWd9123"
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* The maximum quantity of this service that can be booked with an order.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* 1
|
|
69
|
+
*/
|
|
70
|
+
maximum_quantity: number;
|
|
71
|
+
/**
|
|
72
|
+
* The list of passenger `id`s the service applies to. If you add this
|
|
73
|
+
* service to an order it will apply to all the passengers in this list.
|
|
74
|
+
* For services where the type is `baggage`, this list will include only a
|
|
75
|
+
* single passenger.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ["pas_00009hj8USM7Ncg31cBCLL"]
|
|
79
|
+
*/
|
|
80
|
+
passenger_ids: string[];
|
|
81
|
+
/**
|
|
82
|
+
* The list of segment `id`s the service applies to. If you add this
|
|
83
|
+
* service to an order it will apply to all the segments in this list. For
|
|
84
|
+
* services where the type is `baggage`, depending on the airline, this
|
|
85
|
+
* list includes all the segments of all slices or all the segments of a
|
|
86
|
+
* single slice.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ["seg_00009hj8USM7Ncg31cB456"]
|
|
90
|
+
*/
|
|
91
|
+
segment_ids: string[];
|
|
92
|
+
/**
|
|
93
|
+
* The total price of the service for all passengers and segments it
|
|
94
|
+
* applies to, including taxes. This price is for a single unit of the
|
|
95
|
+
* service.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* "15.00"
|
|
99
|
+
*/
|
|
100
|
+
total_amount: string;
|
|
101
|
+
/**
|
|
102
|
+
* The currency of the `totalAmount`, as an ISO 4217 currency code.
|
|
103
|
+
*/
|
|
104
|
+
total_currency: string;
|
|
105
|
+
}
|
|
106
|
+
export interface OfferAvailableServiceBaggageMetadata {
|
|
107
|
+
/**
|
|
108
|
+
* The maximum depth that the baggage can have in centimetres
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* 75
|
|
112
|
+
*/
|
|
113
|
+
maximum_depth_cm: number | null;
|
|
114
|
+
/**
|
|
115
|
+
* The maximum height that the baggage can have in centimetres
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* 90
|
|
119
|
+
*/
|
|
120
|
+
maximum_height_cm: number | null;
|
|
121
|
+
/**
|
|
122
|
+
* The maximum length that the baggage can have in centimetres
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* 90
|
|
126
|
+
*/
|
|
127
|
+
maximum_length_cm: number | null;
|
|
128
|
+
/**
|
|
129
|
+
* The maximum weight that the baggage can have in kilograms
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* 23
|
|
133
|
+
*/
|
|
134
|
+
maximum_weight_kg: number | null;
|
|
135
|
+
/**
|
|
136
|
+
* The type of the baggage
|
|
137
|
+
*/
|
|
138
|
+
type: BaggageType;
|
|
139
|
+
}
|
|
140
|
+
export interface OfferAvailableServiceBaggage extends OfferAvailableServiceCommon {
|
|
141
|
+
/**
|
|
142
|
+
* The metadata varies by the type of service. It includes further data
|
|
143
|
+
* about the service. For example, for baggages, it may have data about
|
|
144
|
+
* size and weight restrictions.
|
|
145
|
+
*/
|
|
146
|
+
metadata: OfferAvailableServiceBaggageMetadata;
|
|
147
|
+
/**
|
|
148
|
+
* The type of the service.
|
|
149
|
+
*/
|
|
150
|
+
type: "baggage";
|
|
151
|
+
}
|
|
152
|
+
export interface Offer {
|
|
153
|
+
/**
|
|
154
|
+
* The types of identity documents that may be provided for the passengers when creating an order based on this offer.
|
|
155
|
+
* Currently, the only supported type is `passport`. If this is `[]`, then you must not provide identity documents.
|
|
156
|
+
*/
|
|
157
|
+
allowed_passenger_identity_document_types: PassengerIdentityDocumentType[];
|
|
158
|
+
/**
|
|
159
|
+
* The services that can be booked along with the offer but are not included by default, for example an additional checked bag.
|
|
160
|
+
* This field is only returned in the Get single offer endpoint.
|
|
161
|
+
* When there are no services available, or we don't support services for the airline, this list will be empty.
|
|
162
|
+
*/
|
|
163
|
+
available_services: Array<OfferAvailableBaggageService | OfferAvailableServiceCancelForAnyReason>;
|
|
164
|
+
/**
|
|
165
|
+
* The base price of the offer for all passengers, excluding taxes.
|
|
166
|
+
* It does not include the base amount of any service(s) that might be booked with the offer.
|
|
167
|
+
*/
|
|
168
|
+
base_amount: string;
|
|
169
|
+
/**
|
|
170
|
+
* The currency of the `base_amount`, as an ISO 4217 currency code
|
|
171
|
+
*/
|
|
172
|
+
base_currency: string;
|
|
173
|
+
/**
|
|
174
|
+
* The ISO 8601 datetime at which the offer was created
|
|
175
|
+
*/
|
|
176
|
+
created_at: string;
|
|
177
|
+
/**
|
|
178
|
+
* The ISO 8601 datetime at which the offer will expire and no longer be usable to create an order
|
|
179
|
+
*/
|
|
180
|
+
expires_at: string;
|
|
181
|
+
/**
|
|
182
|
+
* Duffel's unique identifier for the offer
|
|
183
|
+
*/
|
|
184
|
+
id: string;
|
|
185
|
+
/**
|
|
186
|
+
* Whether the offer request was created in live mode.
|
|
187
|
+
* This field will be set to `true` if the offer request was created in live mode, or `false` if it was created in test mode.
|
|
188
|
+
*/
|
|
189
|
+
live_mode: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* The airline which provided the offer
|
|
192
|
+
*/
|
|
193
|
+
owner: Airline;
|
|
194
|
+
/**
|
|
195
|
+
* Whether the offer is a partial offer
|
|
196
|
+
*/
|
|
197
|
+
partial?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Whether identity documents must be provided for each of the passengers when creating an order based on this offer.
|
|
200
|
+
* If this is `true`, you must provide an identity document for every passenger.
|
|
201
|
+
*/
|
|
202
|
+
passenger_identity_documents_required: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* The passengers included in the offer
|
|
205
|
+
*/
|
|
206
|
+
passengers: OfferPassenger[];
|
|
207
|
+
/**
|
|
208
|
+
* The payment requirements for this offer.
|
|
209
|
+
*/
|
|
210
|
+
payment_requirements: PaymentRequirements;
|
|
211
|
+
/**
|
|
212
|
+
* The private fares applied on this offer.
|
|
213
|
+
*/
|
|
214
|
+
private_fares: OfferPrivateFare[];
|
|
215
|
+
/**
|
|
216
|
+
* The slices that make up this offer. Each slice will include one or more segments,
|
|
217
|
+
* the specific flights that the airline is offering to take the passengers from the slice's `origin` to its `destination`.
|
|
218
|
+
*/
|
|
219
|
+
slices: OfferSlice[];
|
|
220
|
+
/**
|
|
221
|
+
* The amount of tax payable on the offer for all passengers
|
|
222
|
+
*/
|
|
223
|
+
tax_amount: string | null;
|
|
224
|
+
/**
|
|
225
|
+
* The currency of the `tax_amount`, as an ISO 4217 currency code
|
|
226
|
+
*/
|
|
227
|
+
tax_currency: string | null;
|
|
228
|
+
/**
|
|
229
|
+
* The total price of the offer for all passengers, including taxes.
|
|
230
|
+
* It does not include the total price of any service(s) that might be booked with the offer.
|
|
231
|
+
*/
|
|
232
|
+
total_amount: string;
|
|
233
|
+
/**
|
|
234
|
+
* An estimate of the total carbon dioxide (CO₂) emissions when
|
|
235
|
+
* all of the passengers fly this offer's itinerary, measured in kilograms
|
|
236
|
+
*/
|
|
237
|
+
total_emissions_kg: string;
|
|
238
|
+
/**
|
|
239
|
+
* The currency of the `total_amount`, as an ISO 4217 currency code
|
|
240
|
+
*/
|
|
241
|
+
total_currency: string;
|
|
242
|
+
/**
|
|
243
|
+
* List of supported payment types
|
|
244
|
+
*/
|
|
245
|
+
available_payment_types: PaymentType[];
|
|
246
|
+
/**
|
|
247
|
+
* The conditions associated with this offer
|
|
248
|
+
*/
|
|
249
|
+
conditions: {
|
|
250
|
+
/**
|
|
251
|
+
* Whether the whole offer can be changed before the departure of the
|
|
252
|
+
* first slice. If the airline hasn't provided any information about
|
|
253
|
+
* whether this offer can be changed then this property will be `null`.
|
|
254
|
+
*/
|
|
255
|
+
change_before_departure: OfferCondition | null;
|
|
256
|
+
/**
|
|
257
|
+
* Whether the whole offer can be refunded before the departure of the
|
|
258
|
+
* first slice. If the airline hasn't provided any information about
|
|
259
|
+
* whether this offer can be refunded then this property will be `null`.
|
|
260
|
+
*/
|
|
261
|
+
refund_before_departure: OfferCondition | null;
|
|
262
|
+
};
|
|
263
|
+
client_key: string;
|
|
264
|
+
}
|
|
265
|
+
export interface OfferPassenger {
|
|
266
|
+
/**
|
|
267
|
+
* The age of the passenger on the departure_date of the final slice.
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* 14
|
|
271
|
+
*/
|
|
272
|
+
age: number;
|
|
273
|
+
/**
|
|
274
|
+
* The passenger's family name. Only `space`, `-`, `'`, and letters from
|
|
275
|
+
* the `ASCII`, `Latin-1 Supplement` and `Latin Extended-A` (with the
|
|
276
|
+
* exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode
|
|
277
|
+
* charts are accepted. All other characters will result in a validation
|
|
278
|
+
* error. The minimum length is 1 character, and the maximum is 20
|
|
279
|
+
* characters.
|
|
280
|
+
*
|
|
281
|
+
* This is only required if you're also including Loyalty Programme
|
|
282
|
+
* Accounts.
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* "Earhart"
|
|
286
|
+
*/
|
|
287
|
+
family_name: string | null;
|
|
288
|
+
/**
|
|
289
|
+
* The passenger's given name. Only `space`, `-`, `'`, and letters from
|
|
290
|
+
* the `ASCII`, `Latin-1 Supplement` and `Latin Extended-A` (with the
|
|
291
|
+
* exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode
|
|
292
|
+
* charts are accepted. All other characters will result in a validation
|
|
293
|
+
* error. The minimum length is 1 character, and the maximum is 20
|
|
294
|
+
* characters.
|
|
295
|
+
*
|
|
296
|
+
* This is only required if you're also including Loyalty Programme
|
|
297
|
+
* Accounts.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* "Amelia"
|
|
301
|
+
*/
|
|
302
|
+
given_name: string | null;
|
|
303
|
+
/**
|
|
304
|
+
* The identifier for the passenger. This ID will be generated by Duffel.
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* "pas_00009hj8USM7Ncg31cBCLx"
|
|
308
|
+
*/
|
|
309
|
+
id: string;
|
|
310
|
+
/**
|
|
311
|
+
* The Loyalty Programme Accounts for this passenger.
|
|
312
|
+
*/
|
|
313
|
+
loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
|
|
314
|
+
/**
|
|
315
|
+
* The type of the passenger.
|
|
316
|
+
*/
|
|
317
|
+
type: PassengerType;
|
|
318
|
+
}
|
|
319
|
+
export interface LoyaltyProgrammeAccount {
|
|
320
|
+
/**
|
|
321
|
+
* The passenger's account number for this Loyalty Programme Account
|
|
322
|
+
*/
|
|
323
|
+
account_number: string;
|
|
324
|
+
/**
|
|
325
|
+
* The IATA code for the airline that this Loyalty Programme Account belongs to
|
|
326
|
+
*/
|
|
327
|
+
airline_iata_code: string;
|
|
328
|
+
}
|
|
329
|
+
export interface OfferPrivateFare {
|
|
330
|
+
/**
|
|
331
|
+
* The corporate code that was applied, if any.
|
|
332
|
+
*/
|
|
333
|
+
corporate_code?: string;
|
|
334
|
+
/**
|
|
335
|
+
* The tracking reference that was applied, if any.
|
|
336
|
+
*/
|
|
337
|
+
tracking_reference?: string;
|
|
338
|
+
/**
|
|
339
|
+
* The type of private fare applied.
|
|
340
|
+
*/
|
|
341
|
+
type: "corporate" | "leisure" | "negotiated";
|
|
342
|
+
}
|
|
343
|
+
export interface OfferSlice {
|
|
344
|
+
/**
|
|
345
|
+
* The options and conditions to change or cancel this slice. Only
|
|
346
|
+
* "changing before departure" is allowed.
|
|
347
|
+
*/
|
|
348
|
+
conditions: {
|
|
349
|
+
/**
|
|
350
|
+
* Whether this slice can be changed before the departure. If the slice
|
|
351
|
+
* can be changed for all of the passengers then the allowed property
|
|
352
|
+
* will be `true` and information will be provided about any penalties. If
|
|
353
|
+
* none of the passengers on the slice can be changed then the allowed
|
|
354
|
+
* property will be `false`. In all other cases this property will be
|
|
355
|
+
* `null`indicating we can't provide the information for this slice.
|
|
356
|
+
*/
|
|
357
|
+
change_before_departure: OfferCondition | null;
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* The city or airport where this slice ends.
|
|
361
|
+
*/
|
|
362
|
+
destination: OfferSlicePlace;
|
|
363
|
+
/**
|
|
364
|
+
* The type of the destination.
|
|
365
|
+
*/
|
|
366
|
+
destination_type: PlaceType;
|
|
367
|
+
/**
|
|
368
|
+
* The duration of the slice, represented as a ISO 8601 duration.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* "PT02H26M"
|
|
372
|
+
*/
|
|
373
|
+
duration: string | null;
|
|
374
|
+
/**
|
|
375
|
+
* The name of the fare brand associated with this slice. A fare brand
|
|
376
|
+
* specifies the travel conditions you get on your slice made available by
|
|
377
|
+
* the airline. e.g. a British Airways Economy Basic fare will only
|
|
378
|
+
* include a hand baggage allowance. It is worth noting that the fare
|
|
379
|
+
* brand names are defined by the airlines themselves and therefore they
|
|
380
|
+
* are subject to change without any prior notice. We are in the process
|
|
381
|
+
* of adding support for `fare_brand_name` across all our airlines, so for
|
|
382
|
+
* now, this field may be `null` in some offers. This will become a
|
|
383
|
+
* non-nullable attribute in the near future.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* "Basic"
|
|
387
|
+
*/
|
|
388
|
+
fare_brand_name: string | null;
|
|
389
|
+
/**
|
|
390
|
+
* Duffel's unique identifier for the slice. It identifies the slice of
|
|
391
|
+
* an offer (i.e. the same slice across offers will have different `id`s).
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* "sli_00009htYpSCXrwaB9Dn123"
|
|
395
|
+
*/
|
|
396
|
+
id: string;
|
|
397
|
+
/**
|
|
398
|
+
* The city or airport where this slice begins.
|
|
399
|
+
*/
|
|
400
|
+
origin: OfferSlicePlace;
|
|
401
|
+
/**
|
|
402
|
+
* The type of the origin
|
|
403
|
+
*/
|
|
404
|
+
origin_type: PlaceType;
|
|
405
|
+
/**
|
|
406
|
+
* The segments - that is, specific flights - that the airline is offering
|
|
407
|
+
* to get the passengers from the `origin` to the `destination`
|
|
408
|
+
*/
|
|
409
|
+
segments: OfferSliceSegment[];
|
|
410
|
+
}
|
|
411
|
+
export interface OfferSlicePlace {
|
|
412
|
+
/**
|
|
413
|
+
* The 3-letter IATA code for the city where the place is located.
|
|
414
|
+
* Only present for airports which are registered with IATA as belonging to a [metropolitan area](https://portal.iata.org/faq/articles/en_US/FAQ/How-do-I-create-a-new-Metropolitan-Area).
|
|
415
|
+
*/
|
|
416
|
+
iata_city_code: string | null;
|
|
417
|
+
/**
|
|
418
|
+
* The 3-letter IATA code for the place
|
|
419
|
+
*/
|
|
420
|
+
iata_code: string;
|
|
421
|
+
/**
|
|
422
|
+
* Duffel's unique identifier for the place
|
|
423
|
+
*/
|
|
424
|
+
id: string;
|
|
425
|
+
/**
|
|
426
|
+
* The name of the place
|
|
427
|
+
*/
|
|
428
|
+
name: string;
|
|
429
|
+
/**
|
|
430
|
+
* The type of the place
|
|
431
|
+
*/
|
|
432
|
+
type: PlaceType;
|
|
433
|
+
/**
|
|
434
|
+
* The ISO 3166-1 alpha-2 code for the country where the city is located
|
|
435
|
+
*/
|
|
436
|
+
iata_country_code: string;
|
|
437
|
+
/**
|
|
438
|
+
* The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90°
|
|
439
|
+
*/
|
|
440
|
+
latitude: number | null;
|
|
441
|
+
/**
|
|
442
|
+
* The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180°
|
|
443
|
+
*/
|
|
444
|
+
longitude: number | null;
|
|
445
|
+
/**
|
|
446
|
+
* The four-character ICAO code for the airport
|
|
447
|
+
*/
|
|
448
|
+
icao_code: string | null;
|
|
449
|
+
/**
|
|
450
|
+
* The time zone of the airport, specified by name from the [tz database](https://en.wikipedia.org/wiki/Tz_database)
|
|
451
|
+
*/
|
|
452
|
+
time_zone: string | null;
|
|
453
|
+
/**
|
|
454
|
+
* The name of the city (or cities separated by a `/`) where the airport is located
|
|
455
|
+
*/
|
|
456
|
+
city_name: string | null;
|
|
457
|
+
/**
|
|
458
|
+
* The metropolitan area where the airport is located.
|
|
459
|
+
* Only present for airports which are registered with IATA as belonging to a metropolitan area.
|
|
460
|
+
*/
|
|
461
|
+
city: City;
|
|
462
|
+
}
|
|
463
|
+
export interface OfferSliceSegment {
|
|
464
|
+
/**
|
|
465
|
+
* The aircraft that the operating carrier will use to operate this segment
|
|
466
|
+
*/
|
|
467
|
+
aircraft: Aircraft;
|
|
468
|
+
/**
|
|
469
|
+
* The ISO 8601 datetime at which the segment is scheduled to arrive
|
|
470
|
+
*/
|
|
471
|
+
arriving_at: string;
|
|
472
|
+
/**
|
|
473
|
+
* The terminal at the destination airport where the segment is scheduled to arrive
|
|
474
|
+
*/
|
|
475
|
+
destination_terminal: string | null;
|
|
476
|
+
/**
|
|
477
|
+
* The ISO 8601 datetime at which the segment is scheduled to depart
|
|
478
|
+
*/
|
|
479
|
+
departing_at: string;
|
|
480
|
+
/**
|
|
481
|
+
* The terminal at the origin airport from which the segment is scheduled to depart
|
|
482
|
+
*/
|
|
483
|
+
origin_terminal: string | null;
|
|
484
|
+
/**
|
|
485
|
+
* The airport at which the segment is scheduled to arrive
|
|
486
|
+
*/
|
|
487
|
+
destination: Airport;
|
|
488
|
+
/**
|
|
489
|
+
* The distance of the segment in kilometres
|
|
490
|
+
*/
|
|
491
|
+
distance: string | null;
|
|
492
|
+
/**
|
|
493
|
+
* The duration of the segment, represented as a ISO 8601 duration
|
|
494
|
+
*/
|
|
495
|
+
duration: string | null;
|
|
496
|
+
/**
|
|
497
|
+
* Duffel's unique identifier for the segment. It identifies the segment of an offer (i.e. the same segment across offers will have different `id`s
|
|
498
|
+
*/
|
|
499
|
+
id: string;
|
|
500
|
+
/**
|
|
501
|
+
* The airline selling the tickets for this segment.
|
|
502
|
+
* This may differ from the `operating_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline.
|
|
503
|
+
*/
|
|
504
|
+
marketing_carrier: Airline;
|
|
505
|
+
/**
|
|
506
|
+
* The flight number assigned by the marketing carrier
|
|
507
|
+
*/
|
|
508
|
+
marketing_carrier_flight_number: string;
|
|
509
|
+
/**
|
|
510
|
+
* The airport from which the flight is scheduled to depart
|
|
511
|
+
*/
|
|
512
|
+
origin: Airport;
|
|
513
|
+
/**
|
|
514
|
+
* The airline actually operating this segment.
|
|
515
|
+
* This may differ from the marketing_carrier in the case of a "codeshare", where one airline sells flights operated by another airline.
|
|
516
|
+
*/
|
|
517
|
+
operating_carrier: Airline;
|
|
518
|
+
/**
|
|
519
|
+
* The flight number assigned by the operating carrier
|
|
520
|
+
*/
|
|
521
|
+
operating_carrier_flight_number?: string;
|
|
522
|
+
/**
|
|
523
|
+
* Additional segment-specific information about the passengers included in the offer (e.g. their baggage allowance and the cabin class they will be travelling in)
|
|
524
|
+
*/
|
|
525
|
+
passengers: OfferSliceSegmentPassenger[];
|
|
526
|
+
/**
|
|
527
|
+
* Additional segment-specific information about the stops, if any, included in the segment
|
|
528
|
+
*/
|
|
529
|
+
stops: OfferSliceSegmentStop[];
|
|
530
|
+
}
|
|
531
|
+
export interface OfferConditionModificationAllowed {
|
|
532
|
+
/**
|
|
533
|
+
* Allow the modification to the order
|
|
534
|
+
*/
|
|
535
|
+
allowed: true;
|
|
536
|
+
/**
|
|
537
|
+
* The penalty of the modification
|
|
538
|
+
*/
|
|
539
|
+
penalty_amount: number | null;
|
|
540
|
+
/**
|
|
541
|
+
* The penalty currency of the modification
|
|
542
|
+
*/
|
|
543
|
+
penalty_currency: string | null;
|
|
544
|
+
}
|
|
545
|
+
export interface OfferConditionNoModification {
|
|
546
|
+
/**
|
|
547
|
+
* No modification to the order is allowed
|
|
548
|
+
*/
|
|
549
|
+
allowed: false;
|
|
550
|
+
/**
|
|
551
|
+
* When the modification to the order is not allowed, both penalty amount and currency should be null
|
|
552
|
+
*/
|
|
553
|
+
penalty_amount: null;
|
|
554
|
+
penalty_currency: null;
|
|
555
|
+
}
|
|
556
|
+
export type OfferCondition = OfferConditionModificationAllowed | OfferConditionNoModification;
|
|
557
|
+
export interface OfferSliceSegmentPassenger {
|
|
558
|
+
/**
|
|
559
|
+
* The baggage allowances for the passenger on this segment included in the offer.
|
|
560
|
+
* Some airlines may allow additional baggage to be booked as a service - see the offer's available_services.
|
|
561
|
+
*/
|
|
562
|
+
baggages: OfferSliceSegmentPassengerBaggage[];
|
|
563
|
+
/**
|
|
564
|
+
* The cabin class that the passenger will travel in on this segment
|
|
565
|
+
*/
|
|
566
|
+
cabin_class: CabinClass;
|
|
567
|
+
/**
|
|
568
|
+
* The name that the marketing carrier uses to market this cabin class
|
|
569
|
+
*/
|
|
570
|
+
cabin_class_marketing_name: string;
|
|
571
|
+
/**
|
|
572
|
+
* The identifier for the passenger.
|
|
573
|
+
* You may have specified this ID yourself when creating the offer request, or otherwise, Duffel will have generated its own random ID.
|
|
574
|
+
*/
|
|
575
|
+
passenger_id: string;
|
|
576
|
+
}
|
|
577
|
+
export interface OfferSliceSegmentPassengerBaggage {
|
|
578
|
+
/**
|
|
579
|
+
* The type of the baggage allowance
|
|
580
|
+
*/
|
|
581
|
+
type: BaggageType;
|
|
582
|
+
/**
|
|
583
|
+
* The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
|
|
584
|
+
*/
|
|
585
|
+
quantity: number;
|
|
586
|
+
}
|
|
587
|
+
export interface OfferSliceSegmentStop {
|
|
588
|
+
/**
|
|
589
|
+
* Duffel's unique identifier for the Stop
|
|
590
|
+
*/
|
|
591
|
+
id: string;
|
|
592
|
+
/**
|
|
593
|
+
* The airport at which the Stop happens
|
|
594
|
+
*/
|
|
595
|
+
airport: Airport;
|
|
596
|
+
/**
|
|
597
|
+
* The ISO 8601 datetime at which the Stop is scheduled to arrive, in the airport's timezone (see destination.timezone)
|
|
598
|
+
*/
|
|
599
|
+
arriving_at: string;
|
|
600
|
+
/**
|
|
601
|
+
* The ISO 8601 datetime at which the Stop is scheduled to depart, in the airport's timezone (see origin.timezone)
|
|
602
|
+
*/
|
|
603
|
+
departing_at: string;
|
|
604
|
+
/**
|
|
605
|
+
* The duration of the Stop, represented as a ISO 8601 duration
|
|
606
|
+
*/
|
|
607
|
+
duration: string;
|
|
608
|
+
}
|
|
609
|
+
export interface LayoutSelectionPassenger {
|
|
610
|
+
id: string;
|
|
611
|
+
name?: string | null;
|
|
612
|
+
}
|
|
613
|
+
export interface OfferAvailableServiceSeatMetadata {
|
|
614
|
+
/**
|
|
615
|
+
* The designator used to uniquely identify the seat, usually made up of a row number and a column letter
|
|
616
|
+
*/
|
|
617
|
+
designator: string;
|
|
618
|
+
/**
|
|
619
|
+
* Each disclosure is text, in English, provided by the airline that describes the terms and conditions of this seat. We recommend showing this in your user interface to make sure that customers understand any restrictions and limitations.
|
|
620
|
+
*/
|
|
621
|
+
disclosures: string[];
|
|
622
|
+
/**
|
|
623
|
+
* A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
|
|
624
|
+
*/
|
|
625
|
+
name: string;
|
|
626
|
+
}
|
|
627
|
+
export type OfferAvailableService = OfferAvailableBaggageService | OfferAvailableServiceCancelForAnyReason;
|
|
628
|
+
interface OfferAvailableServiceBase {
|
|
629
|
+
/**
|
|
630
|
+
* Duffel's unique identifier for the service
|
|
631
|
+
*/
|
|
632
|
+
id: string;
|
|
633
|
+
/**
|
|
634
|
+
* The maximum quantity of this service that can be booked with an order
|
|
635
|
+
*/
|
|
636
|
+
maximum_quantity: number;
|
|
637
|
+
/**
|
|
638
|
+
* The list of passenger `id`s the service applies to.
|
|
639
|
+
* If you add this service to an order it will apply to all the passengers in this list.
|
|
640
|
+
* For services where the type is `baggage`, this list will include only a single passenger.
|
|
641
|
+
*/
|
|
642
|
+
passenger_ids: string[];
|
|
643
|
+
/**
|
|
644
|
+
* The list of segment ids the service applies to.
|
|
645
|
+
* If you add this service to an order it will apply to all the segments in this list.
|
|
646
|
+
* For services where the type is baggage, depending on the airline,
|
|
647
|
+
* this list includes all the segments of all slices or all the segments of a single slice.
|
|
648
|
+
*/
|
|
649
|
+
segment_ids: string[];
|
|
650
|
+
/**
|
|
651
|
+
* The total price of the service for all passengers and segments it applies to, including taxes
|
|
652
|
+
*/
|
|
653
|
+
total_amount: string;
|
|
654
|
+
/**
|
|
655
|
+
* The currency of the `total_amount`, as an ISO 4217 currency code
|
|
656
|
+
*/
|
|
657
|
+
total_currency: string;
|
|
658
|
+
}
|
|
659
|
+
export interface OfferAvailableBaggageService extends OfferAvailableServiceBase {
|
|
660
|
+
/**
|
|
661
|
+
* An object containing metadata about the service, like the maximum weight and dimensions of the baggage.
|
|
662
|
+
*/
|
|
663
|
+
metadata: OfferAvailableServiceBaggageMetadata;
|
|
664
|
+
/**
|
|
665
|
+
* The type of the service.
|
|
666
|
+
* For now we only return services of type baggage but we will return other types in the future.
|
|
667
|
+
* We won't consider adding new service types a break change.
|
|
668
|
+
*/
|
|
669
|
+
type: "baggage";
|
|
670
|
+
}
|
|
671
|
+
export interface OfferAvailableServiceCancelForAnyReason extends OfferAvailableServiceBase {
|
|
672
|
+
/**
|
|
673
|
+
* An object containing metadata about the service, like the refund amount when cancelling.
|
|
674
|
+
*/
|
|
675
|
+
metadata: OfferAvailableCancelForAnyReasonServiceMetadata;
|
|
676
|
+
/**
|
|
677
|
+
* The type of the service.
|
|
678
|
+
* For now we only return services of type baggage but we will return other types in the future.
|
|
679
|
+
* We won't consider adding new service types a break change.
|
|
680
|
+
*/
|
|
681
|
+
type: "cancel_for_any_reason";
|
|
682
|
+
}
|
|
683
|
+
export interface OfferAvailableSeatService extends OfferAvailableServiceBase {
|
|
684
|
+
/**
|
|
685
|
+
* An object containing metadata about the service, like the maximum weight and dimensions of the baggage.
|
|
686
|
+
*/
|
|
687
|
+
metadata: OfferAvailableServiceSeatMetadata;
|
|
688
|
+
/**
|
|
689
|
+
* The type of the service.
|
|
690
|
+
* For now we only return services of type baggage but we will return other types in the future.
|
|
691
|
+
* We won't consider adding new service types a break change.
|
|
692
|
+
*/
|
|
693
|
+
type: "seats";
|
|
694
|
+
}
|
|
695
|
+
export interface OfferAvailableCancelForAnyReasonServiceMetadata {
|
|
696
|
+
/**
|
|
697
|
+
* The URL where you can find the terms and conditions for this CFAR service
|
|
698
|
+
*/
|
|
699
|
+
terms_and_conditions_url: string;
|
|
700
|
+
/**
|
|
701
|
+
* The amount of money that will be returned
|
|
702
|
+
*/
|
|
703
|
+
refund_amount: string;
|
|
704
|
+
/**
|
|
705
|
+
* Details of what this CFAR service entails and how it can be used
|
|
706
|
+
*/
|
|
707
|
+
merchant_copy: string;
|
|
708
|
+
}
|
|
709
|
+
export type OfferAvailableServiceType = OfferAvailableService["type"];
|
|
710
|
+
export type OfferAvailableServiceMetadata = OfferAvailableServiceBaggageMetadata | OfferAvailableServiceSeatMetadata;
|
|
711
|
+
export {};
|