@shieldiot/pulse-lib 1.0.5 → 1.0.7

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 (244) hide show
  1. package/dist/index.d.ts +4 -2
  2. package/dist/index.js +4 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/common/SeverityIntervalTuple.d.ts +1 -1
  5. package/dist/lib/common/TimeSeriesOfFloat.d.ts +1 -1
  6. package/dist/lib/common/TokenData.d.ts +1 -1
  7. package/dist/lib/entities/Account.d.ts +1 -1
  8. package/dist/lib/entities/Account.js.map +1 -1
  9. package/dist/lib/entities/AccountDTO.d.ts +3 -3
  10. package/dist/lib/entities/AccountDTO.js.map +1 -1
  11. package/dist/lib/entities/AccountSettings.d.ts +1 -1
  12. package/dist/lib/entities/Alert.d.ts +4 -4
  13. package/dist/lib/entities/Alert.js.map +1 -1
  14. package/dist/lib/entities/AlertWithDevice.d.ts +4 -4
  15. package/dist/lib/entities/AlertWithDevice.js.map +1 -1
  16. package/dist/lib/entities/ApiKey.d.ts +1 -1
  17. package/dist/lib/entities/ApiKey.js.map +1 -1
  18. package/dist/lib/entities/DeviceWithEvents.d.ts +2 -2
  19. package/dist/lib/entities/DeviceWithEvents.js.map +1 -1
  20. package/dist/lib/entities/Event.d.ts +3 -3
  21. package/dist/lib/entities/Event.js.map +1 -1
  22. package/dist/lib/entities/EventWithDevice.d.ts +7 -7
  23. package/dist/lib/entities/EventWithDevice.js.map +1 -1
  24. package/dist/lib/entities/Feature.d.ts +1 -1
  25. package/dist/lib/entities/Feature.js.map +1 -1
  26. package/dist/lib/entities/Insight.d.ts +1 -1
  27. package/dist/lib/entities/Insight.js.map +1 -1
  28. package/dist/lib/entities/Integration.d.ts +2 -2
  29. package/dist/lib/entities/Integration.js.map +1 -1
  30. package/dist/lib/entities/Rule.d.ts +1 -1
  31. package/dist/lib/entities/Rule.js.map +1 -1
  32. package/dist/lib/entities/RuleTemplate.d.ts +1 -1
  33. package/dist/lib/entities/RuleTemplate.js.map +1 -1
  34. package/dist/lib/entities/StreamAnalyticsConfig.d.ts +2 -2
  35. package/dist/lib/entities/StreamAnalyticsConfig.js.map +1 -1
  36. package/dist/lib/entities/StreamConfig.d.ts +2 -2
  37. package/dist/lib/services/sysAccountsService.d.ts +2 -2
  38. package/dist/lib/services/sysFeaturesService.d.ts +1 -1
  39. package/dist/lib/services/sysRulesService.d.ts +1 -1
  40. package/dist/lib/services/sysUsersService.d.ts +2 -2
  41. package/dist/lib/services/usrAlertsService.d.ts +9 -9
  42. package/dist/lib/services/usrDevicesService.d.ts +7 -7
  43. package/dist/lib/services/usrEventsService.d.ts +8 -8
  44. package/dist/lib/services/usrRulesService.d.ts +1 -1
  45. package/dist/lib/services/usrUserService.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/src/index.ts +4 -3
  48. package/dist/public-api.d.ts +0 -3
  49. package/dist/public-api.js +0 -7
  50. package/dist/public-api.js.map +0 -1
  51. package/src/config.d.ts +0 -6
  52. package/src/config.d.ts.map +0 -1
  53. package/src/config.js +0 -6
  54. package/src/config.js.map +0 -1
  55. package/src/index.d.ts +0 -3
  56. package/src/index.d.ts.map +0 -1
  57. package/src/index.js +0 -3
  58. package/src/index.js.map +0 -1
  59. package/src/lib/common/AccountRole.ts +0 -25
  60. package/src/lib/common/ConsumptionData.ts +0 -24
  61. package/src/lib/common/ConsumptionTimeDataPoint.ts +0 -21
  62. package/src/lib/common/DeviceConfig.ts +0 -22
  63. package/src/lib/common/DeviceScoreConfig.ts +0 -24
  64. package/src/lib/common/DevicesAtRiskConfig.ts +0 -16
  65. package/src/lib/common/EventSeverityConfig.ts +0 -17
  66. package/src/lib/common/FloatKeyValue.ts +0 -20
  67. package/src/lib/common/GeoData.ts +0 -38
  68. package/src/lib/common/GraphSeries.ts +0 -21
  69. package/src/lib/common/Indicator.ts +0 -32
  70. package/src/lib/common/IntKeySeriesDataValue.ts +0 -21
  71. package/src/lib/common/IntKeyValue.ts +0 -20
  72. package/src/lib/common/Interval.ts +0 -20
  73. package/src/lib/common/Link.ts +0 -41
  74. package/src/lib/common/Location.ts +0 -20
  75. package/src/lib/common/LoginParams.ts +0 -24
  76. package/src/lib/common/MaliciousIPCard.ts +0 -45
  77. package/src/lib/common/MaliciousIPData.ts +0 -28
  78. package/src/lib/common/NetworkMap.ts +0 -22
  79. package/src/lib/common/Node.ts +0 -54
  80. package/src/lib/common/SeriesData.ts +0 -22
  81. package/src/lib/common/SessionTransform.ts +0 -29
  82. package/src/lib/common/SeverityIntervalTuple.ts +0 -22
  83. package/src/lib/common/ShieldexConfig.ts +0 -36
  84. package/src/lib/common/StringIntValue.ts +0 -20
  85. package/src/lib/common/StringKeyIntValue.ts +0 -20
  86. package/src/lib/common/StringKeyValue.ts +0 -20
  87. package/src/lib/common/Thresholds.ts +0 -16
  88. package/src/lib/common/TimeDataPoint.ts +0 -20
  89. package/src/lib/common/TimeDataPoint2D.ts +0 -21
  90. package/src/lib/common/TimeDataPointFloat.ts +0 -20
  91. package/src/lib/common/TimeFrame.ts +0 -20
  92. package/src/lib/common/TimeSeries.ts +0 -26
  93. package/src/lib/common/TimeSeriesOf2D.ts +0 -26
  94. package/src/lib/common/TimeSeriesOfDataConsumption.ts +0 -26
  95. package/src/lib/common/TimeSeriesOfFloat.ts +0 -26
  96. package/src/lib/common/TokenData.ts +0 -39
  97. package/src/lib/common/Tuple.ts +0 -20
  98. package/src/lib/common/UsageTransform.ts +0 -37
  99. package/src/lib/common/ZScore.ts +0 -20
  100. package/src/lib/common/index.ts +0 -41
  101. package/src/lib/entities/Account.ts +0 -45
  102. package/src/lib/entities/AccountDTO.ts +0 -49
  103. package/src/lib/entities/AccountSettings.ts +0 -31
  104. package/src/lib/entities/Action.ts +0 -30
  105. package/src/lib/entities/Alert.ts +0 -91
  106. package/src/lib/entities/AlertWithDevice.ts +0 -92
  107. package/src/lib/entities/ApiKey.ts +0 -33
  108. package/src/lib/entities/AuditLog.ts +0 -39
  109. package/src/lib/entities/BaseEntity.ts +0 -24
  110. package/src/lib/entities/BulkDevices.ts +0 -17
  111. package/src/lib/entities/Checkpoint.ts +0 -71
  112. package/src/lib/entities/ComplianceReportSettings.ts +0 -28
  113. package/src/lib/entities/Condition.ts +0 -28
  114. package/src/lib/entities/ConfigParam.ts +0 -15
  115. package/src/lib/entities/DNSRecord.ts +0 -40
  116. package/src/lib/entities/DataIngestion.ts +0 -63
  117. package/src/lib/entities/DataPointOfDeviceReport.ts +0 -21
  118. package/src/lib/entities/Device.ts +0 -82
  119. package/src/lib/entities/DeviceReport.ts +0 -29
  120. package/src/lib/entities/DeviceWithEvents.ts +0 -86
  121. package/src/lib/entities/Distribution.ts +0 -25
  122. package/src/lib/entities/Event.ts +0 -98
  123. package/src/lib/entities/EventOccurrence.ts +0 -34
  124. package/src/lib/entities/EventWithDevice.ts +0 -97
  125. package/src/lib/entities/Feature.ts +0 -18
  126. package/src/lib/entities/FeaturesGroup.ts +0 -18
  127. package/src/lib/entities/Group.ts +0 -24
  128. package/src/lib/entities/Image.ts +0 -18
  129. package/src/lib/entities/Insight.ts +0 -49
  130. package/src/lib/entities/InsightQuery.ts +0 -29
  131. package/src/lib/entities/InsightSpec.ts +0 -28
  132. package/src/lib/entities/IntDistribution.ts +0 -25
  133. package/src/lib/entities/Integration.ts +0 -81
  134. package/src/lib/entities/Member.ts +0 -22
  135. package/src/lib/entities/Radius.ts +0 -45
  136. package/src/lib/entities/Report.ts +0 -37
  137. package/src/lib/entities/Rule.ts +0 -65
  138. package/src/lib/entities/RuleTemplate.ts +0 -38
  139. package/src/lib/entities/SIM.ts +0 -32
  140. package/src/lib/entities/ServiceStatus.ts +0 -26
  141. package/src/lib/entities/SessionRecord.ts +0 -71
  142. package/src/lib/entities/Shieldex.ts +0 -23
  143. package/src/lib/entities/Stream.ts +0 -31
  144. package/src/lib/entities/StreamAnalyticsConfig.ts +0 -30
  145. package/src/lib/entities/StreamConfig.ts +0 -52
  146. package/src/lib/entities/TeaserPopUpSettings.ts +0 -24
  147. package/src/lib/entities/TimeSeriesOfDeviceReport.ts +0 -26
  148. package/src/lib/entities/UsageRecord.ts +0 -101
  149. package/src/lib/entities/User.ts +0 -45
  150. package/src/lib/entities/UserMembership.ts +0 -38
  151. package/src/lib/entities/UserMemberships.ts +0 -38
  152. package/src/lib/entities/index.ts +0 -51
  153. package/src/lib/enums/AccountStatusCode.ts +0 -35
  154. package/src/lib/enums/AccountTypeCode.ts +0 -40
  155. package/src/lib/enums/DataSourceCode.ts +0 -35
  156. package/src/lib/enums/DeviceActionCode.ts +0 -40
  157. package/src/lib/enums/DeviceCreationCode.ts +0 -40
  158. package/src/lib/enums/DeviceIdentityCode.ts +0 -55
  159. package/src/lib/enums/DeviceStatusCode.ts +0 -40
  160. package/src/lib/enums/DeviceTypeCode.ts +0 -90
  161. package/src/lib/enums/DirectionContextCode.ts +0 -40
  162. package/src/lib/enums/EventCategoryCode.ts +0 -30
  163. package/src/lib/enums/EventStatusCode.ts +0 -40
  164. package/src/lib/enums/EventTypeCode.ts +0 -115
  165. package/src/lib/enums/FeatureCode.ts +0 -70
  166. package/src/lib/enums/HomePageViewCode.ts +0 -35
  167. package/src/lib/enums/HttpMethodCode.ts +0 -45
  168. package/src/lib/enums/InsightStatusCode.ts +0 -35
  169. package/src/lib/enums/InsightTypeCode.ts +0 -30
  170. package/src/lib/enums/IntegrationTriggerCode.ts +0 -30
  171. package/src/lib/enums/IntegrationTypeCode.ts +0 -40
  172. package/src/lib/enums/MemberRoleCode.ts +0 -40
  173. package/src/lib/enums/NetworkMapTypeCode.ts +0 -35
  174. package/src/lib/enums/OperatorCode.ts +0 -75
  175. package/src/lib/enums/PermissionCode.ts +0 -45
  176. package/src/lib/enums/ReportTypeCode.ts +0 -35
  177. package/src/lib/enums/RuleTypeCode.ts +0 -35
  178. package/src/lib/enums/SeverityTypeCode.ts +0 -40
  179. package/src/lib/enums/TrafficDirectionCode.ts +0 -35
  180. package/src/lib/enums/UserStatusCode.ts +0 -40
  181. package/src/lib/enums/UserTypeCode.ts +0 -40
  182. package/src/lib/enums/index.ts +0 -29
  183. package/src/lib/index.ts +0 -4
  184. package/src/lib/pulse-client.ts +0 -190
  185. package/src/lib/services/index.ts +0 -26
  186. package/src/lib/services/services.export.ts +0 -54
  187. package/src/lib/services/supportStreamAnalyticsConfig.ts +0 -63
  188. package/src/lib/services/sysAccountsService.ts +0 -90
  189. package/src/lib/services/sysAuditLogService.ts +0 -72
  190. package/src/lib/services/sysCheckpointsService.ts +0 -62
  191. package/src/lib/services/sysConfigService.ts +0 -63
  192. package/src/lib/services/sysFeaturesService.ts +0 -77
  193. package/src/lib/services/sysGroupsService.ts +0 -85
  194. package/src/lib/services/sysInsightsService.ts +0 -122
  195. package/src/lib/services/sysKeysService.ts +0 -71
  196. package/src/lib/services/sysMembersService.ts +0 -66
  197. package/src/lib/services/sysRuleTemplatesService.ts +0 -63
  198. package/src/lib/services/sysRulesService.ts +0 -79
  199. package/src/lib/services/sysStatisticsService.ts +0 -50
  200. package/src/lib/services/sysStreamsService.ts +0 -64
  201. package/src/lib/services/sysUsersService.ts +0 -89
  202. package/src/lib/services/usrAlertsService.ts +0 -382
  203. package/src/lib/services/usrDevicesService.ts +0 -303
  204. package/src/lib/services/usrEventsService.ts +0 -355
  205. package/src/lib/services/usrInsightsService.ts +0 -29
  206. package/src/lib/services/usrIntegrationsService.ts +0 -79
  207. package/src/lib/services/usrMembersService.ts +0 -77
  208. package/src/lib/services/usrNetworkService.ts +0 -59
  209. package/src/lib/services/usrReportsService.ts +0 -114
  210. package/src/lib/services/usrRulesService.ts +0 -78
  211. package/src/lib/services/usrUserService.ts +0 -114
  212. package/src/public-api.d.ts +0 -4
  213. package/src/public-api.d.ts.map +0 -1
  214. package/src/public-api.js +0 -7
  215. package/src/public-api.js.map +0 -1
  216. package/src/public-api.ts +0 -9
  217. package/src/utils/ActionResponse.d.ts +0 -6
  218. package/src/utils/ActionResponse.d.ts.map +0 -1
  219. package/src/utils/ActionResponse.js +0 -9
  220. package/src/utils/ActionResponse.js.map +0 -1
  221. package/src/utils/BaseRestResponse.d.ts +0 -5
  222. package/src/utils/BaseRestResponse.d.ts.map +0 -1
  223. package/src/utils/BaseRestResponse.js +0 -8
  224. package/src/utils/BaseRestResponse.js.map +0 -1
  225. package/src/utils/EntitiesResponse.d.ts +0 -9
  226. package/src/utils/EntitiesResponse.d.ts.map +0 -1
  227. package/src/utils/EntitiesResponse.js +0 -15
  228. package/src/utils/EntitiesResponse.js.map +0 -1
  229. package/src/utils/EntityResponse.d.ts +0 -9
  230. package/src/utils/EntityResponse.d.ts.map +0 -1
  231. package/src/utils/EntityResponse.js +0 -15
  232. package/src/utils/EntityResponse.js.map +0 -1
  233. package/src/utils/index.d.ts +0 -6
  234. package/src/utils/index.d.ts.map +0 -1
  235. package/src/utils/index.js +0 -6
  236. package/src/utils/index.js.map +0 -1
  237. package/src/utils/rest-axios-setup.d.ts +0 -4
  238. package/src/utils/rest-axios-setup.d.ts.map +0 -1
  239. package/src/utils/rest-axios-setup.js +0 -8
  240. package/src/utils/rest-axios-setup.js.map +0 -1
  241. package/src/utils/rest-util.d.ts +0 -16
  242. package/src/utils/rest-util.d.ts.map +0 -1
  243. package/src/utils/rest-util.js +0 -101
  244. package/src/utils/rest-util.js.map +0 -1
@@ -1,29 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { Insight } from '../entities';
5
-
6
-
7
-
8
- // List of integrations related actions for the operator
9
- // @RequestHeader X-API-KEY The key to identify the application (console)
10
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
11
- export class UsrInsightsService {
12
-
13
- // URL to web api
14
- private baseUrl = '/insights';
15
-
16
- // Class constructor
17
- constructor(private config: PulseConfig, private rest: RestUtil) {
18
- this.baseUrl = this.config.api + this.baseUrl;
19
- }
20
-
21
-
22
- /**
23
- * Find list of insights by day
24
- */
25
- getDailyInsights(dayId?: string) {
26
- return this.rest.get<EntitiesResponse<Insight>>(`${this.baseUrl}/daily/${dayId}`);
27
- }
28
-
29
- }
@@ -1,79 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { Integration } from '../entities';
5
-
6
-
7
-
8
- // List of integrations related actions for the operator
9
- // @RequestHeader X-API-KEY The key to identify the application (console)
10
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
11
- export class UsrIntegrationsService {
12
-
13
- // URL to web api
14
- private baseUrl = '/integrations';
15
-
16
- // Class constructor
17
- constructor(private config: PulseConfig, private rest: RestUtil) {
18
- this.baseUrl = this.config.api + this.baseUrl;
19
- }
20
-
21
-
22
- /**
23
- * Create new integration
24
- */
25
- create(body?: Integration) {
26
- return this.rest.put<EntityResponse<Integration>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
27
- }
28
-
29
- /**
30
- * Update existing integration
31
- */
32
- update(body?: Integration) {
33
- return this.rest.patch<EntityResponse<Integration>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
34
- }
35
-
36
- /**
37
- * Delete integration from the system
38
- */
39
- delete(id?: string) {
40
- return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
41
- }
42
-
43
- /**
44
- * Get single integration by id
45
- */
46
- get(id?: string) {
47
- return this.rest.get<EntityResponse<Integration>>(`${this.baseUrl}/${id}`);
48
- }
49
-
50
- /**
51
- * Find list of integrations by query
52
- */
53
- find(accountId?: string, streamId?: string, search?: string, sort?: string, page?: number, size?: number) {
54
- const params = [];
55
- if (accountId != null) { params.push(`accountId=${accountId}`); }
56
- if (streamId != null) { params.push(`streamId=${streamId}`); }
57
- if (search != null) { params.push(`search=${search}`); }
58
- if (sort != null) { params.push(`sort=${sort}`); }
59
- if (page != null) { params.push(`page=${page}`); }
60
- if (size != null) { params.push(`size=${size}`); }
61
-
62
- return this.rest.get<EntitiesResponse<Integration>>(`${this.baseUrl}`, ...params);
63
- }
64
-
65
- /**
66
- * Validate format of the templates in the fields
67
- */
68
- validate(body?: Integration) {
69
- return this.rest.post<EntityResponse<Integration>>(`${this.baseUrl}/validate`, typeof body === 'object' ? JSON.stringify(body) : body);
70
- }
71
-
72
- /**
73
- * Test the integration with pseudo data
74
- */
75
- test(body?: Integration) {
76
- return this.rest.post<EntityResponse<Integration>>(`${this.baseUrl}/test`, typeof body === 'object' ? JSON.stringify(body) : body);
77
- }
78
-
79
- }
@@ -1,77 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { Member } from '../entities';
5
- import { MemberRoleCode } from '../enums';
6
-
7
-
8
-
9
- // List of members related actions for account administrator only
10
- // @RequestHeader X-API-KEY The key to identify the application (console)
11
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
12
- export class UsrMembersService {
13
-
14
- // URL to web api
15
- private baseUrl = '/members';
16
-
17
- // Class constructor
18
- constructor(private config: PulseConfig, private rest: RestUtil) {
19
- this.baseUrl = this.config.api + this.baseUrl;
20
- }
21
-
22
-
23
- /**
24
- * Create new member
25
- */
26
- create(body?: Member) {
27
- return this.rest.put<EntityResponse<Member>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
28
- }
29
-
30
- /**
31
- * Update existing member in the system
32
- */
33
- update(body?: Member) {
34
- return this.rest.patch<EntityResponse<Member>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
35
- }
36
-
37
- /**
38
- * Delete member from the system
39
- */
40
- delete(id?: string) {
41
- return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
42
- }
43
-
44
- /**
45
- * Get single member by id
46
- */
47
- get(id?: string) {
48
- return this.rest.get<EntityResponse<Member>>(`${this.baseUrl}/${id}`);
49
- }
50
-
51
- /**
52
- * Find list of members by query
53
- */
54
- find(userId?: string, role?: MemberRoleCode[], sort?: string, page?: number, size?: number) {
55
- const params = [];
56
- if (userId != null) { params.push(`userId=${userId}`); }
57
- if (role != null) { params.push(`role=${role}`); }
58
- if (sort != null) { params.push(`sort=${sort}`); }
59
- if (page != null) { params.push(`page=${page}`); }
60
- if (size != null) { params.push(`size=${size}`); }
61
-
62
- return this.rest.get<EntitiesResponse<Member>>(`${this.baseUrl}`, ...params);
63
- }
64
-
65
- /**
66
- * Find list of registered emails by query
67
- */
68
- findEmails(search?: string, page?: number, size?: number) {
69
- const params = [];
70
- if (search != null) { params.push(`search=${search}`); }
71
- if (page != null) { params.push(`page=${page}`); }
72
- if (size != null) { params.push(`size=${size}`); }
73
-
74
- return this.rest.get<EntitiesResponse<Member>>(`${this.baseUrl}/emails`, ...params);
75
- }
76
-
77
- }
@@ -1,59 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { UsageRecord } from '../entities';
5
- import { SessionRecord } from '../entities';
6
-
7
-
8
-
9
- // List of network statistics related queries for the operator
10
- // @RequestHeader X-API-KEY The key to identify the application (console)
11
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
12
- export class UsrNetworkService {
13
-
14
- // URL to web api
15
- private baseUrl = '/network';
16
-
17
- // Class constructor
18
- constructor(private config: PulseConfig, private rest: RestUtil) {
19
- this.baseUrl = this.config.api + this.baseUrl;
20
- }
21
-
22
-
23
- /**
24
- * Find list of usage records by query
25
- */
26
- findUsage(streamId?: string, deviceId?: string, simId?: string, from?: number, to?: number, include?: number, sort?: string, page?: number, size?: number) {
27
- const params = [];
28
- if (streamId != null) { params.push(`streamId=${streamId}`); }
29
- if (deviceId != null) { params.push(`deviceId=${deviceId}`); }
30
- if (simId != null) { params.push(`simId=${simId}`); }
31
- if (from != null) { params.push(`from=${from}`); }
32
- if (to != null) { params.push(`to=${to}`); }
33
- if (include != null) { params.push(`include=${include}`); }
34
- if (sort != null) { params.push(`sort=${sort}`); }
35
- if (page != null) { params.push(`page=${page}`); }
36
- if (size != null) { params.push(`size=${size}`); }
37
-
38
- return this.rest.get<EntitiesResponse<UsageRecord>>(`${this.baseUrl}/usage`, ...params);
39
- }
40
-
41
- /**
42
- * Find list of session records by query
43
- */
44
- findSession(streamId?: string, deviceId?: string, simId?: string, from?: number, to?: number, include?: number, sort?: string, page?: number, size?: number) {
45
- const params = [];
46
- if (streamId != null) { params.push(`streamId=${streamId}`); }
47
- if (deviceId != null) { params.push(`deviceId=${deviceId}`); }
48
- if (simId != null) { params.push(`simId=${simId}`); }
49
- if (from != null) { params.push(`from=${from}`); }
50
- if (to != null) { params.push(`to=${to}`); }
51
- if (include != null) { params.push(`include=${include}`); }
52
- if (sort != null) { params.push(`sort=${sort}`); }
53
- if (page != null) { params.push(`page=${page}`); }
54
- if (size != null) { params.push(`size=${size}`); }
55
-
56
- return this.rest.get<EntitiesResponse<SessionRecord>>(`${this.baseUrl}/session`, ...params);
57
- }
58
-
59
- }
@@ -1,114 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { Report } from '../entities';
5
- import { TimeSeries } from '../common';
6
- import { GraphSeries } from '../common';
7
-
8
-
9
-
10
- // List of events related actions for the operator
11
- // @RequestHeader X-API-KEY The key to identify the application (console)
12
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
13
- export class UsrReportsService {
14
-
15
- // URL to web api
16
- private baseUrl = '/reports';
17
-
18
- // Class constructor
19
- constructor(private config: PulseConfig, private rest: RestUtil) {
20
- this.baseUrl = this.config.api + this.baseUrl;
21
- }
22
-
23
-
24
- /**
25
- * Create new report
26
- */
27
- create(body?: Report) {
28
- return this.rest.put<EntityResponse<Report>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
29
- }
30
-
31
- /**
32
- * Update existing report in the system
33
- */
34
- update(body?: Report) {
35
- return this.rest.patch<EntityResponse<Report>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
36
- }
37
-
38
- /**
39
- * Delete a report from the system
40
- */
41
- delete(id?: string) {
42
- return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
43
- }
44
-
45
- /**
46
- * Get single report by id
47
- */
48
- get(id?: string) {
49
- return this.rest.get<EntityResponse<Report>>(`${this.baseUrl}/${id}`);
50
- }
51
-
52
- /**
53
- * Find list of reports by query
54
- */
55
- find(accountId?: string, search?: string, sort?: string, page?: number, size?: number) {
56
- const params = [];
57
- if (accountId != null) { params.push(`accountId=${accountId}`); }
58
- if (search != null) { params.push(`search=${search}`); }
59
- if (sort != null) { params.push(`sort=${sort}`); }
60
- if (page != null) { params.push(`page=${page}`); }
61
- if (size != null) { params.push(`size=${size}`); }
62
-
63
- return this.rest.get<EntitiesResponse<Report>>(`${this.baseUrl}`, ...params);
64
- }
65
-
66
- /**
67
- * Get compliance report
68
- */
69
- getComplianceReport(streamId?: string, from?: number, to?: number) {
70
- const params = [];
71
- if (streamId != null) { params.push(`streamId=${streamId}`); }
72
- if (from != null) { params.push(`from=${from}`); }
73
- if (to != null) { params.push(`to=${to}`); }
74
-
75
- return this.rest.download(`reports`,`${this.baseUrl}/compliance`, ...params);
76
- }
77
-
78
- /**
79
- * Get histogram of network activity over time
80
- */
81
- getNetworkActivityOverTime(streamId?: string, from?: number, to?: number) {
82
- const params = [];
83
- if (streamId != null) { params.push(`streamId=${streamId}`); }
84
- if (from != null) { params.push(`from=${from}`); }
85
- if (to != null) { params.push(`to=${to}`); }
86
-
87
- return this.rest.get<EntityResponse<TimeSeries>>(`${this.baseUrl}/network-activity-over-time`, ...params);
88
- }
89
-
90
- /**
91
- * Get histogram of device distribution by number of destinations
92
- */
93
- getDeviceDistributionByNumberOfDestinations(streamId?: string, from?: number, to?: number) {
94
- const params = [];
95
- if (streamId != null) { params.push(`streamId=${streamId}`); }
96
- if (from != null) { params.push(`from=${from}`); }
97
- if (to != null) { params.push(`to=${to}`); }
98
-
99
- return this.rest.get<EntityResponse<GraphSeries>>(`${this.baseUrl}/device-distribution-by-number-of-destinations`, ...params);
100
- }
101
-
102
- /**
103
- * Get histogram of device distribution by communication frequency
104
- */
105
- getDeviceGroupsByCommunicationFrequency(streamId?: string, from?: number, to?: number) {
106
- const params = [];
107
- if (streamId != null) { params.push(`streamId=${streamId}`); }
108
- if (from != null) { params.push(`from=${from}`); }
109
- if (to != null) { params.push(`to=${to}`); }
110
-
111
- return this.rest.get<EntityResponse<GraphSeries>>(`${this.baseUrl}/device-groups-by-communication-frequency`, ...params);
112
- }
113
-
114
- }
@@ -1,78 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { Rule } from '../entities';
5
- import { TimeSeriesOfFloat } from '../common';
6
-
7
-
8
-
9
- // List of rules related actions
10
- // @RequestHeader X-API-KEY The key to identify the application (console)
11
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
12
- export class UsrRulesService {
13
-
14
- // URL to web api
15
- private baseUrl = '/rules';
16
-
17
- // Class constructor
18
- constructor(private config: PulseConfig, private rest: RestUtil) {
19
- this.baseUrl = this.config.api + this.baseUrl;
20
- }
21
-
22
-
23
- /**
24
- * Create new rule
25
- */
26
- create(body?: Rule) {
27
- return this.rest.put<EntityResponse<Rule>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
28
- }
29
-
30
- /**
31
- * Update existing rule in the system
32
- */
33
- update(body?: Rule) {
34
- return this.rest.patch<EntityResponse<Rule>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
35
- }
36
-
37
- /**
38
- * Delete a rule from the system
39
- */
40
- delete(id?: string) {
41
- return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
42
- }
43
-
44
- /**
45
- * Get single rule by id
46
- */
47
- get(id?: string) {
48
- return this.rest.get<EntityResponse<Rule>>(`${this.baseUrl}/${id}`);
49
- }
50
-
51
- /**
52
- * Find list of rules by query
53
- */
54
- find(streamId?: string, search?: string, sort?: string, page?: number, size?: number) {
55
- const params = [];
56
- if (streamId != null) { params.push(`streamId=${streamId}`); }
57
- if (search != null) { params.push(`search=${search}`); }
58
- if (sort != null) { params.push(`sort=${sort}`); }
59
- if (page != null) { params.push(`page=${page}`); }
60
- if (size != null) { params.push(`size=${size}`); }
61
-
62
- return this.rest.get<EntitiesResponse<Rule>>(`${this.baseUrl}`, ...params);
63
- }
64
-
65
- /**
66
- * Analyze rule configuration against historic data
67
- */
68
- analyze(from?: number, to?: number, interval?: number, size?: number, body?: Rule) {
69
- const params = [];
70
- if (from != null) { params.push(`from=${from}`); }
71
- if (to != null) { params.push(`to=${to}`); }
72
- if (interval != null) { params.push(`interval=${interval}`); }
73
- if (size != null) { params.push(`size=${size}`); }
74
-
75
- return this.rest.post<EntityResponse<TimeSeriesOfFloat>>(`${this.baseUrl}/analyze`, typeof body === 'object' ? JSON.stringify(body) : body, ...params);
76
- }
77
-
78
- }
@@ -1,114 +0,0 @@
1
- import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
2
- import { PulseConfig } from '../../config';
3
-
4
- import { UserMemberships } from '../entities';
5
- import { LoginParams } from '../common';
6
- import { User } from '../entities';
7
- import { AccountDTO } from '../entities';
8
- import { Image } from '../entities';
9
- import { Feature } from '../entities';
10
- import { Stream } from '../entities';
11
-
12
-
13
-
14
- // List of user related actions
15
- // @RequestHeader X-API-KEY The key to identify the application (console)
16
- // @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
17
- export class UsrUserService {
18
-
19
- // URL to web api
20
- private baseUrl = '/user';
21
-
22
- // Class constructor
23
- constructor(private config: PulseConfig, private rest: RestUtil) {
24
- this.baseUrl = this.config.api + this.baseUrl;
25
- }
26
-
27
-
28
- /**
29
- * Authorize user, verify user exists in the system (user was already authenticated by OAuth provider)
30
- * The response includes access token valid for 20 minutes. The client side should renew the token before expiration using refresh-token method
31
- */
32
- authorize(body?: LoginParams) {
33
- return this.rest.post<EntityResponse<User>>(`${this.baseUrl}/authorize`, typeof body === 'object' ? JSON.stringify(body) : body);
34
- }
35
-
36
- /**
37
- * Refresh token (set new expiration time) and associate with new account if required
38
- * The response includes the account details and the newly refreshed token in the HTTP header X-ACCESS-TOKEN
39
- */
40
- setAccount(id?: string) {
41
- return this.rest.post<EntityResponse<AccountDTO>>(`${this.baseUrl}/set-account/${id}`, '');
42
- }
43
-
44
- /**
45
- * Get the user's current account details
46
- */
47
- getAccount() {
48
- return this.rest.get<EntityResponse<AccountDTO>>(`${this.baseUrl}/get-account`);
49
- }
50
-
51
- /**
52
- * Get user's current account logo
53
- */
54
- getAccountLogo() {
55
- return this.rest.get<EntityResponse<Image>>(`${this.baseUrl}/get-account-logo`);
56
- }
57
-
58
- /**
59
- * Get the user's current account features (aggregated list of all features in all the account's features groups)
60
- */
61
- getAccountFeatures() {
62
- return this.rest.get<EntitiesResponse<Feature>>(`${this.baseUrl}/get-account-features`);
63
- }
64
-
65
- /**
66
- * Get the user's current account streams (accessible by the user)
67
- */
68
- getAccountStreams() {
69
- return this.rest.get<EntitiesResponse<Stream>>(`${this.baseUrl}/get-account-streams`);
70
- }
71
-
72
- /**
73
- * Get all the user memberships (all accounts that the current user has access to)
74
- */
75
- getMemberships() {
76
- return this.rest.get<EntityResponse<UserMemberships>>(`${this.baseUrl}/memberships`);
77
- }
78
-
79
- /**
80
- * Save user's avatar image
81
- */
82
- saveAvatar(body?: Image) {
83
- return this.rest.patch<ActionResponse>(`${this.baseUrl}/avatar`, typeof body === 'object' ? JSON.stringify(body) : body);
84
- }
85
-
86
- /**
87
- * Get user's avatar image
88
- */
89
- getAvatar() {
90
- return this.rest.get<EntityResponse<Image>>(`${this.baseUrl}/avatar`);
91
- }
92
-
93
- /**
94
- * Get arbitrary image by Id
95
- */
96
- getImage(id?: string) {
97
- return this.rest.get<EntityResponse<Image>>(`${this.baseUrl}/images`);
98
- }
99
-
100
- /**
101
- * Get arbitrary image by Id as stream of bytes
102
- */
103
- getImageBytes(id?: string) {
104
- return this.rest.download(`usr-user`,`${this.baseUrl}/image-bytes`);
105
- }
106
-
107
- /**
108
- * Get personal access token
109
- */
110
- getAccessToken() {
111
- return this.rest.get<ActionResponse>(`${this.baseUrl}/access-token`);
112
- }
113
-
114
- }
@@ -1,4 +0,0 @@
1
- export * from './lib';
2
- export * from './utils';
3
- export * from './config';
4
- //# sourceMappingURL=public-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["public-api.ts"],"names":[],"mappings":"AAKA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/src/public-api.js DELETED
@@ -1,7 +0,0 @@
1
- /*
2
- * Public API Surface of pulse-lib
3
- */
4
- export * from './lib';
5
- export * from './utils';
6
- export * from './config';
7
- //# sourceMappingURL=public-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/src/public-api.ts DELETED
@@ -1,9 +0,0 @@
1
- /*
2
- * Public API Surface of pulse-lib
3
- */
4
-
5
-
6
- export * from './lib';
7
- export * from './utils';
8
- export * from './config';
9
-
@@ -1,6 +0,0 @@
1
- import { BaseRestResponse } from './BaseRestResponse';
2
- export declare class ActionResponse extends BaseRestResponse {
3
- key: string;
4
- data: string;
5
- }
6
- //# sourceMappingURL=ActionResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionResponse.d.ts","sourceRoot":"","sources":["ActionResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,qBAAa,cAAe,SAAQ,gBAAgB;IAGzC,GAAG,EAAE,MAAM,CAAM;IAGjB,IAAI,EAAE,MAAM,CAAM;CAC5B"}
@@ -1,9 +0,0 @@
1
- import { BaseRestResponse } from './BaseRestResponse';
2
- // ActionResponse message is returned for any action on entity with no return data (e.d. delete)
3
- export class ActionResponse extends BaseRestResponse {
4
- // Entity key
5
- key = '';
6
- // Additional data
7
- data = '';
8
- }
9
- //# sourceMappingURL=ActionResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionResponse.js","sourceRoot":"","sources":["ActionResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,gGAAgG;AAChG,MAAM,OAAO,cAAe,SAAQ,gBAAgB;IAEhD,aAAa;IACN,GAAG,GAAW,EAAE,CAAC;IAExB,kBAAkB;IACX,IAAI,GAAW,EAAE,CAAC;CAC5B"}
@@ -1,5 +0,0 @@
1
- export declare class BaseRestResponse {
2
- code: number;
3
- error: string;
4
- }
5
- //# sourceMappingURL=BaseRestResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseRestResponse.d.ts","sourceRoot":"","sources":["BaseRestResponse.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IAGlB,IAAI,EAAE,MAAM,CAAK;IAGjB,KAAK,EAAE,MAAM,CAAM;CAC7B"}
@@ -1,8 +0,0 @@
1
- // BaseRestResponse is a common structure for all response types
2
- export class BaseRestResponse {
3
- // Error code (0 for success)
4
- code = 0;
5
- // Error message
6
- error = '';
7
- }
8
- //# sourceMappingURL=BaseRestResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseRestResponse.js","sourceRoot":"","sources":["BaseRestResponse.ts"],"names":[],"mappings":"AACA,gEAAgE;AAChE,MAAM,OAAO,gBAAgB;IAEzB,6BAA6B;IACtB,IAAI,GAAW,CAAC,CAAC;IAExB,gBAAgB;IACT,KAAK,GAAW,EAAE,CAAC;CAC7B"}
@@ -1,9 +0,0 @@
1
- import { BaseRestResponse } from './BaseRestResponse';
2
- export declare class EntitiesResponse<T> extends BaseRestResponse {
3
- page: number;
4
- size: number;
5
- pages: number;
6
- total: number;
7
- list: T[];
8
- }
9
- //# sourceMappingURL=EntitiesResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntitiesResponse.d.ts","sourceRoot":"","sources":["EntitiesResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,gBAAgB;IAG9C,IAAI,EAAE,MAAM,CAAK;IAGjB,IAAI,EAAE,MAAM,CAAK;IAGjB,KAAK,EAAE,MAAM,CAAK;IAGlB,KAAK,EAAE,MAAM,CAAK;IAGlB,IAAI,EAAE,CAAC,EAAE,CAAM;CAEzB"}
@@ -1,15 +0,0 @@
1
- import { BaseRestResponse } from './BaseRestResponse';
2
- // EntitiesResponse message is returned for any action returning multiple entities
3
- export class EntitiesResponse extends BaseRestResponse {
4
- // Current page (Bulk) number
5
- page = 0;
6
- // Size of page (items in bulk)
7
- size = 0;
8
- // Total number of pages
9
- pages = 0;
10
- // Total number of items in the query
11
- total = 0;
12
- // List of entities
13
- list = [];
14
- }
15
- //# sourceMappingURL=EntitiesResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntitiesResponse.js","sourceRoot":"","sources":["EntitiesResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,kFAAkF;AAClF,MAAM,OAAO,gBAAoB,SAAQ,gBAAgB;IAErD,6BAA6B;IACtB,IAAI,GAAW,CAAC,CAAC;IAExB,+BAA+B;IACxB,IAAI,GAAW,CAAC,CAAC;IAExB,wBAAwB;IACjB,KAAK,GAAW,CAAC,CAAC;IAEzB,qCAAqC;IAC9B,KAAK,GAAW,CAAC,CAAC;IAEzB,mBAAmB;IACZ,IAAI,GAAQ,EAAE,CAAC;CAEzB"}