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

fxos-device-service

v4.2.0

Published

A web service that exposes interactions with a connected Firefox OS device

Downloads

15

Readme

fxos-device-service

Build
Status npm
version

A RESTful web service that exposes interactions with a connected Firefox OS device

API Methods

GET /

Status message that shows whether the service is running.

GET /devices[?host=<host>&port=<port>]

List IDs and serial numbers of adb-attached devices. Can optionally specify a remote host and port for which the device is connected.

GET /devices/:id

Fetch details about the device whose session ID is the parameter id.

POST /devices/:id/connections/:port

Open a tcp connection to the parameter port. Returns a port on the host machine that is proxied to the device's port.

DELETE /devices/:id/connections/:port

Close the device tcp connection previously opened on the parameter port.

GET /devices/:id/crashes

List IDs of crash reports on device.

GET /devices/:id/crashes/:crashId

Download the crash dump with the parameter crash crashId.

POST /devices/:id/events

Trigger a series of sequential low-level touch interactions. The client is expected to write a JSON array of event objects for which to sequentially execute. See the syntax for POST /events/:event for event object schema.

POST /devices/:id/events/:event

Trigger a low-level touch-related interaction. The client is expected to write a JSON object with event-related properties which control the trigger details.

Valid event types and their JSON properties:

  • doubletap
    • x, X-axis coordinate
    • y, Y-axis coordinate
  • drag
    • x, X-axis coordinate to start drag
    • y, Y-axis coordinate to start drag
    • endX, X-axis coordinate to end drag
    • endY, Y-axis coordinate to end drag
    • duration, time in milliseconds for drag to elapse
  • keydown
    • code, keycode for the key press
  • keyup
    • code, keycode for the key release
  • reset, needs no parameters
  • sleep
    • duration, time in milliseconds to wait before next event invocation. Useful when triggering many events in a single request.
  • tap
    • x, X-axis coordinate
    • y, Y-axis coordinate

Example:

curl \
  -H 'Content-Type: application/json' \
  -X POST \
  'http://localhost:8080/devices/abcdef0123456789/events/tap' \
  --data-binary '{"x":100,"y":200}'

GET /devices/:id/files?filepath=<filepath>

Download a file from device. Use the filepath query parameter to specify the location of the file to download.

PUT /devices/:id/files?filepath=<filepath>

Upload a file to device. Use the filepath query parameter to specify the path destination of the uploaded file. The uploaded file should sent via multipart/form-data. A file permissions mode may also be set during upload.

Examples:

# Will upload myfile.txt to /data/local/myfile.txt
curl \
  -X PUT
  -F '[email protected]'
  'http://localhost:8080/devices/abcdef0123456789/files?filepath=/data/local/myfile.txt'
# Will upload image.jpg to /data/local/image.jpg with 777 permissions
curl \
  -X PUT
  -F '[email protected]'
  -F 'mode=777'
  'http://localhost:8080/devices/abcdef0123456789/files?filepath=/data/local/image.jpg'
# Will upload script.sh to /data/local/script.sh with executable permissions
curl \
  -X PUT
  -F '[email protected]'
  -F 'mode=+x'
  'http://localhost:8080/devices/abcdef0123456789/files?filepath=/data/local/script.sh'

GET /devices/:id/logs

Pipe logs from logcat to the connected client.

POST /devices/:id/logs

Write a log entry to the device. The client is expected to write a JSON object in the request body with the following fields:

  • message, required
  • priority, optional, defaults to i
  • tag, optional, defaults to DeviceService

DELETE /devices/:id/logs

Clear all logcat logs on the device.

DELETE /devices/:id/processes/:pid

Stop the process given by pid parameter.

GET /devices/:id/properties

Retrieve a JSON object of all the device properties and their associates values.

GET /devices/:id/properties/:property

Retrieve the value of a device property specified by the property url parameter.

POST /devices/:id/properties

Set the values of a collection device properties. The client is expected to write a JSON object which contains a dictionary of property names to values.

POST /devices/:id/restart?hard=(true|false|0|1)

true or 1, then the device will be restarted instead.

GET /devices/:id/profile

Stream the gecko profile from the target device as a tarball (.tar.gz).

POST /devices/:id/profile

Push a gecko profile to the target device. The service expects a gzipped tarball to be sent along as the request body.