@golemio/city-districts 1.1.0 → 1.2.0-dev.775903079
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/db/example/.config.json +3 -0
- package/db/example/citydistricts.sql +15 -0
- package/dist/integration-engine/datasources/CityDistrictsDataSource.d.ts +4 -0
- package/dist/integration-engine/datasources/CityDistrictsDataSource.js +18 -0
- package/dist/integration-engine/datasources/CityDistrictsDataSource.js.map +1 -0
- package/dist/integration-engine/datasources/index.d.ts +1 -0
- package/dist/integration-engine/datasources/index.js +19 -0
- package/dist/integration-engine/datasources/index.js.map +1 -0
- package/dist/integration-engine/index.d.ts +2 -5
- package/dist/integration-engine/index.js +4 -5
- package/dist/integration-engine/index.js.map +1 -1
- package/dist/integration-engine/repositories/CityDistrictMongoRepository.d.ts +5 -0
- package/dist/integration-engine/repositories/CityDistrictMongoRepository.js +26 -0
- package/dist/integration-engine/repositories/CityDistrictMongoRepository.js.map +1 -0
- package/dist/integration-engine/repositories/CityDistrictPostgresRepository.d.ts +7 -0
- package/dist/integration-engine/{models/CityDistrictModel.js → repositories/CityDistrictPostgresRepository.js} +17 -12
- package/dist/integration-engine/repositories/CityDistrictPostgresRepository.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/{CityDistrictsMongoTransformation.d.ts → transformations/CityDistrictsMongoTransformation.d.ts} +0 -0
- package/dist/integration-engine/{CityDistrictsMongoTransformation.js → transformations/CityDistrictsMongoTransformation.js} +2 -2
- package/dist/integration-engine/transformations/CityDistrictsMongoTransformation.js.map +1 -0
- package/dist/integration-engine/{CityDistrictsPostgresTransformation.d.ts → transformations/CityDistrictsPostgresTransformation.d.ts} +2 -1
- package/dist/integration-engine/{CityDistrictsPostgresTransformation.js → transformations/CityDistrictsPostgresTransformation.js} +2 -2
- package/dist/integration-engine/transformations/CityDistrictsPostgresTransformation.js.map +1 -0
- package/dist/integration-engine/transformations/index.d.ts +2 -0
- package/dist/integration-engine/transformations/index.js +20 -0
- package/dist/integration-engine/transformations/index.js.map +1 -0
- package/dist/integration-engine/workers/CityDistrictsWorker.d.ts +5 -0
- package/dist/integration-engine/workers/CityDistrictsWorker.js +15 -0
- package/dist/integration-engine/workers/CityDistrictsWorker.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/RefreshDataInDBTask.d.ts +12 -0
- package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js +43 -0
- package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js.map +1 -0
- package/dist/integration-engine/workers/tasks/index.d.ts +1 -0
- package/dist/integration-engine/workers/tasks/index.js +19 -0
- package/dist/integration-engine/workers/tasks/index.js.map +1 -0
- package/dist/output-gateway/CityDistrictsMongoRouter.d.ts +8 -0
- package/dist/output-gateway/CityDistrictsMongoRouter.js +15 -0
- package/dist/output-gateway/CityDistrictsMongoRouter.js.map +1 -0
- package/dist/output-gateway/CityDistrictsPostgresRouter.d.ts +8 -0
- package/dist/output-gateway/CityDistrictsPostgresRouter.js +15 -0
- package/dist/output-gateway/CityDistrictsPostgresRouter.js.map +1 -0
- package/dist/output-gateway/index.d.ts +3 -2
- package/dist/output-gateway/index.js +3 -2
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/{CityDistrictsModel.d.ts → repositories/CityDistrictsMongoRepository.d.ts} +1 -4
- package/dist/output-gateway/repositories/CityDistrictsMongoRepository.js +17 -0
- package/dist/output-gateway/repositories/CityDistrictsMongoRepository.js.map +1 -0
- package/dist/output-gateway/repositories/CityDistrictsPostgresRepository.d.ts +27 -0
- package/dist/output-gateway/repositories/CityDistrictsPostgresRepository.js +88 -0
- package/dist/output-gateway/repositories/CityDistrictsPostgresRepository.js.map +1 -0
- package/dist/output-gateway/repositories/index.d.ts +2 -0
- package/dist/output-gateway/repositories/index.js +20 -0
- package/dist/output-gateway/repositories/index.js.map +1 -0
- package/dist/schema-definitions/datasources/CityDistrictsJsonSchema.d.ts +25 -0
- package/dist/schema-definitions/datasources/CityDistrictsJsonSchema.js +45 -0
- package/dist/schema-definitions/datasources/CityDistrictsJsonSchema.js.map +1 -0
- package/dist/schema-definitions/index.d.ts +1 -43
- package/dist/schema-definitions/index.js +5 -81
- package/dist/schema-definitions/index.js.map +1 -1
- package/dist/schema-definitions/interfaces/CityDistricts.d.ts +21 -0
- package/dist/schema-definitions/interfaces/CityDistricts.js +3 -0
- package/dist/schema-definitions/interfaces/CityDistricts.js.map +1 -0
- package/dist/schema-definitions/models/CityDistrictModel.d.ts +27 -0
- package/dist/schema-definitions/models/CityDistrictModel.js +87 -0
- package/dist/schema-definitions/models/CityDistrictModel.js.map +1 -0
- package/package.json +11 -6
- package/dist/integration-engine/CityDistrictsMongoTransformation.js.map +0 -1
- package/dist/integration-engine/CityDistrictsPostgresTransformation.js.map +0 -1
- package/dist/integration-engine/CityDistrictsWorker.d.ts +0 -10
- package/dist/integration-engine/CityDistrictsWorker.js +0 -60
- package/dist/integration-engine/CityDistrictsWorker.js.map +0 -1
- package/dist/integration-engine/models/CityDistrictModel.d.ts +0 -5
- package/dist/integration-engine/models/CityDistrictModel.js.map +0 -1
- package/dist/integration-engine/queueDefinitions.d.ts +0 -3
- package/dist/integration-engine/queueDefinitions.js +0 -26
- package/dist/integration-engine/queueDefinitions.js.map +0 -1
- package/dist/output-gateway/CityDistrictsModel.js +0 -20
- package/dist/output-gateway/CityDistrictsModel.js.map +0 -1
- package/dist/output-gateway/CityDistrictsRouter.d.ts +0 -14
- package/dist/output-gateway/CityDistrictsRouter.js +0 -21
- package/dist/output-gateway/CityDistrictsRouter.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CityDistrictsDataSourceFactory = void 0;
|
|
4
|
+
const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
|
|
5
|
+
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
6
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
7
|
+
const _sch_1 = require("../../schema-definitions");
|
|
8
|
+
class CityDistrictsDataSourceFactory {
|
|
9
|
+
static getDataSource() {
|
|
10
|
+
return new datasources_1.DataSource(_sch_1.CityDistricts.name + "DataSource", new datasources_1.HTTPProtocolStrategy({
|
|
11
|
+
headers: {},
|
|
12
|
+
method: "GET",
|
|
13
|
+
url: config_1.config.datasources.CityDistricts,
|
|
14
|
+
}), new datasources_1.JSONDataTypeStrategy({ resultsPath: "features" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.CityDistricts.name + "DataSourceValidator", _sch_1.CityDistricts.datasourceJsonSchema));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CityDistrictsDataSourceFactory = CityDistrictsDataSourceFactory;
|
|
18
|
+
//# sourceMappingURL=CityDistrictsDataSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsDataSource.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/CityDistrictsDataSource.ts"],"names":[],"mappings":";;;AAAA,mFAA2H;AAC3H,yEAAsE;AACtE,mFAAkF;AAClF,mDAAqC;AAErC,MAAa,8BAA8B;IAChC,MAAM,CAAC,aAAa;QACvB,OAAO,IAAI,wBAAU,CACjB,oBAAa,CAAC,IAAI,GAAG,YAAY,EACjC,IAAI,kCAAoB,CAAC;YACrB,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,eAAM,CAAC,WAAW,CAAC,aAAa;SACxC,CAAC,EACF,IAAI,kCAAoB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,EACrD,IAAI,uCAAmB,CAAC,oBAAa,CAAC,IAAI,GAAG,qBAAqB,EAAE,oBAAa,CAAC,oBAAoB,CAAC,CAC1G,CAAC;IACN,CAAC;CACJ;AAbD,wEAaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CityDistrictsDataSource";
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
/* ie/datasources/index.ts */
|
|
18
|
+
__exportStar(require("./CityDistrictsDataSource"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,4DAA0C"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export
|
|
3
|
-
export * from "./CityDistrictsWorker";
|
|
4
|
-
export * from "./queueDefinitions";
|
|
5
|
-
export * from "./models/CityDistrictModel";
|
|
1
|
+
export * from "./transformations";
|
|
2
|
+
export { workers } from "./workers";
|
|
@@ -14,10 +14,9 @@ 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.workers = void 0;
|
|
17
18
|
/* ie/index.ts */
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__exportStar(require("./queueDefinitions"), exports);
|
|
22
|
-
__exportStar(require("./models/CityDistrictModel"), exports);
|
|
19
|
+
__exportStar(require("./transformations"), exports);
|
|
20
|
+
var workers_1 = require("./workers");
|
|
21
|
+
Object.defineProperty(exports, "workers", { enumerable: true, get: function () { return workers_1.workers; } });
|
|
23
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,oDAAkC;AAElC,qCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
4
|
+
const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
5
|
+
const _sch_1 = require("../../schema-definitions");
|
|
6
|
+
class CityDistrictsMongoRepository extends models_1.MongoModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(_sch_1.CityDistricts.name + "Model", {
|
|
9
|
+
identifierPath: "properties.id",
|
|
10
|
+
mongoCollectionName: _sch_1.CityDistricts.mongoCollectionName,
|
|
11
|
+
outputMongooseSchemaObject: _sch_1.CityDistricts.outputMongooseSchemaObject,
|
|
12
|
+
resultsPath: "properties",
|
|
13
|
+
savingType: "insertOrUpdate",
|
|
14
|
+
searchPath: (id, multiple) => (multiple ? { "properties.id": { $in: id } } : { "properties.id": id }),
|
|
15
|
+
updateValues: (a, b) => {
|
|
16
|
+
a.geometry.coordinates = b.geometry.coordinates;
|
|
17
|
+
a.properties.name = b.properties.name;
|
|
18
|
+
a.properties.slug = b.properties.slug;
|
|
19
|
+
a.properties.updated_at = b.properties.updated_at;
|
|
20
|
+
return a;
|
|
21
|
+
},
|
|
22
|
+
}, new golemio_validator_1.Validator(_sch_1.CityDistricts.name + "ModelValidator", _sch_1.CityDistricts.outputMongooseSchemaObject));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = CityDistrictsMongoRepository;
|
|
26
|
+
//# sourceMappingURL=CityDistrictMongoRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictMongoRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/CityDistrictMongoRepository.ts"],"names":[],"mappings":";;AACA,mFAAwE;AACxE,yEAA0E;AAC1E,mDAAqC;AAErC,MAAqB,4BAA6B,SAAQ,mBAAU;IAChE;QACI,KAAK,CACD,oBAAa,CAAC,IAAI,GAAG,OAAO,EAC5B;YACI,cAAc,EAAE,eAAe;YAC/B,mBAAmB,EAAE,oBAAa,CAAC,mBAAmB;YACtD,0BAA0B,EAAE,oBAAa,CAAC,0BAA0B;YACpE,WAAW,EAAE,YAAY;YACzB,UAAU,EAAE,gBAAgB;YAC5B,UAAU,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC;YACrG,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACnB,CAAC,CAAC,QAAQ,CAAC,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAChD,CAAC,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;gBACtC,CAAC,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;gBACtC,CAAC,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;gBAClD,OAAO,CAAC,CAAC;YACb,CAAC;SACJ,EACD,IAAI,6BAAS,CAAC,oBAAa,CAAC,IAAI,GAAG,gBAAgB,EAAE,oBAAa,CAAC,0BAA0B,CAAC,CACjG,CAAC;IACN,CAAC;CACJ;AAtBD,+CAsBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
import { ICityDistricts } from "../../schema-definitions/interfaces/CityDistricts";
|
|
3
|
+
export default class CityDistrictsPostgresRepository extends PostgresModel implements IModel {
|
|
4
|
+
constructor();
|
|
5
|
+
getDistrict: (longitude: number, latitude: number) => Promise<string>;
|
|
6
|
+
bulkUpdate: (data: ICityDistricts[]) => Promise<void>;
|
|
7
|
+
}
|
|
@@ -14,19 +14,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
16
16
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
17
|
-
const
|
|
17
|
+
const _sch_1 = require("../../schema-definitions");
|
|
18
18
|
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
19
|
-
|
|
19
|
+
const CityDistrictModel_1 = require("../../schema-definitions/models/CityDistrictModel");
|
|
20
|
+
class CityDistrictsPostgresRepository extends integration_engine_1.PostgresModel {
|
|
20
21
|
constructor() {
|
|
21
|
-
super(
|
|
22
|
-
outputSequelizeAttributes:
|
|
23
|
-
pgTableName:
|
|
22
|
+
super(_sch_1.CityDistricts.name + "Repository", {
|
|
23
|
+
outputSequelizeAttributes: CityDistrictModel_1.CityDistrictModel.attributeModel,
|
|
24
|
+
pgTableName: _sch_1.CityDistricts.pgTableName,
|
|
25
|
+
pgSchema: _sch_1.CityDistricts.pgSchema,
|
|
24
26
|
savingType: "insertOrUpdate",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
timestamps: false,
|
|
28
|
-
},
|
|
29
|
-
}, new golemio_validator_1.Validator(schema_definitions_1.CityDistricts.name + "ModelPGValidator", schema_definitions_1.CityDistricts.postgres.outputMongooseSchemaObject));
|
|
27
|
+
sequelizeAdditionalSettings: { timestamps: false },
|
|
28
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.CityDistricts.name + "Validator", CityDistrictModel_1.CityDistrictModel.jsonSchema));
|
|
30
29
|
this.getDistrict = (longitude, latitude) => __awaiter(this, void 0, void 0, function* () {
|
|
31
30
|
var _a;
|
|
32
31
|
const result = yield this.findOne({
|
|
@@ -34,7 +33,13 @@ class CityDistrictsModel extends integration_engine_1.PostgresModel {
|
|
|
34
33
|
});
|
|
35
34
|
return result ? (_a = result.dataValues.district_name_slug) !== null && _a !== void 0 ? _a : result.dataValues.district_name : null;
|
|
36
35
|
});
|
|
36
|
+
this.bulkUpdate = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
yield this.validate(data);
|
|
38
|
+
yield this.sequelizeModel.bulkCreate(data, {
|
|
39
|
+
updateOnDuplicate: CityDistrictModel_1.CityDistrictModel.updateAttributes,
|
|
40
|
+
});
|
|
41
|
+
});
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
|
-
exports.default =
|
|
40
|
-
//# sourceMappingURL=
|
|
44
|
+
exports.default = CityDistrictsPostgresRepository;
|
|
45
|
+
//# sourceMappingURL=CityDistrictPostgresRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictPostgresRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/CityDistrictPostgresRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8EAA8E;AAC9E,mFAAkF;AAClF,mDAAqC;AACrC,oFAA4D;AAC5D,yFAAkE;AAGlE,MAAqB,+BAAgC,SAAQ,kCAAa;IACtE;QACI,KAAK,CACD,oBAAa,CAAC,IAAI,GAAG,YAAY,EACjC;YACI,yBAAyB,EAAE,qCAAiB,CAAC,cAAc;YAC3D,WAAW,EAAE,oBAAa,CAAC,WAAW;YACtC,QAAQ,EAAE,oBAAa,CAAC,QAAQ;YAChC,UAAU,EAAE,gBAAgB;YAC5B,2BAA2B,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;SACrD,EACD,IAAI,uCAAmB,CAAC,oBAAa,CAAC,IAAI,GAAG,WAAW,EAAE,qCAAiB,CAAC,UAAU,CAAC,CAC1F,CAAC;QAGC,gBAAW,GAAG,CAAO,SAAiB,EAAE,QAAgB,EAAmB,EAAE;;YAChF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;gBAC9B,KAAK,EAAE,mBAAS,CAAC,EAAE,CACf,eAAe,EACf,mBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EACrB,mBAAS,CAAC,EAAE,CAAC,YAAY,EAAE,mBAAS,CAAC,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,CACtF;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,CAAC,CAAC,MAAA,MAAM,CAAC,UAAU,CAAC,kBAAkB,mCAAI,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;QACnG,CAAC,CAAA,CAAC;QAEK,eAAU,GAAG,CAAO,IAAsB,EAAE,EAAE;YACjD,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1B,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAoB,IAAI,EAAE;gBAC1D,iBAAiB,EAAE,qCAAiB,CAAC,gBAAgB;aACxD,CAAC,CAAC;QACP,CAAC,CAAA,CAAC;IAnBF,CAAC;CAoBJ;AAjCD,kDAiCC"}
|
|
@@ -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
|
+
/* ie/repositories/index.ts */
|
|
18
|
+
__exportStar(require("./CityDistrictMongoRepository"), exports);
|
|
19
|
+
__exportStar(require("./CityDistrictPostgresRepository"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,gEAA8C;AAC9C,mEAAiD"}
|
|
File without changes
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.CityDistrictsMongoTransformation = void 0;
|
|
16
16
|
const slugify_1 = __importDefault(require("slugify"));
|
|
17
17
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
18
|
-
const
|
|
18
|
+
const _sch_1 = require("../../schema-definitions");
|
|
19
19
|
class CityDistrictsMongoTransformation extends integration_engine_1.BaseTransformation {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
@@ -34,7 +34,7 @@ class CityDistrictsMongoTransformation extends integration_engine_1.BaseTransfor
|
|
|
34
34
|
type: element.type,
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
|
-
this.name =
|
|
37
|
+
this.name = _sch_1.CityDistricts.name;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
exports.CityDistrictsMongoTransformation = CityDistrictsMongoTransformation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsMongoTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/CityDistrictsMongoTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA2B;AAC3B,8EAA4F;AAC5F,mDAAqC;AAErC,MAAa,gCAAiC,SAAQ,uCAAkB;IAGpE;QACI,KAAK,EAAE,CAAC;QAIF,qBAAgB,GAAG,CAAO,OAAY,EAAgB,EAAE;YAC9D,OAAO;gBACH,QAAQ,EAAE;oBACN,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW;oBACzC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;iBAC9B;gBACD,UAAU,EAAE;oBACR,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;oBAC3C,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;oBACjC,IAAI,EAAE,IAAA,iBAAI,EAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;oBAClF,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;iBACnC;gBACD,IAAI,EAAE,OAAO,CAAC,IAAI;aACrB,CAAC;QACN,CAAC,CAAA,CAAC;QAjBE,IAAI,CAAC,IAAI,GAAG,oBAAa,CAAC,IAAI,CAAC;IACnC,CAAC;CAiBJ;AAvBD,4EAuBC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
import { ICityDistricts } from "../../schema-definitions/interfaces/CityDistricts";
|
|
2
3
|
export declare class CityDistrictsPostgresTransformation extends BaseTransformation implements ITransformation {
|
|
3
4
|
name: string;
|
|
4
5
|
constructor();
|
|
5
|
-
protected transformElement: (element: any) => Promise<
|
|
6
|
+
protected transformElement: (element: any) => Promise<ICityDistricts>;
|
|
6
7
|
}
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CityDistrictsPostgresTransformation = void 0;
|
|
16
|
-
const
|
|
16
|
+
const _sch_1 = require("../../schema-definitions");
|
|
17
17
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
18
18
|
const slugify_1 = __importDefault(require("slugify"));
|
|
19
19
|
class CityDistrictsPostgresTransformation extends integration_engine_1.BaseTransformation {
|
|
@@ -46,7 +46,7 @@ class CityDistrictsPostgresTransformation extends integration_engine_1.BaseTrans
|
|
|
46
46
|
district_name_slug: (0, slugify_1.default)(element.properties.NAZEV_MC, { lower: true, remove: /[*+~.()'"!:@]/g }),
|
|
47
47
|
};
|
|
48
48
|
});
|
|
49
|
-
this.name =
|
|
49
|
+
this.name = _sch_1.CityDistricts.name;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
exports.CityDistrictsPostgresTransformation = CityDistrictsPostgresTransformation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsPostgresTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/CityDistrictsPostgresTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAqC;AACrC,8EAA4F;AAC5F,sDAA2B;AAG3B,MAAa,mCAAoC,SAAQ,uCAAkB;IAGvE;QACI,KAAK,EAAE,CAAC;QAIF,qBAAgB,GAAG,CAAO,OAAY,EAA2B,EAAE;YACzE,OAAO;gBACH,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;gBAC/B,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACzC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBAC5C,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACzC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;gBAC1C,mBAAmB,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBAC/C,IAAI,kCACG,OAAO,CAAC,QAAQ,KACnB,GAAG,EAAE;wBACD,UAAU,EAAE;4BACR,IAAI,EAAE,WAAW;yBACpB;wBACD,IAAI,EAAE,MAAM;qBACf,GACJ;gBACD,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE;gBACzB,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACzC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;gBACjC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;gBACjC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;gBACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;gBACnC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBACzC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY;gBAC7C,oBAAoB,EAAE,OAAO,CAAC,UAAU,CAAC,oBAAoB;gBAC7D,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;gBAC9B,kBAAkB,EAAE,IAAA,iBAAI,EAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;aACnG,CAAC;QACN,CAAC,CAAA,CAAC;QAhCE,IAAI,CAAC,IAAI,GAAG,oBAAa,CAAC,IAAI,CAAC;IACnC,CAAC;CAgCJ;AAtCD,kFAsCC"}
|
|
@@ -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
|
+
/* ie/transformations/index.ts */
|
|
18
|
+
__exportStar(require("./CityDistrictsMongoTransformation"), exports);
|
|
19
|
+
__exportStar(require("./CityDistrictsPostgresTransformation"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,qEAAmD;AACnD,wEAAsD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CityDistrictsWorker = void 0;
|
|
4
|
+
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
5
|
+
const RefreshDataInDBTask_1 = require("./tasks/RefreshDataInDBTask");
|
|
6
|
+
const _sch_1 = require("../../schema-definitions");
|
|
7
|
+
class CityDistrictsWorker extends workers_1.AbstractWorker {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.name = _sch_1.CityDistricts.name;
|
|
11
|
+
this.registerTask(new RefreshDataInDBTask_1.RefreshDataInDBTask(this.getQueuePrefix()));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.CityDistrictsWorker = CityDistrictsWorker;
|
|
15
|
+
//# sourceMappingURL=CityDistrictsWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsWorker.js","sourceRoot":"","sources":["../../../src/integration-engine/workers/CityDistrictsWorker.ts"],"names":[],"mappings":";;;AAAA,2EAA+E;AAC/E,qEAA4E;AAC5E,mDAAqC;AAErC,MAAa,mBAAoB,SAAQ,wBAAc;IAGnD;QACI,KAAK,EAAE,CAAC;QAHO,SAAI,GAAG,oBAAa,CAAC,IAAI,CAAC;QAIzC,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;CACJ;AAPD,kDAOC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workers = void 0;
|
|
4
|
+
const CityDistrictsWorker_1 = require("./CityDistrictsWorker");
|
|
5
|
+
exports.workers = [CityDistrictsWorker_1.CityDistrictsWorker];
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/workers/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAE/C,QAAA,OAAO,GAAG,CAAC,yCAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
export declare class RefreshDataInDBTask extends AbstractEmptyTask {
|
|
3
|
+
readonly queueName = "refreshDataInDB";
|
|
4
|
+
readonly queueTtl: number;
|
|
5
|
+
private dataSource;
|
|
6
|
+
private mongoTransformation;
|
|
7
|
+
private mongoRepository;
|
|
8
|
+
private postgresTransformation;
|
|
9
|
+
private postgresRepository;
|
|
10
|
+
constructor(queuePrefix: string);
|
|
11
|
+
protected execute(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RefreshDataInDBTask = void 0;
|
|
16
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
17
|
+
const _ie_1 = require("../..");
|
|
18
|
+
const CityDistrictPostgresRepository_1 = __importDefault(require("../../repositories/CityDistrictPostgresRepository"));
|
|
19
|
+
const datasources_1 = require("../../datasources");
|
|
20
|
+
const CityDistrictMongoRepository_1 = __importDefault(require("../../repositories/CityDistrictMongoRepository"));
|
|
21
|
+
class RefreshDataInDBTask extends integration_engine_1.AbstractEmptyTask {
|
|
22
|
+
constructor(queuePrefix) {
|
|
23
|
+
super(queuePrefix);
|
|
24
|
+
this.queueName = "refreshDataInDB";
|
|
25
|
+
this.queueTtl = 15 * 24 * 60 * 60 * 1000; // 15 days
|
|
26
|
+
this.dataSource = datasources_1.CityDistrictsDataSourceFactory.getDataSource();
|
|
27
|
+
this.mongoTransformation = new _ie_1.CityDistrictsMongoTransformation();
|
|
28
|
+
this.mongoRepository = new CityDistrictMongoRepository_1.default();
|
|
29
|
+
this.postgresRepository = new CityDistrictPostgresRepository_1.default();
|
|
30
|
+
this.postgresTransformation = new _ie_1.CityDistrictsPostgresTransformation();
|
|
31
|
+
}
|
|
32
|
+
execute() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const data = yield this.dataSource.getAll();
|
|
35
|
+
const transformedData = yield this.mongoTransformation.transform(data);
|
|
36
|
+
const transformedPostgresData = yield this.postgresTransformation.transform(data);
|
|
37
|
+
yield this.mongoRepository.save(transformedData);
|
|
38
|
+
yield this.postgresRepository.bulkUpdate(transformedPostgresData);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.RefreshDataInDBTask = RefreshDataInDBTask;
|
|
43
|
+
//# sourceMappingURL=RefreshDataInDBTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshDataInDBTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/RefreshDataInDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8EAA0E;AAE1E,+BAA4F;AAE5F,uHAA8F;AAC9F,mDAAiE;AACjE,iHAAwF;AAExF,MAAa,mBAAoB,SAAQ,sCAAiB;IAUtD,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,iBAAiB,CAAC;QAC9B,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,UAAU;QAU3D,IAAI,CAAC,UAAU,GAAG,4CAA8B,CAAC,aAAa,EAAE,CAAC;QACjE,IAAI,CAAC,mBAAmB,GAAG,IAAI,sCAAgC,EAAE,CAAC;QAClE,IAAI,CAAC,eAAe,GAAG,IAAI,qCAA4B,EAAE,CAAC;QAC1D,IAAI,CAAC,kBAAkB,GAAG,IAAI,wCAA+B,EAAE,CAAC;QAChE,IAAI,CAAC,sBAAsB,GAAG,IAAI,yCAAmC,EAAE,CAAC;IAC5E,CAAC;IAEe,OAAO;;YACnB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC5C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACvE,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAClF,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACjD,MAAM,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;QACtE,CAAC;KAAA;CACJ;AA1BD,kDA0BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RefreshDataInDBTask";
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
/* ie/workers/tasks/index.ts */
|
|
18
|
+
__exportStar(require("./RefreshDataInDBTask"), exports);
|
|
19
|
+
//# 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,+BAA+B;AAC/B,wDAAsC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="express" />
|
|
2
|
+
import { Router } from "@golemio/core/dist/shared/express";
|
|
3
|
+
import { GeoJsonRouter } from "@golemio/core/dist/output-gateway";
|
|
4
|
+
export declare class CityDistrictsMongoRouter extends GeoJsonRouter {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
declare const cityDistrictsMongoRouter: Router;
|
|
8
|
+
export { cityDistrictsMongoRouter };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cityDistrictsMongoRouter = exports.CityDistrictsMongoRouter = void 0;
|
|
4
|
+
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
5
|
+
const repositories_1 = require("./repositories");
|
|
6
|
+
class CityDistrictsMongoRouter extends output_gateway_1.GeoJsonRouter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(new repositories_1.CityDistrictsMongoRepository());
|
|
9
|
+
this.initRoutes();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.CityDistrictsMongoRouter = CityDistrictsMongoRouter;
|
|
13
|
+
const cityDistrictsMongoRouter = new CityDistrictsMongoRouter().router;
|
|
14
|
+
exports.cityDistrictsMongoRouter = cityDistrictsMongoRouter;
|
|
15
|
+
//# sourceMappingURL=CityDistrictsMongoRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsMongoRouter.js","sourceRoot":"","sources":["../../src/output-gateway/CityDistrictsMongoRouter.ts"],"names":[],"mappings":";;;AACA,sEAAkE;AAClE,iDAAgE;AAEhE,MAAa,wBAAyB,SAAQ,8BAAa;IACvD;QACI,KAAK,CAAC,IAAI,2CAA4B,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CACJ;AALD,4DAKC;AAED,MAAM,wBAAwB,GAAW,IAAI,wBAAwB,EAAE,CAAC,MAAM,CAAC;AAEtE,4DAAwB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="express" />
|
|
2
|
+
import { Router } from "@golemio/core/dist/shared/express";
|
|
3
|
+
import { GeoJsonRouter } from "@golemio/core/dist/output-gateway";
|
|
4
|
+
export declare class CityDistrictsPostgresRouter extends GeoJsonRouter {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
declare const cityDistrictsPostgresRouter: Router;
|
|
8
|
+
export { cityDistrictsPostgresRouter };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cityDistrictsPostgresRouter = exports.CityDistrictsPostgresRouter = void 0;
|
|
4
|
+
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
5
|
+
const repositories_1 = require("./repositories");
|
|
6
|
+
class CityDistrictsPostgresRouter extends output_gateway_1.GeoJsonRouter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(new repositories_1.CityDistrictsPostgresRepository());
|
|
9
|
+
this.initRoutes();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.CityDistrictsPostgresRouter = CityDistrictsPostgresRouter;
|
|
13
|
+
const cityDistrictsPostgresRouter = new CityDistrictsPostgresRouter().router;
|
|
14
|
+
exports.cityDistrictsPostgresRouter = cityDistrictsPostgresRouter;
|
|
15
|
+
//# sourceMappingURL=CityDistrictsPostgresRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsPostgresRouter.js","sourceRoot":"","sources":["../../src/output-gateway/CityDistrictsPostgresRouter.ts"],"names":[],"mappings":";;;AACA,sEAAkE;AAClE,iDAAmE;AAEnE,MAAa,2BAA4B,SAAQ,8BAAa;IAC1D;QACI,KAAK,CAAC,IAAI,8CAA+B,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CACJ;AALD,kEAKC;AAED,MAAM,2BAA2B,GAAW,IAAI,2BAA2B,EAAE,CAAC,MAAM,CAAC;AAE5E,kEAA2B"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./repositories";
|
|
2
|
+
export * from "./CityDistrictsMongoRouter";
|
|
3
|
+
export * from "./CityDistrictsPostgresRouter";
|
|
@@ -14,6 +14,7 @@ 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
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./repositories"), exports);
|
|
18
|
+
__exportStar(require("./CityDistrictsMongoRouter"), exports);
|
|
19
|
+
__exportStar(require("./CityDistrictsPostgresRouter"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,6DAA2C;AAC3C,gEAA8C"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { GeoJsonModel } from "@golemio/core/dist/output-gateway";
|
|
2
|
-
export declare class
|
|
3
|
-
/**
|
|
4
|
-
* Instantiates the model according to the given schema.
|
|
5
|
-
*/
|
|
2
|
+
export declare class CityDistrictsMongoRepository extends GeoJsonModel {
|
|
6
3
|
constructor();
|
|
7
4
|
PrimaryIdentifierSelection: (inId: string) => {
|
|
8
5
|
"properties.slug": string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CityDistrictsMongoRepository = void 0;
|
|
4
|
+
const _sch_1 = require("../../schema-definitions");
|
|
5
|
+
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
6
|
+
class CityDistrictsMongoRepository extends output_gateway_1.GeoJsonModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(_sch_1.CityDistricts.name, _sch_1.CityDistricts.outputMongooseSchemaObject, _sch_1.CityDistricts.mongoCollectionName);
|
|
9
|
+
this.PrimaryIdentifierSelection = (inId) => {
|
|
10
|
+
return { "properties.slug": inId };
|
|
11
|
+
};
|
|
12
|
+
// Set model-specific indexes
|
|
13
|
+
this.schema.index({ "properties.name": "text" });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CityDistrictsMongoRepository = CityDistrictsMongoRepository;
|
|
17
|
+
//# sourceMappingURL=CityDistrictsMongoRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityDistrictsMongoRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/CityDistrictsMongoRepository.ts"],"names":[],"mappings":";;;AAAA,mDAAqC;AACrC,sEAAiE;AAEjE,MAAa,4BAA6B,SAAQ,6BAAY;IAC1D;QACI,KAAK,CAAC,oBAAa,CAAC,IAAI,EAAE,oBAAa,CAAC,0BAA0B,EAAE,oBAAa,CAAC,mBAAmB,CAAC,CAAC;QAMpG,+BAA0B,GAAG,CAAC,IAAY,EAAE,EAAE;YACjD,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;QACvC,CAAC,CAAC;QANE,6BAA6B;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAC;IACrD,CAAC;CAKJ;AAXD,oEAWC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway";
|
|
2
|
+
import { IGeoJsonModel } from "@golemio/core/dist/output-gateway/models/interfaces/IGeoJsonModel";
|
|
3
|
+
import { IGeoJsonAllFilterParameters, IGeoJSONFeatureCollection } from "@golemio/core/dist/output-gateway";
|
|
4
|
+
import { IGeoCoordinatesPolygon } from "@golemio/core/dist/output-gateway/Geo";
|
|
5
|
+
export interface ICityDistrictsOutput {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
geom: IGeoCoordinatesPolygon;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class CityDistrictsPostgresRepository extends SequelizeModel implements IGeoJsonModel {
|
|
13
|
+
constructor();
|
|
14
|
+
IsPrimaryIdNumber(): Promise<boolean>;
|
|
15
|
+
PrimaryIdentifierSelection(id: string): object;
|
|
16
|
+
GetProperties: () => Promise<never>;
|
|
17
|
+
GetAll: (options?: IGeoJsonAllFilterParameters) => Promise<IGeoJSONFeatureCollection>;
|
|
18
|
+
GetOne: (id: string) => Promise<{
|
|
19
|
+
geometry: {
|
|
20
|
+
coordinates: number[][] | (number | null)[] | number[][][] | number[][][][];
|
|
21
|
+
type: import("@golemio/core/dist/output-gateway").GeoCoordinatesType.Point | import("@golemio/core/dist/output-gateway").GeoCoordinatesType.Polygon | import("@golemio/core/dist/output-gateway").GeoCoordinatesType.MultiPolygon;
|
|
22
|
+
};
|
|
23
|
+
properties: Omit<ICityDistrictsOutput & Record<"geom", import("@golemio/core/dist/output-gateway").TGeoCoordinates>, "geom">;
|
|
24
|
+
type: string;
|
|
25
|
+
} | undefined>;
|
|
26
|
+
private formatOutput;
|
|
27
|
+
}
|