@shieldiot/pulse-lib 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/lib/index.js +0 -1
- package/dist/cjs/lib/pulse-client.js +25 -29
- package/dist/cjs/lib/services/supportStreamAnalyticsConfig.js +3 -3
- package/dist/cjs/lib/services/sysAccountsService.js +3 -3
- package/dist/cjs/lib/services/sysAuditLogService.js +3 -3
- package/dist/cjs/lib/services/sysCheckpointsService.js +3 -3
- package/dist/cjs/lib/services/sysConfigService.js +3 -3
- package/dist/cjs/lib/services/sysFeaturesService.js +3 -3
- package/dist/cjs/lib/services/sysGroupsService.js +3 -3
- package/dist/cjs/lib/services/sysInsightsService.js +3 -3
- package/dist/cjs/lib/services/sysKeysService.js +3 -3
- package/dist/cjs/lib/services/sysMembersService.js +3 -3
- package/dist/cjs/lib/services/sysRuleTemplatesService.js +3 -3
- package/dist/cjs/lib/services/sysRulesService.js +3 -3
- package/dist/cjs/lib/services/sysStatisticsService.js +3 -3
- package/dist/cjs/lib/services/sysStreamsService.js +3 -3
- package/dist/cjs/lib/services/sysUsersService.js +3 -3
- package/dist/cjs/lib/services/usrAlertsService.js +3 -3
- package/dist/cjs/lib/services/usrDevicesService.js +3 -3
- package/dist/cjs/lib/services/usrEventsService.js +3 -3
- package/dist/cjs/lib/services/usrInsightsService.js +3 -3
- package/dist/cjs/lib/services/usrIntegrationsService.js +3 -3
- package/dist/cjs/lib/services/usrMembersService.js +3 -3
- package/dist/cjs/lib/services/usrNetworkService.js +3 -3
- package/dist/cjs/lib/services/usrReportsService.js +3 -3
- package/dist/cjs/lib/services/usrRulesService.js +3 -3
- package/dist/cjs/lib/services/usrUserService.js +3 -3
- package/dist/esm/index.js +0 -1
- package/dist/esm/lib/index.js +0 -1
- package/dist/esm/lib/pulse-client.js +31 -35
- package/dist/esm/lib/services/supportStreamAnalyticsConfig.js +3 -3
- package/dist/esm/lib/services/sysAccountsService.js +3 -3
- package/dist/esm/lib/services/sysAuditLogService.js +3 -3
- package/dist/esm/lib/services/sysCheckpointsService.js +3 -3
- package/dist/esm/lib/services/sysConfigService.js +3 -3
- package/dist/esm/lib/services/sysFeaturesService.js +3 -3
- package/dist/esm/lib/services/sysGroupsService.js +3 -3
- package/dist/esm/lib/services/sysInsightsService.js +3 -3
- package/dist/esm/lib/services/sysKeysService.js +3 -3
- package/dist/esm/lib/services/sysMembersService.js +3 -3
- package/dist/esm/lib/services/sysRuleTemplatesService.js +3 -3
- package/dist/esm/lib/services/sysRulesService.js +3 -3
- package/dist/esm/lib/services/sysStatisticsService.js +3 -3
- package/dist/esm/lib/services/sysStreamsService.js +3 -3
- package/dist/esm/lib/services/sysUsersService.js +3 -3
- package/dist/esm/lib/services/usrAlertsService.js +3 -3
- package/dist/esm/lib/services/usrDevicesService.js +3 -3
- package/dist/esm/lib/services/usrEventsService.js +3 -3
- package/dist/esm/lib/services/usrInsightsService.js +3 -3
- package/dist/esm/lib/services/usrIntegrationsService.js +3 -3
- package/dist/esm/lib/services/usrMembersService.js +3 -3
- package/dist/esm/lib/services/usrNetworkService.js +3 -3
- package/dist/esm/lib/services/usrReportsService.js +3 -3
- package/dist/esm/lib/services/usrRulesService.js +3 -3
- package/dist/esm/lib/services/usrUserService.js +3 -3
- package/dist/types/index.d.ts +0 -1
- package/dist/types/lib/common/TokenData.d.ts +1 -1
- package/dist/types/lib/entities/Account.d.ts +2 -2
- package/dist/types/lib/entities/Action.d.ts +1 -1
- package/dist/types/lib/entities/Alert.d.ts +5 -5
- package/dist/types/lib/entities/AlertWithDevice.d.ts +7 -7
- package/dist/types/lib/entities/Device.d.ts +2 -2
- package/dist/types/lib/entities/DeviceWithEvents.d.ts +3 -3
- package/dist/types/lib/entities/Event.d.ts +4 -4
- package/dist/types/lib/entities/EventWithDevice.d.ts +6 -6
- package/dist/types/lib/entities/Insight.d.ts +2 -2
- package/dist/types/lib/entities/Integration.d.ts +3 -3
- package/dist/types/lib/entities/Radius.d.ts +1 -1
- package/dist/types/lib/entities/Rule.d.ts +3 -3
- package/dist/types/lib/entities/RuleTemplate.d.ts +1 -1
- package/dist/types/lib/entities/User.d.ts +2 -2
- package/dist/types/lib/entities/UserMembership.d.ts +1 -1
- package/dist/types/lib/entities/UserMemberships.d.ts +1 -1
- package/dist/types/lib/index.d.ts +0 -1
- package/dist/types/lib/pulse-client.d.ts +13 -14
- package/dist/types/lib/services/supportStreamAnalyticsConfig.d.ts +2 -3
- package/dist/types/lib/services/sysAccountsService.d.ts +2 -3
- package/dist/types/lib/services/sysAuditLogService.d.ts +2 -3
- package/dist/types/lib/services/sysCheckpointsService.d.ts +2 -3
- package/dist/types/lib/services/sysConfigService.d.ts +2 -3
- package/dist/types/lib/services/sysFeaturesService.d.ts +3 -4
- package/dist/types/lib/services/sysGroupsService.d.ts +2 -3
- package/dist/types/lib/services/sysInsightsService.d.ts +2 -3
- package/dist/types/lib/services/sysKeysService.d.ts +2 -3
- package/dist/types/lib/services/sysMembersService.d.ts +2 -3
- package/dist/types/lib/services/sysRuleTemplatesService.d.ts +2 -3
- package/dist/types/lib/services/sysRulesService.d.ts +2 -3
- package/dist/types/lib/services/sysStatisticsService.d.ts +2 -3
- package/dist/types/lib/services/sysStreamsService.d.ts +2 -3
- package/dist/types/lib/services/sysUsersService.d.ts +2 -3
- package/dist/types/lib/services/usrAlertsService.d.ts +11 -12
- package/dist/types/lib/services/usrDevicesService.d.ts +9 -10
- package/dist/types/lib/services/usrEventsService.d.ts +10 -11
- package/dist/types/lib/services/usrInsightsService.d.ts +2 -3
- package/dist/types/lib/services/usrIntegrationsService.d.ts +2 -3
- package/dist/types/lib/services/usrMembersService.d.ts +2 -3
- package/dist/types/lib/services/usrNetworkService.d.ts +2 -3
- package/dist/types/lib/services/usrReportsService.d.ts +2 -3
- package/dist/types/lib/services/usrRulesService.d.ts +4 -5
- package/dist/types/lib/services/usrUserService.d.ts +4 -5
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/config.js +0 -11
- package/dist/esm/config.js +0 -7
- package/dist/types/config.d.ts +0 -5
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Pulse IoT client library
|
|
2
2
|
|
|
3
|
-
This package is a typescript client library for the pulse IoT API
|
|
3
|
+
This package is a typescript client library for the pulse IoT API.
|
|
4
|
+
The library includes all the types and services exposed the the pulse API.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Install
|
|
6
7
|
|
|
7
8
|
Install dependencies:
|
|
8
9
|
`npm i`
|
|
@@ -20,7 +21,12 @@ let pc = new PulseClient("https://your-pulse-api-endpoint", "your-api-key", "you
|
|
|
20
21
|
pc.UsrRulesService.find("streamId").pipe();
|
|
21
22
|
|
|
22
23
|
```
|
|
24
|
+
The apiKey and accessToken parameters in the PulseClient constructor are optional since
|
|
25
|
+
it is recomended to use HTTP interceptors to inject the API key and access token instead of constructor injection.
|
|
26
|
+
|
|
27
|
+
The use of interceptor is better since for any API response, the response header includes new access toekn with
|
|
28
|
+
new expiration time. Using the same token without refreshing it will eventually result access denied error after the expiration time of the original token (30 minutes).
|
|
29
|
+
The use of constructor injection of access token is recomended for non-expired tokens only (system-to-system integration).
|
|
23
30
|
|
|
24
|
-
It is recomended to use HTTP interceptors to inject the API key and access token
|
|
25
31
|
|
|
26
32
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./config"), exports);
|
|
18
17
|
__exportStar(require("./utils"), exports);
|
|
19
18
|
__exportStar(require("./lib"), exports);
|
|
20
19
|
__exportStar(require("./lib/pulse-client"), exports);
|
package/dist/cjs/lib/index.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PulseClient = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const config_1 = require("../config");
|
|
9
8
|
const utils_1 = require("../utils");
|
|
10
9
|
const services_1 = require("./services");
|
|
11
10
|
const services_2 = require("./services");
|
|
@@ -38,9 +37,6 @@ const services_25 = require("./services");
|
|
|
38
37
|
class PulseClient {
|
|
39
38
|
// Constructor
|
|
40
39
|
constructor(apiUrl, apiKey, accessToken) {
|
|
41
|
-
this.config = new config_1.PulseConfig();
|
|
42
|
-
this.config.api = apiUrl;
|
|
43
|
-
this.config.apiKey = apiKey;
|
|
44
40
|
// Set axios config
|
|
45
41
|
let axiosRequestConfiguration = {
|
|
46
42
|
baseURL: apiUrl,
|
|
@@ -55,31 +51,31 @@ class PulseClient {
|
|
|
55
51
|
this.axiosInst = axios_1.default.create(axiosRequestConfiguration);
|
|
56
52
|
this.restSvc = new utils_1.RestUtil(this.axiosInst);
|
|
57
53
|
// initialize services
|
|
58
|
-
this.
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
80
|
-
this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
54
|
+
this.UsrAlertsService = new services_1.UsrAlertsService(apiUrl, this.restSvc);
|
|
55
|
+
this.UsrDevicesService = new services_2.UsrDevicesService(apiUrl, this.restSvc);
|
|
56
|
+
this.UsrEventsService = new services_3.UsrEventsService(apiUrl, this.restSvc);
|
|
57
|
+
this.UsrNetworkService = new services_4.UsrNetworkService(apiUrl, this.restSvc);
|
|
58
|
+
this.UsrReportsService = new services_5.UsrReportsService(apiUrl, this.restSvc);
|
|
59
|
+
this.UsrRulesService = new services_6.UsrRulesService(apiUrl, this.restSvc);
|
|
60
|
+
this.SupportStreamAnalyticsConfig = new services_7.SupportStreamAnalyticsConfig(apiUrl, this.restSvc);
|
|
61
|
+
this.SysAccountsService = new services_8.SysAccountsService(apiUrl, this.restSvc);
|
|
62
|
+
this.SysAuditLogService = new services_9.SysAuditLogService(apiUrl, this.restSvc);
|
|
63
|
+
this.SysCheckpointsService = new services_10.SysCheckpointsService(apiUrl, this.restSvc);
|
|
64
|
+
this.SysConfigService = new services_11.SysConfigService(apiUrl, this.restSvc);
|
|
65
|
+
this.SysFeaturesService = new services_12.SysFeaturesService(apiUrl, this.restSvc);
|
|
66
|
+
this.SysGroupsService = new services_13.SysGroupsService(apiUrl, this.restSvc);
|
|
67
|
+
this.SysInsightsService = new services_14.SysInsightsService(apiUrl, this.restSvc);
|
|
68
|
+
this.SysKeysService = new services_15.SysKeysService(apiUrl, this.restSvc);
|
|
69
|
+
this.SysMembersService = new services_16.SysMembersService(apiUrl, this.restSvc);
|
|
70
|
+
this.SysRuleTemplatesService = new services_17.SysRuleTemplatesService(apiUrl, this.restSvc);
|
|
71
|
+
this.SysRulesService = new services_18.SysRulesService(apiUrl, this.restSvc);
|
|
72
|
+
this.SysStatisticsService = new services_19.SysStatisticsService(apiUrl, this.restSvc);
|
|
73
|
+
this.SysStreamsService = new services_20.SysStreamsService(apiUrl, this.restSvc);
|
|
74
|
+
this.SysUsersService = new services_21.SysUsersService(apiUrl, this.restSvc);
|
|
75
|
+
this.UsrInsightsService = new services_22.UsrInsightsService(apiUrl, this.restSvc);
|
|
76
|
+
this.UsrIntegrationsService = new services_23.UsrIntegrationsService(apiUrl, this.restSvc);
|
|
77
|
+
this.UsrMembersService = new services_24.UsrMembersService(apiUrl, this.restSvc);
|
|
78
|
+
this.UsrUserService = new services_25.UsrUserService(apiUrl, this.restSvc);
|
|
83
79
|
}
|
|
84
80
|
}
|
|
85
81
|
exports.PulseClient = PulseClient;
|
|
@@ -6,12 +6,12 @@ exports.SupportStreamAnalyticsConfig = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SupportStreamAnalyticsConfig {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/support/stream-analytics-config';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new stream analytics configuration
|
|
@@ -6,12 +6,12 @@ exports.SysAccountsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysAccountsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/accounts';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new account
|
|
@@ -6,12 +6,12 @@ exports.SysAuditLogService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysAuditLogService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/audit-log';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Get single log entry by id
|
|
@@ -6,12 +6,12 @@ exports.SysCheckpointsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysCheckpointsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/checkpoints';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Get a single checkpoint entry by id
|
|
@@ -6,12 +6,12 @@ exports.SysConfigService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysConfigService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/config';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new configuration parameter
|
|
@@ -6,12 +6,12 @@ exports.SysFeaturesService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysFeaturesService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/features';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Find list of feature
|
|
@@ -6,12 +6,12 @@ exports.SysGroupsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysGroupsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/groups';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new groups
|
|
@@ -6,12 +6,12 @@ exports.SysInsightsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysInsightsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/insights';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new insight query
|
|
@@ -6,12 +6,12 @@ exports.SysKeysService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysKeysService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/keys';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new API key
|
|
@@ -6,12 +6,12 @@ exports.SysMembersService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysMembersService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/members';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new member
|
|
@@ -6,12 +6,12 @@ exports.SysRuleTemplatesService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysRuleTemplatesService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/rule-templates';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new rule template
|
|
@@ -6,12 +6,12 @@ exports.SysRulesService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysRulesService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/rules';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new rule
|
|
@@ -6,12 +6,12 @@ exports.SysStatisticsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysStatisticsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/statistics';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Get accounts distribution by field
|
|
@@ -6,12 +6,12 @@ exports.SysStreamsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysStreamsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/streams';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new stream
|
|
@@ -6,12 +6,12 @@ exports.SysUsersService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class SysUsersService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/sys/users';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new user
|
|
@@ -6,12 +6,12 @@ exports.UsrAlertsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrAlertsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/alerts';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Get single alert by id
|
|
@@ -6,12 +6,12 @@ exports.UsrDevicesService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrDevicesService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/devices';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new device
|
|
@@ -6,12 +6,12 @@ exports.UsrEventsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrEventsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/events';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Get single event by id
|
|
@@ -6,12 +6,12 @@ exports.UsrInsightsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrInsightsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/insights';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Find list of insights by day
|
|
@@ -6,12 +6,12 @@ exports.UsrIntegrationsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrIntegrationsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/integrations';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new integration
|
|
@@ -6,12 +6,12 @@ exports.UsrMembersService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrMembersService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/members';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new member
|
|
@@ -6,12 +6,12 @@ exports.UsrNetworkService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrNetworkService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/network';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Find list of usage records by query
|
|
@@ -6,12 +6,12 @@ exports.UsrReportsService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrReportsService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/reports';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new report
|
|
@@ -6,12 +6,12 @@ exports.UsrRulesService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrRulesService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/rules';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Create new rule
|
|
@@ -6,12 +6,12 @@ exports.UsrUserService = void 0;
|
|
|
6
6
|
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
7
7
|
class UsrUserService {
|
|
8
8
|
// Class constructor
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(apiUrl, rest) {
|
|
10
|
+
this.apiUrl = apiUrl;
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
// URL to web api
|
|
13
13
|
this.baseUrl = '/user';
|
|
14
|
-
this.baseUrl =
|
|
14
|
+
this.baseUrl = apiUrl + this.baseUrl;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Authorize user, verify user exists in the system (user was already authenticated by OAuth provider)
|
package/dist/esm/index.js
CHANGED
package/dist/esm/lib/index.js
CHANGED