@golemio/municipal-libraries 1.3.8 → 1.4.0-dev.2635611134
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/01_libraries.sql +22 -22
- package/db/migrations/postgresql/20260521145623-migrate-to-json-api.js +45 -0
- package/db/migrations/postgresql/20260527131433-add-opening-hours-type.js +45 -0
- package/db/migrations/postgresql/sqls/20260521145623-migrate-to-json-api-down.sql +31 -0
- package/db/migrations/postgresql/sqls/20260521145623-migrate-to-json-api-up.sql +16 -0
- package/db/migrations/postgresql/sqls/20260527131433-add-opening-hours-type-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20260527131433-add-opening-hours-type-up.sql +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/integration-engine/datasources/MunicipalLibrariesDataSource.d.ts +1 -2
- package/dist/integration-engine/datasources/MunicipalLibrariesDataSource.js +3 -30
- package/dist/integration-engine/datasources/MunicipalLibrariesDataSource.js.map +1 -1
- package/dist/integration-engine/repositories/LibraryServicesRepository.js +4 -4
- package/dist/integration-engine/repositories/LibraryServicesRepository.js.map +1 -1
- package/dist/integration-engine/repositories/MunicipalLibrariesRepository.d.ts +1 -1
- package/dist/integration-engine/repositories/MunicipalLibrariesRepository.js +12 -12
- package/dist/integration-engine/repositories/MunicipalLibrariesRepository.js.map +1 -1
- package/dist/integration-engine/repositories/OpeningHoursRepository.js +4 -4
- package/dist/integration-engine/repositories/OpeningHoursRepository.js.map +1 -1
- package/dist/integration-engine/repositories/ServicesRepository.js +4 -4
- package/dist/integration-engine/repositories/ServicesRepository.js.map +1 -1
- package/dist/integration-engine/transformations/MunicipalLibrariesTransformation.d.ts +7 -6
- package/dist/integration-engine/transformations/MunicipalLibrariesTransformation.js +26 -14
- package/dist/integration-engine/transformations/MunicipalLibrariesTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/helpers/TransformationHelper.d.ts +9 -11
- package/dist/integration-engine/transformations/helpers/TransformationHelper.js +66 -79
- package/dist/integration-engine/transformations/helpers/TransformationHelper.js.map +1 -1
- package/dist/integration-engine/transformations/index.d.ts +1 -0
- package/dist/integration-engine/transformations/index.js +18 -0
- package/dist/integration-engine/transformations/index.js.map +1 -0
- package/dist/integration-engine/workers/MunicipalLibrariesWorker.js +2 -2
- package/dist/integration-engine/workers/MunicipalLibrariesWorker.js.map +1 -1
- package/dist/integration-engine/workers/schemas/UpdateDistrictSchema.d.ts +2 -2
- package/dist/integration-engine/workers/schemas/UpdateDistrictSchema.js +2 -2
- package/dist/integration-engine/workers/schemas/UpdateDistrictSchema.js.map +1 -1
- package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js +5 -5
- package/dist/integration-engine/workers/tasks/RefreshDataInDBTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdateDistrictsTask.d.ts +2 -2
- package/dist/integration-engine/workers/tasks/UpdateDistrictsTask.js +3 -3
- package/dist/integration-engine/workers/tasks/UpdateDistrictsTask.js.map +1 -1
- package/dist/output-gateway/MunicipalLibrariesRouter.d.ts +0 -1
- package/dist/output-gateway/MunicipalLibrariesRouter.js +2 -2
- package/dist/output-gateway/MunicipalLibrariesRouter.js.map +1 -1
- package/dist/output-gateway/repositories/LibraryServicesRepository.js +3 -3
- package/dist/output-gateway/repositories/LibraryServicesRepository.js.map +1 -1
- package/dist/output-gateway/repositories/MunicipalLibrariesRepository.js +8 -8
- package/dist/output-gateway/repositories/MunicipalLibrariesRepository.js.map +1 -1
- package/dist/output-gateway/repositories/OpeningHoursRepository.js +3 -3
- package/dist/output-gateway/repositories/OpeningHoursRepository.js.map +1 -1
- package/dist/output-gateway/repositories/ServicesRepository.js +3 -3
- package/dist/output-gateway/repositories/ServicesRepository.js.map +1 -1
- package/dist/schema-definitions/Libraries.d.ts +1 -1
- package/dist/schema-definitions/LibraryServices.d.ts +1 -1
- package/dist/schema-definitions/OpeningHours.d.ts +2 -1
- package/dist/schema-definitions/OpeningHours.js.map +1 -1
- package/dist/schema-definitions/datasources/MunicipalLibrariesJsonSchema.d.ts +42 -51
- package/dist/schema-definitions/datasources/MunicipalLibrariesJsonSchema.js +96 -146
- package/dist/schema-definitions/datasources/MunicipalLibrariesJsonSchema.js.map +1 -1
- package/dist/schema-definitions/index.js +5 -5
- package/dist/schema-definitions/index.js.map +1 -1
- package/dist/schema-definitions/models/LibrariesModel.d.ts +2 -2
- package/dist/schema-definitions/models/LibrariesModel.js +2 -2
- package/dist/schema-definitions/models/LibrariesModel.js.map +1 -1
- package/dist/schema-definitions/models/LibraryServicesModel.d.ts +2 -2
- package/dist/schema-definitions/models/LibraryServicesModel.js +2 -2
- package/dist/schema-definitions/models/LibraryServicesModel.js.map +1 -1
- package/dist/schema-definitions/models/OpeningHoursModel.d.ts +4 -3
- package/dist/schema-definitions/models/OpeningHoursModel.js +5 -3
- package/dist/schema-definitions/models/OpeningHoursModel.js.map +1 -1
- package/dist/schema-definitions/models/ServicesModel.d.ts +2 -2
- package/docs/implementation_documentation.md +8 -3
- package/docs/openapi.yaml +8 -4
- package/package.json +91 -64
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
INSERT INTO libraries (id, name, geometry, address, district, web, email, telephone, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by) VALUES
|
|
2
|
-
(
|
|
3
|
-
(
|
|
2
|
+
('ustredni-knihovna', 'Ústřední knihovna', '0101000020E61000004B02D4D4B2D52C40892991442F0B4940', '{"address_country":"Česko","address_formatted":"Mariánské náměstí 98/1, 115 72 Praha 1, Česko","address_locality":"Praha 1","postal_code":"115 72","street_address":"Mariánské náměstí 98/1"}', 'praha-1', 'https://www.mlp.cz/cz/pobocky/ustredni-knihovna/', 'knihovna@mlp.cz', '+420 222 113 555', NULL, '2022-09-22 21:51:55.3+00', NULL, NULL, '2022-09-22 22:37:59.792+00', NULL),
|
|
3
|
+
('barrandov', 'Barrandov', '0101000020E610000078280AF489BC2C400C923EADA2034940', '{"address_country":"Česko","address_formatted":"Wassermannova 926/16, 152 00 Praha 5, Česko","address_locality":"Praha 5","postal_code":"152 00","street_address":"Wassermannova 926/16"}', 'praha-6', 'https://www.mlp.cz/cz/pobocky/barrandov/', 'knihovna@mlp.cz', '+420 770 130 262', NULL, '2022-09-21 21:51:55.298+00', NULL, NULL, '2022-09-21 22:37:59.79+00', NULL);
|
|
4
4
|
|
|
5
5
|
INSERT INTO services (id, name, description, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by) VALUES
|
|
6
6
|
(1, 'Kopírování', 'Kopírujeme černobíle formáty A3, A4 z fondu knihovny', NULL, '2022-09-21 21:51:56.252+00', NULL, NULL, '2022-09-21 22:37:59.879+00', NULL),
|
|
@@ -11,24 +11,24 @@ INSERT INTO services (id, name, description, create_batch_id, created_at, create
|
|
|
11
11
|
(6, 'Digitální piano', 'Můžete si zahrát na digitální piano značky Yamaha.', NULL, '2022-09-21 21:51:56.247+00', NULL, NULL, '2022-09-21 22:37:59.879+00', NULL);
|
|
12
12
|
|
|
13
13
|
INSERT INTO library_services (library_id, service_id, updated_at, created_at) VALUES
|
|
14
|
-
(
|
|
15
|
-
(
|
|
16
|
-
(
|
|
17
|
-
(
|
|
18
|
-
(
|
|
19
|
-
(
|
|
20
|
-
(
|
|
21
|
-
(
|
|
14
|
+
('ustredni-knihovna', 1, '2022-09-21 06:09:07.644+00', '2022-09-21 06:09:07.644+00'),
|
|
15
|
+
('ustredni-knihovna', 2, '2022-09-21 06:09:07.644+00', '2022-09-21 06:09:07.644+00'),
|
|
16
|
+
('ustredni-knihovna', 3, '2022-09-21 06:09:07.644+00', '2022-09-21 06:09:07.644+00'),
|
|
17
|
+
('ustredni-knihovna', 4, '2022-09-21 06:09:07.644+00', '2022-09-21 06:09:07.644+00'),
|
|
18
|
+
('ustredni-knihovna', 5, '2022-09-21 06:09:07.644+00', '2022-09-21 06:09:07.644+00'),
|
|
19
|
+
('ustredni-knihovna', 6, '2022-09-21 06:09:07.644+00', '2022-09-21 06:09:07.644+00'),
|
|
20
|
+
('barrandov', 3, '2022-09-21 06:09:07.641+00', '2022-09-21 06:09:07.641+00'),
|
|
21
|
+
('barrandov', 4, '2022-09-21 06:09:07.641+00', '2022-09-21 06:09:07.641+00');
|
|
22
22
|
|
|
23
|
-
INSERT INTO opening_hours (id, library_id, day_of_week, opens, closes, description, is_default, valid_from, valid_through, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by) VALUES
|
|
24
|
-
(1,
|
|
25
|
-
(2,
|
|
26
|
-
(3,
|
|
27
|
-
(4,
|
|
28
|
-
(5,
|
|
29
|
-
(200,
|
|
30
|
-
(201,
|
|
31
|
-
(202,
|
|
32
|
-
(203,
|
|
33
|
-
(204,
|
|
34
|
-
(205,
|
|
23
|
+
INSERT INTO opening_hours (id, library_id, day_of_week, opens, closes, description, is_default, valid_from, valid_through, type, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by) VALUES
|
|
24
|
+
(1, 'barrandov', 'Monday', '13:00', '19:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
25
|
+
(2, 'barrandov', 'Tuesday', '09:00', '16:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
26
|
+
(3, 'barrandov', 'Wednesday', '12:00', '19:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
27
|
+
(4, 'barrandov', 'Thursday', '12:00', '19:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
28
|
+
(5, 'barrandov', 'Friday', '09:00', '16:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
29
|
+
(200, 'ustredni-knihovna', 'Monday', '13:00', '20:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
30
|
+
(201, 'ustredni-knihovna', 'Tuesday', '09:00', '20:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
31
|
+
(202, 'ustredni-knihovna', 'Wednesday', '09:00', '20:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
32
|
+
(203, 'ustredni-knihovna', 'Thursday', '09:00', '20:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
33
|
+
(204, 'ustredni-knihovna', 'Friday', '09:00', '20:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL),
|
|
34
|
+
(205, 'ustredni-knihovna', 'Saturday', '13:00', '18:00', 'Základní provozní doba', true, NULL, NULL, 'standard', NULL, '2022-09-21 06:21:02.193+00', NULL, NULL, '2022-09-21 06:21:02.193+00', NULL);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
exports.setup = function(options, seedLink) {
|
|
11
|
+
dbm = options.dbmigrate;
|
|
12
|
+
type = dbm.dataType;
|
|
13
|
+
seed = seedLink;
|
|
14
|
+
Promise = options.Promise;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.up = function(db) {
|
|
18
|
+
var filePath = path.join(__dirname, 'sqls', '20260521145623-migrate-to-json-api-up.sql');
|
|
19
|
+
return new Promise(function(resolve, reject) {
|
|
20
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err, data) {
|
|
21
|
+
if (err) return reject(err);
|
|
22
|
+
console.log('received data: ' + data);
|
|
23
|
+
resolve(data);
|
|
24
|
+
});
|
|
25
|
+
}).then(function(data) {
|
|
26
|
+
return db.runSql(data);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.down = function(db) {
|
|
31
|
+
var filePath = path.join(__dirname, 'sqls', '20260521145623-migrate-to-json-api-down.sql');
|
|
32
|
+
return new Promise(function(resolve, reject) {
|
|
33
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err, data) {
|
|
34
|
+
if (err) return reject(err);
|
|
35
|
+
console.log('received data: ' + data);
|
|
36
|
+
resolve(data);
|
|
37
|
+
});
|
|
38
|
+
}).then(function(data) {
|
|
39
|
+
return db.runSql(data);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports._meta = {
|
|
44
|
+
"version": 1
|
|
45
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
exports.setup = function(options, seedLink) {
|
|
11
|
+
dbm = options.dbmigrate;
|
|
12
|
+
type = dbm.dataType;
|
|
13
|
+
seed = seedLink;
|
|
14
|
+
Promise = options.Promise;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.up = function(db) {
|
|
18
|
+
var filePath = path.join(__dirname, 'sqls', '20260527131433-add-opening-hours-type-up.sql');
|
|
19
|
+
return new Promise(function(resolve, reject) {
|
|
20
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err, data) {
|
|
21
|
+
if (err) return reject(err);
|
|
22
|
+
console.log('received data: ' + data);
|
|
23
|
+
resolve(data);
|
|
24
|
+
});
|
|
25
|
+
}).then(function(data) {
|
|
26
|
+
return db.runSql(data);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.down = function(db) {
|
|
31
|
+
var filePath = path.join(__dirname, 'sqls', '20260527131433-add-opening-hours-type-down.sql');
|
|
32
|
+
return new Promise(function(resolve, reject) {
|
|
33
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err, data) {
|
|
34
|
+
if (err) return reject(err);
|
|
35
|
+
console.log('received data: ' + data);
|
|
36
|
+
resolve(data);
|
|
37
|
+
});
|
|
38
|
+
}).then(function(data) {
|
|
39
|
+
return db.runSql(data);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports._meta = {
|
|
44
|
+
"version": 1
|
|
45
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
ALTER TABLE library_services DROP CONSTRAINT libraries_fk;
|
|
2
|
+
ALTER TABLE opening_hours DROP CONSTRAINT opening_hours_fk;
|
|
3
|
+
|
|
4
|
+
-- Assign sequential integer IDs to libraries and propagate to FK tables
|
|
5
|
+
ALTER TABLE libraries ADD COLUMN new_id SERIAL;
|
|
6
|
+
|
|
7
|
+
UPDATE library_services SET library_id = l.new_id::text
|
|
8
|
+
FROM libraries l WHERE library_services.library_id = l.id;
|
|
9
|
+
|
|
10
|
+
UPDATE opening_hours SET library_id = l.new_id::text
|
|
11
|
+
FROM libraries l WHERE opening_hours.library_id = l.id;
|
|
12
|
+
|
|
13
|
+
UPDATE libraries SET id = new_id::text;
|
|
14
|
+
ALTER TABLE libraries DROP COLUMN new_id;
|
|
15
|
+
|
|
16
|
+
-- Convert columns back to INTEGER
|
|
17
|
+
ALTER TABLE library_services ALTER COLUMN library_id TYPE INTEGER USING library_id::integer;
|
|
18
|
+
ALTER TABLE opening_hours ALTER COLUMN library_id TYPE INTEGER USING library_id::integer;
|
|
19
|
+
ALTER TABLE libraries ALTER COLUMN id TYPE INTEGER USING id::integer;
|
|
20
|
+
|
|
21
|
+
-- Restore sequences
|
|
22
|
+
CREATE SEQUENCE IF NOT EXISTS libraries_id_seq;
|
|
23
|
+
SELECT setval('libraries_id_seq', (SELECT COALESCE(MAX(id), 1) FROM libraries));
|
|
24
|
+
ALTER TABLE libraries ALTER COLUMN id SET DEFAULT nextval('libraries_id_seq');
|
|
25
|
+
|
|
26
|
+
CREATE SEQUENCE IF NOT EXISTS services_id_seq;
|
|
27
|
+
SELECT setval('services_id_seq', (SELECT COALESCE(MAX(id), 1) FROM services));
|
|
28
|
+
ALTER TABLE services ALTER COLUMN id SET DEFAULT nextval('services_id_seq');
|
|
29
|
+
|
|
30
|
+
ALTER TABLE library_services ADD CONSTRAINT libraries_fk FOREIGN KEY ("library_id") REFERENCES libraries("id") ON DELETE CASCADE;
|
|
31
|
+
ALTER TABLE opening_hours ADD CONSTRAINT opening_hours_fk FOREIGN KEY ("library_id") REFERENCES libraries("id") ON DELETE CASCADE;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- IDs are now provided by the application (URL slug), not by the DB sequence.
|
|
2
|
+
ALTER TABLE libraries ALTER COLUMN id DROP DEFAULT;
|
|
3
|
+
DROP SEQUENCE IF EXISTS libraries_id_seq;
|
|
4
|
+
|
|
5
|
+
ALTER TABLE services ALTER COLUMN id DROP DEFAULT;
|
|
6
|
+
DROP SEQUENCE IF EXISTS services_id_seq;
|
|
7
|
+
|
|
8
|
+
ALTER TABLE library_services DROP CONSTRAINT libraries_fk;
|
|
9
|
+
ALTER TABLE opening_hours DROP CONSTRAINT opening_hours_fk;
|
|
10
|
+
|
|
11
|
+
ALTER TABLE libraries ALTER COLUMN id TYPE VARCHAR(255);
|
|
12
|
+
ALTER TABLE opening_hours ALTER COLUMN library_id TYPE VARCHAR(255);
|
|
13
|
+
ALTER TABLE library_services ALTER COLUMN library_id TYPE VARCHAR(255);
|
|
14
|
+
|
|
15
|
+
ALTER TABLE library_services ADD CONSTRAINT libraries_fk FOREIGN KEY ("library_id") REFERENCES libraries("id") ON DELETE CASCADE;
|
|
16
|
+
ALTER TABLE opening_hours ADD CONSTRAINT opening_hours_fk FOREIGN KEY ("library_id") REFERENCES libraries("id") ON DELETE CASCADE;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE opening_hours DROP COLUMN "type";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE opening_hours ADD COLUMN "type" varchar(255) NOT NULL DEFAULT 'standard';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as IntegrationEngine from "
|
|
2
|
-
export * as SchemaDefinitions from "
|
|
1
|
+
export * as IntegrationEngine from "#ie/index";
|
|
2
|
+
export * as SchemaDefinitions from "#sch/index";
|
package/dist/index.js
CHANGED
|
@@ -15,16 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.SchemaDefinitions = exports.IntegrationEngine = void 0;
|
|
27
37
|
// Library exports
|
|
28
|
-
exports.IntegrationEngine = __importStar(require("
|
|
29
|
-
exports.SchemaDefinitions = __importStar(require("
|
|
38
|
+
exports.IntegrationEngine = __importStar(require("#ie/index"));
|
|
39
|
+
exports.SchemaDefinitions = __importStar(require("#sch/index"));
|
|
30
40
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,+DAA+C;AAC/C,gEAAgD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataSource } from "@golemio/core/dist/integration-engine/datasources";
|
|
2
2
|
export declare class MunicipalLibrariesDataSourceFactory {
|
|
3
|
-
private url;
|
|
3
|
+
private readonly url;
|
|
4
4
|
constructor();
|
|
5
5
|
getDataSource(): Promise<DataSource>;
|
|
6
|
-
private getHeadersWithCookie;
|
|
7
6
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MunicipalLibrariesDataSourceFactory = void 0;
|
|
4
|
-
const _sch_1 = require("
|
|
4
|
+
const _sch_1 = require("#sch");
|
|
5
5
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
6
6
|
const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
|
|
7
7
|
const HTTPFetchProtocolStrategy_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy");
|
|
8
8
|
const Di_1 = require("@golemio/core/dist/integration-engine/ioc/Di");
|
|
9
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
10
9
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
11
10
|
class MunicipalLibrariesDataSourceFactory {
|
|
12
11
|
constructor() {
|
|
@@ -15,36 +14,10 @@ class MunicipalLibrariesDataSourceFactory {
|
|
|
15
14
|
}
|
|
16
15
|
async getDataSource() {
|
|
17
16
|
return new datasources_1.DataSource(_sch_1.MunicipalLibraries.datasources.municipalLibrariesDatasource.name, new HTTPFetchProtocolStrategy_1.HTTPFetchProtocolStrategy({
|
|
18
|
-
headers: {
|
|
19
|
-
Cookie: await this.getHeadersWithCookie(),
|
|
20
|
-
},
|
|
21
17
|
method: "GET",
|
|
22
|
-
responseType: "
|
|
18
|
+
responseType: "json",
|
|
23
19
|
url: this.url,
|
|
24
|
-
}), new datasources_1.
|
|
25
|
-
resultsPath: "pobocky.pobocka",
|
|
26
|
-
xml2jsParams: { explicitArray: false, ignoreAttrs: true, trim: true, normalize: true, emptyTag: () => null },
|
|
27
|
-
}), new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.datasources.municipalLibrariesDatasource.name + "Validator", _sch_1.MunicipalLibraries.datasources.municipalLibrariesDatasource.jsonSchema));
|
|
28
|
-
}
|
|
29
|
-
async getHeadersWithCookie() {
|
|
30
|
-
try {
|
|
31
|
-
const result = await fetch(this.url, {
|
|
32
|
-
redirect: "manual",
|
|
33
|
-
});
|
|
34
|
-
const result2 = await fetch(result.headers.get("location"), {
|
|
35
|
-
redirect: "manual",
|
|
36
|
-
headers: {
|
|
37
|
-
Cookie: result.headers.get("set-cookie"),
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
const headers = new Headers();
|
|
41
|
-
headers.append("Cookie", result.headers.get("set-cookie"));
|
|
42
|
-
headers.append("Cookie", result2.headers.get("set-cookie"));
|
|
43
|
-
return headers.get("Cookie");
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
throw new golemio_errors_1.GeneralError("Error while getting headers with cookie", this.constructor.name, error);
|
|
47
|
-
}
|
|
20
|
+
}), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.datasources.municipalLibrariesDatasource.name + "Validator", _sch_1.MunicipalLibraries.datasources.municipalLibrariesDatasource.jsonSchema));
|
|
48
21
|
}
|
|
49
22
|
}
|
|
50
23
|
exports.MunicipalLibrariesDataSourceFactory = MunicipalLibrariesDataSourceFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MunicipalLibrariesDataSource.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/MunicipalLibrariesDataSource.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"MunicipalLibrariesDataSource.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/MunicipalLibrariesDataSource.ts"],"names":[],"mappings":";;;AAAA,+BAA0C;AAE1C,wEAAqE;AACrE,mFAAqG;AACrG,6IAA0I;AAC1I,qEAA0F;AAC1F,mFAAkF;AAElF,MAAa,mCAAmC;IAG5C;QACI,MAAM,YAAY,GAAG,+BAA0B,CAAC,OAAO,CAAgB,qBAAS,CAAC,YAAY,CAAC,CAAC;QAC/F,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;IAClE,CAAC;IAEM,KAAK,CAAC,aAAa;QACtB,OAAO,IAAI,wBAAU,CACjB,yBAAkB,CAAC,WAAW,CAAC,4BAA4B,CAAC,IAAI,EAChE,IAAI,qDAAyB,CAAC;YAC1B,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,MAAM;YACpB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,EACF,IAAI,kCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CACnB,yBAAkB,CAAC,WAAW,CAAC,4BAA4B,CAAC,IAAI,GAAG,WAAW,EAC9E,yBAAkB,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,CACzE,CACJ,CAAC;IACN,CAAC;CACJ;AAvBD,kFAuBC"}
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LibraryServicesRepository = void 0;
|
|
4
4
|
const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
5
5
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
6
|
-
const _sch_1 = require("
|
|
7
|
-
const
|
|
6
|
+
const _sch_1 = require("#sch");
|
|
7
|
+
const index_1 = require("#sch/models/index");
|
|
8
8
|
class LibraryServicesRepository extends models_1.PostgresModel {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(_sch_1.MunicipalLibraries.definitions.municipalLibrariesLibraryServices.name + "Repository", {
|
|
11
|
-
outputSequelizeAttributes:
|
|
11
|
+
outputSequelizeAttributes: index_1.LibraryServicesModel.attributeModel,
|
|
12
12
|
pgTableName: _sch_1.MunicipalLibraries.definitions.municipalLibrariesLibraryServices.pgTableName,
|
|
13
13
|
pgSchema: _sch_1.MunicipalLibraries.pgSchema,
|
|
14
14
|
savingType: "insertOrUpdate",
|
|
15
|
-
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibrariesLibraryServices.name + "Validator",
|
|
15
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibrariesLibraryServices.name + "Validator", index_1.LibraryServicesModel.jsonSchema));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.LibraryServicesRepository = LibraryServicesRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibraryServicesRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/LibraryServicesRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,mFAAkF;AAClF
|
|
1
|
+
{"version":3,"file":"LibraryServicesRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/LibraryServicesRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,mFAAkF;AAClF,+BAA0C;AAC1C,6CAAyD;AAEzD,MAAa,yBAA0B,SAAQ,sBAAa;IACxD;QACI,KAAK,CACD,yBAAkB,CAAC,WAAW,CAAC,iCAAiC,CAAC,IAAI,GAAG,YAAY,EACpF;YACI,yBAAyB,EAAE,4BAAoB,CAAC,cAAc;YAC9D,WAAW,EAAE,yBAAkB,CAAC,WAAW,CAAC,iCAAiC,CAAC,WAAW;YACzF,QAAQ,EAAE,yBAAkB,CAAC,QAAQ;YACrC,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CACnB,yBAAkB,CAAC,WAAW,CAAC,iCAAiC,CAAC,IAAI,GAAG,WAAW,EACnF,4BAAoB,CAAC,UAAU,CAClC,CACJ,CAAC;IACN,CAAC;CACJ;AAhBD,8DAgBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
|
|
2
|
-
import { ILibrariesTransformation } from "
|
|
2
|
+
import { ILibrariesTransformation } from "#ie";
|
|
3
3
|
export declare class MunicipalLibrariesRepository extends PostgresModel implements IModel {
|
|
4
4
|
private readonly servicesRepository;
|
|
5
5
|
private readonly libraryServicesRepository;
|
|
@@ -5,17 +5,17 @@ const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
|
5
5
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
6
6
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
7
7
|
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
8
|
-
const
|
|
9
|
-
const _sch_1 = require("
|
|
10
|
-
const
|
|
8
|
+
const index_1 = require("#ie/repositories/index");
|
|
9
|
+
const _sch_1 = require("#sch");
|
|
10
|
+
const index_2 = require("#sch/models/index");
|
|
11
11
|
class MunicipalLibrariesRepository extends models_1.PostgresModel {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(_sch_1.MunicipalLibraries.definitions.municipalLibraries.name + "Repository", {
|
|
14
|
-
outputSequelizeAttributes:
|
|
14
|
+
outputSequelizeAttributes: index_2.LibrariesModel.attributeModel,
|
|
15
15
|
pgTableName: _sch_1.MunicipalLibraries.definitions.municipalLibraries.pgTableName,
|
|
16
16
|
pgSchema: _sch_1.MunicipalLibraries.pgSchema,
|
|
17
17
|
savingType: "insertOrUpdate",
|
|
18
|
-
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibraries.name + "Validator",
|
|
18
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibraries.name + "Validator", index_2.LibrariesModel.jsonSchema));
|
|
19
19
|
this.removeDuplicates = (items) => {
|
|
20
20
|
const unique = new Map();
|
|
21
21
|
for (const item of items) {
|
|
@@ -25,9 +25,9 @@ class MunicipalLibrariesRepository extends models_1.PostgresModel {
|
|
|
25
25
|
}
|
|
26
26
|
return [...unique.values()];
|
|
27
27
|
};
|
|
28
|
-
this.servicesRepository = new
|
|
29
|
-
this.openingHoursRepository = new
|
|
30
|
-
this.libraryServicesRepository = new
|
|
28
|
+
this.servicesRepository = new index_1.ServicesRepository();
|
|
29
|
+
this.openingHoursRepository = new index_1.OpeningHoursRepository();
|
|
30
|
+
this.libraryServicesRepository = new index_1.LibraryServicesRepository();
|
|
31
31
|
this.sequelizeModel.belongsToMany(this.servicesRepository["sequelizeModel"], {
|
|
32
32
|
through: this.libraryServicesRepository["sequelizeModel"],
|
|
33
33
|
foreignKey: "library_id",
|
|
@@ -57,7 +57,7 @@ class MunicipalLibrariesRepository extends models_1.PostgresModel {
|
|
|
57
57
|
async saveLibrariesData(libraries, t) {
|
|
58
58
|
await this.validate(libraries);
|
|
59
59
|
await this.sequelizeModel.bulkCreate(libraries, {
|
|
60
|
-
updateOnDuplicate:
|
|
60
|
+
updateOnDuplicate: index_2.LibrariesModel.updateAttributes,
|
|
61
61
|
transaction: t,
|
|
62
62
|
});
|
|
63
63
|
return libraries.map((lib) => lib.id);
|
|
@@ -67,11 +67,11 @@ class MunicipalLibrariesRepository extends models_1.PostgresModel {
|
|
|
67
67
|
const relationData = services.map((s) => ({ service_id: s.id, library_id: s.library_id }));
|
|
68
68
|
await this.libraryServicesRepository.validate(relationData);
|
|
69
69
|
await this.servicesRepository["sequelizeModel"].bulkCreate(this.removeDuplicates(services), {
|
|
70
|
-
updateOnDuplicate:
|
|
70
|
+
updateOnDuplicate: index_2.ServicesModel.updateAttributes,
|
|
71
71
|
transaction: t,
|
|
72
72
|
});
|
|
73
73
|
await this.libraryServicesRepository["sequelizeModel"].bulkCreate(relationData, {
|
|
74
|
-
updateOnDuplicate:
|
|
74
|
+
updateOnDuplicate: index_2.LibraryServicesModel.updateAttributes,
|
|
75
75
|
transaction: t,
|
|
76
76
|
});
|
|
77
77
|
await this.libraryServicesRepository["sequelizeModel"].destroy({
|
|
@@ -82,7 +82,7 @@ class MunicipalLibrariesRepository extends models_1.PostgresModel {
|
|
|
82
82
|
async saveOpeningHoursData(hours, ids, updatedAt, t) {
|
|
83
83
|
await this.openingHoursRepository.validate(hours);
|
|
84
84
|
await this.openingHoursRepository["sequelizeModel"].bulkCreate(hours, {
|
|
85
|
-
updateOnDuplicate:
|
|
85
|
+
updateOnDuplicate: index_2.OpeningHoursModel.updateAttributes,
|
|
86
86
|
transaction: t,
|
|
87
87
|
});
|
|
88
88
|
await this.openingHoursRepository["sequelizeModel"].destroy({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MunicipalLibrariesRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/MunicipalLibrariesRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,8EAA0E;AAC1E,mFAAkF;AAClF,mEAAsE;AACtE,
|
|
1
|
+
{"version":3,"file":"MunicipalLibrariesRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/MunicipalLibrariesRepository.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OpeningHoursRepository = void 0;
|
|
4
4
|
const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
5
5
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
6
|
-
const _sch_1 = require("
|
|
7
|
-
const
|
|
6
|
+
const _sch_1 = require("#sch");
|
|
7
|
+
const index_1 = require("#sch/models/index");
|
|
8
8
|
class OpeningHoursRepository extends models_1.PostgresModel {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(_sch_1.MunicipalLibraries.definitions.municipalLibraryOpeningHours.name + "Repository", {
|
|
11
|
-
outputSequelizeAttributes:
|
|
11
|
+
outputSequelizeAttributes: index_1.OpeningHoursModel.attributeModel,
|
|
12
12
|
pgTableName: _sch_1.MunicipalLibraries.definitions.municipalLibraryOpeningHours.pgTableName,
|
|
13
13
|
pgSchema: _sch_1.MunicipalLibraries.pgSchema,
|
|
14
14
|
savingType: "insertOrUpdate",
|
|
15
|
-
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibraryOpeningHours.name + "Validator",
|
|
15
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibraryOpeningHours.name + "Validator", index_1.OpeningHoursModel.jsonSchema));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.OpeningHoursRepository = OpeningHoursRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpeningHoursRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/OpeningHoursRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,mFAAkF;AAClF
|
|
1
|
+
{"version":3,"file":"OpeningHoursRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/OpeningHoursRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,mFAAkF;AAClF,+BAA0C;AAC1C,6CAAsD;AAEtD,MAAa,sBAAuB,SAAQ,sBAAa;IACrD;QACI,KAAK,CACD,yBAAkB,CAAC,WAAW,CAAC,4BAA4B,CAAC,IAAI,GAAG,YAAY,EAC/E;YACI,yBAAyB,EAAE,yBAAiB,CAAC,cAAc;YAC3D,WAAW,EAAE,yBAAkB,CAAC,WAAW,CAAC,4BAA4B,CAAC,WAAW;YACpF,QAAQ,EAAE,yBAAkB,CAAC,QAAQ;YACrC,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CACnB,yBAAkB,CAAC,WAAW,CAAC,4BAA4B,CAAC,IAAI,GAAG,WAAW,EAC9E,yBAAiB,CAAC,UAAU,CAC/B,CACJ,CAAC;IACN,CAAC;CACJ;AAhBD,wDAgBC"}
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ServicesRepository = void 0;
|
|
4
4
|
const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
5
5
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
6
|
-
const _sch_1 = require("
|
|
7
|
-
const
|
|
6
|
+
const _sch_1 = require("#sch");
|
|
7
|
+
const index_1 = require("#sch/models/index");
|
|
8
8
|
class ServicesRepository extends models_1.PostgresModel {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(_sch_1.MunicipalLibraries.definitions.municipalLibraryServices.name + "Repository", {
|
|
11
|
-
outputSequelizeAttributes:
|
|
11
|
+
outputSequelizeAttributes: index_1.ServicesModel.attributeModel,
|
|
12
12
|
pgTableName: _sch_1.MunicipalLibraries.definitions.municipalLibraryServices.pgTableName,
|
|
13
13
|
pgSchema: _sch_1.MunicipalLibraries.pgSchema,
|
|
14
14
|
savingType: "insertOrUpdate",
|
|
15
|
-
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibraryServices.name + "Validator",
|
|
15
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.MunicipalLibraries.definitions.municipalLibraryServices.name + "Validator", index_1.ServicesModel.jsonSchema));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.ServicesRepository = ServicesRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/ServicesRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,mFAAkF;AAClF
|
|
1
|
+
{"version":3,"file":"ServicesRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/ServicesRepository.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,mFAAkF;AAClF,+BAA0C;AAC1C,6CAAkD;AAElD,MAAa,kBAAmB,SAAQ,sBAAa;IACjD;QACI,KAAK,CACD,yBAAkB,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,GAAG,YAAY,EAC3E;YACI,yBAAyB,EAAE,qBAAa,CAAC,cAAc;YACvD,WAAW,EAAE,yBAAkB,CAAC,WAAW,CAAC,wBAAwB,CAAC,WAAW;YAChF,QAAQ,EAAE,yBAAkB,CAAC,QAAQ;YACrC,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CACnB,yBAAkB,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,GAAG,WAAW,EAC1E,qBAAa,CAAC,UAAU,CAC3B,CACJ,CAAC;IACN,CAAC;CACJ;AAhBD,gDAgBC"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { ILibrariesInput } from "
|
|
2
|
-
import { ILibraries } from "
|
|
3
|
-
import { IServices } from "
|
|
4
|
-
import { IOpeningHours } from "
|
|
1
|
+
import { ILibrariesInput } from "#sch/datasources/MunicipalLibrariesJsonSchema";
|
|
2
|
+
import { ILibraries } from "#sch/Libraries";
|
|
3
|
+
import { IServices } from "#sch/Services";
|
|
4
|
+
import { IOpeningHours } from "#sch/OpeningHours";
|
|
5
5
|
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
6
6
|
export interface ILibrariesTransformation {
|
|
7
7
|
libraries: ILibraries[];
|
|
8
8
|
services: Array<IServices & {
|
|
9
|
-
library_id:
|
|
9
|
+
library_id: string;
|
|
10
10
|
}>;
|
|
11
11
|
opening_hours: Array<Omit<IOpeningHours, "id">>;
|
|
12
12
|
}
|
|
13
13
|
interface ILibraryItemTransformation extends ILibraries {
|
|
14
14
|
services: Array<IServices & {
|
|
15
|
-
library_id:
|
|
15
|
+
library_id: string;
|
|
16
16
|
}>;
|
|
17
17
|
opening_hours: Array<Omit<IOpeningHours, "id">>;
|
|
18
18
|
}
|
|
19
19
|
export declare class MunicipalLibrariesTransformation extends AbstractTransformation<ILibrariesInput, ILibraryItemTransformation> {
|
|
20
20
|
name: string;
|
|
21
|
+
private readonly transformationHelper;
|
|
21
22
|
constructor();
|
|
22
23
|
transformCollection: (data: ILibrariesInput[]) => ILibrariesTransformation;
|
|
23
24
|
protected transformInternal: (element: ILibrariesInput) => ILibraryItemTransformation;
|