@duffel/components 3.1.2 → 3.1.3--prototype.2
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 +2 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.prettierignore +5 -1
- package/.storybook/main.ts +1 -1
- package/.tool-versions +1 -1
- package/.vscode/extensions.json +7 -0
- package/.vscode/settings.json +10 -0
- package/.yarn/releases/yarn-4.0.1.cjs +893 -0
- package/.yarn/sdks/eslint/bin/eslint.js +20 -0
- package/.yarn/sdks/eslint/lib/api.js +20 -0
- package/.yarn/sdks/eslint/lib/unsupported-api.js +20 -0
- package/.yarn/sdks/eslint/package.json +14 -0
- package/.yarn/sdks/integrations.yml +5 -0
- package/.yarn/sdks/prettier/bin-prettier.js +20 -0
- package/.yarn/sdks/prettier/index.js +20 -0
- package/.yarn/sdks/prettier/package.json +7 -0
- package/.yarn/sdks/typescript/bin/tsc +20 -0
- package/.yarn/sdks/typescript/bin/tsserver +20 -0
- package/.yarn/sdks/typescript/lib/tsc.js +20 -0
- package/.yarn/sdks/typescript/lib/tsserver.js +225 -0
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +225 -0
- package/.yarn/sdks/typescript/lib/typescript.js +20 -0
- package/.yarn/sdks/typescript/package.json +10 -0
- package/.yarnrc.yml +3 -0
- package/README.md +4 -0
- package/jest.config.ts +1 -1
- package/package.json +83 -134
- package/react-dist/custom-elements.js +20 -17
- package/react-dist/custom-elements.js.map +4 -4
- package/react-dist/index.js +21 -47
- package/react-dist/index.js.map +4 -4
- package/react-dist/scripts/generate-fixture.d.ts +3 -0
- package/react-dist/scripts/setup-suggestion-data.d.ts +28 -0
- package/react-dist/{components → src/components}/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +0 -1
- package/react-dist/{components → src/components}/DuffelPayments/DuffelPaymentsCustomElement.d.ts +0 -1
- package/react-dist/{index.d.ts → src/index.d.ts} +0 -1
- package/react-dist/{lib → src/lib}/logging.d.ts +1 -1
- package/scripts/build-and-publish.sh +42 -0
- package/scripts/generate-fixture.ts +2 -2
- package/scripts.tsconfig.json +1 -1
- package/src/components/PlacesLookup/PlacesLookup.tsx +2 -3
- package/src/examples/just-typescript/.yarn/install-state.gz +0 -0
- package/src/examples/just-typescript/package.json +2 -2
- package/src/examples/just-typescript/yarn.lock +467 -154
- package/src/examples/next/README.md +28 -0
- package/src/examples/next/next-env.d.ts +5 -0
- package/src/examples/next/next.config.js +4 -0
- package/src/examples/next/package.json +24 -0
- package/src/examples/next/src/app/DuffelComponents.tsx +40 -0
- package/src/examples/next/src/app/layout.tsx +18 -0
- package/src/examples/next/src/app/page.tsx +9 -0
- package/src/examples/next/tsconfig.json +27 -0
- package/src/examples/next/yarn.lock +257 -0
- package/src/examples/react-app/src/index.tsx +1 -1
- package/src/index.ts +0 -1
- package/src/lib/logging.ts +1 -1
- package/tsconfig.json +9 -3
- package/.github/workflows/autoapprove.yml +0 -18
- package/.github/workflows/release.yml +0 -89
- package/.husky/post-commit +0 -4
- package/.husky/pre-commit +0 -4
- package/.storybook/Storyshots.test.js +0 -3
- package/.storybook/__snapshots__/Storyshots.test.js.snap +0 -67984
- /package/react-dist/{components → src/components}/DuffelAncillaries/Card.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/Counter.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/DuffelAncillaries.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionController.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/Amenity.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/DeckSelect.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/Element.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/EmptyElement.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/ExitElement.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/Legend.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/Row.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/RowSection.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatElement.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatInfo.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatMap.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatSelectionCard.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatSelectionModal.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelAncillaries/seats/SeatUnavailable.d.ts +0 -0
- /package/react-dist/{components → src/components}/DuffelPayments/DuffelPayments.d.ts +0 -0
- /package/react-dist/{components → src/components}/PlacesLookup/PlacesLookup.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/AnimatedLoaderEllipsis.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/Button.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/ErrorBoundary.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/FetchOfferErrorState.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/Icon.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/IconButton.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/Modal.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/NonIdealState.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/Stamp.d.ts +0 -0
- /package/react-dist/{components → src/components}/shared/Tabs.d.ts +0 -0
- /package/react-dist/{custom-elements.d.ts → src/custom-elements.d.ts} +0 -0
- /package/react-dist/{lib → src/lib}/captureErrorInSentry.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/compileCreateOrderPayload.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/createPriceFormatters.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/fetchFromDuffelAPI.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/fetchFromFixtures.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/formatAvailableServices.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/formatDate.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/formatSeatMaps.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getBaggageServiceDescription.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getCabinsForSegmentAndDeck.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getCurrencyForSeatMaps.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getCurrencyForServices.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getFirstSeatElementMatchingCriteria.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getPassengerBySegmentList.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getPassengerInitials.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getPassengerMapById.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getPassengerName.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getRowNumber.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getSegmentList.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getServicePriceMapById.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getSymbols.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getTotalAmountForServices.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/getTotalQuantity.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/hasHighLuminance.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/hasService.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/hasWings.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/isBaggageService.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/isCancelForAnyReasonService.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/isFixtureOfferId.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/isPayloadComplete.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/isSeatElement.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/moneyStringFormatter.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/offerIsExpired.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/retrieveOffer.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/retrieveOfferFromDuffelAPI.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/retrieveSeatMaps.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/retrieveSeatMapsFromDuffelAPI.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/setBodyScrollability.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/validateProps.d.ts +0 -0
- /package/react-dist/{lib → src/lib}/withPlural.d.ts +0 -0
- /package/react-dist/{types → src/types}/Aircraft.d.ts +0 -0
- /package/react-dist/{types → src/types}/Airline.d.ts +0 -0
- /package/react-dist/{types → src/types}/Airport.d.ts +0 -0
- /package/react-dist/{types → src/types}/City.d.ts +0 -0
- /package/react-dist/{types → src/types}/CreateOrderPayload.d.ts +0 -0
- /package/react-dist/{types → src/types}/CurrencyConversion.d.ts +0 -0
- /package/react-dist/{types → src/types}/DuffelAncillariesProps.d.ts +0 -0
- /package/react-dist/{types → src/types}/Offer.d.ts +0 -0
- /package/react-dist/{types → src/types}/Order.d.ts +0 -0
- /package/react-dist/{types → src/types}/Place.d.ts +0 -0
- /package/react-dist/{types → src/types}/SeatMap.d.ts +0 -0
- /package/react-dist/{types → src/types}/index.d.ts +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DuffelAncillariesPropsWithClientKeyAndOfferId, DuffelAncillariesPropsWithOfferIdForFixture, DuffelAncillariesPropsWithOffersAndSeatMaps, DuffelAncillariesPropWithOfferAndClientKey, OnPayloadReady } from "../../types/DuffelAncillariesProps";
|
|
3
2
|
declare global {
|
|
4
3
|
namespace JSX {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
if [[ "$@" == *"--help"* ]]; then
|
|
2
|
+
echo ""
|
|
3
|
+
echo "Builds and publishes the package to npm and CDN."
|
|
4
|
+
echo ""
|
|
5
|
+
echo "Usage:"
|
|
6
|
+
echo " build-and-publish.sh [--dry-run] [--help]"
|
|
7
|
+
echo ""
|
|
8
|
+
echo "Options:"
|
|
9
|
+
echo " ‣ --help Show this help message"
|
|
10
|
+
echo " ‣ --dry-run Build and test, but do not publish"
|
|
11
|
+
echo ""
|
|
12
|
+
|
|
13
|
+
exit 0
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Cleanup the old builds:
|
|
17
|
+
rm -rf ./cdn-dist
|
|
18
|
+
rm -rf ./react-dist
|
|
19
|
+
|
|
20
|
+
# Build for distribution
|
|
21
|
+
|
|
22
|
+
## For those that rely on <script></script>
|
|
23
|
+
node config/esbuild.cdn.config.js
|
|
24
|
+
|
|
25
|
+
## For those that rely on `npm i`
|
|
26
|
+
node config/esbuild.react.config.js
|
|
27
|
+
|
|
28
|
+
## For those that use typescript
|
|
29
|
+
tsc --project tsconfig.json
|
|
30
|
+
|
|
31
|
+
# Only upload to CDN and publish to npm if it's not a dry run
|
|
32
|
+
if [[ "$@" != *"--dry-run"* ]]; then
|
|
33
|
+
# Upload css, js and fixtures to CDN
|
|
34
|
+
bash ./scripts/upload-to-cdn.sh
|
|
35
|
+
|
|
36
|
+
# Publish to npm with tag
|
|
37
|
+
npm publish --tag igorp1-prototype
|
|
38
|
+
else
|
|
39
|
+
echo ""
|
|
40
|
+
echo "Dry run. @duffel/components not published."
|
|
41
|
+
echo ""
|
|
42
|
+
fi
|
|
@@ -24,7 +24,7 @@ const duffelHeaders = {
|
|
|
24
24
|
Authorization: `Bearer ${DUFFEL_API_TOKEN}`,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export const makeMockDateInTheFuture = (daysAhead) => {
|
|
27
|
+
export const makeMockDateInTheFuture = (daysAhead: number) => {
|
|
28
28
|
const now = new Date(Date.now());
|
|
29
29
|
now.setDate(now.getDate() + daysAhead);
|
|
30
30
|
return now;
|
|
@@ -137,7 +137,7 @@ const main = async () => {
|
|
|
137
137
|
);
|
|
138
138
|
if (VERBOSE) {
|
|
139
139
|
const airlines = new Set(
|
|
140
|
-
offerRequest.offers.map((offer) => offer.owner.iata_code)
|
|
140
|
+
offerRequest.offers.map((offer: Offer) => offer.owner.iata_code)
|
|
141
141
|
);
|
|
142
142
|
log(
|
|
143
143
|
`Received ${withPlural(
|
package/scripts.tsconfig.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Fuse from "fuse.js";
|
|
2
2
|
import { debounce } from "lodash";
|
|
3
|
-
import fetch from "node-fetch";
|
|
4
3
|
import React from "react";
|
|
5
4
|
import { Icon } from "../shared/Icon";
|
|
6
5
|
|
|
@@ -61,8 +60,8 @@ export const PlacesLookup: React.FC<PlacesLookupProps> = ({
|
|
|
61
60
|
|
|
62
61
|
React.useEffect(() => {
|
|
63
62
|
fetch(DATA_SOURCE)
|
|
64
|
-
.then((response) => response.json())
|
|
65
|
-
.then((data) =>
|
|
63
|
+
.then((response: Response) => response.json())
|
|
64
|
+
.then((data: string[]) =>
|
|
66
65
|
setLookupData(
|
|
67
66
|
new Fuse<Place>(mapDataRowsIntoObjects(data), {
|
|
68
67
|
threshold: 0.2,
|
|
Binary file
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@types/node": "20.2.5",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"duffel-components": "../../../../duffel-components",
|
|
11
|
+
"typescript": "5.0.4"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"esbuild": "^0.17.19"
|