@golemio/energetics 1.2.10 → 1.2.11-dev.1148398936

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 (193) hide show
  1. package/dist/integration-engine/datasources/oict-energetika/OictDataSourceFactory.js.map +1 -0
  2. package/dist/integration-engine/{workers/oict-energetika/datasources → datasources/oict-energetika}/helpers/OictApiHelper.js +1 -1
  3. package/dist/integration-engine/datasources/oict-energetika/helpers/OictApiHelper.js.map +1 -0
  4. package/dist/integration-engine/datasources/oict-energetika/helpers/index.js.map +1 -0
  5. package/dist/integration-engine/datasources/vpalace/BaseVpalaceFactory.d.ts +6 -0
  6. package/dist/integration-engine/datasources/vpalace/BaseVpalaceFactory.js +31 -0
  7. package/dist/integration-engine/datasources/vpalace/BaseVpalaceFactory.js.map +1 -0
  8. package/dist/integration-engine/datasources/vpalace/VpalaceMeasurementDataSource.d.ts +9 -0
  9. package/dist/integration-engine/datasources/vpalace/VpalaceMeasurementDataSource.js +50 -0
  10. package/dist/integration-engine/datasources/vpalace/VpalaceMeasurementDataSource.js.map +1 -0
  11. package/dist/integration-engine/datasources/vpalace/VpalaceMeasuringEquipmentDataSource.d.ts +9 -0
  12. package/dist/integration-engine/datasources/vpalace/VpalaceMeasuringEquipmentDataSource.js +50 -0
  13. package/dist/integration-engine/datasources/vpalace/VpalaceMeasuringEquipmentDataSource.js.map +1 -0
  14. package/dist/integration-engine/datasources/vpalace/VpalaceMeterTypeDataSource.d.ts +9 -0
  15. package/dist/integration-engine/datasources/vpalace/VpalaceMeterTypeDataSource.js +50 -0
  16. package/dist/integration-engine/datasources/vpalace/VpalaceMeterTypeDataSource.js.map +1 -0
  17. package/dist/integration-engine/datasources/vpalace/VpalaceTypeMeasuringEquipmentDataSource.d.ts +9 -0
  18. package/dist/integration-engine/datasources/vpalace/VpalaceTypeMeasuringEquipmentDataSource.js +50 -0
  19. package/dist/integration-engine/datasources/vpalace/VpalaceTypeMeasuringEquipmentDataSource.js.map +1 -0
  20. package/dist/integration-engine/datasources/vpalace/VpalaceUnitsDataSource.d.ts +9 -0
  21. package/dist/integration-engine/datasources/vpalace/VpalaceUnitsDataSource.js +50 -0
  22. package/dist/integration-engine/datasources/vpalace/VpalaceUnitsDataSource.js.map +1 -0
  23. package/dist/integration-engine/helpers/UnimonitorCemApiHelper.d.ts +5 -4
  24. package/dist/integration-engine/helpers/UnimonitorCemApiHelper.js +76 -58
  25. package/dist/integration-engine/helpers/UnimonitorCemApiHelper.js.map +1 -1
  26. package/dist/integration-engine/index.d.ts +0 -3
  27. package/dist/integration-engine/index.js +2 -18
  28. package/dist/integration-engine/index.js.map +1 -1
  29. package/dist/integration-engine/interfaces/oict-energetika/IFetchConsumptionInput.js.map +1 -0
  30. package/dist/integration-engine/interfaces/oict-energetika/IFetchDataInput.js.map +1 -0
  31. package/dist/integration-engine/interfaces/vpalace/IFetchXDaysDataInput.d.ts +3 -0
  32. package/dist/integration-engine/interfaces/vpalace/IFetchXDaysDataInput.js +3 -0
  33. package/dist/integration-engine/interfaces/vpalace/IFetchXDaysDataInput.js.map +1 -0
  34. package/dist/integration-engine/interfaces/vpalace/IFetchXHoursDataInput.d.ts +3 -0
  35. package/dist/integration-engine/interfaces/vpalace/IFetchXHoursDataInput.js +3 -0
  36. package/dist/integration-engine/interfaces/vpalace/IFetchXHoursDataInput.js.map +1 -0
  37. package/dist/integration-engine/ioc/Di.d.ts +3 -0
  38. package/dist/integration-engine/ioc/Di.js +68 -0
  39. package/dist/integration-engine/ioc/Di.js.map +1 -0
  40. package/dist/integration-engine/ioc/ModuleContainer.d.ts +27 -0
  41. package/dist/integration-engine/ioc/ModuleContainer.js +40 -0
  42. package/dist/integration-engine/ioc/ModuleContainer.js.map +1 -0
  43. package/dist/integration-engine/{workers/oict-energetika/data-access → repositories/oict-energetika}/BuildingsRepository.js +2 -2
  44. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js.map +1 -0
  45. package/dist/integration-engine/{workers/oict-energetika/data-access → repositories/oict-energetika}/ConsumptionRepository.d.ts +1 -1
  46. package/dist/integration-engine/{workers/oict-energetika/data-access → repositories/oict-energetika}/ConsumptionRepository.js +2 -2
  47. package/dist/integration-engine/repositories/oict-energetika/ConsumptionRepository.js.map +1 -0
  48. package/dist/integration-engine/{workers/oict-energetika/data-access → repositories/oict-energetika}/DevicesRepository.js +2 -2
  49. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js.map +1 -0
  50. package/dist/integration-engine/repositories/vpalace/VpalacUnitsRepository.d.ts +9 -0
  51. package/dist/integration-engine/repositories/vpalace/VpalacUnitsRepository.js +53 -0
  52. package/dist/integration-engine/repositories/vpalace/VpalacUnitsRepository.js.map +1 -0
  53. package/dist/integration-engine/repositories/vpalace/VpalaceMeasurementRepository.d.ts +9 -0
  54. package/dist/integration-engine/repositories/vpalace/VpalaceMeasurementRepository.js +53 -0
  55. package/dist/integration-engine/repositories/vpalace/VpalaceMeasurementRepository.js.map +1 -0
  56. package/dist/integration-engine/repositories/vpalace/VpalaceMeasuringEquipmentRepository.d.ts +9 -0
  57. package/dist/integration-engine/repositories/vpalace/VpalaceMeasuringEquipmentRepository.js +53 -0
  58. package/dist/integration-engine/repositories/vpalace/VpalaceMeasuringEquipmentRepository.js.map +1 -0
  59. package/dist/integration-engine/repositories/vpalace/VpalaceMeterTypeRepository.d.ts +9 -0
  60. package/dist/integration-engine/repositories/vpalace/VpalaceMeterTypeRepository.js +53 -0
  61. package/dist/integration-engine/repositories/vpalace/VpalaceMeterTypeRepository.js.map +1 -0
  62. package/dist/integration-engine/repositories/vpalace/VpalaceTypeMeasuringEquipmentRepository.d.ts +9 -0
  63. package/dist/integration-engine/repositories/vpalace/VpalaceTypeMeasuringEquipmentRepository.js +53 -0
  64. package/dist/integration-engine/repositories/vpalace/VpalaceTypeMeasuringEquipmentRepository.js.map +1 -0
  65. package/dist/integration-engine/{workers/oict-energetika/schema → schema/oict-energetika}/FetchConsumptionSchema.d.ts +1 -1
  66. package/dist/integration-engine/schema/oict-energetika/FetchConsumptionSchema.js.map +1 -0
  67. package/dist/integration-engine/{workers/oict-energetika/schema → schema/oict-energetika}/FetchDataSchema.d.ts +1 -1
  68. package/dist/integration-engine/schema/oict-energetika/FetchDataSchema.js.map +1 -0
  69. package/dist/integration-engine/schema/vpalace/FetchXDaysDataValidationSchema.d.ts +4 -0
  70. package/dist/integration-engine/schema/vpalace/FetchXDaysDataValidationSchema.js +22 -0
  71. package/dist/integration-engine/schema/vpalace/FetchXDaysDataValidationSchema.js.map +1 -0
  72. package/dist/integration-engine/schema/vpalace/FetchXHoursDataValidationSchema.d.ts +4 -0
  73. package/dist/integration-engine/schema/vpalace/FetchXHoursDataValidationSchema.js +22 -0
  74. package/dist/integration-engine/schema/vpalace/FetchXHoursDataValidationSchema.js.map +1 -0
  75. package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchBuildingsTask.js +4 -4
  76. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js.map +1 -0
  77. package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchConsumptionTask.d.ts +2 -2
  78. package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchConsumptionTask.js +9 -9
  79. package/dist/integration-engine/tasks/oict-energetika/FetchConsumptionTask.js.map +1 -0
  80. package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchDataTask.d.ts +2 -2
  81. package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchDataTask.js +1 -1
  82. package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js.map +1 -0
  83. package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchDevicesTask.js +7 -7
  84. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js.map +1 -0
  85. package/dist/integration-engine/tasks/vpalace/FetchDateFactory.d.ts +16 -0
  86. package/dist/integration-engine/tasks/vpalace/FetchDateFactory.js +76 -0
  87. package/dist/integration-engine/tasks/vpalace/FetchDateFactory.js.map +1 -0
  88. package/dist/integration-engine/tasks/vpalace/FetchXDaysDataTask.d.ts +16 -0
  89. package/dist/integration-engine/tasks/vpalace/FetchXDaysDataTask.js +76 -0
  90. package/dist/integration-engine/tasks/vpalace/FetchXDaysDataTask.js.map +1 -0
  91. package/dist/integration-engine/tasks/vpalace/FetchXHoursDataTask.d.ts +14 -0
  92. package/dist/integration-engine/tasks/vpalace/FetchXHoursDataTask.js +69 -0
  93. package/dist/integration-engine/tasks/vpalace/FetchXHoursDataTask.js.map +1 -0
  94. package/dist/integration-engine/tasks/vpalace/MeasurementDataFetcher.d.ts +11 -0
  95. package/dist/integration-engine/tasks/vpalace/MeasurementDataFetcher.js +53 -0
  96. package/dist/integration-engine/tasks/vpalace/MeasurementDataFetcher.js.map +1 -0
  97. package/dist/integration-engine/tasks/vpalace/MeasuringEquipmentFetcher.d.ts +11 -0
  98. package/dist/integration-engine/tasks/vpalace/MeasuringEquipmentFetcher.js +51 -0
  99. package/dist/integration-engine/tasks/vpalace/MeasuringEquipmentFetcher.js.map +1 -0
  100. package/dist/integration-engine/tasks/vpalace/MeterTypeFetcher.d.ts +11 -0
  101. package/dist/integration-engine/tasks/vpalace/MeterTypeFetcher.js +51 -0
  102. package/dist/integration-engine/tasks/vpalace/MeterTypeFetcher.js.map +1 -0
  103. package/dist/integration-engine/tasks/vpalace/TypeMeasuringEquipmentFetcher.d.ts +11 -0
  104. package/dist/integration-engine/tasks/vpalace/TypeMeasuringEquipmentFetcher.js +51 -0
  105. package/dist/integration-engine/tasks/vpalace/TypeMeasuringEquipmentFetcher.js.map +1 -0
  106. package/dist/integration-engine/tasks/vpalace/UnitDataFetcher.d.ts +11 -0
  107. package/dist/integration-engine/tasks/vpalace/UnitDataFetcher.js +51 -0
  108. package/dist/integration-engine/tasks/vpalace/UnitDataFetcher.js.map +1 -0
  109. package/dist/integration-engine/{workers/oict-energetika/transformations → transformations/oict-energetika}/BuildingsTransformation.d.ts +2 -2
  110. package/dist/integration-engine/{workers/oict-energetika/transformations → transformations/oict-energetika}/BuildingsTransformation.js +1 -1
  111. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js.map +1 -0
  112. package/dist/integration-engine/{workers/oict-energetika/transformations → transformations/oict-energetika}/ConsumptionTransformation.d.ts +2 -2
  113. package/dist/integration-engine/{workers/oict-energetika/transformations → transformations/oict-energetika}/ConsumptionTransformation.js +1 -1
  114. package/dist/integration-engine/transformations/oict-energetika/ConsumptionTransformation.js.map +1 -0
  115. package/dist/integration-engine/{workers/oict-energetika/transformations → transformations/oict-energetika}/DevicesTransformation.d.ts +2 -2
  116. package/dist/integration-engine/{workers/oict-energetika/transformations → transformations/oict-energetika}/DevicesTransformation.js +1 -1
  117. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js.map +1 -0
  118. package/dist/integration-engine/transformations/vpalace/VpalacMeasurementTransformation.js +38 -0
  119. package/dist/integration-engine/transformations/vpalace/VpalacMeasurementTransformation.js.map +1 -0
  120. package/dist/integration-engine/transformations/{VpalacMeasuringEquipmentTransformation.js → vpalace/VpalacMeasuringEquipmentTransformation.js} +17 -4
  121. package/dist/integration-engine/transformations/vpalace/VpalacMeasuringEquipmentTransformation.js.map +1 -0
  122. package/dist/integration-engine/transformations/{VpalacMeterTypeTransformation.js → vpalace/VpalacMeterTypeTransformation.js} +17 -4
  123. package/dist/integration-engine/transformations/vpalace/VpalacMeterTypeTransformation.js.map +1 -0
  124. package/dist/integration-engine/transformations/{VpalacTypeMeasuringEquipmentTransformation.js → vpalace/VpalacTypeMeasuringEquipmentTransformation.js} +17 -4
  125. package/dist/integration-engine/transformations/vpalace/VpalacTypeMeasuringEquipmentTransformation.js.map +1 -0
  126. package/dist/integration-engine/transformations/{VpalacUnitsTransformation.js → vpalace/VpalacUnitsTransformation.js} +17 -4
  127. package/dist/integration-engine/transformations/vpalace/VpalacUnitsTransformation.js.map +1 -0
  128. package/dist/integration-engine/transformations/vpalace/index.js.map +1 -0
  129. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.d.ts +1 -1
  130. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js +6 -6
  131. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js.map +1 -1
  132. package/dist/integration-engine/workers/vpalace/EnergeticsNewVpalaceWorker.d.ts +5 -0
  133. package/dist/integration-engine/workers/vpalace/EnergeticsNewVpalaceWorker.js +21 -0
  134. package/dist/integration-engine/workers/vpalace/EnergeticsNewVpalaceWorker.js.map +1 -0
  135. package/package.json +2 -2
  136. package/dist/integration-engine/queueDefinitions.d.ts +0 -6
  137. package/dist/integration-engine/queueDefinitions.js +0 -39
  138. package/dist/integration-engine/queueDefinitions.js.map +0 -1
  139. package/dist/integration-engine/transformations/VpalacMeasurementTransformation.js +0 -25
  140. package/dist/integration-engine/transformations/VpalacMeasurementTransformation.js.map +0 -1
  141. package/dist/integration-engine/transformations/VpalacMeasuringEquipmentTransformation.js.map +0 -1
  142. package/dist/integration-engine/transformations/VpalacMeterTypeTransformation.js.map +0 -1
  143. package/dist/integration-engine/transformations/VpalacTypeMeasuringEquipmentTransformation.js.map +0 -1
  144. package/dist/integration-engine/transformations/VpalacUnitsTransformation.js.map +0 -1
  145. package/dist/integration-engine/transformations/index.js.map +0 -1
  146. package/dist/integration-engine/workers/EnergeticsBaseWorker.d.ts +0 -13
  147. package/dist/integration-engine/workers/EnergeticsBaseWorker.js +0 -39
  148. package/dist/integration-engine/workers/EnergeticsBaseWorker.js.map +0 -1
  149. package/dist/integration-engine/workers/EnergeticsVpalacWorker.d.ts +0 -36
  150. package/dist/integration-engine/workers/EnergeticsVpalacWorker.js +0 -197
  151. package/dist/integration-engine/workers/EnergeticsVpalacWorker.js.map +0 -1
  152. package/dist/integration-engine/workers/index.d.ts +0 -2
  153. package/dist/integration-engine/workers/index.js +0 -19
  154. package/dist/integration-engine/workers/index.js.map +0 -1
  155. package/dist/integration-engine/workers/oict-energetika/data-access/BuildingsRepository.js.map +0 -1
  156. package/dist/integration-engine/workers/oict-energetika/data-access/ConsumptionRepository.js.map +0 -1
  157. package/dist/integration-engine/workers/oict-energetika/data-access/DevicesRepository.js.map +0 -1
  158. package/dist/integration-engine/workers/oict-energetika/datasources/OictDataSourceFactory.js.map +0 -1
  159. package/dist/integration-engine/workers/oict-energetika/datasources/helpers/OictApiHelper.js.map +0 -1
  160. package/dist/integration-engine/workers/oict-energetika/datasources/helpers/index.js.map +0 -1
  161. package/dist/integration-engine/workers/oict-energetika/interfaces/IFetchConsumptionInput.js.map +0 -1
  162. package/dist/integration-engine/workers/oict-energetika/interfaces/IFetchDataInput.js.map +0 -1
  163. package/dist/integration-engine/workers/oict-energetika/schema/FetchConsumptionSchema.js.map +0 -1
  164. package/dist/integration-engine/workers/oict-energetika/schema/FetchDataSchema.js.map +0 -1
  165. package/dist/integration-engine/workers/oict-energetika/tasks/FetchBuildingsTask.js.map +0 -1
  166. package/dist/integration-engine/workers/oict-energetika/tasks/FetchConsumptionTask.js.map +0 -1
  167. package/dist/integration-engine/workers/oict-energetika/tasks/FetchDataTask.js.map +0 -1
  168. package/dist/integration-engine/workers/oict-energetika/tasks/FetchDevicesTask.js.map +0 -1
  169. package/dist/integration-engine/workers/oict-energetika/transformations/BuildingsTransformation.js.map +0 -1
  170. package/dist/integration-engine/workers/oict-energetika/transformations/ConsumptionTransformation.js.map +0 -1
  171. package/dist/integration-engine/workers/oict-energetika/transformations/DevicesTransformation.js.map +0 -1
  172. /package/dist/integration-engine/{workers/oict-energetika/datasources → datasources/oict-energetika}/OictDataSourceFactory.d.ts +0 -0
  173. /package/dist/integration-engine/{workers/oict-energetika/datasources → datasources/oict-energetika}/OictDataSourceFactory.js +0 -0
  174. /package/dist/integration-engine/{workers/oict-energetika/datasources → datasources/oict-energetika}/helpers/OictApiHelper.d.ts +0 -0
  175. /package/dist/integration-engine/{workers/oict-energetika/datasources → datasources/oict-energetika}/helpers/index.d.ts +0 -0
  176. /package/dist/integration-engine/{workers/oict-energetika/datasources → datasources/oict-energetika}/helpers/index.js +0 -0
  177. /package/dist/integration-engine/{workers/oict-energetika/interfaces → interfaces/oict-energetika}/IFetchConsumptionInput.d.ts +0 -0
  178. /package/dist/integration-engine/{workers/oict-energetika/interfaces → interfaces/oict-energetika}/IFetchConsumptionInput.js +0 -0
  179. /package/dist/integration-engine/{workers/oict-energetika/interfaces → interfaces/oict-energetika}/IFetchDataInput.d.ts +0 -0
  180. /package/dist/integration-engine/{workers/oict-energetika/interfaces → interfaces/oict-energetika}/IFetchDataInput.js +0 -0
  181. /package/dist/integration-engine/{workers/oict-energetika/data-access → repositories/oict-energetika}/BuildingsRepository.d.ts +0 -0
  182. /package/dist/integration-engine/{workers/oict-energetika/data-access → repositories/oict-energetika}/DevicesRepository.d.ts +0 -0
  183. /package/dist/integration-engine/{workers/oict-energetika/schema → schema/oict-energetika}/FetchConsumptionSchema.js +0 -0
  184. /package/dist/integration-engine/{workers/oict-energetika/schema → schema/oict-energetika}/FetchDataSchema.js +0 -0
  185. /package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchBuildingsTask.d.ts +0 -0
  186. /package/dist/integration-engine/{workers/oict-energetika/tasks → tasks/oict-energetika}/FetchDevicesTask.d.ts +0 -0
  187. /package/dist/integration-engine/transformations/{VpalacMeasurementTransformation.d.ts → vpalace/VpalacMeasurementTransformation.d.ts} +0 -0
  188. /package/dist/integration-engine/transformations/{VpalacMeasuringEquipmentTransformation.d.ts → vpalace/VpalacMeasuringEquipmentTransformation.d.ts} +0 -0
  189. /package/dist/integration-engine/transformations/{VpalacMeterTypeTransformation.d.ts → vpalace/VpalacMeterTypeTransformation.d.ts} +0 -0
  190. /package/dist/integration-engine/transformations/{VpalacTypeMeasuringEquipmentTransformation.d.ts → vpalace/VpalacTypeMeasuringEquipmentTransformation.d.ts} +0 -0
  191. /package/dist/integration-engine/transformations/{VpalacUnitsTransformation.d.ts → vpalace/VpalacUnitsTransformation.d.ts} +0 -0
  192. /package/dist/integration-engine/transformations/{index.d.ts → vpalace/index.d.ts} +0 -0
  193. /package/dist/integration-engine/transformations/{index.js → vpalace/index.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OictDataSourceFactory.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/oict-energetika/OictDataSourceFactory.ts"],"names":[],"mappings":";;;AAAA,yEAAsE;AACtE,mFAA2H;AAC3H,uCAA4D;AAO5D,MAAa,qBAAqB;IACvB,MAAM,CAAC,aAAa,CAAC,YAA8B,EAAE,UAAwB;QAChF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,uBAAa,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,eAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAE1G,IAAI,UAAU,EAAE;YACZ,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;YACtD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;SACrD;QAED,OAAO,IAAI,wBAAU,CACjB,uBAAa,CAAC,QAAQ,GAAG,YAAY,GAAG,YAAY,EACpD,IAAI,kCAAoB,CAAC;YACrB,OAAO,EAAE,eAAM,CAAC,WAAW,CAAC,wBAAwB;YACpD,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK;YACd,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;SACtB,CAAC,EACF,IAAI,kCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,uBAAa,CAAC,YAAY,CAAC,YAAY,CAAC,CAC3C,CAAC;IACN,CAAC;CACJ;AArBD,sDAqBC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OictApiHelper = exports.OictResourceType = void 0;
4
- const datasources_1 = require("../../../../../schema-definitions/datasources");
4
+ const datasources_1 = require("../../../../schema-definitions/datasources");
5
5
  const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
6
6
  const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
7
7
  var OictResourceType;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OictApiHelper.js","sourceRoot":"","sources":["../../../../../src/integration-engine/datasources/oict-energetika/helpers/OictApiHelper.ts"],"names":[],"mappings":";;;AAAA,4EAA6G;AAC7G,6EAAwE;AACxE,mFAAkF;AAElF,IAAY,gBAKX;AALD,WAAY,gBAAgB;IACxB,2CAAuB,CAAA;IACvB,+CAA2B,CAAA;IAC3B,2DAAuC,CAAA;IACvC,uCAAmB,CAAA;AACvB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED,MAAa,aAAa;IAGf,MAAM,CAAC,eAAe,CAAC,YAA8B;QACxD,QAAQ,YAAY,EAAE;YAClB,mCAAmC;YACnC,KAAK,gBAAgB,CAAC,SAAS;gBAC3B,OAAO,gBAAgB,CAAC;YAE5B,4CAA4C;YAC5C,KAAK,gBAAgB,CAAC,WAAW;gBAC7B,OAAO,kBAAkB,CAAC;YAE9B,iCAAiC;YACjC,KAAK,gBAAgB,CAAC,iBAAiB;gBACnC,OAAO,aAAa,CAAC;YAEzB,+DAA+D;YAC/D,KAAK,gBAAgB,CAAC,OAAO;gBACzB,OAAO,cAAc,CAAC;SAC7B;IACL,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,YAA8B;QACrD,MAAM,aAAa,GAAG,GAAG,aAAa,CAAC,QAAQ,GAAG,YAAY,WAAW,CAAC;QAE1E,QAAQ,YAAY,EAAE;YAClB,KAAK,gBAAgB,CAAC,SAAS;gBAC3B,OAAO,IAAI,uCAAmB,CAAC,aAAa,EAAE,qCAAuB,CAAC,CAAC;YAE3E,KAAK,gBAAgB,CAAC,WAAW,CAAC;YAClC,KAAK,gBAAgB,CAAC,iBAAiB;gBACnC,OAAO,IAAI,uCAAmB,CAAC,aAAa,EAAE,uCAAyB,CAAC,CAAC;YAE7E,KAAK,gBAAgB,CAAC,OAAO;gBACzB,OAAO,IAAI,uCAAmB,CAAC,aAAa,EAAE,mCAAqB,CAAC,CAAC;YAEzE;gBACI,MAAM,IAAI,6BAAY,CAAC,0BAA0B,YAAY,EAAE,EAAE,eAAe,CAAC,CAAC;SACzF;IACL,CAAC;;AAxCL,sCAyCC;AAxCiB,sBAAQ,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/integration-engine/datasources/oict-energetika/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
@@ -0,0 +1,6 @@
1
+ import { HTTPProtocolStrategy } from "@golemio/core/dist/integration-engine";
2
+ export declare abstract class BaseVpalaceFactory {
3
+ private url;
4
+ constructor(url: string);
5
+ protected getConnectionSettings: (resourceType: string, dateFrom: string, dateTo: string, authCookie: string) => Promise<HTTPProtocolStrategy>;
6
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BaseVpalaceFactory = void 0;
13
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
14
+ class BaseVpalaceFactory {
15
+ constructor(url) {
16
+ this.getConnectionSettings = (resourceType, dateFrom, dateTo, authCookie) => __awaiter(this, void 0, void 0, function* () {
17
+ const params = new URLSearchParams(Object.assign(Object.assign(Object.assign(Object.assign({}, (resourceType === "11" && { cis: "135" })), { id: resourceType }), (Number.isInteger(+dateFrom) ? { from_ms: dateFrom } : { from: dateFrom })), (Number.isInteger(+dateTo) ? { to_ms: dateTo } : { to: dateTo })));
18
+ return new integration_engine_1.HTTPProtocolStrategy({
19
+ headers: {
20
+ Cookie: authCookie,
21
+ },
22
+ method: "GET",
23
+ timeout: 20000,
24
+ url: `${this.url}?${params}`,
25
+ });
26
+ });
27
+ this.url = url;
28
+ }
29
+ }
30
+ exports.BaseVpalaceFactory = BaseVpalaceFactory;
31
+ //# sourceMappingURL=BaseVpalaceFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseVpalaceFactory.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/vpalace/BaseVpalaceFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA6E;AAG7E,MAAsB,kBAAkB;IAEpC,YAAY,GAAW;QAGb,0BAAqB,GAAG,CAC9B,YAAoB,EACpB,QAAgB,EAChB,MAAc,EACd,UAAkB,EACW,EAAE;YAC/B,MAAM,MAAM,GAAG,IAAI,eAAe,6DAC3B,CAAC,YAAY,KAAK,IAAI,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,KAC5C,EAAE,EAAE,YAAY,KACb,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GAC1E,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EACrE,CAAC;YAEH,OAAO,IAAI,yCAAoB,CAAC;gBAC5B,OAAO,EAAE;oBACL,MAAM,EAAE,UAAU;iBACrB;gBACD,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,KAAK;gBACd,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,MAAM,EAAE;aAC/B,CAAC,CAAC;QACP,CAAC,CAAA,CAAC;QAvBE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;CAuBJ;AA3BD,gDA2BC"}
@@ -0,0 +1,9 @@
1
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
2
+ import { DataSource } from "@golemio/core/dist/integration-engine";
3
+ import { BaseVpalaceFactory } from "./BaseVpalaceFactory";
4
+ export declare class VpalaceMeasurementDataSource extends BaseVpalaceFactory {
5
+ private config;
6
+ constructor(config: ISimpleConfig);
7
+ private readonly resourceType;
8
+ getDataSource(from: string, to: string, authCookie: string): Promise<DataSource>;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.VpalaceMeasurementDataSource = void 0;
25
+ const helpers_1 = require("../../helpers");
26
+ const _sch_1 = require("../../../schema-definitions");
27
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
28
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
29
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
30
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
31
+ const BaseVpalaceFactory_1 = require("./BaseVpalaceFactory");
32
+ let VpalaceMeasurementDataSource = exports.VpalaceMeasurementDataSource = class VpalaceMeasurementDataSource extends BaseVpalaceFactory_1.BaseVpalaceFactory {
33
+ constructor(config) {
34
+ super(config.getValue("old.datasources.UnimonitorCemApiEnergetics.url"));
35
+ this.config = config;
36
+ this.resourceType = helpers_1.UnimonitorCemApi.resourceType.Measurement;
37
+ }
38
+ getDataSource(from, to, authCookie) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const sourceHTTPProtocolStrategy = yield this.getConnectionSettings(this.resourceType, from, to, authCookie);
41
+ return new integration_engine_1.DataSource(_sch_1.EnergeticsSchema.vpalac.measurement.name + "DataSource", sourceHTTPProtocolStrategy, new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.EnergeticsSchema.vpalac.measurement.name + "DataSource", _sch_1.EnergeticsSchema.vpalac.measurement.datasourceJsonSchema));
42
+ });
43
+ }
44
+ };
45
+ exports.VpalaceMeasurementDataSource = VpalaceMeasurementDataSource = __decorate([
46
+ (0, tsyringe_1.injectable)(),
47
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
48
+ __metadata("design:paramtypes", [Object])
49
+ ], VpalaceMeasurementDataSource);
50
+ //# sourceMappingURL=VpalaceMeasurementDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VpalaceMeasurementDataSource.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/vpalace/VpalaceMeasurementDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,sDAAwC;AAExC,wEAAqE;AACrE,8EAAyF;AACzF,mFAAkF;AAClF,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,4BAA4B,0CAAlC,MAAM,4BAA6B,SAAQ,uCAAkB;IAChE,YAA4C,MAA6B;QACrE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAS,gDAAgD,CAAC,CAAC,CAAC;QADjC,WAAM,GAAN,MAAM,CAAe;QAGxD,iBAAY,GAAG,0BAAgB,CAAC,YAAY,CAAC,WAAW,CAAC;IAD1E,CAAC;IAEY,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,UAAkB;;YACnE,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAE7G,OAAO,IAAI,+BAAU,CACjB,uBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG,YAAY,EACvD,0BAA0B,EAC1B,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CACnB,uBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG,YAAY,EACvD,uBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAC3D,CACJ,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;uCAlBY,4BAA4B;IADxC,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GADlC,4BAA4B,CAkBxC"}
@@ -0,0 +1,9 @@
1
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
2
+ import { DataSource } from "@golemio/core/dist/integration-engine";
3
+ import { BaseVpalaceFactory } from "./BaseVpalaceFactory";
4
+ export declare class VpalaceMeasuringEquipmentDataSource extends BaseVpalaceFactory {
5
+ private config;
6
+ private readonly resourceType;
7
+ constructor(config: ISimpleConfig);
8
+ getDataSource(from: string, to: string, authCookie: string): Promise<DataSource>;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.VpalaceMeasuringEquipmentDataSource = void 0;
25
+ const helpers_1 = require("../../helpers");
26
+ const _sch_1 = require("../../../schema-definitions");
27
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
28
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
29
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
30
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
31
+ const BaseVpalaceFactory_1 = require("./BaseVpalaceFactory");
32
+ let VpalaceMeasuringEquipmentDataSource = exports.VpalaceMeasuringEquipmentDataSource = class VpalaceMeasuringEquipmentDataSource extends BaseVpalaceFactory_1.BaseVpalaceFactory {
33
+ constructor(config) {
34
+ super(config.getValue("old.datasources.UnimonitorCemApiEnergetics.url"));
35
+ this.config = config;
36
+ this.resourceType = helpers_1.UnimonitorCemApi.resourceType.MeasuringEquipment;
37
+ }
38
+ getDataSource(from, to, authCookie) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const sourceHTTPProtocolStrategy = yield this.getConnectionSettings(this.resourceType, from, to, authCookie);
41
+ return new integration_engine_1.DataSource(_sch_1.EnergeticsSchema.vpalac.measuringEquipment.name + "DataSource", sourceHTTPProtocolStrategy, new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.EnergeticsSchema.vpalac.measuringEquipment.name + "DataSource", _sch_1.EnergeticsSchema.vpalac.measuringEquipment.datasourceJsonSchema));
42
+ });
43
+ }
44
+ };
45
+ exports.VpalaceMeasuringEquipmentDataSource = VpalaceMeasuringEquipmentDataSource = __decorate([
46
+ (0, tsyringe_1.injectable)(),
47
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
48
+ __metadata("design:paramtypes", [Object])
49
+ ], VpalaceMeasuringEquipmentDataSource);
50
+ //# sourceMappingURL=VpalaceMeasuringEquipmentDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VpalaceMeasuringEquipmentDataSource.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/vpalace/VpalaceMeasuringEquipmentDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,sDAAwC;AAExC,wEAAqE;AACrE,8EAAyF;AACzF,mFAAkF;AAClF,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,mCAAmC,iDAAzC,MAAM,mCAAoC,SAAQ,uCAAkB;IAEvE,YAA4C,MAA6B;QACrE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAS,gDAAgD,CAAC,CAAC,CAAC;QADjC,WAAM,GAAN,MAAM,CAAe;QADxD,iBAAY,GAAG,0BAAgB,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAGjF,CAAC;IACY,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,UAAkB;;YACnE,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAE7G,OAAO,IAAI,+BAAU,CACjB,uBAAgB,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,GAAG,YAAY,EAC9D,0BAA0B,EAC1B,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CACnB,uBAAgB,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,GAAG,YAAY,EAC9D,uBAAgB,CAAC,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAClE,CACJ,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;8CAlBY,mCAAmC;IAD/C,IAAA,qBAAU,GAAE;IAGI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GAFlC,mCAAmC,CAkB/C"}
@@ -0,0 +1,9 @@
1
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
2
+ import { DataSource } from "@golemio/core/dist/integration-engine";
3
+ import { BaseVpalaceFactory } from "./BaseVpalaceFactory";
4
+ export declare class VpalaceMeterTypeDataSource extends BaseVpalaceFactory {
5
+ private config;
6
+ private readonly resourceType;
7
+ constructor(config: ISimpleConfig);
8
+ getDataSource(from: string, to: string, authCookie: string): Promise<DataSource>;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.VpalaceMeterTypeDataSource = void 0;
25
+ const helpers_1 = require("../../helpers");
26
+ const _sch_1 = require("../../../schema-definitions");
27
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
28
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
29
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
30
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
31
+ const BaseVpalaceFactory_1 = require("./BaseVpalaceFactory");
32
+ let VpalaceMeterTypeDataSource = exports.VpalaceMeterTypeDataSource = class VpalaceMeterTypeDataSource extends BaseVpalaceFactory_1.BaseVpalaceFactory {
33
+ constructor(config) {
34
+ super(config.getValue("old.datasources.UnimonitorCemApiEnergetics.url"));
35
+ this.config = config;
36
+ this.resourceType = helpers_1.UnimonitorCemApi.resourceType.MeterType;
37
+ }
38
+ getDataSource(from, to, authCookie) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const sourceHTTPProtocolStrategy = yield this.getConnectionSettings(this.resourceType, from, to, authCookie);
41
+ return new integration_engine_1.DataSource(_sch_1.EnergeticsSchema.vpalac.meterType.name + "DataSource", sourceHTTPProtocolStrategy, new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.EnergeticsSchema.vpalac.meterType.name + "DataSource", _sch_1.EnergeticsSchema.vpalac.meterType.datasourceJsonSchema));
42
+ });
43
+ }
44
+ };
45
+ exports.VpalaceMeterTypeDataSource = VpalaceMeterTypeDataSource = __decorate([
46
+ (0, tsyringe_1.injectable)(),
47
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
48
+ __metadata("design:paramtypes", [Object])
49
+ ], VpalaceMeterTypeDataSource);
50
+ //# sourceMappingURL=VpalaceMeterTypeDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VpalaceMeterTypeDataSource.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/vpalace/VpalaceMeterTypeDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,sDAAwC;AAExC,wEAAqE;AACrE,8EAAyF;AACzF,mFAAkF;AAClF,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,0BAA0B,wCAAhC,MAAM,0BAA2B,SAAQ,uCAAkB;IAE9D,YAA4C,MAA6B;QACrE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAS,gDAAgD,CAAC,CAAC,CAAC;QADjC,WAAM,GAAN,MAAM,CAAe;QADxD,iBAAY,GAAG,0BAAgB,CAAC,YAAY,CAAC,SAAS,CAAC;IAGxE,CAAC;IACY,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,UAAkB;;YACnE,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAE7G,OAAO,IAAI,+BAAU,CACjB,uBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY,EACrD,0BAA0B,EAC1B,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CACnB,uBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY,EACrD,uBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CACzD,CACJ,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;qCAlBY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;IAGI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GAFlC,0BAA0B,CAkBtC"}
@@ -0,0 +1,9 @@
1
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
2
+ import { DataSource } from "@golemio/core/dist/integration-engine";
3
+ import { BaseVpalaceFactory } from "./BaseVpalaceFactory";
4
+ export declare class VpalaceTypeMeasuringEquipmentDataSource extends BaseVpalaceFactory {
5
+ private config;
6
+ private readonly resourceType;
7
+ constructor(config: ISimpleConfig);
8
+ getDataSource(from: string, to: string, authCookie: string): Promise<DataSource>;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.VpalaceTypeMeasuringEquipmentDataSource = void 0;
25
+ const helpers_1 = require("../../helpers");
26
+ const _sch_1 = require("../../../schema-definitions");
27
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
28
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
29
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
30
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
31
+ const BaseVpalaceFactory_1 = require("./BaseVpalaceFactory");
32
+ let VpalaceTypeMeasuringEquipmentDataSource = exports.VpalaceTypeMeasuringEquipmentDataSource = class VpalaceTypeMeasuringEquipmentDataSource extends BaseVpalaceFactory_1.BaseVpalaceFactory {
33
+ constructor(config) {
34
+ super(config.getValue("old.datasources.UnimonitorCemApiEnergetics.url"));
35
+ this.config = config;
36
+ this.resourceType = helpers_1.UnimonitorCemApi.resourceType.TypeMeasuringEquipment;
37
+ }
38
+ getDataSource(from, to, authCookie) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const sourceHTTPProtocolStrategy = yield this.getConnectionSettings(this.resourceType, from, to, authCookie);
41
+ return new integration_engine_1.DataSource(_sch_1.EnergeticsSchema.vpalac.typeMeasuringEquipment.name + "DataSource", sourceHTTPProtocolStrategy, new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.EnergeticsSchema.vpalac.typeMeasuringEquipment.name + "DataSource", _sch_1.EnergeticsSchema.vpalac.typeMeasuringEquipment.datasourceJsonSchema));
42
+ });
43
+ }
44
+ };
45
+ exports.VpalaceTypeMeasuringEquipmentDataSource = VpalaceTypeMeasuringEquipmentDataSource = __decorate([
46
+ (0, tsyringe_1.injectable)(),
47
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
48
+ __metadata("design:paramtypes", [Object])
49
+ ], VpalaceTypeMeasuringEquipmentDataSource);
50
+ //# sourceMappingURL=VpalaceTypeMeasuringEquipmentDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VpalaceTypeMeasuringEquipmentDataSource.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/vpalace/VpalaceTypeMeasuringEquipmentDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,sDAAwC;AAExC,wEAAqE;AACrE,8EAAyF;AACzF,mFAAkF;AAClF,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,uCAAuC,qDAA7C,MAAM,uCAAwC,SAAQ,uCAAkB;IAE3E,YAA4C,MAA6B;QACrE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAS,gDAAgD,CAAC,CAAC,CAAC;QADjC,WAAM,GAAN,MAAM,CAAe;QADxD,iBAAY,GAAG,0BAAgB,CAAC,YAAY,CAAC,sBAAsB,CAAC;IAGrF,CAAC;IACY,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,UAAkB;;YACnE,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAE7G,OAAO,IAAI,+BAAU,CACjB,uBAAgB,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAG,YAAY,EAClE,0BAA0B,EAC1B,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CACnB,uBAAgB,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAG,YAAY,EAClE,uBAAgB,CAAC,MAAM,CAAC,sBAAsB,CAAC,oBAAoB,CACtE,CACJ,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;kDAlBY,uCAAuC;IADnD,IAAA,qBAAU,GAAE;IAGI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GAFlC,uCAAuC,CAkBnD"}
@@ -0,0 +1,9 @@
1
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
2
+ import { DataSource } from "@golemio/core/dist/integration-engine";
3
+ import { BaseVpalaceFactory } from "./BaseVpalaceFactory";
4
+ export declare class VpalaceUnitsDataSource extends BaseVpalaceFactory {
5
+ private config;
6
+ private readonly resourceType;
7
+ constructor(config: ISimpleConfig);
8
+ getDataSource(from: string, to: string, authCookie: string): Promise<DataSource>;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.VpalaceUnitsDataSource = void 0;
25
+ const helpers_1 = require("../../helpers");
26
+ const _sch_1 = require("../../../schema-definitions");
27
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
28
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
29
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
30
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
31
+ const BaseVpalaceFactory_1 = require("./BaseVpalaceFactory");
32
+ let VpalaceUnitsDataSource = exports.VpalaceUnitsDataSource = class VpalaceUnitsDataSource extends BaseVpalaceFactory_1.BaseVpalaceFactory {
33
+ constructor(config) {
34
+ super(config.getValue("old.datasources.UnimonitorCemApiEnergetics.url"));
35
+ this.config = config;
36
+ this.resourceType = helpers_1.UnimonitorCemApi.resourceType.Units;
37
+ }
38
+ getDataSource(from, to, authCookie) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const sourceHTTPProtocolStrategy = yield this.getConnectionSettings(this.resourceType, from, to, authCookie);
41
+ return new integration_engine_1.DataSource(_sch_1.EnergeticsSchema.vpalac.units.name + "DataSource", sourceHTTPProtocolStrategy, new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.EnergeticsSchema.vpalac.units.name + "DataSource", _sch_1.EnergeticsSchema.vpalac.units.datasourceJsonSchema));
42
+ });
43
+ }
44
+ };
45
+ exports.VpalaceUnitsDataSource = VpalaceUnitsDataSource = __decorate([
46
+ (0, tsyringe_1.injectable)(),
47
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
48
+ __metadata("design:paramtypes", [Object])
49
+ ], VpalaceUnitsDataSource);
50
+ //# sourceMappingURL=VpalaceUnitsDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VpalaceUnitsDataSource.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/vpalace/VpalaceUnitsDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,sDAAwC;AAExC,wEAAqE;AACrE,8EAAyF;AACzF,mFAAkF;AAClF,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,uCAAkB;IAE1D,YAA4C,MAA6B;QACrE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAS,gDAAgD,CAAC,CAAC,CAAC;QADjC,WAAM,GAAN,MAAM,CAAe;QADxD,iBAAY,GAAG,0BAAgB,CAAC,YAAY,CAAC,KAAK,CAAC;IAGpE,CAAC;IACY,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,UAAkB;;YACnE,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAE7G,OAAO,IAAI,+BAAU,CACjB,uBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,YAAY,EACjD,0BAA0B,EAC1B,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CACnB,uBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,YAAY,EACjD,uBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CACrD,CACJ,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;iCAlBY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAGI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GAFlC,sBAAsB,CAkBlC"}
@@ -1,20 +1,21 @@
1
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
1
2
  /**
2
3
  * Helper class for requesting additional data from Unimonitor CEM API
3
4
  */
4
5
  declare class UnimonitorCemApi {
6
+ private config;
5
7
  static API_DATE_FORMAT: string;
6
8
  static API_DATE_TZ: string;
7
9
  private static COOKIE_KV_SEPARATOR;
10
+ constructor(config: ISimpleConfig);
8
11
  /**
9
12
  * Create API session and return authorization cookie
10
13
  */
11
- static createSession: () => Promise<{
12
- authCookie: string;
13
- }>;
14
+ createSession: () => Promise<string>;
14
15
  /**
15
16
  * Terminate current session/invalidate auth cookie
16
17
  */
17
- static terminateSession: (authCookie: string) => Promise<void>;
18
+ terminateSession: (authCookie: string) => Promise<void>;
18
19
  /**
19
20
  * Return resource types/identifiers
20
21
  */
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
2
14
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
15
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
16
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -11,16 +23,66 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
23
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
24
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
25
  };
14
- var _a;
26
+ var UnimonitorCemApi_1;
15
27
  Object.defineProperty(exports, "__esModule", { value: true });
16
28
  exports.UnimonitorCemApi = void 0;
17
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
18
29
  const axios_1 = __importDefault(require("@golemio/core/dist/shared/axios"));
19
- const config_1 = require("@golemio/core/dist/integration-engine/config");
30
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
31
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
32
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
20
33
  /**
21
34
  * Helper class for requesting additional data from Unimonitor CEM API
22
35
  */
23
- class UnimonitorCemApi {
36
+ let UnimonitorCemApi = UnimonitorCemApi_1 = class UnimonitorCemApi {
37
+ constructor(config) {
38
+ this.config = config;
39
+ /**
40
+ * Create API session and return authorization cookie
41
+ */
42
+ this.createSession = () => __awaiter(this, void 0, void 0, function* () {
43
+ var _a;
44
+ try {
45
+ const { url, authcookiename, user, pass } = this.config.getValue("old.datasources.UnimonitorCemApiEnergetics");
46
+ const params = new URLSearchParams({
47
+ id: UnimonitorCemApi_1.resourceType.UserLogin,
48
+ pass,
49
+ user,
50
+ });
51
+ const axiosUrl = `${url}?${params}`;
52
+ const axiosConfig = {
53
+ timeout: 10000,
54
+ };
55
+ const { headers } = yield axios_1.default.get(axiosUrl, axiosConfig);
56
+ const cookieHeader = (_a = headers["set-cookie"]) === null || _a === void 0 ? void 0 : _a[0];
57
+ return UnimonitorCemApi_1.processAndFilterAuthCookie(cookieHeader, authcookiename);
58
+ }
59
+ catch (err) {
60
+ throw new golemio_errors_1.GeneralError("Cannot retrieve Unimonitor CEM API authorization token", UnimonitorCemApi_1.name, err);
61
+ }
62
+ });
63
+ /**
64
+ * Terminate current session/invalidate auth cookie
65
+ */
66
+ this.terminateSession = (authCookie) => __awaiter(this, void 0, void 0, function* () {
67
+ const url = this.config.getValue("old.datasources.UnimonitorCemApiEnergetics.url");
68
+ const params = new URLSearchParams({
69
+ id: UnimonitorCemApi_1.resourceType.UserLogout,
70
+ });
71
+ const axiosUrl = `${url}?${params}`;
72
+ const axiosConfig = {
73
+ headers: {
74
+ Cookie: authCookie,
75
+ },
76
+ timeout: 10000,
77
+ };
78
+ try {
79
+ yield axios_1.default.get(axiosUrl, axiosConfig);
80
+ }
81
+ catch (err) {
82
+ throw new golemio_errors_1.GeneralError("Cannot terminate Unimonitor CEM API session", UnimonitorCemApi_1.name, err);
83
+ }
84
+ });
85
+ }
24
86
  /**
25
87
  * Return resource types/identifiers
26
88
  */
@@ -35,73 +97,29 @@ class UnimonitorCemApi {
35
97
  UserLogout: "5",
36
98
  };
37
99
  }
38
- }
100
+ };
39
101
  exports.UnimonitorCemApi = UnimonitorCemApi;
40
- _a = UnimonitorCemApi;
41
102
  UnimonitorCemApi.API_DATE_FORMAT = "yyyy-LL-dd"; // Luxon token format: https://moment.github.io/luxon/#/formatting
42
103
  UnimonitorCemApi.API_DATE_TZ = "Europe/Prague";
43
104
  UnimonitorCemApi.COOKIE_KV_SEPARATOR = "=";
44
- /**
45
- * Create API session and return authorization cookie
46
- */
47
- UnimonitorCemApi.createSession = () => __awaiter(void 0, void 0, void 0, function* () {
48
- var _b;
49
- const { url, authCookieName, user, pass } = config_1.config.datasources.UnimonitorCemApiEnergetics;
50
- const params = new URLSearchParams({
51
- id: UnimonitorCemApi.resourceType.UserLogin,
52
- pass,
53
- user,
54
- });
55
- const axiosUrl = `${url}?${params}`;
56
- const axiosConfig = {
57
- timeout: 10000,
58
- };
59
- try {
60
- const { headers } = yield axios_1.default.get(axiosUrl, axiosConfig);
61
- const cookieHeader = (_b = headers["set-cookie"]) === null || _b === void 0 ? void 0 : _b[0];
62
- return {
63
- authCookie: UnimonitorCemApi.processAndFilterAuthCookie(cookieHeader, authCookieName),
64
- };
65
- }
66
- catch (err) {
67
- throw new golemio_errors_1.GeneralError("Cannot retrieve Unimonitor CEM API authorization token", UnimonitorCemApi.name, err);
68
- }
69
- });
70
- /**
71
- * Terminate current session/invalidate auth cookie
72
- */
73
- UnimonitorCemApi.terminateSession = (authCookie) => __awaiter(void 0, void 0, void 0, function* () {
74
- const { url } = config_1.config.datasources.UnimonitorCemApiEnergetics;
75
- const params = new URLSearchParams({
76
- id: UnimonitorCemApi.resourceType.UserLogout,
77
- });
78
- const axiosUrl = `${url}?${params}`;
79
- const axiosConfig = {
80
- headers: {
81
- Cookie: authCookie,
82
- },
83
- timeout: 10000,
84
- };
85
- try {
86
- yield axios_1.default.get(axiosUrl, axiosConfig);
87
- }
88
- catch (err) {
89
- throw new golemio_errors_1.GeneralError("Cannot terminate Unimonitor CEM API session", UnimonitorCemApi.name, err);
90
- }
91
- });
92
105
  /**
93
106
  * Process and filter auth cookie from the original cookie header
94
107
  */
95
108
  UnimonitorCemApi.processAndFilterAuthCookie = (cookieHeader, authCookieName) => {
96
- var _b;
97
- const rawCookies = (_b = cookieHeader === null || cookieHeader === void 0 ? void 0 : cookieHeader.split(";")) !== null && _b !== void 0 ? _b : [];
109
+ var _a;
110
+ const rawCookies = (_a = cookieHeader === null || cookieHeader === void 0 ? void 0 : cookieHeader.split(";")) !== null && _a !== void 0 ? _a : [];
98
111
  for (const rawCookie of rawCookies) {
99
- const rawCookieArray = rawCookie.split(UnimonitorCemApi.COOKIE_KV_SEPARATOR).map((prop) => prop.trim());
112
+ const rawCookieArray = rawCookie.split(UnimonitorCemApi_1.COOKIE_KV_SEPARATOR).map((prop) => prop.trim());
100
113
  const [cookieName, cookieValue] = rawCookieArray;
101
114
  if (cookieName === authCookieName && !!cookieValue) {
102
- return rawCookieArray.join(UnimonitorCemApi.COOKIE_KV_SEPARATOR);
115
+ return rawCookieArray.join(UnimonitorCemApi_1.COOKIE_KV_SEPARATOR);
103
116
  }
104
117
  }
105
118
  return "";
106
119
  };
120
+ exports.UnimonitorCemApi = UnimonitorCemApi = UnimonitorCemApi_1 = __decorate([
121
+ (0, tsyringe_1.injectable)(),
122
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
123
+ __metadata("design:paramtypes", [Object])
124
+ ], UnimonitorCemApi);
107
125
  //# sourceMappingURL=UnimonitorCemApiHelper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnimonitorCemApiHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/UnimonitorCemApiHelper.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"UnimonitorCemApiHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/UnimonitorCemApiHelper.ts"],"names":[],"mappings":"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"}