npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yandex-fleet-wrapper

v1.3.1

Published

Allow send commands to Yandex.Fleet services

Downloads

21

Readme

yandex-fleet-wrapper

Wrapper for Yandex.Fleet API

Allow send commands to Yandex services

This module for car rent services only! Not for taxi drivers or customers!

For more information about operations and its parameters look at: https://fleet.taxi.yandex.ru/docs/api/reference/index.html

Обертка над сервисами Яндекс.Такси

Позволяет посылать команды в сервис

Данный модуль предназначен только для таксопарков и сервисов аренды авто.

Модуль не предназначен для водителей и клиентов такси.

За дополнительной информацией по API обращайтесь к документации по адресу: https://fleet.taxi.yandex.ru/docs/api/reference/index.html

Installation:

npm i yandex-fleet-wrapper

Supported and planned API points

  • [x] in v. 1.0.1 POST v1/parks/driver-profiles/list

  • [x] in v. 1.0.1 POST v1/parks/orders/list

  • [x] in v. 1.0.1 POST v2/parks/driver-profiles/transactions/list

  • [x] in v. 1.0.1 POST v2/parks/driver-profiles/transactions

  • [x] in v. 1.2.1 GET v1/parks/driver-work-rules

  • [x] in v. 1.2.4 POST v1/parks/cars/list

  • [x] in v. 1.2.4 GET v2/parks/vehicles/car

  • [x] in v. 1.2.4 PUT & DELETE v1/parks/driver-profiles/car-bindings

  • [x] in v. 1.3.1 POST & PUT v2/parks/vehicles/car

  • [ ] v2/parks/contractors/driver-profile

  • [ ] v1/parks/orders/track

  • [ ] v2/parks/transactions/list

  • [ ] v2/parks/orders/transactions/list

Usage:

Create object

const Fleet = require('yandex-fleet-wrapper').Fleet;

let fleet = new Fleet(
    'Your park ID', 
    'Your park auth token'
    [, 'Language code (ru, en)' 
    [, 'URL Prefix' 
    [, 'URL suffix' ]]]
);

If Language code not provided 'ru' is used by default

if URL Prefix and Suffix not provided default is used.

Yandex services path can be changes without notice, this project can be updated with delay

All sending commands are queueing and executes sequentially with delay of 2 seconds. This is because Yandex.API requires a minimum delay of 0.5sec between operations on same parkId.

More information about returned data you can find in official documentation

Get drivers list

let data = await fleet.drivers();

Get orders list

let data = await fleet.orders(timeFrom, timeTo);

timeFrom and timeTo is Date object

timeFrom <= timeTo

Get transactions list

let data = await fleet.transactions(friverId, timeFrom, timeTo);

driverId is an Yandex ID that you can get using fleet.drivers() method

timeFrom and timeTo is Date object

timeFrom <= timeTo

Make driver transaction

let data = await fleet.transaction(driverId, moneyAmount, remarks, idKey);

driverId is an Yandex ID that you can get using fleet.drivers() method

moneyAmount should be a positive or negative decimal(12,2) value and can't be zero

remarks could describe your transaction and passed "AS IS" to Yandex transaction log

idKey (idempotency key) is an unique ID of the transaction provided by user

If one transaction with the same idKey is executed then next one is declined

Get list of work rules

let data = await fleet.workRules();

Get list of cars

let data = await fleet.cars();

Get car details

let data = await fleet.carInfo(carId);

carId is an Yandex ID that you can get using fleet.cars() method

Create car record

let data = await fleet.carCreate(data);

data is an object with specification required by Yandex (see official documentation for details)

Edit car details

let data = await fleet.carEdit(carId, data);

carId is an Yandex ID that you can get using fleet.cars() method

data is an object with specification required by Yandex (see official documentation for details)

Bind car to driver

let data = await fleet.carBind(carId, driverId);

carId is an Yandex ID that you can get using fleet.cars() method

driverId is an Yandex ID that you can get using fleet.drivers() method

Unbind car from driver

let data = await fleet.carUnbind(carId, driverId);

carId is an Yandex ID that you can get using fleet.cars() method

driverId is an Yandex ID that you can get using fleet.drivers() method