@ikonintegration/mod-auditing-client
v0.3.1
Published
Shared module auditing API client
Downloads
715
Readme
module-auditing-client
Auditing module nodejs API client
Overall
How to Use
import SMAuditing from '@ikonintegration/mod-auditing-client';
const API = new SMAuditing({
port: 9090, //isOptional
endpoint: SharedModules_AuditingEndpoint,
//Must be specified when using service routes
apiKey: config.examProvider.key, //API token on IDM.AppID format (generate from APIKey at https://runkit.com/gwdp/idm-appid-v1)
//Must be specified when using admin or user routes
authorizationToken: '', -- optional, IDM JWT for shared module admins -- Accepts a function to be called async and return the tokenroutes
namespace: ''
});
//Create audit trail
const resp = await API.trail.createTrail({
'userID': 'string',
'transactionDate': 'number',
'eventLevel': 'any',
'eventType': 'any',
//Optionals
'description': 'any?',
'eventData': 'any?',
//Externals IDs
'auditKey': 'any',
'auditSubKey': 'any?',
//Identifiers
'requesterID': 'string'
});
if (!resp || resp.statusCode != 200) {
return ERROR:
} return SUCCESS;
Headers
The following header must be specified in every request!
- Authorization
Available API methods
Trail:
- API.trail.createOrUpdateUser(userObj) - Admin and services
- API.trail.listTrailByID(trailID) - Admin and services
- API.trail.listTrailByIDs(trailID, trailSubID) - Admin and services
Client:
- API.client.createClient(clientName) - Admin only
- API.client.updateClient(clientName, clientID) - Admin only
- API.client.deleteClient(clientID) - Admin only
- API.client.getClient(clientID) - Admin only
- API.client.getAllClient() - Admin only