mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-31 10:10:14 +02:00
nip90: list all available jobs, update dvm definitions a little bit.
This commit is contained in:
parent
eaec35c156
commit
535f62cec9
@ -20,16 +20,7 @@ generate: dvm_repo
|
||||
set title (rg --replace '$1' '^title: *(.*)$' $file | string trim)
|
||||
set desc (rg --replace '$1' '^description: *(.*)$' $file | string trim)
|
||||
set inputtype (rg --replace '$1' '(\[ *"i".*\])[^]]*$' $file | jq -nr 'input // [0, 0, ""] | .[2]')
|
||||
|
||||
echo "var Job$kind = Job{
|
||||
InputKind: $kind,
|
||||
OutputKind: $okind,
|
||||
Name: \"$title\",
|
||||
Description: \"$desc\",
|
||||
InputType: \"$inputtype\",
|
||||
Params: []string{" >> kinds.go
|
||||
|
||||
for param in (fq '
|
||||
set params (fq '
|
||||
def drill_to_code:
|
||||
if (type == "object" and .children) then
|
||||
.children
|
||||
@ -71,6 +62,16 @@ generate: dvm_repo
|
||||
| .[]
|
||||
' -d markdown -r $file
|
||||
)
|
||||
|
||||
echo "var Job$kind = Job{
|
||||
InputKind: $kind,
|
||||
OutputKind: $okind,
|
||||
Name: \"$title\",
|
||||
Description: \"$desc\",
|
||||
InputType: \"$inputtype\",
|
||||
Params: []string{" >> kinds.go
|
||||
|
||||
for param in $params
|
||||
echo "\"$param\"", >> kinds.go
|
||||
end
|
||||
|
||||
@ -79,6 +80,13 @@ generate: dvm_repo
|
||||
" >> kinds.go
|
||||
end
|
||||
|
||||
echo "var Jobs = []Job{" >> kinds.go
|
||||
for kindf in (ls data-vending-machines/kinds)
|
||||
set kind (echo $kindf | rg -o '\d+')
|
||||
echo "Job$kind," >> kinds.go
|
||||
end
|
||||
echo "}" >> kinds.go
|
||||
|
||||
go fmt kinds.go
|
||||
|
||||
dvm_repo:
|
||||
|
@ -135,7 +135,7 @@ var Job5301 = Job{
|
||||
OutputKind: 6301,
|
||||
Name: "Nostr People Discovery",
|
||||
Description: "Job request to discover nostr pubkeys",
|
||||
InputType: "",
|
||||
InputType: "text",
|
||||
Params: []string{},
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ var Job5400 = Job{
|
||||
OutputKind: 6400,
|
||||
Name: "Nostr Event Count",
|
||||
Description: "Job request to count matching events",
|
||||
InputType: "",
|
||||
InputType: "text",
|
||||
Params: []string{
|
||||
"content",
|
||||
"group",
|
||||
@ -222,3 +222,25 @@ var Job5970 = Job{
|
||||
InputType: "text",
|
||||
Params: []string{},
|
||||
}
|
||||
|
||||
var Jobs = []Job{
|
||||
Job5000,
|
||||
Job5001,
|
||||
Job5002,
|
||||
Job5050,
|
||||
Job5100,
|
||||
Job5200,
|
||||
Job5201,
|
||||
Job5202,
|
||||
Job5250,
|
||||
Job5300,
|
||||
Job5301,
|
||||
Job5302,
|
||||
Job5303,
|
||||
Job5400,
|
||||
Job5500,
|
||||
Job5900,
|
||||
Job5901,
|
||||
Job5905,
|
||||
Job5970,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user