@golemio/energetics 1.3.5 → 1.3.7-dev.1315648116

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 (174) hide show
  1. package/db/example/00_clear_test_data.sql +6 -0
  2. package/db/example/01_buildings.sql +206 -0
  3. package/db/example/02_organizations.sql +24 -0
  4. package/db/example/03_devices.sql +24 -0
  5. package/db/migrations/postgresql/.config.json +1 -1
  6. package/db/migrations/postgresql/20240514074033-buildings.js +53 -0
  7. package/db/migrations/postgresql/20240514111900-organizations.js +53 -0
  8. package/db/migrations/postgresql/sqls/20240514074033-buildings-down.sql +2 -0
  9. package/db/migrations/postgresql/sqls/20240514074033-buildings-up.sql +138 -0
  10. package/db/migrations/postgresql/sqls/20240514111900-organizations-down.sql +3 -0
  11. package/db/migrations/postgresql/sqls/20240514111900-organizations-up.sql +37 -0
  12. package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js +0 -2
  13. package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js.map +1 -1
  14. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js +0 -4
  15. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js.map +1 -1
  16. package/dist/output-gateway/constants/Links.d.ts +3 -0
  17. package/dist/output-gateway/constants/Links.js +7 -0
  18. package/dist/output-gateway/constants/Links.js.map +1 -0
  19. package/dist/output-gateway/constants/RouteVersion.d.ts +3 -0
  20. package/dist/output-gateway/constants/RouteVersion.js +8 -0
  21. package/dist/output-gateway/constants/RouteVersion.js.map +1 -0
  22. package/dist/output-gateway/controllers/v2/BuildingsController.d.ts +11 -0
  23. package/dist/output-gateway/controllers/v2/BuildingsController.js +74 -0
  24. package/dist/output-gateway/controllers/v2/BuildingsController.js.map +1 -0
  25. package/dist/output-gateway/controllers/v2/V2DevicesController.d.ts +11 -0
  26. package/dist/output-gateway/controllers/v2/V2DevicesController.js +67 -0
  27. package/dist/output-gateway/controllers/v2/V2DevicesController.js.map +1 -0
  28. package/dist/output-gateway/controllers/v2/V2OrganizationsController.d.ts +13 -0
  29. package/dist/output-gateway/controllers/v2/V2OrganizationsController.js +79 -0
  30. package/dist/output-gateway/controllers/v2/V2OrganizationsController.js.map +1 -0
  31. package/dist/output-gateway/helpers/CreateLinkHelper.d.ts +6 -0
  32. package/dist/output-gateway/helpers/CreateLinkHelper.js +32 -0
  33. package/dist/output-gateway/helpers/CreateLinkHelper.js.map +1 -0
  34. package/dist/output-gateway/index.d.ts +1 -0
  35. package/dist/output-gateway/index.js +10 -0
  36. package/dist/output-gateway/index.js.map +1 -0
  37. package/dist/output-gateway/ioc/Di.d.ts +3 -0
  38. package/dist/output-gateway/ioc/Di.js +51 -0
  39. package/dist/output-gateway/ioc/Di.js.map +1 -0
  40. package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +22 -0
  41. package/dist/output-gateway/ioc/ModuleContainerToken.js +26 -0
  42. package/dist/output-gateway/ioc/ModuleContainerToken.js.map +1 -0
  43. package/dist/output-gateway/models/BuildingsPrimaryModel.d.ts +17 -0
  44. package/dist/output-gateway/models/BuildingsPrimaryModel.js +49 -0
  45. package/dist/output-gateway/models/BuildingsPrimaryModel.js.map +1 -0
  46. package/dist/output-gateway/models/BuildingsSecondaryModel.d.ts +124 -0
  47. package/dist/output-gateway/models/BuildingsSecondaryModel.js +338 -0
  48. package/dist/output-gateway/models/BuildingsSecondaryModel.js.map +1 -0
  49. package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.d.ts +6 -0
  50. package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.js +2 -0
  51. package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.js.map +1 -0
  52. package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.d.ts +156 -0
  53. package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.js +3 -0
  54. package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.js.map +1 -0
  55. package/dist/output-gateway/models/interfaces/IPrimaryBuildings.d.ts +10 -0
  56. package/dist/output-gateway/models/interfaces/IPrimaryBuildings.js +3 -0
  57. package/dist/output-gateway/models/interfaces/IPrimaryBuildings.js.map +1 -0
  58. package/dist/output-gateway/models/interfaces/ISecondaryBuildings.d.ts +114 -0
  59. package/dist/output-gateway/models/interfaces/ISecondaryBuildings.js +3 -0
  60. package/dist/output-gateway/models/interfaces/ISecondaryBuildings.js.map +1 -0
  61. package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.d.ts +117 -0
  62. package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.js +3 -0
  63. package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.js.map +1 -0
  64. package/dist/output-gateway/repositories/DevicesRepository.d.ts +8 -0
  65. package/dist/output-gateway/repositories/DevicesRepository.js +64 -0
  66. package/dist/output-gateway/repositories/DevicesRepository.js.map +1 -0
  67. package/dist/output-gateway/repositories/OrganizationBuildingsRepository.d.ts +6 -0
  68. package/dist/output-gateway/repositories/OrganizationBuildingsRepository.js +47 -0
  69. package/dist/output-gateway/repositories/OrganizationBuildingsRepository.js.map +1 -0
  70. package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.d.ts +6 -0
  71. package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.js +47 -0
  72. package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.js.map +1 -0
  73. package/dist/output-gateway/repositories/OrganizationsRepository.d.ts +17 -0
  74. package/dist/output-gateway/repositories/OrganizationsRepository.js +133 -0
  75. package/dist/output-gateway/repositories/OrganizationsRepository.js.map +1 -0
  76. package/dist/output-gateway/repositories/PrimaryBuildingsRepository.d.ts +15 -0
  77. package/dist/output-gateway/repositories/PrimaryBuildingsRepository.js +86 -0
  78. package/dist/output-gateway/repositories/PrimaryBuildingsRepository.js.map +1 -0
  79. package/dist/output-gateway/repositories/SecondaryBuildingsRepository.d.ts +6 -0
  80. package/dist/output-gateway/repositories/SecondaryBuildingsRepository.js +33 -0
  81. package/dist/output-gateway/repositories/SecondaryBuildingsRepository.js.map +1 -0
  82. package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.d.ts +9 -0
  83. package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.js +47 -0
  84. package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.js.map +1 -0
  85. package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.d.ts +5 -0
  86. package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.js +3 -0
  87. package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.js.map +1 -0
  88. package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.d.ts +18 -0
  89. package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.js +3 -0
  90. package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.js.map +1 -0
  91. package/dist/output-gateway/repositories/interfaces/IOrganizationDto.d.ts +4 -0
  92. package/dist/output-gateway/repositories/interfaces/IOrganizationDto.js +3 -0
  93. package/dist/output-gateway/repositories/interfaces/IOrganizationDto.js.map +1 -0
  94. package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.d.ts +8 -0
  95. package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.js +3 -0
  96. package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.js.map +1 -0
  97. package/dist/output-gateway/routers/helpers/parseParams.d.ts +4 -0
  98. package/dist/output-gateway/routers/helpers/parseParams.js +17 -0
  99. package/dist/output-gateway/routers/helpers/parseParams.js.map +1 -0
  100. package/dist/output-gateway/routers/interfaces/IDeviceResponse.d.ts +6 -0
  101. package/dist/output-gateway/routers/interfaces/IDeviceResponse.js +3 -0
  102. package/dist/output-gateway/routers/interfaces/IDeviceResponse.js.map +1 -0
  103. package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.d.ts +34 -0
  104. package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.js +3 -0
  105. package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.js.map +1 -0
  106. package/dist/output-gateway/routers/interfaces/IOrganizationResponse.d.ts +4 -0
  107. package/dist/output-gateway/routers/interfaces/IOrganizationResponse.js +3 -0
  108. package/dist/output-gateway/routers/interfaces/IOrganizationResponse.js.map +1 -0
  109. package/dist/output-gateway/routers/interfaces/IPaginationParams.d.ts +4 -0
  110. package/dist/output-gateway/routers/interfaces/IPaginationParams.js +3 -0
  111. package/dist/output-gateway/routers/interfaces/IPaginationParams.js.map +1 -0
  112. package/dist/output-gateway/routers/v2/BuildingsRouter.d.ts +10 -0
  113. package/dist/output-gateway/routers/v2/BuildingsRouter.js +28 -0
  114. package/dist/output-gateway/routers/v2/BuildingsRouter.js.map +1 -0
  115. package/dist/output-gateway/routers/v2/V2DevicesRouter.d.ts +7 -0
  116. package/dist/output-gateway/routers/v2/V2DevicesRouter.js +41 -0
  117. package/dist/output-gateway/routers/v2/V2DevicesRouter.js.map +1 -0
  118. package/dist/output-gateway/routers/v2/V2OrganizationsRouter.d.ts +7 -0
  119. package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js +41 -0
  120. package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js.map +1 -0
  121. package/dist/output-gateway/transformations/BuildingTransformationFull.d.ts +14 -0
  122. package/dist/output-gateway/transformations/BuildingTransformationFull.js +218 -0
  123. package/dist/output-gateway/transformations/BuildingTransformationFull.js.map +1 -0
  124. package/dist/output-gateway/transformations/BuildingsTransformation.d.ts +8 -0
  125. package/dist/output-gateway/transformations/BuildingsTransformation.js +38 -0
  126. package/dist/output-gateway/transformations/BuildingsTransformation.js.map +1 -0
  127. package/dist/output-gateway/transformations/DeviceDtoTransformation.d.ts +8 -0
  128. package/dist/output-gateway/transformations/DeviceDtoTransformation.js +43 -0
  129. package/dist/output-gateway/transformations/DeviceDtoTransformation.js.map +1 -0
  130. package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.d.ts +9 -0
  131. package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.js +64 -0
  132. package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.js.map +1 -0
  133. package/dist/output-gateway/transformations/OrganizationDtoTransformation.d.ts +9 -0
  134. package/dist/output-gateway/transformations/OrganizationDtoTransformation.js +36 -0
  135. package/dist/output-gateway/transformations/OrganizationDtoTransformation.js.map +1 -0
  136. package/dist/schema-definitions/models/OrganizationBuildingModel.d.ts +10 -0
  137. package/dist/schema-definitions/models/OrganizationBuildingModel.js +33 -0
  138. package/dist/schema-definitions/models/OrganizationBuildingModel.js.map +1 -0
  139. package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.d.ts +16 -0
  140. package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.js +44 -0
  141. package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.js.map +1 -0
  142. package/dist/schema-definitions/models/OrganizationsModel.d.ts +21 -0
  143. package/dist/schema-definitions/models/OrganizationsModel.js +59 -0
  144. package/dist/schema-definitions/models/OrganizationsModel.js.map +1 -0
  145. package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.d.ts +4 -0
  146. package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.js +3 -0
  147. package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.js.map +1 -0
  148. package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.d.ts +10 -0
  149. package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.js +3 -0
  150. package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.js.map +1 -0
  151. package/dist/schema-definitions/models/interfaces/IOrganizationsModel.d.ts +15 -0
  152. package/dist/schema-definitions/models/interfaces/IOrganizationsModel.js +3 -0
  153. package/dist/schema-definitions/models/interfaces/IOrganizationsModel.js.map +1 -0
  154. package/docs/implementation_documentation.md +41 -41
  155. package/docs/openapi-output.yaml +854 -0
  156. package/package.json +5 -3
  157. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.d.ts +0 -4
  158. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js +0 -19
  159. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js.map +0 -1
  160. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.d.ts +0 -4
  161. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js +0 -19
  162. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js.map +0 -1
  163. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.d.ts +0 -9
  164. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js +0 -44
  165. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js.map +0 -1
  166. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.d.ts +0 -9
  167. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js +0 -44
  168. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js.map +0 -1
  169. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.d.ts +0 -7
  170. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js +0 -166
  171. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js.map +0 -1
  172. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.d.ts +0 -7
  173. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js +0 -41
  174. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ import { IBuildingsPrimary } from "../models/interfaces/IPrimaryBuildings";
2
+ import { ISecondaryBuildingsOutput } from "../models/interfaces/ISecondaryBuildingsOutput";
3
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
4
+ export declare class PrimaryBuildingsRepository extends SequelizeModel {
5
+ private secondaryBuildingRepository;
6
+ constructor();
7
+ associate: () => void;
8
+ GetAll(): Promise<IBuildingsPrimary[]>;
9
+ GetAllFull(): Promise<Array<IBuildingsPrimary & {
10
+ secondary: ISecondaryBuildingsOutput;
11
+ }>>;
12
+ GetOne(id: number): Promise<(IBuildingsPrimary & {
13
+ secondary: ISecondaryBuildingsOutput;
14
+ }) | null>;
15
+ }
@@ -0,0 +1,86 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.PrimaryBuildingsRepository = void 0;
22
+ const BuildingsPrimaryModel_1 = require("../models/BuildingsPrimaryModel");
23
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
24
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
25
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
26
+ const SecondaryBuildingsRepository_1 = require("./SecondaryBuildingsRepository");
27
+ let PrimaryBuildingsRepository = exports.PrimaryBuildingsRepository = class PrimaryBuildingsRepository extends output_gateway_1.SequelizeModel {
28
+ constructor() {
29
+ super(BuildingsPrimaryModel_1.BuildingsPrimaryModel.modelName, BuildingsPrimaryModel_1.BuildingsPrimaryModel.tableName, BuildingsPrimaryModel_1.BuildingsPrimaryModel.attributeModel, {
30
+ schema: "energetics",
31
+ });
32
+ this.associate = () => {
33
+ this.sequelizeModel.hasOne(this.secondaryBuildingRepository.sequelizeModel, {
34
+ as: "secondary",
35
+ foreignKey: "id",
36
+ sourceKey: "id",
37
+ });
38
+ };
39
+ this.secondaryBuildingRepository = new SecondaryBuildingsRepository_1.SecondaryBuildingsRepository();
40
+ this.associate();
41
+ }
42
+ GetAll() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ try {
45
+ return this.sequelizeModel.findAll({
46
+ order: [["id", "DESC"]],
47
+ raw: true,
48
+ });
49
+ }
50
+ catch (err) {
51
+ throw new golemio_errors_1.GeneralError("Database error ~ GetAll BuildingsRepository", this.name, err, 500);
52
+ }
53
+ });
54
+ }
55
+ GetAllFull() {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ try {
58
+ return this.sequelizeModel.findAll({
59
+ include: [{ as: "secondary", model: this.secondaryBuildingRepository.sequelizeModel }],
60
+ order: [["id", "DESC"]],
61
+ });
62
+ }
63
+ catch (err) {
64
+ throw new golemio_errors_1.GeneralError("Database error ~ GetAll BuildingsRepository", this.name, err, 500);
65
+ }
66
+ });
67
+ }
68
+ GetOne(id) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ try {
71
+ return yield this.sequelizeModel.findOne({
72
+ include: [{ as: "secondary", model: this.secondaryBuildingRepository.sequelizeModel }],
73
+ where: { id: id },
74
+ });
75
+ }
76
+ catch (err) {
77
+ throw new golemio_errors_1.GeneralError("Database error ~ GetOne BuildingsRepository", this.name, err, 500);
78
+ }
79
+ });
80
+ }
81
+ };
82
+ exports.PrimaryBuildingsRepository = PrimaryBuildingsRepository = __decorate([
83
+ (0, tsyringe_1.injectable)(),
84
+ __metadata("design:paramtypes", [])
85
+ ], PrimaryBuildingsRepository);
86
+ //# sourceMappingURL=PrimaryBuildingsRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimaryBuildingsRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/PrimaryBuildingsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2EAAyE;AAGzE,sEAAmE;AACnE,6EAAwE;AACxE,iEAAgE;AAChE,iFAA8E;AAGvE,IAAM,0BAA0B,wCAAhC,MAAM,0BAA2B,SAAQ,+BAAc;IAE1D;QACI,KAAK,CAAC,6CAAqB,CAAC,SAAS,EAAE,6CAAqB,CAAC,SAAS,EAAE,6CAAqB,CAAC,cAAc,EAAE;YAC1G,MAAM,EAAE,YAAY;SACvB,CAAC,CAAC;QAKA,cAAS,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,cAAc,EAAE;gBACxE,EAAE,EAAE,WAAW;gBACf,UAAU,EAAE,IAAI;gBAChB,SAAS,EAAE,IAAI;aAClB,CAAC,CAAC;QACP,CAAC,CAAC;QAVE,IAAI,CAAC,2BAA2B,GAAG,IAAI,2DAA4B,EAAE,CAAC;QACtE,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IAUY,MAAM;;YACf,IAAI;gBACA,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAwB;oBACtD,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBACvB,GAAG,EAAE,IAAI;iBACZ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,6CAA6C,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;IAEY,UAAU;;YACnB,IAAI;gBACA,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAmE;oBACjG,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,2BAA2B,CAAC,cAAc,EAAE,CAAC;oBACtF,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;iBAC1B,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,6CAA6C,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;IAEY,MAAM,CAAC,EAAU;;YAC1B,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAmE;oBACvG,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,2BAA2B,CAAC,cAAc,EAAE,CAAC;oBACtF,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;iBACpB,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,6CAA6C,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;CACJ,CAAA;qCAlDY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;;GACA,0BAA0B,CAkDtC"}
@@ -0,0 +1,6 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ export declare class SecondaryBuildingsRepository extends SequelizeModel {
3
+ constructor();
4
+ GetAll(): never;
5
+ GetOne(): never;
6
+ }
@@ -0,0 +1,33 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SecondaryBuildingsRepository = void 0;
13
+ const BuildingsSecondaryModel_1 = require("../models/BuildingsSecondaryModel");
14
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
15
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
16
+ let SecondaryBuildingsRepository = exports.SecondaryBuildingsRepository = class SecondaryBuildingsRepository extends output_gateway_1.SequelizeModel {
17
+ constructor() {
18
+ super(BuildingsSecondaryModel_1.BuildingsSecondaryModel.modelName, BuildingsSecondaryModel_1.BuildingsSecondaryModel.tableName, BuildingsSecondaryModel_1.BuildingsSecondaryModel.attributeModel, {
19
+ schema: "energetics",
20
+ });
21
+ }
22
+ GetAll() {
23
+ throw new Error("Not implemented");
24
+ }
25
+ GetOne() {
26
+ throw new Error("Not implemented");
27
+ }
28
+ };
29
+ exports.SecondaryBuildingsRepository = SecondaryBuildingsRepository = __decorate([
30
+ (0, tsyringe_1.injectable)(),
31
+ __metadata("design:paramtypes", [])
32
+ ], SecondaryBuildingsRepository);
33
+ //# sourceMappingURL=SecondaryBuildingsRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecondaryBuildingsRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/SecondaryBuildingsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAA6E;AAC7E,sEAAmE;AACnE,iEAAgE;AAGzD,IAAM,4BAA4B,0CAAlC,MAAM,4BAA6B,SAAQ,+BAAc;IAC5D;QACI,KAAK,CAAC,iDAAuB,CAAC,SAAS,EAAE,iDAAuB,CAAC,SAAS,EAAE,iDAAuB,CAAC,cAAc,EAAE;YAChH,MAAM,EAAE,YAAY;SACvB,CAAC,CAAC;IACP,CAAC;IAED,MAAM;QACF,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAED,MAAM;QACF,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;uCAdY,4BAA4B;IADxC,IAAA,qBAAU,GAAE;;GACA,4BAA4B,CAcxC"}
@@ -0,0 +1,9 @@
1
+ import { ModelStatic } from "@golemio/core/dist/shared/sequelize";
2
+ import { OrganizationsModel } from "../../../schema-definitions/models/OrganizationsModel";
3
+ import { OrganizationResponsibleUsersModel } from "../../../schema-definitions/models/OrganizationResponsibleUsersModel";
4
+ import { OrganizationBuildingModel } from "../../../schema-definitions/models/OrganizationBuildingModel";
5
+ import { BuildingsModel } from "../../../schema-definitions/models";
6
+ export declare class OrganizationsAssociations {
7
+ static associateResponsibleUsers(primaryTable: ModelStatic<OrganizationsModel>, secondaryTable: ModelStatic<OrganizationResponsibleUsersModel>): void;
8
+ static associateBuildings(primaryTable: ModelStatic<OrganizationsModel>, secondaryTable: ModelStatic<BuildingsModel>, relationTable: ModelStatic<OrganizationBuildingModel>): void;
9
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationsAssociations = void 0;
4
+ class OrganizationsAssociations {
5
+ static associateResponsibleUsers(primaryTable, secondaryTable) {
6
+ primaryTable.hasMany(secondaryTable, {
7
+ foreignKey: "organization_id",
8
+ sourceKey: "id",
9
+ as: "responsible_user",
10
+ });
11
+ secondaryTable.belongsTo(primaryTable, {
12
+ foreignKey: "organization_id",
13
+ targetKey: "id",
14
+ });
15
+ }
16
+ static associateBuildings(primaryTable, secondaryTable, relationTable) {
17
+ primaryTable.belongsToMany(secondaryTable, {
18
+ through: relationTable,
19
+ foreignKey: "organization_id",
20
+ otherKey: "building_id",
21
+ as: "buildings",
22
+ });
23
+ secondaryTable.belongsToMany(primaryTable, {
24
+ through: relationTable,
25
+ foreignKey: "building_id",
26
+ otherKey: "organization_id",
27
+ });
28
+ relationTable.belongsTo(primaryTable, {
29
+ targetKey: "id",
30
+ foreignKey: "organization_id",
31
+ });
32
+ relationTable.belongsTo(secondaryTable, {
33
+ targetKey: "id",
34
+ foreignKey: "building_id",
35
+ });
36
+ primaryTable.hasMany(relationTable, {
37
+ sourceKey: "id",
38
+ foreignKey: "organization_id",
39
+ });
40
+ secondaryTable.hasMany(relationTable, {
41
+ sourceKey: "id",
42
+ foreignKey: "building_id",
43
+ });
44
+ }
45
+ }
46
+ exports.OrganizationsAssociations = OrganizationsAssociations;
47
+ //# sourceMappingURL=OrganizationsAssociations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrganizationsAssociations.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/helpers/OrganizationsAssociations.ts"],"names":[],"mappings":";;;AAMA,MAAa,yBAAyB;IAC3B,MAAM,CAAC,yBAAyB,CACnC,YAA6C,EAC7C,cAA8D;QAE9D,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE;YACjC,UAAU,EAAE,iBAAiB;YAC7B,SAAS,EAAE,IAAI;YACf,EAAE,EAAE,kBAAkB;SACzB,CAAC,CAAC;QACH,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE;YACnC,UAAU,EAAE,iBAAiB;YAC7B,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;IACP,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAC5B,YAA6C,EAC7C,cAA2C,EAC3C,aAAqD;QAErD,YAAY,CAAC,aAAa,CAAC,cAAc,EAAE;YACvC,OAAO,EAAE,aAAa;YACtB,UAAU,EAAE,iBAAiB;YAC7B,QAAQ,EAAE,aAAa;YACvB,EAAE,EAAE,WAAW;SAClB,CAAC,CAAC;QACH,cAAc,CAAC,aAAa,CAAC,YAAY,EAAE;YACvC,OAAO,EAAE,aAAa;YACtB,UAAU,EAAE,aAAa;YACzB,QAAQ,EAAE,iBAAiB;SAC9B,CAAC,CAAC;QACH,aAAa,CAAC,SAAS,CAAC,YAAY,EAAE;YAClC,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,iBAAiB;SAChC,CAAC,CAAC;QACH,aAAa,CAAC,SAAS,CAAC,cAAc,EAAE;YACpC,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,aAAa;SAC5B,CAAC,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE;YAChC,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,iBAAiB;SAChC,CAAC,CAAC;QACH,cAAc,CAAC,OAAO,CAAC,aAAa,EAAE;YAClC,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,aAAa;SAC5B,CAAC,CAAC;IACP,CAAC;CACJ;AAjDD,8DAiDC"}
@@ -0,0 +1,5 @@
1
+ export interface IOrganizationBuildingDto {
2
+ id: number;
3
+ building_name: string | null;
4
+ building_address_code: string | null;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IOrganizationBuildingDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOrganizationBuildingDto.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/interfaces/IOrganizationBuildingDto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { IOrganizationDto } from "./IOrganizationDto";
2
+ import { IOrganizationBuildingDto } from "./IOrganizationBuildingDto";
3
+ import { IOrganizationResponsibleUserDto } from "./IOrganizationResponsibleUserDto";
4
+ export interface IOrganizationDetailDto extends IOrganizationDto {
5
+ label: string | null;
6
+ address_street: string | null;
7
+ address_house_number: string | null;
8
+ address_city: string | null;
9
+ address_country: string | null;
10
+ address_mail: string | null;
11
+ address_phone: string | null;
12
+ address_web_address: string | null;
13
+ category: string | null;
14
+ created_by_id: number | null;
15
+ grafana_url: string | null;
16
+ responsible_user: IOrganizationResponsibleUserDto[];
17
+ buildings: IOrganizationBuildingDto[];
18
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IOrganizationDetailDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOrganizationDetailDto.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/interfaces/IOrganizationDetailDto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface IOrganizationDto {
2
+ id: number;
3
+ name: string | null;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IOrganizationDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOrganizationDto.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/interfaces/IOrganizationDto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export interface IOrganizationResponsibleUserDto {
2
+ first_name: string | null;
3
+ last_name: string | null;
4
+ position: string | null;
5
+ phone: string | null;
6
+ mail: string | null;
7
+ company: string | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IOrganizationResponsibleUserDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOrganizationResponsibleUserDto.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ /// <reference types="express" />
2
+ import { Request } from "@golemio/core/dist/shared/express";
3
+ import { IPaginationParams } from "../interfaces/IPaginationParams";
4
+ export declare function parseParams(req: Request): IPaginationParams;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseParams = void 0;
4
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
5
+ function parseParams(req) {
6
+ try {
7
+ return {
8
+ limit: req.query.limit ? parseInt(req.query.limit) : undefined,
9
+ offset: req.query.offset ? parseInt(req.query.offset) : undefined,
10
+ };
11
+ }
12
+ catch (err) {
13
+ throw new golemio_errors_1.GeneralError("Param parsing error", "V3ParkingController", err, 500);
14
+ }
15
+ }
16
+ exports.parseParams = parseParams;
17
+ //# sourceMappingURL=parseParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseParams.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/helpers/parseParams.ts"],"names":[],"mappings":";;;AACA,6EAAwE;AAGxE,SAAgB,WAAW,CAAC,GAAY;IACpC,IAAI;QACA,OAAO;YACH,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,SAAS;YACxE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAgB,CAAC,CAAC,CAAC,CAAC,SAAS;SAC9E,CAAC;KACL;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,6BAAY,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;KAClF;AACL,CAAC;AATD,kCASC"}
@@ -0,0 +1,6 @@
1
+ import { IDevicesModel } from "../../../schema-definitions/models/interfaces";
2
+ export interface IDeviceResponse extends Omit<IDevicesModel, "location_number" | "replaced_meter_id" | "meter_index"> {
3
+ location_number: string | null;
4
+ replaced_meter_id: string | null;
5
+ meter_index: number | null;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IDeviceResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDeviceResponse.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IDeviceResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import { IOrganizationResponse } from "./IOrganizationResponse";
2
+ interface IResponsibleUserResponse {
3
+ name: string | null;
4
+ last_name: string | null;
5
+ position: string | null;
6
+ phone: string | null;
7
+ mail: string | null;
8
+ company: string | null;
9
+ }
10
+ interface IBuildingResponse {
11
+ id: number;
12
+ name: string | null;
13
+ building_address_code: string | null;
14
+ link: string;
15
+ }
16
+ export interface IOrganizationDetailResponse extends IOrganizationResponse {
17
+ label: string | null;
18
+ category: string | null;
19
+ created_by_id: string | null;
20
+ grafana_url: string | null;
21
+ address: {
22
+ street: string | null;
23
+ house_number: string | null;
24
+ city: string | null;
25
+ country: string | null;
26
+ mail: string | null;
27
+ phone: string | null;
28
+ web_address: string | null;
29
+ };
30
+ responsible_user: IResponsibleUserResponse[];
31
+ buildings: IBuildingResponse[];
32
+ link: string;
33
+ }
34
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IOrganizationDetailResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOrganizationDetailResponse.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IOrganizationDetailResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { IOrganizationDto } from "../../repositories/interfaces/IOrganizationDto";
2
+ export interface IOrganizationResponse extends IOrganizationDto {
3
+ link: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IOrganizationResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOrganizationResponse.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IOrganizationResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface IPaginationParams {
2
+ limit?: number;
3
+ offset?: number;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPaginationParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPaginationParams.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IPaginationParams.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
2
+ export declare class BuildingsRouter extends AbstractRouter {
3
+ private controller;
4
+ private cacheHeaderMiddleware;
5
+ private maxAge;
6
+ constructor();
7
+ protected initRoutes(): void;
8
+ }
9
+ declare const v2BuildingsRouter: AbstractRouter;
10
+ export { v2BuildingsRouter };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v2BuildingsRouter = exports.BuildingsRouter = void 0;
4
+ const Links_1 = require("../../constants/Links");
5
+ const RouteVersion_1 = require("../../constants/RouteVersion");
6
+ const BuildingsController_1 = require("../../controllers/v2/BuildingsController");
7
+ const Di_1 = require("../../ioc/Di");
8
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
9
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
10
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
11
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
12
+ class BuildingsRouter extends AbstractRouter_1.AbstractRouter {
13
+ constructor() {
14
+ super(RouteVersion_1.RouteVersion.v2, Links_1.BUILDING_PATH);
15
+ this.maxAge = 6 * 60 * 60; // 6 hours
16
+ this.controller = new BuildingsController_1.BuildingsController();
17
+ this.cacheHeaderMiddleware = Di_1.OGEnergeticsContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
18
+ this.initRoutes();
19
+ }
20
+ initRoutes() {
21
+ this.router.get("/", this.cacheHeaderMiddleware.getMiddleware(this.maxAge), this.controller.getAll);
22
+ this.router.get("/:id", this.cacheHeaderMiddleware.getMiddleware(this.maxAge), (0, express_validator_1.param)("id").exists().isNumeric().not().isArray(), Validation_1.checkErrors, this.controller.getOne);
23
+ }
24
+ }
25
+ exports.BuildingsRouter = BuildingsRouter;
26
+ const v2BuildingsRouter = new BuildingsRouter();
27
+ exports.v2BuildingsRouter = v2BuildingsRouter;
28
+ //# sourceMappingURL=BuildingsRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildingsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/BuildingsRouter.ts"],"names":[],"mappings":";;;AAAA,iDAAoD;AACpD,+DAA0D;AAC1D,kFAA6E;AAC7E,qCAAmD;AACnD,sFAAmF;AAEnF,6EAA2E;AAC3E,+DAAuE;AACvE,mFAAoE;AAEpE,MAAa,eAAgB,SAAQ,+BAAc;IAK/C;QACI,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,qBAAa,CAAC,CAAC;QAHlC,WAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;QAIpC,IAAI,CAAC,UAAU,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAC5C,IAAI,CAAC,qBAAqB,GAAG,0BAAqB,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACxH,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAES,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACpG,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,MAAM,EACN,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EACrD,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAChD,wBAAW,EACX,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ;AAtBD,0CAsBC;AAED,MAAM,iBAAiB,GAAmB,IAAI,eAAe,EAAE,CAAC;AAEvD,8CAAiB"}
@@ -0,0 +1,7 @@
1
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
2
+ import { V2DevicesController } from "../../controllers/v2/V2DevicesController";
3
+ export declare class V2DevicesRouter extends AbstractRouter {
4
+ private controller;
5
+ constructor(controller: V2DevicesController);
6
+ protected initRoutes(): void;
7
+ }
@@ -0,0 +1,41 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.V2DevicesRouter = void 0;
16
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
17
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
18
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
19
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
20
+ const V2DevicesController_1 = require("../../controllers/v2/V2DevicesController");
21
+ const RouteVersion_1 = require("../../constants/RouteVersion");
22
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
23
+ const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
24
+ const Links_1 = require("../../constants/Links");
25
+ let V2DevicesRouter = exports.V2DevicesRouter = class V2DevicesRouter extends AbstractRouter_1.AbstractRouter {
26
+ constructor(controller) {
27
+ super(RouteVersion_1.RouteVersion.v2, Links_1.DEVICES_PATH);
28
+ this.controller = controller;
29
+ this.initRoutes();
30
+ }
31
+ initRoutes() {
32
+ this.router.get("/", Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), (0, output_gateway_1.useCacheMiddleware)(), this.controller.getAll);
33
+ this.router.get("/:id", (0, express_validator_1.param)("id").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(), Validation_1.checkErrors, (0, output_gateway_1.useCacheMiddleware)(), this.controller.getOne);
34
+ }
35
+ };
36
+ exports.V2DevicesRouter = V2DevicesRouter = __decorate([
37
+ (0, tsyringe_1.injectable)(),
38
+ __param(0, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.V2DevicesController)),
39
+ __metadata("design:paramtypes", [V2DevicesController_1.V2DevicesController])
40
+ ], V2DevicesRouter);
41
+ //# sourceMappingURL=V2DevicesRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2DevicesRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2DevicesRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sFAAmF;AACnF,sEAAuE;AACvE,6EAAkH;AAClH,mFAAoE;AACpE,kFAA6E;AAC7E,+DAA0D;AAC1D,iEAAwE;AACxE,yEAAoE;AACpE,iDAAmD;AAG5C,IAAM,eAAe,6BAArB,MAAM,eAAgB,SAAQ,+BAAc;IAC/C,YAAsE,UAA+B;QACjG,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,oBAAY,CAAC,CAAC;QAD6B,eAAU,GAAV,UAAU,CAAqB;QAGjG,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAES,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,GAAG,EACH,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,IAAI,CAAC,IAAI,CAAC,EACpC,IAAA,mCAAkB,GAAE,EACpB,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,MAAM,EACN,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAC/E,wBAAW,EACX,IAAA,mCAAkB,GAAE,EACpB,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ,CAAA;0BAzBY,eAAe;IAD3B,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,mBAAmB,CAAC,CAAA;qCAAqB,yCAAmB;GAD5F,eAAe,CAyB3B"}
@@ -0,0 +1,7 @@
1
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
2
+ import { V2OrganizationsController } from "../../controllers/v2/V2OrganizationsController";
3
+ export declare class V2OrganizationsRouter extends AbstractRouter {
4
+ private controller;
5
+ constructor(controller: V2OrganizationsController);
6
+ protected initRoutes(): void;
7
+ }
@@ -0,0 +1,41 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.V2OrganizationsRouter = void 0;
16
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
17
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
18
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
19
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
20
+ const V2OrganizationsController_1 = require("../../controllers/v2/V2OrganizationsController");
21
+ const RouteVersion_1 = require("../../constants/RouteVersion");
22
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
23
+ const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
24
+ const Links_1 = require("../../constants/Links");
25
+ let V2OrganizationsRouter = exports.V2OrganizationsRouter = class V2OrganizationsRouter extends AbstractRouter_1.AbstractRouter {
26
+ constructor(controller) {
27
+ super(RouteVersion_1.RouteVersion.v2, Links_1.ORGANIZATION_PATH);
28
+ this.controller = controller;
29
+ this.initRoutes();
30
+ }
31
+ initRoutes() {
32
+ this.router.get("/", [(0, express_validator_1.query)("full").optional().isBoolean().not().isArray()], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), (0, output_gateway_1.useCacheMiddleware)(), this.controller.getAll);
33
+ this.router.get("/:id", (0, express_validator_1.param)("id").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(), Validation_1.checkErrors, (0, output_gateway_1.useCacheMiddleware)(), this.controller.getOne);
34
+ }
35
+ };
36
+ exports.V2OrganizationsRouter = V2OrganizationsRouter = __decorate([
37
+ (0, tsyringe_1.injectable)(),
38
+ __param(0, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsController)),
39
+ __metadata("design:paramtypes", [V2OrganizationsController_1.V2OrganizationsController])
40
+ ], V2OrganizationsRouter);
41
+ //# sourceMappingURL=V2OrganizationsRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2OrganizationsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2OrganizationsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sFAAmF;AACnF,sEAAuE;AACvE,6EAAkH;AAClH,mFAA2E;AAC3E,8FAAyF;AACzF,+DAA0D;AAC1D,iEAAwE;AACxE,yEAAoE;AACpE,iDAAwD;AAGjD,IAAM,qBAAqB,mCAA3B,MAAM,qBAAsB,SAAQ,+BAAc;IACrD,YAA4E,UAAqC;QAC7G,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,yBAAiB,CAAC,CAAC;QAD8B,eAAU,GAAV,UAAU,CAA2B;QAG7G,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAES,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,GAAG,EACH,CAAC,IAAA,yBAAK,EAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,EACtD,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,IAAI,CAAC,IAAI,CAAC,EACpC,IAAA,mCAAkB,GAAE,EACpB,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,MAAM,EACN,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAC/E,wBAAW,EACX,IAAA,mCAAkB,GAAE,EACpB,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ,CAAA;gCA1BY,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,yBAAyB,CAAC,CAAA;qCAAqB,qDAAyB;GADxG,qBAAqB,CA0BjC"}
@@ -0,0 +1,14 @@
1
+ import { IFullTransformationSchemaItem } from "../models/interfaces/IFullTransformationSchemaItem";
2
+ import { IBuildingsPrimary } from "../models/interfaces/IPrimaryBuildings";
3
+ import { ISecondaryBuildingsOutput } from "../models/interfaces/ISecondaryBuildingsOutput";
4
+ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
5
+ export declare class BuildingTransformationFull extends AbstractTransformation<IBuildingsPrimary & {
6
+ secondary: ISecondaryBuildingsOutput;
7
+ }, IFullTransformationSchemaItem> {
8
+ name: string;
9
+ private createLinkHelper;
10
+ constructor();
11
+ protected transformInternal: (element: IBuildingsPrimary & {
12
+ secondary: ISecondaryBuildingsOutput;
13
+ }) => IFullTransformationSchemaItem;
14
+ }