@golemio/energetics 1.4.2 → 1.4.3-dev.1411262009
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.
- package/dist/integration-engine/commodity-providers/ioc/Di.js +1 -1
- package/dist/integration-engine/commodity-providers/ioc/Di.js.map +1 -1
- package/dist/output-gateway/routers/v2/V2BuildingsRouter.d.ts +1 -0
- package/dist/output-gateway/routers/v2/V2BuildingsRouter.js +3 -2
- package/dist/output-gateway/routers/v2/V2BuildingsRouter.js.map +1 -1
- package/dist/output-gateway/routers/v2/V2DevicesRouter.d.ts +4 -1
- package/dist/output-gateway/routers/v2/V2DevicesRouter.js +11 -7
- package/dist/output-gateway/routers/v2/V2DevicesRouter.js.map +1 -1
- package/dist/output-gateway/routers/v2/V2MeasurementsRouter.d.ts +4 -1
- package/dist/output-gateway/routers/v2/V2MeasurementsRouter.js +12 -8
- package/dist/output-gateway/routers/v2/V2MeasurementsRouter.js.map +1 -1
- package/dist/output-gateway/routers/v2/V2OrganizationsRouter.d.ts +4 -1
- package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js +11 -7
- package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js.map +1 -1
- package/docs/openapi-output.yaml +175 -127
- package/package.json +3 -3
|
@@ -14,6 +14,7 @@ const PpasAveApiDataSourceProvider_1 = require("../datasources/ppas-ave-api/Ppas
|
|
|
14
14
|
const PreElectroApiDataSourceProvider_1 = require("../datasources/pre-elektro-api/PreElectroApiDataSourceProvider");
|
|
15
15
|
const PreElectroHelper_1 = require("../datasources/pre-elektro-api/helpers/PreElectroHelper");
|
|
16
16
|
const AccessConfigurationDataSource_1 = require("../datasources/static-data/AccessConfigurationDataSource");
|
|
17
|
+
const StaticMeterSettingsDataSourceCapitalDs_1 = require("../datasources/static-data/StaticMeterSettingsDataSourceCapitalDs");
|
|
17
18
|
const StaticMeterSettingsRepository_1 = require("../repositories/StaticMeterSettingsRepository");
|
|
18
19
|
const AveMeasurementTransformation_1 = require("../transformations/AveMeasurementTransformation");
|
|
19
20
|
const PreElectroTransformation_1 = require("../transformations/PreElectroTransformation");
|
|
@@ -25,7 +26,6 @@ const FetchPpasMeasurementsTask_1 = require("../workers/tasks/FetchPpasMeasureme
|
|
|
25
26
|
const FetchPreMeasurementDataTask_1 = require("../workers/tasks/FetchPreMeasurementDataTask");
|
|
26
27
|
const FetchPtasWebScrapedMeasurementsTask_1 = require("../workers/tasks/FetchPtasWebScrapedMeasurementsTask");
|
|
27
28
|
const WorkerContainerToken_1 = require("./WorkerContainerToken");
|
|
28
|
-
const StaticMeterSettingsDataSourceCapitalDs_1 = require("../datasources/static-data/StaticMeterSettingsDataSourceCapitalDs");
|
|
29
29
|
//#region Initialization
|
|
30
30
|
const CommodityContainer = Di_1.VPalaceContainer.createChildContainer();
|
|
31
31
|
exports.CommodityContainer = CommodityContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/commodity-providers/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,0GAA4H;AAC5H,8FAAgH;AAChH,4HAA8I;AAC9I,iFAAmG;AACnG,kGAAoH;AACpH,kHAAoI;AACpI,8FAAgH;AAChH,qCAA8C;AAC9C,8GAAyG;AAEzG,2GAAwG;AACxG,oHAAiH;AACjH,8FAA2F;AAC3F,4GAAyG;AACzG,iGAA8F;AAC9F,kGAA+F;AAC/F,0FAAuF;AACvF,0GAAuG;AACvG,gHAA6G;AAC7G,4GAAyG;AACzG,8FAA2F;AAC3F,0FAAuF;AACvF,8FAA2F;AAC3F,8GAA2G;AAC3G,iEAA8D;
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/commodity-providers/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,0GAA4H;AAC5H,8FAAgH;AAChH,4HAA8I;AAC9I,iFAAmG;AACnG,kGAAoH;AACpH,kHAAoI;AACpI,8FAAgH;AAChH,qC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 -23,13 +23,14 @@ let V2BuildingsRouter = exports.V2BuildingsRouter = class V2BuildingsRouter exte
|
|
|
23
23
|
constructor() {
|
|
24
24
|
super(RouteVersion_1.RouteVersion.v2, Links_1.BUILDING_PATH);
|
|
25
25
|
this.maxAge = 6 * 60 * 60; // 6 hours
|
|
26
|
+
this.staleWhileRevalidate = 60; // 1 minute
|
|
26
27
|
this.controller = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.BuildingsController);
|
|
27
28
|
this.cacheHeaderMiddleware = Di_1.OGEnergeticsContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
28
29
|
this.initRoutes();
|
|
29
30
|
}
|
|
30
31
|
initRoutes() {
|
|
31
|
-
this.router.get("/", (0, express_validator_1.query)("full").optional().isBoolean(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.maxAge), this.controller.getAll);
|
|
32
|
-
this.router.get("/:id",
|
|
32
|
+
this.router.get("/", (0, express_validator_1.query)("full").optional().isBoolean(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getAll);
|
|
33
|
+
this.router.get("/:id", (0, express_validator_1.param)("id").exists().isNumeric().not().isArray(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getOne);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
exports.V2BuildingsRouter = V2BuildingsRouter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V2BuildingsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2BuildingsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAoD;AACpD,+DAA0D;AAE1D,qCAAmD;AACnD,yEAAoE;AACpE,sFAAm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G,CACX,MAAM,EACN,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAChD,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,MAAM,EAAE,EAC7B,wBAAW,EACX,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAChF,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ,CAAA;4BA/BY,iBAAiB;IAD7B,IAAA,qBAAU,GAAE;;GACA,iBAAiB,CA+B7B"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
|
|
2
1
|
import { V2DevicesController } from "../../controllers/v2/V2DevicesController";
|
|
2
|
+
import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
|
|
3
3
|
export declare class V2DevicesRouter extends AbstractRouter {
|
|
4
4
|
private controller;
|
|
5
|
+
private cacheHeaderMiddleware;
|
|
6
|
+
private maxAge;
|
|
7
|
+
private staleWhileRevalidate;
|
|
5
8
|
constructor(controller: V2DevicesController);
|
|
6
9
|
protected initRoutes(): void;
|
|
7
10
|
}
|
|
@@ -13,24 +13,28 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.V2DevicesRouter = void 0;
|
|
16
|
+
const Links_1 = require("../../constants/Links");
|
|
17
|
+
const RouteVersion_1 = require("../../constants/RouteVersion");
|
|
18
|
+
const V2DevicesController_1 = require("../../controllers/v2/V2DevicesController");
|
|
19
|
+
const Di_1 = require("../../ioc/Di");
|
|
20
|
+
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
16
21
|
const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
|
|
17
|
-
const
|
|
22
|
+
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
18
23
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
19
24
|
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
25
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
23
|
-
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
24
|
-
const Links_1 = require("../../constants/Links");
|
|
25
26
|
let V2DevicesRouter = exports.V2DevicesRouter = class V2DevicesRouter extends AbstractRouter_1.AbstractRouter {
|
|
26
27
|
constructor(controller) {
|
|
27
28
|
super(RouteVersion_1.RouteVersion.v2, Links_1.DEVICES_PATH);
|
|
28
29
|
this.controller = controller;
|
|
30
|
+
this.maxAge = 30 * 60; // 30 minutes
|
|
31
|
+
this.staleWhileRevalidate = 60; // 1 minute
|
|
32
|
+
this.cacheHeaderMiddleware = Di_1.OGEnergeticsContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
29
33
|
this.initRoutes();
|
|
30
34
|
}
|
|
31
35
|
initRoutes() {
|
|
32
|
-
this.router.get("/", (0, express_validator_1.query)("accessLimit").exists(), Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), (
|
|
33
|
-
this.router.get("/:id", (0, express_validator_1.param)("id").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, (
|
|
36
|
+
this.router.get("/", (0, express_validator_1.query)("accessLimit").exists(), Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getAll);
|
|
37
|
+
this.router.get("/:id", (0, express_validator_1.param)("id").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getOne);
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
exports.V2DevicesRouter = V2DevicesRouter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V2DevicesRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2DevicesRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"V2DevicesRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2DevicesRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAmD;AACnD,+DAA0D;AAC1D,kFAA6E;AAC7E,qCAAmD;AACnD,yEAAoE;AACpE,sFAAmF;AAEnF,+DAAuE;AACvE,6EAAkH;AAClH,mFAA2E;AAC3E,iEAAwE;AAEjE,IAAM,eAAe,6BAArB,MAAM,eAAgB,SAAQ,+BAAc;IAK/C,YAA8D,UAAuC;QACjG,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,oBAAY,CAAC,CAAC;QAD6B,eAAU,GAAV,UAAU,CAAqB;QAH7F,WAAM,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa;QAC/B,yBAAoB,GAAG,EAAE,CAAC,CAAC,WAAW;QAK1C,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,CACX,GAAG,EACH,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,MAAM,EAAE,EAC7B,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,IAAI,CAAC,IAAI,CAAC,EACpC,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAChF,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,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,MAAM,EAAE,EAC7B,wBAAW,EACX,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAChF,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ,CAAA;0BAhCY,eAAe;IAD3B,IAAA,qBAAU,GAAE;IAMI,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,mBAAmB,CAAC,CAAA;qCAAqB,yCAAmB;GAL5F,eAAe,CAgC3B"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
|
|
2
1
|
import { V2MeasurementsController } from "../../controllers/v2/V2MeasurementsController";
|
|
2
|
+
import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
|
|
3
3
|
export declare class V2MeasurementsRouter extends AbstractRouter {
|
|
4
4
|
private controller;
|
|
5
|
+
private cacheHeaderMiddleware;
|
|
6
|
+
private maxAge;
|
|
7
|
+
private staleWhileRevalidate;
|
|
5
8
|
constructor(controller: V2MeasurementsController);
|
|
6
9
|
protected initRoutes(): void;
|
|
7
10
|
}
|
|
@@ -13,20 +13,24 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.V2MeasurementsRouter = void 0;
|
|
16
|
+
const Links_1 = require("../../constants/Links");
|
|
17
|
+
const RouteVersion_1 = require("../../constants/RouteVersion");
|
|
18
|
+
const V2MeasurementsController_1 = require("../../controllers/v2/V2MeasurementsController");
|
|
19
|
+
const Di_1 = require("../../ioc/Di");
|
|
20
|
+
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
21
|
+
const MeasurementConstants_1 = require("../../../schema-definitions/models/constants/MeasurementConstants");
|
|
16
22
|
const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
|
|
17
|
-
const
|
|
23
|
+
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
18
24
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
19
25
|
const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
|
|
20
|
-
const V2MeasurementsController_1 = require("../../controllers/v2/V2MeasurementsController");
|
|
21
|
-
const RouteVersion_1 = require("../../constants/RouteVersion");
|
|
22
26
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
23
|
-
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
24
|
-
const Links_1 = require("../../constants/Links");
|
|
25
|
-
const MeasurementConstants_1 = require("../../../schema-definitions/models/constants/MeasurementConstants");
|
|
26
27
|
let V2MeasurementsRouter = exports.V2MeasurementsRouter = class V2MeasurementsRouter extends AbstractRouter_1.AbstractRouter {
|
|
27
28
|
constructor(controller) {
|
|
28
29
|
super(RouteVersion_1.RouteVersion.v2, Links_1.MEASUREMENTS_PATH);
|
|
29
30
|
this.controller = controller;
|
|
31
|
+
this.maxAge = 30 * 60; // 30 minutes
|
|
32
|
+
this.staleWhileRevalidate = 60; // 1 minute
|
|
33
|
+
this.cacheHeaderMiddleware = Di_1.OGEnergeticsContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
30
34
|
this.initRoutes();
|
|
31
35
|
}
|
|
32
36
|
initRoutes() {
|
|
@@ -51,7 +55,7 @@ let V2MeasurementsRouter = exports.V2MeasurementsRouter = class V2MeasurementsRo
|
|
|
51
55
|
(0, express_validator_1.query)("dateFrom").optional().isISO8601().not().isArray(),
|
|
52
56
|
(0, express_validator_1.query)("dateTo").optional().isISO8601().not().isArray(),
|
|
53
57
|
(0, express_validator_1.query)("accessLimit").exists(),
|
|
54
|
-
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), (
|
|
58
|
+
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getMeasurements);
|
|
55
59
|
this.router.get("/monthly-reading", [
|
|
56
60
|
(0, express_validator_1.query)("addr1").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
57
61
|
(0, express_validator_1.query)("addr2").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
@@ -59,7 +63,7 @@ let V2MeasurementsRouter = exports.V2MeasurementsRouter = class V2MeasurementsRo
|
|
|
59
63
|
(0, express_validator_1.query)("year").exists().isInt().not().isArray(),
|
|
60
64
|
(0, express_validator_1.query)("month").exists().isInt({ min: 1, max: 12 }).not().isArray(),
|
|
61
65
|
(0, express_validator_1.query)("accessLimit").exists(),
|
|
62
|
-
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), (
|
|
66
|
+
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getMonthlyReadings);
|
|
63
67
|
}
|
|
64
68
|
};
|
|
65
69
|
exports.V2MeasurementsRouter = V2MeasurementsRouter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V2MeasurementsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2MeasurementsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"V2MeasurementsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2MeasurementsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAwD;AACxD,+DAA0D;AAC1D,4FAAuF;AACvF,qCAAmD;AACnD,yEAAoE;AACpE,4GAAsG;AACtG,sFAAmF;AAEnF,+DAAuE;AACvE,6EAAkH;AAClH,mFAA2E;AAC3E,iEAAwE;AAGjE,IAAM,oBAAoB,kCAA1B,MAAM,oBAAqB,SAAQ,+BAAc;IAKpD,YAAmE,UAA4C;QAC3G,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,yBAAiB,CAAC,CAAC;QAD6B,eAAU,GAAV,UAAU,CAA0B;QAHvG,WAAM,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa;QAC/B,yBAAoB,GAAG,EAAE,CAAC,CAAC,WAAW;QAK1C,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,CACX,GAAG,EACH;YACI,IAAA,yBAAK,EAAC,UAAU,CAAC;iBACZ,QAAQ,EAAE;iBACV,GAAG,EAAE;iBACL,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;iBACpC,GAAG,EAAE;iBACL,OAAO,EAAE;iBACT,IAAI,CAAC,4CAAqB,CAAC;YAChC,IAAA,yBAAK,EAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI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A,iBAAM,EAAC,2CAAoB,CAAC,wBAAwB,CAAC,CAAA;qCAAqB,mDAAwB;GALtG,oBAAoB,CA6DhC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
|
|
2
1
|
import { V2OrganizationsController } from "../../controllers/v2/V2OrganizationsController";
|
|
2
|
+
import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
|
|
3
3
|
export declare class V2OrganizationsRouter extends AbstractRouter {
|
|
4
4
|
private controller;
|
|
5
|
+
private cacheHeaderMiddleware;
|
|
6
|
+
private maxAge;
|
|
7
|
+
private staleWhileRevalidate;
|
|
5
8
|
constructor(controller: V2OrganizationsController);
|
|
6
9
|
protected initRoutes(): void;
|
|
7
10
|
}
|
|
@@ -13,24 +13,28 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.V2OrganizationsRouter = void 0;
|
|
16
|
+
const Links_1 = require("../../constants/Links");
|
|
17
|
+
const RouteVersion_1 = require("../../constants/RouteVersion");
|
|
18
|
+
const V2OrganizationsController_1 = require("../../controllers/v2/V2OrganizationsController");
|
|
19
|
+
const Di_1 = require("../../ioc/Di");
|
|
20
|
+
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
16
21
|
const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
|
|
17
|
-
const
|
|
22
|
+
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
18
23
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
19
24
|
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
25
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
23
|
-
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
24
|
-
const Links_1 = require("../../constants/Links");
|
|
25
26
|
let V2OrganizationsRouter = exports.V2OrganizationsRouter = class V2OrganizationsRouter extends AbstractRouter_1.AbstractRouter {
|
|
26
27
|
constructor(controller) {
|
|
27
28
|
super(RouteVersion_1.RouteVersion.v2, Links_1.ORGANIZATION_PATH);
|
|
28
29
|
this.controller = controller;
|
|
30
|
+
this.maxAge = 30 * 60; // 30 minutes
|
|
31
|
+
this.staleWhileRevalidate = 60; // 1 minute
|
|
32
|
+
this.cacheHeaderMiddleware = Di_1.OGEnergeticsContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
29
33
|
this.initRoutes();
|
|
30
34
|
}
|
|
31
35
|
initRoutes() {
|
|
32
|
-
this.router.get("/", [(0, express_validator_1.query)("full").optional().isBoolean().not().isArray()], (0, express_validator_1.query)("accessLimit").exists(), Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), (
|
|
33
|
-
this.router.get("/:id", (0, express_validator_1.param)("id").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, (
|
|
36
|
+
this.router.get("/", [(0, express_validator_1.query)("full").optional().isBoolean().not().isArray()], (0, express_validator_1.query)("accessLimit").exists(), Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(this.path), this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getAll);
|
|
37
|
+
this.router.get("/:id", (0, express_validator_1.param)("id").exists().not().isEmpty({ ignore_whitespace: true }).not().isArray(), (0, express_validator_1.query)("accessLimit").exists(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getOne);
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
exports.V2OrganizationsRouter = V2OrganizationsRouter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V2OrganizationsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2OrganizationsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"V2OrganizationsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2OrganizationsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAwD;AACxD,+DAA0D;AAC1D,8FAAyF;AACzF,qCAAmD;AACnD,yEAAoE;AACpE,sFAAmF;AAEnF,+DAAuE;AACvE,6EAAkH;AAClH,mFAA2E;AAC3E,iEAAwE;AAGjE,IAAM,qBAAqB,mCAA3B,MAAM,qBAAsB,SAAQ,+BAAc;IAKrD,YAAoE,UAA6C;QAC7G,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,yBAAiB,CAAC,CAAC;QAD8B,eAAU,GAAV,UAAU,CAA2B;QAHzG,WAAM,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa;QAC/B,yBAAoB,GAAG,EAAE,CAAC,CAAC,WAAW;QAK1C,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,CACX,GAAG,EACH,CAAC,IAAA,yBAAK,EAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,EACtD,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,MAAM,EAAE,EAC7B,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,IAAI,CAAC,IAAI,CAAC,EACpC,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAChF,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,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,MAAM,EAAE,EAC7B,wBAAW,EACX,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAChF,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ,CAAA;gCAjCY,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAMI,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,yBAAyB,CAAC,CAAA;qCAAqB,qDAAyB;GALxG,qBAAqB,CAiCjC"}
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -34,6 +34,12 @@ paths:
|
|
|
34
34
|
responses:
|
|
35
35
|
"200":
|
|
36
36
|
description: OK
|
|
37
|
+
headers:
|
|
38
|
+
Cache-Control:
|
|
39
|
+
description: Cache control directive for caching proxies
|
|
40
|
+
schema:
|
|
41
|
+
type: string
|
|
42
|
+
example: public, s-maxage=21600, stale-while-revalidate=60
|
|
37
43
|
content:
|
|
38
44
|
application/json:
|
|
39
45
|
schema:
|
|
@@ -56,6 +62,12 @@ paths:
|
|
|
56
62
|
responses:
|
|
57
63
|
"200":
|
|
58
64
|
description: OK
|
|
65
|
+
headers:
|
|
66
|
+
Cache-Control:
|
|
67
|
+
description: Cache control directive for caching proxies
|
|
68
|
+
schema:
|
|
69
|
+
type: string
|
|
70
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
59
71
|
content:
|
|
60
72
|
application/json:
|
|
61
73
|
schema:
|
|
@@ -69,6 +81,12 @@ paths:
|
|
|
69
81
|
responses:
|
|
70
82
|
"200":
|
|
71
83
|
description: Success
|
|
84
|
+
headers:
|
|
85
|
+
Cache-Control:
|
|
86
|
+
description: Cache control directive for caching proxies
|
|
87
|
+
schema:
|
|
88
|
+
type: string
|
|
89
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
72
90
|
content:
|
|
73
91
|
application/json:
|
|
74
92
|
schema:
|
|
@@ -97,6 +115,12 @@ paths:
|
|
|
97
115
|
responses:
|
|
98
116
|
"200":
|
|
99
117
|
description: Success
|
|
118
|
+
headers:
|
|
119
|
+
Cache-Control:
|
|
120
|
+
description: Cache control directive for caching proxies
|
|
121
|
+
schema:
|
|
122
|
+
type: string
|
|
123
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
100
124
|
content:
|
|
101
125
|
application/json:
|
|
102
126
|
schema:
|
|
@@ -125,6 +149,12 @@ paths:
|
|
|
125
149
|
responses:
|
|
126
150
|
"200":
|
|
127
151
|
description: Success
|
|
152
|
+
headers:
|
|
153
|
+
Cache-Control:
|
|
154
|
+
description: Cache control directive for caching proxies
|
|
155
|
+
schema:
|
|
156
|
+
type: string
|
|
157
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
128
158
|
content:
|
|
129
159
|
application/json:
|
|
130
160
|
schema:
|
|
@@ -157,6 +187,12 @@ paths:
|
|
|
157
187
|
responses:
|
|
158
188
|
"200":
|
|
159
189
|
description: Success
|
|
190
|
+
headers:
|
|
191
|
+
Cache-Control:
|
|
192
|
+
description: Cache control directive for caching proxies
|
|
193
|
+
schema:
|
|
194
|
+
type: string
|
|
195
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
160
196
|
content:
|
|
161
197
|
application/json:
|
|
162
198
|
schema:
|
|
@@ -176,86 +212,92 @@ paths:
|
|
|
176
212
|
- ⚡ Energetics (v2)
|
|
177
213
|
summary: Measurements
|
|
178
214
|
parameters:
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
215
|
+
- name: variable
|
|
216
|
+
in: query
|
|
217
|
+
required: false
|
|
218
|
+
schema:
|
|
219
|
+
$ref: "#/components/schemas/EnergeticsVariables"
|
|
220
|
+
description: >-
|
|
221
|
+
core - Kumulovaný objem [m3]<br />
|
|
222
|
+
core2 - Kumulovaný přepočítaný objem [Nm3]<br />
|
|
223
|
+
EFwActi - Odběr činné energie [kWh]<br />
|
|
224
|
+
EFwActiVT - Odběr činné energie, vysoký tarif [kVArh]<br />
|
|
225
|
+
ERvReact - Dodávka jalové energie [kVArh]<br />
|
|
226
|
+
EFwReact - Odběr jalové energie [kVArh]<br />
|
|
227
|
+
raw - Číselník impulzů [imp]<br />
|
|
228
|
+
RSSI - Síla signálu [dBm]<br />
|
|
229
|
+
T - Teplota [°C]<br />
|
|
230
|
+
CO2 - Koncentrace CO2 [ppm]<br />
|
|
231
|
+
RH - Relativní vlhkost [%]<br />
|
|
232
|
+
EFwActiNT - Odběr činné energie, nízký tarif [kVArh]<br />
|
|
233
|
+
VOC - Míra koncentrace těkavých látek [%]<br />
|
|
234
|
+
VT - Vysoký tarif [kWh]<br />
|
|
235
|
+
NT - Nízký tarif [kWh]<br />
|
|
236
|
+
- name: type
|
|
237
|
+
in: query
|
|
238
|
+
required: false
|
|
239
|
+
schema:
|
|
240
|
+
$ref: "#/components/schemas/EnergeticsTypes"
|
|
241
|
+
description: >-
|
|
242
|
+
monthly_reading - hodnoty sčítané po měsících z 15 minutových spotřeb poskytovaných firmou PRE<br />
|
|
243
|
+
provider_value - data získaná od poskytovatelů energií<br />
|
|
244
|
+
dotcontrols_value - data získaná ze systémů VisApp firmy DotControls<br />
|
|
245
|
+
- name: addr1
|
|
246
|
+
in: query
|
|
247
|
+
required: false
|
|
248
|
+
schema:
|
|
249
|
+
type: string
|
|
250
|
+
example: "2.9"
|
|
251
|
+
- name: addr2
|
|
252
|
+
in: query
|
|
253
|
+
required: false
|
|
254
|
+
schema:
|
|
255
|
+
type: string
|
|
256
|
+
example: "PF1"
|
|
257
|
+
- name: dateFrom
|
|
258
|
+
in: query
|
|
259
|
+
schema:
|
|
260
|
+
type: string
|
|
261
|
+
format: date-time
|
|
262
|
+
example: 2023-05-01T00:00:00.000Z
|
|
263
|
+
- name: dateTo
|
|
264
|
+
in: query
|
|
265
|
+
schema:
|
|
266
|
+
type: string
|
|
267
|
+
format: date-time
|
|
268
|
+
example: 2023-05-02T00:00:00.000Z
|
|
269
|
+
- name: limit
|
|
270
|
+
in: query
|
|
271
|
+
description: Limits number of retrieved items.
|
|
272
|
+
schema:
|
|
273
|
+
type: integer
|
|
274
|
+
example: 10000
|
|
275
|
+
- name: offset
|
|
276
|
+
in: query
|
|
277
|
+
description: Number of the first items that are skipped.
|
|
278
|
+
schema:
|
|
279
|
+
type: integer
|
|
280
|
+
example: 0
|
|
245
281
|
responses:
|
|
246
|
-
|
|
282
|
+
"200":
|
|
247
283
|
description: Success
|
|
284
|
+
headers:
|
|
285
|
+
Cache-Control:
|
|
286
|
+
description: Cache control directive for caching proxies
|
|
287
|
+
schema:
|
|
288
|
+
type: string
|
|
289
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
248
290
|
content:
|
|
249
291
|
application/json:
|
|
250
292
|
schema:
|
|
251
293
|
type: array
|
|
252
294
|
items:
|
|
253
|
-
$ref:
|
|
254
|
-
|
|
295
|
+
$ref: "#/components/schemas/EnergeticsMeasurement"
|
|
296
|
+
"400":
|
|
255
297
|
$ref: "#/components/responses/BadRequestError"
|
|
256
|
-
|
|
298
|
+
"401":
|
|
257
299
|
$ref: "#/components/responses/UnauthorizedError"
|
|
258
|
-
|
|
300
|
+
"500":
|
|
259
301
|
$ref: "#/components/responses/ServerError"
|
|
260
302
|
|
|
261
303
|
/v2/energetics/measurements/monthly-reading:
|
|
@@ -264,71 +306,77 @@ paths:
|
|
|
264
306
|
- ⚡ Energetics (v2)
|
|
265
307
|
summary: Monthly sums of measurements from devices
|
|
266
308
|
parameters:
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
309
|
+
- name: addr1
|
|
310
|
+
in: query
|
|
311
|
+
description: First part of device address
|
|
312
|
+
required: true
|
|
313
|
+
schema:
|
|
314
|
+
type: string
|
|
315
|
+
example: "2.9"
|
|
316
|
+
- name: addr2
|
|
317
|
+
in: query
|
|
318
|
+
description: Second part of device address
|
|
319
|
+
required: true
|
|
320
|
+
schema:
|
|
321
|
+
type: string
|
|
322
|
+
example: "PF1"
|
|
323
|
+
- name: variable
|
|
324
|
+
in: query
|
|
325
|
+
required: true
|
|
326
|
+
schema:
|
|
327
|
+
$ref: "#/components/schemas/EnergeticsVariables"
|
|
328
|
+
description: >-
|
|
329
|
+
core - Kumulovaný objem [m3]<br />
|
|
330
|
+
core2 - Kumulovaný přepočítaný objem [Nm3]<br />
|
|
331
|
+
EFwActi - Odběr činné energie [kWh]<br />
|
|
332
|
+
EFwActiVT - Odběr činné energie, vysoký tarif [kVArh]<br />
|
|
333
|
+
ERvReact - Dodávka jalové energie [kVArh]<br />
|
|
334
|
+
EFwReact - Odběr jalové energie [kVArh]<br />
|
|
335
|
+
raw - Číselník impulzů [imp]<br />
|
|
336
|
+
RSSI - Síla signálu [dBm]<br />
|
|
337
|
+
T - Teplota [°C]<br />
|
|
338
|
+
CO2 - Koncentrace CO2 [ppm]<br />
|
|
339
|
+
RH - Relativní vlhkost [%]<br />
|
|
340
|
+
EFwActiNT - Odběr činné energie, nízký tarif [kVArh]<br />
|
|
341
|
+
VOC - Míra koncentrace těkavých látek [%]<br />
|
|
342
|
+
VT - Vysoký tarif [kWh]<br />
|
|
343
|
+
NT - Nízký tarif [kWh]<br />
|
|
344
|
+
- name: year
|
|
345
|
+
in: query
|
|
346
|
+
description: Year of measurement
|
|
347
|
+
required: true
|
|
348
|
+
schema:
|
|
349
|
+
type: integer
|
|
350
|
+
format: int32
|
|
351
|
+
example: 2023
|
|
352
|
+
- name: month
|
|
353
|
+
in: query
|
|
354
|
+
description: Month of measurement
|
|
355
|
+
required: true
|
|
356
|
+
schema:
|
|
357
|
+
type: integer
|
|
358
|
+
format: int32
|
|
359
|
+
example: 5
|
|
318
360
|
responses:
|
|
319
|
-
|
|
361
|
+
"200":
|
|
320
362
|
description: Success
|
|
363
|
+
headers:
|
|
364
|
+
Cache-Control:
|
|
365
|
+
description: Cache control directive for caching proxies
|
|
366
|
+
schema:
|
|
367
|
+
type: string
|
|
368
|
+
example: public, s-maxage=1800, stale-while-revalidate=60
|
|
321
369
|
content:
|
|
322
370
|
application/json:
|
|
323
371
|
schema:
|
|
324
372
|
type: array
|
|
325
373
|
items:
|
|
326
|
-
$ref:
|
|
327
|
-
|
|
374
|
+
$ref: "#/components/schemas/EnergeticsMeasurement"
|
|
375
|
+
"400":
|
|
328
376
|
$ref: "#/components/responses/BadRequestError"
|
|
329
|
-
|
|
377
|
+
"401":
|
|
330
378
|
$ref: "#/components/responses/UnauthorizedError"
|
|
331
|
-
|
|
379
|
+
"500":
|
|
332
380
|
$ref: "#/components/responses/ServerError"
|
|
333
381
|
|
|
334
382
|
components:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/energetics",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3-dev.1411262009",
|
|
4
4
|
"description": "Golemio Energetics Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@commitlint/cli": "^11.0.0",
|
|
37
37
|
"@commitlint/config-conventional": "^11.0.0",
|
|
38
38
|
"@golemio/cli": "1.5.0",
|
|
39
|
-
"@golemio/core": "1.12.
|
|
39
|
+
"@golemio/core": "1.12.3-dev.1387916806",
|
|
40
40
|
"@golemio/db-common": "1.1.4",
|
|
41
41
|
"@golemio/eslint-config": "1.1.2",
|
|
42
42
|
"@types/chai": "4.2.3",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"typescript-transform-paths": "^3.4.6"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@golemio/core": "
|
|
72
|
+
"@golemio/core": "1.12.3-dev.1387916806"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"basic-ftp": "^5.0.2",
|