@golemio/microclimate 1.0.1-dev.675426205
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/LICENSE +11 -0
- package/README.md +46 -0
- package/db/example/.config.json +3 -0
- package/db/example/00_truncate_tables.sql +2 -0
- package/db/example/01_microclimate.sql +2 -0
- package/db/migrations/postgresql/.config.json +3 -0
- package/db/migrations/postgresql/20221018165642-init-mongo-to-pg.js +51 -0
- package/db/migrations/postgresql/package.json +3 -0
- package/db/migrations/postgresql/sqls/20221018165642-init-mongo-to-pg-down.sql +2 -0
- package/db/migrations/postgresql/sqls/20221018165642-init-mongo-to-pg-up.sql +48 -0
- package/db/migrations/postgresql/sqls/package.json +3 -0
- package/dist/integration-engine/datasources/MeasurementsDataSourceFactory.d.ts +5 -0
- package/dist/integration-engine/datasources/MeasurementsDataSourceFactory.js +23 -0
- package/dist/integration-engine/datasources/MeasurementsDataSourceFactory.js.map +1 -0
- package/dist/integration-engine/datasources/SensorDevicesDataSourceFactory.d.ts +4 -0
- package/dist/integration-engine/datasources/SensorDevicesDataSourceFactory.js +18 -0
- package/dist/integration-engine/datasources/SensorDevicesDataSourceFactory.js.map +1 -0
- package/dist/integration-engine/index.d.ts +1 -0
- package/dist/integration-engine/index.js +7 -0
- package/dist/integration-engine/index.js.map +1 -0
- package/dist/integration-engine/repositories/MeasurementsRepository.d.ts +6 -0
- package/dist/integration-engine/repositories/MeasurementsRepository.js +39 -0
- package/dist/integration-engine/repositories/MeasurementsRepository.js.map +1 -0
- package/dist/integration-engine/repositories/SensorDevicesRepository.d.ts +6 -0
- package/dist/integration-engine/repositories/SensorDevicesRepository.js +39 -0
- package/dist/integration-engine/repositories/SensorDevicesRepository.js.map +1 -0
- package/dist/integration-engine/repositories/index.d.ts +2 -0
- package/dist/integration-engine/repositories/index.js +20 -0
- package/dist/integration-engine/repositories/index.js.map +1 -0
- package/dist/integration-engine/schema/RefreshMeasurementsByIdTaskSchema.d.ts +4 -0
- package/dist/integration-engine/schema/RefreshMeasurementsByIdTaskSchema.js +21 -0
- package/dist/integration-engine/schema/RefreshMeasurementsByIdTaskSchema.js.map +1 -0
- package/dist/integration-engine/transformations/MeasurementsTransformation.d.ts +8 -0
- package/dist/integration-engine/transformations/MeasurementsTransformation.js +48 -0
- package/dist/integration-engine/transformations/MeasurementsTransformation.js.map +1 -0
- package/dist/integration-engine/transformations/SensorDevicesTransformation.d.ts +9 -0
- package/dist/integration-engine/transformations/SensorDevicesTransformation.js +41 -0
- package/dist/integration-engine/transformations/SensorDevicesTransformation.js.map +1 -0
- package/dist/integration-engine/workers/MicroclimateWorker.d.ts +5 -0
- package/dist/integration-engine/workers/MicroclimateWorker.js +16 -0
- package/dist/integration-engine/workers/MicroclimateWorker.js.map +1 -0
- package/dist/integration-engine/workers/index.d.ts +2 -0
- package/dist/integration-engine/workers/index.js +6 -0
- package/dist/integration-engine/workers/index.js.map +1 -0
- package/dist/integration-engine/workers/tasks/RefreshMeasurementsByIdTask.d.ts +11 -0
- package/dist/integration-engine/workers/tasks/RefreshMeasurementsByIdTask.js +36 -0
- package/dist/integration-engine/workers/tasks/RefreshMeasurementsByIdTask.js.map +1 -0
- package/dist/integration-engine/workers/tasks/RefreshMeasurementsTask.d.ts +11 -0
- package/dist/integration-engine/workers/tasks/RefreshMeasurementsTask.js +39 -0
- package/dist/integration-engine/workers/tasks/RefreshMeasurementsTask.js.map +1 -0
- package/dist/integration-engine/workers/tasks/RefreshSensorDevicesTask.d.ts +10 -0
- package/dist/integration-engine/workers/tasks/RefreshSensorDevicesTask.js +35 -0
- package/dist/integration-engine/workers/tasks/RefreshSensorDevicesTask.js.map +1 -0
- package/dist/integration-engine/workers/tasks/index.d.ts +3 -0
- package/dist/integration-engine/workers/tasks/index.js +20 -0
- package/dist/integration-engine/workers/tasks/index.js.map +1 -0
- package/dist/schema-definitions/Measurements.d.ts +24 -0
- package/dist/schema-definitions/Measurements.js +8 -0
- package/dist/schema-definitions/Measurements.js.map +1 -0
- package/dist/schema-definitions/SensorDevices.d.ts +10 -0
- package/dist/schema-definitions/SensorDevices.js +8 -0
- package/dist/schema-definitions/SensorDevices.js.map +1 -0
- package/dist/schema-definitions/datasources/MeasurementsJsonSchema.d.ts +29 -0
- package/dist/schema-definitions/datasources/MeasurementsJsonSchema.js +38 -0
- package/dist/schema-definitions/datasources/MeasurementsJsonSchema.js.map +1 -0
- package/dist/schema-definitions/datasources/SensorDevicesJsonSchema.d.ts +14 -0
- package/dist/schema-definitions/datasources/SensorDevicesJsonSchema.js +27 -0
- package/dist/schema-definitions/datasources/SensorDevicesJsonSchema.js.map +1 -0
- package/dist/schema-definitions/index.d.ts +2 -0
- package/dist/schema-definitions/index.js +21 -0
- package/dist/schema-definitions/index.js.map +1 -0
- package/dist/schema-definitions/models/MeasurementsModel.d.ts +22 -0
- package/dist/schema-definitions/models/MeasurementsModel.js +49 -0
- package/dist/schema-definitions/models/MeasurementsModel.js.map +1 -0
- package/dist/schema-definitions/models/SensorDevicesModel.d.ts +11 -0
- package/dist/schema-definitions/models/SensorDevicesModel.js +27 -0
- package/dist/schema-definitions/models/SensorDevicesModel.js.map +1 -0
- package/docs/assets/microclimate_erd.png +0 -0
- package/docs/implementation_documentation.md +282 -0
- package/package.json +69 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RefreshMeasurementsByIdTask = void 0;
|
|
13
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
14
|
+
const RefreshMeasurementsByIdTaskSchema_1 = require("../../schema/RefreshMeasurementsByIdTaskSchema");
|
|
15
|
+
const MeasurementsDataSourceFactory_1 = require("../../datasources/MeasurementsDataSourceFactory");
|
|
16
|
+
const MeasurementsTransformation_1 = require("../../transformations/MeasurementsTransformation");
|
|
17
|
+
const repositories_1 = require("../../repositories");
|
|
18
|
+
class RefreshMeasurementsByIdTask extends integration_engine_1.AbstractTask {
|
|
19
|
+
constructor(queuePrefix) {
|
|
20
|
+
super(queuePrefix);
|
|
21
|
+
this.queueName = "refreshMeasurementsById";
|
|
22
|
+
this.schema = RefreshMeasurementsByIdTaskSchema_1.RefreshMeasurementsByIdTaskSchema;
|
|
23
|
+
this.transformation = new MeasurementsTransformation_1.MeasurementsTransformation();
|
|
24
|
+
this.repository = new repositories_1.MeasurementsRepository();
|
|
25
|
+
}
|
|
26
|
+
execute(msg) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const dataSource = MeasurementsDataSourceFactory_1.MeasurementsDataSourceFactory.getDataSource(msg);
|
|
29
|
+
const data = yield dataSource.getAll();
|
|
30
|
+
const transformedData = yield this.transformation.transform(data, msg.sensorAddr);
|
|
31
|
+
yield this.repository.saveBulk(transformedData);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.RefreshMeasurementsByIdTask = RefreshMeasurementsByIdTask;
|
|
36
|
+
//# sourceMappingURL=RefreshMeasurementsByIdTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshMeasurementsByIdTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/RefreshMeasurementsByIdTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAAqE;AAErE,sGAAiG;AACjG,mGAA8F;AAC9F,iGAA4F;AAC5F,qDAA0D;AAE1D,MAAa,2BAA4B,SAAQ,iCAA0C;IAMvF,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QANP,cAAS,GAAG,yBAAyB,CAAC;QACtC,WAAM,GAAG,qEAAiC,CAAC;QAMvD,IAAI,CAAC,cAAc,GAAG,IAAI,uDAA0B,EAAE,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAsB,EAAE,CAAC;IACnD,CAAC;IAEe,OAAO,CAAC,GAAiC;;YACrD,MAAM,UAAU,GAAG,6DAA6B,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACpE,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;YACvC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;YAClF,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACpD,CAAC;KAAA;CACJ;AAlBD,kEAkBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
export interface ISensorIdObject {
|
|
3
|
+
sensor_id: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class RefreshMeasurementsTask extends AbstractEmptyTask {
|
|
6
|
+
readonly queueName = "refreshMeasurements";
|
|
7
|
+
readonly queueTtl: number;
|
|
8
|
+
private repository;
|
|
9
|
+
constructor(queuePrefix: string);
|
|
10
|
+
protected execute(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RefreshMeasurementsTask = void 0;
|
|
13
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
14
|
+
const repositories_1 = require("../../repositories");
|
|
15
|
+
class RefreshMeasurementsTask extends integration_engine_1.AbstractEmptyTask {
|
|
16
|
+
constructor(queuePrefix) {
|
|
17
|
+
super(queuePrefix);
|
|
18
|
+
this.queueName = "refreshMeasurements";
|
|
19
|
+
this.queueTtl = 23 * 60 * 60 * 1000; // 23 hours
|
|
20
|
+
this.repository = new repositories_1.SensorDevicesRepository();
|
|
21
|
+
}
|
|
22
|
+
execute() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const sensorDevicesFromDB = yield this.repository.find({
|
|
25
|
+
attributes: ["sensor_id"],
|
|
26
|
+
raw: true,
|
|
27
|
+
});
|
|
28
|
+
const promises = sensorDevicesFromDB.map((sensorIdObject) => {
|
|
29
|
+
const msg = {
|
|
30
|
+
sensorAddr: sensorIdObject.sensor_id,
|
|
31
|
+
};
|
|
32
|
+
return integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshMeasurementsById", msg);
|
|
33
|
+
});
|
|
34
|
+
yield Promise.all(promises);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.RefreshMeasurementsTask = RefreshMeasurementsTask;
|
|
39
|
+
//# sourceMappingURL=RefreshMeasurementsTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshMeasurementsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/RefreshMeasurementsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAAwF;AACxF,qDAA2D;AAO3D,MAAa,uBAAwB,SAAQ,sCAAiB;IAM1D,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QANP,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;QAMvD,IAAI,CAAC,UAAU,GAAG,IAAI,sCAAuB,EAAE,CAAC;IACpD,CAAC;IAEe,OAAO;;YACnB,MAAM,mBAAmB,GAAsB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBACtE,UAAU,EAAE,CAAC,WAAW,CAAC;gBACzB,GAAG,EAAE,IAAI;aACZ,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;gBACxD,MAAM,GAAG,GAAiC;oBACtC,UAAU,EAAE,cAAc,CAAC,SAAS;iBACvC,CAAC;gBAEF,OAAO,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,yBAAyB,EAAE,GAAG,CAAC,CAAC;YAChG,CAAC,CAAC,CAAC;YACH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;KAAA;CACJ;AA1BD,0DA0BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
export declare class RefreshSensorDevicesTask extends AbstractEmptyTask {
|
|
3
|
+
readonly queueName = "refreshSensorDevices";
|
|
4
|
+
readonly queueTtl: number;
|
|
5
|
+
private dataSource;
|
|
6
|
+
private transformation;
|
|
7
|
+
private repository;
|
|
8
|
+
constructor(queuePrefix: string);
|
|
9
|
+
protected execute(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RefreshSensorDevicesTask = void 0;
|
|
13
|
+
const SensorDevicesTransformation_1 = require("../../transformations/SensorDevicesTransformation");
|
|
14
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
15
|
+
const SensorDevicesDataSourceFactory_1 = require("../../datasources/SensorDevicesDataSourceFactory");
|
|
16
|
+
const repositories_1 = require("../../repositories");
|
|
17
|
+
class RefreshSensorDevicesTask extends integration_engine_1.AbstractEmptyTask {
|
|
18
|
+
constructor(queuePrefix) {
|
|
19
|
+
super(queuePrefix);
|
|
20
|
+
this.queueName = "refreshSensorDevices";
|
|
21
|
+
this.queueTtl = 23 * 60 * 60 * 1000; // 23 hours
|
|
22
|
+
this.dataSource = SensorDevicesDataSourceFactory_1.SensorDevicesDataSourceFactory.getDataSource();
|
|
23
|
+
this.transformation = new SensorDevicesTransformation_1.SensorDevicesTransformation();
|
|
24
|
+
this.repository = new repositories_1.SensorDevicesRepository();
|
|
25
|
+
}
|
|
26
|
+
execute() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const data = yield this.dataSource.getAll();
|
|
29
|
+
const transformedData = yield this.transformation.transform(data);
|
|
30
|
+
yield this.repository.saveBulk(transformedData);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.RefreshSensorDevicesTask = RefreshSensorDevicesTask;
|
|
35
|
+
//# sourceMappingURL=RefreshSensorDevicesTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshSensorDevicesTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/RefreshSensorDevicesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mGAA8F;AAC9F,8EAA0E;AAE1E,qGAAgG;AAChG,qDAA2D;AAE3D,MAAa,wBAAyB,SAAQ,sCAAiB;IAQ3D,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QARP,cAAS,GAAG,sBAAsB,CAAC;QACnC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;QAQvD,IAAI,CAAC,UAAU,GAAG,+DAA8B,CAAC,aAAa,EAAE,CAAC;QACjE,IAAI,CAAC,cAAc,GAAG,IAAI,yDAA2B,EAAE,CAAC;QACxD,IAAI,CAAC,UAAU,GAAG,IAAI,sCAAuB,EAAE,CAAC;IACpD,CAAC;IAEe,OAAO;;YACnB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC5C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAClE,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACpD,CAAC;KAAA;CACJ;AApBD,4DAoBC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./RefreshSensorDevicesTask"), exports);
|
|
18
|
+
__exportStar(require("./RefreshMeasurementsTask"), exports);
|
|
19
|
+
__exportStar(require("./RefreshMeasurementsByIdTask"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,4DAA0C;AAC1C,gEAA8C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IMeasurements {
|
|
2
|
+
sensor_id: string;
|
|
3
|
+
measurement_id: string;
|
|
4
|
+
measured_at: string;
|
|
5
|
+
air_temp?: number;
|
|
6
|
+
air_hum?: number;
|
|
7
|
+
pressure?: number;
|
|
8
|
+
wind_dir?: string;
|
|
9
|
+
wind_speed?: number;
|
|
10
|
+
wind_impact?: number;
|
|
11
|
+
precip?: number;
|
|
12
|
+
sun_irr?: number;
|
|
13
|
+
dendro_circ?: number;
|
|
14
|
+
dendro_gain?: number;
|
|
15
|
+
water_pot?: number;
|
|
16
|
+
soil_temp?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface IRefreshMeasurementsByIdTask {
|
|
19
|
+
sensorAddr: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const measurements: {
|
|
22
|
+
name: string;
|
|
23
|
+
pgTableName: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Measurements.js","sourceRoot":"","sources":["../../src/schema-definitions/Measurements.ts"],"names":[],"mappings":";;;AA0Ba,QAAA,YAAY,GAAG;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;CAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensorDevices.js","sourceRoot":"","sources":["../../src/schema-definitions/SensorDevices.ts"],"names":[],"mappings":";;;AAOa,QAAA,aAAa,GAAG;IACzB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;CAChC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
2
|
+
export interface IMeasurementInput {
|
|
3
|
+
sensor: {
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
id: string;
|
|
7
|
+
date: string;
|
|
8
|
+
data: {
|
|
9
|
+
airTemp1?: number;
|
|
10
|
+
airHum1?: number;
|
|
11
|
+
pressure?: number;
|
|
12
|
+
windDir?: string;
|
|
13
|
+
windSpeed?: number;
|
|
14
|
+
windImpact?: number;
|
|
15
|
+
volumeMm?: number;
|
|
16
|
+
irr?: number;
|
|
17
|
+
dendroCirc?: number;
|
|
18
|
+
dendroGain?: number;
|
|
19
|
+
waterPot?: number;
|
|
20
|
+
temp1?: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface IMeasurementForTransformation extends IMeasurementInput {
|
|
24
|
+
sensor_id: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const measurementsDatasource: {
|
|
27
|
+
name: string;
|
|
28
|
+
jsonSchema: JSONSchemaType<IMeasurementInput[]>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.measurementsDatasource = void 0;
|
|
4
|
+
const MeasurementsJsonSchema = {
|
|
5
|
+
type: "array",
|
|
6
|
+
items: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
sensor: { type: "object", properties: { type: { type: "string" } }, required: ["type"] },
|
|
10
|
+
id: { type: "string" },
|
|
11
|
+
date: { type: "string" },
|
|
12
|
+
data: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
airTemp1: { type: "number", nullable: true },
|
|
16
|
+
airHum1: { type: "number", nullable: true },
|
|
17
|
+
pressure: { type: "number", nullable: true },
|
|
18
|
+
windDir: { type: "string", nullable: true },
|
|
19
|
+
windSpeed: { type: "number", nullable: true },
|
|
20
|
+
windImpact: { type: "number", nullable: true },
|
|
21
|
+
volumeMm: { type: "number", nullable: true },
|
|
22
|
+
irr: { type: "number", nullable: true },
|
|
23
|
+
dendroCirc: { type: "number", nullable: true },
|
|
24
|
+
dendroGain: { type: "number", nullable: true },
|
|
25
|
+
waterPot: { type: "number", nullable: true },
|
|
26
|
+
temp1: { type: "number", nullable: true },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ["sensor", "id", "date"],
|
|
31
|
+
},
|
|
32
|
+
additionalProperties: false,
|
|
33
|
+
};
|
|
34
|
+
exports.measurementsDatasource = {
|
|
35
|
+
name: "MeasurementsDatasource",
|
|
36
|
+
jsonSchema: MeasurementsJsonSchema,
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=MeasurementsJsonSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasurementsJsonSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/MeasurementsJsonSchema.ts"],"names":[],"mappings":";;;AA4BA,MAAM,sBAAsB,GAAwC;IAChE,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE;YACxF,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC5C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC5C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC3C,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC7C,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC9C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC5C,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBACvC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC9C,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC9C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC5C,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;iBAC5C;aACJ;SACJ;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC;KACrC;IACD,oBAAoB,EAAE,KAAK;CAC9B,CAAC;AAEW,QAAA,sBAAsB,GAAsE;IACrG,IAAI,EAAE,wBAAwB;IAC9B,UAAU,EAAE,sBAAsB;CACrC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
2
|
+
export interface IDeviceLocationInput {
|
|
3
|
+
lat?: number;
|
|
4
|
+
lng?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface IDeviceInput {
|
|
7
|
+
name: string;
|
|
8
|
+
address: string;
|
|
9
|
+
location: IDeviceLocationInput;
|
|
10
|
+
}
|
|
11
|
+
export declare const sensorDevicesDatasource: {
|
|
12
|
+
name: string;
|
|
13
|
+
jsonSchema: JSONSchemaType<IDeviceInput[]>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sensorDevicesDatasource = void 0;
|
|
4
|
+
const SensorDevicesJsonSchema = {
|
|
5
|
+
type: "array",
|
|
6
|
+
items: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
name: { type: "string" },
|
|
10
|
+
address: { type: "string" },
|
|
11
|
+
location: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
lat: { type: "number", nullable: true },
|
|
15
|
+
lng: { type: "number", nullable: true },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ["name", "address", "location"],
|
|
20
|
+
},
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
};
|
|
23
|
+
exports.sensorDevicesDatasource = {
|
|
24
|
+
name: "SensorDevicesDatasource",
|
|
25
|
+
jsonSchema: SensorDevicesJsonSchema,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=SensorDevicesJsonSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensorDevicesJsonSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/SensorDevicesJsonSchema.ts"],"names":[],"mappings":";;;AAaA,MAAM,uBAAuB,GAAmC;IAC5D,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBACvC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;iBAC1C;aACJ;SACJ;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;KAC5C;IACD,oBAAoB,EAAE,KAAK;CAC9B,CAAC;AAEW,QAAA,uBAAuB,GAAiE;IACjG,IAAI,EAAE,yBAAyB;IAC/B,UAAU,EAAE,uBAAuB;CACtC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Microclimate = void 0;
|
|
4
|
+
const SensorDevicesJsonSchema_1 = require("./datasources/SensorDevicesJsonSchema");
|
|
5
|
+
const MeasurementsJsonSchema_1 = require("./datasources/MeasurementsJsonSchema");
|
|
6
|
+
const SensorDevices_1 = require("./SensorDevices");
|
|
7
|
+
const Measurements_1 = require("./Measurements");
|
|
8
|
+
const forExport = {
|
|
9
|
+
name: "Microclimate",
|
|
10
|
+
pgSchema: "microclimate",
|
|
11
|
+
datasources: {
|
|
12
|
+
sensorDevicesDatasource: SensorDevicesJsonSchema_1.sensorDevicesDatasource,
|
|
13
|
+
measurementsDatasource: MeasurementsJsonSchema_1.measurementsDatasource,
|
|
14
|
+
},
|
|
15
|
+
definitions: {
|
|
16
|
+
sensorDevices: SensorDevices_1.sensorDevices,
|
|
17
|
+
measurements: Measurements_1.measurements,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.Microclimate = forExport;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,iFAAiF;AACjF,mDAAgD;AAChD,iDAA8C;AAE9C,MAAM,SAAS,GAAQ;IACnB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE;QACT,uBAAuB,EAAvB,iDAAuB;QACvB,sBAAsB,EAAtB,+CAAsB;KACzB;IACD,WAAW,EAAE;QACT,aAAa,EAAb,6BAAa;QACb,YAAY,EAAZ,2BAAY;KACf;CACJ,CAAC;AAEoB,iCAAY"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
2
|
+
import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
|
|
3
|
+
import { IMeasurements } from "../Measurements";
|
|
4
|
+
export declare class MeasurementsModel extends Model<IMeasurements> implements IMeasurements {
|
|
5
|
+
sensor_id: string;
|
|
6
|
+
measurement_id: string;
|
|
7
|
+
measured_at: string;
|
|
8
|
+
air_temp?: number | undefined;
|
|
9
|
+
air_hum?: number | undefined;
|
|
10
|
+
pressure?: number | undefined;
|
|
11
|
+
wind_dir?: string | undefined;
|
|
12
|
+
wind_speed?: number | undefined;
|
|
13
|
+
wind_impact?: number | undefined;
|
|
14
|
+
precip?: number | undefined;
|
|
15
|
+
sun_irr?: number | undefined;
|
|
16
|
+
dendro_circ?: number | undefined;
|
|
17
|
+
dendro_gain?: number | undefined;
|
|
18
|
+
water_pot?: number | undefined;
|
|
19
|
+
soil_temp?: number | undefined;
|
|
20
|
+
static attributeModel: ModelAttributes<MeasurementsModel, IMeasurements>;
|
|
21
|
+
static jsonSchema: JSONSchemaType<IMeasurements[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeasurementsModel = void 0;
|
|
4
|
+
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
5
|
+
class MeasurementsModel extends sequelize_1.Model {
|
|
6
|
+
}
|
|
7
|
+
exports.MeasurementsModel = MeasurementsModel;
|
|
8
|
+
MeasurementsModel.attributeModel = {
|
|
9
|
+
sensor_id: { type: sequelize_1.DataTypes.STRING },
|
|
10
|
+
measurement_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
|
|
11
|
+
measured_at: { type: sequelize_1.DataTypes.DATE },
|
|
12
|
+
air_temp: { type: sequelize_1.DataTypes.STRING },
|
|
13
|
+
air_hum: { type: sequelize_1.DataTypes.FLOAT },
|
|
14
|
+
pressure: { type: sequelize_1.DataTypes.INTEGER },
|
|
15
|
+
wind_dir: { type: sequelize_1.DataTypes.STRING },
|
|
16
|
+
wind_speed: { type: sequelize_1.DataTypes.FLOAT },
|
|
17
|
+
wind_impact: { type: sequelize_1.DataTypes.FLOAT },
|
|
18
|
+
precip: { type: sequelize_1.DataTypes.FLOAT },
|
|
19
|
+
sun_irr: { type: sequelize_1.DataTypes.INTEGER },
|
|
20
|
+
dendro_circ: { type: sequelize_1.DataTypes.FLOAT },
|
|
21
|
+
dendro_gain: { type: sequelize_1.DataTypes.FLOAT },
|
|
22
|
+
water_pot: { type: sequelize_1.DataTypes.FLOAT },
|
|
23
|
+
soil_temp: { type: sequelize_1.DataTypes.FLOAT },
|
|
24
|
+
};
|
|
25
|
+
MeasurementsModel.jsonSchema = {
|
|
26
|
+
type: "array",
|
|
27
|
+
items: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
sensor_id: { type: "string" },
|
|
31
|
+
measurement_id: { type: "string" },
|
|
32
|
+
measured_at: { type: "string" },
|
|
33
|
+
air_temp: { type: "number", nullable: true },
|
|
34
|
+
air_hum: { type: "number", nullable: true },
|
|
35
|
+
pressure: { type: "number", nullable: true },
|
|
36
|
+
wind_dir: { type: "string", nullable: true },
|
|
37
|
+
wind_speed: { type: "number", nullable: true },
|
|
38
|
+
wind_impact: { type: "number", nullable: true },
|
|
39
|
+
precip: { type: "number", nullable: true },
|
|
40
|
+
sun_irr: { type: "number", nullable: true },
|
|
41
|
+
dendro_circ: { type: "number", nullable: true },
|
|
42
|
+
dendro_gain: { type: "number", nullable: true },
|
|
43
|
+
water_pot: { type: "number", nullable: true },
|
|
44
|
+
soil_temp: { type: "number", nullable: true },
|
|
45
|
+
},
|
|
46
|
+
required: ["sensor_id", "measurement_id", "measured_at"],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=MeasurementsModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasurementsModel.js","sourceRoot":"","sources":["../../../src/schema-definitions/models/MeasurementsModel.ts"],"names":[],"mappings":";;;AACA,mEAAwF;AAGxF,MAAa,iBAAkB,SAAQ,iBAAoB;;AAA3D,8CA2DC;AA1CiB,gCAAc,GAAsD;IAC9E,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IACrC,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5D,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACrC,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IACpC,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IAClC,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,OAAO,EAAE;IACrC,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IACpC,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACrC,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACjC,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,OAAO,EAAE;IACpC,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACtC,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACtC,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACpC,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;CACvC,CAAC;AAEY,4BAAU,GAAoC;IACxD,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC7B,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC5C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC5C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC5C,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC3C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/C,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC7C,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;SAChD;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,aAAa,CAAC;KAC3D;CACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
2
|
+
import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
|
|
3
|
+
import { ISensorDevice } from "../SensorDevices";
|
|
4
|
+
export declare class SensorDevicesModel extends Model<ISensorDevice> implements ISensorDevice {
|
|
5
|
+
whole_name: string;
|
|
6
|
+
sensor_id: string;
|
|
7
|
+
coordinate_lat?: number | undefined;
|
|
8
|
+
coordinate_lng?: number | undefined;
|
|
9
|
+
static attributeModel: ModelAttributes<SensorDevicesModel, ISensorDevice>;
|
|
10
|
+
static jsonSchema: JSONSchemaType<ISensorDevice[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SensorDevicesModel = void 0;
|
|
4
|
+
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
5
|
+
class SensorDevicesModel extends sequelize_1.Model {
|
|
6
|
+
}
|
|
7
|
+
exports.SensorDevicesModel = SensorDevicesModel;
|
|
8
|
+
SensorDevicesModel.attributeModel = {
|
|
9
|
+
whole_name: { type: sequelize_1.DataTypes.STRING },
|
|
10
|
+
sensor_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
|
|
11
|
+
coordinate_lat: { type: sequelize_1.DataTypes.FLOAT },
|
|
12
|
+
coordinate_lng: { type: sequelize_1.DataTypes.FLOAT },
|
|
13
|
+
};
|
|
14
|
+
SensorDevicesModel.jsonSchema = {
|
|
15
|
+
type: "array",
|
|
16
|
+
items: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
whole_name: { type: "string" },
|
|
20
|
+
sensor_id: { type: "string" },
|
|
21
|
+
coordinate_lat: { type: "number", nullable: true },
|
|
22
|
+
coordinate_lng: { type: "number", nullable: true },
|
|
23
|
+
},
|
|
24
|
+
required: ["whole_name", "sensor_id"],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=SensorDevicesModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensorDevicesModel.js","sourceRoot":"","sources":["../../../src/schema-definitions/models/SensorDevicesModel.ts"],"names":[],"mappings":";;;AACA,mEAAwF;AAGxF,MAAa,kBAAmB,SAAQ,iBAAoB;;AAA5D,gDA0BC;AApBiB,iCAAc,GAAuD;IAC/E,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IACtC,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IACvD,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;IACzC,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;CAC5C,CAAC;AAEY,6BAAU,GAAoC;IACxD,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC7B,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAClD,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;SACrD;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;KACxC;CACJ,CAAC"}
|
|
Binary file
|