@golemio/fypr 1.12.0 → 2.0.0-dev.2868130045
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/helpers/errors/ErrorHelper.d.ts +2 -2
- package/dist/helpers/errors/ErrorHelper.js +4 -7
- package/dist/helpers/errors/ErrorHelper.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -39
- package/dist/index.js.map +1 -1
- package/dist/integration-engine/data-sources/AbstractDBFYPRDataSourceFactory.d.ts +2 -2
- package/dist/integration-engine/data-sources/AbstractDBFYPRDataSourceFactory.js +7 -10
- package/dist/integration-engine/data-sources/AbstractDBFYPRDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/DBFYPRDisplayCasesDataSourceFactory.d.ts +3 -3
- package/dist/integration-engine/data-sources/DBFYPRDisplayCasesDataSourceFactory.js +10 -13
- package/dist/integration-engine/data-sources/DBFYPRDisplayCasesDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/DBFYPRInformationPanelsDataSourceFactory.d.ts +3 -3
- package/dist/integration-engine/data-sources/DBFYPRInformationPanelsDataSourceFactory.js +10 -13
- package/dist/integration-engine/data-sources/DBFYPRInformationPanelsDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/DBFYPRObelisksDataSourceFactory.d.ts +3 -3
- package/dist/integration-engine/data-sources/DBFYPRObelisksDataSourceFactory.js +10 -13
- package/dist/integration-engine/data-sources/DBFYPRObelisksDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/DBFYPRSignpostsDataSourceFactory.d.ts +3 -3
- package/dist/integration-engine/data-sources/DBFYPRSignpostsDataSourceFactory.js +10 -13
- package/dist/integration-engine/data-sources/DBFYPRSignpostsDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/DBFYPRTotemsDataSourceFactory.d.ts +3 -3
- package/dist/integration-engine/data-sources/DBFYPRTotemsDataSourceFactory.js +10 -13
- package/dist/integration-engine/data-sources/DBFYPRTotemsDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/DCIPStatusOverviewDataSourceFactory.d.ts +3 -3
- package/dist/integration-engine/data-sources/DCIPStatusOverviewDataSourceFactory.js +13 -15
- package/dist/integration-engine/data-sources/DCIPStatusOverviewDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/data-sources/protocol-strategies/StrapiPaginatedHTTPProtocolStrategy.d.ts +3 -3
- package/dist/integration-engine/data-sources/protocol-strategies/StrapiPaginatedHTTPProtocolStrategy.js +12 -15
- package/dist/integration-engine/data-sources/protocol-strategies/StrapiPaginatedHTTPProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/helpers/StrapiPaginationHelper.js +5 -8
- package/dist/integration-engine/helpers/StrapiPaginationHelper.js.map +1 -1
- package/dist/integration-engine/index.d.ts +1 -1
- package/dist/integration-engine/index.js +2 -5
- package/dist/integration-engine/index.js.map +1 -1
- package/dist/integration-engine/ioc/Di.d.ts +1 -1
- package/dist/integration-engine/ioc/Di.js +63 -66
- package/dist/integration-engine/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ioc/FYPRIEContainerTokens.js +1 -4
- package/dist/integration-engine/ioc/FYPRIEContainerTokens.js.map +1 -1
- package/dist/integration-engine/repositories/AbstractFyprRepository.d.ts +7 -7
- package/dist/integration-engine/repositories/AbstractFyprRepository.js +11 -13
- package/dist/integration-engine/repositories/AbstractFyprRepository.js.map +1 -1
- package/dist/integration-engine/repositories/DeviceStatusRepository.d.ts +7 -7
- package/dist/integration-engine/repositories/DeviceStatusRepository.js +22 -23
- package/dist/integration-engine/repositories/DeviceStatusRepository.js.map +1 -1
- package/dist/integration-engine/repositories/DisplayCaseRepository.d.ts +8 -8
- package/dist/integration-engine/repositories/DisplayCaseRepository.js +17 -19
- package/dist/integration-engine/repositories/DisplayCaseRepository.js.map +1 -1
- package/dist/integration-engine/repositories/InformationPanelPresetsRepository.d.ts +6 -6
- package/dist/integration-engine/repositories/InformationPanelPresetsRepository.js +28 -28
- package/dist/integration-engine/repositories/InformationPanelPresetsRepository.js.map +1 -1
- package/dist/integration-engine/repositories/InformationPanelPresetsRoutesRepository.d.ts +6 -6
- package/dist/integration-engine/repositories/InformationPanelPresetsRoutesRepository.js +24 -24
- package/dist/integration-engine/repositories/InformationPanelPresetsRoutesRepository.js.map +1 -1
- package/dist/integration-engine/repositories/InformationPanelPresetsStopsRepository.d.ts +6 -6
- package/dist/integration-engine/repositories/InformationPanelPresetsStopsRepository.js +24 -24
- package/dist/integration-engine/repositories/InformationPanelPresetsStopsRepository.js.map +1 -1
- package/dist/integration-engine/repositories/InformationPanelRepository.d.ts +8 -8
- package/dist/integration-engine/repositories/InformationPanelRepository.js +17 -19
- package/dist/integration-engine/repositories/InformationPanelRepository.js.map +1 -1
- package/dist/integration-engine/repositories/ObeliskRepository.d.ts +8 -8
- package/dist/integration-engine/repositories/ObeliskRepository.js +17 -19
- package/dist/integration-engine/repositories/ObeliskRepository.js.map +1 -1
- package/dist/integration-engine/repositories/SignpostRepository.d.ts +8 -8
- package/dist/integration-engine/repositories/SignpostRepository.js +17 -19
- package/dist/integration-engine/repositories/SignpostRepository.js.map +1 -1
- package/dist/integration-engine/repositories/TotemRepository.d.ts +8 -8
- package/dist/integration-engine/repositories/TotemRepository.js +17 -19
- package/dist/integration-engine/repositories/TotemRepository.js.map +1 -1
- package/dist/integration-engine/transformations/AbstractElementTransformation.d.ts +3 -3
- package/dist/integration-engine/transformations/AbstractElementTransformation.js +2 -6
- package/dist/integration-engine/transformations/AbstractElementTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/DisplayCasesTransformation.d.ts +3 -3
- package/dist/integration-engine/transformations/DisplayCasesTransformation.js +6 -9
- package/dist/integration-engine/transformations/DisplayCasesTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/InformationPanelsTransformation.d.ts +3 -3
- package/dist/integration-engine/transformations/InformationPanelsTransformation.js +6 -9
- package/dist/integration-engine/transformations/InformationPanelsTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/ObelisksTransformation.d.ts +3 -3
- package/dist/integration-engine/transformations/ObelisksTransformation.js +6 -9
- package/dist/integration-engine/transformations/ObelisksTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/SignpostsTransformation.d.ts +3 -3
- package/dist/integration-engine/transformations/SignpostsTransformation.js +6 -9
- package/dist/integration-engine/transformations/SignpostsTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/TotemsTransformation.d.ts +3 -3
- package/dist/integration-engine/transformations/TotemsTransformation.js +6 -9
- package/dist/integration-engine/transformations/TotemsTransformation.js.map +1 -1
- package/dist/integration-engine/workers/FYPRWorker.d.ts +2 -2
- package/dist/integration-engine/workers/FYPRWorker.js +14 -18
- package/dist/integration-engine/workers/FYPRWorker.js.map +1 -1
- package/dist/integration-engine/workers/constants.js +1 -4
- package/dist/integration-engine/workers/constants.js.map +1 -1
- package/dist/integration-engine/workers/tasks/AbstractUpdateElementsTask.d.ts +5 -5
- package/dist/integration-engine/workers/tasks/AbstractUpdateElementsTask.js +8 -11
- package/dist/integration-engine/workers/tasks/AbstractUpdateElementsTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/FetchDBFYPRTask.d.ts +7 -7
- package/dist/integration-engine/workers/tasks/FetchDBFYPRTask.js +31 -33
- package/dist/integration-engine/workers/tasks/FetchDBFYPRTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/FetchDCIPStatusTask.d.ts +3 -3
- package/dist/integration-engine/workers/tasks/FetchDCIPStatusTask.js +18 -20
- package/dist/integration-engine/workers/tasks/FetchDCIPStatusTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdateDisplayCasesTask.d.ts +7 -7
- package/dist/integration-engine/workers/tasks/UpdateDisplayCasesTask.js +17 -19
- package/dist/integration-engine/workers/tasks/UpdateDisplayCasesTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdateInformationPanelsTask.d.ts +7 -7
- package/dist/integration-engine/workers/tasks/UpdateInformationPanelsTask.js +17 -19
- package/dist/integration-engine/workers/tasks/UpdateInformationPanelsTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdateObelisksTask.d.ts +7 -7
- package/dist/integration-engine/workers/tasks/UpdateObelisksTask.js +17 -19
- package/dist/integration-engine/workers/tasks/UpdateObelisksTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdatePresetsTask.d.ts +5 -5
- package/dist/integration-engine/workers/tasks/UpdatePresetsTask.js +29 -30
- package/dist/integration-engine/workers/tasks/UpdatePresetsTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdateSignpostsTask.d.ts +7 -7
- package/dist/integration-engine/workers/tasks/UpdateSignpostsTask.js +17 -19
- package/dist/integration-engine/workers/tasks/UpdateSignpostsTask.js.map +1 -1
- package/dist/integration-engine/workers/tasks/UpdateTotemsTask.d.ts +7 -7
- package/dist/integration-engine/workers/tasks/UpdateTotemsTask.js +17 -19
- package/dist/integration-engine/workers/tasks/UpdateTotemsTask.js.map +1 -1
- package/dist/output-gateway/fypr/controllers/v1/V1FyprElementKindsController.d.ts +6 -6
- package/dist/output-gateway/fypr/controllers/v1/V1FyprElementKindsController.js +25 -25
- package/dist/output-gateway/fypr/controllers/v1/V1FyprElementKindsController.js.map +1 -1
- package/dist/output-gateway/fypr/controllers/v1/V1FyprMetadataController.d.ts +1 -1
- package/dist/output-gateway/fypr/controllers/v1/V1FyprMetadataController.js +11 -14
- package/dist/output-gateway/fypr/controllers/v1/V1FyprMetadataController.js.map +1 -1
- package/dist/output-gateway/fypr/data-access/FyprElementRepository.d.ts +5 -5
- package/dist/output-gateway/fypr/data-access/FyprElementRepository.js +9 -12
- package/dist/output-gateway/fypr/data-access/FyprElementRepository.js.map +1 -1
- package/dist/output-gateway/fypr/routers/index.d.ts +2 -2
- package/dist/output-gateway/fypr/routers/index.js +2 -7
- package/dist/output-gateway/fypr/routers/index.js.map +1 -1
- package/dist/output-gateway/fypr/routers/middlewares/cacheMiddleware.d.ts +3 -3
- package/dist/output-gateway/fypr/routers/middlewares/cacheMiddleware.js +1 -4
- package/dist/output-gateway/fypr/routers/middlewares/cacheMiddleware.js.map +1 -1
- package/dist/output-gateway/fypr/routers/v1/V1FyprElementKindsRouter.d.ts +3 -3
- package/dist/output-gateway/fypr/routers/v1/V1FyprElementKindsRouter.js +41 -43
- package/dist/output-gateway/fypr/routers/v1/V1FyprElementKindsRouter.js.map +1 -1
- package/dist/output-gateway/fypr/routers/v1/V1FyprMetadataRouter.d.ts +3 -3
- package/dist/output-gateway/fypr/routers/v1/V1FyprMetadataRouter.js +15 -18
- package/dist/output-gateway/fypr/routers/v1/V1FyprMetadataRouter.js.map +1 -1
- package/dist/output-gateway/fypr/routers/v1/validators/InformationPanelsOnlyValidator.d.ts +1 -1
- package/dist/output-gateway/fypr/routers/v1/validators/InformationPanelsOnlyValidator.js +1 -5
- package/dist/output-gateway/fypr/routers/v1/validators/InformationPanelsOnlyValidator.js.map +1 -1
- package/dist/output-gateway/fypr/transformations/InformationPanelOutputTransformation.d.ts +3 -3
- package/dist/output-gateway/fypr/transformations/InformationPanelOutputTransformation.js +9 -12
- package/dist/output-gateway/fypr/transformations/InformationPanelOutputTransformation.js.map +1 -1
- package/dist/output-gateway/index.d.ts +1 -1
- package/dist/output-gateway/index.js +2 -5
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/interfaces/IOGInformationPanel.d.ts +2 -2
- package/dist/output-gateway/interfaces/IOGInformationPanel.js +1 -2
- package/dist/output-gateway/interfaces/IOGInformationPanelScopes.d.ts +2 -2
- package/dist/output-gateway/interfaces/IOGInformationPanelScopes.js +1 -2
- package/dist/output-gateway/ioc/Di.d.ts +1 -1
- package/dist/output-gateway/ioc/Di.js +20 -23
- package/dist/output-gateway/ioc/Di.js.map +1 -1
- package/dist/output-gateway/ioc/FYPROGContainerTokens.js +1 -4
- package/dist/output-gateway/ioc/FYPROGContainerTokens.js.map +1 -1
- package/dist/output-gateway/shared/constants/element-kinds.d.ts +2 -1
- package/dist/output-gateway/shared/constants/element-kinds.js +1 -5
- package/dist/output-gateway/shared/constants/element-kinds.js.map +1 -1
- package/dist/output-gateway/shared/constants/index.d.ts +1 -1
- package/dist/output-gateway/shared/constants/index.js +1 -17
- package/dist/output-gateway/shared/constants/index.js.map +1 -1
- package/dist/schema-definitions/FyprElementTypes.d.ts +5 -5
- package/dist/schema-definitions/FyprElementTypes.js +1 -2
- package/dist/schema-definitions/const.js +11 -14
- package/dist/schema-definitions/const.js.map +1 -1
- package/dist/schema-definitions/data-sources/DBFYPRDisplayCasesJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DBFYPRDisplayCasesJSONSchema.js +22 -25
- package/dist/schema-definitions/data-sources/DBFYPRDisplayCasesJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/DBFYPRElementsJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DBFYPRElementsJSONSchema.js +15 -18
- package/dist/schema-definitions/data-sources/DBFYPRElementsJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/DBFYPRInformationPanelsJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DBFYPRInformationPanelsJSONSchema.js +83 -86
- package/dist/schema-definitions/data-sources/DBFYPRInformationPanelsJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/DBFYPRObelisksJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DBFYPRObelisksJSONSchema.js +17 -20
- package/dist/schema-definitions/data-sources/DBFYPRObelisksJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/DBFYPRSignpostsJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DBFYPRSignpostsJSONSchema.js +19 -22
- package/dist/schema-definitions/data-sources/DBFYPRSignpostsJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/DBFYPRTotemsJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DBFYPRTotemsJSONSchema.js +55 -58
- package/dist/schema-definitions/data-sources/DBFYPRTotemsJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/DCIPStatusOverviewJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/DCIPStatusOverviewJSONSchema.js +3 -6
- package/dist/schema-definitions/data-sources/DCIPStatusOverviewJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/GolemioPresetsJSONSchema.d.ts +2 -2
- package/dist/schema-definitions/data-sources/GolemioPresetsJSONSchema.js +1 -4
- package/dist/schema-definitions/data-sources/GolemioPresetsJSONSchema.js.map +1 -1
- package/dist/schema-definitions/data-sources/index.js +11 -14
- package/dist/schema-definitions/data-sources/index.js.map +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRDisplayCase.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRDisplayCase.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRElement.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRElement.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRInformationPanel.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRInformationPanel.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRObelisk.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRObelisk.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRSignpost.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRSignpost.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRTotem.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDBFYPRTotem.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IDCIPStatusOverview.d.ts +1 -1
- package/dist/schema-definitions/data-sources/interfaces/IDCIPStatusOverview.js +1 -2
- package/dist/schema-definitions/data-sources/interfaces/IGolemioPresetsResponse.js +1 -2
- package/dist/schema-definitions/index.d.ts +4 -3
- package/dist/schema-definitions/index.js +29 -33
- package/dist/schema-definitions/index.js.map +1 -1
- package/dist/schema-definitions/models/AbstractElementModel.d.ts +6 -3
- package/dist/schema-definitions/models/AbstractElementModel.js +39 -42
- package/dist/schema-definitions/models/AbstractElementModel.js.map +1 -1
- package/dist/schema-definitions/models/DeviceStatusModel.d.ts +5 -2
- package/dist/schema-definitions/models/DeviceStatusModel.js +7 -10
- package/dist/schema-definitions/models/DeviceStatusModel.js.map +1 -1
- package/dist/schema-definitions/models/DisplayCaseModel.d.ts +4 -4
- package/dist/schema-definitions/models/DisplayCaseModel.js +46 -49
- package/dist/schema-definitions/models/DisplayCaseModel.js.map +1 -1
- package/dist/schema-definitions/models/InformationPanelModel.d.ts +4 -4
- package/dist/schema-definitions/models/InformationPanelModel.js +177 -180
- package/dist/schema-definitions/models/InformationPanelModel.js.map +1 -1
- package/dist/schema-definitions/models/InformationPanelPresetsModel.d.ts +6 -3
- package/dist/schema-definitions/models/InformationPanelPresetsModel.js +13 -16
- package/dist/schema-definitions/models/InformationPanelPresetsModel.js.map +1 -1
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesAggModel.d.ts +5 -2
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesAggModel.js +8 -11
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesAggModel.js.map +1 -1
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesModel.d.ts +6 -3
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesModel.js +10 -13
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesModel.js.map +1 -1
- package/dist/schema-definitions/models/InformationPanelPresetsStopsModel.d.ts +6 -3
- package/dist/schema-definitions/models/InformationPanelPresetsStopsModel.js +7 -10
- package/dist/schema-definitions/models/InformationPanelPresetsStopsModel.js.map +1 -1
- package/dist/schema-definitions/models/ObeliskModel.d.ts +4 -4
- package/dist/schema-definitions/models/ObeliskModel.js +36 -39
- package/dist/schema-definitions/models/ObeliskModel.js.map +1 -1
- package/dist/schema-definitions/models/SignpostModel.d.ts +4 -4
- package/dist/schema-definitions/models/SignpostModel.js +40 -43
- package/dist/schema-definitions/models/SignpostModel.js.map +1 -1
- package/dist/schema-definitions/models/TotemModel.d.ts +4 -4
- package/dist/schema-definitions/models/TotemModel.js +110 -113
- package/dist/schema-definitions/models/TotemModel.js.map +1 -1
- package/dist/schema-definitions/models/interfaces/IDeviceStatus.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/IDeviceStatus.js +1 -2
- package/dist/schema-definitions/models/interfaces/IDisplayCase.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/IDisplayCase.js +1 -2
- package/dist/schema-definitions/models/interfaces/IElement.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/IElement.js +1 -2
- package/dist/schema-definitions/models/interfaces/IInformationPanel.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/IInformationPanel.js +1 -2
- package/dist/schema-definitions/models/interfaces/IInformationPanelPreset.js +1 -2
- package/dist/schema-definitions/models/interfaces/IInformationPanelPresetRoute.js +1 -2
- package/dist/schema-definitions/models/interfaces/IInformationPanelPresetStop.js +1 -2
- package/dist/schema-definitions/models/interfaces/IObelisk.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/IObelisk.js +1 -2
- package/dist/schema-definitions/models/interfaces/IPresetRouteAgg.js +1 -2
- package/dist/schema-definitions/models/interfaces/ISignpost.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/ISignpost.js +1 -2
- package/dist/schema-definitions/models/interfaces/ITotem.d.ts +1 -1
- package/dist/schema-definitions/models/interfaces/ITotem.js +1 -2
- package/dist/schema-definitions/models/interfaces/fyprElementStates.js +1 -4
- package/dist/schema-definitions/models/interfaces/fyprElementStates.js.map +1 -1
- package/dist/schema-definitions/translation/index.d.ts +1 -1
- package/dist/schema-definitions/translation/index.js +13 -19
- package/dist/schema-definitions/translation/index.js.map +1 -1
- package/package.json +42 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateObelisksTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdateObelisksTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateObelisksTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdateObelisksTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAGtF,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,CAAC;AAG1C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,0BAAoD;IAIxF,YAEI,cAAsC,EACW,UAA6B;QAE9E,KAAK,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QARb,cAAS,GAAG,gBAAgB,CAAC;QAC7B,WAAM,GAAG,IAAI,mBAAmB,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC;IAQ9G,CAAC;CACJ,CAAA;AAXY,kBAAkB;IAD9B,UAAU,EAAE;IAMJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,CAAA;IAEpD,WAAA,MAAM,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAA;qCADhC,sBAAsB;QACuB,iBAAiB;GAPzE,kBAAkB,CAW9B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InformationPanelPresetsRepository } from "
|
|
2
|
-
import { InformationPanelPresetsRoutesRepository } from "
|
|
3
|
-
import { InformationPanelPresetsStopsRepository } from "
|
|
4
|
-
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
5
|
-
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
1
|
+
import { InformationPanelPresetsRepository } from "#ie/repositories/InformationPanelPresetsRepository";
|
|
2
|
+
import { InformationPanelPresetsRoutesRepository } from "#ie/repositories/InformationPanelPresetsRoutesRepository";
|
|
3
|
+
import { InformationPanelPresetsStopsRepository } from "#ie/repositories/InformationPanelPresetsStopsRepository";
|
|
4
|
+
import type { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig.js";
|
|
5
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/index.js";
|
|
6
6
|
export declare class UpdatePresetsTask extends AbstractEmptyTask {
|
|
7
7
|
private readonly presetsRepository;
|
|
8
8
|
private readonly presetsStopsRepository;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,29 +10,29 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
let UpdatePresetsTask = class UpdatePresetsTask extends
|
|
13
|
+
import { ErrorHelper } from "#helpers/errors/ErrorHelper";
|
|
14
|
+
import { InformationPanelPresetsRepository } from "#ie/repositories/InformationPanelPresetsRepository";
|
|
15
|
+
import { InformationPanelPresetsRoutesRepository } from "#ie/repositories/InformationPanelPresetsRoutesRepository";
|
|
16
|
+
import { InformationPanelPresetsStopsRepository } from "#ie/repositories/InformationPanelPresetsStopsRepository";
|
|
17
|
+
import { fyprIEContainerTokens } from "#ie/ioc/FYPRIEContainerTokens";
|
|
18
|
+
import { golemioPresetsJSONSchema } from "#sch/data-sources/GolemioPresetsJSONSchema";
|
|
19
|
+
import { CoreToken } from "@golemio/core/dist/helpers/ioc/CoreToken.js";
|
|
20
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/index.js";
|
|
21
|
+
import GolemioErrors from "@golemio/core/dist/shared/golemio-errors.js";
|
|
22
|
+
import { inject, injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
23
|
+
import GolemioValidator from "@golemio/core/dist/shared/golemio-validator.js";
|
|
24
|
+
import { FYPR_WORKER_NAME } from "../constants.js";
|
|
25
|
+
const { DatasourceError, GeneralError } = GolemioErrors;
|
|
26
|
+
const { JSONSchemaValidator } = GolemioValidator;
|
|
27
|
+
let UpdatePresetsTask = class UpdatePresetsTask extends AbstractEmptyTask {
|
|
29
28
|
constructor(config, presetsRepository, presetsStopsRepository, presetsRoutesRepository) {
|
|
30
|
-
super(
|
|
29
|
+
super(FYPR_WORKER_NAME.toLowerCase());
|
|
31
30
|
this.presetsRepository = presetsRepository;
|
|
32
31
|
this.presetsStopsRepository = presetsStopsRepository;
|
|
33
32
|
this.presetsRoutesRepository = presetsRoutesRepository;
|
|
34
33
|
this.queueName = "updatePresetsWithRoutes";
|
|
35
34
|
this.queueTtl = 59 * 60 * 1000;
|
|
36
|
-
this.presetsValidator = new
|
|
35
|
+
this.presetsValidator = new JSONSchemaValidator("golemioPresetsValidation", golemioPresetsJSONSchema);
|
|
37
36
|
this.apiKey = config.getValue("env.GOLEMIO_API_KEY", "");
|
|
38
37
|
this.presetUrl = config.getValue("module.fypr.ropidPresetsApi.url", "");
|
|
39
38
|
}
|
|
@@ -70,7 +69,7 @@ let UpdatePresetsTask = class UpdatePresetsTask extends integration_engine_1.Abs
|
|
|
70
69
|
await this.presetsRoutesRepository.updateList(routes);
|
|
71
70
|
}
|
|
72
71
|
catch (err) {
|
|
73
|
-
throw
|
|
72
|
+
throw ErrorHelper.ensureGolemioError(err, new GeneralError("UpdatePresetsTask process error", this.constructor.name, err));
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
async fetchPresets() {
|
|
@@ -86,19 +85,19 @@ let UpdatePresetsTask = class UpdatePresetsTask extends integration_engine_1.Abs
|
|
|
86
85
|
return data;
|
|
87
86
|
}
|
|
88
87
|
catch (err) {
|
|
89
|
-
throw new
|
|
88
|
+
throw new DatasourceError("Error while fetching presets data", this.constructor.name, err);
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(0,
|
|
96
|
-
__param(
|
|
97
|
-
__param(
|
|
98
|
-
__param(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
InformationPanelPresetsRoutesRepository_1.InformationPanelPresetsRoutesRepository])
|
|
92
|
+
UpdatePresetsTask = __decorate([
|
|
93
|
+
injectable(),
|
|
94
|
+
__param(0, inject(CoreToken.SimpleConfig)),
|
|
95
|
+
__param(1, inject(fyprIEContainerTokens.InformationPanelPresetsRepository)),
|
|
96
|
+
__param(2, inject(fyprIEContainerTokens.InformationPanelPresetsStopsRepository)),
|
|
97
|
+
__param(3, inject(fyprIEContainerTokens.InformationPanelPresetsRoutesRepository)),
|
|
98
|
+
__metadata("design:paramtypes", [Object, InformationPanelPresetsRepository,
|
|
99
|
+
InformationPanelPresetsStopsRepository,
|
|
100
|
+
InformationPanelPresetsRoutesRepository])
|
|
103
101
|
], UpdatePresetsTask);
|
|
102
|
+
export { UpdatePresetsTask };
|
|
104
103
|
//# sourceMappingURL=UpdatePresetsTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdatePresetsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdatePresetsTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdatePresetsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdatePresetsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,EAAE,uCAAuC,EAAE,MAAM,0DAA0D,CAAC;AACnH,OAAO,EAAE,sCAAsC,EAAE,MAAM,yDAAyD,CAAC;AACjH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAKtF,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,aAAa,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,aAAa,CAAC;AACxD,MAAM,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,CAAC;AAG1C,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,iBAAiB;IAQpD,YACoC,MAAqB,EAErD,iBAAqE,EAErE,sBAA+E,EAE/E,uBAAiF;QAEjF,KAAK,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC;QANrB,sBAAiB,GAAjB,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,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3C,OAAO,IAAiC,CAAC;QAC7C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,eAAe,CAAC,mCAAmC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/F,CAAC;IACL,CAAC;CACJ,CAAA;AArFY,iBAAiB;IAD7B,UAAU,EAAE;IAUJ,WAAA,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;IAC9B,WAAA,MAAM,CAAC,qBAAqB,CAAC,iCAAiC,CAAC,CAAA;IAE/D,WAAA,MAAM,CAAC,qBAAqB,CAAC,sCAAsC,CAAC,CAAA;IAEpE,WAAA,MAAM,CAAC,qBAAqB,CAAC,uCAAuC,CAAC,CAAA;6CAHlC,iCAAiC;QAE5B,sCAAsC;QAErC,uCAAuC;GAf5E,iBAAiB,CAqF7B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SignpostsTransformation } from "
|
|
2
|
-
import { IDBFYPRSignpost } from "
|
|
3
|
-
import { ISignpost } from "
|
|
4
|
-
import
|
|
5
|
-
import { AbstractUpdateElementsTask } from "./AbstractUpdateElementsTask";
|
|
6
|
-
import { SignpostRepository } from "
|
|
1
|
+
import { SignpostsTransformation } from "#ie/transformations/SignpostsTransformation";
|
|
2
|
+
import type { IDBFYPRSignpost } from "#sch/data-sources/interfaces/IDBFYPRSignpost";
|
|
3
|
+
import type { ISignpost } from "#sch/models/interfaces/ISignpost";
|
|
4
|
+
import GolemioValidator from "@golemio/core/dist/shared/golemio-validator.js";
|
|
5
|
+
import { AbstractUpdateElementsTask } from "./AbstractUpdateElementsTask.js";
|
|
6
|
+
import { SignpostRepository } from "#ie/repositories/SignpostRepository";
|
|
7
7
|
export declare class UpdateSignpostsTask extends AbstractUpdateElementsTask<IDBFYPRSignpost, ISignpost> {
|
|
8
8
|
readonly queueName = "updateSignposts";
|
|
9
|
-
readonly schema: JSONSchemaValidator;
|
|
9
|
+
readonly schema: GolemioValidator.JSONSchemaValidator;
|
|
10
10
|
constructor(transformation: SignpostsTransformation, repository: SignpostRepository);
|
|
11
11
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,28 +10,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
let UpdateSignpostsTask = class UpdateSignpostsTask extends AbstractUpdateElementsTask_1.AbstractUpdateElementsTask {
|
|
13
|
+
import { fyprIEContainerTokens } from "#ie/ioc/FYPRIEContainerTokens";
|
|
14
|
+
import { SignpostsTransformation } from "#ie/transformations/SignpostsTransformation";
|
|
15
|
+
import { dbfyprSignpostsJSONSchema } from "#sch/data-sources/DBFYPRSignpostsJSONSchema";
|
|
16
|
+
import GolemioValidator from "@golemio/core/dist/shared/golemio-validator.js";
|
|
17
|
+
import { inject, injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
18
|
+
import { AbstractUpdateElementsTask } from "./AbstractUpdateElementsTask.js";
|
|
19
|
+
import { SignpostRepository } from "#ie/repositories/SignpostRepository";
|
|
20
|
+
const { JSONSchemaValidator } = GolemioValidator;
|
|
21
|
+
let UpdateSignpostsTask = class UpdateSignpostsTask extends AbstractUpdateElementsTask {
|
|
24
22
|
constructor(transformation, repository) {
|
|
25
23
|
super(transformation, repository);
|
|
26
24
|
this.queueName = "updateSignposts";
|
|
27
|
-
this.schema = new
|
|
25
|
+
this.schema = new JSONSchemaValidator("signpostsDataValidation", dbfyprSignpostsJSONSchema);
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(0,
|
|
33
|
-
__param(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
SignpostRepository_1.SignpostRepository])
|
|
28
|
+
UpdateSignpostsTask = __decorate([
|
|
29
|
+
injectable(),
|
|
30
|
+
__param(0, inject(fyprIEContainerTokens.SignpostsTransformation)),
|
|
31
|
+
__param(1, inject(fyprIEContainerTokens.SignpostRepository)),
|
|
32
|
+
__metadata("design:paramtypes", [SignpostsTransformation,
|
|
33
|
+
SignpostRepository])
|
|
37
34
|
], UpdateSignpostsTask);
|
|
35
|
+
export { UpdateSignpostsTask };
|
|
38
36
|
//# sourceMappingURL=UpdateSignpostsTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSignpostsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdateSignpostsTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSignpostsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdateSignpostsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAGxF,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,MAAM,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,CAAC;AAG1C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,0BAAsD;IAI3F,YAEI,cAAuC,EACW,UAA8B;QAEhF,KAAK,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QARb,cAAS,GAAG,iBAAiB,CAAC;QAC9B,WAAM,GAAG,IAAI,mBAAmB,CAAC,yBAAyB,EAAE,yBAAyB,CAAC,CAAC;IAQhH,CAAC;CACJ,CAAA;AAXY,mBAAmB;IAD/B,UAAU,EAAE;IAMJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,uBAAuB,CAAC,CAAA;IAErD,WAAA,MAAM,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAA;qCADjC,uBAAuB;QACuB,kBAAkB;GAP3E,mBAAmB,CAW/B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TotemsTransformation } from "
|
|
2
|
-
import { IDBFYPRTotem } from "
|
|
3
|
-
import { ITotem } from "
|
|
4
|
-
import
|
|
5
|
-
import { AbstractUpdateElementsTask } from "./AbstractUpdateElementsTask";
|
|
6
|
-
import { TotemRepository } from "
|
|
1
|
+
import { TotemsTransformation } from "#ie/transformations/TotemsTransformation";
|
|
2
|
+
import type { IDBFYPRTotem } from "#sch/data-sources/interfaces/IDBFYPRTotem";
|
|
3
|
+
import type { ITotem } from "#sch/models/interfaces/ITotem";
|
|
4
|
+
import GolemioValidator from "@golemio/core/dist/shared/golemio-validator.js";
|
|
5
|
+
import { AbstractUpdateElementsTask } from "./AbstractUpdateElementsTask.js";
|
|
6
|
+
import { TotemRepository } from "#ie/repositories/TotemRepository";
|
|
7
7
|
export declare class UpdateTotemsTask extends AbstractUpdateElementsTask<IDBFYPRTotem, ITotem> {
|
|
8
8
|
readonly queueName = "updateTotems";
|
|
9
|
-
readonly schema: JSONSchemaValidator;
|
|
9
|
+
readonly schema: GolemioValidator.JSONSchemaValidator;
|
|
10
10
|
constructor(transformation: TotemsTransformation, repository: TotemRepository);
|
|
11
11
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,28 +10,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
let UpdateTotemsTask = class UpdateTotemsTask extends AbstractUpdateElementsTask_1.AbstractUpdateElementsTask {
|
|
13
|
+
import { fyprIEContainerTokens } from "#ie/ioc/FYPRIEContainerTokens";
|
|
14
|
+
import { TotemsTransformation } from "#ie/transformations/TotemsTransformation";
|
|
15
|
+
import { dbfyprTotemsJSONSchema } from "#sch/data-sources/DBFYPRTotemsJSONSchema";
|
|
16
|
+
import GolemioValidator from "@golemio/core/dist/shared/golemio-validator.js";
|
|
17
|
+
import { inject, injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
18
|
+
import { AbstractUpdateElementsTask } from "./AbstractUpdateElementsTask.js";
|
|
19
|
+
import { TotemRepository } from "#ie/repositories/TotemRepository";
|
|
20
|
+
const { JSONSchemaValidator } = GolemioValidator;
|
|
21
|
+
let UpdateTotemsTask = class UpdateTotemsTask extends AbstractUpdateElementsTask {
|
|
24
22
|
constructor(transformation, repository) {
|
|
25
23
|
super(transformation, repository);
|
|
26
24
|
this.queueName = "updateTotems";
|
|
27
|
-
this.schema = new
|
|
25
|
+
this.schema = new JSONSchemaValidator("totemsDataValidation", dbfyprTotemsJSONSchema);
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(0,
|
|
33
|
-
__param(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
TotemRepository_1.TotemRepository])
|
|
28
|
+
UpdateTotemsTask = __decorate([
|
|
29
|
+
injectable(),
|
|
30
|
+
__param(0, inject(fyprIEContainerTokens.TotemsTransformation)),
|
|
31
|
+
__param(1, inject(fyprIEContainerTokens.TotemRepository)),
|
|
32
|
+
__metadata("design:paramtypes", [TotemsTransformation,
|
|
33
|
+
TotemRepository])
|
|
37
34
|
], UpdateTotemsTask);
|
|
35
|
+
export { UpdateTotemsTask };
|
|
38
36
|
//# sourceMappingURL=UpdateTotemsTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateTotemsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdateTotemsTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateTotemsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/UpdateTotemsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAGlF,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,CAAC;AAG1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,0BAAgD;IAIlF,YAEI,cAAoC,EACW,UAA2B;QAE1E,KAAK,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QARb,cAAS,GAAG,cAAc,CAAC;QAC3B,WAAM,GAAG,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;IAQ1G,CAAC;CACJ,CAAA;AAXY,gBAAgB;IAD5B,UAAU,EAAE;IAMJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAA;IAElD,WAAA,MAAM,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAA;qCAD9B,oBAAoB;QACuB,eAAe;GAPrE,gBAAgB,CAW5B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FyprElementRepository } from "
|
|
2
|
-
import { InformationPanelOutputTransformation } from "
|
|
3
|
-
import { FyprElementKind } from "
|
|
4
|
-
import { AnyFyprElement } from "
|
|
5
|
-
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
6
|
-
import { NextFunction, Request, RequestHandler, Response } from "@golemio/core/dist/shared/express";
|
|
1
|
+
import { FyprElementRepository } from "#og/fypr/data-access/FyprElementRepository";
|
|
2
|
+
import { InformationPanelOutputTransformation } from "#og/fypr/transformations/InformationPanelOutputTransformation";
|
|
3
|
+
import type { FyprElementKind } from "#og/shared/constants/index";
|
|
4
|
+
import type { AnyFyprElement } from "#sch/index";
|
|
5
|
+
import type { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig.js";
|
|
6
|
+
import type { NextFunction, Request, RequestHandler, Response } from "@golemio/core/dist/shared/express.js";
|
|
7
7
|
export declare class V1FyprElementKindsController {
|
|
8
8
|
private repositories;
|
|
9
9
|
private informationPanelOutputTransformation;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,23 +10,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
13
|
+
import { InformationPanelOutputTransformation } from "#og/fypr/transformations/InformationPanelOutputTransformation";
|
|
14
|
+
import { fyprOGContainerTokens } from "#og/ioc/FYPROGContainerTokens";
|
|
15
|
+
import { fyprElementKinds } from "#sch/index";
|
|
16
|
+
import { CoreToken } from "@golemio/core/dist/helpers/ioc/CoreToken.js";
|
|
17
|
+
import ExpressValidator from "@golemio/core/dist/shared/express-validator.js";
|
|
18
|
+
import GolemioErrors from "@golemio/core/dist/shared/golemio-errors.js";
|
|
19
|
+
import Sequelize from "@golemio/core/dist/shared/sequelize.js";
|
|
20
|
+
import { inject, injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
21
|
+
const { matchedData } = ExpressValidator;
|
|
22
|
+
const { GeneralError } = GolemioErrors;
|
|
23
|
+
const { Op } = Sequelize;
|
|
24
24
|
let V1FyprElementKindsController = class V1FyprElementKindsController {
|
|
25
25
|
constructor(repositories, informationPanelOutputTransformation, config) {
|
|
26
26
|
this.repositories = repositories;
|
|
27
27
|
this.informationPanelOutputTransformation = informationPanelOutputTransformation;
|
|
28
28
|
this.getAll = async (req, res, next) => {
|
|
29
29
|
try {
|
|
30
|
-
const { kind, limit, offset, jis, scopes, state, hasDeviceId } =
|
|
30
|
+
const { kind, limit, offset, jis, scopes, state, hasDeviceId } = matchedData(req);
|
|
31
31
|
const effectiveLimit = req.query.limit !== undefined ? Number(limit) : this.defaultLimit;
|
|
32
32
|
const where = kind === "information-panels" ? this.buildInformationPanelWhere({ jis, state, hasDeviceId }) : {};
|
|
33
33
|
const embeds = scopes ? (Array.isArray(scopes) ? scopes : [scopes]) : undefined;
|
|
@@ -52,10 +52,10 @@ let V1FyprElementKindsController = class V1FyprElementKindsController {
|
|
|
52
52
|
};
|
|
53
53
|
this.getOne = async (req, res, next) => {
|
|
54
54
|
try {
|
|
55
|
-
const { kind, id } =
|
|
55
|
+
const { kind, id } = matchedData(req);
|
|
56
56
|
const data = await this.getRepositoryByKind(kind).getOne(id);
|
|
57
57
|
if (!data) {
|
|
58
|
-
throw new
|
|
58
|
+
throw new GeneralError("FYPR element not found.", this.constructor.name, undefined, 404);
|
|
59
59
|
}
|
|
60
60
|
// if more kinds need transformation, consider extracting to a transformation dispatcher
|
|
61
61
|
switch (kind) {
|
|
@@ -75,12 +75,12 @@ let V1FyprElementKindsController = class V1FyprElementKindsController {
|
|
|
75
75
|
getRepositoryByKind(kind) {
|
|
76
76
|
const repository = this.repositories.get(kind);
|
|
77
77
|
if (!repository)
|
|
78
|
-
throw new
|
|
78
|
+
throw new GeneralError("Unknown kind of FYPR element.", this.constructor.name, undefined, 400);
|
|
79
79
|
return repository;
|
|
80
80
|
}
|
|
81
81
|
getIndex(basePath) {
|
|
82
82
|
const response = {
|
|
83
|
-
links:
|
|
83
|
+
links: fyprElementKinds.map((kind) => ({
|
|
84
84
|
rel: "collection",
|
|
85
85
|
name: kind,
|
|
86
86
|
href: `${basePath}/${kind}`,
|
|
@@ -95,21 +95,21 @@ let V1FyprElementKindsController = class V1FyprElementKindsController {
|
|
|
95
95
|
}
|
|
96
96
|
if (filters.state !== undefined) {
|
|
97
97
|
const states = Array.isArray(filters.state) ? filters.state : [filters.state];
|
|
98
|
-
where.state = { [
|
|
98
|
+
where.state = { [Op.in]: states };
|
|
99
99
|
}
|
|
100
100
|
if (filters.hasDeviceId !== undefined) {
|
|
101
|
-
where.device_id = filters.hasDeviceId ? { [
|
|
101
|
+
where.device_id = filters.hasDeviceId ? { [Op.not]: null } : { [Op.is]: null };
|
|
102
102
|
}
|
|
103
103
|
return where;
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
(0,
|
|
109
|
-
__param(
|
|
110
|
-
__param(
|
|
111
|
-
__param(2, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
|
|
106
|
+
V1FyprElementKindsController = __decorate([
|
|
107
|
+
injectable(),
|
|
108
|
+
__param(0, inject(fyprOGContainerTokens.FyprElementRepositoriesMap)),
|
|
109
|
+
__param(1, inject(fyprOGContainerTokens.InformationPanelOutputTransformation)),
|
|
110
|
+
__param(2, inject(CoreToken.SimpleConfig)),
|
|
112
111
|
__metadata("design:paramtypes", [Map,
|
|
113
|
-
|
|
112
|
+
InformationPanelOutputTransformation, Object])
|
|
114
113
|
], V1FyprElementKindsController);
|
|
114
|
+
export { V1FyprElementKindsController };
|
|
115
115
|
//# sourceMappingURL=V1FyprElementKindsController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1FyprElementKindsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/fypr/controllers/v1/V1FyprElementKindsController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"V1FyprElementKindsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/fypr/controllers/v1/V1FyprElementKindsController.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+DAA+D,CAAC;AACrH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAExE,OAAO,gB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,CAAC,GAAG,CAAC;QACpC,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC9E,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;QACtC,CAAC;QACD,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;QACnF,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CAqBJ,CAAA;AA9FY,4BAA4B;IADxC,UAAU,EAAE;IAKJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,0BAA0B,CAAC,CAAA;IAExD,WAAA,MAAM,CAAC,qBAAqB,CAAC,oCAAoC,CAAC,CAAA;IAElE,WAAA,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;qCAHT,GAAG;QAEqB,oCAAoC;GAP7E,4BAA4B,CA8FxC"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const translation_1 = require("../../../../schema-definitions/translation");
|
|
12
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
7
|
+
import { FyprElementsConfig, fyprElementKinds } from "#sch/index";
|
|
8
|
+
import { fyprElementTranslations } from "#sch/translation/index";
|
|
9
|
+
import { injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
13
10
|
let V1FyprMetadataController = class V1FyprMetadataController {
|
|
14
11
|
getMetadata(basePath) {
|
|
15
|
-
const elements =
|
|
12
|
+
const elements = fyprElementKinds.reduce((acc, kind) => {
|
|
16
13
|
acc[kind] = {
|
|
17
14
|
links: [{ rel: "collection", href: `${basePath}/${kind}` }],
|
|
18
15
|
translations: {
|
|
19
16
|
kind: {
|
|
20
|
-
slug_en:
|
|
21
|
-
title_cs:
|
|
22
|
-
title_cs_singular:
|
|
17
|
+
slug_en: FyprElementsConfig[kind].tableName,
|
|
18
|
+
title_cs: FyprElementsConfig[kind].cs,
|
|
19
|
+
title_cs_singular: FyprElementsConfig[kind].cs_singular,
|
|
23
20
|
},
|
|
24
|
-
attributes: Object.fromEntries(Object.entries(
|
|
21
|
+
attributes: Object.fromEntries(Object.entries(fyprElementTranslations[kind]).map(([slugEn, entry]) => [
|
|
25
22
|
slugEn,
|
|
26
23
|
{ slug_cs: entry.cs, title_cs: entry.title_cs },
|
|
27
24
|
])),
|
|
@@ -32,8 +29,8 @@ let V1FyprMetadataController = class V1FyprMetadataController {
|
|
|
32
29
|
return (_req, res, _next) => res.status(200).json({ elements });
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(0, tsyringe_1.injectable)()
|
|
32
|
+
V1FyprMetadataController = __decorate([
|
|
33
|
+
injectable()
|
|
38
34
|
], V1FyprMetadataController);
|
|
35
|
+
export { V1FyprMetadataController };
|
|
39
36
|
//# sourceMappingURL=V1FyprMetadataController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1FyprMetadataController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/fypr/controllers/v1/V1FyprMetadataController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"V1FyprMetadataController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/fypr/controllers/v1/V1FyprMetadataController.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAG5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAC1B,WAAW,CAAC,QAAgB;QAC/B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACnD,GAAG,CAAC,IAAI,CAAC,GAAG;gBACR,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,QAAQ,IAAI,IAAI,EAAE,EAAE,CAAC;gBAC3D,YAAY,EAAE;oBACV,IAAI,EAAE;wBACF,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,SAAS;wBAC3C,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE;wBACrC,iBAAiB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,WAAW;qBAC1D;oBACD,UAAU,EAAE,MAAM,CAAC,WAAW,CAC1B,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;wBACnE,MAAM;wBACN,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;qBAClD,CAAC,CACL;iBACJ;aACJ,CAAC;YACF,OAAO,GAAG,CAAC;QACf,CAAC,EAAE,EAA6B,CAAC,CAAC;QAClC,OAAO,CAAC,IAAa,EAAE,GAAa,EAAE,KAAmB,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrG,CAAC;CACJ,CAAA;AAvBY,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CAuBpC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FyprEmbedConfig } from "
|
|
2
|
-
import { ILogger } from "@golemio/core/dist/helpers";
|
|
3
|
-
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
4
|
-
import { AbstractBasicRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository";
|
|
5
|
-
import { ModelAttributes, WhereOptions } from "@golemio/core/dist/shared/sequelize";
|
|
1
|
+
import type { FyprEmbedConfig } from "#sch/index";
|
|
2
|
+
import type { ILogger } from "@golemio/core/dist/helpers/index.js";
|
|
3
|
+
import type { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector.js";
|
|
4
|
+
import { AbstractBasicRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository.js";
|
|
5
|
+
import type { ModelAttributes, WhereOptions } from "@golemio/core/dist/shared/sequelize.js";
|
|
6
6
|
export declare class FyprElementRepository<T> extends AbstractBasicRepository {
|
|
7
7
|
readonly schema = "fypr";
|
|
8
8
|
readonly tableName: string;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const AbstractBasicRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository");
|
|
6
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
1
|
+
import { PG_SCHEMA } from "#sch/const";
|
|
2
|
+
import { AbstractBasicRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository.js";
|
|
3
|
+
import GolemioErrors from "@golemio/core/dist/shared/golemio-errors.js";
|
|
4
|
+
const { GeneralError } = GolemioErrors;
|
|
7
5
|
// Manually instantiated via instanceCachingFactory in Di.ts (deferred until first resolve, after connect()).
|
|
8
6
|
// sequelizeModel and embedIncludes are lazy so getConnection() is safe to call at first query time.
|
|
9
|
-
class FyprElementRepository extends
|
|
7
|
+
export class FyprElementRepository extends AbstractBasicRepository {
|
|
10
8
|
get sequelizeModel() {
|
|
11
9
|
if (!this._sequelizeModel) {
|
|
12
10
|
this._sequelizeModel = this.connector
|
|
@@ -20,7 +18,7 @@ class FyprElementRepository extends AbstractBasicRepository_1.AbstractBasicRepos
|
|
|
20
18
|
const sequelize = this.connector.getConnection();
|
|
21
19
|
this._embedIncludes = Object.fromEntries(Object.entries(this.embedsConfig).map(([key, cfg]) => {
|
|
22
20
|
const embedModel = sequelize.models[cfg.tableName] ??
|
|
23
|
-
sequelize.define(cfg.tableName, cfg.attributeModel, { schema:
|
|
21
|
+
sequelize.define(cfg.tableName, cfg.attributeModel, { schema: PG_SCHEMA, timestamps: false });
|
|
24
22
|
if (!this.sequelizeModel.associations[cfg.as]) {
|
|
25
23
|
const associationOptions = { foreignKey: cfg.foreignKey, sourceKey: cfg.sourceKey, as: cfg.as };
|
|
26
24
|
if (cfg.cardinality === "one") {
|
|
@@ -39,7 +37,7 @@ class FyprElementRepository extends AbstractBasicRepository_1.AbstractBasicRepos
|
|
|
39
37
|
}
|
|
40
38
|
constructor(connector, logger, modelName, tableName, attributeModel, embeds = {}) {
|
|
41
39
|
super(connector, logger);
|
|
42
|
-
this.schema =
|
|
40
|
+
this.schema = PG_SCHEMA;
|
|
43
41
|
this.modelName = modelName;
|
|
44
42
|
this.tableName = tableName;
|
|
45
43
|
this.attributeModel = attributeModel;
|
|
@@ -58,7 +56,7 @@ class FyprElementRepository extends AbstractBasicRepository_1.AbstractBasicRepos
|
|
|
58
56
|
return instances.map((i) => i.toJSON());
|
|
59
57
|
}
|
|
60
58
|
catch (err) {
|
|
61
|
-
throw new
|
|
59
|
+
throw new GeneralError(`Database error when listing '${this.modelName}'`, this.constructor.name, err, 500);
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
async getOne(id) {
|
|
@@ -66,9 +64,8 @@ class FyprElementRepository extends AbstractBasicRepository_1.AbstractBasicRepos
|
|
|
66
64
|
return await this.sequelizeModel.findByPk(id, { raw: true });
|
|
67
65
|
}
|
|
68
66
|
catch (err) {
|
|
69
|
-
throw new
|
|
67
|
+
throw new GeneralError(`Database error when findByPk '${this.modelName}'`, this.constructor.name, err, 500);
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
exports.FyprElementRepository = FyprElementRepository;
|
|
74
71
|
//# sourceMappingURL=FyprElementRepository.js.map
|