Skip to content

Commit

Permalink
feat(commands): add command and command handler types
Browse files Browse the repository at this point in the history
  • Loading branch information
TheExGenesis committed Apr 2, 2022
1 parent 5259277 commit 18c6abc
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/default-packages/unigraph.core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
{
"id": "sync_resource",
"src": "schemas/sync_resource.json"
},
{
"id": "command",
"src": "schemas/command.json"
},
{
"id": "command_handler",
"src": "schemas/command_handler.json"
}
],
"executables": [
Expand Down
26 changes: 26 additions & 0 deletions packages/default-packages/unigraph.core/schemas/command.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"dgraph.type": "Type",
"_name": "Command",
"_icon": "%3Csvg xmlns='http://www.w3.org/2000/svg' style='width:24px;height:24px' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74zm9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38z' /%3E%3C/svg%3E",
"_definition": {
"type": { "unigraph.id": "$/composer/Object" },
"_parameters": {
"_indexedBy": { "unigraph.id": "$/primitive/string" }
},
"_properties": [
{
"_key": "name",
"_definition": {
"type": { "unigraph.id": "$/primitive/string" }
},
"_indexAs": "name"
},
{
"_key": "icon",
"_definition": {
"type": { "unigraph.id": "$/schema/icon_url" }
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"dgraph.type": "Type",
"_name": "Command Handler",
"_definition": {
"type": { "unigraph.id": "$/composer/Object" },
"_parameters": {
"_indexedBy": { "unigraph.id": "$/primitive/string" }
},
"_properties": [
{
"_key": "command",
"_definition": {
"type": { "unigraph.id": "$/schema/command" }
}
},
{
"_key": "condition",
"_definition": {
"type": { "unigraph.id": "$/schema/executable" }
}
},
{
"_key": "action",
"_definition": {
"type": { "unigraph.id": "$/schema/executable" }
}
}
]
}
}

0 comments on commit 18c6abc

Please sign in to comment.