@mrfylke/contact-form 0.1.4 → 0.1.7
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 +17 -0
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +3 -1
- package/lib/commoneEvents.d.ts.map +1 -1
- package/lib/components/button/button.d.ts.map +1 -1
- package/lib/components/button/button.module.css +151 -139
- package/lib/components/button/index.d.ts.map +1 -1
- package/lib/components/button/link.d.ts.map +1 -1
- package/lib/components/button/utils.d.ts.map +1 -1
- package/lib/components/checkbox/checkbox.d.ts.map +1 -1
- package/lib/components/checkbox/checkbox.module.css +40 -37
- package/lib/components/checkbox/index.d.ts.map +1 -1
- package/lib/components/error-message/error-message.d.ts.map +1 -1
- package/lib/components/error-message/error-message.module.css +2 -2
- package/lib/components/error-message/index.d.ts.map +1 -1
- package/lib/components/external-link-page.d.ts +1 -1
- package/lib/components/external-link-page.d.ts.map +1 -1
- package/lib/components/external-link-page.js +7 -6
- package/lib/components/external-link-page.module.css +15 -15
- package/lib/components/form/date-selector.d.ts +1 -1
- package/lib/components/form/date-selector.d.ts.map +1 -1
- package/lib/components/form/description-modal.d.ts.map +1 -1
- package/lib/components/form/field-wrapper-with-error/index.d.ts +1 -1
- package/lib/components/form/field-wrapper-with-error/index.d.ts.map +1 -1
- package/lib/components/form/fieldset/fieldset.module.css +15 -15
- package/lib/components/form/fieldset/index.d.ts.map +1 -1
- package/lib/components/form/file-input.d.ts.map +1 -1
- package/lib/components/form/file-input.js +1 -1
- package/lib/components/form/form-component-label/form-component-label.module.css +4 -4
- package/lib/components/form/form-component-label/index.d.ts.map +1 -1
- package/lib/components/form/form.module.css +324 -308
- package/lib/components/form/index.d.ts.map +1 -1
- package/lib/components/form/input.d.ts +1 -1
- package/lib/components/form/input.d.ts.map +1 -1
- package/lib/components/form/input.js +1 -1
- package/lib/components/form/radio.d.ts.map +1 -1
- package/lib/components/form/searchable-select/index.d.ts.map +1 -1
- package/lib/components/form/searchable-select/searchable-select.d.ts.map +1 -1
- package/lib/components/form/searchable-select/searchable-select.js +1 -1
- package/lib/components/form/searchable-select/utils.d.ts +1 -1
- package/lib/components/form/searchable-select/utils.d.ts.map +1 -1
- package/lib/components/form/select.d.ts.map +1 -1
- package/lib/components/form/textarea.d.ts.map +1 -1
- package/lib/components/form/time-selector.d.ts +1 -1
- package/lib/components/form/time-selector.d.ts.map +1 -1
- package/lib/components/icon/checkbox-icon.d.ts +1 -1
- package/lib/components/icon/checkbox-icon.d.ts.map +1 -1
- package/lib/components/icon/checkbox-icon.js +1 -1
- package/lib/components/icon/color-icon.d.ts.map +1 -1
- package/lib/components/icon/color-icon.js +0 -2
- package/lib/components/icon/generated-icons.d.ts +233 -233
- package/lib/components/icon/generated-icons.d.ts.map +1 -1
- package/lib/components/icon/generated-icons.js +1771 -1771
- package/lib/components/icon/icon-wrapper.d.ts +1 -1
- package/lib/components/icon/icon-wrapper.d.ts.map +1 -1
- package/lib/components/icon/illustration.d.ts.map +1 -1
- package/lib/components/icon/illustration.js +0 -2
- package/lib/components/icon/image.d.ts.map +1 -1
- package/lib/components/icon/image.js +0 -2
- package/lib/components/icon/mono-icon-new.d.ts +2 -2
- package/lib/components/icon/mono-icon-new.d.ts.map +1 -1
- package/lib/components/icon/mono-icon.d.ts +1 -1
- package/lib/components/icon/mono-icon.d.ts.map +1 -1
- package/lib/components/icon/mono-icon.js +1 -3
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/loading/index.d.ts +1 -1
- package/lib/components/loading/index.d.ts.map +1 -1
- package/lib/components/loading/loading.module.css +9 -9
- package/lib/components/section-card/index.d.ts.map +1 -1
- package/lib/components/section-card/section-card.d.ts.map +1 -1
- package/lib/components/section-card/section-card.module.css +10 -10
- package/lib/components/typography/index.d.ts +6 -5
- package/lib/components/typography/index.d.ts.map +1 -1
- package/lib/components/typography/index.js +0 -1
- package/lib/contact.module.css +37 -36
- package/lib/error-content/error-content.module.css +7 -7
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/journey-info/events.d.ts +6 -6
- package/lib/journey-info/events.d.ts.map +1 -1
- package/lib/journey-info/events.js +0 -1
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +4 -2
- package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -1
- package/lib/layouts/contact-form-container.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.d.ts +2 -2
- package/lib/layouts/contact-page-layout.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.js +1 -5
- package/lib/layouts/container.module.css +10 -10
- package/lib/layouts/index.d.ts.map +1 -1
- package/lib/layouts/layout.module.css +46 -45
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/means-of-transport/events.d.ts +7 -7
- package/lib/means-of-transport/events.d.ts.map +1 -1
- package/lib/means-of-transport/events.js +0 -1
- package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/index.d.ts.map +1 -1
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +4 -2
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.js +5 -1
- package/lib/modules/api-browser/index.d.ts.map +1 -1
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/theme-adapter.d.ts.map +1 -1
- package/lib/modules/config/types.d.ts +4 -34
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/graphql-types/index.d.ts.map +1 -1
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.d.ts.map +1 -1
- package/lib/modules/theme/index.d.ts.map +1 -1
- package/lib/modules/theme/theme-context.d.ts +1 -1
- package/lib/modules/theme/theme-context.d.ts.map +1 -1
- package/lib/modules/theme/theme-context.js +9 -6
- package/lib/modules/transport-mode/filter/filter.d.ts.map +1 -1
- package/lib/modules/transport-mode/filter/filter.module.css +51 -49
- package/lib/modules/transport-mode/filter/index.d.ts.map +1 -1
- package/lib/modules/transport-mode/filter/types.d.ts.map +1 -1
- package/lib/modules/transport-mode/filter/utils.d.ts.map +1 -1
- package/lib/modules/transport-mode/icon/icon.module.css +14 -14
- package/lib/modules/transport-mode/icon/index.d.ts.map +1 -1
- package/lib/modules/transport-mode/icon/index.js +1 -1
- package/lib/modules/transport-mode/index.d.ts.map +1 -1
- package/lib/modules/transport-mode/types.d.ts.map +1 -1
- package/lib/modules/transport-mode/utils.d.ts.map +1 -1
- package/lib/refund/events.d.ts +12 -12
- package/lib/refund/events.d.ts.map +1 -1
- package/lib/refund/events.js +0 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +4 -2
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +9 -3
- package/lib/server/index.d.ts +1 -1
- package/lib/server/index.d.ts.map +1 -1
- package/lib/server/journey-planner/authority.d.ts.map +1 -1
- package/lib/server/journey-planner/entur-client.d.ts.map +1 -1
- package/lib/server/journey-planner/index.d.ts.map +1 -1
- package/lib/server/journey-planner/journey-gql/lines.generated.d.ts +1 -1
- package/lib/server/journey-planner/journey-gql/lines.generated.d.ts.map +1 -1
- package/lib/server/journey-planner/journey-gql/lines.generated.js +11 -11
- package/lib/server/journey-planner/validators.d.ts.map +1 -1
- package/lib/server/types.d.ts.map +1 -1
- package/lib/success-content/success-content.module.css +7 -7
- package/lib/ticket-control/events.d.ts +6 -6
- package/lib/ticket-control/events.d.ts.map +1 -1
- package/lib/ticket-control/events.js +0 -1
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +4 -2
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +7 -2
- package/lib/ticketing/events.d.ts +10 -10
- package/lib/ticketing/events.d.ts.map +1 -1
- package/lib/ticketing/events.js +0 -1
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/index.d.ts.map +1 -1
- package/lib/ticketing/forms/app/index.js +1 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/index.js +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/index.js +1 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/index.d.ts.map +1 -1
- package/lib/ticketing/index.js +4 -2
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
- package/lib/ticketing/ticketingStateMachine.js +2 -1
- package/lib/translations/common/index.d.ts.map +1 -1
- package/lib/translations/common/layout.d.ts.map +1 -1
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/components/index.d.ts.map +1 -1
- package/lib/translations/components/map.d.ts.map +1 -1
- package/lib/translations/components/search.d.ts.map +1 -1
- package/lib/translations/components/transport-mode.d.ts.map +1 -1
- package/lib/translations/dictionary.d.ts.map +1 -1
- package/lib/translations/index.d.ts +2 -2
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/json-to-override.d.ts.map +1 -1
- package/lib/translations/json-to-override.js +15 -5
- package/lib/translations/language-context.d.ts.map +1 -1
- package/lib/translations/language-context.js +5 -9
- package/lib/translations/load-org-translations.d.ts.map +1 -1
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +3 -1
- package/lib/translations/modules/index.d.ts +0 -1
- package/lib/translations/modules/index.d.ts.map +1 -1
- package/lib/translations/modules/index.js +1 -3
- package/lib/translations/modules/situation.d.ts.map +1 -1
- package/lib/translations/pages/contact.d.ts +1 -1
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/departures.d.ts.map +1 -1
- package/lib/translations/pages/index.d.ts.map +1 -1
- package/lib/translations/server/endpoints.d.ts.map +1 -1
- package/lib/translations/server/index.d.ts.map +1 -1
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/types.d.ts.map +1 -1
- package/lib/translations/utils.d.ts.map +1 -1
- package/lib/translations/utils.js +3 -1
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/color.js +1 -1
- package/lib/utils/date.d.ts.map +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/env.d.ts.map +1 -1
- package/lib/utils/presence.d.ts.map +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/validation/commonInputValidator.d.ts.map +1 -1
- package/lib/validation/index.d.ts.map +1 -1
- package/lib/validation/validationRules.d.ts.map +1 -1
- package/package.json +2 -3
- package/lib/layouts/contact-form-footer.d.ts +0 -5
- package/lib/layouts/contact-form-footer.d.ts.map +0 -1
- package/lib/layouts/contact-form-footer.js +0 -59
- package/lib/layouts/contact-form-header.d.ts +0 -9
- package/lib/layouts/contact-form-header.d.ts.map +0 -1
- package/lib/layouts/contact-form-header.js +0 -45
- package/lib/layouts/footer.module.css +0 -109
- package/lib/layouts/header.module.css +0 -39
- package/lib/modules/api-server/external-client.d.ts +0 -22
- package/lib/modules/api-server/external-client.d.ts.map +0 -1
- package/lib/modules/api-server/external-client.js +0 -86
- package/lib/modules/api-server/index.d.ts +0 -9
- package/lib/modules/api-server/index.d.ts.map +0 -1
- package/lib/modules/api-server/index.js +0 -24
- package/lib/modules/api-server/requesters/graphql-requester.d.ts +0 -6
- package/lib/modules/api-server/requesters/graphql-requester.d.ts.map +0 -1
- package/lib/modules/api-server/requesters/graphql-requester.js +0 -63
- package/lib/modules/api-server/requesters/http-requester.d.ts +0 -3
- package/lib/modules/api-server/requesters/http-requester.d.ts.map +0 -1
- package/lib/modules/api-server/requesters/http-requester.js +0 -110
- package/lib/modules/api-server/requesters/types.d.ts +0 -37
- package/lib/modules/api-server/requesters/types.d.ts.map +0 -1
- package/lib/modules/api-server/requesters/types.js +0 -34
- package/lib/modules/api-server/requesters/utils.d.ts +0 -17
- package/lib/modules/api-server/requesters/utils.d.ts.map +0 -1
- package/lib/modules/api-server/requesters/utils.js +0 -75
- package/lib/modules/cookies/constants.d.ts +0 -4
- package/lib/modules/cookies/constants.d.ts.map +0 -1
- package/lib/modules/cookies/constants.js +0 -6
- package/lib/modules/cookies/cookies-context.d.ts +0 -17
- package/lib/modules/cookies/cookies-context.d.ts.map +0 -1
- package/lib/modules/cookies/cookies-context.js +0 -61
- package/lib/modules/cookies/index.d.ts +0 -15
- package/lib/modules/cookies/index.d.ts.map +0 -1
- package/lib/modules/cookies/index.js +0 -22
- package/lib/modules/firebase/analytics.d.ts +0 -3
- package/lib/modules/firebase/analytics.d.ts.map +0 -1
- package/lib/modules/firebase/analytics.js +0 -40
- package/lib/modules/firebase/firebase.d.ts +0 -4
- package/lib/modules/firebase/firebase.d.ts.map +0 -1
- package/lib/modules/firebase/firebase.js +0 -19
- package/lib/modules/firebase/index.d.ts +0 -5
- package/lib/modules/firebase/index.d.ts.map +0 -1
- package/lib/modules/firebase/index.js +0 -25
- package/lib/modules/firebase/preassigned-fare-products.d.ts +0 -8
- package/lib/modules/firebase/preassigned-fare-products.d.ts.map +0 -1
- package/lib/modules/firebase/preassigned-fare-products.js +0 -35
- package/lib/modules/firebase/tariff-zones.d.ts +0 -17
- package/lib/modules/firebase/tariff-zones.d.ts.map +0 -1
- package/lib/modules/firebase/tariff-zones.js +0 -32
- package/lib/modules/firebase/transport-mode-filter.d.ts +0 -27
- package/lib/modules/firebase/transport-mode-filter.d.ts.map +0 -1
- package/lib/modules/firebase/transport-mode-filter.js +0 -27
- package/lib/modules/firebase/types.d.ts +0 -19
- package/lib/modules/firebase/types.d.ts.map +0 -1
- package/lib/modules/firebase/types.js +0 -15
- package/lib/modules/logging/index.d.ts +0 -6
- package/lib/modules/logging/index.d.ts.map +0 -1
- package/lib/modules/logging/index.js +0 -13
- package/lib/modules/logging/log-api-response.d.ts +0 -15
- package/lib/modules/logging/log-api-response.d.ts.map +0 -1
- package/lib/modules/logging/log-api-response.js +0 -52
- package/lib/modules/logging/log-page-access.d.ts +0 -20
- package/lib/modules/logging/log-page-access.d.ts.map +0 -1
- package/lib/modules/logging/log-page-access.js +0 -60
- package/lib/modules/logging/logger.d.ts +0 -3
- package/lib/modules/logging/logger.d.ts.map +0 -1
- package/lib/modules/logging/logger.js +0 -32
- package/lib/modules/logging/timer.d.ts +0 -6
- package/lib/modules/logging/timer.d.ts.map +0 -1
- package/lib/modules/logging/timer.js +0 -13
- package/lib/modules/logging/with-access-logging.d.ts +0 -5
- package/lib/modules/logging/with-access-logging.d.ts.map +0 -1
- package/lib/modules/logging/with-access-logging.js +0 -20
- package/lib/modules/transport-mode/icon/transport-icon-new.d.ts +0 -28
- package/lib/modules/transport-mode/icon/transport-icon-new.d.ts.map +0 -1
- package/lib/modules/transport-mode/icon/transport-icon-new.js +0 -114
- package/lib/server/contact/index.d.ts +0 -11
- package/lib/server/contact/index.d.ts.map +0 -1
- package/lib/server/contact/index.js +0 -47
- package/lib/translations/__tests__/utils.test.d.ts +0 -2
- package/lib/translations/__tests__/utils.test.d.ts.map +0 -1
- package/lib/translations/__tests__/utils.test.js +0 -35
- package/lib/translations/modules/layout.d.ts +0 -73
- package/lib/translations/modules/layout.d.ts.map +0 -1
- package/lib/translations/modules/layout.js +0 -106
- package/lib/translations/pages/assistant.d.ts +0 -2
- package/lib/translations/pages/assistant.d.ts.map +0 -1
- package/lib/translations/pages/assistant.js +0 -303
- package/lib/utils/enum-from-string.d.ts +0 -4
- package/lib/utils/enum-from-string.d.ts.map +0 -1
- package/lib/utils/enum-from-string.js +0 -9
- package/lib/utils/only-uniques.d.ts +0 -3
- package/lib/utils/only-uniques.d.ts.map +0 -1
- package/lib/utils/only-uniques.js +0 -7
- package/lib/utils/org-theme-definitions.d.ts +0 -5
- package/lib/utils/org-theme-definitions.d.ts.map +0 -1
- package/lib/utils/org-theme-definitions.js +0 -13
- package/lib/utils/reference-data.d.ts +0 -15
- package/lib/utils/reference-data.d.ts.map +0 -1
- package/lib/utils/reference-data.js +0 -15
- package/lib/utils/use-client-width.d.ts +0 -2
- package/lib/utils/use-client-width.d.ts.map +0 -1
- package/lib/utils/use-client-width.js +0 -18
- package/lib/utils/use-interval.d.ts +0 -2
- package/lib/utils/use-interval.d.ts.map +0 -1
- package/lib/utils/use-interval.js +0 -22
- package/lib/utils/use-localstorage.d.ts +0 -2
- package/lib/utils/use-localstorage.d.ts.map +0 -1
- package/lib/utils/use-localstorage.js +0 -40
- package/lib/utils/use-now.d.ts +0 -2
- package/lib/utils/use-now.d.ts.map +0 -1
- package/lib/utils/use-now.js +0 -13
- package/lib/utils/user-media-query.d.ts +0 -2
- package/lib/utils/user-media-query.d.ts.map +0 -1
- package/lib/utils/user-media-query.js +0 -36
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/firebase/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;iBAS3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tariffZoneSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const types_1 = require("../../translations/types");
|
|
6
|
-
exports.tariffZoneSchema = zod_1.z.object({
|
|
7
|
-
geometry: zod_1.z.object({
|
|
8
|
-
coordinates: zod_1.z.array(zod_1.z.array(zod_1.z.array(zod_1.z.number()))),
|
|
9
|
-
type: zod_1.z.literal('Polygon'),
|
|
10
|
-
}),
|
|
11
|
-
id: zod_1.z.string(),
|
|
12
|
-
name: types_1.languageAndTextSchema,
|
|
13
|
-
version: zod_1.z.string(),
|
|
14
|
-
isDefault: zod_1.z.boolean().optional(),
|
|
15
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { logApiResponse } from './log-api-response';
|
|
2
|
-
export { logPageAccess } from './log-page-access';
|
|
3
|
-
export { withAccessLogging } from './with-access-logging';
|
|
4
|
-
export { Timer } from './timer';
|
|
5
|
-
export { logger } from './logger';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/logging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = exports.Timer = exports.withAccessLogging = exports.logPageAccess = exports.logApiResponse = void 0;
|
|
4
|
-
var log_api_response_1 = require("./log-api-response");
|
|
5
|
-
Object.defineProperty(exports, "logApiResponse", { enumerable: true, get: function () { return log_api_response_1.logApiResponse; } });
|
|
6
|
-
var log_page_access_1 = require("./log-page-access");
|
|
7
|
-
Object.defineProperty(exports, "logPageAccess", { enumerable: true, get: function () { return log_page_access_1.logPageAccess; } });
|
|
8
|
-
var with_access_logging_1 = require("./with-access-logging");
|
|
9
|
-
Object.defineProperty(exports, "withAccessLogging", { enumerable: true, get: function () { return with_access_logging_1.withAccessLogging; } });
|
|
10
|
-
var timer_1 = require("./timer");
|
|
11
|
-
Object.defineProperty(exports, "Timer", { enumerable: true, get: function () { return timer_1.Timer; } });
|
|
12
|
-
var logger_1 = require("./logger");
|
|
13
|
-
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IncomingHttpHeaders } from 'http';
|
|
2
|
-
type LogResponseParams = {
|
|
3
|
-
message: string;
|
|
4
|
-
duration: number;
|
|
5
|
-
requestHeaders: IncomingHttpHeaders;
|
|
6
|
-
responseHeaders?: any;
|
|
7
|
-
url?: string;
|
|
8
|
-
statusCode?: number;
|
|
9
|
-
method?: string;
|
|
10
|
-
operationName?: string;
|
|
11
|
-
customerAccountId?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const logApiResponse: ({ message, duration, requestHeaders, responseHeaders, url, statusCode, method, operationName, customerAccountId, }: LogResponseParams) => void;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=log-api-response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-api-response.d.ts","sourceRoot":"","sources":["../../../src/modules/logging/log-api-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,MAAM,CAAC;AAGzC,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,mBAAmB,CAAC;IACpC,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,oHAUG,iBAAiB,SAgDlD,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logApiResponse = void 0;
|
|
4
|
-
const logger_1 = require("./logger");
|
|
5
|
-
const logApiResponse = ({ message, duration, requestHeaders, responseHeaders, url, statusCode, method, operationName, customerAccountId, }) => {
|
|
6
|
-
const rateLimitUsed = responseHeaders?.get('rate-limit-used');
|
|
7
|
-
const rateLimitAllowed = responseHeaders?.get('rate-limit-allowed');
|
|
8
|
-
let operationNameGroup = 'other';
|
|
9
|
-
if (url) {
|
|
10
|
-
if (url.includes('/mobility')) {
|
|
11
|
-
operationNameGroup = 'mobility';
|
|
12
|
-
}
|
|
13
|
-
else if (url.includes('/journey-planner')) {
|
|
14
|
-
operationNameGroup =
|
|
15
|
-
operationName == 'Trips' ? 'planner-trip' : 'planner-nontrip';
|
|
16
|
-
}
|
|
17
|
-
else if (url.includes('/geocoder')) {
|
|
18
|
-
operationNameGroup = 'geocoder';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
let severity = 'INFO';
|
|
22
|
-
if (statusCode && statusCode >= 400) {
|
|
23
|
-
severity = 'ERROR';
|
|
24
|
-
}
|
|
25
|
-
const time = responseHeaders
|
|
26
|
-
? new Date(responseHeaders?.get('date')).toISOString()
|
|
27
|
-
: new Date().toISOString();
|
|
28
|
-
const log = {
|
|
29
|
-
severity: severity,
|
|
30
|
-
time: time,
|
|
31
|
-
message: message,
|
|
32
|
-
correlationId: requestHeaders['correlationId'],
|
|
33
|
-
method: method,
|
|
34
|
-
url: url,
|
|
35
|
-
code: statusCode,
|
|
36
|
-
requestId: requestHeaders['requestId'],
|
|
37
|
-
installId: requestHeaders['installId'],
|
|
38
|
-
appVersion: requestHeaders['appVersion'],
|
|
39
|
-
customerAccountId: customerAccountId,
|
|
40
|
-
rateLimitUsed: rateLimitUsed,
|
|
41
|
-
rateLimitAllowed: rateLimitAllowed,
|
|
42
|
-
rateLimitGroup: operationNameGroup,
|
|
43
|
-
duration: `${duration}ms`,
|
|
44
|
-
};
|
|
45
|
-
if (severity == 'INFO') {
|
|
46
|
-
logger_1.logger.info(log);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
logger_1.logger.error(log);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
exports.logApiResponse = logApiResponse;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IncomingHttpHeaders } from 'http';
|
|
2
|
-
import { GetServerSidePropsResult } from 'next/types';
|
|
3
|
-
type LogPageAccessParams = {
|
|
4
|
-
duration: number;
|
|
5
|
-
url?: string;
|
|
6
|
-
method?: string;
|
|
7
|
-
statusCode?: number;
|
|
8
|
-
requestHeaders?: IncomingHttpHeaders;
|
|
9
|
-
propsResult?: GetServerSidePropsResult<any>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Fire-and-forget function for access logging.
|
|
13
|
-
*
|
|
14
|
-
* The exported function itself is not async since there is no promise to ever wait for from the outside.
|
|
15
|
-
* But since it does access the propsResult.props which can be a promise it needs to be async internally.
|
|
16
|
-
*/
|
|
17
|
-
export declare function logPageAccess({ duration, url, method, requestHeaders, statusCode, propsResult, }: LogPageAccessParams): void;
|
|
18
|
-
export declare function limitedStringify<T>(obj: T, maxDepth?: number): string;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=log-page-access.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-page-access.d.ts","sourceRoot":"","sources":["../../../src/modules/logging/log-page-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,MAAM,CAAC;AACzC,OAAO,EAAC,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAGpD,KAAK,mBAAmB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,WAAW,CAAC,EAAE,wBAAwB,CAAC,GAAG,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EACI,QAAQ,EACR,GAAG,EACH,MAAM,EACN,cAAc,EACd,UAAU,EACV,WAAW,GACd,EAAE,mBAAmB,QAqBnD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CA6BxE"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logPageAccess = logPageAccess;
|
|
4
|
-
exports.limitedStringify = limitedStringify;
|
|
5
|
-
const logger_1 = require("./logger");
|
|
6
|
-
/**
|
|
7
|
-
* Fire-and-forget function for access logging.
|
|
8
|
-
*
|
|
9
|
-
* The exported function itself is not async since there is no promise to ever wait for from the outside.
|
|
10
|
-
* But since it does access the propsResult.props which can be a promise it needs to be async internally.
|
|
11
|
-
*/
|
|
12
|
-
function logPageAccess({ duration, url, method, requestHeaders, statusCode, propsResult, }) {
|
|
13
|
-
(async () => {
|
|
14
|
-
const stringifiedProps = propsResult && 'props' in propsResult
|
|
15
|
-
? limitedStringify(await propsResult.props)
|
|
16
|
-
: 'No resolved props';
|
|
17
|
-
const ct = {
|
|
18
|
-
method,
|
|
19
|
-
url,
|
|
20
|
-
duration,
|
|
21
|
-
severity: 'INFO',
|
|
22
|
-
message: 'page access',
|
|
23
|
-
time: new Date().toISOString(),
|
|
24
|
-
requestId: requestHeaders?.['requestId'],
|
|
25
|
-
code: statusCode,
|
|
26
|
-
clientIpAddress: requestHeaders?.['client-ip-address'],
|
|
27
|
-
resolvedProps: stringifiedProps,
|
|
28
|
-
};
|
|
29
|
-
logger_1.logger.info(ct);
|
|
30
|
-
})();
|
|
31
|
-
}
|
|
32
|
-
function limitedStringify(obj, maxDepth = 2) {
|
|
33
|
-
const seen = new WeakSet();
|
|
34
|
-
function _trunc(val, depth) {
|
|
35
|
-
if (val !== null && typeof val === 'object') {
|
|
36
|
-
if (seen.has(val))
|
|
37
|
-
return '[Circular]';
|
|
38
|
-
if (depth > maxDepth)
|
|
39
|
-
return '[TruncatedObject, maxDepth: ' + maxDepth + ' exceeded]';
|
|
40
|
-
seen.add(val);
|
|
41
|
-
if (Array.isArray(val)) {
|
|
42
|
-
return val.map((item) => _trunc(item, depth + 1));
|
|
43
|
-
}
|
|
44
|
-
const out = {};
|
|
45
|
-
for (const k in val) {
|
|
46
|
-
if (Object.prototype.hasOwnProperty.call(val, k)) {
|
|
47
|
-
out[k] = _trunc(val[k], depth + 1);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return out;
|
|
51
|
-
}
|
|
52
|
-
return val;
|
|
53
|
-
}
|
|
54
|
-
try {
|
|
55
|
-
return JSON.stringify(_trunc(obj, 0), null, 2);
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
return `[Unserializable: ${e.message}]`;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/modules/logging/logger.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,MAAM,QAwBjB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.logger = void 0;
|
|
7
|
-
const bunyan_1 = __importDefault(require("bunyan"));
|
|
8
|
-
exports.logger = bunyan_1.default.createLogger({
|
|
9
|
-
name: 'planner-web',
|
|
10
|
-
streams: [{ stream: process.stdout, level: 'info' }],
|
|
11
|
-
serializers: {
|
|
12
|
-
req: (req) => {
|
|
13
|
-
return {
|
|
14
|
-
method: req.method,
|
|
15
|
-
url: req.url,
|
|
16
|
-
headers: {
|
|
17
|
-
...req.headers,
|
|
18
|
-
cookie: null,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
res: bunyan_1.default.stdSerializers.res,
|
|
23
|
-
upstream: (up) => {
|
|
24
|
-
return {
|
|
25
|
-
statusCode: up.status,
|
|
26
|
-
url: up.url,
|
|
27
|
-
statusText: up.statusText,
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
err: bunyan_1.default.stdSerializers.err,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../../src/modules/logging/timer.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;IACd,KAAK,EAAE,IAAI,CAAC;gBAEA,KAAK,CAAC,EAAE,IAAI;IAIxB,YAAY;CAIf"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Timer = void 0;
|
|
4
|
-
class Timer {
|
|
5
|
-
constructor(start) {
|
|
6
|
-
this.start = start ?? new Date();
|
|
7
|
-
}
|
|
8
|
-
getElapsedMs() {
|
|
9
|
-
const now = new Date();
|
|
10
|
-
return now.valueOf() - this.start.valueOf();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.Timer = Timer;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ParsedUrlQuery } from 'querystring';
|
|
2
|
-
import { GetServerSideProps, GetServerSidePropsContext } from 'next';
|
|
3
|
-
import { GetServerSidePropsResult } from 'next/types';
|
|
4
|
-
export declare function withAccessLogging<P extends {} = {}, Params extends ParsedUrlQuery = ParsedUrlQuery>(propGetter?: GetServerSideProps<P, Params>): (ctx: GetServerSidePropsContext<Params>) => Promise<GetServerSidePropsResult<P>>;
|
|
5
|
-
//# sourceMappingURL=with-access-logging.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-access-logging.d.ts","sourceRoot":"","sources":["../../../src/modules/logging/with-access-logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,kBAAkB,EAAE,yBAAyB,EAAC,MAAM,MAAM,CAAC;AACnE,OAAO,EAAC,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAIpD,wBAAgB,iBAAiB,CAC7B,CAAC,SAAS,EAAE,GAAG,EAAE,EACjB,MAAM,SAAS,cAAc,GAAG,cAAc,EAChD,UAAU,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,MAAM,CAAC,IAEpC,KAAK,yBAAyB,CAAC,MAAM,CAAC,KACvC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAc1C"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withAccessLogging = withAccessLogging;
|
|
4
|
-
const timer_1 = require("./timer");
|
|
5
|
-
const log_page_access_1 = require("./log-page-access");
|
|
6
|
-
function withAccessLogging(propGetter) {
|
|
7
|
-
return async function inside(ctx) {
|
|
8
|
-
const timer = new timer_1.Timer();
|
|
9
|
-
const propsResult = await propGetter?.(ctx);
|
|
10
|
-
(0, log_page_access_1.logPageAccess)({
|
|
11
|
-
url: ctx.resolvedUrl,
|
|
12
|
-
method: ctx.req?.method,
|
|
13
|
-
requestHeaders: ctx.req?.headers,
|
|
14
|
-
duration: timer.getElapsedMs(),
|
|
15
|
-
statusCode: ctx.res?.statusCode,
|
|
16
|
-
propsResult,
|
|
17
|
-
});
|
|
18
|
-
return propsResult ?? { props: {} };
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TransportModeGroup } from '../types';
|
|
2
|
-
import type { IconName, TransportColors, ContrastColor } from '@contact/modules/config';
|
|
3
|
-
export type TransportIconsProps = {
|
|
4
|
-
modes: TransportModeGroup[];
|
|
5
|
-
};
|
|
6
|
-
export declare function TransportIcons({ modes }: TransportIconsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export type TransportIconProps = {
|
|
8
|
-
mode: TransportModeGroup;
|
|
9
|
-
size?: 'small' | 'normal' | 'large';
|
|
10
|
-
isFlexible?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare function TransportIcon({ mode, size, isFlexible, }: TransportIconProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function TransportMonoIcon({ mode }: TransportIconProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export type TransportIconWithDurationProps = {
|
|
15
|
-
mode: TransportModeGroup;
|
|
16
|
-
label?: string;
|
|
17
|
-
duration?: number;
|
|
18
|
-
isFlexible?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export declare function TransportIconWithDuration({ mode, label, duration, isFlexible, }: TransportIconWithDurationProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export declare function useTransportationThemeColor(mode: TransportModeGroup, isFlexible?: boolean): {
|
|
22
|
-
backgroundColor: any;
|
|
23
|
-
textColor: any;
|
|
24
|
-
overrideMode: any;
|
|
25
|
-
};
|
|
26
|
-
export declare function transportModeToColor(mode: TransportModeGroup, transport: TransportColors, isFlexible?: boolean): ContrastColor;
|
|
27
|
-
export declare function getTransportModeIcon(mode: TransportModeGroup): IconName;
|
|
28
|
-
//# sourceMappingURL=transport-icon-new.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport-icon-new.d.ts","sourceRoot":"","sources":["../../../../src/modules/transport-mode/icon/transport-icon-new.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAW5D;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,IAAe,EACf,UAAU,GACX,EAAE,kBAAkB,2CAcpB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,kBAAkB,2CAS7D;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE,8BAA8B,2CA8ChC;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,kBAAkB,EACxB,UAAU,CAAC,EAAE,OAAO;;;;EASrB;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,eAAe,EAC1B,UAAU,CAAC,EAAE,OAAO,GACnB,aAAa,CAqCf;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,QAAQ,CAwBvE"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TransportIcons = TransportIcons;
|
|
7
|
-
exports.TransportIcon = TransportIcon;
|
|
8
|
-
exports.TransportMonoIcon = TransportMonoIcon;
|
|
9
|
-
exports.TransportIconWithDuration = TransportIconWithDuration;
|
|
10
|
-
exports.useTransportationThemeColor = useTransportationThemeColor;
|
|
11
|
-
exports.transportModeToColor = transportModeToColor;
|
|
12
|
-
exports.getTransportModeIcon = getTransportModeIcon;
|
|
13
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
14
|
-
const icon_wrapper_1 = require("@contact/components/icon/icon-wrapper");
|
|
15
|
-
const theme_1 = require("@contact/modules/theme");
|
|
16
|
-
const translations_1 = require("@contact/translations");
|
|
17
|
-
const utils_1 = require("../utils");
|
|
18
|
-
const color_1 = require("@contact/utils/color");
|
|
19
|
-
const typography_1 = require("@contact/components/typography");
|
|
20
|
-
const date_1 = require("@contact/utils/date");
|
|
21
|
-
const journeyplanner_types_v3_generated_1 = require("@contact/modules/graphql-types/journeyplanner-types_v3.generated");
|
|
22
|
-
const icon_module_css_1 = __importDefault(require("./icon.module.css"));
|
|
23
|
-
function TransportIcons({ modes }) {
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: icon_module_css_1.default.transportIcons, children: modes.map((mode) => ((0, jsx_runtime_1.jsx)(TransportIcon, { mode: mode }, mode.transportMode ?? '' + mode.transportSubModes))) }));
|
|
25
|
-
}
|
|
26
|
-
function TransportIcon({ mode, size = 'normal', isFlexible, }) {
|
|
27
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
28
|
-
const { backgroundColor } = useTransportationThemeColor(mode, isFlexible);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("span", { className: icon_module_css_1.default.transportIcon, style: { backgroundColor }, children: (0, jsx_runtime_1.jsx)(icon_wrapper_1.Icon, { icon: getTransportModeIcon(mode), size: size, role: "img", alt: t((0, utils_1.transportModeToTranslatedString)(mode)) }) }));
|
|
30
|
-
}
|
|
31
|
-
function TransportMonoIcon({ mode }) {
|
|
32
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(icon_wrapper_1.Icon, { icon: getTransportModeIcon(mode), role: "img", alt: t((0, utils_1.transportModeToTranslatedString)(mode)) }));
|
|
34
|
-
}
|
|
35
|
-
function TransportIconWithDuration({ mode, label, duration, isFlexible, }) {
|
|
36
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
37
|
-
const { theme } = (0, theme_1.useTheme)();
|
|
38
|
-
let colors = useTransportationThemeColor(mode, isFlexible);
|
|
39
|
-
// Walking legs should have a lighter background color in the trip pattern view.
|
|
40
|
-
if (mode.transportMode === 'foot') {
|
|
41
|
-
colors = {
|
|
42
|
-
backgroundColor: theme.color.background.neutral[2].background,
|
|
43
|
-
textColor: theme.color.background.neutral[2].foreground.primary,
|
|
44
|
-
overrideMode: (0, color_1.colorToOverrideMode)(theme.color.background.neutral[2].foreground.primary),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: icon_module_css_1.default.transportIconWithLabel, style: { backgroundColor: colors.backgroundColor }, children: [(0, jsx_runtime_1.jsx)(icon_wrapper_1.Icon, { icon: getTransportModeIcon(mode), role: "img", alt: t((0, utils_1.transportModeToTranslatedString)(mode)), style: { color: colors.textColor } }), label && ((0, jsx_runtime_1.jsx)("span", { style: { color: colors.textColor }, className: icon_module_css_1.default.transportIconWithLabel__label, children: label })), !label && duration && ((0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__xs", style: { color: colors.textColor }, className: icon_module_css_1.default.transportIconWithLabel__duration, children: (0, date_1.secondsToMinutes)(duration) }))] }));
|
|
48
|
-
}
|
|
49
|
-
function useTransportationThemeColor(mode, isFlexible) {
|
|
50
|
-
const { theme } = (0, theme_1.useTheme)();
|
|
51
|
-
let color = transportModeToColor(mode, theme.color.transport, isFlexible);
|
|
52
|
-
return {
|
|
53
|
-
backgroundColor: color.background,
|
|
54
|
-
textColor: color.foreground.primary,
|
|
55
|
-
overrideMode: (0, color_1.colorToOverrideMode)(color.foreground.primary),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function transportModeToColor(mode, transport, isFlexible) {
|
|
59
|
-
if (isFlexible)
|
|
60
|
-
return transport.flexible.primary;
|
|
61
|
-
switch (mode.transportMode) {
|
|
62
|
-
case 'bus':
|
|
63
|
-
case 'coach':
|
|
64
|
-
if (mode.transportSubModes?.includes(journeyplanner_types_v3_generated_1.TransportSubmode.LocalBus)) {
|
|
65
|
-
return transport.city.primary;
|
|
66
|
-
}
|
|
67
|
-
if (mode.transportSubModes?.includes(journeyplanner_types_v3_generated_1.TransportSubmode.AirportLinkBus)) {
|
|
68
|
-
return transport.airportExpress.primary;
|
|
69
|
-
}
|
|
70
|
-
return transport.region.primary;
|
|
71
|
-
case 'rail':
|
|
72
|
-
if (mode.transportSubModes?.includes(journeyplanner_types_v3_generated_1.TransportSubmode.AirportLinkRail)) {
|
|
73
|
-
return transport.airportExpress.primary;
|
|
74
|
-
}
|
|
75
|
-
return transport.train.primary;
|
|
76
|
-
case 'tram':
|
|
77
|
-
return transport.city.primary;
|
|
78
|
-
case 'bicycle':
|
|
79
|
-
return transport.bike.primary;
|
|
80
|
-
case 'water':
|
|
81
|
-
return transport.boat.primary;
|
|
82
|
-
case 'air':
|
|
83
|
-
return transport.other.primary;
|
|
84
|
-
case 'metro':
|
|
85
|
-
return transport.train.primary;
|
|
86
|
-
default:
|
|
87
|
-
return transport.other.primary;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function getTransportModeIcon(mode) {
|
|
91
|
-
switch (mode.transportMode) {
|
|
92
|
-
case 'bus':
|
|
93
|
-
case 'coach':
|
|
94
|
-
return 'transportation/BusFill';
|
|
95
|
-
case 'tram':
|
|
96
|
-
return 'transportation/TramFill';
|
|
97
|
-
case 'rail':
|
|
98
|
-
return 'transportation/TrainFill';
|
|
99
|
-
case 'foot':
|
|
100
|
-
return 'transportation/WalkFill';
|
|
101
|
-
case 'bicycle':
|
|
102
|
-
return 'transportation/BicycleFill';
|
|
103
|
-
case 'air':
|
|
104
|
-
return 'transportation/PlaneFill';
|
|
105
|
-
case 'water':
|
|
106
|
-
return (0, utils_1.isSubModeBoat)(mode.transportSubModes)
|
|
107
|
-
? 'transportation/BoatFill'
|
|
108
|
-
: 'transportation/FerryFill';
|
|
109
|
-
case 'metro':
|
|
110
|
-
return 'transportation/MetroFill';
|
|
111
|
-
default:
|
|
112
|
-
return 'transportation/UnknownFill';
|
|
113
|
-
}
|
|
114
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HttpRequester } from '../../modules/api-server';
|
|
2
|
-
import { ContactApiReturnType } from '../types';
|
|
3
|
-
export type ContactApi = {
|
|
4
|
-
submitTicketControlForm(formData: any): Promise<ContactApiReturnType>;
|
|
5
|
-
submitRefundForm(formData: any): Promise<ContactApiReturnType>;
|
|
6
|
-
submitMeansOfTransportForm(formData: any): Promise<ContactApiReturnType>;
|
|
7
|
-
submitTicketingForm(formData: any): Promise<ContactApiReturnType>;
|
|
8
|
-
submitJourneyInfoForm(formData: any): Promise<ContactApiReturnType>;
|
|
9
|
-
};
|
|
10
|
-
export declare function createContactApi(request: HttpRequester<'http-contact-api'>): ContactApi;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/contact/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG;IACrB,uBAAuB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACtE,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC/D,0BAA0B,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzE,mBAAmB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClE,qBAAqB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACvE,CAAC;AAEF,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAC3C,UAAU,CA+CZ"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createContactApi = createContactApi;
|
|
4
|
-
function createContactApi(request) {
|
|
5
|
-
return {
|
|
6
|
-
async submitTicketControlForm(formData) {
|
|
7
|
-
const response = await request('/ticket-control', {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
body: formData,
|
|
10
|
-
});
|
|
11
|
-
const data = await response.json();
|
|
12
|
-
return data;
|
|
13
|
-
},
|
|
14
|
-
async submitRefundForm(formData) {
|
|
15
|
-
const response = await request('/refund', {
|
|
16
|
-
method: 'POST',
|
|
17
|
-
body: formData,
|
|
18
|
-
});
|
|
19
|
-
const data = await response.json();
|
|
20
|
-
return data;
|
|
21
|
-
},
|
|
22
|
-
async submitMeansOfTransportForm(formData) {
|
|
23
|
-
const response = await request('/means-of-transport', {
|
|
24
|
-
method: 'POST',
|
|
25
|
-
body: formData,
|
|
26
|
-
});
|
|
27
|
-
const data = await response.json();
|
|
28
|
-
return data;
|
|
29
|
-
},
|
|
30
|
-
async submitTicketingForm(formData) {
|
|
31
|
-
const response = await request('/ticketing', {
|
|
32
|
-
method: 'POST',
|
|
33
|
-
body: formData,
|
|
34
|
-
});
|
|
35
|
-
const data = await response.json();
|
|
36
|
-
return data;
|
|
37
|
-
},
|
|
38
|
-
async submitJourneyInfoForm(formData) {
|
|
39
|
-
const response = await request('/journey-info', {
|
|
40
|
-
method: 'POST',
|
|
41
|
-
body: formData,
|
|
42
|
-
});
|
|
43
|
-
const data = await response.json();
|
|
44
|
-
return data;
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../src/translations/__tests__/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
const commons_1 = require("../commons");
|
|
6
|
-
(0, vitest_1.describe)('orgSpecificTranslations', () => {
|
|
7
|
-
(0, vitest_1.test)('should override specific fields when specifying one org', () => {
|
|
8
|
-
const TitlesInternal = {
|
|
9
|
-
title: (0, commons_1.translation)('A', 'A', 'A'),
|
|
10
|
-
};
|
|
11
|
-
const Titles = (0, utils_1.orgSpecificTranslations)(TitlesInternal, {
|
|
12
|
-
nfk: {
|
|
13
|
-
title: (0, commons_1.translation)('B', 'B', 'B'),
|
|
14
|
-
},
|
|
15
|
-
}, 'nfk');
|
|
16
|
-
(0, vitest_1.expect)(Titles.title.no).toEqual('B');
|
|
17
|
-
});
|
|
18
|
-
(0, vitest_1.test)('should override specific fields for multiple orgs', () => {
|
|
19
|
-
const TitlesInternal = {
|
|
20
|
-
title: (0, commons_1.translation)('A', 'A', 'A'),
|
|
21
|
-
};
|
|
22
|
-
const overrides = {
|
|
23
|
-
nfk: {
|
|
24
|
-
title: (0, commons_1.translation)('B', 'B', 'B'),
|
|
25
|
-
},
|
|
26
|
-
fram: {
|
|
27
|
-
title: (0, commons_1.translation)('C', 'C', 'C'),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
const TitlesNfk = (0, utils_1.orgSpecificTranslations)(TitlesInternal, overrides, 'nfk');
|
|
31
|
-
const TitlesFram = (0, utils_1.orgSpecificTranslations)(TitlesInternal, overrides, 'fram');
|
|
32
|
-
(0, vitest_1.expect)(TitlesNfk.title.no).toEqual('B');
|
|
33
|
-
(0, vitest_1.expect)(TitlesFram.title.no).toEqual('C');
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export declare const LayoutInternal: {
|
|
2
|
-
base: {
|
|
3
|
-
footer: {
|
|
4
|
-
sections: {
|
|
5
|
-
general: {
|
|
6
|
-
header: import("../../translations/commons").TranslatedString;
|
|
7
|
-
supportPageLink: import("../../translations/commons").TranslatedString;
|
|
8
|
-
helpPageLink: import("../../translations/commons").TranslatedString;
|
|
9
|
-
ticketPricesPageLink: import("../../translations/commons").TranslatedString;
|
|
10
|
-
};
|
|
11
|
-
contact: {
|
|
12
|
-
header: import("../../translations/commons").TranslatedString;
|
|
13
|
-
contactLink: import("../../translations/commons").TranslatedString;
|
|
14
|
-
};
|
|
15
|
-
settings: {
|
|
16
|
-
header: import("../../translations/commons").TranslatedString;
|
|
17
|
-
forcedThemeHeader: import("../../translations/commons").TranslatedString;
|
|
18
|
-
setLanguage: {
|
|
19
|
-
norsk: import("../../translations/commons").TranslatedString;
|
|
20
|
-
english: import("../../translations/commons").TranslatedString;
|
|
21
|
-
nynorsk: import("../../translations/commons").TranslatedString;
|
|
22
|
-
};
|
|
23
|
-
toggleDarkMode: import("../../translations/commons").TranslatedString;
|
|
24
|
-
toggleLightMode: import("../../translations/commons").TranslatedString;
|
|
25
|
-
cookiesWarning: import("../../translations/commons").TranslatedString;
|
|
26
|
-
languageCookiesWarning: import("../../translations/commons").TranslatedString;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
bottomLinks: {
|
|
30
|
-
privacy: import("../../translations/commons").TranslatedString;
|
|
31
|
-
accessibilityStatement: import("../../translations/commons").TranslatedString;
|
|
32
|
-
termsOfUse: import("../../translations/commons").TranslatedString;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export declare const Layout: {
|
|
38
|
-
base: {
|
|
39
|
-
footer: {
|
|
40
|
-
sections: {
|
|
41
|
-
general: {
|
|
42
|
-
header: import("../../translations/commons").TranslatedString;
|
|
43
|
-
supportPageLink: import("../../translations/commons").TranslatedString;
|
|
44
|
-
helpPageLink: import("../../translations/commons").TranslatedString;
|
|
45
|
-
ticketPricesPageLink: import("../../translations/commons").TranslatedString;
|
|
46
|
-
};
|
|
47
|
-
contact: {
|
|
48
|
-
header: import("../../translations/commons").TranslatedString;
|
|
49
|
-
contactLink: import("../../translations/commons").TranslatedString;
|
|
50
|
-
};
|
|
51
|
-
settings: {
|
|
52
|
-
header: import("../../translations/commons").TranslatedString;
|
|
53
|
-
forcedThemeHeader: import("../../translations/commons").TranslatedString;
|
|
54
|
-
setLanguage: {
|
|
55
|
-
norsk: import("../../translations/commons").TranslatedString;
|
|
56
|
-
english: import("../../translations/commons").TranslatedString;
|
|
57
|
-
nynorsk: import("../../translations/commons").TranslatedString;
|
|
58
|
-
};
|
|
59
|
-
toggleDarkMode: import("../../translations/commons").TranslatedString;
|
|
60
|
-
toggleLightMode: import("../../translations/commons").TranslatedString;
|
|
61
|
-
cookiesWarning: import("../../translations/commons").TranslatedString;
|
|
62
|
-
languageCookiesWarning: import("../../translations/commons").TranslatedString;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
bottomLinks: {
|
|
66
|
-
privacy: import("../../translations/commons").TranslatedString;
|
|
67
|
-
accessibilityStatement: import("../../translations/commons").TranslatedString;
|
|
68
|
-
termsOfUse: import("../../translations/commons").TranslatedString;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/translations/modules/layout.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmF1B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFjB,CAAC"}
|