@mrfylke/contact-form 0.1.23 → 0.1.25

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.
Files changed (255) hide show
  1. package/README.md +1 -11
  2. package/lib/ContactFormRoot.d.ts +2 -2
  3. package/lib/ContactFormRoot.d.ts.map +1 -1
  4. package/lib/ContactFormRoot.js +2 -1
  5. package/lib/components/button/link.d.ts +1 -1
  6. package/lib/components/button/link.d.ts.map +1 -1
  7. package/lib/components/button/utils.d.ts +2 -2
  8. package/lib/components/button/utils.d.ts.map +1 -1
  9. package/lib/components/checkbox/checkbox.d.ts +1 -1
  10. package/lib/components/checkbox/checkbox.d.ts.map +1 -1
  11. package/lib/components/error-message/error-message.d.ts +1 -1
  12. package/lib/components/error-message/error-message.d.ts.map +1 -1
  13. package/lib/components/external-link-page.d.ts +2 -2
  14. package/lib/components/external-link-page.d.ts.map +1 -1
  15. package/lib/components/external-link-page.js +1 -1
  16. package/lib/components/form/date-selector.d.ts +1 -1
  17. package/lib/components/form/date-selector.d.ts.map +1 -1
  18. package/lib/components/form/date-selector.js +2 -2
  19. package/lib/components/form/departure-time-field.d.ts +1 -1
  20. package/lib/components/form/departure-time-field.d.ts.map +1 -1
  21. package/lib/components/form/description-modal.d.ts +1 -1
  22. package/lib/components/form/description-modal.d.ts.map +1 -1
  23. package/lib/components/form/field-wrapper-with-error/index.d.ts +1 -1
  24. package/lib/components/form/field-wrapper-with-error/index.d.ts.map +1 -1
  25. package/lib/components/form/fieldset/index.d.ts +1 -1
  26. package/lib/components/form/fieldset/index.d.ts.map +1 -1
  27. package/lib/components/form/file-input.d.ts +1 -1
  28. package/lib/components/form/file-input.d.ts.map +1 -1
  29. package/lib/components/form/form-component-label/index.d.ts +3 -2
  30. package/lib/components/form/form-component-label/index.d.ts.map +1 -1
  31. package/lib/components/form/form-component-label/index.js +2 -2
  32. package/lib/components/form/input.d.ts +1 -1
  33. package/lib/components/form/input.d.ts.map +1 -1
  34. package/lib/components/form/radio.d.ts +1 -1
  35. package/lib/components/form/radio.d.ts.map +1 -1
  36. package/lib/components/form/searchable-select/searchable-select.d.ts +1 -1
  37. package/lib/components/form/searchable-select/searchable-select.d.ts.map +1 -1
  38. package/lib/components/form/searchable-select/searchable-select.js +1 -1
  39. package/lib/components/form/select.d.ts +1 -1
  40. package/lib/components/form/select.d.ts.map +1 -1
  41. package/lib/components/form/select.js +1 -1
  42. package/lib/components/form/textarea.d.ts +1 -1
  43. package/lib/components/form/textarea.d.ts.map +1 -1
  44. package/lib/components/form/time-selector.d.ts +1 -1
  45. package/lib/components/form/time-selector.d.ts.map +1 -1
  46. package/lib/components/form/time-selector.js +2 -2
  47. package/lib/components/icon/checkbox-icon.d.ts +1 -1
  48. package/lib/components/icon/checkbox-icon.d.ts.map +1 -1
  49. package/lib/components/icon/color-icon.d.ts +1 -1
  50. package/lib/components/icon/color-icon.d.ts.map +1 -1
  51. package/lib/components/icon/generated-icons.d.ts +422 -262
  52. package/lib/components/icon/generated-icons.d.ts.map +1 -1
  53. package/lib/components/icon/generated-icons.js +1931 -1771
  54. package/lib/components/icon/illustration.d.ts +1 -1
  55. package/lib/components/icon/illustration.d.ts.map +1 -1
  56. package/lib/components/icon/image.d.ts +1 -1
  57. package/lib/components/icon/image.d.ts.map +1 -1
  58. package/lib/components/icon/mono-icon.d.ts +1 -1
  59. package/lib/components/icon/mono-icon.d.ts.map +1 -1
  60. package/lib/components/icon/utils.d.ts.map +1 -1
  61. package/lib/components/icon/utils.js +6 -6
  62. package/lib/components/loading/index.d.ts +2 -2
  63. package/lib/components/loading/index.d.ts.map +1 -1
  64. package/lib/components/section-card/section-card.d.ts +1 -1
  65. package/lib/components/section-card/section-card.d.ts.map +1 -1
  66. package/lib/components/typography/index.d.ts +6 -6
  67. package/lib/components/typography/index.d.ts.map +1 -1
  68. package/lib/error-content/error-content.d.ts +1 -1
  69. package/lib/error-content/error-content.d.ts.map +1 -1
  70. package/lib/group-travel/index.d.ts +1 -1
  71. package/lib/group-travel/index.d.ts.map +1 -1
  72. package/lib/index.d.ts +5 -6
  73. package/lib/index.d.ts.map +1 -1
  74. package/lib/index.js +6 -12
  75. package/lib/journey-info/events.d.ts.map +1 -1
  76. package/lib/journey-info/index.d.ts +1 -1
  77. package/lib/journey-info/index.d.ts.map +1 -1
  78. package/lib/journey-info/index.js +1 -1
  79. package/lib/layouts/contact-form-container.d.ts +1 -1
  80. package/lib/layouts/contact-form-container.d.ts.map +1 -1
  81. package/lib/layouts/contact-page-layout.d.ts +1 -23
  82. package/lib/layouts/contact-page-layout.d.ts.map +1 -1
  83. package/lib/layouts/contact-page-layout.js +39 -90
  84. package/lib/layouts/contact-pages.d.ts +20 -0
  85. package/lib/layouts/contact-pages.d.ts.map +1 -0
  86. package/lib/layouts/contact-pages.js +124 -0
  87. package/lib/layouts/index.d.ts +2 -1
  88. package/lib/layouts/index.d.ts.map +1 -1
  89. package/lib/layouts/index.js +5 -2
  90. package/lib/lines/use-departures.js +2 -2
  91. package/lib/lines/use-lines.d.ts +2 -2
  92. package/lib/lines/use-lines.js +1 -1
  93. package/lib/lost-property/LostPropertyForm.d.ts +2 -1
  94. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -1
  95. package/lib/lost-property/index.d.ts +1 -1
  96. package/lib/lost-property/index.d.ts.map +1 -1
  97. package/lib/lost-property-external/index.d.ts +2 -0
  98. package/lib/lost-property-external/index.d.ts.map +1 -0
  99. package/lib/lost-property-external/index.js +17 -0
  100. package/lib/means-of-transport/events.d.ts.map +1 -1
  101. package/lib/means-of-transport/forms/delayForm.d.ts +1 -1
  102. package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
  103. package/lib/means-of-transport/forms/driverForm.d.ts +1 -1
  104. package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
  105. package/lib/means-of-transport/forms/injuryForm.d.ts +1 -1
  106. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  107. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts +1 -1
  108. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  109. package/lib/means-of-transport/forms/stopForm.d.ts +1 -1
  110. package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
  111. package/lib/means-of-transport/forms/transportationForm.d.ts +1 -1
  112. package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
  113. package/lib/means-of-transport/index.d.ts +1 -1
  114. package/lib/means-of-transport/index.d.ts.map +1 -1
  115. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +22 -22
  116. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  117. package/lib/modules/config/context.d.ts +5 -37
  118. package/lib/modules/config/context.d.ts.map +1 -1
  119. package/lib/modules/config/context.js +9 -51
  120. package/lib/modules/config/types.d.ts +79 -64
  121. package/lib/modules/config/types.d.ts.map +1 -1
  122. package/lib/modules/config/types.js +9 -0
  123. package/lib/modules/org-data/index.d.ts +2 -2
  124. package/lib/modules/org-data/index.js +2 -2
  125. package/lib/modules/theme/theme-context.d.ts +1 -1
  126. package/lib/modules/theme/theme-context.d.ts.map +1 -1
  127. package/lib/modules/transport-mode/filter/filter.d.ts +1 -1
  128. package/lib/modules/transport-mode/filter/filter.d.ts.map +1 -1
  129. package/lib/modules/transport-mode/icon/index.d.ts +4 -4
  130. package/lib/modules/transport-mode/icon/index.d.ts.map +1 -1
  131. package/lib/modules/transport-mode/types.d.ts +3 -5
  132. package/lib/modules/transport-mode/types.d.ts.map +1 -1
  133. package/lib/modules/transport-mode/types.js +3 -138
  134. package/lib/modules/transport-mode/utils.d.ts +2 -2
  135. package/lib/modules/transport-mode/utils.d.ts.map +1 -1
  136. package/lib/modules/transport-mode/utils.js +39 -6
  137. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts +1 -1
  138. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  139. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts +1 -1
  140. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  141. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts +1 -1
  142. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  143. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts +2 -2
  144. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  145. package/lib/refund/forms/refund-ticket/index.d.ts +1 -1
  146. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  147. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts +1 -1
  148. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  149. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +1 -5
  150. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts +1 -1
  151. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
  152. package/lib/refund/index.d.ts +1 -1
  153. package/lib/refund/index.d.ts.map +1 -1
  154. package/lib/refund/refundFormMachine.d.ts +14 -14
  155. package/lib/refund/refundFormMachine.js +1 -1
  156. package/lib/server/departures-route-handler.d.ts +27 -0
  157. package/lib/server/departures-route-handler.d.ts.map +1 -0
  158. package/lib/server/departures-route-handler.js +93 -0
  159. package/lib/server/index.d.ts +1 -0
  160. package/lib/server/index.d.ts.map +1 -1
  161. package/lib/server/index.js +3 -1
  162. package/lib/server/journey-planner/authority.d.ts +2 -2
  163. package/lib/server/journey-planner/authority.js +3 -3
  164. package/lib/server/journey-planner/index.d.ts.map +1 -1
  165. package/lib/server/journey-planner/index.js +8 -9
  166. package/lib/server/journey-planner/journey-gql/lines.generated.d.ts +1 -0
  167. package/lib/server/journey-planner/journey-gql/lines.generated.d.ts.map +1 -1
  168. package/lib/server/journey-planner/journey-gql/lines.generated.js +1 -0
  169. package/lib/server/journey-planner/validators.d.ts +4 -4
  170. package/lib/server/journey-planner/validators.js +3 -3
  171. package/lib/server/lines-route-handler.d.ts +7 -18
  172. package/lib/server/lines-route-handler.d.ts.map +1 -1
  173. package/lib/server/lines-route-handler.js +15 -17
  174. package/lib/success-content/success-content.d.ts +1 -1
  175. package/lib/success-content/success-content.d.ts.map +1 -1
  176. package/lib/ticket-control/events.d.ts +1 -1
  177. package/lib/ticket-control/events.d.ts.map +1 -1
  178. package/lib/ticket-control/forms/feeComplaintForm.d.ts +1 -1
  179. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  180. package/lib/ticket-control/forms/feeComplaintForm.js +5 -1
  181. package/lib/ticket-control/forms/feedbackForm.d.ts +1 -1
  182. package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
  183. package/lib/ticket-control/forms/postponePayment.d.ts +1 -1
  184. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  185. package/lib/ticket-control/forms/postponePayment.js +5 -1
  186. package/lib/ticket-control/index.d.ts +1 -1
  187. package/lib/ticket-control/index.d.ts.map +1 -1
  188. package/lib/ticket-control/ticket-control-form-machine.d.ts +24 -22
  189. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  190. package/lib/ticket-control/ticket-control-form-machine.js +4 -2
  191. package/lib/ticketing/events.d.ts.map +1 -1
  192. package/lib/ticketing/forms/app/appAccountForm.d.ts +1 -1
  193. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  194. package/lib/ticketing/forms/app/appTicketingForm.d.ts +1 -1
  195. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  196. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts +1 -1
  197. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  198. package/lib/ticketing/forms/app/index.d.ts +1 -1
  199. package/lib/ticketing/forms/app/index.d.ts.map +1 -1
  200. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts +1 -1
  201. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  202. package/lib/ticketing/forms/travel-card/index.d.ts +1 -1
  203. package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
  204. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts +1 -1
  205. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
  206. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts +1 -1
  207. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  208. package/lib/ticketing/forms/webshop/index.d.ts +1 -1
  209. package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
  210. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts +1 -1
  211. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  212. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts +1 -1
  213. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  214. package/lib/ticketing/index.d.ts +1 -1
  215. package/lib/ticketing/index.d.ts.map +1 -1
  216. package/lib/ticketing/ticketingStateMachine.d.ts +8 -8
  217. package/lib/translations/common/layout.d.ts.map +1 -1
  218. package/lib/translations/common/layout.js +1 -29
  219. package/lib/translations/common/titles.d.ts.map +1 -1
  220. package/lib/translations/common/titles.js +2 -20
  221. package/lib/translations/json-to-override.d.ts.map +1 -1
  222. package/lib/translations/language-context.d.ts +3 -3
  223. package/lib/translations/language-context.d.ts.map +1 -1
  224. package/lib/translations/merge-overrides.d.ts +3 -3
  225. package/lib/translations/merge-overrides.js +3 -3
  226. package/lib/translations/pages/contact.d.ts +6 -16
  227. package/lib/translations/pages/contact.d.ts.map +1 -1
  228. package/lib/translations/pages/contact.js +7 -31
  229. package/lib/translations/server/endpoints.d.ts.map +1 -1
  230. package/lib/translations/server/endpoints.js +7 -83
  231. package/lib/translations/translations-context.d.ts +1 -1
  232. package/lib/translations/translations-context.d.ts.map +1 -1
  233. package/lib/translations/types.d.ts +7 -7
  234. package/lib/translations/types.d.ts.map +1 -1
  235. package/lib/translations/utils.d.ts +0 -7
  236. package/lib/translations/utils.d.ts.map +1 -1
  237. package/lib/translations/utils.js +0 -26
  238. package/lib/types/submit-payloads.d.ts +1 -0
  239. package/lib/types/submit-payloads.d.ts.map +1 -1
  240. package/lib/types.d.ts.map +1 -1
  241. package/lib/utils/typing.d.ts +32 -0
  242. package/lib/utils/typing.d.ts.map +1 -0
  243. package/lib/utils/typing.js +6 -0
  244. package/lib/utils.d.ts +0 -1
  245. package/lib/utils.d.ts.map +1 -1
  246. package/lib/utils.js +1 -5
  247. package/lib/validation/validationRules.d.ts.map +1 -1
  248. package/lib/validation/validationRules.js +7 -0
  249. package/package.json +42 -32
  250. package/lib/components/icon/icon-wrapper.d.ts +0 -30
  251. package/lib/components/icon/icon-wrapper.d.ts.map +0 -1
  252. package/lib/components/icon/icon-wrapper.js +0 -39
  253. package/lib/components/icon/mono-icon-new.d.ts +0 -32
  254. package/lib/components/icon/mono-icon-new.d.ts.map +0 -1
  255. package/lib/components/icon/mono-icon-new.js +0 -43
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAG3C,kCAAkC,4CAkHpC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAG3C,kCAAkC,gCAkHpC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
@@ -6,6 +6,6 @@ type RefundCarFormProps = {
6
6
  };
7
7
  send: (event: typeof RefundFormEvents) => void;
8
8
  };
9
- export declare const RefundCarForm: ({ state, send }: RefundCarFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const RefundCarForm: ({ state, send }: RefundCarFormProps) => import("react").JSX.Element;
10
10
  export default RefundCarForm;
11
11
  //# sourceMappingURL=refundCarForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"refundCarForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundCarForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgB7D,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,iBAAiB,kBAAkB,4CA8chE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"refundCarForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundCarForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgB7D,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,iBAAiB,kBAAkB,gCA8chE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -6,6 +6,6 @@ type RefundTaxiFormProps = {
6
6
  };
7
7
  send: (event: typeof RefundFormEvents) => void;
8
8
  };
9
- export declare const RefundTaxiForm: ({ state, send }: RefundTaxiFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const RefundTaxiForm: ({ state, send }: RefundTaxiFormProps) => import("react").JSX.Element;
10
10
  export default RefundTaxiForm;
11
11
  //# sourceMappingURL=refundTaxiForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgB7D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,4CAqblE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgB7D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,gCAqblE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -6,7 +6,7 @@ type AppTicketRefundProps = {
6
6
  };
7
7
  send: (event: typeof RefundFormEvents) => void;
8
8
  };
9
- export declare const AppTicketRefund: ({ state, send }: AppTicketRefundProps) => import("react/jsx-runtime").JSX.Element;
10
- export default function AppTicketRefundContent({ state, send, }: AppTicketRefundProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare const AppTicketRefund: ({ state, send }: AppTicketRefundProps) => import("react").JSX.Element;
10
+ export default function AppTicketRefundContent({ state, send, }: AppTicketRefundProps): import("react").JSX.Element;
11
11
  export {};
12
12
  //# sourceMappingURL=appTicketRefund.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAkBhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,4CAyDpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,2CAWtB"}
1
+ {"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAkBhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,gCAyDpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,+BAWtB"}
@@ -5,6 +5,6 @@ type RefundTicketFormsProps = {
5
5
  state: StateFrom<typeof refundStateMachine>;
6
6
  send: (event: typeof RefundFormEvents) => void;
7
7
  };
8
- export declare const RefundTicketForms: ({ state, send }: RefundTicketFormsProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const RefundTicketForms: ({ state, send }: RefundTicketFormsProps) => import("react").JSX.Element;
9
9
  export default RefundTicketForms;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAUnC,OAAO,EAAE,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAmIxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAUnC,OAAO,EAAE,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,gCAmIxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -6,6 +6,6 @@ type OtherTicketRefundProps = {
6
6
  };
7
7
  send: (event: typeof RefundFormEvents) => void;
8
8
  };
9
- export declare const OtherTicketRefund: ({ state, send }: OtherTicketRefundProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const OtherTicketRefund: ({ state, send }: OtherTicketRefundProps) => import("react").JSX.Element;
10
10
  export default OtherTicketRefund;
11
11
  //# sourceMappingURL=otherTicketRefund.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAmcF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAWxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAmbF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,gCAWxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -24,11 +24,7 @@ const RefundSection = ({ state, send }) => {
24
24
  });
25
25
  }, placeholder: t(PageText.Contact.input.ticketType.optionLabelRefund), options: ticketTypeOptions, isRequired: true, error: state.context?.errorMessages['ticketType']?.[0]
26
26
  ? t(state.context?.errorMessages['ticketType'][0])
27
- : undefined })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
28
- type: 'ON_INPUT_CHANGE',
29
- inputName: 'orderId',
30
- value: e.target.value,
31
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
27
+ : undefined })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
32
28
  type: 'ON_INPUT_CHANGE',
33
29
  inputName: 'travelCardNumber',
34
30
  value: e.target.value,
@@ -1,2 +1,2 @@
1
- export declare const ResidualValueOnTravelCard: ({}: {}) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const ResidualValueOnTravelCard: ({}: {}) => import("react").JSX.Element;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,GAAI,MAAE,4CAyC3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,GAAI,MAAE,gCAyC3C,CAAC"}
@@ -1,3 +1,3 @@
1
- declare const RefundContent: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const RefundContent: () => import("react").JSX.Element;
2
2
  export default RefundContent;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,+CA+HlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,mCA+HlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -146,12 +146,6 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
146
146
  } | {
147
147
  type: "navigateToSuccessPage";
148
148
  params: unknown;
149
- } | {
150
- type: "setFormTypeToUndefined";
151
- params: unknown;
152
- } | {
153
- type: "setInitialAgreementAndFormType";
154
- params: unknown;
155
149
  } | {
156
150
  type: "clearValidationErrors";
157
151
  params: unknown;
@@ -173,6 +167,12 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
173
167
  } | {
174
168
  type: "onLineChange";
175
169
  params: unknown;
170
+ } | {
171
+ type: "setFormTypeToUndefined";
172
+ params: unknown;
173
+ } | {
174
+ type: "setInitialAgreementAndFormType";
175
+ params: unknown;
176
176
  } | {
177
177
  type: "onPurchasePlatformChange";
178
178
  params: unknown;
@@ -203,7 +203,7 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
203
203
  } | {
204
204
  type: "isRefundTaxi";
205
205
  params: unknown;
206
- }, never, "success" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | "validating" | "submitting" | {
206
+ }, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
207
207
  editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
208
208
  refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
209
209
  } | {
@@ -306,12 +306,6 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
306
306
  } | {
307
307
  type: "navigateToSuccessPage";
308
308
  params: unknown;
309
- } | {
310
- type: "setFormTypeToUndefined";
311
- params: unknown;
312
- } | {
313
- type: "setInitialAgreementAndFormType";
314
- params: unknown;
315
309
  } | {
316
310
  type: "clearValidationErrors";
317
311
  params: unknown;
@@ -333,6 +327,12 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
333
327
  } | {
334
328
  type: "onLineChange";
335
329
  params: unknown;
330
+ } | {
331
+ type: "setFormTypeToUndefined";
332
+ params: unknown;
333
+ } | {
334
+ type: "setInitialAgreementAndFormType";
335
+ params: unknown;
336
336
  } | {
337
337
  type: "onPurchasePlatformChange";
338
338
  params: unknown;
@@ -363,7 +363,7 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
363
363
  } | {
364
364
  type: "isRefundTaxi";
365
365
  params: unknown;
366
- }, never, "success" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | "validating" | "submitting" | {
366
+ }, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
367
367
  editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
368
368
  refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
369
369
  } | {
@@ -105,7 +105,7 @@ const setInputToValidate = (context) => {
105
105
  city,
106
106
  email,
107
107
  phoneNumber,
108
- orderId,
108
+ travelCardNumber: context.travelCardNumber,
109
109
  ...(hasInternationalBankAccount
110
110
  ? { IBAN, SWIFT }
111
111
  : { bankAccountNumber }),
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Next.js App Router API route handler for the departures endpoint.
3
+ * Hosts mount this at their chosen path (e.g. /api/contact/departures) and
4
+ * supply the GTFS agency ID and (optionally) the GCP project ID for BigQuery.
5
+ */
6
+ import type { NextRequest } from 'next/server';
7
+ export type DeparturesRouteHandlerOptions = {
8
+ /** GTFS agency ID (the host's Entur authority ID) to scope the query to. */
9
+ agencyId: string;
10
+ /** GCP project ID for BigQuery. */
11
+ projectId: string;
12
+ };
13
+ /**
14
+ * Creates a Next.js App Router API route handler for
15
+ * GET /api/contact/departures.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { createDeparturesRouteHandler } from '@mrfylke/contact-form/server';
20
+ * export const GET = createDeparturesRouteHandler({
21
+ * agencyId: 'INN:Authority:INN_ID',
22
+ * projectId: process.env.GOOGLE_CLOUD_PROJECT!,
23
+ * });
24
+ * ```
25
+ */
26
+ export declare function createDeparturesRouteHandler(options: DeparturesRouteHandlerOptions): (request: NextRequest) => Promise<Response>;
27
+ //# sourceMappingURL=departures-route-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"departures-route-handler.d.ts","sourceRoot":"","sources":["../../src/server/departures-route-handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA0B/C,MAAM,MAAM,6BAA6B,GAAG;IAC1C,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;GAYG;AAOH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,GACrC,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CA6D7C"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ /**
3
+ * Next.js App Router API route handler for the departures endpoint.
4
+ * Hosts mount this at their chosen path (e.g. /api/contact/departures) and
5
+ * supply the GTFS agency ID and (optionally) the GCP project ID for BigQuery.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createDeparturesRouteHandler = createDeparturesRouteHandler;
9
+ const bigquery_1 = require("@google-cloud/bigquery");
10
+ const DEPARTURES_QUERY = `
11
+ SELECT DISTINCT
12
+ FORMAT_TIMESTAMP('%H:%M:%S', f.departure_time, 'Europe/Oslo') AS departure_time,
13
+ f.trip_id
14
+ FROM \`ent-data-sharing-ext-prd.timetable_gtfs.gtfs_last_recorded_ent_v1\` AS f
15
+ JOIN \`ent-data-sharing-ext-prd.timetable_gtfs.gtfs_last_recorded_ent_v1\` AS t
16
+ ON f.trip_id = t.trip_id
17
+ AND f.operating_date = t.operating_date
18
+ AND f.stop_sequence < t.stop_sequence
19
+ WHERE f.operating_date = CAST(@date AS DATE)
20
+ AND f.agency_id = @agencyId
21
+ AND f.route_id = @lineId
22
+ AND f.stop_id = @fromStopId
23
+ AND t.parent_station = (
24
+ SELECT parent_station
25
+ FROM \`ent-data-sharing-ext-prd.timetable_gtfs.gtfs_last_recorded_ent_v1\`
26
+ WHERE operating_date = CAST(@date AS DATE)
27
+ AND stop_id = @toStopId
28
+ LIMIT 1
29
+ )
30
+ ORDER BY departure_time ASC
31
+ LIMIT 1000
32
+ `;
33
+ /**
34
+ * Creates a Next.js App Router API route handler for
35
+ * GET /api/contact/departures.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { createDeparturesRouteHandler } from '@mrfylke/contact-form/server';
40
+ * export const GET = createDeparturesRouteHandler({
41
+ * agencyId: 'INN:Authority:INN_ID',
42
+ * projectId: process.env.GOOGLE_CLOUD_PROJECT!,
43
+ * });
44
+ * ```
45
+ */
46
+ // Deliberately returns a plain Response, built with Response.json(), rather
47
+ // than NextResponse from 'next/server': Turbopack strips a runtime
48
+ // `require("next/server")` from this package's compiled CJS output when
49
+ // consumed as a symlinked monorepo package
50
+ // (https://github.com/vercel/next.js/issues/74062), leaving NextResponse
51
+ // undefined at request time.
52
+ function createDeparturesRouteHandler(options) {
53
+ return async (request) => {
54
+ const date = request.nextUrl.searchParams.get('date');
55
+ const lineId = request.nextUrl.searchParams.get('lineId');
56
+ const fromStopId = request.nextUrl.searchParams.get('fromStopId');
57
+ const toStopId = request.nextUrl.searchParams.get('toStopId');
58
+ if (!date || !lineId || !fromStopId || !toStopId) {
59
+ return Response.json({
60
+ message: 'Missing required params: date, lineId, fromStopId, toStopId',
61
+ }, { status: 400 });
62
+ }
63
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) {
64
+ return Response.json({ message: 'Invalid date format, expected YYYY-MM-DD' }, { status: 400 });
65
+ }
66
+ if (!options.projectId) {
67
+ console.error('[contact-form] GOOGLE_CLOUD_PROJECT is not set');
68
+ return Response.json({ message: 'Failed to fetch departures' }, { status: 500 });
69
+ }
70
+ try {
71
+ const bigquery = new bigquery_1.BigQuery({ projectId: options.projectId });
72
+ const [rows] = await bigquery.query({
73
+ query: DEPARTURES_QUERY,
74
+ params: {
75
+ date,
76
+ agencyId: options.agencyId,
77
+ lineId,
78
+ fromStopId,
79
+ toStopId,
80
+ },
81
+ });
82
+ const departures = rows.map((row) => ({
83
+ departureTime: row.departure_time,
84
+ tripId: row.trip_id,
85
+ }));
86
+ return Response.json({ departures });
87
+ }
88
+ catch (error) {
89
+ console.error('[contact-form] BigQuery departures error:', error);
90
+ return Response.json({ message: 'Failed to fetch departures' }, { status: 500 });
91
+ }
92
+ };
93
+ }
@@ -7,4 +7,5 @@
7
7
  export { getLines } from './journey-planner';
8
8
  export { getEnturAuthorityId, EnturAuthority, } from './journey-planner/authority';
9
9
  export { createLinesRouteHandler, type LinesRouteHandlerOptions, } from './lines-route-handler';
10
+ export { createDeparturesRouteHandler, type DeparturesRouteHandlerOptions, } from './departures-route-handler';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * API route handlers or server components.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createLinesRouteHandler = exports.EnturAuthority = exports.getEnturAuthorityId = exports.getLines = void 0;
9
+ exports.createDeparturesRouteHandler = exports.createLinesRouteHandler = exports.EnturAuthority = exports.getEnturAuthorityId = exports.getLines = void 0;
10
10
  var journey_planner_1 = require("./journey-planner");
11
11
  Object.defineProperty(exports, "getLines", { enumerable: true, get: function () { return journey_planner_1.getLines; } });
12
12
  var authority_1 = require("./journey-planner/authority");
@@ -14,3 +14,5 @@ Object.defineProperty(exports, "getEnturAuthorityId", { enumerable: true, get: f
14
14
  Object.defineProperty(exports, "EnturAuthority", { enumerable: true, get: function () { return authority_1.EnturAuthority; } });
15
15
  var lines_route_handler_1 = require("./lines-route-handler");
16
16
  Object.defineProperty(exports, "createLinesRouteHandler", { enumerable: true, get: function () { return lines_route_handler_1.createLinesRouteHandler; } });
17
+ var departures_route_handler_1 = require("./departures-route-handler");
18
+ Object.defineProperty(exports, "createDeparturesRouteHandler", { enumerable: true, get: function () { return departures_route_handler_1.createDeparturesRouteHandler; } });
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The package reads the Entur authority ID from:
5
5
  * 1. Environment variable: ENTUR_AUTHORITY_ID (or NEXT_PUBLIC_ENTUR_AUTHORITY_ID)
6
- * 2. Fallback to org.authorityId from ContactFormConfig (if available)
6
+ * 2. An optional fallback passed in by the caller
7
7
  *
8
8
  * Host apps should set ENTUR_AUTHORITY_ID in their .env file.
9
9
  */
@@ -18,7 +18,7 @@ export declare enum EnturAuthority {
18
18
  /**
19
19
  * Get the Entur authority ID from environment variable or fallback.
20
20
  *
21
- * @param fallbackAuthorityId - Optional fallback from org config
21
+ * @param fallbackAuthorityId - Optional fallback provided by the caller
22
22
  * @returns The authority ID string
23
23
  * @throws Error if neither env var nor fallback is provided
24
24
  */
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * The package reads the Entur authority ID from:
6
6
  * 1. Environment variable: ENTUR_AUTHORITY_ID (or NEXT_PUBLIC_ENTUR_AUTHORITY_ID)
7
- * 2. Fallback to org.authorityId from ContactFormConfig (if available)
7
+ * 2. An optional fallback passed in by the caller
8
8
  *
9
9
  * Host apps should set ENTUR_AUTHORITY_ID in their .env file.
10
10
  */
@@ -24,7 +24,7 @@ let cachedAuthorityId = null;
24
24
  /**
25
25
  * Get the Entur authority ID from environment variable or fallback.
26
26
  *
27
- * @param fallbackAuthorityId - Optional fallback from org config
27
+ * @param fallbackAuthorityId - Optional fallback provided by the caller
28
28
  * @returns The authority ID string
29
29
  * @throws Error if neither env var nor fallback is provided
30
30
  */
@@ -44,5 +44,5 @@ function getEnturAuthorityId(fallbackAuthorityId) {
44
44
  }
45
45
  throw new Error('ENTUR_AUTHORITY_ID environment variable must be set. ' +
46
46
  'Set it in your .env file (e.g., ENTUR_AUTHORITY_ID=ATB:Authority:2) ' +
47
- 'or provide org.authorityId in ContactFormConfig.');
47
+ 'or provide a fallback authority ID.');
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAe,MAAM,cAAc,CAAC;AAgBjD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CA+D5E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAe,MAAM,cAAc,CAAC;AAgBjD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CA8D5E"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLines = getLines;
4
4
  const lines_generated_1 = require("./journey-gql/lines.generated");
5
5
  const validators_1 = require("./validators");
6
- const transport_mode_1 = require("../../modules/transport-mode");
6
+ const utils_1 = require("../../modules/transport-mode/utils");
7
7
  const entur_client_1 = require("./entur-client");
8
8
  const authority_1 = require("./authority");
9
9
  /**
@@ -26,21 +26,20 @@ async function getLines(fallbackAuthorityId) {
26
26
  if (result.error || result.errors) {
27
27
  throw result.error || result.errors;
28
28
  }
29
- const data = result.data.lines.map((line) => ({
29
+ const data = (result.data.lines ?? []).map((line) => ({
30
30
  id: line.id,
31
31
  name: line.name ?? '',
32
32
  publicCode: line.publicCode ?? null,
33
- transportMode: (0, transport_mode_1.isTransportModeType)(line.transportMode)
33
+ transportMode: (0, utils_1.isTransportModeType)(line.transportMode)
34
34
  ? line.transportMode
35
35
  : null,
36
- transportSubmode: (0, transport_mode_1.isTransportSubmodeType)(line.transportSubmode)
36
+ transportSubmode: (0, utils_1.isTransportSubmodeType)(line.transportSubmode)
37
37
  ? line.transportSubmode
38
38
  : null,
39
- quays: line.quays
40
- .map((quay) => ({ id: quay.id, name: quay.name }))
41
- .sort((a, b) => a.name.localeCompare(b.name, undefined, {
42
- numeric: true,
43
- sensitivity: 'base',
39
+ quays: line.quays.map((quay) => ({
40
+ id: quay.id,
41
+ name: quay.name,
42
+ description: quay.description ?? null,
44
43
  })),
45
44
  }));
46
45
  const validated = validators_1.linesSchema.safeParse(data);
@@ -13,6 +13,7 @@ export type LinesQuery = {
13
13
  quays: Array<{
14
14
  id: string;
15
15
  name: string;
16
+ description?: string;
16
17
  }>;
17
18
  }>;
18
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lines.generated.d.ts","sourceRoot":"","sources":["../../../../src/server/journey-planner/journey-gql/lines.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kEAAkE,CAAC;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,KAAK,CAAC;IAC5C,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,gBAAgB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC;QAC1C,KAAK,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC5C,CAAC,CAAC;CACJ,CAAC;AAEF,eAAO,MAAM,aAAa,cAczB,CAAC;AACF,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EACxD,GAAG,EAAE,YAAY,EACjB,IAAI,CAAC,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,CAAC,KACR,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAEnC,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;qBAE5B,mBAAmB,YAAY,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;EAQ1E;AAED,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"lines.generated.d.ts","sourceRoot":"","sources":["../../../../src/server/journey-planner/journey-gql/lines.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kEAAkE,CAAC;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,KAAK,CAAC;IAC5C,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,gBAAgB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC;QAC1C,KAAK,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAClE,CAAC,CAAC;CACJ,CAAC;AAEF,eAAO,MAAM,aAAa,cAezB,CAAC;AACF,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EACxD,GAAG,EAAE,YAAY,EACjB,IAAI,CAAC,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,CAAC,KACR,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAEnC,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;qBAE5B,mBAAmB,YAAY,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;EAQ1E;AAED,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -17,6 +17,7 @@ exports.LinesDocument = (0, graphql_tag_1.default) `
17
17
  quays {
18
18
  id
19
19
  name
20
+ description
20
21
  }
21
22
  }
22
23
  }
@@ -3,8 +3,8 @@ export declare const lineSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  name: z.ZodString;
5
5
  publicCode: z.ZodNullable<z.ZodString>;
6
- transportMode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"air">, z.ZodLiteral<"bus">, z.ZodLiteral<"foot">, z.ZodLiteral<"bicycle">, z.ZodLiteral<"cableway">, z.ZodLiteral<"car">, z.ZodLiteral<"carpool">, z.ZodLiteral<"coach">, z.ZodLiteral<"funicular">, z.ZodLiteral<"lift">, z.ZodLiteral<"metro">, z.ZodLiteral<"monorail">, z.ZodLiteral<"rail">, z.ZodLiteral<"scooter">, z.ZodLiteral<"taxi">, z.ZodLiteral<"tram">, z.ZodLiteral<"trolleybus">, z.ZodLiteral<"unknown">, z.ZodLiteral<"water">, z.ZodLiteral<"snowAndIce">]>>;
7
- transportSubmode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"SchengenAreaFlight">, z.ZodLiteral<"airportBoatLink">, z.ZodLiteral<"airportLinkBus">, z.ZodLiteral<"airportLinkRail">, z.ZodLiteral<"airshipService">, z.ZodLiteral<"allFunicularServices">, z.ZodLiteral<"allHireVehicles">, z.ZodLiteral<"allTaxiServices">, z.ZodLiteral<"bikeTaxi">, z.ZodLiteral<"blackCab">, z.ZodLiteral<"cableCar">, z.ZodLiteral<"cableFerry">, z.ZodLiteral<"canalBarge">, z.ZodLiteral<"carTransportRailService">, z.ZodLiteral<"chairLift">, z.ZodLiteral<"charterTaxi">, z.ZodLiteral<"cityTram">, z.ZodLiteral<"communalTaxi">, z.ZodLiteral<"commuterCoach">, z.ZodLiteral<"crossCountryRail">, z.ZodLiteral<"dedicatedLaneBus">, z.ZodLiteral<"demandAndResponseBus">, z.ZodLiteral<"domesticCharterFlight">, z.ZodLiteral<"domesticFlight">, z.ZodLiteral<"domesticScheduledFlight">, z.ZodLiteral<"dragLift">, z.ZodLiteral<"escooter">, z.ZodLiteral<"expressBus">, z.ZodLiteral<"funicular">, z.ZodLiteral<"helicopterService">, z.ZodLiteral<"highFrequencyBus">, z.ZodLiteral<"highSpeedPassengerService">, z.ZodLiteral<"highSpeedRail">, z.ZodLiteral<"highSpeedVehicleService">, z.ZodLiteral<"hireCar">, z.ZodLiteral<"hireCycle">, z.ZodLiteral<"hireMotorbike">, z.ZodLiteral<"hireVan">, z.ZodLiteral<"intercontinentalCharterFlight">, z.ZodLiteral<"intercontinentalFlight">, z.ZodLiteral<"international">, z.ZodLiteral<"internationalCarFerry">, z.ZodLiteral<"internationalCharterFlight">, z.ZodLiteral<"internationalCoach">, z.ZodLiteral<"internationalFlight">, z.ZodLiteral<"internationalPassengerFerry">, z.ZodLiteral<"interregionalRail">, z.ZodLiteral<"lift">, z.ZodLiteral<"local">, z.ZodLiteral<"localBus">, z.ZodLiteral<"localCarFerry">, z.ZodLiteral<"localPassengerFerry">, z.ZodLiteral<"localTram">, z.ZodLiteral<"longDistance">, z.ZodLiteral<"metro">, z.ZodLiteral<"miniCab">, z.ZodLiteral<"mobilityBus">, z.ZodLiteral<"mobilityBusForRegisteredDisabled">, z.ZodLiteral<"nationalCarFerry">, z.ZodLiteral<"nationalCoach">, z.ZodLiteral<"nationalPassengerFerry">, z.ZodLiteral<"nightBus">, z.ZodLiteral<"nightRail">, z.ZodLiteral<"postBoat">, z.ZodLiteral<"postBus">, z.ZodLiteral<"rackAndPinionRailway">, z.ZodLiteral<"railReplacementBus">, z.ZodLiteral<"railShuttle">, z.ZodLiteral<"railTaxi">, z.ZodLiteral<"regionalBus">, z.ZodLiteral<"regionalCarFerry">, z.ZodLiteral<"regionalCoach">, z.ZodLiteral<"regionalPassengerFerry">, z.ZodLiteral<"regionalRail">, z.ZodLiteral<"regionalTram">, z.ZodLiteral<"replacementRailService">, z.ZodLiteral<"riverBus">, z.ZodLiteral<"roadFerryLink">, z.ZodLiteral<"roundTripCharterFlight">, z.ZodLiteral<"scheduledFerry">, z.ZodLiteral<"schoolAndPublicServiceBus">, z.ZodLiteral<"schoolBoat">, z.ZodLiteral<"schoolBus">, z.ZodLiteral<"schoolCoach">, z.ZodLiteral<"shortHaulInternationalFlight">, z.ZodLiteral<"shuttleBus">, z.ZodLiteral<"shuttleCoach">, z.ZodLiteral<"shuttleFerryService">, z.ZodLiteral<"shuttleFlight">, z.ZodLiteral<"shuttleTram">, z.ZodLiteral<"sightseeingBus">, z.ZodLiteral<"sightseeingCoach">, z.ZodLiteral<"sightseeingFlight">, z.ZodLiteral<"sightseeingService">, z.ZodLiteral<"sightseeingTram">, z.ZodLiteral<"sleeperRailService">, z.ZodLiteral<"specialCoach">, z.ZodLiteral<"specialNeedsBus">, z.ZodLiteral<"specialTrain">, z.ZodLiteral<"streetCableCar">, z.ZodLiteral<"suburbanRailway">, z.ZodLiteral<"telecabin">, z.ZodLiteral<"telecabinLink">, z.ZodLiteral<"touristCoach">, z.ZodLiteral<"touristRailway">, z.ZodLiteral<"trainFerry">, z.ZodLiteral<"trainTram">, z.ZodLiteral<"tube">, z.ZodLiteral<"undefined">, z.ZodLiteral<"undefinedFunicular">, z.ZodLiteral<"unknown">, z.ZodLiteral<"urbanRailway">, z.ZodLiteral<"waterTaxi">]>>;
6
+ transportMode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"bicycle">, z.ZodLiteral<"foot">, z.ZodLiteral<"scooter">, z.ZodLiteral<"air">, z.ZodLiteral<"bus">, z.ZodLiteral<"cableway">, z.ZodLiteral<"car">, z.ZodLiteral<"carpool">, z.ZodLiteral<"coach">, z.ZodLiteral<"funicular">, z.ZodLiteral<"lift">, z.ZodLiteral<"metro">, z.ZodLiteral<"monorail">, z.ZodLiteral<"rail">, z.ZodLiteral<"taxi">, z.ZodLiteral<"tram">, z.ZodLiteral<"trolleybus">, z.ZodLiteral<"snowAndIce">, z.ZodLiteral<"unknown">, z.ZodLiteral<"water">]>>;
7
+ transportSubmode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"escooter">, z.ZodLiteral<"ebicycle">, z.ZodLiteral<"SchengenAreaFlight">, z.ZodLiteral<"airportBoatLink">, z.ZodLiteral<"airportLinkBus">, z.ZodLiteral<"airportLinkRail">, z.ZodLiteral<"airshipService">, z.ZodLiteral<"allFunicularServices">, z.ZodLiteral<"allHireVehicles">, z.ZodLiteral<"allTaxiServices">, z.ZodLiteral<"bikeTaxi">, z.ZodLiteral<"blackCab">, z.ZodLiteral<"cableCar">, z.ZodLiteral<"cableFerry">, z.ZodLiteral<"canalBarge">, z.ZodLiteral<"carTransportRailService">, z.ZodLiteral<"chairLift">, z.ZodLiteral<"charterTaxi">, z.ZodLiteral<"cityTram">, z.ZodLiteral<"communalTaxi">, z.ZodLiteral<"commuterCoach">, z.ZodLiteral<"crossCountryRail">, z.ZodLiteral<"dedicatedLaneBus">, z.ZodLiteral<"demandAndResponseBus">, z.ZodLiteral<"domesticCharterFlight">, z.ZodLiteral<"domesticFlight">, z.ZodLiteral<"domesticScheduledFlight">, z.ZodLiteral<"dragLift">, z.ZodLiteral<"expressBus">, z.ZodLiteral<"funicular">, z.ZodLiteral<"helicopterService">, z.ZodLiteral<"highFrequencyBus">, z.ZodLiteral<"highSpeedPassengerService">, z.ZodLiteral<"highSpeedRail">, z.ZodLiteral<"highSpeedVehicleService">, z.ZodLiteral<"hireCar">, z.ZodLiteral<"hireCycle">, z.ZodLiteral<"hireMotorbike">, z.ZodLiteral<"hireVan">, z.ZodLiteral<"intercontinentalCharterFlight">, z.ZodLiteral<"intercontinentalFlight">, z.ZodLiteral<"international">, z.ZodLiteral<"internationalCarFerry">, z.ZodLiteral<"internationalCharterFlight">, z.ZodLiteral<"internationalCoach">, z.ZodLiteral<"internationalFlight">, z.ZodLiteral<"internationalPassengerFerry">, z.ZodLiteral<"interregionalRail">, z.ZodLiteral<"lift">, z.ZodLiteral<"local">, z.ZodLiteral<"localBus">, z.ZodLiteral<"localCarFerry">, z.ZodLiteral<"localPassengerFerry">, z.ZodLiteral<"localTram">, z.ZodLiteral<"longDistance">, z.ZodLiteral<"metro">, z.ZodLiteral<"miniCab">, z.ZodLiteral<"mobilityBus">, z.ZodLiteral<"mobilityBusForRegisteredDisabled">, z.ZodLiteral<"nationalCarFerry">, z.ZodLiteral<"nationalCoach">, z.ZodLiteral<"nationalPassengerFerry">, z.ZodLiteral<"nightBus">, z.ZodLiteral<"nightRail">, z.ZodLiteral<"postBoat">, z.ZodLiteral<"postBus">, z.ZodLiteral<"rackAndPinionRailway">, z.ZodLiteral<"railReplacementBus">, z.ZodLiteral<"railShuttle">, z.ZodLiteral<"railTaxi">, z.ZodLiteral<"regionalBus">, z.ZodLiteral<"regionalCarFerry">, z.ZodLiteral<"regionalCoach">, z.ZodLiteral<"regionalPassengerFerry">, z.ZodLiteral<"regionalRail">, z.ZodLiteral<"regionalTram">, z.ZodLiteral<"replacementRailService">, z.ZodLiteral<"riverBus">, z.ZodLiteral<"roadFerryLink">, z.ZodLiteral<"roundTripCharterFlight">, z.ZodLiteral<"scheduledFerry">, z.ZodLiteral<"schoolAndPublicServiceBus">, z.ZodLiteral<"schoolBoat">, z.ZodLiteral<"schoolBus">, z.ZodLiteral<"schoolCoach">, z.ZodLiteral<"shortHaulInternationalFlight">, z.ZodLiteral<"shuttleBus">, z.ZodLiteral<"shuttleCoach">, z.ZodLiteral<"shuttleFerryService">, z.ZodLiteral<"shuttleFlight">, z.ZodLiteral<"shuttleTram">, z.ZodLiteral<"sightseeingBus">, z.ZodLiteral<"sightseeingCoach">, z.ZodLiteral<"sightseeingFlight">, z.ZodLiteral<"sightseeingService">, z.ZodLiteral<"sightseeingTram">, z.ZodLiteral<"sleeperRailService">, z.ZodLiteral<"specialCoach">, z.ZodLiteral<"specialNeedsBus">, z.ZodLiteral<"specialTrain">, z.ZodLiteral<"streetCableCar">, z.ZodLiteral<"suburbanRailway">, z.ZodLiteral<"telecabin">, z.ZodLiteral<"telecabinLink">, z.ZodLiteral<"touristCoach">, z.ZodLiteral<"touristRailway">, z.ZodLiteral<"trainFerry">, z.ZodLiteral<"trainTram">, z.ZodLiteral<"tube">, z.ZodLiteral<"undefined">, z.ZodLiteral<"undefinedFunicular">, z.ZodLiteral<"unknown">, z.ZodLiteral<"urbanRailway">, z.ZodLiteral<"waterTaxi">]>>;
8
8
  quays: z.ZodArray<z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  name: z.ZodString;
@@ -15,8 +15,8 @@ export declare const linesSchema: z.ZodArray<z.ZodObject<{
15
15
  id: z.ZodString;
16
16
  name: z.ZodString;
17
17
  publicCode: z.ZodNullable<z.ZodString>;
18
- transportMode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"air">, z.ZodLiteral<"bus">, z.ZodLiteral<"foot">, z.ZodLiteral<"bicycle">, z.ZodLiteral<"cableway">, z.ZodLiteral<"car">, z.ZodLiteral<"carpool">, z.ZodLiteral<"coach">, z.ZodLiteral<"funicular">, z.ZodLiteral<"lift">, z.ZodLiteral<"metro">, z.ZodLiteral<"monorail">, z.ZodLiteral<"rail">, z.ZodLiteral<"scooter">, z.ZodLiteral<"taxi">, z.ZodLiteral<"tram">, z.ZodLiteral<"trolleybus">, z.ZodLiteral<"unknown">, z.ZodLiteral<"water">, z.ZodLiteral<"snowAndIce">]>>;
19
- transportSubmode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"SchengenAreaFlight">, z.ZodLiteral<"airportBoatLink">, z.ZodLiteral<"airportLinkBus">, z.ZodLiteral<"airportLinkRail">, z.ZodLiteral<"airshipService">, z.ZodLiteral<"allFunicularServices">, z.ZodLiteral<"allHireVehicles">, z.ZodLiteral<"allTaxiServices">, z.ZodLiteral<"bikeTaxi">, z.ZodLiteral<"blackCab">, z.ZodLiteral<"cableCar">, z.ZodLiteral<"cableFerry">, z.ZodLiteral<"canalBarge">, z.ZodLiteral<"carTransportRailService">, z.ZodLiteral<"chairLift">, z.ZodLiteral<"charterTaxi">, z.ZodLiteral<"cityTram">, z.ZodLiteral<"communalTaxi">, z.ZodLiteral<"commuterCoach">, z.ZodLiteral<"crossCountryRail">, z.ZodLiteral<"dedicatedLaneBus">, z.ZodLiteral<"demandAndResponseBus">, z.ZodLiteral<"domesticCharterFlight">, z.ZodLiteral<"domesticFlight">, z.ZodLiteral<"domesticScheduledFlight">, z.ZodLiteral<"dragLift">, z.ZodLiteral<"escooter">, z.ZodLiteral<"expressBus">, z.ZodLiteral<"funicular">, z.ZodLiteral<"helicopterService">, z.ZodLiteral<"highFrequencyBus">, z.ZodLiteral<"highSpeedPassengerService">, z.ZodLiteral<"highSpeedRail">, z.ZodLiteral<"highSpeedVehicleService">, z.ZodLiteral<"hireCar">, z.ZodLiteral<"hireCycle">, z.ZodLiteral<"hireMotorbike">, z.ZodLiteral<"hireVan">, z.ZodLiteral<"intercontinentalCharterFlight">, z.ZodLiteral<"intercontinentalFlight">, z.ZodLiteral<"international">, z.ZodLiteral<"internationalCarFerry">, z.ZodLiteral<"internationalCharterFlight">, z.ZodLiteral<"internationalCoach">, z.ZodLiteral<"internationalFlight">, z.ZodLiteral<"internationalPassengerFerry">, z.ZodLiteral<"interregionalRail">, z.ZodLiteral<"lift">, z.ZodLiteral<"local">, z.ZodLiteral<"localBus">, z.ZodLiteral<"localCarFerry">, z.ZodLiteral<"localPassengerFerry">, z.ZodLiteral<"localTram">, z.ZodLiteral<"longDistance">, z.ZodLiteral<"metro">, z.ZodLiteral<"miniCab">, z.ZodLiteral<"mobilityBus">, z.ZodLiteral<"mobilityBusForRegisteredDisabled">, z.ZodLiteral<"nationalCarFerry">, z.ZodLiteral<"nationalCoach">, z.ZodLiteral<"nationalPassengerFerry">, z.ZodLiteral<"nightBus">, z.ZodLiteral<"nightRail">, z.ZodLiteral<"postBoat">, z.ZodLiteral<"postBus">, z.ZodLiteral<"rackAndPinionRailway">, z.ZodLiteral<"railReplacementBus">, z.ZodLiteral<"railShuttle">, z.ZodLiteral<"railTaxi">, z.ZodLiteral<"regionalBus">, z.ZodLiteral<"regionalCarFerry">, z.ZodLiteral<"regionalCoach">, z.ZodLiteral<"regionalPassengerFerry">, z.ZodLiteral<"regionalRail">, z.ZodLiteral<"regionalTram">, z.ZodLiteral<"replacementRailService">, z.ZodLiteral<"riverBus">, z.ZodLiteral<"roadFerryLink">, z.ZodLiteral<"roundTripCharterFlight">, z.ZodLiteral<"scheduledFerry">, z.ZodLiteral<"schoolAndPublicServiceBus">, z.ZodLiteral<"schoolBoat">, z.ZodLiteral<"schoolBus">, z.ZodLiteral<"schoolCoach">, z.ZodLiteral<"shortHaulInternationalFlight">, z.ZodLiteral<"shuttleBus">, z.ZodLiteral<"shuttleCoach">, z.ZodLiteral<"shuttleFerryService">, z.ZodLiteral<"shuttleFlight">, z.ZodLiteral<"shuttleTram">, z.ZodLiteral<"sightseeingBus">, z.ZodLiteral<"sightseeingCoach">, z.ZodLiteral<"sightseeingFlight">, z.ZodLiteral<"sightseeingService">, z.ZodLiteral<"sightseeingTram">, z.ZodLiteral<"sleeperRailService">, z.ZodLiteral<"specialCoach">, z.ZodLiteral<"specialNeedsBus">, z.ZodLiteral<"specialTrain">, z.ZodLiteral<"streetCableCar">, z.ZodLiteral<"suburbanRailway">, z.ZodLiteral<"telecabin">, z.ZodLiteral<"telecabinLink">, z.ZodLiteral<"touristCoach">, z.ZodLiteral<"touristRailway">, z.ZodLiteral<"trainFerry">, z.ZodLiteral<"trainTram">, z.ZodLiteral<"tube">, z.ZodLiteral<"undefined">, z.ZodLiteral<"undefinedFunicular">, z.ZodLiteral<"unknown">, z.ZodLiteral<"urbanRailway">, z.ZodLiteral<"waterTaxi">]>>;
18
+ transportMode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"bicycle">, z.ZodLiteral<"foot">, z.ZodLiteral<"scooter">, z.ZodLiteral<"air">, z.ZodLiteral<"bus">, z.ZodLiteral<"cableway">, z.ZodLiteral<"car">, z.ZodLiteral<"carpool">, z.ZodLiteral<"coach">, z.ZodLiteral<"funicular">, z.ZodLiteral<"lift">, z.ZodLiteral<"metro">, z.ZodLiteral<"monorail">, z.ZodLiteral<"rail">, z.ZodLiteral<"taxi">, z.ZodLiteral<"tram">, z.ZodLiteral<"trolleybus">, z.ZodLiteral<"snowAndIce">, z.ZodLiteral<"unknown">, z.ZodLiteral<"water">]>>;
19
+ transportSubmode: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"escooter">, z.ZodLiteral<"ebicycle">, z.ZodLiteral<"SchengenAreaFlight">, z.ZodLiteral<"airportBoatLink">, z.ZodLiteral<"airportLinkBus">, z.ZodLiteral<"airportLinkRail">, z.ZodLiteral<"airshipService">, z.ZodLiteral<"allFunicularServices">, z.ZodLiteral<"allHireVehicles">, z.ZodLiteral<"allTaxiServices">, z.ZodLiteral<"bikeTaxi">, z.ZodLiteral<"blackCab">, z.ZodLiteral<"cableCar">, z.ZodLiteral<"cableFerry">, z.ZodLiteral<"canalBarge">, z.ZodLiteral<"carTransportRailService">, z.ZodLiteral<"chairLift">, z.ZodLiteral<"charterTaxi">, z.ZodLiteral<"cityTram">, z.ZodLiteral<"communalTaxi">, z.ZodLiteral<"commuterCoach">, z.ZodLiteral<"crossCountryRail">, z.ZodLiteral<"dedicatedLaneBus">, z.ZodLiteral<"demandAndResponseBus">, z.ZodLiteral<"domesticCharterFlight">, z.ZodLiteral<"domesticFlight">, z.ZodLiteral<"domesticScheduledFlight">, z.ZodLiteral<"dragLift">, z.ZodLiteral<"expressBus">, z.ZodLiteral<"funicular">, z.ZodLiteral<"helicopterService">, z.ZodLiteral<"highFrequencyBus">, z.ZodLiteral<"highSpeedPassengerService">, z.ZodLiteral<"highSpeedRail">, z.ZodLiteral<"highSpeedVehicleService">, z.ZodLiteral<"hireCar">, z.ZodLiteral<"hireCycle">, z.ZodLiteral<"hireMotorbike">, z.ZodLiteral<"hireVan">, z.ZodLiteral<"intercontinentalCharterFlight">, z.ZodLiteral<"intercontinentalFlight">, z.ZodLiteral<"international">, z.ZodLiteral<"internationalCarFerry">, z.ZodLiteral<"internationalCharterFlight">, z.ZodLiteral<"internationalCoach">, z.ZodLiteral<"internationalFlight">, z.ZodLiteral<"internationalPassengerFerry">, z.ZodLiteral<"interregionalRail">, z.ZodLiteral<"lift">, z.ZodLiteral<"local">, z.ZodLiteral<"localBus">, z.ZodLiteral<"localCarFerry">, z.ZodLiteral<"localPassengerFerry">, z.ZodLiteral<"localTram">, z.ZodLiteral<"longDistance">, z.ZodLiteral<"metro">, z.ZodLiteral<"miniCab">, z.ZodLiteral<"mobilityBus">, z.ZodLiteral<"mobilityBusForRegisteredDisabled">, z.ZodLiteral<"nationalCarFerry">, z.ZodLiteral<"nationalCoach">, z.ZodLiteral<"nationalPassengerFerry">, z.ZodLiteral<"nightBus">, z.ZodLiteral<"nightRail">, z.ZodLiteral<"postBoat">, z.ZodLiteral<"postBus">, z.ZodLiteral<"rackAndPinionRailway">, z.ZodLiteral<"railReplacementBus">, z.ZodLiteral<"railShuttle">, z.ZodLiteral<"railTaxi">, z.ZodLiteral<"regionalBus">, z.ZodLiteral<"regionalCarFerry">, z.ZodLiteral<"regionalCoach">, z.ZodLiteral<"regionalPassengerFerry">, z.ZodLiteral<"regionalRail">, z.ZodLiteral<"regionalTram">, z.ZodLiteral<"replacementRailService">, z.ZodLiteral<"riverBus">, z.ZodLiteral<"roadFerryLink">, z.ZodLiteral<"roundTripCharterFlight">, z.ZodLiteral<"scheduledFerry">, z.ZodLiteral<"schoolAndPublicServiceBus">, z.ZodLiteral<"schoolBoat">, z.ZodLiteral<"schoolBus">, z.ZodLiteral<"schoolCoach">, z.ZodLiteral<"shortHaulInternationalFlight">, z.ZodLiteral<"shuttleBus">, z.ZodLiteral<"shuttleCoach">, z.ZodLiteral<"shuttleFerryService">, z.ZodLiteral<"shuttleFlight">, z.ZodLiteral<"shuttleTram">, z.ZodLiteral<"sightseeingBus">, z.ZodLiteral<"sightseeingCoach">, z.ZodLiteral<"sightseeingFlight">, z.ZodLiteral<"sightseeingService">, z.ZodLiteral<"sightseeingTram">, z.ZodLiteral<"sleeperRailService">, z.ZodLiteral<"specialCoach">, z.ZodLiteral<"specialNeedsBus">, z.ZodLiteral<"specialTrain">, z.ZodLiteral<"streetCableCar">, z.ZodLiteral<"suburbanRailway">, z.ZodLiteral<"telecabin">, z.ZodLiteral<"telecabinLink">, z.ZodLiteral<"touristCoach">, z.ZodLiteral<"touristRailway">, z.ZodLiteral<"trainFerry">, z.ZodLiteral<"trainTram">, z.ZodLiteral<"tube">, z.ZodLiteral<"undefined">, z.ZodLiteral<"undefinedFunicular">, z.ZodLiteral<"unknown">, z.ZodLiteral<"urbanRailway">, z.ZodLiteral<"waterTaxi">]>>;
20
20
  quays: z.ZodArray<z.ZodObject<{
21
21
  id: z.ZodString;
22
22
  name: z.ZodString;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.linesSchema = exports.lineSchema = void 0;
4
- const transport_mode_1 = require("../../modules/transport-mode");
4
+ const types_1 = require("../../modules/transport-mode/types");
5
5
  const zod_1 = require("zod");
6
6
  exports.lineSchema = zod_1.z.object({
7
7
  id: zod_1.z.string(),
8
8
  name: zod_1.z.string(),
9
9
  publicCode: zod_1.z.string().nullable(),
10
- transportMode: transport_mode_1.transportModeSchema.nullable(),
11
- transportSubmode: transport_mode_1.transportSubmodeSchema.nullable(),
10
+ transportMode: types_1.transportModeSchema.nullable(),
11
+ transportSubmode: types_1.transportSubmodeSchema.nullable(),
12
12
  quays: zod_1.z.array(zod_1.z.object({
13
13
  id: zod_1.z.string(),
14
14
  name: zod_1.z.string(),
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Next.js API route handler for the lines endpoint.
2
+ * Next.js App Router API route handler for the lines endpoint.
3
3
  * Hosts mount this at their chosen path (e.g. /api/contact/lines) and supply
4
4
  * the region/authority prefix only.
5
5
  */
@@ -11,35 +11,24 @@ export type LinesRouteHandlerOptions = {
11
11
  */
12
12
  getAuthorityId?: () => string | Promise<string>;
13
13
  };
14
- type NextApiResponseLike = {
15
- status(code: number): {
16
- json(body: unknown): void;
17
- };
18
- json(body: unknown): void;
19
- };
20
- type NextApiRequestLike = {
21
- method?: string;
22
- };
23
14
  /**
24
- * Creates a Next.js API route handler for GET /api/contact/lines.
15
+ * Creates a Next.js App Router API route handler for GET /api/contact/lines.
25
16
  * The handler fetches lines from Entur for the given authority; the host
26
17
  * only supplies the region/authority prefix via getAuthorityId or env.
27
18
  *
28
19
  * @example With env-based authority (host sets ENTUR_AUTHORITY_ID):
29
20
  * ```ts
30
21
  * import { createLinesRouteHandler } from '@mrfylke/contact-form/server';
31
- * export default createLinesRouteHandler();
22
+ * export const GET = createLinesRouteHandler();
32
23
  * ```
33
24
  *
34
- * @example With app-provided authority (e.g. from org config):
25
+ * @example With app-provided authority:
35
26
  * ```ts
36
27
  * import { createLinesRouteHandler } from '@mrfylke/contact-form/server';
37
- * import { getOrgData } from '@/modules/org-data';
38
- * export default createLinesRouteHandler({
39
- * getAuthorityId: () => getOrgData().authorityId,
28
+ * export const GET = createLinesRouteHandler({
29
+ * getAuthorityId: () => 'ATB:Authority:2',
40
30
  * });
41
31
  * ```
42
32
  */
43
- export declare function createLinesRouteHandler(options?: LinesRouteHandlerOptions): (req: NextApiRequestLike, res: NextApiResponseLike) => Promise<void>;
44
- export {};
33
+ export declare function createLinesRouteHandler(options?: LinesRouteHandlerOptions): () => Promise<Response>;
45
34
  //# sourceMappingURL=lines-route-handler.d.ts.map