@golemio/core 1.6.6 → 1.6.7-dev.846525251

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 (84) hide show
  1. package/README.md +0 -1
  2. package/bin/import-test-data.js +0 -72
  3. package/dist/helpers/HealthCheck.d.ts +0 -1
  4. package/dist/helpers/HealthCheck.js +0 -1
  5. package/dist/helpers/HealthCheck.js.map +1 -1
  6. package/dist/integration-engine/config/IntegrationEngineConfiguration.d.ts +0 -1
  7. package/dist/integration-engine/config/IntegrationEngineConfiguration.js +0 -1
  8. package/dist/integration-engine/config/IntegrationEngineConfiguration.js.map +1 -1
  9. package/dist/integration-engine/config/abstract.d.ts +0 -1
  10. package/dist/integration-engine/connectors/index.d.ts +0 -6
  11. package/dist/integration-engine/connectors/index.js +1 -6
  12. package/dist/integration-engine/connectors/index.js.map +1 -1
  13. package/dist/integration-engine/datasources/IDataSource.d.ts +2 -2
  14. package/dist/integration-engine/ioc/ContainerToken.d.ts +0 -1
  15. package/dist/integration-engine/ioc/ContainerToken.js +0 -1
  16. package/dist/integration-engine/ioc/ContainerToken.js.map +1 -1
  17. package/dist/integration-engine/ioc/Di.js +0 -2
  18. package/dist/integration-engine/ioc/Di.js.map +1 -1
  19. package/dist/integration-engine/models/IModel.d.ts +0 -12
  20. package/dist/integration-engine/models/PostgresModel.js +1 -1
  21. package/dist/integration-engine/models/PostgresModel.js.map +1 -1
  22. package/dist/integration-engine/models/index.d.ts +0 -1
  23. package/dist/integration-engine/models/index.js +0 -1
  24. package/dist/integration-engine/models/index.js.map +1 -1
  25. package/dist/monitoring/opentelemetry/instrumentation/configs/index.d.ts +0 -1
  26. package/dist/monitoring/opentelemetry/instrumentation/configs/index.js +1 -3
  27. package/dist/monitoring/opentelemetry/instrumentation/configs/index.js.map +1 -1
  28. package/dist/monitoring/opentelemetry/instrumentation/index.d.ts +1 -2
  29. package/dist/monitoring/opentelemetry/instrumentation/index.js +0 -2
  30. package/dist/monitoring/opentelemetry/instrumentation/index.js.map +1 -1
  31. package/dist/monitoring/sentry/sentry-provider.js +0 -1
  32. package/dist/monitoring/sentry/sentry-provider.js.map +1 -1
  33. package/dist/output-gateway/Geo.d.ts +1 -1
  34. package/dist/output-gateway/config/OutputGatewayConfiguration.d.ts +0 -3
  35. package/dist/output-gateway/config/OutputGatewayConfiguration.js +0 -11
  36. package/dist/output-gateway/config/OutputGatewayConfiguration.js.map +1 -1
  37. package/dist/output-gateway/database/index.d.ts +1 -30
  38. package/dist/output-gateway/database/index.js +1 -6
  39. package/dist/output-gateway/database/index.js.map +1 -1
  40. package/dist/output-gateway/ioc/ContainerToken.d.ts +0 -1
  41. package/dist/output-gateway/ioc/ContainerToken.js +0 -1
  42. package/dist/output-gateway/ioc/ContainerToken.js.map +1 -1
  43. package/dist/output-gateway/ioc/Di.js +0 -2
  44. package/dist/output-gateway/ioc/Di.js.map +1 -1
  45. package/dist/output-gateway/models/index.d.ts +0 -3
  46. package/dist/output-gateway/models/index.js +0 -3
  47. package/dist/output-gateway/models/index.js.map +1 -1
  48. package/dist/output-gateway/routes/index.d.ts +0 -2
  49. package/dist/output-gateway/routes/index.js +0 -2
  50. package/dist/output-gateway/routes/index.js.map +1 -1
  51. package/package.json +3 -6
  52. package/dist/integration-engine/connectors/MongoConnector.d.ts +0 -15
  53. package/dist/integration-engine/connectors/MongoConnector.js +0 -89
  54. package/dist/integration-engine/connectors/MongoConnector.js.map +0 -1
  55. package/dist/integration-engine/connectors/interfaces/IMongoConnector.d.ts +0 -7
  56. package/dist/integration-engine/connectors/interfaces/IMongoConnector.js +0 -3
  57. package/dist/integration-engine/connectors/interfaces/IMongoConnector.js.map +0 -1
  58. package/dist/integration-engine/models/MongoModel.d.ts +0 -42
  59. package/dist/integration-engine/models/MongoModel.js +0 -245
  60. package/dist/integration-engine/models/MongoModel.js.map +0 -1
  61. package/dist/monitoring/opentelemetry/instrumentation/configs/mongoose.d.ts +0 -2
  62. package/dist/monitoring/opentelemetry/instrumentation/configs/mongoose.js +0 -20
  63. package/dist/monitoring/opentelemetry/instrumentation/configs/mongoose.js.map +0 -1
  64. package/dist/output-gateway/database/MongoDatabase.d.ts +0 -19
  65. package/dist/output-gateway/database/MongoDatabase.js +0 -89
  66. package/dist/output-gateway/database/MongoDatabase.js.map +0 -1
  67. package/dist/output-gateway/models/GeoJsonModel.d.ts +0 -56
  68. package/dist/output-gateway/models/GeoJsonModel.js +0 -188
  69. package/dist/output-gateway/models/GeoJsonModel.js.map +0 -1
  70. package/dist/output-gateway/models/HistoryModel.d.ts +0 -30
  71. package/dist/output-gateway/models/HistoryModel.js +0 -96
  72. package/dist/output-gateway/models/HistoryModel.js.map +0 -1
  73. package/dist/output-gateway/models/MongoModel.d.ts +0 -74
  74. package/dist/output-gateway/models/MongoModel.js +0 -87
  75. package/dist/output-gateway/models/MongoModel.js.map +0 -1
  76. package/dist/output-gateway/routes/HistoryRouter.d.ts +0 -7
  77. package/dist/output-gateway/routes/HistoryRouter.js +0 -46
  78. package/dist/output-gateway/routes/HistoryRouter.js.map +0 -1
  79. package/dist/output-gateway/routes/RouterBuilder.d.ts +0 -70
  80. package/dist/output-gateway/routes/RouterBuilder.js +0 -92
  81. package/dist/output-gateway/routes/RouterBuilder.js.map +0 -1
  82. package/dist/shared/mongoose.d.ts +0 -2
  83. package/dist/shared/mongoose.js +0 -7
  84. package/dist/shared/mongoose.js.map +0 -1
@@ -1,7 +0,0 @@
1
- import { HistoryModel } from "../models";
2
- import { ValidationChain } from "express-validator/check";
3
- import { AbstractHistoryRouter } from "./AbstractHistoryRouter";
4
- export declare class HistoryRouter extends AbstractHistoryRouter {
5
- constructor(inModel: HistoryModel);
6
- protected GetIdQueryParamWithCorrectType: () => Promise<ValidationChain>;
7
- }
@@ -1,46 +0,0 @@
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.HistoryRouter = void 0;
13
- const Logger_1 = require("../Logger");
14
- const check_1 = require("express-validator/check");
15
- const mongoose_1 = require("mongoose");
16
- const AbstractHistoryRouter_1 = require("./AbstractHistoryRouter");
17
- class HistoryRouter extends AbstractHistoryRouter_1.AbstractHistoryRouter {
18
- constructor(inModel) {
19
- super(inModel);
20
- this.GetIdQueryParamWithCorrectType = () => __awaiter(this, void 0, void 0, function* () {
21
- let sensorIdParam;
22
- // @ts-ignore
23
- return yield this.model.GetSchema().then((schema) => {
24
- // Get the location of the ID of the sensor (the attribute name)
25
- const idKey = this.model.primarySensorIdPropertyLocation;
26
- let message = "Created history model " + this.model.GetName() + " has ID of sensor `" + idKey + "` of type ";
27
- // ID of the sensor has type "Number" in the schema
28
- if (schema.path(idKey) instanceof mongoose_1.Schema.Types.Number) {
29
- message += "number.";
30
- // Create a query parameter (which validates by express-validator) for detail route with type number
31
- sensorIdParam = (0, check_1.query)("sensorId.*").optional().isNumeric();
32
- // ID of the sensor has type "String" in the schema
33
- }
34
- else {
35
- message += "string.";
36
- // Create a query parameter (which validates by express-validator) for detail route with type string
37
- sensorIdParam = (0, check_1.query)("sensorId.*").optional().isString();
38
- }
39
- Logger_1.log.silly(message);
40
- return sensorIdParam;
41
- });
42
- });
43
- }
44
- }
45
- exports.HistoryRouter = HistoryRouter;
46
- //# sourceMappingURL=HistoryRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HistoryRouter.js","sourceRoot":"","sources":["../../../src/output-gateway/routes/HistoryRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAiC;AAEjC,mDAAiE;AACjE,uCAAkC;AAClC,mEAAgE;AAEhE,MAAa,aAAc,SAAQ,6CAAqB;IACpD,YAAmB,OAAqB;QACpC,KAAK,CAAC,OAAO,CAAC,CAAC;QAGT,mCAA8B,GAAG,GAAmC,EAAE;YAC5E,IAAI,aAA8B,CAAC;YACnC,aAAa;YACb,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBAChD,gEAAgE;gBAChE,MAAM,KAAK,GAAI,IAAI,CAAC,KAAsB,CAAC,+BAA+B,CAAC;gBAC3E,IAAI,OAAO,GAAW,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,qBAAqB,GAAG,KAAK,GAAG,YAAY,CAAC;gBACrH,mDAAmD;gBACnD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,iBAAM,CAAC,KAAK,CAAC,MAAM,EAAE;oBACnD,OAAO,IAAI,SAAS,CAAC;oBACrB,oGAAoG;oBACpG,aAAa,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC;oBAC3D,mDAAmD;iBACtD;qBAAM;oBACH,OAAO,IAAI,SAAS,CAAC;oBACrB,oGAAoG;oBACpG,aAAa,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;iBAC7D;gBACD,YAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACnB,OAAO,aAAa,CAAC;YACzB,CAAC,CAAC,CAAC;QACP,CAAC,CAAA,CAAC;IAvBF,CAAC;CAwBJ;AA3BD,sCA2BC"}
@@ -1,70 +0,0 @@
1
- import { Router } from "express";
2
- import { SchemaDefinition } from "mongoose";
3
- import { GeoJsonModel, HistoryModel } from "../models";
4
- export interface IDatasetDefinition {
5
- name: string;
6
- schema: SchemaDefinition;
7
- collectionName: string;
8
- history?: IDatasetDefinition;
9
- historyTimePropertyLocation?: string;
10
- expire?: number | string;
11
- }
12
- /**
13
- * General router builder. Creates routes on top of passed Express router
14
- * based on data about desired routes - their type, name (base url) and schema of the data to be returned
15
- *
16
- * For GeoJSON data, automatically creates / and /:id routes,
17
- * adds filtering parameters (geo, city district, limit, offset, last updated)
18
- */
19
- export declare class RouterBuilder {
20
- /**
21
- * Router instance to build all the routes on
22
- */
23
- private router;
24
- /**
25
- * Routes data - name (base url) of the routes, data schemas and (optional) collection name
26
- */
27
- private routesData;
28
- constructor(inRouter: Router);
29
- /**
30
- *
31
- * @param inName Name of the route, serves as base url for the route's requests {base router}/{inName}/
32
- * @param inModel Model whose methods are to be mounted on the routes
33
- *
34
- * Creates a router with the model's methods mounted on {inName}/...
35
- */
36
- CreateGeojsonRoute(inName: string, inModel: GeoJsonModel, expire?: number | string): void;
37
- /**
38
- *
39
- * @param inName Name of the route, serves as base url for the route's requests {base router}/{inName}/
40
- * @param inModel Model whose methods are to be mounted on the routes
41
- *
42
- * Creates a router with the model's methods mounted on {inName}/...
43
- */
44
- CreateHistoryRoute(inName: string, inModel: HistoryModel, expire?: number | string): void;
45
- /**
46
- *
47
- * @param inData Array with data about the new created routes, contains object with name
48
- * (specifies where the routes will be available)
49
- * and schema (format of the data to be returned at the routes).
50
- *
51
- * Binds all routes passed as parameter to /{their name}
52
- */
53
- CreateGeojsonRoutes(inData: IDatasetDefinition[]): void;
54
- /**
55
- *
56
- * @param inData Array with data about the new created routes
57
- * if it contains a "history" sub-object, this creates a route for that
58
- *
59
- * Binds history route passed as parameter to /{their name}/history
60
- */
61
- CreateHistoryRoutes(inData: IDatasetDefinition[]): void;
62
- /**
63
- * Loads the data for building the routes
64
- */
65
- LoadData(inData: IDatasetDefinition[]): void;
66
- /**
67
- * Builds all routes based on data in this.data and mounts them to this.router
68
- */
69
- BuildAllRoutes(): void;
70
- }
@@ -1,92 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RouterBuilder = void 0;
4
- const routes_1 = require("./");
5
- const Logger_1 = require("../Logger");
6
- const models_1 = require("../models");
7
- /**
8
- * General router builder. Creates routes on top of passed Express router
9
- * based on data about desired routes - their type, name (base url) and schema of the data to be returned
10
- *
11
- * For GeoJSON data, automatically creates / and /:id routes,
12
- * adds filtering parameters (geo, city district, limit, offset, last updated)
13
- */
14
- class RouterBuilder {
15
- constructor(inRouter) {
16
- this.router = inRouter;
17
- }
18
- /**
19
- *
20
- * @param inName Name of the route, serves as base url for the route's requests {base router}/{inName}/
21
- * @param inModel Model whose methods are to be mounted on the routes
22
- *
23
- * Creates a router with the model's methods mounted on {inName}/...
24
- */
25
- CreateGeojsonRoute(inName, inModel, expire) {
26
- const generalRouter = new routes_1.GeoJsonRouter(inModel);
27
- generalRouter.initRoutes(expire);
28
- this.router.use(inName, generalRouter.router);
29
- }
30
- /**
31
- *
32
- * @param inName Name of the route, serves as base url for the route's requests {base router}/{inName}/
33
- * @param inModel Model whose methods are to be mounted on the routes
34
- *
35
- * Creates a router with the model's methods mounted on {inName}/...
36
- */
37
- CreateHistoryRoute(inName, inModel, expire) {
38
- const historyRouter = new routes_1.HistoryRouter(inModel);
39
- historyRouter.initRoutes(expire);
40
- this.router.use(inName, historyRouter.router);
41
- }
42
- /**
43
- *
44
- * @param inData Array with data about the new created routes, contains object with name
45
- * (specifies where the routes will be available)
46
- * and schema (format of the data to be returned at the routes).
47
- *
48
- * Binds all routes passed as parameter to /{their name}
49
- */
50
- CreateGeojsonRoutes(inData) {
51
- inData.forEach((data) => {
52
- this.CreateGeojsonRoute("/" + data.name.toLowerCase(), new models_1.GeoJsonModel(data.name, data.schema, data.collectionName));
53
- });
54
- }
55
- /**
56
- *
57
- * @param inData Array with data about the new created routes
58
- * if it contains a "history" sub-object, this creates a route for that
59
- *
60
- * Binds history route passed as parameter to /{their name}/history
61
- */
62
- CreateHistoryRoutes(inData) {
63
- inData.forEach((data) => {
64
- if (data.history) {
65
- this.CreateHistoryRoute("/" + data.name.toLowerCase() + "/history", new models_1.HistoryModel(data.history.name, data.history.schema, data.history.collectionName, data.history.historyTimePropertyLocation));
66
- }
67
- });
68
- }
69
- /**
70
- * Loads the data for building the routes
71
- */
72
- LoadData(inData) {
73
- Logger_1.log.silly(`RouterBuilder: Loaded data to build ${inData.length} sets of routes`);
74
- if (this.routesData && this.routesData.length >= 0) {
75
- Logger_1.log.warn("Routes data were not empty. Rewriting with new set of data. All previous will be lost.");
76
- }
77
- this.routesData = inData;
78
- }
79
- /**
80
- * Builds all routes based on data in this.data and mounts them to this.router
81
- */
82
- BuildAllRoutes() {
83
- if (!this.routesData || this.routesData.length === 0) {
84
- Logger_1.log.warn("Routes data for building routes seem to be empty." + "Make sure to call .LoadData before you .BuildAllRoutes");
85
- Logger_1.log.debug(this.routesData);
86
- }
87
- this.CreateHistoryRoutes(this.routesData);
88
- this.CreateGeojsonRoutes(this.routesData);
89
- }
90
- }
91
- exports.RouterBuilder = RouterBuilder;
92
- //# sourceMappingURL=RouterBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RouterBuilder.js","sourceRoot":"","sources":["../../../src/output-gateway/routes/RouterBuilder.ts"],"names":[],"mappings":";;;AAEA,+BAA0D;AAC1D,sCAAiC;AACjC,sCAAwD;AAWxD;;;;;;GAMG;AACH,MAAa,aAAa;IAUtB,YAAY,QAAgB;QACxB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACI,kBAAkB,CAAC,MAAc,EAAE,OAAqB,EAAE,MAAwB;QACrF,MAAM,aAAa,GAAG,IAAI,sBAAa,CAAC,OAAO,CAAC,CAAC;QACjD,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;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;YAChD,YAAG,CAAC,IAAI,CAAC,wFAAwF,CAAC,CAAC;SACtG;QACD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,cAAc;QACjB,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAClD,YAAG,CAAC,IAAI,CACJ,mDAAmD,GAAG,wDAAwD,CACjH,CAAC;YACF,YAAG,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC9B;QACD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;CACJ;AArGD,sCAqGC"}
@@ -1,2 +0,0 @@
1
- import mongoose from "mongoose";
2
- export = mongoose;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- const mongoose_1 = __importDefault(require("mongoose"));
6
- module.exports = mongoose_1.default;
7
- //# sourceMappingURL=mongoose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mongoose.js","sourceRoot":"","sources":["../../src/shared/mongoose.ts"],"names":[],"mappings":";;;;AAAA,wDAAgC;AAChC,iBAAS,kBAAQ,CAAC"}