@golemio/municipal-authorities 1.0.4-dev.632094713 → 1.0.5-dev.674670756

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 (130) hide show
  1. package/LICENSE +2 -2
  2. package/db/example/.config.json +3 -0
  3. package/db/example/00_truncate_tables.sql +2 -0
  4. package/db/example/01_municipal_authorities.sql +11 -0
  5. package/db/migrations/postgresql/.config.json +3 -0
  6. package/db/migrations/postgresql/20221008165642-init-mongo-to-pg.js +51 -0
  7. package/db/migrations/postgresql/package.json +3 -0
  8. package/db/migrations/postgresql/sqls/20221008165642-init-mongo-to-pg-down.sql +3 -0
  9. package/db/migrations/postgresql/sqls/20221008165642-init-mongo-to-pg-up.sql +70 -0
  10. package/db/migrations/postgresql/sqls/package.json +3 -0
  11. package/dist/integration-engine/datasources/MunicipalAuthoritiesDataSource.d.ts +4 -0
  12. package/dist/integration-engine/datasources/MunicipalAuthoritiesDataSource.js +18 -0
  13. package/dist/integration-engine/datasources/MunicipalAuthoritiesDataSource.js.map +1 -0
  14. package/dist/integration-engine/datasources/SkodaPalaceQueuesDataSource.d.ts +4 -0
  15. package/dist/integration-engine/datasources/SkodaPalaceQueuesDataSource.js +26 -0
  16. package/dist/integration-engine/datasources/SkodaPalaceQueuesDataSource.js.map +1 -0
  17. package/dist/integration-engine/index.d.ts +1 -4
  18. package/dist/integration-engine/index.js +3 -18
  19. package/dist/integration-engine/index.js.map +1 -1
  20. package/dist/integration-engine/repositories/MunicipalAuthoritiesRepository.d.ts +6 -0
  21. package/dist/integration-engine/repositories/MunicipalAuthoritiesRepository.js +39 -0
  22. package/dist/integration-engine/repositories/MunicipalAuthoritiesRepository.js.map +1 -0
  23. package/dist/integration-engine/repositories/SkodaPalaceQueuesHistoryRepository.d.ts +4 -0
  24. package/dist/integration-engine/repositories/SkodaPalaceQueuesHistoryRepository.js +20 -0
  25. package/dist/integration-engine/repositories/SkodaPalaceQueuesHistoryRepository.js.map +1 -0
  26. package/dist/integration-engine/repositories/SkodaPalaceQueuesRepository.d.ts +6 -0
  27. package/dist/integration-engine/repositories/SkodaPalaceQueuesRepository.js +40 -0
  28. package/dist/integration-engine/repositories/SkodaPalaceQueuesRepository.js.map +1 -0
  29. package/dist/integration-engine/repositories/index.d.ts +3 -0
  30. package/dist/integration-engine/repositories/index.js +21 -0
  31. package/dist/integration-engine/repositories/index.js.map +1 -0
  32. package/dist/integration-engine/schema/SaveWaitingQueuesDataToHistorySchema.d.ts +9 -0
  33. package/dist/integration-engine/schema/SaveWaitingQueuesDataToHistorySchema.js +41 -0
  34. package/dist/integration-engine/schema/SaveWaitingQueuesDataToHistorySchema.js.map +1 -0
  35. package/dist/integration-engine/transformations/MunicipalAuthoritiesTransformation.d.ts +11 -0
  36. package/dist/integration-engine/{MunicipalAuthoritiesTransformation.js → transformations/MunicipalAuthoritiesTransformation.js} +61 -35
  37. package/dist/integration-engine/transformations/MunicipalAuthoritiesTransformation.js.map +1 -0
  38. package/dist/integration-engine/transformations/SkodaPalaceQueuesTransformation.d.ts +17 -0
  39. package/dist/integration-engine/{SkodaPalaceQueuesTransformation.js → transformations/SkodaPalaceQueuesTransformation.js} +26 -28
  40. package/dist/integration-engine/transformations/SkodaPalaceQueuesTransformation.js.map +1 -0
  41. package/dist/integration-engine/workers/MunicipalAuthoritiesWorker.d.ts +5 -0
  42. package/dist/integration-engine/workers/MunicipalAuthoritiesWorker.js +16 -0
  43. package/dist/integration-engine/workers/MunicipalAuthoritiesWorker.js.map +1 -0
  44. package/dist/integration-engine/workers/index.d.ts +2 -0
  45. package/dist/integration-engine/workers/index.js +6 -0
  46. package/dist/integration-engine/workers/index.js.map +1 -0
  47. package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.d.ts +10 -0
  48. package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js +35 -0
  49. package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js.map +1 -0
  50. package/dist/integration-engine/workers/tasks/RefreshWaitingQueuesTask.d.ts +10 -0
  51. package/dist/integration-engine/workers/tasks/RefreshWaitingQueuesTask.js +39 -0
  52. package/dist/integration-engine/workers/tasks/RefreshWaitingQueuesTask.js.map +1 -0
  53. package/dist/integration-engine/workers/tasks/SaveWaitingQueuesDataToHistoryTask.d.ts +11 -0
  54. package/dist/integration-engine/workers/tasks/SaveWaitingQueuesDataToHistoryTask.js +33 -0
  55. package/dist/integration-engine/workers/tasks/SaveWaitingQueuesDataToHistoryTask.js.map +1 -0
  56. package/dist/integration-engine/workers/tasks/index.d.ts +3 -0
  57. package/dist/{output-gateway/models → integration-engine/workers/tasks}/index.js +3 -2
  58. package/dist/integration-engine/workers/tasks/index.js.map +1 -0
  59. package/dist/output-gateway/MunicipalAuthoritiesRouter.d.ts +2 -10
  60. package/dist/output-gateway/MunicipalAuthoritiesRouter.js +13 -57
  61. package/dist/output-gateway/MunicipalAuthoritiesRouter.js.map +1 -1
  62. package/dist/output-gateway/index.d.ts +1 -1
  63. package/dist/output-gateway/index.js +1 -1
  64. package/dist/output-gateway/index.js.map +1 -1
  65. package/dist/output-gateway/repositories/FilterHelper.d.ts +11 -0
  66. package/dist/output-gateway/repositories/FilterHelper.js +58 -0
  67. package/dist/output-gateway/repositories/FilterHelper.js.map +1 -0
  68. package/dist/output-gateway/repositories/MunicipalAuthoritiesRepository.d.ts +12 -0
  69. package/dist/output-gateway/repositories/MunicipalAuthoritiesRepository.js +92 -0
  70. package/dist/output-gateway/repositories/MunicipalAuthoritiesRepository.js.map +1 -0
  71. package/dist/output-gateway/repositories/SkodaPalaceQueuesRepository.d.ts +7 -0
  72. package/dist/output-gateway/repositories/SkodaPalaceQueuesRepository.js +56 -0
  73. package/dist/output-gateway/repositories/SkodaPalaceQueuesRepository.js.map +1 -0
  74. package/dist/schema-definitions/MunicipalAuthorities.d.ts +37 -0
  75. package/dist/schema-definitions/MunicipalAuthorities.js +8 -0
  76. package/dist/schema-definitions/MunicipalAuthorities.js.map +1 -0
  77. package/dist/schema-definitions/SkodaPalaceQueues.d.ts +37 -0
  78. package/dist/schema-definitions/SkodaPalaceQueues.js +12 -0
  79. package/dist/schema-definitions/SkodaPalaceQueues.js.map +1 -0
  80. package/dist/schema-definitions/datasources/MunicipalAuthoritiesJsonSchema.d.ts +37 -0
  81. package/dist/schema-definitions/datasources/MunicipalAuthoritiesJsonSchema.js +86 -0
  82. package/dist/schema-definitions/datasources/MunicipalAuthoritiesJsonSchema.js.map +1 -0
  83. package/dist/schema-definitions/datasources/SkodaPalaceQueuesJsonSchema.d.ts +29 -0
  84. package/dist/schema-definitions/datasources/SkodaPalaceQueuesJsonSchema.js +49 -0
  85. package/dist/schema-definitions/datasources/SkodaPalaceQueuesJsonSchema.js.map +1 -0
  86. package/dist/schema-definitions/index.d.ts +1 -207
  87. package/dist/schema-definitions/index.js +9 -247
  88. package/dist/schema-definitions/index.js.map +1 -1
  89. package/dist/schema-definitions/models/AuthorityModel.d.ts +22 -0
  90. package/dist/schema-definitions/models/AuthorityModel.js +99 -0
  91. package/dist/schema-definitions/models/AuthorityModel.js.map +1 -0
  92. package/dist/schema-definitions/models/QueueHistoryModel.d.ts +13 -0
  93. package/dist/schema-definitions/models/QueueHistoryModel.js +34 -0
  94. package/dist/schema-definitions/models/QueueHistoryModel.js.map +1 -0
  95. package/dist/schema-definitions/models/QueueModel.d.ts +14 -0
  96. package/dist/schema-definitions/models/QueueModel.js +43 -0
  97. package/dist/schema-definitions/models/QueueModel.js.map +1 -0
  98. package/docs/assets/municipalauthorities_erd.png +0 -0
  99. package/docs/implementation_documentation.md +112 -0
  100. package/docs/openapi.yaml +423 -0
  101. package/package.json +66 -61
  102. package/db/example/mongo_data/dataplatform/municipalauthorities.bson +0 -0
  103. package/db/example/mongo_data/dataplatform/municipalauthorities.metadata.json +0 -1
  104. package/db/example/mongo_data/dataplatform/municipalauthorities_queues.bson +0 -0
  105. package/db/example/mongo_data/dataplatform/municipalauthorities_queues.metadata.json +0 -1
  106. package/db/example/mongo_data/dataplatform/municipalauthorities_queues_history.bson +0 -0
  107. package/db/example/mongo_data/dataplatform/municipalauthorities_queues_history.metadata.json +0 -1
  108. package/db/example/mongo_data/dataplatform/skodapalacequeues.bson +0 -0
  109. package/db/example/mongo_data/dataplatform/skodapalacequeues.metadata.json +0 -1
  110. package/dist/index.d.ts +0 -3
  111. package/dist/index.js +0 -31
  112. package/dist/index.js.map +0 -1
  113. package/dist/integration-engine/MunicipalAuthoritiesTransformation.d.ts +0 -8
  114. package/dist/integration-engine/MunicipalAuthoritiesTransformation.js.map +0 -1
  115. package/dist/integration-engine/MunicipalAuthoritiesWorker.d.ts +0 -15
  116. package/dist/integration-engine/MunicipalAuthoritiesWorker.js +0 -119
  117. package/dist/integration-engine/MunicipalAuthoritiesWorker.js.map +0 -1
  118. package/dist/integration-engine/SkodaPalaceQueuesTransformation.d.ts +0 -11
  119. package/dist/integration-engine/SkodaPalaceQueuesTransformation.js.map +0 -1
  120. package/dist/integration-engine/queueDefinitions.d.ts +0 -3
  121. package/dist/integration-engine/queueDefinitions.js +0 -45
  122. package/dist/integration-engine/queueDefinitions.js.map +0 -1
  123. package/dist/output-gateway/models/MunicipalAuthoritiesModel.d.ts +0 -7
  124. package/dist/output-gateway/models/MunicipalAuthoritiesModel.js +0 -17
  125. package/dist/output-gateway/models/MunicipalAuthoritiesModel.js.map +0 -1
  126. package/dist/output-gateway/models/MunicipalAuthoritiesQueuesModel.d.ts +0 -35
  127. package/dist/output-gateway/models/MunicipalAuthoritiesQueuesModel.js +0 -33
  128. package/dist/output-gateway/models/MunicipalAuthoritiesQueuesModel.js.map +0 -1
  129. package/dist/output-gateway/models/index.d.ts +0 -2
  130. package/dist/output-gateway/models/index.js.map +0 -1
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * app/routers/MunicipalAuthoritiesRouter.ts
4
- *
5
- * Router /WEB LAYER/: maps routes to specific model functions, passes request parameters and handles responses.
6
- * Handles web logic (http request, response). Sets response headers, handles error responses.
7
- */
8
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -14,74 +8,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
9
  });
16
10
  };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
11
  Object.defineProperty(exports, "__esModule", { value: true });
21
12
  exports.municipalAuthoritiesRouter = exports.MunicipalAuthoritiesRouter = void 0;
22
13
  const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
23
- const Geo_1 = require("@golemio/core/dist/output-gateway/Geo");
24
14
  const redis_1 = require("@golemio/core/dist/output-gateway/redis");
25
15
  const routes_1 = require("@golemio/core/dist/output-gateway/routes");
26
- const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
27
- const models_1 = require("./models");
28
- const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
16
+ const _1 = require(".");
17
+ const SkodaPalaceQueuesRepository_1 = require("./repositories/SkodaPalaceQueuesRepository");
29
18
  class MunicipalAuthoritiesRouter extends routes_1.GeoJsonRouter {
30
19
  constructor() {
31
- super(new models_1.MunicipalAuthoritiesModel());
32
- this.model = new models_1.MunicipalAuthoritiesModel();
33
- this.queuesModel = new models_1.MunicipalAuthoritiesQueuesModel();
34
- this.GetAll = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
35
- // Parsing parameters
36
- let ids = req.query.ids;
37
- let districts = req.query.districts;
38
- const typeFilter = req.query.type;
39
- let additionalFilters = {};
40
- if (districts) {
41
- districts = this.ConvertToArray(districts);
42
- }
43
- if (ids) {
44
- ids = this.ConvertToArray(ids);
45
- }
46
- try {
47
- const coords = yield (0, Geo_1.parseCoordinates)(req.query.latlng, req.query.range);
48
- if (typeFilter) {
49
- additionalFilters = Object.assign(Object.assign({}, additionalFilters), { "properties.type.id": req.query.type });
50
- }
51
- const data = yield this.model.GetAll({
52
- additionalFilters,
53
- districts,
54
- ids,
55
- lat: coords.lat,
56
- limit: Number(req.query.limit) || undefined,
57
- lng: coords.lng,
58
- offset: Number(req.query.offset) || undefined,
59
- range: coords.range,
60
- updatedSince: req.query.updatedSince,
61
- });
62
- res.status(200).send(data);
63
- }
64
- catch (err) {
65
- next(err);
66
- }
67
- });
20
+ super(new _1.MunicipalAuthoritiesRepository());
68
21
  this.GetQueues = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
69
22
  try {
70
- const data = yield this.queuesModel.GetQueuesByOfficeId(req.params.id);
71
- if (!data) {
72
- return res.status(204).send();
23
+ if (req.params.id != "skoduv-palac") {
24
+ return res.status(404).send();
25
+ }
26
+ const data = yield this.skodaPalaceQueuesRepository.GetAll();
27
+ if (data) {
28
+ res.status(200).send(data);
29
+ }
30
+ else {
31
+ res.status(404).send();
73
32
  }
74
- data.last_updated ? (data.last_updated = (0, moment_timezone_1.default)(data.last_updated).toISOString()) : null;
75
- data.updated_at ? (data.updated_at = (0, moment_timezone_1.default)(data.updated_at).toISOString()) : null;
76
- return res.status(200).send(data);
77
33
  }
78
34
  catch (err) {
79
35
  next(err);
80
36
  }
81
37
  });
38
+ this.skodaPalaceQueuesRepository = new SkodaPalaceQueuesRepository_1.SkodaPalaceQueuesRepository();
82
39
  this.initRoutes();
83
40
  this.router.get("/:id/queues", [(0, express_validator_1.param)("id").exists().isString()], (0, redis_1.useCacheMiddleware)(), this.GetQueues);
84
- this.router.get("/", [(0, express_validator_1.query)("type").optional().isString()], this.standardParams, Validation_1.pagination, (0, Validation_1.paginationLimitMiddleware)("MunicipalAuthoritiesRouter"), (0, redis_1.useCacheMiddleware)(), this.GetAll);
85
41
  }
86
42
  }
87
43
  exports.MunicipalAuthoritiesRouter = MunicipalAuthoritiesRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"MunicipalAuthoritiesR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,CAAC,IAAI,EAAE,CAAC;iBACjC;gBAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC;gBAE7D,IAAI,IAAI,EAAE;oBACN,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBAC9B;qBAAM;oBACH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;iBAC1B;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QArBE,IAAI,CAAC,2BAA2B,GAAG,IAAI,yDAA2B,EAAE,CAAC;QACrE,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAA,0BAAkB,GAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5G,CAAC;CAmBJ;AA1BD,gEA0BC;AAED,MAAM,0BAA0B,GAAW,IAAI,0BAA0B,EAAE,CAAC,MAAM,CAAC;AAE1E,gEAA0B"}
@@ -1,2 +1,2 @@
1
+ export * from "./repositories/MunicipalAuthoritiesRepository";
1
2
  export * from "./MunicipalAuthoritiesRouter";
2
- export * from "./models";
@@ -14,6 +14,6 @@ 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("./repositories/MunicipalAuthoritiesRepository"), exports);
17
18
  __exportStar(require("./MunicipalAuthoritiesRouter"), exports);
18
- __exportStar(require("./models"), exports);
19
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gFAA8D;AAC9D,+DAA6C"}
@@ -0,0 +1,11 @@
1
+ import { IGeoJsonAllFilterParameters } from "@golemio/core/dist/output-gateway";
2
+ import Sequelize, { WhereOptions } from "@golemio/core/dist/shared/sequelize";
3
+ export declare class FilterHelper {
4
+ static prepareFilterForType(additionalFiltersObj: {
5
+ type?: string;
6
+ } | undefined): WhereOptions[];
7
+ static prepareFilterForDistricts(options: IGeoJsonAllFilterParameters): WhereOptions[];
8
+ static prepareFilterForUpdateSince(options: IGeoJsonAllFilterParameters): WhereOptions[];
9
+ static prepareFilterForLocation(options: IGeoJsonAllFilterParameters): WhereOptions[];
10
+ static prepareOrderFunction(options: IGeoJsonAllFilterParameters | undefined): Sequelize.Order | undefined;
11
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FilterHelper = void 0;
7
+ const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
8
+ class FilterHelper {
9
+ static prepareFilterForType(additionalFiltersObj) {
10
+ return additionalFiltersObj && additionalFiltersObj.type && additionalFiltersObj.type.length > 0
11
+ ? [
12
+ {
13
+ type: {
14
+ [sequelize_1.default.Op.eq]: additionalFiltersObj.type,
15
+ },
16
+ },
17
+ ]
18
+ : [];
19
+ }
20
+ static prepareFilterForDistricts(options) {
21
+ return options.districts && options.districts.length > 0
22
+ ? [
23
+ {
24
+ district: {
25
+ [sequelize_1.default.Op.in]: options.districts,
26
+ },
27
+ },
28
+ ]
29
+ : [];
30
+ }
31
+ static prepareFilterForUpdateSince(options) {
32
+ return options.updatedSince
33
+ ? [
34
+ {
35
+ updated_at: {
36
+ [sequelize_1.default.Op.gt]: options === null || options === void 0 ? void 0 : options.updatedSince,
37
+ },
38
+ },
39
+ ]
40
+ : [];
41
+ }
42
+ static prepareFilterForLocation(options) {
43
+ return options.lat && options.lng && options.range
44
+ ? [
45
+ sequelize_1.default.fn("ST_DWithin", sequelize_1.default.col("geometry"), sequelize_1.default.cast(sequelize_1.default.fn("ST_SetSRID", sequelize_1.default.fn("ST_MakePoint", options.lng, options.lat), 4326), "geography"), options.range),
46
+ ]
47
+ : [];
48
+ }
49
+ static prepareOrderFunction(options) {
50
+ return (options === null || options === void 0 ? void 0 : options.lat) && options.lng
51
+ ? [
52
+ sequelize_1.default.fn("ST_Distance", sequelize_1.default.col("geometry"), sequelize_1.default.cast(sequelize_1.default.fn("ST_SetSRID", sequelize_1.default.fn("ST_MakePoint", options.lng, options.lat), 4326), "geography")),
53
+ ]
54
+ : undefined;
55
+ }
56
+ }
57
+ exports.FilterHelper = FilterHelper;
58
+ //# sourceMappingURL=FilterHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterHelper.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/FilterHelper.ts"],"names":[],"mappings":";;;;;;AACA,oFAA8E;AAE9E,MAAa,YAAY;IACd,MAAM,CAAC,oBAAoB,CAAC,oBAAmD;QAClF,OAAO,oBAAoB,IAAI,oBAAoB,CAAC,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAC5F,CAAC,CAAC;gBACI;oBACI,IAAI,EAAE;wBACF,CAAC,mBAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,oBAAoB,CAAC,IAAI;qBAC/C;iBACJ;aACJ;YACH,CAAC,CAAC,EAAE,CAAC;IACb,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,OAAoC;QACxE,OAAO,OAAO,CAAC,SAAS,I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AAS,CAAC,EAAE,CAAC,YAAY,EAAE,mBAAS,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EACxF,WAAW,CACd,CACJ;aACJ;YACH,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;CACJ;AAnED,oCAmEC"}
@@ -0,0 +1,12 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ import { IGeoJsonModel } from "@golemio/core/dist/output-gateway/models/interfaces/IGeoJsonModel";
3
+ import { IGeoJsonAllFilterParameters, IGeoJSONFeature, IGeoJSONFeatureCollection } from "@golemio/core/dist/output-gateway";
4
+ export declare class MunicipalAuthoritiesRepository extends SequelizeModel implements IGeoJsonModel {
5
+ constructor();
6
+ IsPrimaryIdNumber(idKey: string): Promise<boolean>;
7
+ PrimaryIdentifierSelection(id: string): object;
8
+ GetProperties: () => Promise<any>;
9
+ GetAll: (options?: IGeoJsonAllFilterParameters) => Promise<IGeoJSONFeatureCollection>;
10
+ GetOne: (id: string) => Promise<IGeoJSONFeature | undefined>;
11
+ private formatOutput;
12
+ }
@@ -0,0 +1,92 @@
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 __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.MunicipalAuthoritiesRepository = void 0;
27
+ const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
28
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
29
+ const output_gateway_2 = require("@golemio/core/dist/output-gateway");
30
+ const FilterHelper_1 = require("./FilterHelper");
31
+ const _sch_1 = require("../../schema-definitions");
32
+ const AuthorityModel_1 = require("../../schema-definitions/models/AuthorityModel");
33
+ class MunicipalAuthoritiesRepository extends output_gateway_1.SequelizeModel {
34
+ constructor() {
35
+ super("MunicipalAuthoritiesRepository", _sch_1.MunicipalAuthorities.definitions.municipalAuthorities.pgTableName, AuthorityModel_1.AuthorityModel.attributeModel, { schema: _sch_1.MunicipalAuthorities.pgSchema });
36
+ this.GetProperties = () => __awaiter(this, void 0, void 0, function* () {
37
+ throw new Error("Method not implemented.");
38
+ });
39
+ this.GetAll = (options = {}) => __awaiter(this, void 0, void 0, function* () {
40
+ const result = yield this.sequelizeModel.findAll({
41
+ attributes: {
42
+ include: ["updated_at"],
43
+ },
44
+ where: options
45
+ ? {
46
+ [sequelize_1.default.Op.and]: [
47
+ ...FilterHelper_1.FilterHelper.prepareFilterForType(options.additionalFilters),
48
+ ...FilterHelper_1.FilterHelper.prepareFilterForLocation(options),
49
+ ...FilterHelper_1.FilterHelper.prepareFilterForUpdateSince(options),
50
+ ...FilterHelper_1.FilterHelper.prepareFilterForDistricts(options),
51
+ ],
52
+ }
53
+ : {},
54
+ limit: options === null || options === void 0 ? void 0 : options.limit,
55
+ offset: Number.isInteger(options === null || options === void 0 ? void 0 : options.offset) ? options === null || options === void 0 ? void 0 : options.offset : undefined,
56
+ order: FilterHelper_1.FilterHelper.prepareOrderFunction(options),
57
+ });
58
+ return (0, output_gateway_2.buildGeojsonFeatureCollection)(result.map((record) => {
59
+ return this.formatOutput(record);
60
+ }));
61
+ });
62
+ this.GetOne = (id) => __awaiter(this, void 0, void 0, function* () {
63
+ const result = yield this.sequelizeModel.findOne({
64
+ attributes: {
65
+ include: ["updated_at"],
66
+ },
67
+ where: { id },
68
+ });
69
+ return result ? this.formatOutput(result) : undefined;
70
+ });
71
+ this.formatOutput = (record) => {
72
+ const _a = record.get({ plain: true }), { geometry, address_formatted, type, description } = _a, rest = __rest(_a, ["geometry", "address_formatted", "type", "description"]);
73
+ return (0, output_gateway_2.buildGeojsonFeatureLatLng)(Object.assign(Object.assign({}, rest), {
74
+ address: {
75
+ address_formatted,
76
+ },
77
+ type: {
78
+ description,
79
+ id: type,
80
+ },
81
+ }), geometry.coordinates[0], geometry.coordinates[1]);
82
+ };
83
+ }
84
+ IsPrimaryIdNumber(idKey) {
85
+ return Promise.resolve(false);
86
+ }
87
+ PrimaryIdentifierSelection(id) {
88
+ return { id };
89
+ }
90
+ }
91
+ exports.MunicipalAuthoritiesRepository = MunicipalAuthoritiesRepository;
92
+ //# sourceMappingURL=MunicipalAuthoritiesRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MunicipalAuthoritiesRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/MunicipalAuthoritiesRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,sEAA2F;AAE3F,sEAM2C;AAC3C,iDAA8C;AAE9C,mDAA4C;AAC5C,mFAA4D;AAE5D,MAAa,8BAA+B,SAAQ,+BAAc;IAC9D;QACI,KAAK,CACD,gCAAgC,EAChC,2BAAoB,CAAC,WAAW,CAAC,oBAAoB,CAAC,WAAW,EACjE,+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,CAAA,CAAC;QAEK,WAAM,GAAG,CAAO,EAAU,EAAwC,EAAE;YACvE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAiB;gBAC7D,UAAU,EAAE;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;iBAC1B;gBACD,KAAK,EAAE,EAAE,EAAE,EAAE;aAChB,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1D,CAAC,CAAA,CAAC;QAEM,iBAAY,GAAG,CAAC,MAAsB,EAA+B,EAAE;YAC3E,MAAM,KAA8D,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAzF,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,OAAyC,EAApC,IAAI,cAAzD,wDAA2D,CAA8B,CAAC;YAChG,OAAO,IAAA,0CAAyB,kCAErB,IAAI,GACJ;gBACC,OAAO,EAAE;oBACL,iBAAiB;iBACpB;gBACD,IAAI,EAAE;oBACF,WAAW;oBACX,EAAE,EAAE,IAAI;iBACX;aACJ,GAEL,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EACvB,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAC1B,CAAC;QACN,CAAC,CAAC;IAtEF,CAAC;IAEM,iBAAiB,CAAC,KAAa;QAClC,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAEM,0BAA0B,CAAC,EAAU;QACxC,OAAO,EAAE,EAAE,EAAE,CAAC;IAClB,CAAC;CA+DJ;AA/ED,wEA+EC"}
@@ -0,0 +1,7 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ import { ISkodaPalaceQueueOutput } from "../../schema-definitions/SkodaPalaceQueues";
3
+ export declare class SkodaPalaceQueuesRepository extends SequelizeModel {
4
+ constructor();
5
+ GetAll: () => Promise<ISkodaPalaceQueueOutput | null>;
6
+ GetOne: () => Promise<any>;
7
+ }
@@ -0,0 +1,56 @@
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.SkodaPalaceQueuesRepository = void 0;
13
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
14
+ const _sch_1 = require("../../schema-definitions");
15
+ const QueueModel_1 = require("../../schema-definitions/models/QueueModel");
16
+ const SkodaPalaceQueues_1 = require("../../schema-definitions/SkodaPalaceQueues");
17
+ const luxon_1 = require("@golemio/core/dist/shared/luxon");
18
+ class SkodaPalaceQueuesRepository extends output_gateway_1.SequelizeModel {
19
+ constructor() {
20
+ super("SkodaPalaceQueuesRepository", SkodaPalaceQueues_1.skodaPalaceQueues.pgTableName, QueueModel_1.QueueModel.attributeModel, {
21
+ schema: _sch_1.MunicipalAuthorities.pgSchema,
22
+ });
23
+ this.GetAll = () => __awaiter(this, void 0, void 0, function* () {
24
+ const result = yield this.sequelizeModel.findAll({
25
+ attributes: {
26
+ include: ["updated_at"],
27
+ },
28
+ });
29
+ if (result && result.length) {
30
+ return {
31
+ last_updated: result[0].last_updated
32
+ ? luxon_1.DateTime.fromJSDate(new Date(+result[0].last_updated), { zone: "Europe/Prague" }).toISO()
33
+ : null,
34
+ municipal_authority_id: "skoduv-palac",
35
+ served_activities: result.map((element) => {
36
+ return {
37
+ activity: element.activity,
38
+ number_of_person_in_queue: element.number_of_person_in_queue,
39
+ number_of_serving_counters: element.number_of_serving_counters,
40
+ };
41
+ }),
42
+ updated_at: result[0].updated_at
43
+ ? luxon_1.DateTime.fromJSDate(new Date(result[0].updated_at), { zone: "Europe/Prague" }).toISO()
44
+ : null,
45
+ title: "Monitoring odbavování klientů ve Škodově paláci",
46
+ };
47
+ }
48
+ return null;
49
+ });
50
+ this.GetOne = () => __awaiter(this, void 0, void 0, function* () {
51
+ throw new Error("Method not implemented.");
52
+ });
53
+ }
54
+ }
55
+ exports.SkodaPalaceQueuesRepository = SkodaPalaceQueuesRepository;
56
+ //# sourceMappingURL=SkodaPalaceQueuesRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkodaPalaceQueuesRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/SkodaPalaceQueuesRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sEAAmE;AACnE,mDAA4C;AAC5C,2EAAoD;AACpD,kFAAoF;AACpF,2DAA2D;AAE3D,MAAa,2BAA4B,SAAQ,+BAAc;IAC3D;QACI,KAAK,CAAC,6BAA6B,EAAE,qCAAiB,CAAC,WAAW,EAAE,uBAAU,CAAC,cAAc,EAAE;YAC3F,MAAM,EAAE,2BAAoB,CAAC,QAAQ;SACxC,CAAC,CAAC;QAGA,WAAM,GAAG,GAAkD,EAAE;YAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAa;gBACzD,UAAU,EAAE;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;iBAC1B;aACJ,CAAC,CAAC;YACH,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;gBACzB,OAAO;oBACH,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY;wBAChC,CAAC,CAAC,gBAAQ,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE;wBAC3F,CAAC,CAAC,IAAI;oBACV,sBAAsB,EAAE,cAAc;oBACtC,iBAAiB,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;wBACtC,OAAO;4BACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,yBAAyB,EAAE,OAAO,CAAC,yBAAyB;4BAC5D,0BAA0B,EAAE,OAAO,CAAC,0BAA0B;yBACjE,CAAC;oBACN,CAAC,CAAC;oBACF,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU;wBAC5B,CAAC,CAAC,gBAAQ,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE;wBACxF,CAAC,CAAC,IAAI;oBACV,KAAK,EAAE,iDAAiD;iBAC3D,CAAC;aACL;YACD,OAAO,IAAI,CAAC;QAChB,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAuB,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC,CAAA,CAAC;IAhCF,CAAC;CAiCJ;AAtCD,kEAsCC"}
@@ -0,0 +1,37 @@
1
+ import { Point } from "geojson";
2
+ export interface IAgenda {
3
+ description?: string;
4
+ keywords?: string[];
5
+ long_description?: string;
6
+ }
7
+ export interface IImage {
8
+ mimetype?: string;
9
+ size?: number;
10
+ url?: string;
11
+ }
12
+ export interface IOpeningHour {
13
+ closes: string;
14
+ day_of_week: string;
15
+ description: string | null;
16
+ opens: string;
17
+ }
18
+ export interface IMunicipalAuthority {
19
+ id: string;
20
+ geometry: Point;
21
+ address_formatted?: string;
22
+ agendas?: IAgenda[];
23
+ district?: string;
24
+ email?: string[];
25
+ image?: IImage;
26
+ name: string;
27
+ official_board?: string;
28
+ opening_hours?: IOpeningHour[];
29
+ telephone?: string[];
30
+ type?: string;
31
+ description?: string;
32
+ web?: string[];
33
+ }
34
+ export declare const municipalAuthorities: {
35
+ name: string;
36
+ pgTableName: string;
37
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.municipalAuthorities = void 0;
4
+ exports.municipalAuthorities = {
5
+ name: "MunicipalAuthorities",
6
+ pgTableName: "municipalauthorities",
7
+ };
8
+ //# sourceMappingURL=MunicipalAuthorities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MunicipalAuthorities.js","sourceRoot":"","sources":["../../src/schema-definitions/MunicipalAuthorities.ts"],"names":[],"mappings":";;;AAsCa,QAAA,oBAAoB,GAAG;IAChC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;CACtC,CAAC"}
@@ -0,0 +1,37 @@
1
+ export interface ISkodaPalaceQueue {
2
+ last_updated: number;
3
+ municipal_authority_id: string;
4
+ activity: string;
5
+ number_of_person_in_queue: number;
6
+ number_of_serving_counters: number;
7
+ title: string;
8
+ updated_at?: string;
9
+ }
10
+ export interface ISkodaPalaceQueueHistory {
11
+ last_updated: number;
12
+ municipal_authority_id: string;
13
+ activity: string;
14
+ number_of_person_in_queue: number;
15
+ number_of_serving_counters: number;
16
+ updated_at?: string;
17
+ }
18
+ export interface IServedActivity {
19
+ activity: string;
20
+ number_of_person_in_queue: number;
21
+ number_of_serving_counters: number;
22
+ }
23
+ export interface ISkodaPalaceQueueOutput {
24
+ last_updated: string | null;
25
+ municipal_authority_id: string;
26
+ served_activities: IServedActivity[];
27
+ updated_at: string | null;
28
+ title: string;
29
+ }
30
+ export declare const skodaPalaceQueues: {
31
+ name: string;
32
+ pgTableName: string;
33
+ };
34
+ export declare const skodaPalaceQueuesHistory: {
35
+ name: string;
36
+ pgTableName: string;
37
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skodaPalaceQueuesHistory = exports.skodaPalaceQueues = void 0;
4
+ exports.skodaPalaceQueues = {
5
+ name: "SkodaPalaceQueues",
6
+ pgTableName: "skodapalace_queues",
7
+ };
8
+ exports.skodaPalaceQueuesHistory = {
9
+ name: "SkodaPalaceQueuesHistory",
10
+ pgTableName: "skodapalace_queues_history",
11
+ };
12
+ //# sourceMappingURL=SkodaPalaceQueues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkodaPalaceQueues.js","sourceRoot":"","sources":["../../src/schema-definitions/SkodaPalaceQueues.ts"],"names":[],"mappings":";;;AAiCa,QAAA,iBAAiB,GAAG;IAC7B,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,oBAAoB;CACpC,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACpC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,4BAA4B;CAC5C,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
2
+ export interface IAgenda {
3
+ description?: string;
4
+ keywords?: string[];
5
+ long_description?: string;
6
+ }
7
+ export interface IImage {
8
+ filename?: string;
9
+ size?: number;
10
+ mimetype?: string;
11
+ url?: string;
12
+ }
13
+ export interface IMunicipalAuthoritiesInput {
14
+ name: string;
15
+ slug: string;
16
+ address?: string;
17
+ district?: string;
18
+ coordinates: number[];
19
+ opening_hours_friday?: string;
20
+ opening_hours_monday?: string;
21
+ opening_hours_saturday?: string;
22
+ opening_hours_sunday?: string;
23
+ opening_hours_thursday?: string;
24
+ opening_hours_tuesday?: string;
25
+ opening_hours_wednesday?: string;
26
+ official_board?: string;
27
+ agendas?: IAgenda[];
28
+ image?: IImage;
29
+ type?: string;
30
+ web?: string[];
31
+ email?: string[];
32
+ telephone?: string[];
33
+ }
34
+ export declare const municipalAuthoritiesDatasource: {
35
+ name: string;
36
+ jsonSchema: JSONSchemaType<IMunicipalAuthoritiesInput[]>;
37
+ };
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.municipalAuthoritiesDatasource = void 0;
4
+ const municipalAuthoritiesJsonSchema = {
5
+ type: "array",
6
+ items: {
7
+ type: "object",
8
+ properties: {
9
+ name: { type: "string" },
10
+ slug: { type: "string" },
11
+ address: { type: "string", nullable: true },
12
+ district: { type: "string", nullable: true },
13
+ coordinates: {
14
+ type: "array",
15
+ items: {
16
+ type: "number",
17
+ },
18
+ minItems: 2,
19
+ maxItems: 2,
20
+ },
21
+ opening_hours_friday: { type: "string", nullable: true },
22
+ opening_hours_monday: { type: "string", nullable: true },
23
+ opening_hours_saturday: { type: "string", nullable: true },
24
+ opening_hours_sunday: { type: "string", nullable: true },
25
+ opening_hours_thursday: { type: "string", nullable: true },
26
+ opening_hours_tuesday: { type: "string", nullable: true },
27
+ opening_hours_wednesday: { type: "string", nullable: true },
28
+ official_board: { type: "string", nullable: true },
29
+ agendas: {
30
+ type: "array",
31
+ items: {
32
+ type: "object",
33
+ properties: {
34
+ description: { type: "string", nullable: true },
35
+ keywords: {
36
+ type: "array",
37
+ items: { type: "string" },
38
+ nullable: true,
39
+ },
40
+ long_description: { type: "string", nullable: true },
41
+ },
42
+ },
43
+ nullable: true,
44
+ },
45
+ image: {
46
+ type: "object",
47
+ properties: {
48
+ filename: { type: "string", nullable: true },
49
+ size: { type: "number", nullable: true },
50
+ mimetype: { type: "string", nullable: true },
51
+ url: { type: "string", nullable: true },
52
+ },
53
+ nullable: true,
54
+ },
55
+ type: { type: "string", nullable: true },
56
+ web: {
57
+ type: "array",
58
+ items: {
59
+ type: "string",
60
+ },
61
+ nullable: true,
62
+ },
63
+ email: {
64
+ type: "array",
65
+ items: {
66
+ type: "string",
67
+ },
68
+ nullable: true,
69
+ },
70
+ telephone: {
71
+ type: "array",
72
+ items: {
73
+ type: "string",
74
+ },
75
+ nullable: true,
76
+ },
77
+ },
78
+ required: ["name", "slug", "coordinates"],
79
+ additionalProperties: false,
80
+ },
81
+ };
82
+ exports.municipalAuthoritiesDatasource = {
83
+ name: "MunicipalAuthoritiesDatasource",
84
+ jsonSchema: municipalAuthoritiesJsonSchema,
85
+ };
86
+ //# sourceMappingURL=MunicipalAuthoritiesJsonSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MunicipalAuthoritiesJsonSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/MunicipalAuthoritiesJsonSchema.ts"],"names":[],"mappings":";;;AAqCA,MAAM,8BAA8B,GAAiD;IACjF,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC5C,WAAW,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;iBACjB;gBACD,QAAQ,EAAE,CAAC;gBACX,QAAQ,EAAE,CAAC;aACd;YACD,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACxD,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACxD,sBAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1D,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACxD,sBAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1D,qBAAqB,EAAE,EAAE,IA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