diff --git a/DSL.Resql/list_regex.sql b/DSL.Resql/list_regex.sql new file mode 100644 index 0000000..43a1c80 --- /dev/null +++ b/DSL.Resql/list_regex.sql @@ -0,0 +1 @@ +select Regex_Entity.id, Regex_Entity.entity, Regex_Entity.regex from Regex_Entity join (select Regex_Entity."id", max(Regex_Entity."created_at") as most_recent_record from Regex_Entity group by id) p ON (Regex_Entity.id = p.id and Regex_Entity.created_at = p.most_recent_record) where Regex_Entity.active = True; diff --git a/DSL.Ruuter/GET/regex.yml b/DSL.Ruuter/GET/regex.yml new file mode 100644 index 0000000..6b5b876 --- /dev/null +++ b/DSL.Ruuter/GET/regex.yml @@ -0,0 +1,8 @@ +list_regex: + call: http.post + args: + url: http://resql:8082/list_regex + result: request_response + +return_value: + return: ${request_response.response.body} diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 24e6fe6..226ffe4 --- a/README.md +++ b/README.md @@ -185,3 +185,19 @@ https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/POST/annotate ``` curl -H "Content-Type: application/json" -X "POST" "http://localhost:8080/annotate?project=097afbed-761e-4ede-b7d4-97cafdadc488" --data '{"id":932021,"annotated_text":"text","sentences_annotations":"[{\"value\":{\"start\":44,\"end\":48,\"text\":\"2343\",\"labels\":[\"Aadress\"]},\"id\":\"AFPMDbFSpq\",\"from_name\":\"label\",\"to_name\":\"text\",\"type\":\"labels\",\"origin\":\"manual\"}]","annotate_existing_task":false,"project":"097afbed-761e-4ede-b7d4-97cafdadc488"}' ``` + +### View list of Regex patterns added by user + +https://github.com/buerokratt/Data-Anonymizer/issues/60 + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/list_regex.sql + +``` +curl -X "POST" "http://localhost:8082/list_regex" +``` + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/regex.yml + +``` +curl "http://localhost:8080/regex" +```