Skip to content

Latest commit

 

History

History
324 lines (277 loc) · 26.7 KB

README.md

File metadata and controls

324 lines (277 loc) · 26.7 KB

@blues-inc/notehub-js

NotehubJs - JavaScript client for @blues-inc/notehub-js The OpenAPI definition for the Notehub.io API.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.2.0
  • Package version: 1.0.27
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://dev.blues.io/support/

Installation

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @blues-inc/notehub-js --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your @blues-inc/notehub-js from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false,
      },
    },
  ];
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var NotehubJs = require('@blues-inc/notehub-js');

var defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"

var api = new NotehubJs.AlertApi()
var projectUID = app:2606f411-dea6-44a0-9743-1130f57d77d8; // {String}
var opts = {
  'pageSize': 50, // {Number}
  'pageNum': 1, // {Number}
  'monitorUID': "monitorUID_example" // {String}
};
api.getAlerts(projectUID, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.notefile.net

Class Method HTTP request Description
NotehubJs.AlertApi getAlerts GET /v1/projects/{projectUID}/alerts
NotehubJs.AuthorizationApi login POST /auth/login
NotehubJs.BillingAccountApi getBillingAccounts GET /v1/billing-accounts
NotehubJs.DeviceApi deleteDeviceEnvironmentVariable DELETE /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/{key}
NotehubJs.DeviceApi deleteProjectDevice DELETE /v1/projects/{projectUID}/devices/{deviceUID}
NotehubJs.DeviceApi disableDevice POST /v1/projects/{projectUID}/devices/{deviceUID}/disable
NotehubJs.DeviceApi disableDeviceConnectivityAssurance POST /v1/projects/{projectUID}/devices/{deviceUID}/disable-connectivity-assurance
NotehubJs.DeviceApi enableDevice POST /v1/projects/{projectUID}/devices/{deviceUID}/enable
NotehubJs.DeviceApi enableDeviceConnectivityAssurance POST /v1/projects/{projectUID}/devices/{deviceUID}/enable-connectivity-assurance
NotehubJs.DeviceApi getDevice GET /v1/projects/{projectUID}/devices/{deviceUID}
NotehubJs.DeviceApi getDeviceEnvironmentVariables GET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
NotehubJs.DeviceApi getDeviceEnvironmentVariablesByPin GET /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin
NotehubJs.DeviceApi getDeviceHealthLog GET /v1/projects/{projectUID}/devices/{deviceUID}/health-log
NotehubJs.DeviceApi getDeviceLatest GET /v1/projects/{projectUID}/devices/{deviceUID}/latest
NotehubJs.DeviceApi getDevicePublicKey GET /v1/projects/{projectUID}/devices/{deviceUID}/public-key
NotehubJs.DeviceApi getDeviceSessions GET /v1/projects/{projectUID}/devices/{deviceUID}/sessions
NotehubJs.DeviceApi getProjectDevicePublicKeys GET /v1/projects/{projectUID}/devices/public-keys
NotehubJs.DeviceApi getProjectDevices GET /v1/projects/{projectUID}/devices
NotehubJs.DeviceApi getProjectFleetDevices GET /v1/projects/{projectUID}/fleets/{fleetUID}/devices
NotehubJs.DeviceApi handleNoteAdd POST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}
NotehubJs.DeviceApi handleNoteChanges GET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/changes
NotehubJs.DeviceApi handleNoteCreateAdd POST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
NotehubJs.DeviceApi handleNoteDelete DELETE /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
NotehubJs.DeviceApi handleNoteGet GET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
NotehubJs.DeviceApi handleNoteSignal POST /v1/projects/{projectUID}/devices/{deviceUID}/signal
NotehubJs.DeviceApi handleNoteUpdate PUT /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
NotehubJs.DeviceApi handleNotefileChanges GET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes
NotehubJs.DeviceApi handleNotefileChangesPending GET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes/pending
NotehubJs.DeviceApi handleNotefileDelete DELETE /v1/projects/{projectUID}/devices/{deviceUID}/files
NotehubJs.DeviceApi postProvisionProjectDevice POST /v1/projects/{projectUID}/devices/{deviceUID}/provision
NotehubJs.DeviceApi putDeviceEnvironmentVariables PUT /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
NotehubJs.DeviceApi putDeviceEnvironmentVariablesByPin PUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin
NotehubJs.EventApi getFleetEvents GET /v1/projects/{projectUID}/fleets/{fleetUID}/events
NotehubJs.EventApi getFleetEventsByCursor GET /v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor
NotehubJs.EventApi getProjectEvents GET /v1/projects/{projectUID}/events
NotehubJs.EventApi getProjectEventsByCursor GET /v1/projects/{projectUID}/events-cursor
NotehubJs.EventApi getRouteLogsByEvent GET /v1/projects/{projectUID}/events/{eventUID}/route-logs
NotehubJs.MonitorApi createMonitor POST /v1/projects/{projectUID}/monitors
NotehubJs.MonitorApi deleteMonitor DELETE /v1/projects/{projectUID}/monitors/{monitorUID}
NotehubJs.MonitorApi getMonitor GET /v1/projects/{projectUID}/monitors/{monitorUID}
NotehubJs.MonitorApi getMonitors GET /v1/projects/{projectUID}/monitors
NotehubJs.MonitorApi updateMonitor PUT /v1/projects/{projectUID}/monitors/{monitorUID}
NotehubJs.ProjectApi cloneProject POST /v1/projects/{projectUID}/clone
NotehubJs.ProjectApi createFleet POST /v1/projects/{projectUID}/fleets
NotehubJs.ProjectApi createProduct POST /v1/projects/{projectUID}/products
NotehubJs.ProjectApi createProject POST /v1/projects
NotehubJs.ProjectApi deleteDeviceFleets DELETE /v1/projects/{projectUID}/devices/{deviceUID}/fleets
NotehubJs.ProjectApi deleteFleet DELETE /v1/projects/{projectUID}/fleets/{fleetUID}
NotehubJs.ProjectApi deleteFleetEnvironmentVariable DELETE /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key}
NotehubJs.ProjectApi deleteProject DELETE /v1/projects/{projectUID}
NotehubJs.ProjectApi deleteProjectEnvironmentVariable DELETE /v1/projects/{projectUID}/environment_variables/{key}
NotehubJs.ProjectApi dfuAction POST /v1/projects/{projectUID}/dfu/{firmwareType}/{action}
NotehubJs.ProjectApi disableGlobalTransformation POST /v1/projects/{projectUID}/global-transformation/disable
NotehubJs.ProjectApi enableGlobalTransformation POST /v1/projects/{projectUID}/global-transformation/enable
NotehubJs.ProjectApi getDeviceDfuHistory GET /v1/projects/{projectUID}/devices/{deviceUID}/dfu/{firmwareType}/history
NotehubJs.ProjectApi getDeviceDfuStatus GET /v1/projects/{projectUID}/devices/{deviceUID}/dfu/{firmwareType}/status
NotehubJs.ProjectApi getDeviceFleets GET /v1/projects/{projectUID}/devices/{deviceUID}/fleets
NotehubJs.ProjectApi getDevicesDfuHistory GET /v1/projects/{projectUID}/dfu/{firmwareType}/history
NotehubJs.ProjectApi getDevicesDfuStatus GET /v1/projects/{projectUID}/dfu/{firmwareType}/status
NotehubJs.ProjectApi getFirmwareInfo GET /v1/projects/{projectUID}/firmware
NotehubJs.ProjectApi getFleet GET /v1/projects/{projectUID}/fleets/{fleetUID}
NotehubJs.ProjectApi getFleetEnvironmentVariables GET /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables
NotehubJs.ProjectApi getProject GET /v1/projects/{projectUID}
NotehubJs.ProjectApi getProjectByProduct GET /v1/products/{productUID}/project
NotehubJs.ProjectApi getProjectEnvironmentVariables GET /v1/projects/{projectUID}/environment_variables
NotehubJs.ProjectApi getProjectFleets GET /v1/projects/{projectUID}/fleets
NotehubJs.ProjectApi getProjectMembers GET /v1/projects/{projectUID}/members
NotehubJs.ProjectApi getProjectProducts GET /v1/projects/{projectUID}/products
NotehubJs.ProjectApi getProjects GET /v1/projects
NotehubJs.ProjectApi putDeviceFleets PUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets
NotehubJs.ProjectApi putFleetEnvironmentVariables PUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables
NotehubJs.ProjectApi putProjectEnvironmentVariables PUT /v1/projects/{projectUID}/environment_variables
NotehubJs.ProjectApi setGlobalTransformation POST /v1/projects/{projectUID}/global-transformation
NotehubJs.ProjectApi updateFleet PUT /v1/projects/{projectUID}/fleets/{fleetUID}
NotehubJs.RouteApi createRoute POST /v1/projects/{projectUID}/routes
NotehubJs.RouteApi deleteRoute DELETE /v1/projects/{projectUID}/routes/{routeUID}
NotehubJs.RouteApi getRoute GET /v1/projects/{projectUID}/routes/{routeUID}
NotehubJs.RouteApi getRouteLogsByRoute GET /v1/projects/{projectUID}/routes/{routeUID}/route-logs
NotehubJs.RouteApi getRoutes GET /v1/projects/{projectUID}/routes
NotehubJs.RouteApi updateRoute PUT /v1/projects/{projectUID}/routes/{routeUID}

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: X-Session-Token
  • Location: HTTP header

pin

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header