-
Install Deno
brew install deno
-
Install jfilter
deno install --allow-read -n jfilter https://cdn.jsdelivr.net/gh/Drache93/[email protected]/main.ts
Expects a JSON object with ogit/Auth/vertexRule
or ogit/Auth/edgeRule
keys (will traverse until found):
{
"test-data": {
"ogit/_organization": "test_org",
"ogit/description": "test_desc",
"ogit/Auth/vertexRule": [
{
"action": "GET",
"values": {
"vertex.ogit/_type": [
"ogit/Mobile/Message"
]
}
},
{
"action": "UPDATE",
"values": {
"vertex.ogit/_type": [
"ogit/Mobile/Message"
]
}
}
]
}
}
jfilter -n -f my-filter.json
Outputs:
{
"test-data": {
"ogit/_organization": "test_org",
"ogit/description": "test_desc",
"ogit/Auth/vertexRule": "|(&(action = GET)(vertex.ogit/_type = ogit/Mobile/Message))(&(action = UPDATE)(vertex.ogit/_type = ogit/Mobile/Message))"
}
}
Nested data is also supported, this is a JSON object with specific keys expected to contain a JFilter object. Nested data is outputted with the same structure, however the JFilter object is replaced with a JFilter string.
A correct Jfilter value can be passed in to check the JSON output
jfilter my-filter.json "|(&(action = GET)(|(vertex.ogit/_type = ogit/Mobile/Message)))(&(action = UPDATE)(|(vertex.ogit/_type = ogit/Mobile/Message)))"
Any differences will be highlighted