mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-25 16:21:00 +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 title (rg --replace '$1' '^title: *(.*)$' $file | string trim)
|
||||||
set desc (rg --replace '$1' '^description: *(.*)$' $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]')
|
set inputtype (rg --replace '$1' '(\[ *"i".*\])[^]]*$' $file | jq -nr 'input // [0, 0, ""] | .[2]')
|
||||||
|
set params (fq '
|
||||||
echo "var Job$kind = Job{
|
|
||||||
InputKind: $kind,
|
|
||||||
OutputKind: $okind,
|
|
||||||
Name: \"$title\",
|
|
||||||
Description: \"$desc\",
|
|
||||||
InputType: \"$inputtype\",
|
|
||||||
Params: []string{" >> kinds.go
|
|
||||||
|
|
||||||
for param in (fq '
|
|
||||||
def drill_to_code:
|
def drill_to_code:
|
||||||
if (type == "object" and .children) then
|
if (type == "object" and .children) then
|
||||||
.children
|
.children
|
||||||
@ -71,6 +62,16 @@ generate: dvm_repo
|
|||||||
| .[]
|
| .[]
|
||||||
' -d markdown -r $file
|
' -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
|
echo "\"$param\"", >> kinds.go
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -79,6 +80,13 @@ generate: dvm_repo
|
|||||||
" >> kinds.go
|
" >> kinds.go
|
||||||
end
|
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
|
go fmt kinds.go
|
||||||
|
|
||||||
dvm_repo:
|
dvm_repo:
|
||||||
|
@ -135,7 +135,7 @@ var Job5301 = Job{
|
|||||||
OutputKind: 6301,
|
OutputKind: 6301,
|
||||||
Name: "Nostr People Discovery",
|
Name: "Nostr People Discovery",
|
||||||
Description: "Job request to discover nostr pubkeys",
|
Description: "Job request to discover nostr pubkeys",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ var Job5400 = Job{
|
|||||||
OutputKind: 6400,
|
OutputKind: 6400,
|
||||||
Name: "Nostr Event Count",
|
Name: "Nostr Event Count",
|
||||||
Description: "Job request to count matching events",
|
Description: "Job request to count matching events",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"content",
|
"content",
|
||||||
"group",
|
"group",
|
||||||
@ -222,3 +222,25 @@ var Job5970 = Job{
|
|||||||
InputType: "text",
|
InputType: "text",
|
||||||
Params: []string{},
|
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