@simrail-sdk/api-core-node
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

SimRail Core API for Node.JS

This is a Core API module (community edition) for interacting with the SimRail APIs.

This Core API module just provides an interface with SimRail's remote APIs. If you are looking for a more usable SDK module, check out:



Content index



Using NPM:

$ npm i @simrail-sdk/api-core-node

or

$ npm i github:simrail-sdk/api-core-node#VERSION

Where VERSION specifies the version to install.

For regular usage you only need to construct the API class and provide it with the endpoint URLs for live data and the timetable.

NOTE: API SDK will do some simple conversion on data received from endpoints to fix typos and enable continuity with other SDK projects. To disable this functionality, please refer to the second example below.

import Api from "@simrail-sdk/api-core-node";

const api = new Api({
    endpoints: {
        liveData: "https://panel.simrail.eu:8084",
        timetable: "https://api1.aws.simrail.eu:8082/api",
    },
});

api.getActiveServers().then(...);
// [
//     {
//         id: "638fec40d089346098624eb5",
//         isActive: true,
//         serverCode: "en1",
//         serverName: "EN1 (English)",
//         serverRegion: "Europe",
//     },
//     ...
// ]

api.getActiveStations("en1").then(...);
// [
//     {
//         additionalImage1URL: "https://api.simrail.eu:8083/Thumbnails/Stations/ko2.jpg",
//         additionalImage2URL: "https://api.simrail.eu:8083/Thumbnails/Stations/ko3.jpg",
//         difficultyLevel: 5,
//         dispatchedBy: [],
//         id: "644133f3858f72cc3d476e42",
//         latitude: 50.25686264038086,
//         longitude: 19.01921844482422,
//         mainImageURL: "https://api.simrail.eu:8083/Thumbnails/Stations/ko1m.jpg",
//         name: "Katowice",
//         prefix: "KO"
//     },
//     ...
// ]

api.getActiveTrains("en1").then(...);
// [
//     {
//         endStation: "Częstochowa",
//         id: "662f96b3766d379b4f3f525f",
//         runId: "73c0f0ea-20d9-4317-8339-8bc7d098bd35",
//         serverCode: "en1",
//         startStation: "Jaworzno Szczakowa",
//         trainData: {
//         inBorderStationArea: true,
//         latitude: 50.262142181396484,
//         longitude: 19.269641876220703,
//         vdDelayedTimetableIndex: 1,
//         velocity: 40,
//         distanceToSignalInFront: 386.6281433105469,
//         signalInFront: "SMA_G@7129,82510,8",
//         signalInFrontSpeed: 40
//         },
//         trainName: "PWJ",
//         trainNoLocal: "446004",
//         type: "bot",
//         vehicles: [ "EN57/EN57-1003", "EN57/EN57-614", "EN57/EN57-1755" ]
//     },
//     ...
// ]

api.getTimetable("en1").then(...);
api.getTimetable("en1", "446004").then(...);
// {
//     endStation: "Częstochowa",
//     endsAt: "03:53:00",
//     locoType: "EN57 (5B+6B+5B)",
//     runId: "73c0f0ea-20d9-4317-8339-8bc7d098bd35",
//     startStation: "Jaworzno Szczakowa",
//     startsAt: "02:15:00",
//     timetable: [
//       {
//         departureTime: "2024-08-05 02:15:00",
//         displayedTrainNumber: "446004",
//         line: 133,
//         maxSpeed: 100,
//         kilometrage: 15.81,
//         nameForPerson: "Jaworzno Szczakowa",
//         nameOfPoint: "Jaworzno Szczakowa",
//         pointId: "1472",
//         stopType: "NoStopOver",
//         trainType: "PWJ",
//         supervisedBy: "Jaworzno Szczakowa"
//       },
//       ...
//     ],
//     trainLength: 60,
//     trainName: "PWJ",
//     trainNoLocal: "446004",
//     trainWeight: 60
// }


Use option convertData to enable or disable result conversion. (default: true)

import Api from "@simrail-sdk/api-core-node";

const endpoints: Api.Endpoints = {
    liveData: "https://panel.simrail.eu:8084",
    timetable: "https://api1.aws.simrail.eu:8082/api",
};

new Api({ convertData: false, endpoints }).getActiveStations("en1").then(...);
// [
//     {
//         AdditionalImage1URL: 'https://api.simrail.eu:8083/Thumbnails/Stations/ko2.jpg',
//         AdditionalImage2URL: 'https://api.simrail.eu:8083/Thumbnails/Stations/ko3.jpg',
//         DifficultyLevel: 5,
//         DispatchedBy: [],
//         id: '644133f3858f72cc3d476e42'
//         Latititude: 50.25686264038086,
//         Longitude: 19.01921844482422,
//         MainImageURL: 'https://api.simrail.eu:8083/Thumbnails/Stations/ko1m.jpg',
//         Name: 'Katowice',
//         Prefix: 'KO',
//     },
//     ...
// ]

new Api({ convertData: true, endpoints }).getActiveStations("en1").then(...);
// [
//     {
//         additionalImage1URL: "https://api.simrail.eu:8083/Thumbnails/Stations/ko2.jpg",
//         additionalImage2URL: "https://api.simrail.eu:8083/Thumbnails/Stations/ko3.jpg",
//         difficultyLevel: 5,
//         dispatchedBy: [],
//         id: "644133f3858f72cc3d476e42",
//         latitude: 50.25686264038086,
//         longitude: 19.01921844482422,
//         mainImageURL: "https://api.simrail.eu:8083/Thumbnails/Stations/ko1m.jpg",
//         name: "Katowice",
//         prefix: "KO"
//     },
//     ...
// ]



NOTE: The API reference section doesn't account for namespaces, this unfortunately means the documentation below is not entirely complete. Please investigate the TypeScript definition files for the full API.




class Api   

Specifies an API class instance for interacting with SimRail's remote API.

Type params: Extends Optional Default Description
ConvertData Api.ConvertData Yes true Specifies if responses are converted or if the raw API response is returned. (default: true)

Since: 0.1.0

Definition:  index.ts:30



Type params: Extends Optional Default
ConvertData boolean Yes true
Arguments: Type
config Config<ConvertData>

Returns:  Api<ConvertData>

Since: 0.1.0

Definition:  index.ts:35



read-only

Specifies the configuration of the API.

Type:  Config<ConvertData>

Since: 0.1.0

Definition:  index.ts:33



Method to retrieve servers from the live data endpoint.

Returns:  Promise<ConvertData extends true ? Array<Server> : Array<Server.Raw>>  - A list of multiplayer servers.

Since: 0.1.0

Definition:  index.ts:44



Method to retrieve active dispatch stations from the live data endpoint.

Arguments: Type Description
serverCode string The unique code of the multiplayer server.

Returns:  Promise<ConvertData extends true ? Array<Station> : Array<Station.Raw>>  - A list of active dispatch stations.

Since: 0.1.0

Definition:  index.ts:57



Method to retrieve active trains from the live data endpoint.

Arguments: Type Description
serverCode string The unique code of the multiplayer server.

Returns:  Promise<ConvertData extends true ? Array<Train> : Array<Train.Raw>>  - A list of active trains.

Since: 0.1.0

Definition:  index.ts:70



Method to retrieve timetable data from the timetable endpoint.

Arguments: Type Description
serverCode string The unique code of the multiplayer server.

Returns:  Promise<ConvertData extends true ? Array<[Timetable][api-reference-types/liveData/index.ts~Timetable]> : Array<Timetable.Raw>>

Since: 0.1.0

Definition:  index.ts:83



Method to retrieve timetable data from the timetable endpoint.

Arguments: Type Description
serverCode string The unique code of the multiplayer server.
trainNoLocal string The national train number of a train. If left undefined, this function will return data for all trains in the timetable.

Returns:  Promise<ConvertData extends true ? Data : Raw>

Since: 0.1.0

Definition:  index.ts:83



Method to retrieve timetable data from the timetable endpoint.

Arguments: Type Optional Description
serverCode string No The unique code of the multiplayer server.
trainNoLocal string Yes The national train number of a train. If left undefined, this function will return data for all trains in the timetable.

Returns:  Promise<ConvertData extends false ? (Raw | List) : (Data | List)>

Since: 0.1.0

Definition:  index.ts:83




Specifies the version of the API.

Type:  Version

Since: 0.1.0

Definition:  index.ts:277




Specifies the maximum allowable operating speed. (Vmax)

Type:  "vmax"

Since: 0.1.0

Definition:  types/liveData/index.ts:15




Specifies the "speed" value that will indicate "vmax".

Type:  32767

Since: 0.1.0

Definition:  types/liveData/index.ts:18




Type params: Extends
ResponseResult Result

Since: 0.1.0

Definition:  types/liveData/index.ts:30



Specifies if the request succeeded.

Type:  ResponseResult

Since: 0.1.0

Definition:  types/liveData/index.ts:32




Specifies the configuration of the API.

Type params: Extends Description
ApiConvertData ConvertData Specifies if responses are converted or if the raw API response is returned.

Since: 0.1.0

Definition:  index.ts:289



read-only optional

Specifies if responses are converted or if the raw API response is returned.

Type:  ApiConvertData

Since: 0.1.0

Definition:  index.ts:295



read-only

Specifies the configuration for API endpoints.

Type:  Endpoints

Since: 0.1.0

Definition:  index.ts:297




Specifies information about a train in a timetable.

Since: 0.1.0

Definition:  types/timetable/index.ts:15



optional

Specifies under which train number the train will continue.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:17



Specifies the name of the destination station.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:19



Specifies when the train arrives at it's destination. Format: hh:mm:ss

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:21



Specifies the name of the train's locomotive.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:23



Specifies the unique ID of the train. (independent from the train number)

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:25



Specifies the name of the origin station.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:27



Specifies when the train departs from it's origin. Format: hh:mm:ss

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:29



Specifies a list of timetable entries for this train.

Type:  List

Since: 0.1.0

Definition:  types/timetable/index.ts:31



Specifies the length of the train in meters.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:33



Specifies the name of the train or train series.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:35



optional

Specifies the international train number of this train.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:37



Specifies the national train number of this train.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:39



Specifies the weight of this train in metric tonnes.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:41




Specifies a player dispatching at a station in the raw API format.

Since: 0.1.0

Definition:  types/liveData/index.ts:196



Specifies the unique code of the server the player is using in the raw API format.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:198



Specifies the Steam ID of the player in the raw API format.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:200




Since: 0.1.0

Definition:  index.ts:303



read-only

Specifies the URL for the live data API endpoint.

Type:  string

Since: 0.1.0

Definition:  index.ts:305



read-only

Specifies the URL for the timetable API endpoint.

Type:  string

Since: 0.1.0

Definition:  index.ts:307




Specifies a response for a failed request.

Extends:  Base<false>

Since: 0.1.0

Definition:  types/liveData/index.ts:39




Specifies a timetable entry for a train in the raw API format.

Extends:  Omit<Timetable | "arrivalTime" | "platform" | "radioChannels" | "stationCategory" | "stopType" | "supervisedBy" | "track">

Since: 0.1.0

Definition:  types/timetable/index.ts:180



Specifies when the train arrives at this point in the raw API format.

Type:  ArrivalTime

Since: 0.1.0

Definition:  types/timetable/index.ts:182



Specifies at what distance this point will be passed in kilometers and in the raw API format.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:184



Specifies at which platform the train will stop in Roman numerals in the raw API format.

Type:  Platform

Since: 0.1.0

Definition:  types/timetable/index.ts:190



Specifies the radio channels required after this point as a comma-separated string in the raw API format.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:196



Specifies the category of the station in the raw API format.

Type:  StationCategory

Since: 0.1.0

Definition:  types/timetable/index.ts:198



Specifies the type of stop the train will make in the raw API format.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:200



Specifies the name of the dispatch station this point belongs to in the raw API format.

Type:  SupervisedBy

Since: 0.1.0

Definition:  types/timetable/index.ts:202



Specifies the number of the track this train will stop at in the raw API format.

Type:  Track

Since: 0.1.0

Definition:  types/timetable/index.ts:204




Specifies a multiplayer server.

Since: 0.1.0

Definition:  types/liveData/index.ts:64



Specifies the unique ID of the server. (independent of code)

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:66



Specifies if the server is active.

Type:  boolean

Since: 0.1.0

Definition:  types/liveData/index.ts:68



Specifies the unique code of the server.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:70



Specifies the name of the server.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:72



Specifies in which region the server is located.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:74




Specifies an active dispatch station.

Since: 0.1.0

Definition:  types/liveData/index.ts:115



Specifies the URL of the first secondary image for this station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:117



Specifies the URL of the second secondary image for this station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:119



Specifies the difficulty level for this station. (from 1 to 5)

Type:  DifficultyLevel

Since: 0.1.0

Definition:  types/liveData/index.ts:121



optional

Specifies a list of players dispatching at this station.

Type:  Array<DispatchedBy>

Since: 0.1.0

Definition:  types/liveData/index.ts:123



Specifies the unique ID of this station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:125



Specifies the global latitude of this station.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:127



Specifies the global longitude of this station.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:129



Specifies the URL of the main image of this station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:131



Specifies the name of the station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:133



Specifies the prefix of this station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:135




Specfies a response for a successful request.

Extends:  Base<true>

Type params: Description
ResponseData The requested data.

Since: 0.1.0

Definition:  types/liveData/index.ts:47



Specifies the number of results.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:49



Specifies the requested data.

Type:  ResponseData

Since: 0.1.0

Definition:  types/liveData/index.ts:51



Specifies a description for the response.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:53




Specifies a timetable entry for a train.

Since: 0.1.0

Definition:  types/timetable/index.ts:88



optional

Specifies when the train arrives at this point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:90



Specifies when the train departs at this point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:92



Specifies which train number is displayed for this train.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:94



Specifies at what distance this point will be passed.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:100



Specifies the number of the line that the train will follow.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:96



Specifies the maximum speed at this point.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:98



Specifies the name of the dispatcher for this point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:102



Specifies the name of this point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:104



optional

Specifies at which platform the train will stop in Roman numerals.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:110



Specifies the unique ID of this point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:112



optional

Specifies the radio channels required after this point.

Type:  RadioChannels

Since: 0.1.0

Definition:  types/timetable/index.ts:118



optional

Specifies the category of the station.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:120



Specifies the type of stop the train will make.

Type:  StopType

Since: 0.1.0

Definition:  types/timetable/index.ts:122



optional

Specifies the name of the dispatch station this point belongs to.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:124



optional

Specifies the number of the track this train will stop at.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:126



Specifies the name of the train series.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:128




Specifies an active train.

Since: 0.1.0

Definition:  types/liveData/index.ts:220



Specifies the name of the destination station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:222



Specifies the unique ID of the train. (independent from runId)

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:224



Specifies the unique ID of this train on the timetable server. (independent from id)

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:226



Specifies the unique code of the server the train is running on.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:228



Specifies the name of the origin station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:230



Specifies live data about the train.

Type:  TrainData

Since: 0.1.0

Definition:  types/liveData/index.ts:232



Specifies the name of the train.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:234



Specifies the national train number of this train.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:236



Specifies if this train is operated by a "bot" or a "user".

Type:  Type

Since: 0.1.0

Definition:  types/liveData/index.ts:238



Specifies a list of vehicles of this train.

NOTE: This data hasn't be deciphered yet, if you know what this data describes please open a new issue in the project repository.

Type:  Vehicles

Since: 0.1.0

Definition:  types/liveData/index.ts:245




Specifies live data about a train.

Since: 0.1.0

Definition:  types/liveData/index.ts:281



optional

Specifies the Steam ID of the player controlling this train.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:283



optional

Specifies the distance to the next signal in meters.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:285



Specifies if the train is in the border area of the map. (unplayable area)

Type:  boolean

Since: 0.1.0

Definition:  types/liveData/index.ts:287



Specifies the current global latitude of the train.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:289



Specifies the current global longitude of the train.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:291



optional

Specifies data about the next signal.

NOTE: This data (except for the ID prefixing the @ symbol) hasn't be deciphered yet, if you know what this data describes please open a new issue in the project repository.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:298



optional

Specifies the track limit effective at the next signal in km/h.

Type:  SignalInFrontSpeed

Since: 0.1.0

Definition:  types/liveData/index.ts:300



Specifies the index of the current entry in this train's timetable.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:302



Specifies the current speed of the train.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:304




Specifies a response returned by the remote API.

Type params: Description
ResponseData The requested data.

Type:  ApiResponse.Error | ApiResponse.Successful<ResponseData>

Since: 0.1.0

Definition:  types/liveData/index.ts:28




Specifies when the train arrives at a point.

Type:  Timetable.ArrivalTime | null

Since: 0.1.0

Definition:  types/timetable/index.ts:208




Specifies under which train number a train will continue.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:49




Specifies the Steam ID of the player controlling a train in the raw API format.

Type:  string | null

Since: 0.1.0

Definition:  types/liveData/index.ts:358




Specifies if responses are converted or if the raw API response is returned.

Type:  boolean

Since: 0.1.0

Definition:  index.ts:294




Specifies the number of results.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:35




Specifies when a train departs at this point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:134




Specifies a description of a response.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:37




Specifies the difficulty level for a station in the raw API format. (from 1 to 5)

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:194




Specifies which train number is displayed for a train.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:136




Specifies the distance to the next signal in meters and in the raw API format.

Type:  number | null

Since: 0.1.0

Definition:  types/liveData/index.ts:371




Specifies when a train arrives at it's destination. Format: hh:mm:ss

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:53




Specifies the name of a destination station.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:51




type Id   

Specifies the unique ID of a train. (independent from Train.RunId)

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:251




Specifies the URL of an image.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:158




Specifies if a train is in the border area of the map. (unplayable area)

Type:  boolean

Since: 0.1.0

Definition:  types/liveData/index.ts:312




Specifies if a server is active.

Type:  boolean

Since: 0.1.0

Definition:  types/liveData/index.ts:80




Specifies at what distance a point will be passed.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:144




Specifies the global latitude of a station in the raw API format.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:207




Specifies the current global latitude of a train in the raw API format.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:360




Specifies the current global latitude of a train.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:314




type Line   

Specifies the number of the line that a train will follow.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:138




type List   

Specifies a list of timetable entries for a train.

Type:  Raw[]

Since: 0.1.0

Definition:  types/timetable/index.ts:210




Specifies the name of a train's locomotive.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:55




Specifies the current global longitude of a train.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:316




Specifies the current global longitude of a train in the raw API format.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:362




Specifies the maximum speed at a point.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:142




Specifies at what distance a point will be passed in kilometers.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:212




type Name   

Specifies the name of a station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:166




Specifies the name of the dispatcher for a point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:146




Specifies the name of a point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:148




Specifies at which platform a train will stop in Roman numerals.

Type:  Timetable.Platform | null

Since: 0.1.0

Definition:  types/timetable/index.ts:218




Specifies the unique ID of a point.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:156




Specifies the prefix of a station.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:168




Specifies a radio channel.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:162




Specifies the radio channels required after a point as a comma-separated string.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:224




Specifies if a request succeeded.

Type:  boolean

Since: 0.1.0

Definition:  types/liveData/index.ts:41




Specifies the unique ID of a train. (independent from the train number)

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:57




Specifies the unique code of a timetable server.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:59




Specifies the name of a server.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:86




Specifies in which region a server is located.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:88




Specifies data about the next signal in the raw API format.

NOTE: This data (except for the ID prefixing the @ symbol) hasn't be deciphered yet, if you know what this data describes please open a new issue in the project repository.

Type:  string | null

Since: 0.1.0

Definition:  types/liveData/index.ts:369




Specifies the track limit effective at the next signal in km/h and in the raw API format.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:373




Specifies when a train departs from it's origin. Format: hh:mm:ss

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:63




Specifies the name of an origin station.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:61




Specifies the category of a station.

Type:  Timetable.StationCategory | null

Since: 0.1.0

Definition:  types/timetable/index.ts:226




Specifies the Steam ID of a player.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:153




Specifies the type of stop a train will make.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:228




Specifies the name of the dispatch station a point belongs to.

Type:  Timetable.SupervisedBy | null

Since: 0.1.0

Definition:  types/timetable/index.ts:230




Specifies the number of the track a train will stop at.

Type:  Timetable.Track | null

Since: 0.1.0

Definition:  types/timetable/index.ts:232




Specifies the length of a train in meters.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:65




Specifies the name of a train or train series.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:67




Specifies the international train number of a train.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:69




Specifies the national train number of a train.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:71




Specifies the name of a train series.

Type:  string

Since: 0.1.0

Definition:  types/timetable/index.ts:178




Specifies the weight of a train in metric tonnes.

Type:  number

Since: 0.1.0

Definition:  types/timetable/index.ts:73




type Type   

Specifies the type of train operator in the raw API format. ("bot" or "user")

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:408




type Url   

Specifies an API endpoint URL.

Type:  string

Since: 0.1.0

Definition:  index.ts:311




Specifies the index of the current entry in a train's timetable.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:327




Specifies data about a vehicle of a train.

NOTE: This data hasn't be deciphered yet, if you know what this data describes please open a new issue in the project repository.

Type:  string

Since: 0.1.0

Definition:  types/liveData/index.ts:272




Specifies a list of vehicles of a train.

NOTE: This data hasn't be deciphered yet, if you know what this data describes please open a new issue in the project repository.

Type:  Vehicles[]

Since: 0.1.0

Definition:  types/liveData/index.ts:279




Specifies the current speed of a train.

Type:  number

Since: 0.1.0

Definition:  types/liveData/index.ts:329




Specifies the version of the API.

Type:  `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`

Since: 0.1.0

Definition:  index.ts:314




Package name: @simrail-sdk/api-core-node

Author: Niek van Bennekom

Version: 0.1.2

Repository: github:simrail-sdk/api-core-node (origin)

Keywords: simrail, sdk, core, api, rest.

View license   |   view open source licenses

SCTL version: 0.1.11-dev

Development packages: (2)

  • @types/node: TypeScript definitions for node.

  • typescript: TypeScript is a language for application scale JavaScript development.



This module contains and uses the following internal modules:

  • index.js

  • types/index.js

  • types/liveData/index.js

  • types/timetable/index.js



Dependency tree:

Dependency tree graph



File type Number of files Lines with code Lines with comments Blank lines
Markdown 3 2377 0 1675
TypeScript 8 719 836 95
JavaScript 6 278 6 0
JSON 3 91 0 1
YAML 1 44 0 2
All (total) 21 3509 842 1773

Readme

Keywords

Package Sidebar

Install

npm i @simrail-sdk/api-core-node

Weekly Downloads

0

Version

0.1.2

License

See LICENSE.md

Unpacked Size

219 kB

Total Files

21

Last publish

Collaborators

  • niekvb