@opentripplanner/core-utils 14.0.0-alpha.2 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +0 -4
  2. package/esm/itinerary.js +70 -32
  3. package/esm/itinerary.js.map +1 -1
  4. package/esm/otpSchema.json +7321 -5821
  5. package/esm/planQuery.graphql +12 -0
  6. package/esm/profile.js +1 -1
  7. package/esm/profile.js.map +1 -1
  8. package/esm/query-gen.js +2 -2
  9. package/esm/query-gen.js.map +1 -1
  10. package/esm/query.js +2 -5
  11. package/esm/query.js.map +1 -1
  12. package/esm/storage.js +2 -6
  13. package/esm/storage.js.map +1 -1
  14. package/esm/time.js +1 -2
  15. package/esm/time.js.map +1 -1
  16. package/lib/index.js +50 -35
  17. package/lib/index.js.map +1 -1
  18. package/lib/itinerary.d.ts +25 -8
  19. package/lib/itinerary.d.ts.map +1 -1
  20. package/lib/itinerary.js +524 -495
  21. package/lib/itinerary.js.map +1 -1
  22. package/lib/map.js +40 -39
  23. package/lib/map.js.map +1 -1
  24. package/lib/otpSchema.json +7321 -5821
  25. package/lib/planQuery.graphql +12 -0
  26. package/lib/profile.js +1 -1
  27. package/lib/profile.js.map +1 -1
  28. package/lib/query-gen.js +134 -138
  29. package/lib/query-gen.js.map +1 -1
  30. package/lib/query.js +3 -6
  31. package/lib/query.js.map +1 -1
  32. package/lib/route.js +230 -248
  33. package/lib/route.js.map +1 -1
  34. package/lib/storage.d.ts.map +1 -1
  35. package/lib/storage.js +22 -28
  36. package/lib/storage.js.map +1 -1
  37. package/lib/suspense.js +28 -16
  38. package/lib/suspense.js.map +1 -1
  39. package/lib/time.js +36 -49
  40. package/lib/time.js.map +1 -1
  41. package/lib/ui.js +33 -36
  42. package/lib/ui.js.map +1 -1
  43. package/package.json +3 -3
  44. package/src/__tests__/__snapshots__/query-params.ts.snap +201 -201
  45. package/src/__tests__/__snapshots__/query.js.snap +28 -28
  46. package/src/__tests__/__snapshots__/route.js.snap +76 -76
  47. package/src/__tests__/__snapshots__/time.js.snap +2 -2
  48. package/src/__tests__/itinerary.ts +108 -23
  49. package/src/__tests__/query.js +1 -1
  50. package/src/__tests__/route.js +1 -1
  51. package/src/core-utils.story.tsx +34 -23
  52. package/src/itinerary.ts +85 -37
  53. package/src/otpSchema.json +7321 -5821
  54. package/src/planQuery.graphql +12 -0
  55. package/src/profile.js +1 -1
  56. package/src/query-gen.ts +1 -1
  57. package/src/query.js +2 -5
  58. package/src/storage.ts +5 -9
  59. package/tsconfig.tsbuildinfo +1 -1
package/esm/query.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","names":["format","isMatch","parse","getGeocoder","qs","getTransitModes","hasCar","isAccessMode","coordsToString","stringToCoords","queryParams","getCurrentTime","getCurrentDate","OTP_API_DATE_FORMAT","OTP_API_TIME_FORMAT","defaultParams","TIME_FORMATS","getQueryParamProperty","paramInfo","property","query","ensureSingleAccessMode","queryModes","accessCount","filter","m","length","firstAccess","find","push","getUrlParams","window","location","href","split","undefined","getOtpUrlParams","Object","keys","key","startsWith","getTripOptionsFromQuery","keepPlace","arguments","options","_objectSpread","time","departArrive","date","from","to","getDefaultQueryParamValue","param","getDefaultQuery","config","defaultQuery","routingType","qp","forEach","name","routingTypes","defaultQueryParams","isParamApplicable","applicable","includes","reduceOtpFlexModes","modes","enabled","reduce","prev","cur","newModes","expandOtpFlexMode","mode","map","join","isNotDefaultQuery","_config$modes","activeModes","sort","mergeFlex","defaultModes","concat","modesEqual","every","value","index","_loop","i","v","_ret","getFirstGeocodeResult","_x","_x2","_getFirstGeocodeResult","apply","_asyncToGenerator","_regeneratorRuntime","mark","_callee","text","geocoderConfig","geocoderMethod","geocoder","_args","wrap","_callee$","_context","next","abrupt","then","result","firstResult","features","getLocationFromGeocodedFeature","stop","parseLocationString","parts","coordinates","lat","lon","queryParamToLocation","_x3","_x4","_queryParamToLocation","_callee2","_callee2$","_context2","autoMethod","sent","planParamsToQuery","params","fromPlace","toPlace","arriveBy","matchedTimeFormat","timeFormat","Date","intermediatePlaces","maybeNumber","Number","isNaN","planParamsToQueryAsync","_x5","_planParamsToQueryAsync","_callee3","_args3","_callee3$","_context3","getRoutingParams","currentQuery","ignoreRealtimeUpdates","_config$modes2","isItinerary","indexOf","rewriteFunction","itineraryRewrite","profileRewrite","assign","_defineProperty","dateValid","timeValid","minTransitDistance","searchTimeout","onlyTransitTrips","startTimeValid","startTime","endTimeValid","endTime","reducedMode"],"sources":["../src/query.js"],"sourcesContent":["import { format, isMatch, parse } from \"date-fns\";\nimport getGeocoder from \"@opentripplanner/geocoder/lib\";\nimport qs from \"qs\";\n\nimport { getTransitModes, hasCar, isAccessMode } from \"./itinerary\";\nimport { coordsToString, stringToCoords } from \"./map\";\nimport queryParams from \"./query-params\";\nimport {\n getCurrentTime,\n getCurrentDate,\n OTP_API_DATE_FORMAT,\n OTP_API_TIME_FORMAT\n} from \"./time\";\n\n/* The list of default parameters considered in the settings panel */\n\nexport const defaultParams = [\n \"wheelchair\",\n \"maxWalkDistance\",\n \"walkReluctance\",\n \"maxWalkTime\",\n \"maxBikeDistance\",\n \"maxBikeTime\",\n \"bikeSpeed\",\n \"optimize\",\n \"optimizeBike\",\n \"maxEScooterDistance\",\n \"watts\"\n];\n\n/**\n * List of time formats to parse when reading query params.\n */\nconst TIME_FORMATS = [\n \"HH:mm:ss\",\n \"HH:mm\",\n \"H:mm\",\n \"h:mm:ss a\",\n \"h:mm:ssa\",\n \"h:mm a\",\n \"h:mma\",\n \"h:mm\",\n \"HHmm\",\n \"hmm\",\n \"ha\"\n];\n\n/* A function to retrieve a property value from an entry in the query-params\n * table, checking for either a static value or a function */\n\nexport function getQueryParamProperty(paramInfo, property, query) {\n return typeof paramInfo[property] === \"function\"\n ? paramInfo[property](query)\n : paramInfo[property];\n}\n\nexport function ensureSingleAccessMode(queryModes) {\n // Count the number of access modes\n const accessCount = queryModes.filter(m => isAccessMode(m)).length;\n\n // If multiple access modes are specified, keep only the first one\n if (accessCount > 1) {\n const firstAccess = queryModes.find(m => isAccessMode(m));\n queryModes = queryModes.filter(m => !isAccessMode(m) || m === firstAccess);\n\n // If no access modes are specified, add 'WALK' as the default\n } else if (accessCount === 0) {\n queryModes.push(\"WALK\");\n }\n\n return queryModes;\n}\n\nexport function getUrlParams() {\n if (window) {\n return qs.parse(window.location.href.split(\"?\")[1]);\n }\n return undefined;\n}\n\nexport function getOtpUrlParams() {\n return Object.keys(getUrlParams()).filter(key => !key.startsWith(\"ui_\"));\n}\n\nexport function getTripOptionsFromQuery(query, keepPlace = false) {\n const options = { ...query };\n // Delete time/date options and from/to\n delete options.time;\n delete options.departArrive;\n delete options.date;\n if (!keepPlace) {\n delete options.from;\n delete options.to;\n }\n return options;\n}\n\n/**\n * Gets the query param's default value that is either a constant or by\n * executing the default value function.\n */\nfunction getDefaultQueryParamValue(param) {\n return typeof param.default === \"function\" ? param.default() : param.default;\n}\n\n/**\n * Get the default query to OTP based on the given config.\n */\nexport function getDefaultQuery(config = null) {\n const defaultQuery = { routingType: \"ITINERARY\" };\n queryParams\n .filter(qp => \"default\" in qp)\n .forEach(qp => {\n defaultQuery[qp.name] = getDefaultQueryParamValue(qp);\n });\n if (config) {\n if (config.routingTypes && config.routingTypes.length > 0) {\n defaultQuery.routingType = config.routingTypes[0].key;\n }\n if (config.defaultQueryParams) {\n Object.keys(config.defaultQueryParams).forEach(key => {\n defaultQuery[key] = config.defaultQueryParams[key];\n });\n }\n }\n return defaultQuery;\n}\n\n/**\n * Determine if the specified query param applies to the given query (based on\n * routing type and the param's own applicable function).\n * @param paramInfo an entry from query-params.js\n * @param query the query against which to check if the param applies\n * @param config OTP config\n * @return {Boolean}\n */\nfunction isParamApplicable(paramInfo, query, config) {\n const { applicable, routingTypes } = paramInfo;\n if (!routingTypes.includes(query.routingType)) return false;\n if (typeof applicable === \"function\" && !applicable(query, config)) {\n return false;\n }\n return true;\n}\n\n/**\n * Helper method which replaces OTP flex modes with single FLEX mode that's\n * more useful and easier to work with.\n */\nexport function reduceOtpFlexModes(modes, enabled = true) {\n if (!enabled) return modes;\n\n return modes.reduce((prev, cur) => {\n const newModes = prev;\n // Add the current mode if it is not a flex mode\n if (!cur.includes(\"FLEX\")) {\n newModes.push(cur);\n // If it is a flex mode, do not add it but rather add the custom flex mode\n // if not already present\n } else if (!newModes.includes(\"FLEX\")) {\n newModes.push(\"FLEX\");\n }\n return newModes;\n }, []);\n}\n\n/**\n * Helper method to process a mode string, replacing all instances of FLEX\n * with the full set of FLEX modes used by otp-2\n * @param {*} mode a mode String, not an array\n * @returns a mode String, not an array (with flex modes expanded)\n */\nexport function expandOtpFlexMode(mode) {\n const modes = reduceOtpFlexModes(mode.split(\",\"));\n return modes\n .map(m => {\n // If both the expanded and shrunk modes are included, remove the expanded one\n if (m === \"FLEX_EGRESS\" || m === \"FLEX_ACCESS\" || m === \"FLEX_DIRECT\") {\n if (mode.includes(\"FLEX\")) return \"\";\n }\n if (m === \"FLEX\") {\n return \"FLEX_EGRESS,FLEX_ACCESS,FLEX_DIRECT\";\n }\n return m;\n })\n .join(\",\");\n}\n\n/**\n * Determines whether the specified query differs from the default query, i.e.,\n * whether the user has modified any trip options (including mode) from their\n * default values.\n */\nexport function isNotDefaultQuery(query, config) {\n const activeModes = reduceOtpFlexModes(\n query.mode.split(\",\").sort(),\n config.modes?.mergeFlex\n );\n if (\n activeModes.length !== 2 ||\n activeModes[0] !== \"TRANSIT\" ||\n activeModes[1] !== \"WALK\"\n ) {\n // Default mode is TRANSIT,WALK. If general TRANSIT is not used, check\n // against available transit modes in config.\n const defaultModes = getTransitModes(config)\n .concat([\"WALK\"])\n .sort();\n const modesEqual =\n activeModes.length === defaultModes.length &&\n activeModes.every((value, index) => {\n return value === defaultModes[index];\n });\n if (!modesEqual) return true;\n }\n // If modes are equal, check the remaining params.\n const defaultQuery = getDefaultQuery(config);\n for (let i = 0; i < defaultParams.length; i++) {\n const param = defaultParams[i];\n const paramInfo = queryParams.find(qp => qp.name === param);\n // If the parameter applies to the query and does not match the default\n // value, the query is not default.\n if (\n isParamApplicable(paramInfo, query, config) &&\n query[param] !== defaultQuery[param]\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Geocode utility for returning the first result for the provided place name text.\n * @param {string} text - text to search\n * @param {Object} geocoderConfig\n * @param {string} geocoderMethod - an alternate geocoder api method to use. Defaults to `search`\n * @return {Location}\n */\nasync function getFirstGeocodeResult(\n text,\n geocoderConfig,\n geocoderMethod = \"search\"\n) {\n const geocoder = getGeocoder(geocoderConfig);\n // Attempt to geocode search text and return first result if found.\n // TODO: Import geocoder from @opentripplanner\n return geocoder[geocoderMethod]({ text }).then(result => {\n const firstResult = result.features && result.features[0];\n if (firstResult) {\n return geocoder.getLocationFromGeocodedFeature(firstResult);\n }\n return null;\n });\n}\n\n/**\n * OTP allows passing a location in the form '123 Main St::lat,lon', so we check\n * for the double colon and parse the coordinates accordingly.\n * @param {string} value - query param for place described above\n * @return {Location} - location or null if the value is falsey or the parsed\n * coordinates do not result in both a lat and lon\n */\nexport function parseLocationString(value) {\n if (!value) return null;\n const parts = value.split(\"::\");\n const coordinates = parts[1]\n ? stringToCoords(parts[1])\n : stringToCoords(parts[0]);\n const name = parts[1] ? parts[0] : coordsToString(coordinates);\n return coordinates.length === 2\n ? {\n name: name || null,\n lat: coordinates[0] || null,\n lon: coordinates[1] || null\n }\n : null;\n}\n\n/**\n * Convert a string query param for a from or to place into a location. If\n * coordinates not provided and geocoder config is present, use the first\n * geocoded result.\n * @param {string} value\n * @param {Object} [geocoderConfig=null]\n * @return {Location}\n */\nasync function queryParamToLocation(value, geocoderConfig) {\n let location = parseLocationString(value);\n if (!location && value && geocoderConfig) {\n // If a valid location was not found, but the place name text exists,\n // attempt to geocode the name.\n location = await getFirstGeocodeResult(\n value,\n geocoderConfig,\n geocoderConfig.autoMethod\n );\n }\n return location;\n}\n\n/**\n * Create a otp query based on a the url params.\n *\n * @param {Object} params An object representing the parsed querystring of url\n * params.\n */\nexport function planParamsToQuery(params) {\n const query = {};\n Object.keys(params).forEach(key => {\n switch (key) {\n case \"fromPlace\":\n query.from = parseLocationString(params.fromPlace);\n break;\n case \"toPlace\":\n query.to = parseLocationString(params.toPlace);\n break;\n case \"arriveBy\":\n query.departArrive =\n params.arriveBy === \"true\"\n ? \"ARRIVE\"\n : params.arriveBy === \"false\"\n ? \"DEPART\"\n : \"NOW\";\n break;\n case \"date\":\n query.date = params.date || getCurrentDate();\n break;\n case \"time\":\n {\n // Match one of the supported time formats\n const matchedTimeFormat = TIME_FORMATS.find(timeFormat =>\n isMatch(params.time, timeFormat)\n );\n query.time = matchedTimeFormat\n ? format(\n parse(params.time, matchedTimeFormat, new Date()),\n OTP_API_TIME_FORMAT\n )\n : getCurrentTime();\n }\n break;\n case \"intermediatePlaces\":\n // If query has intermediate places, ensure that they are parsed\n // as locations.\n query.intermediatePlaces = params.intermediatePlaces\n ? params.intermediatePlaces.map(parseLocationString)\n : [];\n break;\n default: {\n const maybeNumber = Number(params[key]);\n // If the param value is an empty string literal and is not a number,\n // use string value. Else, use parsed number value.\n // See https://github.com/opentripplanner/otp-ui/issues/50\n query[key] =\n params[key] === \"\" || Number.isNaN(maybeNumber)\n ? params[key]\n : maybeNumber;\n break;\n }\n }\n });\n return query;\n}\n\n/**\n * Async method to create a otp query based on a the url params. This provides\n * the same functionality as planParamsToQuery, except that it will also attempt\n * to geocode the input from and to strings if no lat/lng values were provided.\n *\n * @param {Object} params An object representing the parsed querystring of url\n * params.\n * @param config the config in the otp-rr store.\n */\nexport async function planParamsToQueryAsync(params, config = {}) {\n // Construct query from plan params.\n const query = planParamsToQuery(params);\n // Attempt to geocode from and to params if the string parsing does not return\n // valid locations.\n if (!query.from) {\n query.from = await queryParamToLocation(params.fromPlace, config.geocoder);\n }\n if (!query.to) {\n query.to = await queryParamToLocation(params.toPlace, config.geocoder);\n }\n return query;\n}\n\n/**\n * Create an object that can be used as a querystring in making an OTP\n * PlannerResource request.\n *\n * See http://otp-docs.ibi-transit.com/api/resource_PlannerResource.html\n *\n * @param {Object} config The OTP application config. See types#configType\n * @param {Object} currentQuery The current query parameters as saved in the\n * application state. This method does some extra logic on top of this data\n * in order to create a request suitable for OTP. See __tests__/query.js#L14 for more.\n * @param {boolean} ignoreRealtimeUpdates If true, will create a request that\n * does not use realtime data.\n */\nexport function getRoutingParams(config, currentQuery, ignoreRealtimeUpdates) {\n const routingType = currentQuery.routingType;\n const isItinerary = routingType === \"ITINERARY\";\n let params = {};\n\n // Start with the universe of OTP parameters defined in query-params.js:\n queryParams\n .filter(qp => {\n // A given parameter is included in the request if all of the following:\n // 1. Must apply to the active routing type (ITINERARY or PROFILE)\n // 2. Must be included in the current user-defined query\n // 3. Must pass the parameter's applicability test, if one is specified\n return (\n qp.routingTypes.indexOf(routingType) !== -1 &&\n qp.name in currentQuery &&\n (typeof qp.applicable !== \"function\" ||\n qp.applicable(currentQuery, config))\n );\n })\n .forEach(qp => {\n // Translate the applicable parameters according to their rewrite\n // functions (if provided)\n const rewriteFunction = isItinerary\n ? qp.itineraryRewrite\n : qp.profileRewrite;\n params = Object.assign(\n params,\n rewriteFunction\n ? rewriteFunction(currentQuery[qp.name])\n : { [qp.name]: currentQuery[qp.name] }\n );\n });\n\n // Additional processing specific to ITINERARY mode\n if (isItinerary) {\n // override ignoreRealtimeUpdates if provided\n if (typeof ignoreRealtimeUpdates === \"boolean\") {\n params.ignoreRealtimeUpdates = ignoreRealtimeUpdates;\n }\n\n // check date/time validity; ignore both if either is invalid\n const dateValid = isMatch(params.date, OTP_API_DATE_FORMAT);\n const timeValid = isMatch(params.time, OTP_API_TIME_FORMAT);\n\n if (!dateValid || !timeValid) {\n delete params.time;\n delete params.date;\n }\n\n // temp: set additional parameters for CAR_HAIL or CAR_RENT trips\n if (\n params.mode &&\n (params.mode.includes(\"CAR_HAIL\") || params.mode.includes(\"CAR_RENT\"))\n ) {\n params.minTransitDistance = \"50%\";\n // increase search timeout because these queries can take a while\n params.searchTimeout = 10000;\n }\n\n // set onlyTransitTrips for car rental searches\n if (params.mode && params.mode.includes(\"CAR_RENT\")) {\n params.onlyTransitTrips = true;\n }\n\n // Additional processing specific to PROFILE mode\n } else {\n // check start and end time validity; ignore both if either is invalid\n const startTimeValid = isMatch(params.startTime, OTP_API_TIME_FORMAT);\n const endTimeValid = isMatch(params.endTime, OTP_API_TIME_FORMAT);\n\n if (!startTimeValid || !endTimeValid) {\n delete params.startTimeValid;\n delete params.endTimeValid;\n }\n }\n\n // TODO: check that valid from/to locations are provided\n\n // hack to add walking to driving/TNC trips\n if (hasCar(params.mode)) {\n params.mode += \",WALK\";\n }\n\n // Replace FLEX placeholder with OTP flex modes\n // Explicit false check allows avoiding a breaking change -- undefined is true\n if (params.mode && config.modes?.mergeFlex !== false) {\n // Ensure query is in reduced format to avoid replacing twice\n const reducedMode = reduceOtpFlexModes(params.mode.split(\",\")).join(\",\");\n params.mode = expandOtpFlexMode(reducedMode);\n }\n\n return params;\n}\n"],"mappings":";;;;;AAAA,SAASA,MAAM,EAAEC,OAAO,EAAEC,KAAK,QAAQ,UAAU;AACjD,OAAOC,WAAW,MAAM,+BAA+B;AACvD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SAASC,eAAe,EAAEC,MAAM,EAAEC,YAAY,QAAQ,aAAa;AACnE,SAASC,cAAc,EAAEC,cAAc,QAAQ,OAAO;AACtD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SACEC,cAAc,EACdC,cAAc,EACdC,mBAAmB,EACnBC,mBAAmB,QACd,QAAQ;;AAEf;;AAEA,OAAO,IAAMC,aAAa,GAAG,CAC3B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,OAAO,CACR;;AAED;AACA;AACA;AACA,IAAMC,YAAY,GAAG,CACnB,UAAU,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,UAAU,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,CAACkI,MAAM,CAACqC,OAAO,EAAE1J,mBAAmB,CAAC;IAEjE,IAAI,CAACuJ,cAAc,IAAI,CAACE,YAAY,EAAE;MACpC,OAAOpC,MAAM,CAACkC,cAAc;MAC5B,OAAOlC,MAAM,CAACoC,YAAY;IAC5B;EACF;;EAEA;;EAEA;EACA,IAAIjK,MAAM,CAAC6H,MAAM,CAAC1D,IAAI,CAAC,EAAE;IACvB0D,MAAM,CAAC1D,IAAI,IAAI,OAAO;EACxB;;EAEA;EACA;EACA,IAAI0D,MAAM,CAAC1D,IAAI,IAAI,EAAA+E,cAAA,GAAAlG,MAAM,CAACY,KAAK,cAAAsF,cAAA,uBAAZA,cAAA,CAAcxE,SAAS,MAAK,KAAK,EAAE;IACpD;IACA,IAAMyF,WAAW,GAAGxG,kBAAkB,CAACkE,MAAM,CAAC1D,IAAI,CAACvC,KAAK,CAAC,GAAG,CAAC,CAAC,CAACyC,IAAI,CAAC,GAAG,CAAC;IACxEwD,MAAM,CAAC1D,IAAI,GAAGD,iBAAiB,CAACiG,WAAW,CAAC;EAC9C;EAEA,OAAOtC,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"query.js","names":["format","isMatch","parse","getGeocoder","qs","getTransitModes","hasCar","isAccessMode","coordsToString","stringToCoords","queryParams","getCurrentTime","getCurrentDate","OTP_API_DATE_FORMAT","OTP_API_TIME_FORMAT","defaultParams","TIME_FORMATS","getQueryParamProperty","paramInfo","property","query","ensureSingleAccessMode","queryModes","accessCount","filter","m","length","firstAccess","find","push","getUrlParams","window","location","href","split","getOtpUrlParams","Object","keys","key","startsWith","getTripOptionsFromQuery","keepPlace","arguments","undefined","options","_objectSpread","time","departArrive","date","from","to","getDefaultQueryParamValue","param","getDefaultQuery","config","defaultQuery","routingType","qp","forEach","name","routingTypes","defaultQueryParams","isParamApplicable","applicable","includes","reduceOtpFlexModes","modes","enabled","reduce","prev","cur","newModes","expandOtpFlexMode","mode","map","join","isNotDefaultQuery","_config$modes","activeModes","sort","mergeFlex","defaultModes","concat","modesEqual","every","value","index","_loop","i","v","_ret","getFirstGeocodeResult","_x","_x2","_getFirstGeocodeResult","apply","_asyncToGenerator","_regeneratorRuntime","mark","_callee","text","geocoderConfig","geocoderMethod","geocoder","_args","wrap","_callee$","_context","next","abrupt","then","result","firstResult","features","getLocationFromGeocodedFeature","stop","parseLocationString","parts","coordinates","lat","lon","queryParamToLocation","_x3","_x4","_queryParamToLocation","_callee2","_callee2$","_context2","autoMethod","sent","planParamsToQuery","params","fromPlace","toPlace","arriveBy","matchedTimeFormat","timeFormat","Date","intermediatePlaces","maybeNumber","Number","isNaN","planParamsToQueryAsync","_x5","_planParamsToQueryAsync","_callee3","_args3","_callee3$","_context3","getRoutingParams","currentQuery","ignoreRealtimeUpdates","_config$modes2","isItinerary","indexOf","rewriteFunction","itineraryRewrite","profileRewrite","assign","_defineProperty","dateValid","timeValid","minTransitDistance","searchTimeout","onlyTransitTrips","startTimeValid","startTime","endTimeValid","endTime","reducedMode"],"sources":["../src/query.js"],"sourcesContent":["import { format, isMatch, parse } from \"date-fns\";\nimport getGeocoder from \"@opentripplanner/geocoder\";\nimport qs from \"qs\";\n\nimport { getTransitModes, hasCar, isAccessMode } from \"./itinerary\";\nimport { coordsToString, stringToCoords } from \"./map\";\nimport queryParams from \"./query-params\";\nimport {\n getCurrentTime,\n getCurrentDate,\n OTP_API_DATE_FORMAT,\n OTP_API_TIME_FORMAT\n} from \"./time\";\n\n/* The list of default parameters considered in the settings panel */\n\nexport const defaultParams = [\n \"wheelchair\",\n \"maxWalkDistance\",\n \"walkReluctance\",\n \"maxWalkTime\",\n \"maxBikeDistance\",\n \"maxBikeTime\",\n \"bikeSpeed\",\n \"optimize\",\n \"optimizeBike\",\n \"maxEScooterDistance\",\n \"watts\"\n];\n\n/**\n * List of time formats to parse when reading query params.\n */\nconst TIME_FORMATS = [\n \"HH:mm:ss\",\n \"HH:mm\",\n \"H:mm\",\n \"h:mm:ss a\",\n \"h:mm:ssa\",\n \"h:mm a\",\n \"h:mma\",\n \"h:mm\",\n \"HHmm\",\n \"hmm\",\n \"ha\"\n];\n\n/* A function to retrieve a property value from an entry in the query-params\n * table, checking for either a static value or a function */\n\nexport function getQueryParamProperty(paramInfo, property, query) {\n return typeof paramInfo[property] === \"function\"\n ? paramInfo[property](query)\n : paramInfo[property];\n}\n\nexport function ensureSingleAccessMode(queryModes) {\n // Count the number of access modes\n const accessCount = queryModes.filter(m => isAccessMode(m)).length;\n\n // If multiple access modes are specified, keep only the first one\n if (accessCount > 1) {\n const firstAccess = queryModes.find(m => isAccessMode(m));\n queryModes = queryModes.filter(m => !isAccessMode(m) || m === firstAccess);\n\n // If no access modes are specified, add 'WALK' as the default\n } else if (accessCount === 0) {\n queryModes.push(\"WALK\");\n }\n\n return queryModes;\n}\n\nexport function getUrlParams() {\n return qs.parse(window.location.href.split(\"?\")[1]);\n}\n\nexport function getOtpUrlParams() {\n return Object.keys(getUrlParams()).filter(key => !key.startsWith(\"ui_\"));\n}\n\nexport function getTripOptionsFromQuery(query, keepPlace = false) {\n const options = { ...query };\n // Delete time/date options and from/to\n delete options.time;\n delete options.departArrive;\n delete options.date;\n if (!keepPlace) {\n delete options.from;\n delete options.to;\n }\n return options;\n}\n\n/**\n * Gets the query param's default value that is either a constant or by\n * executing the default value function.\n */\nfunction getDefaultQueryParamValue(param) {\n return typeof param.default === \"function\" ? param.default() : param.default;\n}\n\n/**\n * Get the default query to OTP based on the given config.\n */\nexport function getDefaultQuery(config = null) {\n const defaultQuery = { routingType: \"ITINERARY\" };\n queryParams\n .filter(qp => \"default\" in qp)\n .forEach(qp => {\n defaultQuery[qp.name] = getDefaultQueryParamValue(qp);\n });\n if (config) {\n if (config.routingTypes && config.routingTypes.length > 0) {\n defaultQuery.routingType = config.routingTypes[0].key;\n }\n if (config.defaultQueryParams) {\n Object.keys(config.defaultQueryParams).forEach(key => {\n defaultQuery[key] = config.defaultQueryParams[key];\n });\n }\n }\n return defaultQuery;\n}\n\n/**\n * Determine if the specified query param applies to the given query (based on\n * routing type and the param's own applicable function).\n * @param paramInfo an entry from query-params.js\n * @param query the query against which to check if the param applies\n * @param config OTP config\n * @return {Boolean}\n */\nfunction isParamApplicable(paramInfo, query, config) {\n const { applicable, routingTypes } = paramInfo;\n if (!routingTypes.includes(query.routingType)) return false;\n if (typeof applicable === \"function\" && !applicable(query, config)) {\n return false;\n }\n return true;\n}\n\n/**\n * Helper method which replaces OTP flex modes with single FLEX mode that's\n * more useful and easier to work with.\n */\nexport function reduceOtpFlexModes(modes, enabled = true) {\n if (!enabled) return modes;\n\n return modes.reduce((prev, cur) => {\n const newModes = prev;\n // Add the current mode if it is not a flex mode\n if (!cur.includes(\"FLEX\")) {\n newModes.push(cur);\n // If it is a flex mode, do not add it but rather add the custom flex mode\n // if not already present\n } else if (!newModes.includes(\"FLEX\")) {\n newModes.push(\"FLEX\");\n }\n return newModes;\n }, []);\n}\n\n/**\n * Helper method to process a mode string, replacing all instances of FLEX\n * with the full set of FLEX modes used by otp-2\n * @param {*} mode a mode String, not an array\n * @returns a mode String, not an array (with flex modes expanded)\n */\nexport function expandOtpFlexMode(mode) {\n const modes = reduceOtpFlexModes(mode.split(\",\"));\n return modes\n .map(m => {\n // If both the expanded and shrunk modes are included, remove the expanded one\n if (m === \"FLEX_EGRESS\" || m === \"FLEX_ACCESS\" || m === \"FLEX_DIRECT\") {\n if (mode.includes(\"FLEX\")) return \"\";\n }\n if (m === \"FLEX\") {\n return \"FLEX_EGRESS,FLEX_ACCESS,FLEX_DIRECT\";\n }\n return m;\n })\n .join(\",\");\n}\n\n/**\n * Determines whether the specified query differs from the default query, i.e.,\n * whether the user has modified any trip options (including mode) from their\n * default values.\n */\nexport function isNotDefaultQuery(query, config) {\n const activeModes = reduceOtpFlexModes(\n query.mode.split(\",\").sort(),\n config.modes?.mergeFlex\n );\n if (\n activeModes.length !== 2 ||\n activeModes[0] !== \"TRANSIT\" ||\n activeModes[1] !== \"WALK\"\n ) {\n // Default mode is TRANSIT,WALK. If general TRANSIT is not used, check\n // against available transit modes in config.\n const defaultModes = getTransitModes(config)\n .concat([\"WALK\"])\n .sort();\n const modesEqual =\n activeModes.length === defaultModes.length &&\n activeModes.every((value, index) => {\n return value === defaultModes[index];\n });\n if (!modesEqual) return true;\n }\n // If modes are equal, check the remaining params.\n const defaultQuery = getDefaultQuery(config);\n for (let i = 0; i < defaultParams.length; i++) {\n const param = defaultParams[i];\n const paramInfo = queryParams.find(qp => qp.name === param);\n // If the parameter applies to the query and does not match the default\n // value, the query is not default.\n if (\n isParamApplicable(paramInfo, query, config) &&\n query[param] !== defaultQuery[param]\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Geocode utility for returning the first result for the provided place name text.\n * @param {string} text - text to search\n * @param {Object} geocoderConfig\n * @param {string} geocoderMethod - an alternate geocoder api method to use. Defaults to `search`\n * @return {Location}\n */\nasync function getFirstGeocodeResult(\n text,\n geocoderConfig,\n geocoderMethod = \"search\"\n) {\n const geocoder = getGeocoder(geocoderConfig);\n // Attempt to geocode search text and return first result if found.\n // TODO: Import geocoder from @opentripplanner\n return geocoder[geocoderMethod]({ text }).then(result => {\n const firstResult = result.features && result.features[0];\n if (firstResult) {\n return geocoder.getLocationFromGeocodedFeature(firstResult);\n }\n return null;\n });\n}\n\n/**\n * OTP allows passing a location in the form '123 Main St::lat,lon', so we check\n * for the double colon and parse the coordinates accordingly.\n * @param {string} value - query param for place described above\n * @return {Location} - location or null if the value is falsey or the parsed\n * coordinates do not result in both a lat and lon\n */\nexport function parseLocationString(value) {\n if (!value) return null;\n const parts = value.split(\"::\");\n const coordinates = parts[1]\n ? stringToCoords(parts[1])\n : stringToCoords(parts[0]);\n const name = parts[1] ? parts[0] : coordsToString(coordinates);\n return coordinates.length === 2\n ? {\n name: name || null,\n lat: coordinates[0] || null,\n lon: coordinates[1] || null\n }\n : null;\n}\n\n/**\n * Convert a string query param for a from or to place into a location. If\n * coordinates not provided and geocoder config is present, use the first\n * geocoded result.\n * @param {string} value\n * @param {Object} [geocoderConfig=null]\n * @return {Location}\n */\nasync function queryParamToLocation(value, geocoderConfig) {\n let location = parseLocationString(value);\n if (!location && value && geocoderConfig) {\n // If a valid location was not found, but the place name text exists,\n // attempt to geocode the name.\n location = await getFirstGeocodeResult(\n value,\n geocoderConfig,\n geocoderConfig.autoMethod\n );\n }\n return location;\n}\n\n/**\n * Create a otp query based on a the url params.\n *\n * @param {Object} params An object representing the parsed querystring of url\n * params.\n */\nexport function planParamsToQuery(params) {\n const query = {};\n Object.keys(params).forEach(key => {\n switch (key) {\n case \"fromPlace\":\n query.from = parseLocationString(params.fromPlace);\n break;\n case \"toPlace\":\n query.to = parseLocationString(params.toPlace);\n break;\n case \"arriveBy\":\n query.departArrive =\n params.arriveBy === \"true\"\n ? \"ARRIVE\"\n : params.arriveBy === \"false\"\n ? \"DEPART\"\n : \"NOW\";\n break;\n case \"date\":\n query.date = params.date || getCurrentDate();\n break;\n case \"time\":\n {\n // Match one of the supported time formats\n const matchedTimeFormat = TIME_FORMATS.find(timeFormat =>\n isMatch(params.time, timeFormat)\n );\n query.time = matchedTimeFormat\n ? format(\n parse(params.time, matchedTimeFormat, new Date()),\n OTP_API_TIME_FORMAT\n )\n : getCurrentTime();\n }\n break;\n case \"intermediatePlaces\":\n // If query has intermediate places, ensure that they are parsed\n // as locations.\n query.intermediatePlaces = params.intermediatePlaces\n ? params.intermediatePlaces.map(parseLocationString)\n : [];\n break;\n default: {\n const maybeNumber = Number(params[key]);\n // If the param value is an empty string literal and is not a number,\n // use string value. Else, use parsed number value.\n // See https://github.com/opentripplanner/otp-ui/issues/50\n query[key] =\n params[key] === \"\" || Number.isNaN(maybeNumber)\n ? params[key]\n : maybeNumber;\n break;\n }\n }\n });\n return query;\n}\n\n/**\n * Async method to create a otp query based on a the url params. This provides\n * the same functionality as planParamsToQuery, except that it will also attempt\n * to geocode the input from and to strings if no lat/lng values were provided.\n *\n * @param {Object} params An object representing the parsed querystring of url\n * params.\n * @param config the config in the otp-rr store.\n */\nexport async function planParamsToQueryAsync(params, config = {}) {\n // Construct query from plan params.\n const query = planParamsToQuery(params);\n // Attempt to geocode from and to params if the string parsing does not return\n // valid locations.\n if (!query.from) {\n query.from = await queryParamToLocation(params.fromPlace, config.geocoder);\n }\n if (!query.to) {\n query.to = await queryParamToLocation(params.toPlace, config.geocoder);\n }\n return query;\n}\n\n/**\n * Create an object that can be used as a querystring in making an OTP\n * PlannerResource request.\n *\n * See http://otp-docs.ibi-transit.com/api/resource_PlannerResource.html\n *\n * @param {Object} config The OTP application config. See types#configType\n * @param {Object} currentQuery The current query parameters as saved in the\n * application state. This method does some extra logic on top of this data\n * in order to create a request suitable for OTP. See __tests__/query.js#L14 for more.\n * @param {boolean} ignoreRealtimeUpdates If true, will create a request that\n * does not use realtime data.\n */\nexport function getRoutingParams(config, currentQuery, ignoreRealtimeUpdates) {\n const routingType = currentQuery.routingType;\n const isItinerary = routingType === \"ITINERARY\";\n let params = {};\n\n // Start with the universe of OTP parameters defined in query-params.js:\n queryParams\n .filter(qp => {\n // A given parameter is included in the request if all of the following:\n // 1. Must apply to the active routing type (ITINERARY or PROFILE)\n // 2. Must be included in the current user-defined query\n // 3. Must pass the parameter's applicability test, if one is specified\n return (\n qp.routingTypes.indexOf(routingType) !== -1 &&\n qp.name in currentQuery &&\n (typeof qp.applicable !== \"function\" ||\n qp.applicable(currentQuery, config))\n );\n })\n .forEach(qp => {\n // Translate the applicable parameters according to their rewrite\n // functions (if provided)\n const rewriteFunction = isItinerary\n ? qp.itineraryRewrite\n : qp.profileRewrite;\n params = Object.assign(\n params,\n rewriteFunction\n ? rewriteFunction(currentQuery[qp.name])\n : { [qp.name]: currentQuery[qp.name] }\n );\n });\n\n // Additional processing specific to ITINERARY mode\n if (isItinerary) {\n // override ignoreRealtimeUpdates if provided\n if (typeof ignoreRealtimeUpdates === \"boolean\") {\n params.ignoreRealtimeUpdates = ignoreRealtimeUpdates;\n }\n\n // check date/time validity; ignore both if either is invalid\n const dateValid = isMatch(params.date, OTP_API_DATE_FORMAT);\n const timeValid = isMatch(params.time, OTP_API_TIME_FORMAT);\n\n if (!dateValid || !timeValid) {\n delete params.time;\n delete params.date;\n }\n\n // temp: set additional parameters for CAR_HAIL or CAR_RENT trips\n if (\n params.mode &&\n (params.mode.includes(\"CAR_HAIL\") || params.mode.includes(\"CAR_RENT\"))\n ) {\n params.minTransitDistance = \"50%\";\n // increase search timeout because these queries can take a while\n params.searchTimeout = 10000;\n }\n\n // set onlyTransitTrips for car rental searches\n if (params.mode && params.mode.includes(\"CAR_RENT\")) {\n params.onlyTransitTrips = true;\n }\n\n // Additional processing specific to PROFILE mode\n } else {\n // check start and end time validity; ignore both if either is invalid\n const startTimeValid = isMatch(params.startTime, OTP_API_TIME_FORMAT);\n const endTimeValid = isMatch(params.endTime, OTP_API_TIME_FORMAT);\n\n if (!startTimeValid || !endTimeValid) {\n delete params.startTimeValid;\n delete params.endTimeValid;\n }\n }\n\n // TODO: check that valid from/to locations are provided\n\n // hack to add walking to driving/TNC trips\n if (hasCar(params.mode)) {\n params.mode += \",WALK\";\n }\n\n // Replace FLEX placeholder with OTP flex modes\n // Explicit false check allows avoiding a breaking change -- undefined is true\n if (params.mode && config.modes?.mergeFlex !== false) {\n // Ensure query is in reduced format to avoid replacing twice\n const reducedMode = reduceOtpFlexModes(params.mode.split(\",\")).join(\",\");\n params.mode = expandOtpFlexMode(reducedMode);\n }\n\n return params;\n}\n"],"mappings":";;;;;AAAA,SAASA,MAAM,EAAEC,OAAO,EAAEC,KAAK,QAAQ,UAAU;AACjD,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SAASC,eAAe,EAAEC,MAAM,EAAEC,YAAY,QAAQ,aAAa;AACnE,SAASC,cAAc,EAAEC,cAAc,QAAQ,OAAO;AACtD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SACEC,cAAc,EACdC,cAAc,EACdC,mBAAmB,EACnBC,mBAAmB,QACd,Q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AI,CAACT,QAAQ,CAAC,UAAU,CAAC,EAAE;MACnDmE,MAAM,CAACiC,gBAAgB,GAAG,IAAI;IAChC;;IAEA;EACF,CAAC,MAAM;IACL;IACA,IAAMC,cAAc,GAAGpK,OAAO,CAACkI,MAAM,CAACmC,SAAS,EAAExJ,mBAAmB,CAAC;IACrE,IAAMyJ,YAAY,GAAGtK,OAAO,CAACkI,MAAM,CAACqC,OAAO,EAAE1J,mBAAmB,CAAC;IAEjE,IAAI,CAACuJ,cAAc,IAAI,CAACE,YAAY,EAAE;MACpC,OAAOpC,MAAM,CAACkC,cAAc;MAC5B,OAAOlC,MAAM,CAACoC,YAAY;IAC5B;EACF;;EAEA;;EAEA;EACA,IAAIjK,MAAM,CAAC6H,MAAM,CAAC1D,IAAI,CAAC,EAAE;IACvB0D,MAAM,CAAC1D,IAAI,IAAI,OAAO;EACxB;;EAEA;EACA;EACA,IAAI0D,MAAM,CAAC1D,IAAI,IAAI,EAAA+E,cAAA,GAAAlG,MAAM,CAACY,KAAK,cAAAsF,cAAA,uBAAZA,cAAA,CAAcxE,SAAS,MAAK,KAAK,EAAE;IACpD;IACA,IAAMyF,WAAW,GAAGxG,kBAAkB,CAACkE,MAAM,CAAC1D,IAAI,CAACvC,KAAK,CAAC,GAAG,CAAC,CAAC,CAACyC,IAAI,CAAC,GAAG,CAAC;IACxEwD,MAAM,CAAC1D,IAAI,GAAGD,iBAAiB,CAACiG,WAAW,CAAC;EAC9C;EAEA,OAAOtC,MAAM;AACf","ignoreList":[]}
package/esm/storage.js CHANGED
@@ -6,9 +6,7 @@ var STORAGE_PREFIX = "otp";
6
6
  * Store a javascript object at the specified key.
7
7
  */
8
8
  export function storeItem(key, object) {
9
- if (window) {
10
- window.localStorage.setItem("".concat(STORAGE_PREFIX, ".").concat(key), JSON.stringify(object));
11
- }
9
+ window.localStorage.setItem("".concat(STORAGE_PREFIX, ".").concat(key), JSON.stringify(object));
12
10
  }
13
11
 
14
12
  /**
@@ -34,9 +32,7 @@ export function getItem(key) {
34
32
  * Remove item at specified key.
35
33
  */
36
34
  export function removeItem(key) {
37
- if (window) {
38
- window.localStorage.removeItem("".concat(STORAGE_PREFIX, ".").concat(key));
39
- }
35
+ window.localStorage.removeItem("".concat(STORAGE_PREFIX, ".").concat(key));
40
36
  }
41
37
 
42
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","names":["STORAGE_PREFIX","storeItem","key","object","window","localStorage","setItem","concat","JSON","stringify","getItem","notFoundValue","arguments","length","undefined","itemAsString","json","parse","e","console","warn","removeItem","randId","Math","random","toString","substr"],"sources":["../src/storage.ts"],"sourcesContent":["/* eslint-disable no-console */\n// Prefix to use with local storage keys.\nconst STORAGE_PREFIX = \"otp\";\n\n/**\n * Store a javascript object at the specified key.\n */\nexport function storeItem(key: string, object: unknown): void {\n if (window) {\n window.localStorage.setItem(\n `${STORAGE_PREFIX}.${key}`,\n JSON.stringify(object)\n );\n }\n}\n\n/**\n * Retrieve a javascript object at the specified key. If not found, defaults to\n * null or, the optionally provided notFoundValue.\n */\nexport function getItem(key: string, notFoundValue: unknown = null): unknown {\n let itemAsString: string;\n try {\n itemAsString = window.localStorage.getItem(`${STORAGE_PREFIX}.${key}`);\n const json = JSON.parse(itemAsString);\n if (json) return json;\n return notFoundValue;\n } catch (e) {\n // Catch any errors associated with parsing bad JSON.\n console.warn(e, itemAsString);\n return notFoundValue;\n }\n}\n\n/**\n * Remove item at specified key.\n */\nexport function removeItem(key: string): void {\n if (window) {\n window.localStorage.removeItem(`${STORAGE_PREFIX}.${key}`);\n }\n}\n\n/**\n * Generate a random ID. This might not quite be a UUID, but it serves our\n * purposes for now.\n */\nexport function randId(): string {\n return Math.random()\n .toString(36)\n .substr(2, 9);\n}\n"],"mappings":"AAAA;AACA;AACA,IAAMA,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,GAAW,EAAEC,MAAe,EAAQ;EAC5D,IAAIC,MAAM,EAAE;IACVA,MAAM,CAACC,YAAY,CAACC,OAAO,IAAAC,MAAA,CACtBP,cAAc,OAAAO,MAAA,CAAIL,GAAG,GACxBM,IAAI,CAACC,SAAS,CAACN,MAAM,CACvB,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASO,OAAOA,CAACR,GAAW,EAA0C;EAAA,IAAxCS,aAAsB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAChE,IAAIG,YAAoB;EACxB,IAAI;IACFA,YAAY,GAAGX,MAAM,CAACC,YAAY,CAACK,OAAO,IAAAH,MAAA,CAAIP,cAAc,OAAAO,MAAA,CAAIL,GAAG,CAAE,CAAC;IACtE,IAAMc,IAAI,GAAGR,IAAI,CAACS,KAAK,CAACF,YAAY,CAAC;IACrC,IAAIC,IAAI,EAAE,OAAOA,IAAI;IACrB,OAAOL,aAAa;EACtB,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV;IACAC,OAAO,CAACC,IAAI,CAACF,CAAC,EAAEH,YAAY,CAAC;IAC7B,OAAOJ,aAAa;EACtB;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASU,UAAUA,CAACnB,GAAW,EAAQ;EAC5C,IAAIE,MAAM,EAAE;IACVA,MAAM,CAACC,YAAY,CAACgB,UAAU,IAAAd,MAAA,CAAIP,cAAc,OAAAO,MAAA,CAAIL,GAAG,CAAE,CAAC;EAC5D;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASoB,MAAMA,CAAA,EAAW;EAC/B,OAAOC,IAAI,CAACC,MAAM,CAAC,CAAC,CACjBC,QAAQ,CAAC,EAAE,CAAC,CACZC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACjB","ignoreList":[]}
1
+ {"version":3,"file":"storage.js","names":["STORAGE_PREFIX","storeItem","key","object","window","localStorage","setItem","concat","JSON","stringify","getItem","notFoundValue","arguments","length","undefined","itemAsString","json","parse","e","console","warn","removeItem","randId","Math","random","toString","substr"],"sources":["../src/storage.ts"],"sourcesContent":["/* eslint-disable no-console */\n// Prefix to use with local storage keys.\nconst STORAGE_PREFIX = \"otp\";\n\n/**\n * Store a javascript object at the specified key.\n */\nexport function storeItem(key: string, object: unknown): void {\n window.localStorage.setItem(\n `${STORAGE_PREFIX}.${key}`,\n JSON.stringify(object)\n );\n}\n\n/**\n * Retrieve a javascript object at the specified key. If not found, defaults to\n * null or, the optionally provided notFoundValue.\n */\nexport function getItem(key: string, notFoundValue: unknown = null): unknown {\n let itemAsString: string;\n try {\n itemAsString = window.localStorage.getItem(`${STORAGE_PREFIX}.${key}`);\n const json = JSON.parse(itemAsString);\n if (json) return json;\n return notFoundValue;\n } catch (e) {\n // Catch any errors associated with parsing bad JSON.\n console.warn(e, itemAsString);\n return notFoundValue;\n }\n}\n\n/**\n * Remove item at specified key.\n */\nexport function removeItem(key: string): void {\n window.localStorage.removeItem(`${STORAGE_PREFIX}.${key}`);\n}\n\n/**\n * Generate a random ID. This might not quite be a UUID, but it serves our\n * purposes for now.\n */\nexport function randId(): string {\n return Math.random()\n .toString(36)\n .substr(2, 9);\n}\n"],"mappings":"AAAA;AACA;AACA,IAAMA,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,GAAW,EAAEC,MAAe,EAAQ;EAC5DC,MAAM,CAACC,YAAY,CAACC,OAAO,IAAAC,MAAA,CACtBP,cAAc,OAAAO,MAAA,CAAIL,GAAG,GACxBM,IAAI,CAACC,SAAS,CAACN,MAAM,CACvB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASO,OAAOA,CAACR,GAAW,EAA0C;EAAA,IAAxCS,aAAsB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAChE,IAAIG,YAAoB;EACxB,IAAI;IACFA,YAAY,GAAGX,MAAM,CAACC,YAAY,CAACK,OAAO,IAAAH,MAAA,CAAIP,cAAc,OAAAO,MAAA,CAAIL,GAAG,CAAE,CAAC;IACtE,IAAMc,IAAI,GAAGR,IAAI,CAACS,KAAK,CAACF,YAAY,CAAC;IACrC,IAAIC,IAAI,EAAE,OAAOA,IAAI;IACrB,OAAOL,aAAa;EACtB,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV;IACAC,OAAO,CAACC,IAAI,CAACF,CAAC,EAAEH,YAAY,CAAC;IAC7B,OAAOJ,aAAa;EACtB;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASU,UAAUA,CAACnB,GAAW,EAAQ;EAC5CE,MAAM,CAACC,YAAY,CAACgB,UAAU,IAAAd,MAAA,CAAIP,cAAc,OAAAO,MAAA,CAAIL,GAAG,CAAE,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASoB,MAAMA,CAAA,EAAW;EAC/B,OAAOC,IAAI,CAACC,MAAM,CAAC,CAAC,CACjBC,QAAQ,CAAC,EAAE,CAAC,CACZC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACjB","ignoreList":[]}
package/esm/time.js CHANGED
@@ -74,10 +74,9 @@ export function formatSecondsAfterMidnight(seconds, timeFormat) {
74
74
  * GMT+0 if the Intl API is unavailable.
75
75
  */
76
76
  export function getUserTimezone() {
77
- var _Intl;
78
77
  var fallbackTimezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "Etc/Greenwich";
79
78
  if (process.env.NODE_ENV === "test") return process.env.TZ;
80
- return ((_Intl = Intl) === null || _Intl === void 0 ? void 0 : _Intl.DateTimeFormat().resolvedOptions().timeZone) || fallbackTimezone;
79
+ return (Intl === null || Intl === void 0 ? void 0 : Intl.DateTimeFormat().resolvedOptions().timeZone) || fallbackTimezone;
81
80
  }
82
81
 
83
82
  /**
package/esm/time.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","names":["startOfDay","add","format","utcToZonedTime","OTP_API_DATE_FORMAT","OTP_API_TIME_FORMAT","toHoursMinutesSeconds","seconds","hours","Math","floor","minutes","ensureAtLeastOneMinute","duration","getTimeFormat","config","_config$dateTime","dateTime","timeFormat","getDateFormat","_config$dateTime2","dateFormat","getLongDateFormat","_config$dateTime3","longDateFormat","offsetTime","ms","options","offset","formatSecondsAfterMidnight","time","Date","getUserTimezone","_Intl","fallbackTimezone","arguments","length","undefined","process","env","NODE_ENV","TZ","Intl","DateTimeFormat","resolvedOptions","timeZone","getCurrentTime","timezone","now","getCurrentDate"],"sources":["../src/time.ts"],"sourcesContent":["import { Config } from \"@opentripplanner/types\";\nimport { startOfDay, add, format } from \"date-fns\";\nimport { utcToZonedTime } from \"date-fns-tz\";\n\n// Date/time formats (per date-fns) when sending/receiving date from OTP\n// regardless of whatever the user has configured as the display format.\nexport const OTP_API_DATE_FORMAT = \"yyyy-MM-dd\";\nexport const OTP_API_TIME_FORMAT = \"HH:mm\";\n\n/**\n * Breaks up a duration in seconds into hours, minutes, and seconds.\n * @param {number} seconds The number of seconds to break up\n * @returns an object with fields with the corresponding, hours, minutes, seconds.\n */\nexport function toHoursMinutesSeconds(\n seconds: number\n): {\n hours: number;\n minutes: number;\n seconds: number;\n} {\n return {\n hours: Math.floor(seconds / 3600),\n minutes: Math.floor(seconds / 60) % 60,\n seconds: seconds % 60\n };\n}\n\n/**\n * If a duration is less than 60 seconds, round it to one minute, to avoid a duration\n * of 0 minutes on a leg.\n * @param {number} duration The leg or trip duration in seconds\n * @returns a duration in seconds of at least 60 seconds.\n */\nexport const ensureAtLeastOneMinute = (duration: number): number =>\n duration < 60 ? 60 : duration;\n\n/**\n * @param {[type]} config the OTP config object found in store\n * @return {string} the config-defined time formatter or HH:mm (24-hr time)\n */\nexport function getTimeFormat(config: Config): string {\n return config?.dateTime?.timeFormat || OTP_API_TIME_FORMAT;\n}\n\nexport function getDateFormat(config: Config): string {\n return config?.dateTime?.dateFormat || OTP_API_DATE_FORMAT;\n}\n\n/** @deprecated */\nexport function getLongDateFormat(config: Config): string {\n return config?.dateTime?.longDateFormat || \"D MMMM YYYY\";\n}\n/**\n * Offsets a time according to the provided time options\n * and returns the result.\n */\nexport function offsetTime(ms, options) {\n return ms + (options?.offset || 0);\n}\n\n/**\n * Formats a seconds after midnight value for display in narrative\n * @param {number} seconds time since midnight in seconds\n * @param {string} timeFormat A valid date-fns time format\n * @return {string} formatted text representation\n */\nexport function formatSecondsAfterMidnight(\n seconds: number,\n timeFormat: string\n): string {\n const time = add(startOfDay(new Date()), { seconds });\n return format(time, timeFormat);\n}\n\n/**\n * Uses Intl.DateTimeFormat() api to get the user's time zone. In a test\n * environment, pulls timezone information from an env variable. Default to\n * GMT+0 if the Intl API is unavailable.\n */\nexport function getUserTimezone(fallbackTimezone = \"Etc/Greenwich\"): string {\n if (process.env.NODE_ENV === \"test\") return process.env.TZ;\n return Intl?.DateTimeFormat().resolvedOptions().timeZone || fallbackTimezone;\n}\n\n/**\n * Formats current time for use in OTP query\n * The conversion to the user's timezone is needed for testing purposes.\n */\nexport function getCurrentTime(timezone = getUserTimezone()): string {\n return format(utcToZonedTime(Date.now(), timezone), OTP_API_TIME_FORMAT);\n}\n\n/**\n * Formats current date for use in OTP query\n * The conversion to the user's timezone is needed for testing purposes.\n */\nexport function getCurrentDate(timezone = getUserTimezone()): string {\n return format(utcToZonedTime(Date.now(), timezone), OTP_API_DATE_FORMAT);\n}\n"],"mappings":"AACA,SAASA,UAAU,EAAEC,GAAG,EAAEC,MAAM,QAAQ,UAAU;AAClD,SAASC,cAAc,QAAQ,aAAa;;AAE5C;AACA;AACA,OAAO,IAAMC,mBAAmB,GAAG,YAAY;AAC/C,OAAO,IAAMC,mBAAmB,GAAG,OAAO;;AAE1C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,OAAe,EAKf;EACA,OAAO;IACLC,KAAK,EAAEC,IAAI,CAACC,KAAK,CAACH,OAAO,GAAG,IAAI,CAAC;IACjCI,OAAO,EAAEF,IAAI,CAACC,KAAK,CAACH,OAAO,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E_FORMAT","OTP_API_TIME_FORMAT","toHoursMinutesSeconds","seconds","hours","Math","floor","minutes","ensureAtLeastOneMinute","duration","getTimeFormat","config","_config$dateTime","dateTime","timeFormat","getDateFormat","_config$dateTime2","dateFormat","getLongDateFormat","_config$dateTime3","longDateFormat","offsetTime","ms","options","offset","formatSecondsAfterMidnight","time","Date","getUserTimezone","fallbackTimezone","arguments","length","undefined","process","env","NODE_ENV","TZ","Intl","DateTimeFormat","resolvedOptions","timeZone","getCurrentTime","timezone","now","getCurrentDate"],"sources":["../src/time.ts"],"sourcesContent":["import { Config } from \"@opentripplanner/types\";\nimport { startOfDay, add, format } from \"date-fns\";\nimport { utcToZonedTime } from \"date-fns-tz\";\n\n// Date/time formats (per date-fns) when sending/receiving date from OTP\n// regardless of whatever the user has configured as the display format.\nexport const OTP_API_DATE_FORMAT = \"yyyy-MM-dd\";\nexport const OTP_API_TIME_FORMAT = \"HH:mm\";\n\n/**\n * Breaks up a duration in seconds into hours, minutes, and seconds.\n * @param {number} seconds The number of seconds to break up\n * @returns an object with fields with the corresponding, hours, minutes, seconds.\n */\nexport function toHoursMinutesSeconds(\n seconds: number\n): {\n hours: number;\n minutes: number;\n seconds: number;\n} {\n return {\n hours: Math.floor(seconds / 3600),\n minutes: Math.floor(seconds / 60) % 60,\n seconds: seconds % 60\n };\n}\n\n/**\n * If a duration is less than 60 seconds, round it to one minute, to avoid a duration\n * of 0 minutes on a leg.\n * @param {number} duration The leg or trip duration in seconds\n * @returns a duration in seconds of at least 60 seconds.\n */\nexport const ensureAtLeastOneMinute = (duration: number): number =>\n duration < 60 ? 60 : duration;\n\n/**\n * @param {[type]} config the OTP config object found in store\n * @return {string} the config-defined time formatter or HH:mm (24-hr time)\n */\nexport function getTimeFormat(config: Config): string {\n return config?.dateTime?.timeFormat || OTP_API_TIME_FORMAT;\n}\n\nexport function getDateFormat(config: Config): string {\n return config?.dateTime?.dateFormat || OTP_API_DATE_FORMAT;\n}\n\n/** @deprecated */\nexport function getLongDateFormat(config: Config): string {\n return config?.dateTime?.longDateFormat || \"D MMMM YYYY\";\n}\n/**\n * Offsets a time according to the provided time options\n * and returns the result.\n */\nexport function offsetTime(ms, options) {\n return ms + (options?.offset || 0);\n}\n\n/**\n * Formats a seconds after midnight value for display in narrative\n * @param {number} seconds time since midnight in seconds\n * @param {string} timeFormat A valid date-fns time format\n * @return {string} formatted text representation\n */\nexport function formatSecondsAfterMidnight(\n seconds: number,\n timeFormat: string\n): string {\n const time = add(startOfDay(new Date()), { seconds });\n return format(time, timeFormat);\n}\n\n/**\n * Uses Intl.DateTimeFormat() api to get the user's time zone. In a test\n * environment, pulls timezone information from an env variable. Default to\n * GMT+0 if the Intl API is unavailable.\n */\nexport function getUserTimezone(fallbackTimezone = \"Etc/Greenwich\"): string {\n if (process.env.NODE_ENV === \"test\") return process.env.TZ;\n return Intl?.DateTimeFormat().resolvedOptions().timeZone || fallbackTimezone;\n}\n\n/**\n * Formats current time for use in OTP query\n * The conversion to the user's timezone is needed for testing purposes.\n */\nexport function getCurrentTime(timezone = getUserTimezone()): string {\n return format(utcToZonedTime(Date.now(), timezone), OTP_API_TIME_FORMAT);\n}\n\n/**\n * Formats current date for use in OTP query\n * The conversion to the user's timezone is needed for testing purposes.\n */\nexport function getCurrentDate(timezone = getUserTimezone()): string {\n return format(utcToZonedTime(Date.now(), timezone), OTP_API_DATE_FORMAT);\n}\n"],"mappings":"AACA,SAASA,UAAU,EAAEC,GAAG,EAAEC,MAAM,QAAQ,UAAU;AAClD,SAASC,cAAc,QAAQ,aAAa;;AAE5C;AACA;AACA,OAAO,IAAMC,mBAAmB,GAAG,YAAY;AAC/C,OAAO,IAAMC,mBAAmB,GAAG,OAAO;;AAE1C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,OAAe,EAKf;EACA,OAAO;IACLC,KAAK,EAAEC,IAAI,CAACC,KAAK,CAACH,OAAO,GAAG,IAAI,CAAC;IACjCI,OAAO,EAAEF,IAAI,CA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ault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
6
17
  });
7
- Object.defineProperty(exports, "SafeSuspense", {
8
- enumerable: true,
9
- get: function () {
10
- return _suspense.default;
11
- }
12
- });
13
- exports.default = void 0;
14
- var itinerary = _interopRequireWildcard(require("./itinerary"));
15
- var map = _interopRequireWildcard(require("./map"));
16
- var profile = _interopRequireWildcard(require("./profile"));
17
- var query = _interopRequireWildcard(require("./query"));
18
- var queryParams = _interopRequireWildcard(require("./query-params"));
19
- var route = _interopRequireWildcard(require("./route"));
20
- var storage = _interopRequireWildcard(require("./storage"));
21
- var time = _interopRequireWildcard(require("./time"));
22
- var ui = _interopRequireWildcard(require("./ui"));
23
- var queryGen = _interopRequireWildcard(require("./query-gen"));
24
- var _suspense = _interopRequireDefault(require("./suspense"));
25
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
26
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SafeSuspense = void 0;
30
+ const itinerary = __importStar(require("./itinerary"));
31
+ const map = __importStar(require("./map"));
32
+ const profile = __importStar(require("./profile"));
33
+ const query = __importStar(require("./query"));
34
+ const queryParams = __importStar(require("./query-params"));
35
+ const route = __importStar(require("./route"));
36
+ const storage = __importStar(require("./storage"));
37
+ const time = __importStar(require("./time"));
38
+ const ui = __importStar(require("./ui"));
39
+ const queryGen = __importStar(require("./query-gen"));
40
+ const suspense_1 = __importDefault(require("./suspense"));
41
+ exports.SafeSuspense = suspense_1.default;
27
42
  const core = {
28
- itinerary,
29
- map,
30
- profile,
31
- query,
32
- queryGen,
33
- queryParams,
34
- route,
35
- storage,
36
- time,
37
- ui
43
+ itinerary,
44
+ map,
45
+ profile,
46
+ query,
47
+ queryGen,
48
+ queryParams,
49
+ route,
50
+ storage,
51
+ time,
52
+ ui
38
53
  };
39
- var _default = exports.default = core;
54
+ exports.default = core;
40
55
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["itinerary","_interopRequireWildcard","require","map","profile","query","queryParams","route","storage","time","ui","queryGen","_suspense","_interopRequireDefault","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","core","_default","exports"],"sources":["../src/index.ts"],"sourcesContent":["import * as itinerary from \"./itinerary\";\nimport * as map from \"./map\";\nimport * as profile from \"./profile\";\nimport * as query from \"./query\";\nimport * as queryParams from \"./query-params\";\nimport * as route from \"./route\";\nimport * as storage from \"./storage\";\nimport * as time from \"./time\";\nimport * as ui from \"./ui\";\nimport * as queryGen from \"./query-gen\";\nimport SafeSuspense from \"./suspense\";\n\nconst core = {\n itinerary,\n map,\n profile,\n query,\n queryGen,\n queryParams,\n route,\n storage,\n time,\n ui\n};\n\nexport { SafeSuspense };\nexport default core;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,IAAA,GAAAR,uBAAA,CAAAC,OAAA;AACA,IAAAQ,EAAA,GAAAT,uBAAA,CAAAC,OAAA;AACA,IAAAS,QAAA,GAAAV,uBAAA,CAAAC,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAAsC,SAAAY,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI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C,6CAA+B;AAC/B,yCAA2B;AAC3B,sDAAwC;AACxC,0DAAsC;AAe7B,uBAfF,kBAAY,CAeE;AAbrB,MAAM,IAAI,GAAG;IACX,SAAS;IACT,GAAG;IACH,OAAO;IACP,KAAK;IACL,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,IAAI;IACJ,EAAE;CACH,CAAC;AAGF,kBAAe,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Company, Config, ElevationProfile, ElevationProfileComponent, FlexBookingInfo, ItineraryOnlyLegsRequired, LatLngArray, Leg, MassUnitOption, Money, Place, Step, Stop, TncFare } from "@opentripplanner/types";
1
+ import { AppliedFareProduct, Company, Config, Currency, ElevationProfile, ElevationProfileComponent, FlexBookingInfo, ItineraryOnlyLegsRequired, LatLngArray, Leg, MassUnitOption, Money, Place, Step, Stop, TncFare } from "@opentripplanner/types";
2
2
  export declare const transitModes: string[];
3
3
  /**
4
4
  * @param {config} config OTP-RR configuration object
@@ -134,15 +134,31 @@ export declare function calculateEmissions(itinerary: ItineraryOnlyLegsRequired,
134
134
  */
135
135
  export declare function getDisplayedStopId(placeOrStop: Place | Stop): string;
136
136
  /**
137
- * Extracts useful data from the fare products on a leg, such as the leg cost and transfer info.
138
- * @param leg Leg with fare products (must have used getLegsWithFares)
139
- * @param category Rider category
140
- * @param container Fare container (cash, electronic)
141
- * @returns Object containing price as well as the transfer discount amount, if a transfer was used.
137
+ * Removes the first part of the OTP standard scope (":"), if it is present
138
+ * @param item String that is potentially scoped with `:` character
139
+ * @returns descoped string
142
140
  */
143
- export declare function getLegCost(leg: Leg, mediumId: string | null, riderCategoryId: string | null): {
141
+ export declare const descope: (item: string) => string;
142
+ export type ExtendedMoney = Money & {
143
+ originalAmount?: number;
144
+ };
145
+ export declare const zeroDollars: (currency: Currency) => Money;
146
+ /**
147
+ * Extracts useful data from the fare products on a leg, such as the leg cost and transfer info.
148
+ * @param leg Leg with Fares v2 information
149
+ * @param mediumId Desired medium ID to calculate fare for
150
+ * @param riderCategoryId Desire rider category to calculate fare for
151
+ * @param seenFareIds Fare IDs used on previous legs. Used to detect transfer discounts.
152
+ * @returns Object containing price as well as transfer/dependent
153
+ * fare information. `AppliedFareProduct` should contain
154
+ * all the information needed, but the other fields are kept to
155
+ * make the transition to Fares V2 less jarring.
156
+ */
157
+ export declare function getLegCost(leg: Leg, mediumId: string | null, riderCategoryId: string | null, seenFareIds?: string[]): {
158
+ alternateFareProducts?: AppliedFareProduct[];
159
+ appliedFareProduct?: AppliedFareProduct;
160
+ isDependent?: boolean;
144
161
  price?: Money;
145
- transferAmount?: Money | undefined;
146
162
  productUseId?: string;
147
163
  };
148
164
  /**
@@ -150,6 +166,7 @@ export declare function getLegCost(leg: Leg, mediumId: string | null, riderCateg
150
166
  * @param legs Itinerary legs with fare products (must have used getLegsWithFares)
151
167
  * @param category Rider category (youth, regular, senior)
152
168
  * @param container Fare container (cash, electronic)
169
+ * @param seenFareIds List of fare product IDs that have already been seen on prev legs.
153
170
  * @returns Money object for the total itinerary cost.
154
171
  */
155
172
  export declare function getItineraryCost(legs: Leg[], mediumId: string | null, riderCategoryId: string | null): Money | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"itinerary.d.ts","sourceRoot":"","sources":["../src/itinerary.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,GAAG,EACH,cAAc,EACd,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACR,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,YAAY,UAQxB,CAAC;AAEF;;;GAGG;AAEH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAOxD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAE9C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAA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