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

vinli-cli

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinli-cli - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

bin/vinli-device-events

10

lib/app.js

@@ -30,1 +30,11 @@ 'use strict';

};
exports.assertAppSecret = (options) => {
if (!(options.app && options.secret)) {
throw new Error(`App and Secret not found. Set them with:
--app & --secret parameters
save to vinlirc with 'vinli-cli app set-current'
export to VINLI_APP & VINLI_SECRET environment variables`);
}
return options;
};

2

lib/error_handler.js

@@ -21,3 +21,3 @@ 'use strict';

throw new Error(err);
console.log(colors.red(err.message || err));
};
'use strict';
const origins = {
prod: {
platform: 'https://platform.vin.li',
telemetry: 'https://telemetry.vin.li',
event: 'https://events.vin.li',
trip: 'https://trips.vin.li',
dev: 'https://dev.vin.li',
auth: 'https://auth.vin.li',
rule: 'https://rules.vin.li',
dummy: 'https://dummies.vin.li'
}
};
const origins = (stack) => ({
platform: `https://platform${stack}`,
telemetry: `https://telemetry${stack}`,
event: `https://events${stack}`,
trip: `https://trips${stack}`,
dev: `https://dev${stack}`,
auth: `https://auth${stack}`,
rule: `https://rules${stack}`,
dummy: `https://dummies${stack}`,
stream: `wss://stream${stack}`
});
module.exports = function(service, stack) {
return origins[stack || 'prod'][service];
return origins(stack || process.env.VINLI_STACK || '.vin.li')[service];
};

@@ -8,3 +8,3 @@ 'use strict';

const defaultFormat = function(value) {
if (typeof value === 'time') {
if (_.isDate(value)) {
return value.toISOString();

@@ -11,0 +11,0 @@ }

{
"name": "vinli-cli",
"version": "1.0.2",
"version": "1.1.0",
"description": "Vinli Developers don't use web interfaces",

@@ -46,6 +46,7 @@ "preferGlobal": true,

"moment": "^2.11.1",
"prompt": "^0.2.14",
"prompt": "^1.0.0",
"table": "^3.7.8",
"ws": "^1.0.1",
"yarp": "^0.4.5"
}
}

@@ -22,2 +22,4 @@ Vinli CLI

- [Device](#device)
- [`events`](#device-events)
- [`latest-vehicle`](#device-latest-vehicle)
- [`list`](#device-list)

@@ -27,2 +29,4 @@ - [`set-current`](#device-set-current)

- [`snapshots`](#device-snapshots)
- [`stream`](#device-stream)
- [`messages`](#device-messages)
- [`vehicles`](#device-vehicles)

@@ -63,2 +67,3 @@ - [Dummy](#dummy)

- **Dummy** - Dummies are virtual devices can be created on demand and sent on virtual trips on predefined routes. A dummy can be added to a My Vinli account that has authorized your app and when it starts a trip the data will come into your application in real time exactly the same as a real Vinli device. Commands that act on a dummy can have a dummy specified by name or id with the `--dummy` parameter, `VINL_DUMMY` environment variable or saved to nearest `.vinlirc` file with `dummy set-current`. Dummies are associated with an app and there is a limit of 5 per app. They can be reused multiple times and deleted.
- **since** & **until** - Commands that output sets of dated sets of data can be limited with `--since` and `--until` parameters (or `VINLI_SINCE` / `VINLI_UNTIL` environment variables). Use either or both parameters to limit the output of the command. You can enter anything that will parse to a javascript date like `2016-02-14`, `2016-02-14T06:00:00.000Z`, '1455429600000' (milliseconds Epoch), or relative values like `1 hour ago` (seconds/minutes/hours/days/weeks/months/years)
- **Output** - Output of almost all commands can be formatted to support easier integration with the parameter `--output [format]` or `-o [format]`. Supported formats are `table` (default), `json`, `yaml`, or `text`

@@ -119,2 +124,16 @@ - **Help** - `-h` or `--help` with any command or subcommand will output help contents and accepted parameters. Ex: `vinli --help`, `vinli app -h`, `vinli dummy set-current --help`.

## Device
### `device events`
Get device event history.
Requires `--device` param or current device saved in `.vinlirc`. Supports output formatting with `--output`. Requires `app` and `secret`.
Pagination parameters for `device locations`:
* `--limit`
* `--since`
* `--until`
### `device latest-vehicle`
Get the vehicle information for last vehicle a device was seen in.
Requires `--device` param or current device saved in `.vinlirc`. Supports output formatting with `--output`. Requires `app` and `secret`.
### `device list`

@@ -128,3 +147,3 @@ Get a list of devices that available to an app. These can be real devices or dummies. Supports output formatting with `--output`. Requires `app` and `secret`.

### `device set-current`
Most commands require the selection of a device. This is similar to the app selection and will also be stored in the nearest `.vinlirc` file. Requires `app` and `secret`.
Most commands require the selection of a device. This is similar to the app selection and will also be stored in the nearest `.vinlirc` file. Requires `--device` param. Requires `app` and `secret`.

@@ -140,3 +159,3 @@ * `vinli device set-current --device 74ce1599-72e3-4353-8637-0cc4e2bffe54`

Fields in output can be limited with `--fields [list]` parameter. Supports output formatting with `--output`. Requires `app` and `secret`.
Requires `--device` param or current device saved in `.vinlirc`. Fields in output can be limited with `--fields [list]` parameter. Supports output formatting with `--output`. Requires `app` and `secret`.

@@ -151,3 +170,3 @@ Pagination parameters for `device locations`:

Fields in output can be limited with `--fields [list]` parameter. Supports output formatting with `--output`. Requires `app` and `secret`.
Requires `--device` param or current device saved in `.vinlirc`. Fields in output can be limited with `--fields [list]` parameter. Supports output formatting with `--output`. Requires `app` and `secret`.

@@ -159,6 +178,21 @@ Pagination parameters for `device snapshots`:

### `device stream`
Subscribe to a stream of device messages.
Requires `--device` param or current device saved in `.vinlirc`. Requires `app` and `secret`. Supports output formatting with `--output`, but only `table` and `json` are supported.s
### `device messages`
Get recent messages that a device has sent in to the platform.
Requires `--device` param or current device saved in `.vinlirc`. Supports output formatting with `--output`. Requires `app` and `secret`.
Pagination parameters for `device snapshots`:
* `--limit`
* `--since`
* `--until`
### `device vehicles`
Get a list of vehicles a devices has been in.
Supports output formatting with `--output`. Requires `app` and `secret`.
Requires `--device` param or current device saved in `.vinlirc`. Supports output formatting with `--output`. Requires `app` and `secret`.

@@ -165,0 +199,0 @@ Pagination parameters for `device snapshots`:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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