@golemio/core 1.6.5 → 1.6.6-dev.837110606
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/README.md +0 -1
- package/bin/import-test-data.js +0 -72
- package/dist/helpers/HealthCheck.d.ts +0 -1
- package/dist/helpers/HealthCheck.js +0 -1
- package/dist/helpers/HealthCheck.js.map +1 -1
- package/dist/helpers/data-access/amqp/AlternateExchangeCreator.js +2 -1
- package/dist/helpers/data-access/amqp/AlternateExchangeCreator.js.map +1 -1
- package/dist/input-gateway/connectors/AMQPConnector.js +2 -1
- package/dist/input-gateway/connectors/AMQPConnector.js.map +1 -1
- package/dist/integration-engine/config/IntegrationEngineConfiguration.d.ts +0 -1
- package/dist/integration-engine/config/IntegrationEngineConfiguration.js +0 -1
- package/dist/integration-engine/config/IntegrationEngineConfiguration.js.map +1 -1
- package/dist/integration-engine/config/abstract.d.ts +0 -1
- package/dist/integration-engine/connectors/AMQPConnector.js +2 -1
- package/dist/integration-engine/connectors/AMQPConnector.js.map +1 -1
- package/dist/integration-engine/connectors/index.d.ts +0 -6
- package/dist/integration-engine/connectors/index.js +1 -6
- package/dist/integration-engine/connectors/index.js.map +1 -1
- package/dist/integration-engine/datasources/IDataSource.d.ts +2 -2
- package/dist/integration-engine/ioc/ContainerToken.d.ts +0 -1
- package/dist/integration-engine/ioc/ContainerToken.js +0 -1
- package/dist/integration-engine/ioc/ContainerToken.js.map +1 -1
- package/dist/integration-engine/ioc/Di.js +0 -2
- package/dist/integration-engine/ioc/Di.js.map +1 -1
- package/dist/integration-engine/models/IModel.d.ts +0 -12
- package/dist/integration-engine/models/PostgresModel.js +1 -1
- package/dist/integration-engine/models/PostgresModel.js.map +1 -1
- package/dist/integration-engine/models/index.d.ts +0 -1
- package/dist/integration-engine/models/index.js +0 -1
- package/dist/integration-engine/models/index.js.map +1 -1
- package/dist/integration-engine/queueprocessors/QueueProcessor.js +1 -1
- package/dist/integration-engine/queueprocessors/QueueProcessor.js.map +1 -1
- package/dist/integration-engine/workers/AbstractTask.d.ts +1 -0
- package/dist/integration-engine/workers/AbstractTask.js +1 -0
- package/dist/integration-engine/workers/AbstractTask.js.map +1 -1
- package/dist/integration-engine/workers/AbstractWorker.js +1 -0
- package/dist/integration-engine/workers/AbstractWorker.js.map +1 -1
- package/dist/integration-engine/workers/interfaces/ITask.d.ts +1 -0
- package/dist/monitoring/opentelemetry/instrumentation/configs/index.d.ts +0 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/index.js +1 -3
- package/dist/monitoring/opentelemetry/instrumentation/configs/index.js.map +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/index.d.ts +1 -2
- package/dist/monitoring/opentelemetry/instrumentation/index.js +0 -2
- package/dist/monitoring/opentelemetry/instrumentation/index.js.map +1 -1
- package/dist/monitoring/sentry/sentry-provider.js +0 -1
- package/dist/monitoring/sentry/sentry-provider.js.map +1 -1
- package/dist/output-gateway/Geo.d.ts +1 -1
- package/dist/output-gateway/config/OutputGatewayConfiguration.d.ts +0 -3
- package/dist/output-gateway/config/OutputGatewayConfiguration.js +0 -11
- package/dist/output-gateway/config/OutputGatewayConfiguration.js.map +1 -1
- package/dist/output-gateway/database/index.d.ts +1 -30
- package/dist/output-gateway/database/index.js +1 -6
- package/dist/output-gateway/database/index.js.map +1 -1
- package/dist/output-gateway/ioc/ContainerToken.d.ts +0 -1
- package/dist/output-gateway/ioc/ContainerToken.js +0 -1
- package/dist/output-gateway/ioc/ContainerToken.js.map +1 -1
- package/dist/output-gateway/ioc/Di.js +0 -2
- package/dist/output-gateway/ioc/Di.js.map +1 -1
- package/dist/output-gateway/models/index.d.ts +0 -3
- package/dist/output-gateway/models/index.js +0 -3
- package/dist/output-gateway/models/index.js.map +1 -1
- package/dist/output-gateway/routes/index.d.ts +0 -2
- package/dist/output-gateway/routes/index.js +0 -2
- package/dist/output-gateway/routes/index.js.map +1 -1
- package/package.json +6 -7
- package/dist/integration-engine/connectors/MongoConnector.d.ts +0 -15
- package/dist/integration-engine/connectors/MongoConnector.js +0 -89
- package/dist/integration-engine/connectors/MongoConnector.js.map +0 -1
- package/dist/integration-engine/connectors/interfaces/IMongoConnector.d.ts +0 -7
- package/dist/integration-engine/connectors/interfaces/IMongoConnector.js +0 -3
- package/dist/integration-engine/connectors/interfaces/IMongoConnector.js.map +0 -1
- package/dist/integration-engine/models/MongoModel.d.ts +0 -42
- package/dist/integration-engine/models/MongoModel.js +0 -245
- package/dist/integration-engine/models/MongoModel.js.map +0 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/mongoose.d.ts +0 -2
- package/dist/monitoring/opentelemetry/instrumentation/configs/mongoose.js +0 -20
- package/dist/monitoring/opentelemetry/instrumentation/configs/mongoose.js.map +0 -1
- package/dist/output-gateway/database/MongoDatabase.d.ts +0 -19
- package/dist/output-gateway/database/MongoDatabase.js +0 -89
- package/dist/output-gateway/database/MongoDatabase.js.map +0 -1
- package/dist/output-gateway/models/GeoJsonModel.d.ts +0 -56
- package/dist/output-gateway/models/GeoJsonModel.js +0 -188
- package/dist/output-gateway/models/GeoJsonModel.js.map +0 -1
- package/dist/output-gateway/models/HistoryModel.d.ts +0 -30
- package/dist/output-gateway/models/HistoryModel.js +0 -96
- package/dist/output-gateway/models/HistoryModel.js.map +0 -1
- package/dist/output-gateway/models/MongoModel.d.ts +0 -74
- package/dist/output-gateway/models/MongoModel.js +0 -87
- package/dist/output-gateway/models/MongoModel.js.map +0 -1
- package/dist/output-gateway/routes/HistoryRouter.d.ts +0 -7
- package/dist/output-gateway/routes/HistoryRouter.js +0 -46
- package/dist/output-gateway/routes/HistoryRouter.js.map +0 -1
- package/dist/output-gateway/routes/RouterBuilder.d.ts +0 -70
- package/dist/output-gateway/routes/RouterBuilder.js +0 -92
- package/dist/output-gateway/routes/RouterBuilder.js.map +0 -1
- package/dist/shared/mongoose.d.ts +0 -2
- package/dist/shared/mongoose.js +0 -7
- package/dist/shared/mongoose.js.map +0 -1
|
@@ -7,7 +7,6 @@ const instrumentation_ioredis_1 = require("@opentelemetry/instrumentation-ioredi
|
|
|
7
7
|
const instrumentation_redis_1 = require("@opentelemetry/instrumentation-redis");
|
|
8
8
|
const instrumentation_express_1 = require("@opentelemetry/instrumentation-express");
|
|
9
9
|
const opentelemetry_instrumentation_sequelize_1 = require("opentelemetry-instrumentation-sequelize");
|
|
10
|
-
const opentelemetry_instrumentation_mongoose_1 = require("opentelemetry-instrumentation-mongoose");
|
|
11
10
|
const instrumentation_amqplib_1 = require("@opentelemetry/instrumentation-amqplib");
|
|
12
11
|
const instrumentation_aws_sdk_1 = require("@opentelemetry/instrumentation-aws-sdk");
|
|
13
12
|
// Configs
|
|
@@ -17,7 +16,6 @@ const getInstrumentation = () => {
|
|
|
17
16
|
new instrumentation_express_1.ExpressInstrumentation(),
|
|
18
17
|
new instrumentation_http_1.HttpInstrumentation(configs_1.httpConfig),
|
|
19
18
|
new opentelemetry_instrumentation_sequelize_1.SequelizeInstrumentation(configs_1.sequelizeConfig),
|
|
20
|
-
new opentelemetry_instrumentation_mongoose_1.MongooseInstrumentation(configs_1.mongooseConfig),
|
|
21
19
|
new instrumentation_amqplib_1.AmqplibInstrumentation(configs_1.amqplibConfig),
|
|
22
20
|
new instrumentation_ioredis_1.IORedisInstrumentation(),
|
|
23
21
|
new instrumentation_redis_1.RedisInstrumentation(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,8EAA0E;AAC1E,oFAAgF;AAChF,gFAA4E;AAC5E,oFAAgF;AAChF,qGAAmF;AACnF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,8EAA0E;AAC1E,oFAAgF;AAChF,gFAA4E;AAC5E,oFAAgF;AAChF,qGAAmF;AACnF,oFAAgF;AAChF,oFAA4E;AAE5E,UAAU;AACV,uCAAqF;AAE9E,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,OAAO;QACH,IAAI,gDAAsB,EAAE;QAC5B,IAAI,0CAAmB,CAAC,oBAAU,CAAC;QACnC,IAAI,kEAAwB,CAAC,yBAAe,CAAC;QAC7C,IAAI,gDAAsB,CAAC,uBAAa,CAAC;QACzC,IAAI,gDAAsB,EAAE;QAC5B,IAAI,4CAAoB,EAAE;QAC1B,IAAI,4CAAkB,CAAC,sBAAY,CAAC;KACvC,CAAC;AACN,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B"}
|
|
@@ -40,7 +40,6 @@ const initSentry = (sentryConfig, appName, app) => {
|
|
|
40
40
|
debug: sentryConfig.debug,
|
|
41
41
|
integrations: [
|
|
42
42
|
new sentry.Integrations.Http({ tracing: true }),
|
|
43
|
-
new tracer.Integrations.Mongo({ useMongoose: true }),
|
|
44
43
|
new tracer.Integrations.Postgres(),
|
|
45
44
|
...(app ? [new tracer.Integrations.Express({ app })] : []),
|
|
46
45
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry-provider.js","sourceRoot":"","sources":["../../../src/monitoring/sentry/sentry-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAuC;AACvC,wDAA0C;AAC1C,4CAA8C;AAWvC,MAAM,UAAU,GAAG,CAAC,YAA2B,EAAE,OAAe,EAAE,GAAyB,EAAE,EAAE;IAClG,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG;QAAE,OAAO;IAEvD,MAAM,OAAO,GAAuB;QAChC,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,YAAY,EAAE;YACV,IAAI,EAAE,EAAE,OAAO,EAAE;SACpB;QACD,KAAK,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AE;gBAClC,KAAK,CAAC,WAAW,GAAG;oBAChB,6BAA6B;oBAC7B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;oBACtB,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;oBAC3B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;oBACtB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;oBACvB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;iBAC1B,CAAC;aACL;YAED,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC,CAAC;AApCW,QAAA,UAAU,cAoCrB"}
|
|
@@ -81,7 +81,7 @@ export declare const buildGeojsonFeatureLatLng: (item: any, lon: number, lat: nu
|
|
|
81
81
|
*/
|
|
82
82
|
export declare const buildGeojsonFeatureType: <K extends string, T>(geoProp: K, { [geoProp]: location, ...rest }: T & Record<K, TGeoCoordinates>) => {
|
|
83
83
|
geometry: {
|
|
84
|
-
coordinates:
|
|
84
|
+
coordinates: (number | null)[] | number[][] | number[][][] | number[][][][];
|
|
85
85
|
type: GeoCoordinatesType.Point | GeoCoordinatesType.Polygon | GeoCoordinatesType.MultiPolygon;
|
|
86
86
|
};
|
|
87
87
|
properties: Omit<T & Record<K, TGeoCoordinates>, K>;
|
|
@@ -8,8 +8,6 @@ export declare class OutputGatewayConfiguration {
|
|
|
8
8
|
host: string | undefined;
|
|
9
9
|
port: string | undefined;
|
|
10
10
|
};
|
|
11
|
-
mongo_connection: string | undefined;
|
|
12
|
-
mongo_timeout: number;
|
|
13
11
|
node_env: string;
|
|
14
12
|
pagination_max_limit: number;
|
|
15
13
|
port: string | undefined;
|
|
@@ -53,5 +51,4 @@ export declare class OutputGatewayConfiguration {
|
|
|
53
51
|
};
|
|
54
52
|
constructor();
|
|
55
53
|
private getPaginationMaxLimit;
|
|
56
|
-
private getMongoTimeout;
|
|
57
54
|
}
|
|
@@ -22,7 +22,6 @@ let OutputGatewayConfiguration = class OutputGatewayConfiguration {
|
|
|
22
22
|
host: process.env.INSPECTOR_HOST,
|
|
23
23
|
port: process.env.INSPECTOR_PORT,
|
|
24
24
|
};
|
|
25
|
-
this.mongo_connection = process.env.MONGO_CONN;
|
|
26
25
|
this.node_env = process.env.NODE_ENV || "development";
|
|
27
26
|
this.port = process.env.PORT;
|
|
28
27
|
this.postgres_connection = process.env.POSTGRES_CONN;
|
|
@@ -93,16 +92,6 @@ let OutputGatewayConfiguration = class OutputGatewayConfiguration {
|
|
|
93
92
|
}
|
|
94
93
|
return 10000;
|
|
95
94
|
};
|
|
96
|
-
this.getMongoTimeout = () => {
|
|
97
|
-
if (process.env.MONGO_TIMEOUT) {
|
|
98
|
-
const parsed = parseInt(process.env.MONGO_TIMEOUT, 10);
|
|
99
|
-
if (!isNaN(parsed)) {
|
|
100
|
-
return parsed;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return 30000;
|
|
104
|
-
};
|
|
105
|
-
this.mongo_timeout = this.getMongoTimeout();
|
|
106
95
|
this.pagination_max_limit = this.getPaginationMaxLimit();
|
|
107
96
|
}
|
|
108
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputGatewayConfiguration.js","sourceRoot":"","sources":["../../../src/output-gateway/config/OutputGatewayConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kDAAkD;AAClD,uCAAsC;AAGtC,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;
|
|
1
|
+
{"version":3,"file":"OutputGatewayConfiguration.js","sourceRoot":"","sources":["../../../src/output-gateway/config/OutputGatewayConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kDAAkD;AAClD,uCAAsC;AAGtC,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IAwEnC;;QAvEO,gBAAW,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAC9C,aAAQ,GAAG,OAAO,CAA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,CAAC;QAClB,qBAAgB,GAAG;YACtB,eAAe,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,kCAAkC,mCAAI,eAAe;SACrF,CAAC;QAMM,0BAAqB,GAAG,GAAW,EAAE;YACzC,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE;gBAClC,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;gBAC9D,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;oBAChB,OAAO,MAAM,CAAC;iBACjB;aACJ;YAED,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QAZE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC7D,CAAC;CAYJ,CAAA;AAtFY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;;GACA,0BAA0B,CAsFtC;AAtFY,gEAA0B"}
|
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose" />
|
|
25
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
26
1
|
import { Sequelize } from "sequelize";
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
29
|
-
*/
|
|
30
|
-
declare const mongooseConnection: Promise<import("mongoose").Connection>;
|
|
31
2
|
/**
|
|
32
3
|
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
33
4
|
*/
|
|
@@ -37,4 +8,4 @@ declare const sequelizeConnection: Sequelize;
|
|
|
37
8
|
*/
|
|
38
9
|
declare const sequelizeReadOnlyConnection: Sequelize;
|
|
39
10
|
export * from "./PostgreDatabase";
|
|
40
|
-
export {
|
|
11
|
+
export { sequelizeConnection, sequelizeReadOnlyConnection };
|
|
@@ -14,13 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.sequelizeReadOnlyConnection = exports.sequelizeConnection =
|
|
17
|
+
exports.sequelizeReadOnlyConnection = exports.sequelizeConnection = void 0;
|
|
18
18
|
const ioc_1 = require("../ioc");
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
21
|
-
*/
|
|
22
|
-
const mongooseConnection = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.MongoDatabase).connect();
|
|
23
|
-
exports.mongooseConnection = mongooseConnection;
|
|
24
19
|
/**
|
|
25
20
|
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
26
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/database/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gCAAiE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/database/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gCAAiE;AAGjE;;GAEG;AACH,MAAM,mBAAmB,GAAG,4BAAsB,CAAC,OAAO,CAAY,oBAAc,CAAC,mBAAmB,CAAC,CAAC;AAOjG,kDAAmB;AAN5B;;GAEG;AACH,MAAM,2BAA2B,GAAG,4BAAsB,CAAC,OAAO,CAAY,oBAAc,CAAC,2BAA2B,CAAC,CAAC;AAG5F,kEAA2B;AADzD,oDAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerToken.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/ContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACnB,MAAM,EAAE,MAAM,EAAE;IAChB,MAAM,EAAE,MAAM,EAAE;IAChB,YAAY,EAAE,MAAM,EAAE;IACtB,aAAa,EAAE,MAAM,EAAE;IACvB,gBAAgB,EAAE,MAAM,EAAE;IAC1B,2BAA2B,EAAE,MAAM,EAAE;IACrC,mBAAmB,EAAE,MAAM,EAAE;IAC7B,cAAc,EAAE,MAAM,EAAE;IACxB,eAAe,EAAE,MAAM,EAAE;IACzB,
|
|
1
|
+
{"version":3,"file":"ContainerToken.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/ContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACnB,MAAM,EAAE,MAAM,EAAE;IAChB,MAAM,EAAE,MAAM,EAAE;IAChB,YAAY,EAAE,MAAM,EAAE;IACtB,aAAa,EAAE,MAAM,EAAE;IACvB,gBAAgB,EAAE,MAAM,EAAE;IAC1B,2BAA2B,EAAE,MAAM,EAAE;IACrC,mBAAmB,EAAE,MAAM,EAAE;IAC7B,cAAc,EAAE,MAAM,EAAE;IACxB,eAAe,EAAE,MAAM,EAAE;IACzB,kBAAkB,EAAE,MAAM,EAAE;IAC5B,yBAAyB,EAAE,MAAM,EAAE;CACtC,CAAC;AAEO,wCAAc"}
|
|
@@ -5,7 +5,6 @@ const _helpers_1 = require("../../helpers");
|
|
|
5
5
|
const Di_1 = require("../../helpers/ioc/Di");
|
|
6
6
|
const OutputGatewayConfiguration_1 = require("../config/OutputGatewayConfiguration");
|
|
7
7
|
const FeatureFlagServiceWrapper_1 = require("../data-access/FeatureFlagServiceWrapper");
|
|
8
|
-
const MongoDatabase_1 = require("../database/MongoDatabase");
|
|
9
8
|
const PostgreDatabase_1 = require("../database/PostgreDatabase");
|
|
10
9
|
const CacheMiddleware_1 = require("../redis/CacheMiddleware");
|
|
11
10
|
const RedisConnector_1 = require("../redis/RedisConnector");
|
|
@@ -35,7 +34,6 @@ OutputGatewayContainer.register(ContainerToken_1.ContainerToken.PostgresDatabase
|
|
|
35
34
|
.register(ContainerToken_1.ContainerToken.SequelizeConnection, {
|
|
36
35
|
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => c.resolve(ContainerToken_1.ContainerToken.PostgresDatabase).connect(config.postgres_connection || "")),
|
|
37
36
|
})
|
|
38
|
-
.registerSingleton(ContainerToken_1.ContainerToken.MongoDatabase, MongoDatabase_1.MongoDatabase)
|
|
39
37
|
.registerSingleton(ContainerToken_1.ContainerToken.RedisConnector, RedisConnector_1.RedisConnector)
|
|
40
38
|
.registerSingleton(ContainerToken_1.ContainerToken.CacheMiddleware, CacheMiddleware_1.CacheMiddleware)
|
|
41
39
|
.register(ContainerToken_1.ContainerToken.FeatureFlagServiceWrapper, FeatureFlagServiceWrapper_1.FeatureFlagServiceWrapper, singletonOptions)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,4CAAsE;AACtE,6CAAkD;AAClD,qFAAmF;AACnF,wFAAsF;AACtF,
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,4CAAsE;AACtE,6CAAkD;AAClD,qFAAmF;AACnF,wFAAsF;AACtF,iEAAgE;AAChE,8DAA4D;AAC5D,4DAA0D;AAC1D,uCAA6D;AAC7D,qDAAkD;AAElD,wBAAwB;AACxB,MAAM,gBAAgB,GAAG,EAAE,SAAS,EAAE,oBAAS,CAAC,SAAS,EAAE,CAAC;AAC5D,MAAM,sBAAsB,GAAG,oBAAe,CAAC,oBAAoB,EAAE,CAAC;AA+C7D,wDAAsB;AA9C/B,YAAY;AAEZ,iBAAiB;AACjB,sBAAsB,CAAC,iBAAiB,CAAC,+BAAc,CAAC,MAAM,EAAE,uDAA0B,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAA6B,+BAAc,CAAC,MAAM,CAAC,CAAC;AAEjG,sBAAsB,CAAC,QAAQ,CAAU,+BAAc,CAAC,MAAM,EAAE;IAC5D,UAAU,EAAE,IAAA,iCAAsB,EAAC,GAAG,EAAE,CACpC,IAAA,uBAAY,EAAC;QACT,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,MAAM,CAAC,QAAQ;QACxB,QAAQ,EAAE,MAAM,CAAC,SAAS;KAC7B,CAAC,CACL;CACJ,CAAC,CAAC,gBAAgB,CACf,+BAAc,CAAC,aAAa,EAC5B,IAAA,8BAAmB,EAAC,MAAM,CAAC,QAAQ,EAAE,sBAAsB,CAAC,OAAO,CAAU,+BAAc,CAAC,MAAM,CAAC,CAAC,CACvG,CAAC;AACF,YAAY;AAEZ,qBAAqB;AACrB,sBAAsB,CAAC,QAAQ,CAC3B,+BAAc,CAAC,gBAAgB,EAC/B,EAAE,QAAQ,EAAE,kCAAgB,EAAE,EAC9B,EAAE,SAAS,EAAE,oBAAS,CAAC,SAAS,EAAE,CACrC;KACI,QAAQ,CAAC,+BAAc,CAAC,2BAA2B,EAAE;IAClD,UAAU,EAAE,IAAA,iCAAsB,EAAC,CAAC,CAAC,EAAE,EAAE,CACrC,CAAC,CAAC,OAAO,CAAmB,+BAAc,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,6BAA6B,IAAI,EAAE,CAAC,CACnH;CACJ,CAAC;KACD,QAAQ,CAAC,+BAAc,CAAC,mBAAmB,EAAE;IAC1C,UAAU,EAAE,IAAA,iCAAsB,EAAC,CAAC,CAAC,EAAE,EAAE,CACrC,CAAC,CAAC,OAAO,CAAmB,+BAAc,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC,CACzG;CACJ,CAAC;KACD,iBAAiB,CAAC,+BAAc,CAAC,cAAc,EAAE,+BAAc,CAAC;KAChE,iBAAiB,CAAC,+BAAc,CAAC,eAAe,EAAE,iCAAe,CAAC;KAClE,QAAQ,CAAC,+BAAc,CAAC,yBAAyB,EAAE,qDAAyB,EAAE,gBAAgB,CAAC;KAC/F,QAAQ,CAAC,+BAAc,CAAC,kBAAkB,EAAE;IACzC,UAAU,EAAE,IAAA,iCAAsB,EAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAA4B,+BAAc,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAChG;CACJ,CAAC,CAAC"}
|
|
@@ -16,8 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BaseModel"), exports);
|
|
18
18
|
__exportStar(require("./SequelizeModel"), exports);
|
|
19
|
-
__exportStar(require("./MongoModel"), exports);
|
|
20
|
-
__exportStar(require("./GeoJsonModel"), exports);
|
|
21
|
-
__exportStar(require("./HistoryModel"), exports);
|
|
22
19
|
__exportStar(require("./response"), exports);
|
|
23
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,mDAAiC;AACjC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,mDAAiC;AACjC,6CAA2B"}
|
|
@@ -15,7 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./GeoJsonRouter"), exports);
|
|
18
|
-
__exportStar(require("./HistoryRouter"), exports);
|
|
19
|
-
__exportStar(require("./RouterBuilder"), exports);
|
|
20
18
|
__exportStar(require("./interfaces/IGeoJsonAllFilterParameters"), exports);
|
|
21
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/routes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/routes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2EAAyD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6-dev.837110606",
|
|
4
4
|
"description": "Golemio Core Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@abraham/reflection": "^0.10.0",
|
|
73
73
|
"@azure/storage-blob": "^12.11.0",
|
|
74
74
|
"@golemio/errors": "1.1.1",
|
|
75
|
-
"@golemio/validator": "0.3.
|
|
75
|
+
"@golemio/validator": "0.3.2-dev.833945190",
|
|
76
76
|
"@google-cloud/storage": "^5.18.0",
|
|
77
77
|
"@opentelemetry/api": "1.0.4",
|
|
78
78
|
"@opentelemetry/exporter-jaeger": "^1.2.0",
|
|
@@ -113,9 +113,6 @@
|
|
|
113
113
|
"lightship": "^6.7.2",
|
|
114
114
|
"luxon": "^2.5.2",
|
|
115
115
|
"moment-timezone": "^0.5.26",
|
|
116
|
-
"mongodb-restore-dump": "1.0.1",
|
|
117
|
-
"mongoose": "^6.6.5",
|
|
118
|
-
"opentelemetry-instrumentation-mongoose": "^0.27.1",
|
|
119
116
|
"opentelemetry-instrumentation-sequelize": "^0.27.1",
|
|
120
117
|
"path-to-regexp": "^6.2.0",
|
|
121
118
|
"pg": "^8.6.0",
|
|
@@ -135,5 +132,7 @@
|
|
|
135
132
|
"xml2js-es6-promise": "^1.1.1",
|
|
136
133
|
"yauzl": "^2.10.0"
|
|
137
134
|
},
|
|
138
|
-
"overrides": {
|
|
139
|
-
|
|
135
|
+
"overrides": {
|
|
136
|
+
"xml2js": "0.5.0"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ILogger } from "../../helpers";
|
|
2
|
-
import { IConfiguration } from "../config";
|
|
3
|
-
import mongoose from "mongoose";
|
|
4
|
-
import { Disposable } from "tsyringe";
|
|
5
|
-
import { IMongoConnector } from "./interfaces/IMongoConnector";
|
|
6
|
-
export declare class MongoConnector implements IMongoConnector, Disposable {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private mongoConn;
|
|
9
|
-
constructor(config: IConfiguration, log: ILogger);
|
|
10
|
-
connect: () => Promise<mongoose.Connection>;
|
|
11
|
-
getConnection: () => mongoose.Connection;
|
|
12
|
-
isConnected: () => Promise<boolean>;
|
|
13
|
-
disconnect: () => Promise<void>;
|
|
14
|
-
dispose: () => Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.MongoConnector = void 0;
|
|
28
|
-
const ioc_1 = require("../ioc");
|
|
29
|
-
const errors_1 = require("@golemio/errors");
|
|
30
|
-
const mongoose_1 = __importDefault(require("mongoose"));
|
|
31
|
-
const tsyringe_1 = require("tsyringe");
|
|
32
|
-
let MongoConnector = class MongoConnector {
|
|
33
|
-
constructor(config, log) {
|
|
34
|
-
this.log = log;
|
|
35
|
-
this.connect = () => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
try {
|
|
37
|
-
if (!this.mongoConn) {
|
|
38
|
-
throw new errors_1.CustomError("The ENV variable MONGO_CONN cannot be undefined.", true, this.constructor.name, 6003);
|
|
39
|
-
}
|
|
40
|
-
const connectOptions = {
|
|
41
|
-
bufferCommands: false,
|
|
42
|
-
connectTimeoutMS: 90000,
|
|
43
|
-
socketTimeoutMS: 90000,
|
|
44
|
-
};
|
|
45
|
-
yield mongoose_1.default.connect(this.mongoConn, connectOptions);
|
|
46
|
-
mongoose_1.default.connection.on("disconnected", () => {
|
|
47
|
-
this.log.error("MongoDB disconnected!");
|
|
48
|
-
});
|
|
49
|
-
mongoose_1.default.connection.on("reconnected", () => {
|
|
50
|
-
this.log.warn("MongoDB reconnected after connection lost.");
|
|
51
|
-
});
|
|
52
|
-
mongoose_1.default.connection.on("error", (err) => {
|
|
53
|
-
this.log.error(err);
|
|
54
|
-
});
|
|
55
|
-
this.log.info("Connected to MongoDB!");
|
|
56
|
-
return mongoose_1.default.connection;
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
this.log.error("Could not connect to " + this.mongoConn);
|
|
60
|
-
throw new errors_1.CustomError("Error while connecting to MongoDB.", false, this.constructor.name, 1001, err);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
this.getConnection = () => {
|
|
64
|
-
if (mongoose_1.default.connection.readyState !== 1) {
|
|
65
|
-
throw new errors_1.CustomError("Mongoose connection does not exist. First call connect() method.", false, this.constructor.name, 1002);
|
|
66
|
-
}
|
|
67
|
-
return mongoose_1.default.connection;
|
|
68
|
-
};
|
|
69
|
-
this.isConnected = () => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
return mongoose_1.default.connection.readyState === 1;
|
|
71
|
-
});
|
|
72
|
-
this.disconnect = () => __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
this.log.info("MongoDB disconnect called");
|
|
74
|
-
return mongoose_1.default.connection.close();
|
|
75
|
-
});
|
|
76
|
-
this.dispose = () => __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
yield this.disconnect();
|
|
78
|
-
});
|
|
79
|
-
this.mongoConn = config.MONGO_CONN;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
MongoConnector = __decorate([
|
|
83
|
-
(0, tsyringe_1.injectable)(),
|
|
84
|
-
__param(0, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Config)),
|
|
85
|
-
__param(1, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Logger)),
|
|
86
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
87
|
-
], MongoConnector);
|
|
88
|
-
exports.MongoConnector = MongoConnector;
|
|
89
|
-
//# sourceMappingURL=MongoConnector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongoConnector.js","sourceRoot":"","sources":["../../../src/integration-engine/connectors/MongoConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gCAAyC;AACzC,4CAA8C;AAC9C,wDAAoD;AACpD,uCAA0D;AAI1D,IAAa,cAAc,GAA3B,MAAa,cAAc;IAGvB,YACmC,MAAsB,EACL,GAAY;QAAZ,QAAG,GAAH,GAAG,CAAS;QAKzD,YAAO,GAAG,GAAuC,EAAE;YACtD,IAAI;gBACA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;oBACjB,MAAM,IAAI,oBAAW,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U,KAAK,CAAC,EAAE;gBACtC,MAAM,IAAI,oBAAW,CACjB,kEAAkE,EAClE,KAAK,EACL,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,IAAI,CACP,CAAC;aACL;YACD,OAAO,kBAAQ,CAAC,UAAU,CAAC;QAC/B,CAAC,CAAC;QAEK,gBAAW,GAAG,GAA2B,EAAE;YAC9C,OAAO,kBAAQ,CAAC,UAAU,CAAC,UAAU,KAAK,CAAC,CAAC;QAChD,CAAC,CAAA,CAAC;QAEK,eAAU,GAAG,GAAwB,EAAE;YAC1C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;YAC3C,OAAO,kBAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACvC,CAAC,CAAA,CAAC;QAEK,YAAO,GAAG,GAAwB,EAAE;YACvC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5B,CAAC,CAAA,CAAC;QA3DE,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;IACvC,CAAC;CA2DJ,CAAA;AAnEY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;;GALzB,cAAc,CAmE1B;AAnEY,wCAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IMongoConnector.js","sourceRoot":"","sources":["../../../../src/integration-engine/connectors/interfaces/IMongoConnector.ts"],"names":[],"mappings":""}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IModel, IMongooseSettings } from "./";
|
|
2
|
-
import { Validator } from "@golemio/validator";
|
|
3
|
-
import mongoose from "mongoose";
|
|
4
|
-
export declare class MongoModel implements IModel {
|
|
5
|
-
/** Model name */
|
|
6
|
-
name: string;
|
|
7
|
-
/** The schema which contains schemaObject for creating the Mongoose Schema */
|
|
8
|
-
protected schema: mongoose.Schema;
|
|
9
|
-
/** The Mongoose Model */
|
|
10
|
-
protected mongooseModel: mongoose.Model<any>;
|
|
11
|
-
/** The Mongoose Model for temporary collection */
|
|
12
|
-
protected tmpMongooseModel?: mongoose.Model<any>;
|
|
13
|
-
/** Validation helper */
|
|
14
|
-
protected validator: Validator;
|
|
15
|
-
/** Path where to look for ID - identifier to search by */
|
|
16
|
-
protected searchPath: Function;
|
|
17
|
-
/** Path to the sub-property which contains the identifier (separated by dot), e.g. "properties.id" */
|
|
18
|
-
protected identifierPath: string;
|
|
19
|
-
/** Path to the sub-property which contains the results (separated by dot), e.g. "properties" */
|
|
20
|
-
protected resultsPath: string;
|
|
21
|
-
/** String to specify selection of DB query. */
|
|
22
|
-
protected select: string;
|
|
23
|
-
/** Type/Strategy of saving the data */
|
|
24
|
-
protected savingType: "readOnly" | "insertOnly" | "insertOrUpdate";
|
|
25
|
-
/** Function to specify which values can be updated */
|
|
26
|
-
protected updateValues: ((dbData: any, newData: any) => any) | null;
|
|
27
|
-
constructor(name: string, settings: IMongooseSettings, validator: Validator);
|
|
28
|
-
save: (data: any, useTmpTable?: boolean) => Promise<any>;
|
|
29
|
-
updateOne: (opts: any, data: any, useTmpTable?: boolean) => Promise<any>;
|
|
30
|
-
updateOneById: (id: any, data: any, useTmpTable?: boolean) => Promise<any>;
|
|
31
|
-
truncate: (useTmpTable?: boolean) => Promise<any>;
|
|
32
|
-
delete: (opts: object, useTmpTable?: boolean) => Promise<any>;
|
|
33
|
-
find: (opts: object, useTmpTable?: boolean) => Promise<any>;
|
|
34
|
-
findOne: (opts: object, useTmpTable?: boolean) => Promise<any>;
|
|
35
|
-
findOneById: (id: string | number, useTmpTable?: boolean) => Promise<any>;
|
|
36
|
-
aggregate: (aggregation: any[], useTmpTable?: boolean) => Promise<any>;
|
|
37
|
-
replaceOrigCollectionByTempCollection: () => Promise<void>;
|
|
38
|
-
private insertOnly;
|
|
39
|
-
private insertOrUpdate;
|
|
40
|
-
private insertOrUpdateOne;
|
|
41
|
-
private getMongooseModelSafely;
|
|
42
|
-
}
|