@shieldiot/pulse-lib 1.0.8 → 1.0.10

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 (509) hide show
  1. package/LICENSE +18 -4
  2. package/README.md +36 -17
  3. package/dist/cjs/Num.js +174 -0
  4. package/dist/cjs/index.js +5 -0
  5. package/dist/esm/Num.js +171 -0
  6. package/dist/esm/index.js +2 -0
  7. package/dist/types/Num.d.ts +15 -0
  8. package/dist/types/index.d.ts +2 -0
  9. package/dist/umd/index.js +1 -0
  10. package/package.json +64 -19
  11. package/dist/config.d.ts +0 -5
  12. package/dist/config.js +0 -6
  13. package/dist/config.js.map +0 -1
  14. package/dist/index.d.ts +0 -4
  15. package/dist/index.js +0 -5
  16. package/dist/index.js.map +0 -1
  17. package/dist/lib/base/BaseEntity.d.ts +0 -6
  18. package/dist/lib/base/BaseEntity.js +0 -21
  19. package/dist/lib/base/BaseEntity.js.map +0 -1
  20. package/dist/lib/base/index.d.ts +0 -1
  21. package/dist/lib/base/index.js +0 -2
  22. package/dist/lib/base/index.js.map +0 -1
  23. package/dist/lib/common/AccountRole.d.ts +0 -7
  24. package/dist/lib/common/AccountRole.js +0 -21
  25. package/dist/lib/common/AccountRole.js.map +0 -1
  26. package/dist/lib/common/ConsumptionData.d.ts +0 -6
  27. package/dist/lib/common/ConsumptionData.js +0 -21
  28. package/dist/lib/common/ConsumptionData.js.map +0 -1
  29. package/dist/lib/common/ConsumptionTimeDataPoint.d.ts +0 -6
  30. package/dist/lib/common/ConsumptionTimeDataPoint.js +0 -16
  31. package/dist/lib/common/ConsumptionTimeDataPoint.js.map +0 -1
  32. package/dist/lib/common/DeviceConfig.d.ts +0 -7
  33. package/dist/lib/common/DeviceConfig.js +0 -16
  34. package/dist/lib/common/DeviceConfig.js.map +0 -1
  35. package/dist/lib/common/DeviceScoreConfig.d.ts +0 -6
  36. package/dist/lib/common/DeviceScoreConfig.js +0 -21
  37. package/dist/lib/common/DeviceScoreConfig.js.map +0 -1
  38. package/dist/lib/common/DevicesAtRiskConfig.d.ts +0 -4
  39. package/dist/lib/common/DevicesAtRiskConfig.js +0 -11
  40. package/dist/lib/common/DevicesAtRiskConfig.js.map +0 -1
  41. package/dist/lib/common/EventSeverityConfig.d.ts +0 -5
  42. package/dist/lib/common/EventSeverityConfig.js +0 -11
  43. package/dist/lib/common/EventSeverityConfig.js.map +0 -1
  44. package/dist/lib/common/FloatKeyValue.d.ts +0 -5
  45. package/dist/lib/common/FloatKeyValue.js +0 -16
  46. package/dist/lib/common/FloatKeyValue.js.map +0 -1
  47. package/dist/lib/common/GeoData.d.ts +0 -10
  48. package/dist/lib/common/GeoData.js +0 -37
  49. package/dist/lib/common/GeoData.js.map +0 -1
  50. package/dist/lib/common/GraphSeries.d.ts +0 -6
  51. package/dist/lib/common/GraphSeries.js +0 -16
  52. package/dist/lib/common/GraphSeries.js.map +0 -1
  53. package/dist/lib/common/Indicator.d.ts +0 -8
  54. package/dist/lib/common/Indicator.js +0 -31
  55. package/dist/lib/common/Indicator.js.map +0 -1
  56. package/dist/lib/common/IntKeySeriesDataValue.d.ts +0 -6
  57. package/dist/lib/common/IntKeySeriesDataValue.js +0 -16
  58. package/dist/lib/common/IntKeySeriesDataValue.js.map +0 -1
  59. package/dist/lib/common/IntKeyValue.d.ts +0 -5
  60. package/dist/lib/common/IntKeyValue.js +0 -16
  61. package/dist/lib/common/IntKeyValue.js.map +0 -1
  62. package/dist/lib/common/Interval.d.ts +0 -5
  63. package/dist/lib/common/Interval.js +0 -16
  64. package/dist/lib/common/Interval.js.map +0 -1
  65. package/dist/lib/common/Link.d.ts +0 -11
  66. package/dist/lib/common/Link.js +0 -41
  67. package/dist/lib/common/Link.js.map +0 -1
  68. package/dist/lib/common/Location.d.ts +0 -5
  69. package/dist/lib/common/Location.js +0 -16
  70. package/dist/lib/common/Location.js.map +0 -1
  71. package/dist/lib/common/LoginParams.d.ts +0 -6
  72. package/dist/lib/common/LoginParams.js +0 -21
  73. package/dist/lib/common/LoginParams.js.map +0 -1
  74. package/dist/lib/common/MaliciousIPCard.d.ts +0 -12
  75. package/dist/lib/common/MaliciousIPCard.js +0 -46
  76. package/dist/lib/common/MaliciousIPCard.js.map +0 -1
  77. package/dist/lib/common/MaliciousIPData.d.ts +0 -7
  78. package/dist/lib/common/MaliciousIPData.js +0 -26
  79. package/dist/lib/common/MaliciousIPData.js.map +0 -1
  80. package/dist/lib/common/NetworkMap.d.ts +0 -7
  81. package/dist/lib/common/NetworkMap.js +0 -16
  82. package/dist/lib/common/NetworkMap.js.map +0 -1
  83. package/dist/lib/common/Node.d.ts +0 -15
  84. package/dist/lib/common/Node.js +0 -56
  85. package/dist/lib/common/Node.js.map +0 -1
  86. package/dist/lib/common/SeriesData.d.ts +0 -7
  87. package/dist/lib/common/SeriesData.js +0 -16
  88. package/dist/lib/common/SeriesData.js.map +0 -1
  89. package/dist/lib/common/SessionTransform.d.ts +0 -8
  90. package/dist/lib/common/SessionTransform.js +0 -26
  91. package/dist/lib/common/SessionTransform.js.map +0 -1
  92. package/dist/lib/common/SeverityIntervalTuple.d.ts +0 -7
  93. package/dist/lib/common/SeverityIntervalTuple.js +0 -16
  94. package/dist/lib/common/SeverityIntervalTuple.js.map +0 -1
  95. package/dist/lib/common/ShieldexConfig.d.ts +0 -9
  96. package/dist/lib/common/ShieldexConfig.js +0 -36
  97. package/dist/lib/common/ShieldexConfig.js.map +0 -1
  98. package/dist/lib/common/StringIntValue.d.ts +0 -5
  99. package/dist/lib/common/StringIntValue.js +0 -16
  100. package/dist/lib/common/StringIntValue.js.map +0 -1
  101. package/dist/lib/common/StringKeyIntValue.d.ts +0 -5
  102. package/dist/lib/common/StringKeyIntValue.js +0 -16
  103. package/dist/lib/common/StringKeyIntValue.js.map +0 -1
  104. package/dist/lib/common/StringKeyValue.d.ts +0 -5
  105. package/dist/lib/common/StringKeyValue.js +0 -16
  106. package/dist/lib/common/StringKeyValue.js.map +0 -1
  107. package/dist/lib/common/Thresholds.d.ts +0 -4
  108. package/dist/lib/common/Thresholds.js +0 -11
  109. package/dist/lib/common/Thresholds.js.map +0 -1
  110. package/dist/lib/common/TimeDataPoint.d.ts +0 -5
  111. package/dist/lib/common/TimeDataPoint.js +0 -16
  112. package/dist/lib/common/TimeDataPoint.js.map +0 -1
  113. package/dist/lib/common/TimeDataPoint2D.d.ts +0 -6
  114. package/dist/lib/common/TimeDataPoint2D.js +0 -16
  115. package/dist/lib/common/TimeDataPoint2D.js.map +0 -1
  116. package/dist/lib/common/TimeDataPointFloat.d.ts +0 -5
  117. package/dist/lib/common/TimeDataPointFloat.js +0 -16
  118. package/dist/lib/common/TimeDataPointFloat.js.map +0 -1
  119. package/dist/lib/common/TimeFrame.d.ts +0 -5
  120. package/dist/lib/common/TimeFrame.js +0 -16
  121. package/dist/lib/common/TimeFrame.js.map +0 -1
  122. package/dist/lib/common/TimeSeries.d.ts +0 -8
  123. package/dist/lib/common/TimeSeries.js +0 -21
  124. package/dist/lib/common/TimeSeries.js.map +0 -1
  125. package/dist/lib/common/TimeSeriesOf2D.d.ts +0 -8
  126. package/dist/lib/common/TimeSeriesOf2D.js +0 -21
  127. package/dist/lib/common/TimeSeriesOf2D.js.map +0 -1
  128. package/dist/lib/common/TimeSeriesOfDataConsumption.d.ts +0 -8
  129. package/dist/lib/common/TimeSeriesOfDataConsumption.js +0 -21
  130. package/dist/lib/common/TimeSeriesOfDataConsumption.js.map +0 -1
  131. package/dist/lib/common/TimeSeriesOfFloat.d.ts +0 -8
  132. package/dist/lib/common/TimeSeriesOfFloat.js +0 -21
  133. package/dist/lib/common/TimeSeriesOfFloat.js.map +0 -1
  134. package/dist/lib/common/TokenData.d.ts +0 -12
  135. package/dist/lib/common/TokenData.js +0 -36
  136. package/dist/lib/common/TokenData.js.map +0 -1
  137. package/dist/lib/common/Tuple.d.ts +0 -5
  138. package/dist/lib/common/Tuple.js +0 -16
  139. package/dist/lib/common/Tuple.js.map +0 -1
  140. package/dist/lib/common/UsageTransform.d.ts +0 -10
  141. package/dist/lib/common/UsageTransform.js +0 -36
  142. package/dist/lib/common/UsageTransform.js.map +0 -1
  143. package/dist/lib/common/ZScore.d.ts +0 -5
  144. package/dist/lib/common/ZScore.js +0 -16
  145. package/dist/lib/common/ZScore.js.map +0 -1
  146. package/dist/lib/common/index.d.ts +0 -41
  147. package/dist/lib/common/index.js +0 -42
  148. package/dist/lib/common/index.js.map +0 -1
  149. package/dist/lib/entities/Account.d.ts +0 -17
  150. package/dist/lib/entities/Account.js +0 -25
  151. package/dist/lib/entities/Account.js.map +0 -1
  152. package/dist/lib/entities/AccountDTO.d.ts +0 -19
  153. package/dist/lib/entities/AccountDTO.js +0 -27
  154. package/dist/lib/entities/AccountDTO.js.map +0 -1
  155. package/dist/lib/entities/AccountSettings.d.ts +0 -10
  156. package/dist/lib/entities/AccountSettings.js +0 -26
  157. package/dist/lib/entities/AccountSettings.js.map +0 -1
  158. package/dist/lib/entities/Action.d.ts +0 -10
  159. package/dist/lib/entities/Action.js +0 -17
  160. package/dist/lib/entities/Action.js.map +0 -1
  161. package/dist/lib/entities/Alert.d.ts +0 -34
  162. package/dist/lib/entities/Alert.js +0 -54
  163. package/dist/lib/entities/Alert.js.map +0 -1
  164. package/dist/lib/entities/AlertWithDevice.d.ts +0 -36
  165. package/dist/lib/entities/AlertWithDevice.js +0 -53
  166. package/dist/lib/entities/AlertWithDevice.js.map +0 -1
  167. package/dist/lib/entities/ApiKey.d.ts +0 -11
  168. package/dist/lib/entities/ApiKey.js +0 -19
  169. package/dist/lib/entities/ApiKey.js.map +0 -1
  170. package/dist/lib/entities/AuditLog.d.ts +0 -13
  171. package/dist/lib/entities/AuditLog.js +0 -23
  172. package/dist/lib/entities/AuditLog.js.map +0 -1
  173. package/dist/lib/entities/BulkDevices.d.ts +0 -5
  174. package/dist/lib/entities/BulkDevices.js +0 -11
  175. package/dist/lib/entities/BulkDevices.js.map +0 -1
  176. package/dist/lib/entities/Checkpoint.d.ts +0 -23
  177. package/dist/lib/entities/Checkpoint.js +0 -45
  178. package/dist/lib/entities/Checkpoint.js.map +0 -1
  179. package/dist/lib/entities/ComplianceReportSettings.d.ts +0 -7
  180. package/dist/lib/entities/ComplianceReportSettings.js +0 -26
  181. package/dist/lib/entities/ComplianceReportSettings.js.map +0 -1
  182. package/dist/lib/entities/Condition.d.ts +0 -8
  183. package/dist/lib/entities/Condition.js +0 -25
  184. package/dist/lib/entities/Condition.js.map +0 -1
  185. package/dist/lib/entities/ConfigParam.d.ts +0 -4
  186. package/dist/lib/entities/ConfigParam.js +0 -8
  187. package/dist/lib/entities/ConfigParam.js.map +0 -1
  188. package/dist/lib/entities/DNSRecord.d.ts +0 -12
  189. package/dist/lib/entities/DNSRecord.js +0 -25
  190. package/dist/lib/entities/DNSRecord.js.map +0 -1
  191. package/dist/lib/entities/DataIngestion.d.ts +0 -18
  192. package/dist/lib/entities/DataIngestion.js +0 -66
  193. package/dist/lib/entities/DataIngestion.js.map +0 -1
  194. package/dist/lib/entities/DataPointOfDeviceReport.d.ts +0 -6
  195. package/dist/lib/entities/DataPointOfDeviceReport.js +0 -16
  196. package/dist/lib/entities/DataPointOfDeviceReport.js.map +0 -1
  197. package/dist/lib/entities/Device.d.ts +0 -30
  198. package/dist/lib/entities/Device.js +0 -49
  199. package/dist/lib/entities/Device.js.map +0 -1
  200. package/dist/lib/entities/DeviceReport.d.ts +0 -9
  201. package/dist/lib/entities/DeviceReport.js +0 -17
  202. package/dist/lib/entities/DeviceReport.js.map +0 -1
  203. package/dist/lib/entities/DeviceWithEvents.d.ts +0 -32
  204. package/dist/lib/entities/DeviceWithEvents.js +0 -51
  205. package/dist/lib/entities/DeviceWithEvents.js.map +0 -1
  206. package/dist/lib/entities/Distribution.d.ts +0 -7
  207. package/dist/lib/entities/Distribution.js +0 -21
  208. package/dist/lib/entities/Distribution.js.map +0 -1
  209. package/dist/lib/entities/Event.d.ts +0 -38
  210. package/dist/lib/entities/Event.js +0 -57
  211. package/dist/lib/entities/Event.js.map +0 -1
  212. package/dist/lib/entities/EventOccurrence.d.ts +0 -10
  213. package/dist/lib/entities/EventOccurrence.js +0 -31
  214. package/dist/lib/entities/EventOccurrence.js.map +0 -1
  215. package/dist/lib/entities/EventWithDevice.d.ts +0 -39
  216. package/dist/lib/entities/EventWithDevice.js +0 -55
  217. package/dist/lib/entities/EventWithDevice.js.map +0 -1
  218. package/dist/lib/entities/Feature.d.ts +0 -6
  219. package/dist/lib/entities/Feature.js +0 -9
  220. package/dist/lib/entities/Feature.js.map +0 -1
  221. package/dist/lib/entities/FeaturesGroup.d.ts +0 -6
  222. package/dist/lib/entities/FeaturesGroup.js +0 -9
  223. package/dist/lib/entities/FeaturesGroup.js.map +0 -1
  224. package/dist/lib/entities/Group.d.ts +0 -8
  225. package/dist/lib/entities/Group.js +0 -13
  226. package/dist/lib/entities/Group.js.map +0 -1
  227. package/dist/lib/entities/Image.d.ts +0 -5
  228. package/dist/lib/entities/Image.js +0 -10
  229. package/dist/lib/entities/Image.js.map +0 -1
  230. package/dist/lib/entities/Insight.d.ts +0 -18
  231. package/dist/lib/entities/Insight.js +0 -28
  232. package/dist/lib/entities/Insight.js.map +0 -1
  233. package/dist/lib/entities/InsightQuery.d.ts +0 -10
  234. package/dist/lib/entities/InsightQuery.js +0 -16
  235. package/dist/lib/entities/InsightQuery.js.map +0 -1
  236. package/dist/lib/entities/InsightSpec.d.ts +0 -9
  237. package/dist/lib/entities/InsightSpec.js +0 -16
  238. package/dist/lib/entities/InsightSpec.js.map +0 -1
  239. package/dist/lib/entities/IntDistribution.d.ts +0 -7
  240. package/dist/lib/entities/IntDistribution.js +0 -21
  241. package/dist/lib/entities/IntDistribution.js.map +0 -1
  242. package/dist/lib/entities/Integration.d.ts +0 -31
  243. package/dist/lib/entities/Integration.js +0 -47
  244. package/dist/lib/entities/Integration.js.map +0 -1
  245. package/dist/lib/entities/Member.d.ts +0 -7
  246. package/dist/lib/entities/Member.js +0 -12
  247. package/dist/lib/entities/Member.js.map +0 -1
  248. package/dist/lib/entities/Radius.d.ts +0 -15
  249. package/dist/lib/entities/Radius.js +0 -27
  250. package/dist/lib/entities/Radius.js.map +0 -1
  251. package/dist/lib/entities/Report.d.ts +0 -13
  252. package/dist/lib/entities/Report.js +0 -21
  253. package/dist/lib/entities/Report.js.map +0 -1
  254. package/dist/lib/entities/Rule.d.ts +0 -25
  255. package/dist/lib/entities/Rule.js +0 -37
  256. package/dist/lib/entities/Rule.js.map +0 -1
  257. package/dist/lib/entities/RuleTemplate.d.ts +0 -14
  258. package/dist/lib/entities/RuleTemplate.js +0 -21
  259. package/dist/lib/entities/RuleTemplate.js.map +0 -1
  260. package/dist/lib/entities/SIM.d.ts +0 -8
  261. package/dist/lib/entities/SIM.js +0 -31
  262. package/dist/lib/entities/SIM.js.map +0 -1
  263. package/dist/lib/entities/ServiceStatus.d.ts +0 -8
  264. package/dist/lib/entities/ServiceStatus.js +0 -15
  265. package/dist/lib/entities/ServiceStatus.js.map +0 -1
  266. package/dist/lib/entities/SessionRecord.d.ts +0 -22
  267. package/dist/lib/entities/SessionRecord.js +0 -46
  268. package/dist/lib/entities/SessionRecord.js.map +0 -1
  269. package/dist/lib/entities/Shieldex.d.ts +0 -7
  270. package/dist/lib/entities/Shieldex.js +0 -13
  271. package/dist/lib/entities/Shieldex.js.map +0 -1
  272. package/dist/lib/entities/Stream.d.ts +0 -11
  273. package/dist/lib/entities/Stream.js +0 -17
  274. package/dist/lib/entities/Stream.js.map +0 -1
  275. package/dist/lib/entities/StreamAnalyticsConfig.d.ts +0 -12
  276. package/dist/lib/entities/StreamAnalyticsConfig.js +0 -15
  277. package/dist/lib/entities/StreamAnalyticsConfig.js.map +0 -1
  278. package/dist/lib/entities/StreamConfig.d.ts +0 -19
  279. package/dist/lib/entities/StreamConfig.js +0 -46
  280. package/dist/lib/entities/StreamConfig.js.map +0 -1
  281. package/dist/lib/entities/TeaserPopUpSettings.d.ts +0 -6
  282. package/dist/lib/entities/TeaserPopUpSettings.js +0 -21
  283. package/dist/lib/entities/TeaserPopUpSettings.js.map +0 -1
  284. package/dist/lib/entities/TimeSeriesOfDeviceReport.d.ts +0 -8
  285. package/dist/lib/entities/TimeSeriesOfDeviceReport.js +0 -21
  286. package/dist/lib/entities/TimeSeriesOfDeviceReport.js.map +0 -1
  287. package/dist/lib/entities/UsageRecord.d.ts +0 -32
  288. package/dist/lib/entities/UsageRecord.js +0 -66
  289. package/dist/lib/entities/UsageRecord.js.map +0 -1
  290. package/dist/lib/entities/User.d.ts +0 -16
  291. package/dist/lib/entities/User.js +0 -26
  292. package/dist/lib/entities/User.js.map +0 -1
  293. package/dist/lib/entities/UserMembership.d.ts +0 -14
  294. package/dist/lib/entities/UserMembership.js +0 -21
  295. package/dist/lib/entities/UserMembership.js.map +0 -1
  296. package/dist/lib/entities/UserMemberships.d.ts +0 -14
  297. package/dist/lib/entities/UserMemberships.js +0 -21
  298. package/dist/lib/entities/UserMemberships.js.map +0 -1
  299. package/dist/lib/entities/index.d.ts +0 -50
  300. package/dist/lib/entities/index.js +0 -51
  301. package/dist/lib/entities/index.js.map +0 -1
  302. package/dist/lib/enums/AccountStatusCode.d.ts +0 -7
  303. package/dist/lib/enums/AccountStatusCode.js +0 -22
  304. package/dist/lib/enums/AccountStatusCode.js.map +0 -1
  305. package/dist/lib/enums/AccountTypeCode.d.ts +0 -8
  306. package/dist/lib/enums/AccountTypeCode.js +0 -25
  307. package/dist/lib/enums/AccountTypeCode.js.map +0 -1
  308. package/dist/lib/enums/DataSourceCode.d.ts +0 -7
  309. package/dist/lib/enums/DataSourceCode.js +0 -22
  310. package/dist/lib/enums/DataSourceCode.js.map +0 -1
  311. package/dist/lib/enums/DeviceActionCode.d.ts +0 -8
  312. package/dist/lib/enums/DeviceActionCode.js +0 -25
  313. package/dist/lib/enums/DeviceActionCode.js.map +0 -1
  314. package/dist/lib/enums/DeviceCreationCode.d.ts +0 -8
  315. package/dist/lib/enums/DeviceCreationCode.js +0 -25
  316. package/dist/lib/enums/DeviceCreationCode.js.map +0 -1
  317. package/dist/lib/enums/DeviceIdentityCode.d.ts +0 -11
  318. package/dist/lib/enums/DeviceIdentityCode.js +0 -34
  319. package/dist/lib/enums/DeviceIdentityCode.js.map +0 -1
  320. package/dist/lib/enums/DeviceStatusCode.d.ts +0 -8
  321. package/dist/lib/enums/DeviceStatusCode.js +0 -25
  322. package/dist/lib/enums/DeviceStatusCode.js.map +0 -1
  323. package/dist/lib/enums/DeviceTypeCode.d.ts +0 -18
  324. package/dist/lib/enums/DeviceTypeCode.js +0 -55
  325. package/dist/lib/enums/DeviceTypeCode.js.map +0 -1
  326. package/dist/lib/enums/DirectionContextCode.d.ts +0 -8
  327. package/dist/lib/enums/DirectionContextCode.js +0 -25
  328. package/dist/lib/enums/DirectionContextCode.js.map +0 -1
  329. package/dist/lib/enums/EventCategoryCode.d.ts +0 -6
  330. package/dist/lib/enums/EventCategoryCode.js +0 -19
  331. package/dist/lib/enums/EventCategoryCode.js.map +0 -1
  332. package/dist/lib/enums/EventStatusCode.d.ts +0 -8
  333. package/dist/lib/enums/EventStatusCode.js +0 -25
  334. package/dist/lib/enums/EventStatusCode.js.map +0 -1
  335. package/dist/lib/enums/EventTypeCode.d.ts +0 -23
  336. package/dist/lib/enums/EventTypeCode.js +0 -70
  337. package/dist/lib/enums/EventTypeCode.js.map +0 -1
  338. package/dist/lib/enums/FeatureCode.d.ts +0 -14
  339. package/dist/lib/enums/FeatureCode.js +0 -43
  340. package/dist/lib/enums/FeatureCode.js.map +0 -1
  341. package/dist/lib/enums/HomePageViewCode.d.ts +0 -7
  342. package/dist/lib/enums/HomePageViewCode.js +0 -22
  343. package/dist/lib/enums/HomePageViewCode.js.map +0 -1
  344. package/dist/lib/enums/HttpMethodCode.d.ts +0 -9
  345. package/dist/lib/enums/HttpMethodCode.js +0 -28
  346. package/dist/lib/enums/HttpMethodCode.js.map +0 -1
  347. package/dist/lib/enums/InsightStatusCode.d.ts +0 -7
  348. package/dist/lib/enums/InsightStatusCode.js +0 -22
  349. package/dist/lib/enums/InsightStatusCode.js.map +0 -1
  350. package/dist/lib/enums/InsightTypeCode.d.ts +0 -6
  351. package/dist/lib/enums/InsightTypeCode.js +0 -19
  352. package/dist/lib/enums/InsightTypeCode.js.map +0 -1
  353. package/dist/lib/enums/IntegrationTriggerCode.d.ts +0 -6
  354. package/dist/lib/enums/IntegrationTriggerCode.js +0 -19
  355. package/dist/lib/enums/IntegrationTriggerCode.js.map +0 -1
  356. package/dist/lib/enums/IntegrationTypeCode.d.ts +0 -8
  357. package/dist/lib/enums/IntegrationTypeCode.js +0 -25
  358. package/dist/lib/enums/IntegrationTypeCode.js.map +0 -1
  359. package/dist/lib/enums/MemberRoleCode.d.ts +0 -8
  360. package/dist/lib/enums/MemberRoleCode.js +0 -25
  361. package/dist/lib/enums/MemberRoleCode.js.map +0 -1
  362. package/dist/lib/enums/NetworkMapTypeCode.d.ts +0 -7
  363. package/dist/lib/enums/NetworkMapTypeCode.js +0 -22
  364. package/dist/lib/enums/NetworkMapTypeCode.js.map +0 -1
  365. package/dist/lib/enums/OperatorCode.d.ts +0 -15
  366. package/dist/lib/enums/OperatorCode.js +0 -46
  367. package/dist/lib/enums/OperatorCode.js.map +0 -1
  368. package/dist/lib/enums/PermissionCode.d.ts +0 -9
  369. package/dist/lib/enums/PermissionCode.js +0 -28
  370. package/dist/lib/enums/PermissionCode.js.map +0 -1
  371. package/dist/lib/enums/ReportTypeCode.d.ts +0 -7
  372. package/dist/lib/enums/ReportTypeCode.js +0 -22
  373. package/dist/lib/enums/ReportTypeCode.js.map +0 -1
  374. package/dist/lib/enums/RuleTypeCode.d.ts +0 -7
  375. package/dist/lib/enums/RuleTypeCode.js +0 -22
  376. package/dist/lib/enums/RuleTypeCode.js.map +0 -1
  377. package/dist/lib/enums/SeverityTypeCode.d.ts +0 -8
  378. package/dist/lib/enums/SeverityTypeCode.js +0 -25
  379. package/dist/lib/enums/SeverityTypeCode.js.map +0 -1
  380. package/dist/lib/enums/TrafficDirectionCode.d.ts +0 -7
  381. package/dist/lib/enums/TrafficDirectionCode.js +0 -22
  382. package/dist/lib/enums/TrafficDirectionCode.js.map +0 -1
  383. package/dist/lib/enums/UserStatusCode.d.ts +0 -8
  384. package/dist/lib/enums/UserStatusCode.js +0 -25
  385. package/dist/lib/enums/UserStatusCode.js.map +0 -1
  386. package/dist/lib/enums/UserTypeCode.d.ts +0 -8
  387. package/dist/lib/enums/UserTypeCode.js +0 -25
  388. package/dist/lib/enums/UserTypeCode.js.map +0 -1
  389. package/dist/lib/enums/index.d.ts +0 -29
  390. package/dist/lib/enums/index.js +0 -30
  391. package/dist/lib/enums/index.js.map +0 -1
  392. package/dist/lib/index.d.ts +0 -5
  393. package/dist/lib/index.js +0 -6
  394. package/dist/lib/index.js.map +0 -1
  395. package/dist/lib/pulse-client.d.ts +0 -59
  396. package/dist/lib/pulse-client.js +0 -156
  397. package/dist/lib/pulse-client.js.map +0 -1
  398. package/dist/lib/services/index.d.ts +0 -26
  399. package/dist/lib/services/index.js +0 -27
  400. package/dist/lib/services/index.js.map +0 -1
  401. package/dist/lib/services/services.export.d.ts +0 -26
  402. package/dist/lib/services/services.export.js +0 -53
  403. package/dist/lib/services/services.export.js.map +0 -1
  404. package/dist/lib/services/supportStreamAnalyticsConfig.d.ts +0 -29
  405. package/dist/lib/services/supportStreamAnalyticsConfig.js +0 -59
  406. package/dist/lib/services/supportStreamAnalyticsConfig.js.map +0 -1
  407. package/dist/lib/services/sysAccountsService.d.ts +0 -45
  408. package/dist/lib/services/sysAccountsService.js +0 -83
  409. package/dist/lib/services/sysAccountsService.js.map +0 -1
  410. package/dist/lib/services/sysAuditLogService.d.ts +0 -22
  411. package/dist/lib/services/sysAuditLogService.js +0 -108
  412. package/dist/lib/services/sysAuditLogService.js.map +0 -1
  413. package/dist/lib/services/sysCheckpointsService.d.ts +0 -22
  414. package/dist/lib/services/sysCheckpointsService.js +0 -78
  415. package/dist/lib/services/sysCheckpointsService.js.map +0 -1
  416. package/dist/lib/services/sysConfigService.d.ts +0 -29
  417. package/dist/lib/services/sysConfigService.js +0 -59
  418. package/dist/lib/services/sysConfigService.js.map +0 -1
  419. package/dist/lib/services/sysFeaturesService.d.ts +0 -34
  420. package/dist/lib/services/sysFeaturesService.js +0 -78
  421. package/dist/lib/services/sysFeaturesService.js.map +0 -1
  422. package/dist/lib/services/sysGroupsService.d.ts +0 -42
  423. package/dist/lib/services/sysGroupsService.js +0 -77
  424. package/dist/lib/services/sysGroupsService.js.map +0 -1
  425. package/dist/lib/services/sysInsightsService.d.ts +0 -54
  426. package/dist/lib/services/sysInsightsService.js +0 -133
  427. package/dist/lib/services/sysInsightsService.js.map +0 -1
  428. package/dist/lib/services/sysKeysService.d.ts +0 -34
  429. package/dist/lib/services/sysKeysService.js +0 -65
  430. package/dist/lib/services/sysKeysService.js.map +0 -1
  431. package/dist/lib/services/sysMembersService.d.ts +0 -30
  432. package/dist/lib/services/sysMembersService.js +0 -65
  433. package/dist/lib/services/sysMembersService.js.map +0 -1
  434. package/dist/lib/services/sysRuleTemplatesService.d.ts +0 -29
  435. package/dist/lib/services/sysRuleTemplatesService.js +0 -59
  436. package/dist/lib/services/sysRuleTemplatesService.js.map +0 -1
  437. package/dist/lib/services/sysRulesService.d.ts +0 -34
  438. package/dist/lib/services/sysRulesService.js +0 -84
  439. package/dist/lib/services/sysRulesService.js.map +0 -1
  440. package/dist/lib/services/sysStatisticsService.d.ts +0 -25
  441. package/dist/lib/services/sysStatisticsService.js +0 -40
  442. package/dist/lib/services/sysStatisticsService.js.map +0 -1
  443. package/dist/lib/services/sysStreamsService.d.ts +0 -29
  444. package/dist/lib/services/sysStreamsService.js +0 -62
  445. package/dist/lib/services/sysStreamsService.js.map +0 -1
  446. package/dist/lib/services/sysUsersService.d.ts +0 -44
  447. package/dist/lib/services/sysUsersService.js +0 -83
  448. package/dist/lib/services/sysUsersService.js.map +0 -1
  449. package/dist/lib/services/usrAlertsService.d.ts +0 -110
  450. package/dist/lib/services/usrAlertsService.js +0 -657
  451. package/dist/lib/services/usrAlertsService.js.map +0 -1
  452. package/dist/lib/services/usrDevicesService.d.ts +0 -109
  453. package/dist/lib/services/usrDevicesService.js +0 -433
  454. package/dist/lib/services/usrDevicesService.js.map +0 -1
  455. package/dist/lib/services/usrEventsService.d.ts +0 -93
  456. package/dist/lib/services/usrEventsService.js +0 -639
  457. package/dist/lib/services/usrEventsService.js.map +0 -1
  458. package/dist/lib/services/usrInsightsService.d.ts +0 -13
  459. package/dist/lib/services/usrInsightsService.js +0 -22
  460. package/dist/lib/services/usrInsightsService.js.map +0 -1
  461. package/dist/lib/services/usrIntegrationsService.d.ts +0 -37
  462. package/dist/lib/services/usrIntegrationsService.js +0 -77
  463. package/dist/lib/services/usrIntegrationsService.js.map +0 -1
  464. package/dist/lib/services/usrMembersService.d.ts +0 -34
  465. package/dist/lib/services/usrMembersService.js +0 -78
  466. package/dist/lib/services/usrMembersService.js.map +0 -1
  467. package/dist/lib/services/usrNetworkService.d.ts +0 -18
  468. package/dist/lib/services/usrNetworkService.js +0 -84
  469. package/dist/lib/services/usrNetworkService.js.map +0 -1
  470. package/dist/lib/services/usrReportsService.d.ts +0 -47
  471. package/dist/lib/services/usrReportsService.js +0 -126
  472. package/dist/lib/services/usrReportsService.js.map +0 -1
  473. package/dist/lib/services/usrRulesService.d.ts +0 -34
  474. package/dist/lib/services/usrRulesService.js +0 -81
  475. package/dist/lib/services/usrRulesService.js.map +0 -1
  476. package/dist/lib/services/usrUserService.d.ts +0 -65
  477. package/dist/lib/services/usrUserService.js +0 -90
  478. package/dist/lib/services/usrUserService.js.map +0 -1
  479. package/dist/utils/ActionResponse.d.ts +0 -5
  480. package/dist/utils/ActionResponse.js +0 -9
  481. package/dist/utils/ActionResponse.js.map +0 -1
  482. package/dist/utils/BaseRestResponse.d.ts +0 -4
  483. package/dist/utils/BaseRestResponse.js +0 -8
  484. package/dist/utils/BaseRestResponse.js.map +0 -1
  485. package/dist/utils/EntitiesResponse.d.ts +0 -8
  486. package/dist/utils/EntitiesResponse.js +0 -15
  487. package/dist/utils/EntitiesResponse.js.map +0 -1
  488. package/dist/utils/EntityResponse.d.ts +0 -8
  489. package/dist/utils/EntityResponse.js +0 -15
  490. package/dist/utils/EntityResponse.js.map +0 -1
  491. package/dist/utils/index.d.ts +0 -5
  492. package/dist/utils/index.js +0 -6
  493. package/dist/utils/index.js.map +0 -1
  494. package/dist/utils/rest-axios-setup.d.ts +0 -3
  495. package/dist/utils/rest-axios-setup.js +0 -8
  496. package/dist/utils/rest-axios-setup.js.map +0 -1
  497. package/dist/utils/rest-util.d.ts +0 -15
  498. package/dist/utils/rest-util.js +0 -101
  499. package/dist/utils/rest-util.js.map +0 -1
  500. package/src/config.ts +0 -6
  501. package/src/index.ts +0 -4
  502. package/src/utils/ActionResponse.ts +0 -13
  503. package/src/utils/BaseRestResponse.ts +0 -10
  504. package/src/utils/EntitiesResponse.ts +0 -21
  505. package/src/utils/EntityResponse.ts +0 -20
  506. package/src/utils/index.ts +0 -5
  507. package/src/utils/rest-axios-setup.ts +0 -10
  508. package/src/utils/rest-util.ts +0 -113
  509. package/tsconfig.json +0 -77
package/LICENSE CHANGED
@@ -1,7 +1,21 @@
1
- ISC License
1
+ MIT License
2
2
 
3
- Copyright 2024 Shield-IoT
3
+ Copyright (c) 2021 Tom Chen (tomchen.org)
4
4
 
5
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
6
11
 
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,25 +1,44 @@
1
- # TypeScript Client Library for pulse-api
2
- This folder includes the skeleton cod of the TypeScript library for the pulse-api service.
3
- The actual code (domain model and services) is generated by the processor.
4
- This is a native typescript with no Angular dependency
1
+ # Step by Step manual install
5
2
 
6
- # pulse-lib
7
- TypeScript Client Library for pulse-api based on pure TypeScript and [axios](https://axios-http.com/)
8
3
 
9
- ## Installation
10
- `npm install @shieldiot/pulse-lib --save`
4
+ ##### Install dependencies with npm:
11
5
 
12
- ## Usage
13
- Consume PulseIoT API services from the client library.
14
- To use this library, one must add the following HTTP headers to any request:
15
- * X-API-KEY - API provided by ShieldIoT to identify the integrated system
16
- * X-ACCESS-TOKEN - Security token to identify the user/service
6
+ Install dependencies:
7
+ `npm i`
17
8
 
18
- The X-API-KEY header can be set in the library constructor but the X-ACCESS-TOKEN should be injected dynamically using HTTP INTERCEPTORS
9
+ Build package:
10
+ `npm run build`
19
11
 
20
- ```javascript
21
- import PulseClient from "@shieldiot/pulse-lib";
22
12
 
23
- cli = new PulseClient();
13
+ ##### Test localy:
14
+
15
+ Create a symlink in the global folder:
16
+ `npm link`
17
+
18
+ Go to another folder (the consumer project) and run:
19
+ `npm link pulse-lib`
20
+
21
+ Create sample code in the consumer folder:
24
22
 
23
+ ```javascript
24
+ import { Num } from 'pulse-lib'
25
+ console.log(new Num(5).add(new Num(6)).val() === 11)
25
26
  ```
27
+
28
+ Build and run the project to test the library
29
+
30
+ Uninstall the globally-installed package:
31
+ `npm uninstall pulse-lib -g`
32
+
33
+ # Step by Step CI/CD install (repeat git actions workflow)
34
+
35
+ Set env variable:
36
+ `export NODE_AUTH_TOKEN="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"`
37
+
38
+ Add Scope:
39
+ `node tools/packagejson name pulse-lib`
40
+
41
+ Publish to NPM
42
+ `npm publish`
43
+
44
+
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Num = void 0;
4
+ var Num = /** @class */ (function () {
5
+ function Num(n) {
6
+ this.value = n;
7
+ }
8
+ Num.prototype.val = function () {
9
+ return this.value;
10
+ };
11
+ Num.prototype.add = function (n2) {
12
+ this.value += n2.val();
13
+ return this;
14
+ };
15
+ Num.prototype.toString = function () {
16
+ return this.val().toString();
17
+ };
18
+ Num.addAll = function (numArr) {
19
+ return new Num(numArr.map(function (n) { return n.val(); }).reduce(function (a, b) { return a + b; }, 0));
20
+ };
21
+ return Num;
22
+ }());
23
+ exports.Num = Num;
24
+ /***
25
+ * Go to TypeScript's official website https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html to read more.
26
+ *
27
+ * The following text is copied from
28
+ * https://github.com/microsoft/TypeScript-New-Handbook/blob/master/intros/TypeScript%20for%20the%20New%20Programmer.md
29
+ * and is under the MIT License
30
+ */
31
+ /*
32
+
33
+ * TypeScript for the New Programmer
34
+ * What is JavaScript?
35
+ * Runs everywhere
36
+ * Untyped, error-prone language
37
+ * Super common
38
+
39
+ # TypeScript for the New Programmer
40
+
41
+ Congratulations choosing TypeScript as one of your first languages - you're already making good decisions.
42
+
43
+ You've probably already heard that TypeScript is a "flavor" or "variant" of JavaScript.
44
+ The relationship between TypeScript and JavaScript is rather unique among modern programming languages, so learning more about this relationship will help you understand how TypeScript adds to JavaScript.
45
+
46
+ ## What is JavaScript? A Brief History
47
+
48
+ JavaScript started as a simple scripting language available in browers.
49
+ When the language was first invented, writing more than a few dozen lines of JavaScript (JS) in a webpage would have been somewhat unusual.
50
+ Over time, though, JS became more common and web developers used more and more JS in their webpages to create interactive experiences.
51
+ Early web browsers executed JS very slowly and this sometimes led to laggy, unresponsive pages.
52
+
53
+ Web browser developers saw the increased use of JS and started to optimize their browsers to run JS more quickly.
54
+ Web developers responded by using JS even more to increase the interactivity of their pages.
55
+ On modern websites, you might be running tens or even hundreds of thousands of lines of JS code.
56
+ The web, which started as a simple network of static pages, has evolved into a platform for rich *applications* of all kinds.
57
+
58
+ Lately, JS has also become a popular choice for non-browser scenarios, such as running servers using node.js.
59
+ The "run anywhere" nature of JS makes it an attractive choice for cross-platform development.
60
+ Many developers these days use *only* JavaScript to program their entire stack!
61
+
62
+ The net result is that a very simple language designed to provide basic webpage interactivity is now being used to write applications with millions of lines of code.
63
+
64
+ JavaScript's humble beginnings are still visible in its many *quirks* - oddities or surprises that are not typical for other programming languages.
65
+ For example, JavaScript's equality operator `==` *coerces* its arguments, leading to unexpected behavior:
66
+ ```js
67
+ if ("" == 0) {
68
+ // It is! But why??
69
+ }
70
+ ```
71
+
72
+ JavaScript also allows accessing properties which aren't present:
73
+ ```js
74
+ const obj = { width: 10, height: 15 };
75
+ // Why is this NaN? Spelling is hard!
76
+ const area = obj.width * obj.heigth;
77
+ ```
78
+
79
+ Other programming languages would usually cause these programs to either fail to start at all, or terminate the program mid-execution, if these sorts of errors occur.
80
+ When writing small programs, these quirks are annoying but manageable; when writing applications with hundreds or thousands of lines of code, these constant surprises make development slow and frustrating.
81
+
82
+ ## TypeScript: A Static Type Checker
83
+
84
+ We said earlier that other programming languages wouldn't allow those buggy programs to run at all.
85
+ Detecting errors in code without running it is referred to as *static* checking.
86
+ Determining what's an error and what's not based on the kinds of values being operated on is known as *type* checking.
87
+
88
+ Because TypeScript checks a program for errors before it's run, and does so based on the *kinds of values*, it's a *static type checker*.
89
+ For example, the snippet from earlier has an error because of the *type* of `obj`.
90
+ Here's the error TypeScript found:
91
+
92
+ ```ts
93
+ const obj = { width: 10, height: 15 };
94
+ const area = obj.width * obj.heigth;
95
+ ```
96
+
97
+ ### A Typed Superset of JavaScript
98
+
99
+ How does TypeScript relate to JavaScript, though?
100
+
101
+ #### Syntax
102
+
103
+ TypeScript is a programming language where all JavaScript syntax is legal.
104
+ Syntax refers to the way we arrange characters to form a program.
105
+ For example, this code has a *syntax* error because it's missing a `)`:
106
+
107
+ ```js
108
+ let a = (4
109
+ ```
110
+
111
+ TypeScript doesn't consider any JavaScript code to be an error because of its syntax.
112
+ This means you can take any working JavaScript code and put it in a TypeScript file without worrying about exactly how it's written.
113
+
114
+ #### Types
115
+
116
+ However, TypeScript is a *typed* superset, meaning that it adds rules about how different kinds of values can be used.
117
+ The earlier error about `obj.heigth` was not an error about the *syntax* of the program, but instead an error about using a kind of value (a *type*) in an incorrect way.
118
+
119
+ As another example, this is JavaScript code you can run in a browser that *will* print a value:
120
+ ```js
121
+ console.log(4 / []);
122
+ ```
123
+
124
+ This syntactically-legal program prints `NaN`.
125
+ TypeScript, though, considers division of number by an array to be a nonsensical operation, and will issue an error:
126
+
127
+ ```ts
128
+ console.log(4 / []);
129
+ ```
130
+
131
+ It's entirely possible you really did intend to divide a number by an array, perhaps just to see what would happen.
132
+ The vast majority of the time, though, this code is a mistake on the programmer's part.
133
+ TypeScript's type system rules are designed to allow correct programs through while still catching as many common errors as possible.
134
+ Later, we'll learn about settings you can use to configure how strictly TypeScript checks your code.
135
+
136
+ If you move some code from a JavaScript file to a TypeScript file, you might see *type errors* depending on how the code is written.
137
+ These may be legitimate problems with the code, or TypeScript being overly conservative.
138
+ Throughout this guide we'll demonstrate how to add various TypeScript syntax to make these errors go away.
139
+
140
+ #### Runtime Behavior
141
+
142
+ TypeScript is also a programming language that preserves the *runtime behavior* of JavaScript.
143
+ For example, dividing by zero in JavaScript produces `Infinity` instead of throwing a runtime exception.
144
+ TypeScript **never** changes the runtime behavior of JavaScript code.
145
+
146
+ This means code you move from JavaScript to TypeScript is **guaranteed** to do the same thing, even if TypeScript thinks that code has type errors.
147
+
148
+ Keeping the same runtime behavior as JavaScript is a foundational promise of TypeScript because it means you can easily transition between the two languages without worrying about subtle differences that might make your program stop working.
149
+
150
+ #### Erased Types
151
+
152
+ TypeScript's type system is *erased*, meaning that once your code is compiled, there is no persisted type information in the resulting JavaScript code.
153
+
154
+ TypeScript also never changes the behavior of your program based on the types it inferred.
155
+ While you might see more or fewer type errors, the type system itself has no bearing on how your program works once it's running.
156
+
157
+ Finally, TypeScript doesn't provide any additional runtime libraries.
158
+ Your programs will use the same standard library (or external libraries) as JavaScript programs, so there's no additional TypeScript-specific framework to learn.
159
+
160
+ ## Learning JavaScript and TypeScript
161
+
162
+ We frequently see the question "Should I learn JavaScript, or TypeScript instead?".
163
+
164
+ The answer is that you can't do one without doing the other!
165
+ Because TypeScript shares syntax and runtime behavior with JavaScript, anything you learn about JavaScript is helping you learn TypeScript at the same time.
166
+
167
+ There are many, many resources available for programmers learning JavaScript, and you shouldn't ignore these resources if you're writing TypeScript.
168
+ For example, there about 20 times more StackOverflow questions tagged `javascript` than `typescript`, but *all* of the `javascript` questions also apply to TypeScript.
169
+
170
+ If you find yourself searching for something like "how to sort a list in TypeScript", remember, **TypeScript is JavaScript's runtime with a build-time type system**.
171
+ The way you sort a list in TypeScript is the same way you sort a list in JavaScript.
172
+ If you find a resource that does use TypeScript, that's great too, but don't limit yourself to thinking you need TypeScript-specific answers for everyday questions about how to accomplish runtime tasks.
173
+
174
+ */
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Num = void 0;
4
+ var Num_1 = require("./Num");
5
+ Object.defineProperty(exports, "Num", { enumerable: true, get: function () { return Num_1.Num; } });
@@ -0,0 +1,171 @@
1
+ var Num = /** @class */ (function () {
2
+ function Num(n) {
3
+ this.value = n;
4
+ }
5
+ Num.prototype.val = function () {
6
+ return this.value;
7
+ };
8
+ Num.prototype.add = function (n2) {
9
+ this.value += n2.val();
10
+ return this;
11
+ };
12
+ Num.prototype.toString = function () {
13
+ return this.val().toString();
14
+ };
15
+ Num.addAll = function (numArr) {
16
+ return new Num(numArr.map(function (n) { return n.val(); }).reduce(function (a, b) { return a + b; }, 0));
17
+ };
18
+ return Num;
19
+ }());
20
+ export { Num };
21
+ /***
22
+ * Go to TypeScript's official website https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html to read more.
23
+ *
24
+ * The following text is copied from
25
+ * https://github.com/microsoft/TypeScript-New-Handbook/blob/master/intros/TypeScript%20for%20the%20New%20Programmer.md
26
+ * and is under the MIT License
27
+ */
28
+ /*
29
+
30
+ * TypeScript for the New Programmer
31
+ * What is JavaScript?
32
+ * Runs everywhere
33
+ * Untyped, error-prone language
34
+ * Super common
35
+
36
+ # TypeScript for the New Programmer
37
+
38
+ Congratulations choosing TypeScript as one of your first languages - you're already making good decisions.
39
+
40
+ You've probably already heard that TypeScript is a "flavor" or "variant" of JavaScript.
41
+ The relationship between TypeScript and JavaScript is rather unique among modern programming languages, so learning more about this relationship will help you understand how TypeScript adds to JavaScript.
42
+
43
+ ## What is JavaScript? A Brief History
44
+
45
+ JavaScript started as a simple scripting language available in browers.
46
+ When the language was first invented, writing more than a few dozen lines of JavaScript (JS) in a webpage would have been somewhat unusual.
47
+ Over time, though, JS became more common and web developers used more and more JS in their webpages to create interactive experiences.
48
+ Early web browsers executed JS very slowly and this sometimes led to laggy, unresponsive pages.
49
+
50
+ Web browser developers saw the increased use of JS and started to optimize their browsers to run JS more quickly.
51
+ Web developers responded by using JS even more to increase the interactivity of their pages.
52
+ On modern websites, you might be running tens or even hundreds of thousands of lines of JS code.
53
+ The web, which started as a simple network of static pages, has evolved into a platform for rich *applications* of all kinds.
54
+
55
+ Lately, JS has also become a popular choice for non-browser scenarios, such as running servers using node.js.
56
+ The "run anywhere" nature of JS makes it an attractive choice for cross-platform development.
57
+ Many developers these days use *only* JavaScript to program their entire stack!
58
+
59
+ The net result is that a very simple language designed to provide basic webpage interactivity is now being used to write applications with millions of lines of code.
60
+
61
+ JavaScript's humble beginnings are still visible in its many *quirks* - oddities or surprises that are not typical for other programming languages.
62
+ For example, JavaScript's equality operator `==` *coerces* its arguments, leading to unexpected behavior:
63
+ ```js
64
+ if ("" == 0) {
65
+ // It is! But why??
66
+ }
67
+ ```
68
+
69
+ JavaScript also allows accessing properties which aren't present:
70
+ ```js
71
+ const obj = { width: 10, height: 15 };
72
+ // Why is this NaN? Spelling is hard!
73
+ const area = obj.width * obj.heigth;
74
+ ```
75
+
76
+ Other programming languages would usually cause these programs to either fail to start at all, or terminate the program mid-execution, if these sorts of errors occur.
77
+ When writing small programs, these quirks are annoying but manageable; when writing applications with hundreds or thousands of lines of code, these constant surprises make development slow and frustrating.
78
+
79
+ ## TypeScript: A Static Type Checker
80
+
81
+ We said earlier that other programming languages wouldn't allow those buggy programs to run at all.
82
+ Detecting errors in code without running it is referred to as *static* checking.
83
+ Determining what's an error and what's not based on the kinds of values being operated on is known as *type* checking.
84
+
85
+ Because TypeScript checks a program for errors before it's run, and does so based on the *kinds of values*, it's a *static type checker*.
86
+ For example, the snippet from earlier has an error because of the *type* of `obj`.
87
+ Here's the error TypeScript found:
88
+
89
+ ```ts
90
+ const obj = { width: 10, height: 15 };
91
+ const area = obj.width * obj.heigth;
92
+ ```
93
+
94
+ ### A Typed Superset of JavaScript
95
+
96
+ How does TypeScript relate to JavaScript, though?
97
+
98
+ #### Syntax
99
+
100
+ TypeScript is a programming language where all JavaScript syntax is legal.
101
+ Syntax refers to the way we arrange characters to form a program.
102
+ For example, this code has a *syntax* error because it's missing a `)`:
103
+
104
+ ```js
105
+ let a = (4
106
+ ```
107
+
108
+ TypeScript doesn't consider any JavaScript code to be an error because of its syntax.
109
+ This means you can take any working JavaScript code and put it in a TypeScript file without worrying about exactly how it's written.
110
+
111
+ #### Types
112
+
113
+ However, TypeScript is a *typed* superset, meaning that it adds rules about how different kinds of values can be used.
114
+ The earlier error about `obj.heigth` was not an error about the *syntax* of the program, but instead an error about using a kind of value (a *type*) in an incorrect way.
115
+
116
+ As another example, this is JavaScript code you can run in a browser that *will* print a value:
117
+ ```js
118
+ console.log(4 / []);
119
+ ```
120
+
121
+ This syntactically-legal program prints `NaN`.
122
+ TypeScript, though, considers division of number by an array to be a nonsensical operation, and will issue an error:
123
+
124
+ ```ts
125
+ console.log(4 / []);
126
+ ```
127
+
128
+ It's entirely possible you really did intend to divide a number by an array, perhaps just to see what would happen.
129
+ The vast majority of the time, though, this code is a mistake on the programmer's part.
130
+ TypeScript's type system rules are designed to allow correct programs through while still catching as many common errors as possible.
131
+ Later, we'll learn about settings you can use to configure how strictly TypeScript checks your code.
132
+
133
+ If you move some code from a JavaScript file to a TypeScript file, you might see *type errors* depending on how the code is written.
134
+ These may be legitimate problems with the code, or TypeScript being overly conservative.
135
+ Throughout this guide we'll demonstrate how to add various TypeScript syntax to make these errors go away.
136
+
137
+ #### Runtime Behavior
138
+
139
+ TypeScript is also a programming language that preserves the *runtime behavior* of JavaScript.
140
+ For example, dividing by zero in JavaScript produces `Infinity` instead of throwing a runtime exception.
141
+ TypeScript **never** changes the runtime behavior of JavaScript code.
142
+
143
+ This means code you move from JavaScript to TypeScript is **guaranteed** to do the same thing, even if TypeScript thinks that code has type errors.
144
+
145
+ Keeping the same runtime behavior as JavaScript is a foundational promise of TypeScript because it means you can easily transition between the two languages without worrying about subtle differences that might make your program stop working.
146
+
147
+ #### Erased Types
148
+
149
+ TypeScript's type system is *erased*, meaning that once your code is compiled, there is no persisted type information in the resulting JavaScript code.
150
+
151
+ TypeScript also never changes the behavior of your program based on the types it inferred.
152
+ While you might see more or fewer type errors, the type system itself has no bearing on how your program works once it's running.
153
+
154
+ Finally, TypeScript doesn't provide any additional runtime libraries.
155
+ Your programs will use the same standard library (or external libraries) as JavaScript programs, so there's no additional TypeScript-specific framework to learn.
156
+
157
+ ## Learning JavaScript and TypeScript
158
+
159
+ We frequently see the question "Should I learn JavaScript, or TypeScript instead?".
160
+
161
+ The answer is that you can't do one without doing the other!
162
+ Because TypeScript shares syntax and runtime behavior with JavaScript, anything you learn about JavaScript is helping you learn TypeScript at the same time.
163
+
164
+ There are many, many resources available for programmers learning JavaScript, and you shouldn't ignore these resources if you're writing TypeScript.
165
+ For example, there about 20 times more StackOverflow questions tagged `javascript` than `typescript`, but *all* of the `javascript` questions also apply to TypeScript.
166
+
167
+ If you find yourself searching for something like "how to sort a list in TypeScript", remember, **TypeScript is JavaScript's runtime with a build-time type system**.
168
+ The way you sort a list in TypeScript is the same way you sort a list in JavaScript.
169
+ If you find a resource that does use TypeScript, that's great too, but don't limit yourself to thinking you need TypeScript-specific answers for everyday questions about how to accomplish runtime tasks.
170
+
171
+ */
@@ -0,0 +1,2 @@
1
+ import { Num } from './Num';
2
+ export { Num };
@@ -0,0 +1,15 @@
1
+ export declare class Num {
2
+ value: number;
3
+ constructor(n: number);
4
+ val(): number;
5
+ add(n2: Num): Num;
6
+ toString(): string;
7
+ static addAll(numArr: Array<Num>): Num;
8
+ }
9
+ /***
10
+ * Go to TypeScript's official website https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html to read more.
11
+ *
12
+ * The following text is copied from
13
+ * https://github.com/microsoft/TypeScript-New-Handbook/blob/master/intros/TypeScript%20for%20the%20New%20Programmer.md
14
+ * and is under the MIT License
15
+ */
@@ -0,0 +1,2 @@
1
+ import { Num } from './Num';
2
+ export { Num };
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.exampleTypescriptPackage=t():e.exampleTypescriptPackage=t()}(this,(()=>(()=>{"use strict";var e={49:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Num=void 0;var r=function(){function e(e){this.value=e}return e.prototype.val=function(){return this.value},e.prototype.add=function(e){return this.value+=e.val(),this},e.prototype.toString=function(){return this.val().toString()},e.addAll=function(t){return new e(t.map((function(e){return e.val()})).reduce((function(e,t){return e+t}),0))},e}();t.Num=r}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n](u,u.exports,r),u.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.Num=void 0;var t=r(49);Object.defineProperty(e,"Num",{enumerable:!0,get:function(){return t.Num}})})(),n})()));
package/package.json CHANGED
@@ -1,28 +1,73 @@
1
1
  {
2
2
  "name": "@shieldiot/pulse-lib",
3
- "author": "Shield IoT",
4
- "license": "ISC",
5
- "version": "1.0.8",
6
- "description": "A TypeScript library for the pulse-api based on axios",
3
+ "version": "1.0.10",
4
+ "description": "",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "umd:main": "dist/umd/index.js",
8
+ "types": "dist/types/index.d.js",
9
+ "scripts": {
10
+ "_postinstall": "husky install",
11
+ "prepublishOnly": "pinst --disable",
12
+ "postpublish": "pinst --enable",
13
+ "build": "npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types",
14
+ "build:cjs": "node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json",
15
+ "build:esm": "node tools/cleanup esm && tsc -p config/tsconfig.esm.json",
16
+ "build:umd": "node tools/cleanup umd && webpack --config config/webpack.config.js",
17
+ "build:types": "node tools/cleanup types && tsc -p config/tsconfig.types.json",
18
+ "clean": "node tools/cleanup",
19
+ "package": "npm run build && npm pack",
20
+ "test": "jest --no-cache --runInBand",
21
+ "test:cov": "jest --coverage --no-cache --runInBand",
22
+ "addscope": "node tools/packagejson name @pulseiot/pulse-lib-example"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
7
30
  "keywords": [
8
- "shieldiot",
9
- "pulse"
31
+ "example",
32
+ "typescript",
33
+ "npm",
34
+ "package",
35
+ "sample",
36
+ "boilerplate",
37
+ "starter",
38
+ "demo",
39
+ "cjs",
40
+ "esm",
41
+ "umd"
10
42
  ],
11
- "main": "dist/index.js",
12
- "type": "module",
13
- "types": "dist/index.d.ts",
14
- "scripts": {
15
- "build": "tsc -p tsconfig.json",
16
- "start": "node dist/index.js"
43
+ "author": "Motty Cohen <motty.cohen@shieldiot.io>",
44
+ "license": "MIT",
45
+ "homepage": "https://github.com/shieldiot/pulse-lib-example",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git@github.com:shieldiot/pulse-lib-example.git"
17
49
  },
18
- "dependencies": {
19
- "axios": "^1.7.2",
20
- "rxjs": "^7.4.0"
50
+ "bugs": {
51
+ "url": "https://github.com/shieldiot/pulse-lib-example/issues"
21
52
  },
53
+ "dependencies": {},
22
54
  "devDependencies": {
23
- "@tsconfig/node20": "^20.1.2",
24
- "@types/node": "^20.8.10",
25
- "ts-node": "^10.9.1",
26
- "typescript": "^5.2.2"
55
+ "@commitlint/cli": "^19.5.0",
56
+ "@commitlint/config-conventional": "^19.5.0",
57
+ "@types/jest": "^29.5.13",
58
+ "@typescript-eslint/eslint-plugin": "^8.8.1",
59
+ "@typescript-eslint/parser": "^8.8.1",
60
+ "eslint": "^9.12.0",
61
+ "eslint-config-prettier": "^9.1.0",
62
+ "eslint-plugin-prettier": "^5.2.1",
63
+ "husky": "^9.1.6",
64
+ "jest": "^29.7.0",
65
+ "pinst": "^3.0.0",
66
+ "prettier": "^3.3.3",
67
+ "ts-jest": "^29.2.5",
68
+ "ts-loader": "^9.5.1",
69
+ "typescript": "~5.5.3",
70
+ "webpack": "^5.95.0",
71
+ "webpack-cli": "^5.1.4"
27
72
  }
28
73
  }
package/dist/config.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare class PulseConfig {
2
- api: string;
3
- apiKey: string;
4
- accessToken: string;
5
- }
package/dist/config.js DELETED
@@ -1,6 +0,0 @@
1
- export class PulseConfig {
2
- api = '';
3
- apiKey = '';
4
- accessToken = '';
5
- }
6
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,WAAW;IACpB,GAAG,GAAW,EAAE,CAAC;IACjB,MAAM,GAAW,EAAE,CAAC;IACpB,WAAW,GAAW,EAAE,CAAC;CAC5B"}
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './config';
2
- export * from './utils';
3
- export * from './lib';
4
- export * from './lib/pulse-client';
package/dist/index.js DELETED
@@ -1,5 +0,0 @@
1
- export * from './config';
2
- export * from './utils';
3
- export * from './lib';
4
- export * from './lib/pulse-client';
5
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAA"}
@@ -1,6 +0,0 @@
1
- export declare class BaseEntity {
2
- id: string;
3
- createdOn: number;
4
- updatedOn: number;
5
- constructor(id?: string, createdOn?: number, updatedOn?: number);
6
- }
@@ -1,21 +0,0 @@
1
- // Base entity includes common fields for all entities (persistence objects) in the system
2
- export class BaseEntity {
3
- // Entity Id
4
- id;
5
- // When the entity was created [Epoch milliseconds Timestamp]
6
- createdOn;
7
- // When the entity was updated [Epoch milliseconds Timestamp]
8
- updatedOn;
9
- constructor(id, createdOn, updatedOn) {
10
- if (id !== undefined) {
11
- this.id = id;
12
- }
13
- if (createdOn !== undefined) {
14
- this.createdOn = createdOn;
15
- }
16
- if (updatedOn !== undefined) {
17
- this.updatedOn = updatedOn;
18
- }
19
- }
20
- }
21
- //# sourceMappingURL=BaseEntity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseEntity.js","sourceRoot":"","sources":["../../../src/lib/base/BaseEntity.ts"],"names":[],"mappings":"AAGA,0FAA0F;AAC1F,MAAM,OAAO,UAAU;IAEnB,aAAa;IACN,EAAE,CAAS;IAElB,8DAA8D;IACvD,SAAS,CAAS;IAEzB,8DAA8D;IACvD,SAAS,CAAS;IAExB,YAAY,EAAW,EAAE,SAAkB,EAAE,SAAkB;QAC5D,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAAC,CAAC;QAC5D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAAC,CAAC;IAChE,CAAC;CAEJ"}
@@ -1 +0,0 @@
1
- export * from './BaseEntity';
@@ -1,2 +0,0 @@
1
- export * from './BaseEntity';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/base/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1,7 +0,0 @@
1
- import { MemberRoleCode } from '../enums';
2
- export declare class AccountRole {
3
- accountId: string;
4
- accountName: string;
5
- role: MemberRoleCode;
6
- constructor(accountId?: string, accountName?: string, role?: MemberRoleCode);
7
- }