File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 8
8
import Core.Types.Basic (TokenId )
9
9
import Core.Types.Fact (Fact (.. ), parseFacts )
10
10
import MPFS.API (MPFS , mpfsGetTokenFacts )
11
+ import Oracle.Config.Types (Config , ConfigKey )
11
12
import Text.JSON.Canonical
13
+ import User.Agent.Types (WhiteListKey )
12
14
import User.Types
13
15
( Phase (.. )
14
16
, RegisterUserKey
@@ -28,7 +30,10 @@ data FactsSelection a where
28
30
UserFacts :: FactsSelection [Fact RegisterUserKey () ]
29
31
RoleFacts :: FactsSelection [Fact RegisterUserKey () ]
30
32
TestRunFacts :: TestRunSelection a -> FactsSelection a
33
+ ConfigFact :: FactsSelection [Fact ConfigKey Config ]
34
+ WhiteListedFacts :: FactsSelection [Fact WhiteListKey () ]
31
35
AllFacts :: FactsSelection [Fact JSValue JSValue ]
36
+
32
37
retrieveAnyFacts
33
38
:: (FromJSON Maybe k , FromJSON Maybe v , Functor m )
34
39
=> MPFS m
@@ -59,4 +64,6 @@ factsCmd mpfs tokenId (TestRunFacts TestRunRejected) = do
59
64
_ -> False
60
65
)
61
66
facts
67
+ factsCmd mpfs tokenId ConfigFact = retrieveAnyFacts mpfs tokenId
68
+ factsCmd mpfs tokenId WhiteListedFacts = retrieveAnyFacts mpfs tokenId
62
69
factsCmd mpfs tokenId AllFacts = retrieveAnyFacts mpfs tokenId
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module Options
13
13
) where
14
14
15
15
import Cli (Command (.. ))
16
+ import Control.Applicative (optional )
16
17
import Core.Options
17
18
( outputReferenceParser
18
19
, tokenIdOption
@@ -27,13 +28,13 @@ import OptEnvConf
27
28
( Parser
28
29
, command
29
30
, commands
30
- , runParser , (<|>)
31
+ , runParser
32
+ , (<|>)
31
33
)
32
34
import Oracle.Options (oracleCommandParser )
33
35
import User.Agent.Options (agentCommandParser )
34
36
import User.Requester.Options (requesterCommandParser )
35
37
import Wallet.Options (walletCommandParser )
36
- import Control.Applicative (optional )
37
38
38
39
newtype Options a = Options
39
40
{ optionsCommand :: Command a
@@ -78,7 +79,16 @@ factsSelectionParser =
78
79
" test-run"
79
80
" Get test runs"
80
81
(fmapBox TestRunFacts <$> testRunSelectionParser)
81
- ] <|> pure (Box AllFacts )
82
+ , command
83
+ " config"
84
+ " Get the oracle configuration"
85
+ (pure $ Box ConfigFact )
86
+ , command
87
+ " white-listed"
88
+ " Get white-listed repositories"
89
+ (pure $ Box WhiteListedFacts )
90
+ ]
91
+ <|> pure (Box AllFacts )
82
92
83
93
testRunSelectionParser :: Parser (Box TestRunSelection )
84
94
testRunSelectionParser =
You can’t perform that action at this time.
0 commit comments