Git Product home page Git Product logo

sdk's Introduction

sdk's People

Contributors

aryani1 avatar bendiksk avatar bujordet avatar carljoachim avatar caroline-odden avatar dependabot[bot] avatar didrikkvanvik avatar draperunner avatar fredrikmeyer avatar gurogb avatar hemm1 avatar ingara avatar jarlestavne avatar joelchelliah avatar kentandersen avatar kseverinsen avatar martinbjerkeengen avatar mikaelbr avatar mjansrud avatar oysval avatar rosvik avatar selbekk avatar torfjor avatar v-jiepeng avatar wfeiring avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk's Issues

Function for getting prices would be convenient.

I tried to use your SDK for a side project I am working on, but due to there not being a function for getting prices, and your API documentation being fairly poor. I resorted to using Vy's undocumented API

findTrips crashes

@babel/polyfill is missing, therefore running service.findTrips, which uses async/await, crashes.

New method: getBikeRentalStations

We need a getBikeRentalStations method for fetching multiple bike rental stations at once. It should take a list of IDs as its first parameter.

New method: getNearestPlaces

We should implement a method for the nearest query.

https://api.entur.io/journey-planner/v2/ide/?query={  nearest(latitude%3A 59.91459596109116%2C longitude%3A 10.755761595613489%2C filterByPlaceTypes%3A [stopPlace%2C bicycleRent]) {    edges {      node {        place {          id        }      }    }  }}

UnhandledPromiseRejectionWarning

Hi, I´m trying to run the examples but I always get, do you have any idea about what I´m doing wrong?

Thanks!
The Code:
const { default: EnturService, convertLocationToPosition } = require('../lib')

const service = new EnturService({ clientName: 'tjruterapp-ruterapp'})

async function example() {
const [fromLocation] = await service.getLocations('Ryllikvegen, Lillehammer')
const [toLocation] = await service.getLocations('Oslo S')

if (fromLocation && toLocation) {
    service.getTripPatterns({
        searchDate: new Date(),
        from: convertLocationToPosition(fromLocation),
        to: convertLocationToPosition(toLocation),
    }).then(console.log) // eslint-disable-line no-console
}

}
The error:
example()(node:80207) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

Are the examples outdated?

The examples on the master branch say

service.getTripPatterns({
    searchDate: new Date(),
    from: {
        name: 'Ryllikvegen, Lillehammer',
        coordinates: {
            latitude: 61.102848368937416,
            longitude: 10.51613308426234
        },
    },
    to: {
        place: 'NSR:StopPlace:337',
        name: 'Oslo S, Oslo'
    }
})

but when installing the package i get @entur/[email protected], which defines getTripPatterns like this:

getTripPatterns(
      from: Location,
      to: Location,
      params?: GetTripPatternsParams,
      ignoreFields?: Array<string>,
  ): Promise<TripPattern[]>;

Should the examples be updated, or have a notice saying that the default installed package is "next", and may not work like the examples?

Cheers!

Realtime not working for ruter...

service.getStopPlaceDepartures
stopId=NSR:StopPlace:3378
Reply:
"realtime" seems to be always true even if the bus has not started the journey, and there are fewer buses that actually are realtime, than on the actual platform info board.
Not sure where to report this, so please point me in the right direction if this is not the right place.
TIA
Jonas

TypeError on no results in getTripPatterns

Hi,

It seems like you are producing a TypeError in getTripPatterns if the response from the API is empty (i.e. no results found).

It seems like a bug to me, I'd expect to either get a more meaningful error or perhaps just an empty array back.

TypeError: Cannot read property 'trip' of undefined
at @entur\sdk\lib\trip\index.js:69:26

On a sidenote, I love the fact that you have made this javascript library to access your API.

Cheers,
Aleksander

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.