@p7m/alarm-backend
v0.3.0
Published
## API for generating and tracking alarms This is the API of what P7M mainly uses within the Telfas service.
Readme
@p7m/alarm-backend
AlarmBackend - JavaScript client for @p7m/alarm-backend
API for generating and tracking alarms
This is the API of what P7M mainly uses within the Telfas service. This SDK is automatically generated by the OpenAPI Generator project:
- API version: 0.3.0
- Package version: 0.3.0
- Generator version: 7.13.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install @p7m/alarm-backend --saveFinally, you need to build the module:
npm run buildLocal 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 installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkTo use the link you just defined in your project, switch to the directory you want to use your @p7m/alarm-backend from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>Finally, you need to build the module:
npm run buildgit
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 --saveFor 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.jsThen 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 AlarmBackend = require('@p7m/alarm-backend');
var defaultClient = AlarmBackend.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = "YOUR ACCESS TOKEN"
var api = new AlarmBackend.AlarmApi()
var alarmId = "alarmId_example"; // {String} ID of the alarm
api.deleteAlarmsId(alarmId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Documentation for API Endpoints
All URIs are relative to https://alarm.api.p7m.de/v1
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- AlarmBackend.AlarmApi | deleteAlarmsId | DELETE /alarms/{alarm_id} | Delete an alarm by its ID AlarmBackend.AlarmApi | deleteAlarmsRecipientsId | DELETE /alarms/{alarm_id}/recipients/{alarm_recipient_id} | Delete a single alarm recipient by its ID AlarmBackend.AlarmApi | getAlarms | GET /alarms | Get a list of all alarms AlarmBackend.AlarmApi | getAlarmsId | GET /alarms/{alarm_id} | Get a single alarm by its ID AlarmBackend.AlarmApi | getAlarmsRecipients | GET /alarms/{alarm_id}/recipients | Get the list of receipients of an alarm AlarmBackend.AlarmApi | getAlarmsRecipientsId | GET /alarms/{alarm_id}/recipients/{alarm_recipient_id} | Get a single recipient of an alarm by its ID AlarmBackend.AlarmApi | postAlarm | POST /alarms | Create a new alarm and by that trigger signalling AlarmBackend.AlarmApi | postAlarmRecipients | POST /alarms/{alarm_id}/recipients | Add a new recipient to an existing alarm AlarmBackend.AlarmApi | putAlarmsId | PUT /alarms/{alarm_id} | Update an existing alarm AlarmBackend.AlarmApi | putAlarmsRecipientsId | PUT /alarms/{alarm_id}/recipients/{alarm_recipient_id} | Update an existing recipient of an alarm AlarmBackend.AlarmTypeApi | deleteAlarmTypes | DELETE /alarmtypes/{id} | Delete a single alarm type by its ID AlarmBackend.AlarmTypeApi | getAlarmTypes | GET /alarmtypes | Get list of all alarm types AlarmBackend.AlarmTypeApi | getAlarmTypesId | GET /alarmtypes/{id} | Get a single alarm type by its ID AlarmBackend.AlarmTypeApi | postAlarmTypes | POST /alarmtypes | Create a new alarm type AlarmBackend.AlarmTypeApi | putAlarmTypes | PUT /alarmtypes/{id} | Update an existing alarm type AlarmBackend.RecipientApi | deleteRecipientsRecipientId | DELETE /recipients/{recipient_id} | Delete a single recipient by its ID AlarmBackend.RecipientApi | getRecipients | GET /recipients | Get the list of all recipients AlarmBackend.RecipientApi | getRecipientsRecipientId | GET /recipients/{recipient_id} | Get a single recipient by its ID AlarmBackend.RecipientApi | postRecipients | POST /recipients | Create a new recipient AlarmBackend.RecipientApi | putRecipientsRecipientId | PUT /recipients/{recipient_id} | Update an existing recipient
Documentation for Models
- AlarmBackend.Alarm
- AlarmBackend.AlarmConfirmation
- AlarmBackend.AlarmGuidance
- AlarmBackend.AlarmMedium
- AlarmBackend.AlarmRecipient
- AlarmBackend.AlarmType
- AlarmBackend.ListWrapperAlarm
- AlarmBackend.ListWrapperAlarmDataInner
- AlarmBackend.ListWrapperAlarmRecipient
- AlarmBackend.ListWrapperAlarmRecipientDataInner
- AlarmBackend.ListWrapperAlarmType
- AlarmBackend.ListWrapperAlarmTypeDataInner
- AlarmBackend.ListWrapperRecipient
- AlarmBackend.ListWrapperRecipientDataInner
- AlarmBackend.NewAlarm
- AlarmBackend.NewAlarmRecipient
- AlarmBackend.NewAlarmType
- AlarmBackend.NewRecipient
- AlarmBackend.Recipient
Documentation for Authorization
Authentication schemes defined for the API:
oauth
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://login.p7m.de/auth/authorize
- Scopes: N/A
