Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uber-handler

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uber-handler - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

52

index.js

@@ -6,2 +6,3 @@ const Axios = require("axios");

constructor(config) {
this.service_name = "uber";
this.token = config.token || "";

@@ -32,2 +33,3 @@ this.access_token = config.access_token || "";

this.cancelCurrentRide = this.cancelCurrentRide.bind(this);
this.rideStatus = this.rideStatus.bind(this);
}

@@ -53,2 +55,3 @@

return {
service: this.service_name,
price: data.fare.value,

@@ -93,2 +96,3 @@ requestKey: {

return {
service: this.service_name,
requestId: response.data.request_id

@@ -99,2 +103,48 @@ }

rideStatus(requestId) {
return this.axios
.get(`/requests/${requestId}`)
.then(response => {
const { data } = response
const driver = data.driver && data.vehicle && {
name: data.driver.name,
rating: data.driver.rating,
pictureUrl: data.driver.picture_url,
phoneNumber: data.driver.phone_number,
vehicle: {
plate: data.vehicle.licence_plate,
name: data.vehicle.make + data.vehicle.model
}
}
const payload = {
service: this.service_name,
requestId: data.request_id,
driver
}
const result = {
'processing': {
status: 'processing',
...payload
},
'accepted': {
status: 'accepted',
...payload
},
'in_progress': {
status: 'on_the_way',
...payload
},
'completed': {
status: 'completed',
...payload
}
}
return result[data.status]
})
}
cancelCurrentRide() {

@@ -105,2 +155,3 @@ return this.axios

return {
service: this.service_name,
cancelled: true

@@ -116,2 +167,3 @@ }

return {
service: this.service_name,
cancelled: true

@@ -118,0 +170,0 @@ }

2

package.json
{
"name": "uber-handler",
"version": "0.4.4",
"version": "0.4.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc