@golemio/energetics 1.4.8-rc.1556310797 → 1.4.8-rc.1648036666

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 (78) hide show
  1. package/db/migrations/postgresql/20250120141804-ptas-selected-meters.js +53 -0
  2. package/db/migrations/postgresql/sqls/20250120141804-ptas-selected-meters-down.sql +1 -0
  3. package/db/migrations/postgresql/sqls/20250120141804-ptas-selected-meters-up.sql +3 -0
  4. package/dist/input-gateway/helpers/PreDataExtractor.d.ts +5 -0
  5. package/dist/input-gateway/helpers/PreDataExtractor.js +20 -0
  6. package/dist/input-gateway/helpers/PreDataExtractor.js.map +1 -0
  7. package/dist/input-gateway/index.d.ts +1 -0
  8. package/dist/input-gateway/index.js +1 -0
  9. package/dist/input-gateway/index.js.map +1 -1
  10. package/dist/input-gateway/pre/PreCsvInputController.d.ts +8 -0
  11. package/dist/input-gateway/pre/PreCsvInputController.js +42 -0
  12. package/dist/input-gateway/pre/PreCsvInputController.js.map +1 -0
  13. package/dist/input-gateway/pre/PreInputRouter.d.ts +14 -0
  14. package/dist/input-gateway/pre/PreInputRouter.js +57 -0
  15. package/dist/input-gateway/pre/PreInputRouter.js.map +1 -0
  16. package/dist/input-gateway/pre/PreJsonInputController.d.ts +8 -0
  17. package/dist/input-gateway/pre/PreJsonInputController.js +44 -0
  18. package/dist/input-gateway/pre/PreJsonInputController.js.map +1 -0
  19. package/dist/input-gateway/pre/index.d.ts +2 -0
  20. package/dist/input-gateway/pre/index.js +19 -0
  21. package/dist/input-gateway/pre/index.js.map +1 -0
  22. package/dist/input-gateway/transformations/PreCsvInputTransformation.d.ts +8 -0
  23. package/dist/input-gateway/transformations/PreCsvInputTransformation.js +25 -0
  24. package/dist/input-gateway/transformations/PreCsvInputTransformation.js.map +1 -0
  25. package/dist/integration-engine/commodity-providers/datasources/pre-elektro-api/PreElectroApiDataSourceProvider.js.map +1 -1
  26. package/dist/integration-engine/commodity-providers/helper/PreMeasurementFilter.d.ts +4 -0
  27. package/dist/integration-engine/commodity-providers/helper/PreMeasurementFilter.js +15 -0
  28. package/dist/integration-engine/commodity-providers/helper/PreMeasurementFilter.js.map +1 -0
  29. package/dist/integration-engine/commodity-providers/ioc/Di.js +4 -0
  30. package/dist/integration-engine/commodity-providers/ioc/Di.js.map +1 -1
  31. package/dist/integration-engine/commodity-providers/ioc/WorkerContainerToken.d.ts +2 -0
  32. package/dist/integration-engine/commodity-providers/ioc/WorkerContainerToken.js +2 -0
  33. package/dist/integration-engine/commodity-providers/ioc/WorkerContainerToken.js.map +1 -1
  34. package/dist/integration-engine/commodity-providers/repositories/StaticMeterSettingsRepository.js.map +1 -1
  35. package/dist/integration-engine/commodity-providers/transformations/PreMeasurementTransformation.d.ts +16 -0
  36. package/dist/integration-engine/commodity-providers/transformations/PreMeasurementTransformation.js +39 -0
  37. package/dist/integration-engine/commodity-providers/transformations/PreMeasurementTransformation.js.map +1 -0
  38. package/dist/integration-engine/commodity-providers/workers/CommodityWorker.js +1 -0
  39. package/dist/integration-engine/commodity-providers/workers/CommodityWorker.js.map +1 -1
  40. package/dist/integration-engine/commodity-providers/workers/interfaces/IPreEanMeasurement.d.ts +4 -0
  41. package/dist/integration-engine/commodity-providers/workers/interfaces/IPreEanMeasurement.js +3 -0
  42. package/dist/integration-engine/commodity-providers/workers/interfaces/IPreEanMeasurement.js.map +1 -0
  43. package/dist/integration-engine/commodity-providers/workers/schema/PreEanMeasurementSchema.d.ts +5 -0
  44. package/dist/integration-engine/commodity-providers/workers/schema/PreEanMeasurementSchema.js +25 -0
  45. package/dist/integration-engine/commodity-providers/workers/schema/PreEanMeasurementSchema.js.map +1 -0
  46. package/dist/integration-engine/commodity-providers/workers/tasks/FetchMeasurementOptionsStaticDataTask.js +1 -0
  47. package/dist/integration-engine/commodity-providers/workers/tasks/FetchMeasurementOptionsStaticDataTask.js.map +1 -1
  48. package/dist/integration-engine/commodity-providers/workers/tasks/FetchPreMeasurementDataTask.js.map +1 -1
  49. package/dist/integration-engine/commodity-providers/workers/tasks/FetchPtasWebScrapedMeasurementsTask.d.ts +1 -3
  50. package/dist/integration-engine/commodity-providers/workers/tasks/FetchPtasWebScrapedMeasurementsTask.js +10 -10
  51. package/dist/integration-engine/commodity-providers/workers/tasks/FetchPtasWebScrapedMeasurementsTask.js.map +1 -1
  52. package/dist/integration-engine/commodity-providers/workers/tasks/ProcessPreEanMeasurementsTask.d.ts +16 -0
  53. package/dist/integration-engine/commodity-providers/workers/tasks/ProcessPreEanMeasurementsTask.js +74 -0
  54. package/dist/integration-engine/commodity-providers/workers/tasks/ProcessPreEanMeasurementsTask.js.map +1 -0
  55. package/dist/schema-definitions/datasources/PreCsvInputSchema.d.ts +3 -0
  56. package/dist/schema-definitions/datasources/PreCsvInputSchema.js +19 -0
  57. package/dist/schema-definitions/datasources/PreCsvInputSchema.js.map +1 -0
  58. package/dist/schema-definitions/datasources/PreJsonInputSchema.d.ts +3 -0
  59. package/dist/schema-definitions/datasources/PreJsonInputSchema.js +51 -0
  60. package/dist/schema-definitions/datasources/PreJsonInputSchema.js.map +1 -0
  61. package/dist/schema-definitions/datasources/interfaces/IPreCsvInput.d.ts +5 -0
  62. package/dist/schema-definitions/datasources/interfaces/IPreCsvInput.js +3 -0
  63. package/dist/schema-definitions/datasources/interfaces/IPreCsvInput.js.map +1 -0
  64. package/dist/schema-definitions/datasources/interfaces/IPreJsonInput.d.ts +15 -0
  65. package/dist/schema-definitions/datasources/interfaces/IPreJsonInput.js +3 -0
  66. package/dist/schema-definitions/datasources/interfaces/IPreJsonInput.js.map +1 -0
  67. package/dist/schema-definitions/datasources/interfaces/IStaticMeterSettings.d.ts +3 -0
  68. package/dist/schema-definitions/models/helpers/CommodityProviderTypeEnum.d.ts +2 -1
  69. package/dist/schema-definitions/models/helpers/CommodityProviderTypeEnum.js +1 -0
  70. package/dist/schema-definitions/models/helpers/CommodityProviderTypeEnum.js.map +1 -1
  71. package/dist/schema-definitions/models/helpers/StaticDataResourceTypeEnum.d.ts +2 -1
  72. package/dist/schema-definitions/models/helpers/StaticDataResourceTypeEnum.js +1 -0
  73. package/dist/schema-definitions/models/helpers/StaticDataResourceTypeEnum.js.map +1 -1
  74. package/dist/schema-definitions/models/interfaces/IStaticDataOutputDto.d.ts +2 -1
  75. package/docs/asyncapi.yaml +32 -2
  76. package/docs/implementation_documentation.md +34 -0
  77. package/docs/openapi-input.yaml +93 -0
  78. package/package.json +3 -1
@@ -51,7 +51,80 @@ paths:
51
51
  description: Not found
52
52
  422:
53
53
  description: Error while validating input data
54
+ /pre:
55
+ post:
56
+ description: Input for PRE json data
57
+ tags:
58
+ - ⚡ Energetics
59
+ requestBody:
60
+ content:
61
+ application/json:
62
+ schema:
63
+ $ref: "#/components/schemas/PreMeasurement"
64
+ examples:
65
+ application/json:
66
+ summary: Example input
67
+ value:
68
+ "{
69
+ \"project_name\": \"REPORT_PRAHA_OICT\",
70
+ \"stored_month\": {
71
+ \"year\": 2024,
72
+ \"month\": 11,
73
+ \"companies\": {
74
+ \"70872503\": {
75
+ \"EAN_list\": {
76
+ \"859182400306074267\": {
77
+ \"daily_data_Wh_per_EAN\": {
78
+ \"T1_Wh_raw_data\": [
79
+ [
80
+ [
81
+ \"30.11.2024 00:15\",
82
+ 10
83
+ ],
84
+ [
85
+ \"30.11.2024 00:30\",
86
+ 12
87
+ ]
88
+ ]
89
+ ]
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }"
97
+ responses:
98
+ 204:
99
+ description: OK
100
+ 401:
101
+ $ref: "#/components/responses/UnauthorizedError"
102
+ 422:
103
+ description: Error while validating input data
104
+ /pre/csv:
105
+ post:
106
+ tags:
107
+ - ⚡ Energetics
108
+ summary: Receive and save PRE data in CSV format
109
+ requestBody:
110
+ content:
111
+ text/csv:
112
+ schema:
113
+ $ref: "#/components/schemas/PreCsvMeasurement"
114
+ examples:
115
+ text/csv:
116
+ summary: Sample data
117
+ value:
118
+ "Počátek intervalu;Konec intervalu;859182400300027238 - Činná - spotřeba [kW];859182400300027238 - Induktivní - spotřeba [kVAr];859182400300027238 - Kapacitní - spotřeba [kVAr];
54
119
 
120
+ 01.01.2021 00:00;01.01.2021 00:15;57,000;0,000;5,000;"
121
+ responses:
122
+ 204:
123
+ description: OK
124
+ 401:
125
+ $ref: "#/components/responses/UnauthorizedError"
126
+ 422:
127
+ description: Error while validating input data
55
128
  components:
56
129
  responses:
57
130
  UnauthorizedError:
@@ -95,3 +168,23 @@ components:
95
168
  type: string
96
169
  Status odečtu:
97
170
  type: string
171
+ PreCsvMeasurement:
172
+ type: object
173
+ properties:
174
+ Počátek intervalu:
175
+ type: string
176
+ Konec intervalu:
177
+ type: string
178
+ required:
179
+ - Počátek intervalu
180
+ - Konec intervalu
181
+ PreMeasurement:
182
+ type: object
183
+ properties:
184
+ stored_month:
185
+ type: object
186
+ properties:
187
+ companies:
188
+ type: object
189
+
190
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/energetics",
3
- "version": "1.4.8-rc.1556310797",
3
+ "version": "1.4.8-rc.1648036666",
4
4
  "description": "Golemio Energetics Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,6 +46,8 @@
46
46
  "@types/papaparse": "^5.3.14",
47
47
  "@types/sinon": "^9.0.10",
48
48
  "@types/supertest": "^6.0.2",
49
+ "body-parser": "^1.20.3",
50
+ "body-parser-xml": "^2.0.5",
49
51
  "chai": "4.2.0",
50
52
  "chai-as-promised": "7.1.1",
51
53
  "cross-env": "^7.0.3",