@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.
Files changed (107) hide show
  1. package/README.md +9 -3
  2. package/dist/cjs/index.js +0 -1
  3. package/dist/cjs/lib/index.js +0 -1
  4. package/dist/cjs/lib/pulse-client.js +25 -29
  5. package/dist/cjs/lib/services/supportStreamAnalyticsConfig.js +3 -3
  6. package/dist/cjs/lib/services/sysAccountsService.js +3 -3
  7. package/dist/cjs/lib/services/sysAuditLogService.js +3 -3
  8. package/dist/cjs/lib/services/sysCheckpointsService.js +3 -3
  9. package/dist/cjs/lib/services/sysConfigService.js +3 -3
  10. package/dist/cjs/lib/services/sysFeaturesService.js +3 -3
  11. package/dist/cjs/lib/services/sysGroupsService.js +3 -3
  12. package/dist/cjs/lib/services/sysInsightsService.js +3 -3
  13. package/dist/cjs/lib/services/sysKeysService.js +3 -3
  14. package/dist/cjs/lib/services/sysMembersService.js +3 -3
  15. package/dist/cjs/lib/services/sysRuleTemplatesService.js +3 -3
  16. package/dist/cjs/lib/services/sysRulesService.js +3 -3
  17. package/dist/cjs/lib/services/sysStatisticsService.js +3 -3
  18. package/dist/cjs/lib/services/sysStreamsService.js +3 -3
  19. package/dist/cjs/lib/services/sysUsersService.js +3 -3
  20. package/dist/cjs/lib/services/usrAlertsService.js +3 -3
  21. package/dist/cjs/lib/services/usrDevicesService.js +3 -3
  22. package/dist/cjs/lib/services/usrEventsService.js +3 -3
  23. package/dist/cjs/lib/services/usrInsightsService.js +3 -3
  24. package/dist/cjs/lib/services/usrIntegrationsService.js +3 -3
  25. package/dist/cjs/lib/services/usrMembersService.js +3 -3
  26. package/dist/cjs/lib/services/usrNetworkService.js +3 -3
  27. package/dist/cjs/lib/services/usrReportsService.js +3 -3
  28. package/dist/cjs/lib/services/usrRulesService.js +3 -3
  29. package/dist/cjs/lib/services/usrUserService.js +3 -3
  30. package/dist/esm/index.js +0 -1
  31. package/dist/esm/lib/index.js +0 -1
  32. package/dist/esm/lib/pulse-client.js +31 -35
  33. package/dist/esm/lib/services/supportStreamAnalyticsConfig.js +3 -3
  34. package/dist/esm/lib/services/sysAccountsService.js +3 -3
  35. package/dist/esm/lib/services/sysAuditLogService.js +3 -3
  36. package/dist/esm/lib/services/sysCheckpointsService.js +3 -3
  37. package/dist/esm/lib/services/sysConfigService.js +3 -3
  38. package/dist/esm/lib/services/sysFeaturesService.js +3 -3
  39. package/dist/esm/lib/services/sysGroupsService.js +3 -3
  40. package/dist/esm/lib/services/sysInsightsService.js +3 -3
  41. package/dist/esm/lib/services/sysKeysService.js +3 -3
  42. package/dist/esm/lib/services/sysMembersService.js +3 -3
  43. package/dist/esm/lib/services/sysRuleTemplatesService.js +3 -3
  44. package/dist/esm/lib/services/sysRulesService.js +3 -3
  45. package/dist/esm/lib/services/sysStatisticsService.js +3 -3
  46. package/dist/esm/lib/services/sysStreamsService.js +3 -3
  47. package/dist/esm/lib/services/sysUsersService.js +3 -3
  48. package/dist/esm/lib/services/usrAlertsService.js +3 -3
  49. package/dist/esm/lib/services/usrDevicesService.js +3 -3
  50. package/dist/esm/lib/services/usrEventsService.js +3 -3
  51. package/dist/esm/lib/services/usrInsightsService.js +3 -3
  52. package/dist/esm/lib/services/usrIntegrationsService.js +3 -3
  53. package/dist/esm/lib/services/usrMembersService.js +3 -3
  54. package/dist/esm/lib/services/usrNetworkService.js +3 -3
  55. package/dist/esm/lib/services/usrReportsService.js +3 -3
  56. package/dist/esm/lib/services/usrRulesService.js +3 -3
  57. package/dist/esm/lib/services/usrUserService.js +3 -3
  58. package/dist/types/index.d.ts +0 -1
  59. package/dist/types/lib/common/TokenData.d.ts +1 -1
  60. package/dist/types/lib/entities/Account.d.ts +2 -2
  61. package/dist/types/lib/entities/Action.d.ts +1 -1
  62. package/dist/types/lib/entities/Alert.d.ts +5 -5
  63. package/dist/types/lib/entities/AlertWithDevice.d.ts +7 -7
  64. package/dist/types/lib/entities/Device.d.ts +2 -2
  65. package/dist/types/lib/entities/DeviceWithEvents.d.ts +3 -3
  66. package/dist/types/lib/entities/Event.d.ts +4 -4
  67. package/dist/types/lib/entities/EventWithDevice.d.ts +6 -6
  68. package/dist/types/lib/entities/Insight.d.ts +2 -2
  69. package/dist/types/lib/entities/Integration.d.ts +3 -3
  70. package/dist/types/lib/entities/Radius.d.ts +1 -1
  71. package/dist/types/lib/entities/Rule.d.ts +3 -3
  72. package/dist/types/lib/entities/RuleTemplate.d.ts +1 -1
  73. package/dist/types/lib/entities/User.d.ts +2 -2
  74. package/dist/types/lib/entities/UserMembership.d.ts +1 -1
  75. package/dist/types/lib/entities/UserMemberships.d.ts +1 -1
  76. package/dist/types/lib/index.d.ts +0 -1
  77. package/dist/types/lib/pulse-client.d.ts +13 -14
  78. package/dist/types/lib/services/supportStreamAnalyticsConfig.d.ts +2 -3
  79. package/dist/types/lib/services/sysAccountsService.d.ts +2 -3
  80. package/dist/types/lib/services/sysAuditLogService.d.ts +2 -3
  81. package/dist/types/lib/services/sysCheckpointsService.d.ts +2 -3
  82. package/dist/types/lib/services/sysConfigService.d.ts +2 -3
  83. package/dist/types/lib/services/sysFeaturesService.d.ts +3 -4
  84. package/dist/types/lib/services/sysGroupsService.d.ts +2 -3
  85. package/dist/types/lib/services/sysInsightsService.d.ts +2 -3
  86. package/dist/types/lib/services/sysKeysService.d.ts +2 -3
  87. package/dist/types/lib/services/sysMembersService.d.ts +2 -3
  88. package/dist/types/lib/services/sysRuleTemplatesService.d.ts +2 -3
  89. package/dist/types/lib/services/sysRulesService.d.ts +2 -3
  90. package/dist/types/lib/services/sysStatisticsService.d.ts +2 -3
  91. package/dist/types/lib/services/sysStreamsService.d.ts +2 -3
  92. package/dist/types/lib/services/sysUsersService.d.ts +2 -3
  93. package/dist/types/lib/services/usrAlertsService.d.ts +11 -12
  94. package/dist/types/lib/services/usrDevicesService.d.ts +9 -10
  95. package/dist/types/lib/services/usrEventsService.d.ts +10 -11
  96. package/dist/types/lib/services/usrInsightsService.d.ts +2 -3
  97. package/dist/types/lib/services/usrIntegrationsService.d.ts +2 -3
  98. package/dist/types/lib/services/usrMembersService.d.ts +2 -3
  99. package/dist/types/lib/services/usrNetworkService.d.ts +2 -3
  100. package/dist/types/lib/services/usrReportsService.d.ts +2 -3
  101. package/dist/types/lib/services/usrRulesService.d.ts +4 -5
  102. package/dist/types/lib/services/usrUserService.d.ts +4 -5
  103. package/dist/umd/index.js +1 -1
  104. package/package.json +1 -1
  105. package/dist/cjs/config.js +0 -11
  106. package/dist/esm/config.js +0 -7
  107. package/dist/types/config.d.ts +0 -5
@@ -1,6 +1,11 @@
1
1
  import axios from 'axios';
2
- import { PulseConfig } from "../config";
3
2
  import { RestUtil } from "../utils";
3
+ import { UsrAlertsService } from "./services";
4
+ import { UsrDevicesService } from "./services";
5
+ import { UsrEventsService } from "./services";
6
+ import { UsrNetworkService } from "./services";
7
+ import { UsrReportsService } from "./services";
8
+ import { UsrRulesService } from "./services";
4
9
  import { SupportStreamAnalyticsConfig } from "./services";
5
10
  import { SysAccountsService } from "./services";
6
11
  import { SysAuditLogService } from "./services";
@@ -20,21 +25,12 @@ import { UsrInsightsService } from "./services";
20
25
  import { UsrIntegrationsService } from "./services";
21
26
  import { UsrMembersService } from "./services";
22
27
  import { UsrUserService } from "./services";
23
- import { UsrAlertsService } from "./services";
24
- import { UsrDevicesService } from "./services";
25
- import { UsrEventsService } from "./services";
26
- import { UsrNetworkService } from "./services";
27
- import { UsrReportsService } from "./services";
28
- import { UsrRulesService } from "./services";
29
28
  // PulseClient is the main entry point of the client library.
30
29
  // Create a single global instance of PulseClient in your application and use
31
30
  // Factory methods to get service endpoints
32
31
  export class PulseClient {
33
32
  // Constructor
34
33
  constructor(apiUrl, apiKey, accessToken) {
35
- this.config = new PulseConfig();
36
- this.config.api = apiUrl;
37
- this.config.apiKey = apiKey;
38
34
  // Set axios config
39
35
  let axiosRequestConfiguration = {
40
36
  baseURL: apiUrl,
@@ -49,30 +45,30 @@ export class PulseClient {
49
45
  this.axiosInst = axios.create(axiosRequestConfiguration);
50
46
  this.restSvc = new RestUtil(this.axiosInst);
51
47
  // initialize services
52
- this.SupportStreamAnalyticsConfig = new SupportStreamAnalyticsConfig(this.config, this.restSvc);
53
- this.SysAccountsService = new SysAccountsService(this.config, this.restSvc);
54
- this.SysAuditLogService = new SysAuditLogService(this.config, this.restSvc);
55
- this.SysCheckpointsService = new SysCheckpointsService(this.config, this.restSvc);
56
- this.SysConfigService = new SysConfigService(this.config, this.restSvc);
57
- this.SysFeaturesService = new SysFeaturesService(this.config, this.restSvc);
58
- this.SysGroupsService = new SysGroupsService(this.config, this.restSvc);
59
- this.SysInsightsService = new SysInsightsService(this.config, this.restSvc);
60
- this.SysKeysService = new SysKeysService(this.config, this.restSvc);
61
- this.SysMembersService = new SysMembersService(this.config, this.restSvc);
62
- this.SysRuleTemplatesService = new SysRuleTemplatesService(this.config, this.restSvc);
63
- this.SysRulesService = new SysRulesService(this.config, this.restSvc);
64
- this.SysStatisticsService = new SysStatisticsService(this.config, this.restSvc);
65
- this.SysStreamsService = new SysStreamsService(this.config, this.restSvc);
66
- this.SysUsersService = new SysUsersService(this.config, this.restSvc);
67
- this.UsrInsightsService = new UsrInsightsService(this.config, this.restSvc);
68
- this.UsrIntegrationsService = new UsrIntegrationsService(this.config, this.restSvc);
69
- this.UsrMembersService = new UsrMembersService(this.config, this.restSvc);
70
- this.UsrUserService = new UsrUserService(this.config, this.restSvc);
71
- this.UsrAlertsService = new UsrAlertsService(this.config, this.restSvc);
72
- this.UsrDevicesService = new UsrDevicesService(this.config, this.restSvc);
73
- this.UsrEventsService = new UsrEventsService(this.config, this.restSvc);
74
- this.UsrNetworkService = new UsrNetworkService(this.config, this.restSvc);
75
- this.UsrReportsService = new UsrReportsService(this.config, this.restSvc);
76
- this.UsrRulesService = new UsrRulesService(this.config, this.restSvc);
48
+ this.UsrAlertsService = new UsrAlertsService(apiUrl, this.restSvc);
49
+ this.UsrDevicesService = new UsrDevicesService(apiUrl, this.restSvc);
50
+ this.UsrEventsService = new UsrEventsService(apiUrl, this.restSvc);
51
+ this.UsrNetworkService = new UsrNetworkService(apiUrl, this.restSvc);
52
+ this.UsrReportsService = new UsrReportsService(apiUrl, this.restSvc);
53
+ this.UsrRulesService = new UsrRulesService(apiUrl, this.restSvc);
54
+ this.SupportStreamAnalyticsConfig = new SupportStreamAnalyticsConfig(apiUrl, this.restSvc);
55
+ this.SysAccountsService = new SysAccountsService(apiUrl, this.restSvc);
56
+ this.SysAuditLogService = new SysAuditLogService(apiUrl, this.restSvc);
57
+ this.SysCheckpointsService = new SysCheckpointsService(apiUrl, this.restSvc);
58
+ this.SysConfigService = new SysConfigService(apiUrl, this.restSvc);
59
+ this.SysFeaturesService = new SysFeaturesService(apiUrl, this.restSvc);
60
+ this.SysGroupsService = new SysGroupsService(apiUrl, this.restSvc);
61
+ this.SysInsightsService = new SysInsightsService(apiUrl, this.restSvc);
62
+ this.SysKeysService = new SysKeysService(apiUrl, this.restSvc);
63
+ this.SysMembersService = new SysMembersService(apiUrl, this.restSvc);
64
+ this.SysRuleTemplatesService = new SysRuleTemplatesService(apiUrl, this.restSvc);
65
+ this.SysRulesService = new SysRulesService(apiUrl, this.restSvc);
66
+ this.SysStatisticsService = new SysStatisticsService(apiUrl, this.restSvc);
67
+ this.SysStreamsService = new SysStreamsService(apiUrl, this.restSvc);
68
+ this.SysUsersService = new SysUsersService(apiUrl, this.restSvc);
69
+ this.UsrInsightsService = new UsrInsightsService(apiUrl, this.restSvc);
70
+ this.UsrIntegrationsService = new UsrIntegrationsService(apiUrl, this.restSvc);
71
+ this.UsrMembersService = new UsrMembersService(apiUrl, this.restSvc);
72
+ this.UsrUserService = new UsrUserService(apiUrl, this.restSvc);
77
73
  }
78
74
  }
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SupportStreamAnalyticsConfig {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/support/stream-analytics-config';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new stream analytics configuration
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysAccountsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/accounts';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new account
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysAuditLogService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/audit-log';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Get single log entry by id
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysCheckpointsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/checkpoints';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Get a single checkpoint entry by id
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysConfigService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/config';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new configuration parameter
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysFeaturesService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/features';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Find list of feature
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysGroupsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/groups';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new groups
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysInsightsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/insights';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new insight query
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysKeysService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/keys';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new API key
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysMembersService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/members';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new member
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysRuleTemplatesService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/rule-templates';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new rule template
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysRulesService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/rules';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new rule
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysStatisticsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/statistics';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Get accounts distribution by field
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysStreamsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/streams';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new stream
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class SysUsersService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/sys/users';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new user
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrAlertsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/alerts';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Get single alert by id
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrDevicesService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/devices';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new device
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrEventsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/events';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Get single event by id
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrInsightsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/insights';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Find list of insights by day
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrIntegrationsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/integrations';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new integration
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrMembersService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/members';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new member
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrNetworkService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/network';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Find list of usage records by query
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrReportsService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/reports';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new report
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrRulesService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/rules';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Create new rule
@@ -3,12 +3,12 @@
3
3
  // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
4
4
  export class UsrUserService {
5
5
  // Class constructor
6
- constructor(config, rest) {
7
- this.config = config;
6
+ constructor(apiUrl, rest) {
7
+ this.apiUrl = apiUrl;
8
8
  this.rest = rest;
9
9
  // URL to web api
10
10
  this.baseUrl = '/user';
11
- this.baseUrl = this.config.api + this.baseUrl;
11
+ this.baseUrl = apiUrl + this.baseUrl;
12
12
  }
13
13
  /**
14
14
  * Authorize user, verify user exists in the system (user was already authenticated by OAuth provider)
@@ -1,4 +1,3 @@
1
- export * from './config';
2
1
  export * from './utils';
3
2
  export * from './lib';
4
3
  export * from './lib/pulse-client';
@@ -1,6 +1,6 @@
1
+ import { UserTypeCode } from '../enums';
1
2
  import { MemberRoleCode } from '../enums';
2
3
  import { UserStatusCode } from '../enums';
3
- import { UserTypeCode } from '../enums';
4
4
  export declare class TokenData {
5
5
  accountId: string;
6
6
  subjectId: string;
@@ -1,8 +1,8 @@
1
- import { AccountTypeCode } from '../enums';
2
- import { AccountStatusCode } from '../enums';
3
1
  import { StringKeyValue } from '../common';
4
2
  import { AccountSettings } from '../entities';
5
3
  import { BaseEntity } from '../base';
4
+ import { AccountTypeCode } from '../enums';
5
+ import { AccountStatusCode } from '../enums';
6
6
  export declare class Account extends BaseEntity {
7
7
  name: string;
8
8
  externalId: string;
@@ -1,5 +1,5 @@
1
- import { DeviceActionCode } from '../enums';
2
1
  import { BaseEntity } from '../base';
2
+ import { DeviceActionCode } from '../enums';
3
3
  export declare class Action extends BaseEntity {
4
4
  accountId: string;
5
5
  streamId: string;
@@ -1,12 +1,12 @@
1
- import { SeverityTypeCode } from '../enums';
2
1
  import { EventStatusCode } from '../enums';
3
- import { RuleTypeCode } from '../enums';
4
- import { TrafficDirectionCode } from '../enums';
2
+ import { EventCategoryCode } from '../enums';
5
3
  import { BaseEntity } from '../base';
6
- import { EventTypeCode } from '../enums';
4
+ import { SeverityTypeCode } from '../enums';
5
+ import { RuleTypeCode } from '../enums';
7
6
  import { GeoData } from '../common';
8
7
  import { StringKeyValue } from '../common';
9
- import { EventCategoryCode } from '../enums';
8
+ import { TrafficDirectionCode } from '../enums';
9
+ import { EventTypeCode } from '../enums';
10
10
  export declare class Alert extends BaseEntity {
11
11
  accountId: string;
12
12
  streamId: string;
@@ -1,13 +1,13 @@
1
- import { EventTypeCode } from '../enums';
2
- import { TrafficDirectionCode } from '../enums';
3
- import { Device } from '../entities';
1
+ import { GeoData } from '../common';
4
2
  import { StringKeyValue } from '../common';
5
- import { EventCategoryCode } from '../enums';
6
- import { BaseEntity } from '../base';
7
- import { SeverityTypeCode } from '../enums';
8
3
  import { EventStatusCode } from '../enums';
4
+ import { SeverityTypeCode } from '../enums';
9
5
  import { RuleTypeCode } from '../enums';
10
- import { GeoData } from '../common';
6
+ import { EventCategoryCode } from '../enums';
7
+ import { TrafficDirectionCode } from '../enums';
8
+ import { Device } from '../entities';
9
+ import { BaseEntity } from '../base';
10
+ import { EventTypeCode } from '../enums';
11
11
  export declare class AlertWithDevice extends BaseEntity {
12
12
  accountId: string;
13
13
  streamId: string;
@@ -1,9 +1,9 @@
1
- import { SIM } from '../entities';
2
- import { BaseEntity } from '../base';
3
1
  import { DeviceTypeCode } from '../enums';
4
2
  import { DeviceStatusCode } from '../enums';
5
3
  import { StringKeyValue } from '../common';
6
4
  import { DeviceActionCode } from '../enums';
5
+ import { SIM } from '../entities';
6
+ import { BaseEntity } from '../base';
7
7
  export declare class Device extends BaseEntity {
8
8
  accountId: string;
9
9
  streamId: string;
@@ -1,10 +1,10 @@
1
+ import { StringKeyValue } from '../common';
2
+ import { DeviceActionCode } from '../enums';
3
+ import { SIM } from '../entities';
1
4
  import { Event } from '../entities';
2
5
  import { BaseEntity } from '../base';
3
6
  import { DeviceTypeCode } from '../enums';
4
7
  import { DeviceStatusCode } from '../enums';
5
- import { StringKeyValue } from '../common';
6
- import { DeviceActionCode } from '../enums';
7
- import { SIM } from '../entities';
8
8
  export declare class DeviceWithEvents extends BaseEntity {
9
9
  accountId: string;
10
10
  streamId: string;