@golemio/municipal-libraries 1.0.5-dev.568966813 → 1.1.0

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 (147) hide show
  1. package/db/example/.config.json +3 -0
  2. package/db/example/00_truncate_tables.sql +7 -0
  3. package/db/example/01_libraries.sql +50 -0
  4. package/db/migrations/postgresql/.config.json +3 -0
  5. package/db/migrations/postgresql/20220916133717-init.js +53 -0
  6. package/db/migrations/postgresql/package.json +3 -0
  7. package/db/migrations/postgresql/sqls/20220916133717-init-down.sql +6 -0
  8. package/db/migrations/postgresql/sqls/20220916133717-init-up.sql +102 -0
  9. package/db/migrations/postgresql/sqls/package.json +3 -0
  10. package/dist/integration-engine/datasources/MunicipalLibrariesDataSource.d.ts +4 -0
  11. package/dist/integration-engine/datasources/MunicipalLibrariesDataSource.js +21 -0
  12. package/dist/integration-engine/datasources/MunicipalLibrariesDataSource.js.map +1 -0
  13. package/dist/integration-engine/datasources/index.d.ts +1 -0
  14. package/dist/integration-engine/datasources/index.js +19 -0
  15. package/dist/integration-engine/datasources/index.js.map +1 -0
  16. package/dist/integration-engine/index.d.ts +2 -3
  17. package/dist/integration-engine/index.js +5 -3
  18. package/dist/integration-engine/index.js.map +1 -1
  19. package/dist/integration-engine/repositories/DepartmentsRepository.d.ts +4 -0
  20. package/dist/integration-engine/repositories/DepartmentsRepository.js +19 -0
  21. package/dist/integration-engine/repositories/DepartmentsRepository.js.map +1 -0
  22. package/dist/integration-engine/repositories/LibraryDepartmentsRepository.d.ts +4 -0
  23. package/dist/integration-engine/repositories/LibraryDepartmentsRepository.js +19 -0
  24. package/dist/integration-engine/repositories/LibraryDepartmentsRepository.js.map +1 -0
  25. package/dist/integration-engine/repositories/LibraryServicesRepository.d.ts +4 -0
  26. package/dist/integration-engine/repositories/LibraryServicesRepository.js +19 -0
  27. package/dist/integration-engine/repositories/LibraryServicesRepository.js.map +1 -0
  28. package/dist/integration-engine/repositories/MunicipalLibrariesRepository.d.ts +16 -0
  29. package/dist/integration-engine/repositories/MunicipalLibrariesRepository.js +140 -0
  30. package/dist/integration-engine/repositories/MunicipalLibrariesRepository.js.map +1 -0
  31. package/dist/integration-engine/repositories/OpeningHoursRepository.d.ts +4 -0
  32. package/dist/integration-engine/repositories/OpeningHoursRepository.js +19 -0
  33. package/dist/integration-engine/repositories/OpeningHoursRepository.js.map +1 -0
  34. package/dist/integration-engine/repositories/ServicesRepository.d.ts +4 -0
  35. package/dist/integration-engine/repositories/ServicesRepository.js +19 -0
  36. package/dist/integration-engine/repositories/ServicesRepository.js.map +1 -0
  37. package/dist/integration-engine/repositories/index.d.ts +6 -0
  38. package/dist/integration-engine/repositories/index.js +24 -0
  39. package/dist/integration-engine/repositories/index.js.map +1 -0
  40. package/dist/integration-engine/transformations/MunicipalLibrariesTransformation.d.ts +32 -0
  41. package/dist/integration-engine/transformations/MunicipalLibrariesTransformation.js +72 -0
  42. package/dist/integration-engine/transformations/MunicipalLibrariesTransformation.js.map +1 -0
  43. package/dist/integration-engine/transformations/helpers/TransformationHelper.d.ts +19 -0
  44. package/dist/integration-engine/transformations/helpers/TransformationHelper.js +95 -0
  45. package/dist/integration-engine/transformations/helpers/TransformationHelper.js.map +1 -0
  46. package/dist/integration-engine/workers/MunicipalLibrariesWorker.d.ts +5 -0
  47. package/dist/integration-engine/workers/MunicipalLibrariesWorker.js +16 -0
  48. package/dist/integration-engine/workers/MunicipalLibrariesWorker.js.map +1 -0
  49. package/dist/integration-engine/workers/index.d.ts +2 -0
  50. package/dist/integration-engine/workers/index.js +6 -0
  51. package/dist/integration-engine/workers/index.js.map +1 -0
  52. package/dist/integration-engine/workers/schemas/UpdateDistrictSchema.d.ts +6 -0
  53. package/dist/integration-engine/workers/schemas/UpdateDistrictSchema.js +21 -0
  54. package/dist/integration-engine/workers/schemas/UpdateDistrictSchema.js.map +1 -0
  55. package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.d.ts +10 -0
  56. package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js +41 -0
  57. package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js.map +1 -0
  58. package/dist/integration-engine/workers/tasks/UpdateDistrictsTask.d.ts +12 -0
  59. package/dist/integration-engine/workers/tasks/UpdateDistrictsTask.js +47 -0
  60. package/dist/integration-engine/workers/tasks/UpdateDistrictsTask.js.map +1 -0
  61. package/dist/integration-engine/workers/tasks/index.d.ts +2 -0
  62. package/dist/integration-engine/workers/tasks/index.js +20 -0
  63. package/dist/integration-engine/workers/tasks/index.js.map +1 -0
  64. package/dist/output-gateway/MunicipalLibrariesRouter.d.ts +8 -0
  65. package/dist/output-gateway/MunicipalLibrariesRouter.js +15 -0
  66. package/dist/output-gateway/MunicipalLibrariesRouter.js.map +1 -0
  67. package/dist/output-gateway/index.d.ts +2 -0
  68. package/dist/output-gateway/index.js +19 -0
  69. package/dist/output-gateway/index.js.map +1 -0
  70. package/dist/output-gateway/repositories/DepartmentsRepository.d.ts +6 -0
  71. package/dist/output-gateway/repositories/DepartmentsRepository.js +28 -0
  72. package/dist/output-gateway/repositories/DepartmentsRepository.js.map +1 -0
  73. package/dist/output-gateway/repositories/LibraryDepartmentsRepository.d.ts +6 -0
  74. package/dist/output-gateway/repositories/LibraryDepartmentsRepository.js +28 -0
  75. package/dist/output-gateway/repositories/LibraryDepartmentsRepository.js.map +1 -0
  76. package/dist/output-gateway/repositories/LibraryServicesRepository.d.ts +6 -0
  77. package/dist/output-gateway/repositories/LibraryServicesRepository.js +28 -0
  78. package/dist/output-gateway/repositories/LibraryServicesRepository.js.map +1 -0
  79. package/dist/output-gateway/repositories/MunicipalLibrariesRepository.d.ts +17 -0
  80. package/dist/output-gateway/repositories/MunicipalLibrariesRepository.js +164 -0
  81. package/dist/output-gateway/repositories/MunicipalLibrariesRepository.js.map +1 -0
  82. package/dist/output-gateway/repositories/OpeningHoursRepository.d.ts +6 -0
  83. package/dist/output-gateway/repositories/OpeningHoursRepository.js +28 -0
  84. package/dist/output-gateway/repositories/OpeningHoursRepository.js.map +1 -0
  85. package/dist/output-gateway/repositories/ServicesRepository.d.ts +6 -0
  86. package/dist/output-gateway/repositories/ServicesRepository.js +28 -0
  87. package/dist/output-gateway/repositories/ServicesRepository.js.map +1 -0
  88. package/dist/output-gateway/repositories/index.d.ts +6 -0
  89. package/dist/output-gateway/repositories/index.js +23 -0
  90. package/dist/output-gateway/repositories/index.js.map +1 -0
  91. package/dist/schema-definitions/Departments.d.ts +10 -0
  92. package/dist/schema-definitions/Departments.js +8 -0
  93. package/dist/schema-definitions/Departments.js.map +1 -0
  94. package/dist/schema-definitions/Libraries.d.ts +16 -0
  95. package/dist/schema-definitions/Libraries.js +8 -0
  96. package/dist/schema-definitions/Libraries.js.map +1 -0
  97. package/dist/schema-definitions/LibraryDepartments.d.ts +8 -0
  98. package/dist/schema-definitions/LibraryDepartments.js +8 -0
  99. package/dist/schema-definitions/LibraryDepartments.js.map +1 -0
  100. package/dist/schema-definitions/LibraryServices.d.ts +8 -0
  101. package/dist/schema-definitions/LibraryServices.js +8 -0
  102. package/dist/schema-definitions/LibraryServices.js.map +1 -0
  103. package/dist/schema-definitions/OpeningHours.d.ts +15 -0
  104. package/dist/schema-definitions/OpeningHours.js +8 -0
  105. package/dist/schema-definitions/OpeningHours.js.map +1 -0
  106. package/dist/schema-definitions/Services.d.ts +9 -0
  107. package/dist/schema-definitions/Services.js +8 -0
  108. package/dist/schema-definitions/Services.js.map +1 -0
  109. package/dist/schema-definitions/datasources/MunicipalLibrariesJsonSchema.d.ts +78 -0
  110. package/dist/schema-definitions/datasources/MunicipalLibrariesJsonSchema.js +209 -0
  111. package/dist/schema-definitions/datasources/MunicipalLibrariesJsonSchema.js.map +1 -0
  112. package/dist/schema-definitions/index.d.ts +1 -314
  113. package/dist/schema-definitions/index.js +19 -265
  114. package/dist/schema-definitions/index.js.map +1 -1
  115. package/dist/schema-definitions/models/DepartmentsModel.d.ts +12 -0
  116. package/dist/schema-definitions/models/DepartmentsModel.js +33 -0
  117. package/dist/schema-definitions/models/DepartmentsModel.js.map +1 -0
  118. package/dist/schema-definitions/models/LibrariesModel.d.ts +18 -0
  119. package/dist/schema-definitions/models/LibrariesModel.js +46 -0
  120. package/dist/schema-definitions/models/LibrariesModel.js.map +1 -0
  121. package/dist/schema-definitions/models/LibraryDepartmentsModel.d.ts +10 -0
  122. package/dist/schema-definitions/models/LibraryDepartmentsModel.js +30 -0
  123. package/dist/schema-definitions/models/LibraryDepartmentsModel.js.map +1 -0
  124. package/dist/schema-definitions/models/LibraryServicesModel.d.ts +10 -0
  125. package/dist/schema-definitions/models/LibraryServicesModel.js +30 -0
  126. package/dist/schema-definitions/models/LibraryServicesModel.js.map +1 -0
  127. package/dist/schema-definitions/models/OpeningHoursModel.d.ts +17 -0
  128. package/dist/schema-definitions/models/OpeningHoursModel.js +44 -0
  129. package/dist/schema-definitions/models/OpeningHoursModel.js.map +1 -0
  130. package/dist/schema-definitions/models/ServicesModel.d.ts +11 -0
  131. package/dist/schema-definitions/models/ServicesModel.js +31 -0
  132. package/dist/schema-definitions/models/ServicesModel.js.map +1 -0
  133. package/dist/schema-definitions/models/index.d.ts +6 -0
  134. package/dist/schema-definitions/models/index.js +24 -0
  135. package/dist/schema-definitions/models/index.js.map +1 -0
  136. package/package.json +64 -58
  137. package/db/example/mongo_data/dataplatform/municipallibraries.bson +0 -0
  138. package/db/example/mongo_data/dataplatform/municipallibraries.metadata.json +0 -1
  139. package/dist/integration-engine/MunicipalLibrariesTransformation.d.ts +0 -9
  140. package/dist/integration-engine/MunicipalLibrariesTransformation.js +0 -150
  141. package/dist/integration-engine/MunicipalLibrariesTransformation.js.map +0 -1
  142. package/dist/integration-engine/MunicipalLibrariesWorker.d.ts +0 -11
  143. package/dist/integration-engine/MunicipalLibrariesWorker.js +0 -105
  144. package/dist/integration-engine/MunicipalLibrariesWorker.js.map +0 -1
  145. package/dist/integration-engine/queueDefinitions.d.ts +0 -3
  146. package/dist/integration-engine/queueDefinitions.js +0 -36
  147. package/dist/integration-engine/queueDefinitions.js.map +0 -1
@@ -0,0 +1,24 @@
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
+ /* sch/models/index.ts */
18
+ __exportStar(require("./LibrariesModel"), exports);
19
+ __exportStar(require("./ServicesModel"), exports);
20
+ __exportStar(require("./DepartmentsModel"), exports);
21
+ __exportStar(require("./OpeningHoursModel"), exports);
22
+ __exportStar(require("./LibraryServicesModel"), exports);
23
+ __exportStar(require("./LibraryDepartmentsModel"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema-definitions/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yBAAyB;AACzB,mDAAiC;AACjC,kDAAgC;AAChC,qDAAmC;AACnC,sDAAoC;AACpC,yDAAuC;AACvC,4DAA0C"}
package/package.json CHANGED
@@ -1,60 +1,66 @@
1
1
  {
2
- "name": "@golemio/municipal-libraries",
3
- "version": "1.0.5-dev.568966813",
4
- "description": "Golemio Municipal Libraries Module",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
9
- "build-minimal": "run-s 'build --sourceMap false --declaration false'",
10
- "build-watch": "run-s 'build --watch --preserveWatchOutput'",
11
- "test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register 'test/**/*.test.ts'",
12
- "test-debug": "run-s 'test --inspect-brk=9230'",
13
- "code-coverage": "nyc run-s 'test -r source-map-support/register'",
14
- "generate-docs": "typedoc --out docs/typedoc src",
15
- "lint": "eslint \"{src,test}/**/*.ts\""
16
- },
17
- "keywords": [
18
- "golemio"
19
- ],
20
- "author": "Operator ICT, a.s.",
21
- "license": "MIT",
22
- "repository": {
23
- "type": "git",
24
- "url": "https://gitlab.com/operator-ict/golemio/code/modules/municipal-libraries"
25
- },
26
- "devDependencies": {
27
- "@commitlint/cli": "^11.0.0",
28
- "@commitlint/config-conventional": "^11.0.0",
29
- "@golemio/city-districts": "1.0.5",
30
- "@golemio/core": "1.2.13",
31
- "@golemio/eslint-config": "^1.0.2",
32
- "@ovos-media/ts-transform-paths": "^1.7.18-1",
33
- "@types/chai": "4.2.3",
34
- "@types/chai-as-promised": "7.1.2",
35
- "@types/mocha": "^8.2.0",
36
- "@types/node": "^16.11.35",
37
- "@types/sinon": "^9.0.10",
38
- "chai": "4.2.0",
39
- "chai-as-promised": "7.1.1",
40
- "cross-env": "^7.0.3",
41
- "eslint": "^7.17.0",
42
- "husky": "^4.3.7",
43
- "mocha": "^8.2.1",
44
- "npm-run-all": "^4.1.5",
45
- "nyc": "^15.1.0",
46
- "prettier": "^2.2.1",
47
- "pretty-quick": "^3.1.0",
48
- "rimraf": "^3.0.2",
49
- "sinon": "^9.2.3",
50
- "source-map-support": "0.5.19",
51
- "ts-node": "^10.7.0",
52
- "ttypescript": "^1.5.13",
53
- "typedoc": "^0.22.15",
54
- "typescript": "4.6.4"
55
- },
56
- "peerDependencies": {
57
- "@golemio/city-districts": "^1.0.0",
58
- "@golemio/core": "^1.0.0"
59
- }
2
+ "name": "@golemio/municipal-libraries",
3
+ "version": "1.1.0",
4
+ "description": "Golemio Municipal Libraries Module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
9
+ "build-minimal": "run-s 'build --sourceMap false --declaration false'",
10
+ "build-watch": "run-s 'build --watch --preserveWatchOutput'",
11
+ "pretest": "golemio import-db-data --postgres",
12
+ "test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
13
+ "test-debug": "run-s 'test --inspect-brk=9230'",
14
+ "code-coverage": "nyc run-s 'test -r source-map-support/register'",
15
+ "migrate-db": "golemio migrate-db up --postgres",
16
+ "generate-docs": "typedoc --out docs/typedoc src",
17
+ "lint": "eslint \"{src,test}/**/*.ts\""
18
+ },
19
+ "keywords": [
20
+ "golemio"
21
+ ],
22
+ "author": "Operator ICT, a.s.",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://gitlab.com/operator-ict/golemio/code/modules/municipal-libraries"
27
+ },
28
+ "devDependencies": {
29
+ "@commitlint/cli": "^11.0.0",
30
+ "@commitlint/config-conventional": "^11.0.0",
31
+ "@golemio/city-districts": "1.0.5",
32
+ "@golemio/cli": "1.3.2",
33
+ "@golemio/core": "1.2.20",
34
+ "@golemio/db-common": "1.0.2",
35
+ "@golemio/eslint-config": "1.1.0",
36
+ "@ovos-media/ts-transform-paths": "^1.7.18-1",
37
+ "@types/chai": "4.2.3",
38
+ "@types/chai-as-promised": "7.1.2",
39
+ "@types/mocha": "^9.1.0",
40
+ "@types/node": "^16.11.35",
41
+ "@types/sinon": "^9.0.10",
42
+ "@types/supertest": "^2.0.12",
43
+ "chai": "4.2.0",
44
+ "chai-as-promised": "7.1.1",
45
+ "cross-env": "^7.0.3",
46
+ "eslint": "^8.1.1",
47
+ "husky": "^4.3.7",
48
+ "mocha": "^9.1.2",
49
+ "npm-run-all": "^4.1.5",
50
+ "nyc": "^15.1.0",
51
+ "prettier": "^2.5.1",
52
+ "pretty-quick": "^3.1.0",
53
+ "rimraf": "^3.0.2",
54
+ "sinon": "^9.2.3",
55
+ "source-map-support": "0.5.19",
56
+ "supertest": "^6.2.4",
57
+ "ts-node": "^10.7.0",
58
+ "ttypescript": "^1.5.13",
59
+ "typedoc": "^0.22.15",
60
+ "typescript": "4.6.4"
61
+ },
62
+ "peerDependencies": {
63
+ "@golemio/city-districts": "^1.0.0",
64
+ "@golemio/core": "^1.0.0"
65
+ }
60
66
  }
@@ -1 +0,0 @@
1
- {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"dataplatform.municipallibraries"},{"v":2,"key":{"properties.id":1},"name":"properties.id_1","ns":"dataplatform.municipallibraries"},{"v":2,"key":{"geometry":"2dsphere"},"name":"geometry_2dsphere","ns":"dataplatform.municipallibraries","2dsphereIndexVersion":3}],"uuid":"dfba351c328d4dbaa1c327a299e027d7"}
@@ -1,9 +0,0 @@
1
- import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
2
- export declare class MunicipalLibrariesTransformation extends BaseTransformation implements ITransformation {
3
- name: string;
4
- constructor();
5
- protected transformElement: (element: any) => Promise<any>;
6
- private transformOpeningHours;
7
- private transformService;
8
- private transformSection;
9
- }
@@ -1,150 +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
- 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.MunicipalLibrariesTransformation = void 0;
16
- const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
17
- const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
18
- const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
19
- const index_1 = require("../schema-definitions/index");
20
- var openingHoursDaysKeys;
21
- (function (openingHoursDaysKeys) {
22
- openingHoursDaysKeys["pondeli"] = "Monday";
23
- openingHoursDaysKeys["utery"] = "Tuesday";
24
- openingHoursDaysKeys["streda"] = "Wednesday";
25
- openingHoursDaysKeys["ctvrtek"] = "Thursday";
26
- openingHoursDaysKeys["patek"] = "Friday";
27
- openingHoursDaysKeys["sobota"] = "Saturday";
28
- openingHoursDaysKeys["nedele"] = "Sunday";
29
- })(openingHoursDaysKeys || (openingHoursDaysKeys = {}));
30
- class MunicipalLibrariesTransformation extends transformations_1.BaseTransformation {
31
- constructor() {
32
- super();
33
- this.transformElement = (element) => __awaiter(this, void 0, void 0, function* () {
34
- // filter sub-departments
35
- if (element.nadrazena.trim() !== "") {
36
- helpers_1.log.debug(`Subdepartment '${element.nazev}' was filtered out.`);
37
- return null;
38
- }
39
- const gps = element.adresa.gps.split(",").map((e) => parseFloat(e.trim()));
40
- // filter departments without gps
41
- if (gps[0] === 0 || gps[1] === 0) {
42
- helpers_1.log.debug(`Department '${element.nazev}' was filtered out.`);
43
- return null;
44
- }
45
- const res = {
46
- geometry: {
47
- coordinates: [gps[1], gps[0]],
48
- type: "Point",
49
- },
50
- properties: {
51
- address: {
52
- address_country: "Česko",
53
- address_formatted: element.adresa.ulice +
54
- " " +
55
- element.adresa.cislo +
56
- ", " +
57
- element.adresa.psc +
58
- " " +
59
- element.adresa.mesto +
60
- ", Česko",
61
- address_locality: element.adresa.mesto,
62
- postal_code: element.adresa.psc,
63
- street_address: element.adresa.ulice + " " + element.adresa.cislo,
64
- },
65
- email: element.kontakt.email,
66
- id: parseInt(element.id, 10),
67
- name: element.nazev,
68
- opening_hours: element.oteviracidoby.oteviracidoba instanceof Array
69
- ? element.oteviracidoby.oteviracidoba.flatMap((o) => this.transformOpeningHours(o))
70
- : this.transformOpeningHours(element.oteviracidoby.oteviracidoba),
71
- sections_and_departments: typeof element.oddeleni !== "string"
72
- ? element.oddeleni.oddeleni instanceof Array
73
- ? element.oddeleni.oddeleni.map((o) => this.transformSection(o))
74
- : [this.transformSection(element.oddeleni.oddeleni)]
75
- : [],
76
- services: typeof element.sluzby !== "string"
77
- ? element.sluzby.sluzba instanceof Array
78
- ? element.sluzby.sluzba.map((s) => this.transformService(s))
79
- : [this.transformService(element.sluzby.sluzba)]
80
- : [],
81
- telephone: element.kontakt.telefon,
82
- updated_at: new Date().getTime(),
83
- web: element.adresa.url,
84
- },
85
- type: "Feature",
86
- };
87
- return res;
88
- });
89
- this.transformOpeningHours = (openingHoursObject) => {
90
- const res = [];
91
- const description = openingHoursObject.nazev;
92
- const isDefault = openingHoursObject.defaultni;
93
- let validFrom;
94
- let validThrough;
95
- if (openingHoursObject.platnost) {
96
- if (openingHoursObject.platnost.od) {
97
- validFrom = moment_timezone_1.default.tz(openingHoursObject.platnost.od, "Europe/Prague").toISOString();
98
- }
99
- if (openingHoursObject.platnost.do) {
100
- validThrough = moment_timezone_1.default.tz(openingHoursObject.platnost.do, "Europe/Prague").toISOString();
101
- }
102
- }
103
- Object.keys(openingHoursDaysKeys).forEach((day) => {
104
- if (openingHoursObject[day] && !(typeof openingHoursObject[day] === "string")) {
105
- if (openingHoursObject[day].rano) {
106
- res.push({
107
- closes: openingHoursObject[day].rano.do,
108
- day_of_week: openingHoursDaysKeys[day],
109
- description,
110
- is_default: isDefault,
111
- opens: openingHoursObject[day].rano.od,
112
- valid_from: validFrom,
113
- valid_through: validThrough,
114
- });
115
- }
116
- if (openingHoursObject[day].odpoledne) {
117
- res.push({
118
- closes: openingHoursObject[day].odpoledne.do,
119
- day_of_week: openingHoursDaysKeys[day],
120
- description,
121
- is_default: isDefault,
122
- opens: openingHoursObject[day].odpoledne.od,
123
- valid_from: validFrom,
124
- valid_through: validThrough,
125
- });
126
- }
127
- }
128
- });
129
- return res;
130
- };
131
- this.transformService = (serviceObject) => {
132
- return {
133
- description: serviceObject.popis ? serviceObject.popis : null,
134
- id: parseInt(serviceObject.id, 10),
135
- name: serviceObject.nazev,
136
- };
137
- };
138
- this.transformSection = (sectionObject) => {
139
- return {
140
- id: sectionObject.id,
141
- name: sectionObject.nazev,
142
- type: sectionObject.typ ? sectionObject.typ : null,
143
- url: sectionObject.url ? sectionObject.url : null,
144
- };
145
- };
146
- this.name = index_1.MunicipalLibraries.name;
147
- }
148
- }
149
- exports.MunicipalLibrariesTransformation = MunicipalLibrariesTransformation;
150
- //# sourceMappingURL=MunicipalLibrariesTransformation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MunicipalLibrariesTransformation.js","sourceRoot":"","sources":["../../src/integration-engine/MunicipalLibrariesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gGAA+D;AAC/D,2EAAoE;AACpE,2FAA4G;AAC5G,uDAAgD;AAUhD,IAAK,oBAQJ;AARD,WAAK,oBAAoB;IACrB,0CAAkB,CAAA;IAClB,yCAAiB,CAAA;IACjB,4CAAoB,CAAA;IACpB,4CAAoB,CAAA;IACpB,wCAAgB,CAAA;IAChB,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;AACrB,CAAC,EARI,oBAAoB,KAApB,oBAAoB,QAQxB;AAeD,MAAa,gCAAiC,SAAQ,oCAAkB;IAGpE;QACI,KAAK,EAAE,CAAC;QAIF,qBAAgB,GAAG,CAAO,OAAY,EAAgB,EAAE;YAC9D,yBAAyB;YACzB,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACjC,aAAG,CAAC,KAAK,CAAC,kBAAkB,OAAO,CAAC,KAAK,qBAAqB,CAAC,CAAC;gBAChE,OAAO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,CAAC;CA8HJ;AApID,4EAoIC"}
@@ -1,11 +0,0 @@
1
- import { BaseWorker } from "@golemio/core/dist/integration-engine/workers";
2
- export declare class MunicipalLibrariesWorker extends BaseWorker {
3
- private dataSource;
4
- private transformation;
5
- private model;
6
- private queuePrefix;
7
- private cityDistrictsModel;
8
- constructor();
9
- refreshDataInDB: (msg: any) => Promise<void>;
10
- updateDistrict: (msg: any) => Promise<void>;
11
- }
@@ -1,105 +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.MunicipalLibrariesWorker = void 0;
13
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
14
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
15
- const config_1 = require("@golemio/core/dist/integration-engine/config");
16
- const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
17
- const models_1 = require("@golemio/core/dist/integration-engine/models");
18
- const workers_1 = require("@golemio/core/dist/integration-engine/workers");
19
- const schema_definitions_1 = require("@golemio/city-districts/dist/schema-definitions");
20
- const index_1 = require("../schema-definitions/index");
21
- const _1 = require("./");
22
- class MunicipalLibrariesWorker extends workers_1.BaseWorker {
23
- constructor() {
24
- super();
25
- this.refreshDataInDB = (msg) => __awaiter(this, void 0, void 0, function* () {
26
- const data = yield this.dataSource.getAll();
27
- const transformedData = yield this.transformation.transform(data);
28
- yield this.model.save(transformedData);
29
- // send messages for updating district and address and average occupancy
30
- const promises = transformedData.map((p) => {
31
- this.sendMessageToExchange("workers." + this.queuePrefix + ".updateDistrict", JSON.stringify(p));
32
- });
33
- yield Promise.all(promises);
34
- });
35
- this.updateDistrict = (msg) => __awaiter(this, void 0, void 0, function* () {
36
- const inputData = JSON.parse(msg.content.toString());
37
- const id = inputData.properties.id;
38
- const dbData = yield this.model.findOneById(id);
39
- if (!dbData.properties.district ||
40
- inputData.geometry.coordinates[0] !== dbData.geometry.coordinates[0] ||
41
- inputData.geometry.coordinates[1] !== dbData.geometry.coordinates[1]) {
42
- try {
43
- const result = yield this.cityDistrictsModel.findOne({
44
- // find district by coordinates
45
- geometry: {
46
- $geoIntersects: {
47
- $geometry: {
48
- coordinates: dbData.geometry.coordinates,
49
- type: "Point",
50
- },
51
- },
52
- },
53
- });
54
- dbData.properties.district = result ? result.properties.slug : null;
55
- yield dbData.save();
56
- }
57
- catch (err) {
58
- throw new golemio_errors_1.CustomError("Error while updating district.", true, this.constructor.name, 5001, err);
59
- }
60
- }
61
- return dbData;
62
- });
63
- this.dataSource = new datasources_1.DataSource(index_1.MunicipalLibraries.name + "DataSource", new datasources_1.HTTPProtocolStrategy({
64
- headers: {},
65
- method: "GET",
66
- url: config_1.config.datasources.MunicipalLibraries,
67
- }), new datasources_1.XMLDataTypeStrategy({
68
- resultsPath: "pobocky.pobocka",
69
- xml2jsParams: { explicitArray: false, ignoreAttrs: true, trim: true },
70
- }), new golemio_validator_1.JSONSchemaValidator(index_1.MunicipalLibraries.name + "DataSource", index_1.MunicipalLibraries.datasourceJsonSchema));
71
- this.model = new models_1.MongoModel(index_1.MunicipalLibraries.name + "Model", {
72
- identifierPath: "properties.id",
73
- mongoCollectionName: index_1.MunicipalLibraries.mongoCollectionName,
74
- outputMongooseSchemaObject: index_1.MunicipalLibraries.outputMongooseSchemaObject,
75
- resultsPath: "properties",
76
- savingType: "insertOrUpdate",
77
- searchPath: (id, multiple) => (multiple ? { "properties.id": { $in: id } } : { "properties.id": id }),
78
- updateValues: (a, b) => {
79
- a.geometry = b.geometry;
80
- a.properties.address = b.properties.address;
81
- a.properties.email = b.properties.email;
82
- a.properties.name = b.properties.name;
83
- a.properties.opening_hours = b.properties.opening_hours;
84
- a.properties.sections_and_departments = b.properties.sections_and_departments;
85
- a.properties.services = b.properties.services;
86
- a.properties.telephone = b.properties.telephone;
87
- a.properties.updated_at = b.properties.updated_at;
88
- a.properties.web = b.properties.web;
89
- return a;
90
- },
91
- }, new golemio_validator_1.Validator(index_1.MunicipalLibraries.name + "ModelValidator", index_1.MunicipalLibraries.outputMongooseSchemaObject));
92
- this.transformation = new _1.MunicipalLibrariesTransformation();
93
- this.queuePrefix = config_1.config.RABBIT_EXCHANGE_NAME + "." + index_1.MunicipalLibraries.name.toLowerCase();
94
- this.cityDistrictsModel = new models_1.MongoModel(schema_definitions_1.CityDistricts.name + "Model", {
95
- identifierPath: "properties.id",
96
- mongoCollectionName: schema_definitions_1.CityDistricts.mongoCollectionName,
97
- outputMongooseSchemaObject: schema_definitions_1.CityDistricts.outputMongooseSchemaObject,
98
- resultsPath: "properties",
99
- savingType: "readOnly",
100
- searchPath: (id, multiple) => (multiple ? { "properties.id": { $in: id } } : { "properties.id": id }),
101
- }, new golemio_validator_1.Validator(schema_definitions_1.CityDistricts.name + "ModelValidator", schema_definitions_1.CityDistricts.outputMongooseSchemaObject));
102
- }
103
- }
104
- exports.MunicipalLibrariesWorker = MunicipalLibrariesWorker;
105
- //# sourceMappingURL=MunicipalLibrariesWorker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MunicipalLibrariesWorker.js","sourceRoot":"","sources":["../../src/integration-engine/MunicipalLibrariesWorker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,mFAA6F;AAC7F,yEAAsE;AACtE,mFAA0H;AAC1H,yEAA0E;AAC1E,2EAA2E;AAC3E,wFAAgF;AAChF,uDAAgD;AAChD,yBAAsD;AAEtD,MAAa,wBAAyB,SAAQ,oBAAU;IAOpD;QACI,KAAK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I,GAAG,gBAAgB,EAAE,0BAAkB,CAAC,0BAA0B,CAAC,CAC3G,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,mCAAgC,EAAE,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,0BAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7F,IAAI,CAAC,kBAAkB,GAAG,IAAI,mBAAU,CACpC,kCAAa,CAAC,IAAI,GAAG,OAAO,EAC5B;YACI,cAAc,EAAE,eAAe;YAC/B,mBAAmB,EAAE,kCAAa,CAAC,mBAAmB;YACtD,0BAA0B,EAAE,kCAAa,CAAC,0BAA0B;YACpE,WAAW,EAAE,YAAY;YACzB,UAAU,EAAE,UAAU;YACtB,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;SACxG,EACD,IAAI,6BAAS,CAAC,kCAAa,CAAC,IAAI,GAAG,gBAAgB,EAAE,kCAAa,CAAC,0BAA0B,CAAC,CACjG,CAAC;IACN,CAAC;CA4CJ;AA1GD,4DA0GC"}
@@ -1,3 +0,0 @@
1
- import { IQueueDefinition } from "@golemio/core/dist/integration-engine/queueprocessors";
2
- declare const queueDefinitions: IQueueDefinition[];
3
- export { queueDefinitions };
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.queueDefinitions = void 0;
4
- const config_1 = require("@golemio/core/dist/integration-engine/config");
5
- const index_1 = require("../schema-definitions/index");
6
- const MunicipalLibrariesWorker_1 = require("./MunicipalLibrariesWorker");
7
- const queueDefinitions = [
8
- {
9
- name: index_1.MunicipalLibraries.name,
10
- queuePrefix: config_1.config.RABBIT_EXCHANGE_NAME + "." + index_1.MunicipalLibraries.name.toLowerCase(),
11
- queues: [
12
- {
13
- name: "refreshDataInDB",
14
- options: {
15
- deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
16
- deadLetterRoutingKey: "dead",
17
- messageTtl: 59 * 60 * 1000, // 59 minutes
18
- },
19
- worker: MunicipalLibrariesWorker_1.MunicipalLibrariesWorker,
20
- workerMethod: "refreshDataInDB",
21
- },
22
- {
23
- name: "updateDistrict",
24
- options: {
25
- deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
26
- deadLetterRoutingKey: "dead",
27
- messageTtl: 59 * 60 * 1000, // 59 minutes
28
- },
29
- worker: MunicipalLibrariesWorker_1.MunicipalLibrariesWorker,
30
- workerMethod: "updateDistrict",
31
- },
32
- ],
33
- },
34
- ];
35
- exports.queueDefinitions = queueDefinitions;
36
- //# sourceMappingURL=queueDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queueDefinitions.js","sourceRoot":"","sources":["../../src/integration-engine/queueDefinitions.ts"],"names":[],"mappings":";;;AAAA,yEAAsE;AAEtE,uDAAgD;AAChD,yEAAwE;AAExE,MAAM,gBAAgB,GAAuB;IACzC;QACI,IAAI,EAAE,0BAAkB,CAAC,IAAI;QAC7B,WAAW,EAAE,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,0BAAkB,CAAC,IAAI,CAAC,WAAW,EAAE;QACtF,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,mDAAwB;gBAChC,YAAY,EAAE,iBAAiB;aAClC;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,mDAAwB;gBAChC,YAAY,EAAE,gBAAgB;aACjC;SACJ;KACJ;CACJ,CAAC;AAEO,4CAAgB"}