Skip to content

Commit

Permalink
Merge pull request #251 from ds-wizard/release/4.14.0
Browse files Browse the repository at this point in the history
Release 4.14.0
  • Loading branch information
vknaisl authored Jan 7, 2025
2 parents 3f1688a + 3165e1d commit 9d321e5
Show file tree
Hide file tree
Showing 98 changed files with 1,077 additions and 148 deletions.
2 changes: 1 addition & 1 deletion registry-public/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: registry-public
version: '4.13.0'
version: '4.14.0'
synopsis: Registry Public
description: Registry Public
category: Web
Expand Down
2 changes: 1 addition & 1 deletion registry-server/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: registry-server
version: '4.13.0'
version: '4.14.0'
synopsis: Engine Registry
description: Engine Registry
category: Web
Expand Down
2 changes: 1 addition & 1 deletion registry-server/src/Registry/Api/Handler/Swagger/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ swagger =
s._swaggerInfo
{ _infoTitle = "Registry API"
, _infoDescription = Just "API specification for Registry"
, _infoVersion = "4.13.0"
, _infoVersion = "4.14.0"
, _infoLicense =
Just $
License
Expand Down
2 changes: 1 addition & 1 deletion shared-common/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: shared-common
version: '4.13.0'
version: '4.14.0'
synopsis: Engine Shared
description: Engine Shared
category: Web
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ findActionKeyByHashAndType hash aType = do
tenantUuid <- asks (.tenantUuid')
createFindEntityByFn entityName [tenantQueryUuid tenantUuid, ("hash", hash), ("type", show aType)]

findActionKeyByIdentityAndType' :: (AppContextC s sc m, ToField identity, FromField identity, FromField aType, Show aType) => String -> aType -> m (Maybe (ActionKey identity aType))
findActionKeyByIdentityAndType' identity aType = do
tenantUuid <- asks (.tenantUuid')
createFindEntityByFn' entityName [tenantQueryUuid tenantUuid, ("identity", identity), ("type", show aType)]

findActionKeyByIdentityAndHash'
:: ( AppContextC s sc m
, FromField aType
Expand Down
1 change: 1 addition & 0 deletions shared-common/src/Shared/Common/Util/Aeson.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jsonSpecialFields "adData" = "data"
jsonSpecialFields "seData" = "data"
jsonSpecialFields "scData" = "data"
jsonSpecialFields "sqData" = "data"
jsonSpecialFields "srData" = "data"
jsonSpecialFields "ouiData" = "data"
jsonSpecialFields "qeData" = "data"
jsonSpecialFields "aType" = "type"
Expand Down
3 changes: 2 additions & 1 deletion wizard-common/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wizard-common
version: '4.13.0'
version: '4.14.0'
synopsis: Wizard Engine
description: Wizard Engine
category: Web
Expand Down Expand Up @@ -34,6 +34,7 @@ library:
- directory
- exceptions
- fsutils
- hashable
- http-client
- http-client-tls
- http-types
Expand Down
46 changes: 46 additions & 0 deletions wizard-common/src/WizardLib/Common/Util/Hashable.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{-# LANGUAGE StandaloneDeriving #-}

module WizardLib.Common.Util.Hashable where

import Data.Hashable
import Data.Time
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.KnowledgeModel.Model.Event.EventField
import WizardLib.KnowledgeModel.Model.KnowledgeModel.KnowledgeModel

deriving instance Generic Day

instance Hashable Day

deriving instance Generic LocalTime

instance Hashable LocalTime

deriving instance Generic TimeOfDay

instance Hashable TimeOfDay

deriving instance Generic TimeZone

instance Hashable TimeZone

instance Hashable DiffTime where
hashWithSalt s = (hashWithSalt s :: Double -> Int) . realToFrac

deriving instance Generic UTCTime

instance Hashable UTCTime

deriving instance Eq ZonedTime

deriving instance Generic ZonedTime

instance Hashable ZonedTime

instance Hashable MetricMeasure
instance Hashable QuestionValidation
instance Hashable QuestionValueType
instance Hashable a => Hashable (EventField a)
instance (Hashable key, Hashable value) => Hashable (MapEntry key value)
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module WizardLib.KnowledgeModel.Model.Event.Answer.AnswerEvent where

import Data.Hashable
import Data.Time
import qualified Data.UUID as U
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.EventField
import WizardLib.KnowledgeModel.Model.KnowledgeModel.KnowledgeModel

Expand All @@ -20,6 +22,8 @@ data AddAnswerEvent = AddAnswerEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddAnswerEvent

data EditAnswerEvent = EditAnswerEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -33,10 +37,20 @@ data EditAnswerEvent = EditAnswerEvent
}
deriving (Show, Eq, Generic)

instance Hashable EditAnswerEvent

data DeleteAnswerEvent = DeleteAnswerEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
, entityUuid :: U.UUID
, createdAt :: UTCTime
}
deriving (Show, Eq, Generic)
deriving (Show, Generic)

instance Eq DeleteAnswerEvent where
a == b =
a.uuid == b.uuid
&& a.parentUuid == b.parentUuid
&& a.entityUuid == b.entityUuid

instance Hashable DeleteAnswerEvent
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module WizardLib.KnowledgeModel.Model.Event.Chapter.ChapterEvent where

import Data.Hashable
import Data.Time
import qualified Data.UUID as U
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.EventField

data AddChapterEvent = AddChapterEvent
Expand All @@ -18,6 +20,8 @@ data AddChapterEvent = AddChapterEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddChapterEvent

data EditChapterEvent = EditChapterEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -30,10 +34,14 @@ data EditChapterEvent = EditChapterEvent
}
deriving (Show, Eq, Generic)

instance Hashable EditChapterEvent

data DeleteChapterEvent = DeleteChapterEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
, entityUuid :: U.UUID
, createdAt :: UTCTime
}
deriving (Show, Eq, Generic)

instance Hashable DeleteChapterEvent
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module WizardLib.KnowledgeModel.Model.Event.Choice.ChoiceEvent where

import Data.Hashable
import Data.Time
import qualified Data.UUID as U
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.EventField

data AddChoiceEvent = AddChoiceEvent
Expand All @@ -17,6 +19,8 @@ data AddChoiceEvent = AddChoiceEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddChoiceEvent

data EditChoiceEvent = EditChoiceEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -27,10 +31,14 @@ data EditChoiceEvent = EditChoiceEvent
}
deriving (Show, Eq, Generic)

instance Hashable EditChoiceEvent

data DeleteChoiceEvent = DeleteChoiceEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
, entityUuid :: U.UUID
, createdAt :: UTCTime
}
deriving (Show, Eq, Generic)

instance Hashable DeleteChoiceEvent
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module WizardLib.KnowledgeModel.Model.Event.Event where

import Data.Hashable
import GHC.Generics

import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.Answer.AnswerEvent
import WizardLib.KnowledgeModel.Model.Event.Chapter.ChapterEvent
import WizardLib.KnowledgeModel.Model.Event.Choice.ChoiceEvent
Expand Down Expand Up @@ -61,3 +63,5 @@ data Event
| MoveExpertEvent' MoveExpertEvent
| MoveReferenceEvent' MoveReferenceEvent
deriving (Show, Eq, Generic)

instance Hashable Event
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module WizardLib.KnowledgeModel.Model.Event.Expert.ExpertEvent where

import Data.Hashable
import Data.Time
import qualified Data.UUID as U
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.EventField

data AddExpertEvent = AddExpertEvent
Expand All @@ -18,6 +20,8 @@ data AddExpertEvent = AddExpertEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddExpertEvent

data EditExpertEvent = EditExpertEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -29,10 +33,14 @@ data EditExpertEvent = EditExpertEvent
}
deriving (Show, Eq, Generic)

instance Hashable EditExpertEvent

data DeleteExpertEvent = DeleteExpertEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
, entityUuid :: U.UUID
, createdAt :: UTCTime
}
deriving (Show, Eq, Generic)

instance Hashable DeleteExpertEvent
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
module WizardLib.KnowledgeModel.Model.Event.Integration.IntegrationEvent where

import Data.Hashable
import Data.Time
import qualified Data.UUID as U
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.EventField

data AddIntegrationEvent
= AddApiIntegrationEvent' AddApiIntegrationEvent
| AddWidgetIntegrationEvent' AddWidgetIntegrationEvent
deriving (Show, Eq, Generic)

instance Hashable AddIntegrationEvent

data AddApiIntegrationEvent = AddApiIntegrationEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -34,6 +38,8 @@ data AddApiIntegrationEvent = AddApiIntegrationEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddApiIntegrationEvent

data AddWidgetIntegrationEvent = AddWidgetIntegrationEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -49,11 +55,15 @@ data AddWidgetIntegrationEvent = AddWidgetIntegrationEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddWidgetIntegrationEvent

data EditIntegrationEvent
= EditApiIntegrationEvent' EditApiIntegrationEvent
| EditWidgetIntegrationEvent' EditWidgetIntegrationEvent
deriving (Show, Eq, Generic)

instance Hashable EditIntegrationEvent

data EditApiIntegrationEvent = EditApiIntegrationEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -76,6 +86,8 @@ data EditApiIntegrationEvent = EditApiIntegrationEvent
}
deriving (Show, Eq, Generic)

instance Hashable EditApiIntegrationEvent

data EditWidgetIntegrationEvent = EditWidgetIntegrationEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -91,10 +103,14 @@ data EditWidgetIntegrationEvent = EditWidgetIntegrationEvent
}
deriving (Show, Eq, Generic)

instance Hashable EditWidgetIntegrationEvent

data DeleteIntegrationEvent = DeleteIntegrationEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
, entityUuid :: U.UUID
, createdAt :: UTCTime
}
deriving (Show, Eq, Generic)

instance Hashable DeleteIntegrationEvent
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module WizardLib.KnowledgeModel.Model.Event.KnowledgeModel.KnowledgeModelEvent where

import Data.Hashable
import Data.Time
import qualified Data.UUID as U
import GHC.Generics

import Shared.Common.Model.Common.MapEntry
import WizardLib.Common.Util.Hashable ()
import WizardLib.KnowledgeModel.Model.Event.EventField

data AddKnowledgeModelEvent = AddKnowledgeModelEvent
Expand All @@ -16,6 +18,8 @@ data AddKnowledgeModelEvent = AddKnowledgeModelEvent
}
deriving (Show, Eq, Generic)

instance Hashable AddKnowledgeModelEvent

data EditKnowledgeModelEvent = EditKnowledgeModelEvent
{ uuid :: U.UUID
, parentUuid :: U.UUID
Expand All @@ -30,3 +34,5 @@ data EditKnowledgeModelEvent = EditKnowledgeModelEvent
, createdAt :: UTCTime
}
deriving (Show, Eq, Generic)

instance Hashable EditKnowledgeModelEvent
Loading

0 comments on commit 9d321e5

Please sign in to comment.