]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add new query parameters in M365EmailList endpoint
authorFrancisco Manuel Garcia Botella <francisco.garcia@baculasystems.com>
Wed, 4 Sep 2024 10:27:24 +0000 (10:27 +0000)
committerFrancisco Manuel Garcia Botella <francisco.garcia@baculasystems.com>
Wed, 4 Sep 2024 10:27:24 +0000 (10:27 +0000)
gui/baculum/protected/API/Pages/API/PluginM365EmailList.php
gui/baculum/protected/API/openapi_baculum.json

index 201331b3a311635ec43828d846ff9f0e69c6630f..c2c970a6b4f6e9ee425e798e082ab6a2d7111cff 100644 (file)
@@ -92,7 +92,7 @@ class PluginM365EmailList extends ConsoleOutputJSONPage {
                        $params['maxtime'] = $this->Request['maxtime'];
                }
                if ($this->Request->contains('folder') && $misc->isValidFilename($this->Request['folder'])) {
-                       $params['folder'] = $this->Request['folder'];
+                       $params['foldername'] = $this->Request['folder'];
                }
                if ($this->Request->contains('tags') && $misc->isValidName($this->Request['tags'])) {
                        $params['tags'] = $this->Request['tags'];
@@ -113,8 +113,18 @@ class PluginM365EmailList extends ConsoleOutputJSONPage {
                        $params['maxsize'] = $this->Request['maxsize'];
                }
                if ($this->Request->contains('conversationid') && $misc->isValidNameExt($this->Request['conversationid'])) {
-                       $params['conversationid'] =  $this->Request['conversationid'];
+                       $params['conversationid'] = $this->Request['conversationid'];
                }
+               if ($this->Request->contains('subject')) {
+                       $params['subject'] = $this->Request['subject'];
+               }
+               if ($this->Request->contains('bodypreview')) {
+                       $params['bodypreview'] = $this->Request['bodypreview'];
+               }
+               if ($this->Request->contains('hasattachment') && $misc->isValidBooleanTrue($this->Request['hasattachment'])) {
+                       $params['hasattachment'] = $this->Request['hasattachment'];
+               }
+               
                $out = $this->getJSONOutput($params);
 
                $output = [];
index 8234d59cb7d94a7349cf3db0c51c57c888c7a786..54eb8d808de780cd120c35b0fb5aa966b0da46da 100644 (file)
                                                        "type": "string"
                                                }
                                        },
+                                       {
+                                               "name": "subject",
+                                               "in": "query",
+                                               "required": false,
+                                               "description": "Email subject",
+                                               "schema": {
+                                                       "type": "string"
+                                               }
+                                       },
+                                       {
+                                               "name": "bodypreview",
+                                               "in": "query",
+                                               "required": false,
+                                               "description": "Email body preview",
+                                               "schema": {
+                                                       "type": "string"
+                                               }
+                                       },
                                        {
                                                "name": "minsize",
                                                "in": "query",
                                                "schema": {
                                                        "type": "string"
                                                }
+                                       },
+                                       {
+                                               "name": "hasattachment",
+                                               "in": "query",
+                                               "required": false,
+                                               "description": "Email has attachments",
+                                               "schema": {
+                                                       "type": "boolean"
+                                               }
                                        }
                                ]
                        }