mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
new api 2.0
This commit is contained in:
parent
3922a052c9
commit
3c68356b81
Binary file not shown.
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 8.3 KiB |
@ -3,7 +3,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Swagger UI</title>
|
||||
<title>Pandora FMS API</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link
|
||||
|
@ -0,0 +1,96 @@
|
||||
ramda: 361.78 KB (5.92%)
|
||||
ramda-adjunct: 257.62 KB (4.21%)
|
||||
lodash: 253.56 KB (4.15%)
|
||||
autolinker: 203.32 KB (3.33%)
|
||||
@swagger-api/apidom-ns-openapi-3-0: 201.95 KB (3.30%)
|
||||
swagger-client: 172.85 KB (2.83%)
|
||||
cookie: 5.16 KB (2.98%)
|
||||
is-plain-object: 758 B (0.428%)
|
||||
<self>: 166.96 KB (96.6%)
|
||||
@swagger-api/apidom-ns-openapi-3-1: 153.37 KB (2.51%)
|
||||
immutable: 139.01 KB (2.27%)
|
||||
react-dom: 129.98 KB (2.13%)
|
||||
remarkable: 125.56 KB (2.05%)
|
||||
highlight.js: 111.85 KB (1.83%)
|
||||
js-yaml: 105.01 KB (1.72%)
|
||||
readable-stream: 96.66 KB (1.58%)
|
||||
@swagger-api/apidom-reference: 90.42 KB (1.48%)
|
||||
core-js-pure: 82.79 KB (1.35%)
|
||||
dompurify: 63.43 KB (1.04%)
|
||||
minim: 57.35 KB (0.938%)
|
||||
buffer: 56.99 KB (0.932%)
|
||||
@swagger-api/apidom-ns-json-schema-draft-4: 54.24 KB (0.887%)
|
||||
@swagger-api/apidom-core: 50.31 KB (0.823%)
|
||||
@swagger-api/apidom-ast: 47.25 KB (0.773%)
|
||||
react-syntax-highlighter: 40.15 KB (0.657%)
|
||||
react-redux: 36.88 KB (0.603%)
|
||||
fast-json-patch: 31.89 KB (0.522%)
|
||||
qs: 26.61 KB (0.435%)
|
||||
reselect: 21.43 KB (0.350%)
|
||||
short-unique-id: 18.88 KB (0.309%)
|
||||
sha.js: 18.57 KB (0.304%)
|
||||
object-inspect: 18.44 KB (0.302%)
|
||||
redux: 16.37 KB (0.268%)
|
||||
url-parse: 16.23 KB (0.266%)
|
||||
tslib: 15.87 KB (0.260%)
|
||||
events: 14.54 KB (0.238%)
|
||||
get-intrinsic: 13.01 KB (0.213%)
|
||||
zenscroll: 12.31 KB (0.201%)
|
||||
react-debounce-input: 11.95 KB (0.195%)
|
||||
react-immutable-proptypes: 11.82 KB (0.193%)
|
||||
ret: 10.82 KB (0.177%)
|
||||
lodash.debounce: 10.53 KB (0.172%)
|
||||
unraw: 9.9 KB (0.162%)
|
||||
string_decoder: 9.24 KB (0.151%)
|
||||
xml: 7.39 KB (0.121%)
|
||||
react-copy-to-clipboard: 7.33 KB (0.120%)
|
||||
traverse: 7.15 KB (0.117%)
|
||||
react: 6.94 KB (0.113%)
|
||||
@swagger-api/apidom-json-pointer: 6.39 KB (0.105%)
|
||||
randexp: 6.15 KB (0.101%)
|
||||
react-immutable-pure-component: 6.01 KB (0.0982%)
|
||||
redux-immutable: 5.43 KB (0.0889%)
|
||||
process: 5.29 KB (0.0865%)
|
||||
drange: 4.8 KB (0.0786%)
|
||||
lowlight: 4.42 KB (0.0724%)
|
||||
scheduler: 4.33 KB (0.0708%)
|
||||
@babel/runtime: 4.23 KB (0.0691%)
|
||||
deep-extend: 4.19 KB (0.0686%)
|
||||
deepmerge: 3.95 KB (0.0647%)
|
||||
base64-js: 3.84 KB (0.0628%)
|
||||
stream-browserify: 3.76 KB (0.0615%)
|
||||
@swagger-api/apidom-error: 3.36 KB (0.0549%)
|
||||
side-channel: 3.31 KB (0.0542%)
|
||||
copy-to-clipboard: 3.29 KB (0.0537%)
|
||||
format: 3.26 KB (0.0533%)
|
||||
stampit: 3.16 KB (0.0516%)
|
||||
css.escape: 3.08 KB (0.0504%)
|
||||
serialize-error: 2.93 KB (0.0479%)
|
||||
define-data-property: 2.77 KB (0.0453%)
|
||||
prop-types: 2.6 KB (0.0425%)
|
||||
querystringify: 2.5 KB (0.0410%)
|
||||
xml-but-prettier: 2.17 KB (0.0354%)
|
||||
has-symbols: 2.13 KB (0.0348%)
|
||||
function-bind: 2.12 KB (0.0346%)
|
||||
ieee754: 2.1 KB (0.0344%)
|
||||
@braintree/sanitize-url: 1.98 KB (0.0324%)
|
||||
safe-buffer: 1.63 KB (0.0267%)
|
||||
call-bind: 1.59 KB (0.0260%)
|
||||
util-deprecate: 1.58 KB (0.0258%)
|
||||
randombytes: 1.54 KB (0.0252%)
|
||||
js-file-download: 1.52 KB (0.0248%)
|
||||
classnames: 1.49 KB (0.0244%)
|
||||
use-sync-external-store: 1.28 KB (0.0210%)
|
||||
repeat-string: 1.18 KB (0.0194%)
|
||||
set-function-length: 1.14 KB (0.0187%)
|
||||
@babel/runtime-corejs3: 878 B (0.0140%)
|
||||
has-property-descriptors: 817 B (0.0130%)
|
||||
toggle-selection: 780 B (0.0125%)
|
||||
inherits: 753 B (0.0120%)
|
||||
requires-port: 753 B (0.0120%)
|
||||
fault: 691 B (0.0110%)
|
||||
gopd: 263 B (0.00420%)
|
||||
hasown: 234 B (0.00374%)
|
||||
has-proto: 197 B (0.00315%)
|
||||
object-inspect|.: 15 B (0.000240%)
|
||||
<self>: 2.72 MB (45.5%)
|
@ -0,0 +1,14 @@
|
||||
readable-stream: 96.66 KB (6.16%)
|
||||
buffer: 56.99 KB (3.63%)
|
||||
sha.js: 18.57 KB (1.18%)
|
||||
events: 14.54 KB (0.926%)
|
||||
string_decoder: 9.24 KB (0.589%)
|
||||
xml: 7.39 KB (0.471%)
|
||||
process: 5.29 KB (0.337%)
|
||||
deep-extend: 4.19 KB (0.267%)
|
||||
stream-browserify: 3.76 KB (0.239%)
|
||||
safe-buffer: 1.63 KB (0.104%)
|
||||
util-deprecate: 1.58 KB (0.100%)
|
||||
randombytes: 1.54 KB (0.0981%)
|
||||
inherits: 753 B (0.0468%)
|
||||
<self>: 1.32 MB (85.9%)
|
@ -0,0 +1,96 @@
|
||||
ramda: 361.78 KB (5.92%)
|
||||
ramda-adjunct: 257.62 KB (4.21%)
|
||||
lodash: 253.56 KB (4.15%)
|
||||
autolinker: 203.32 KB (3.33%)
|
||||
@swagger-api/apidom-ns-openapi-3-0: 201.95 KB (3.30%)
|
||||
swagger-client: 172.85 KB (2.83%)
|
||||
cookie: 5.16 KB (2.98%)
|
||||
is-plain-object: 758 B (0.428%)
|
||||
<self>: 166.96 KB (96.6%)
|
||||
@swagger-api/apidom-ns-openapi-3-1: 153.37 KB (2.51%)
|
||||
immutable: 139.01 KB (2.27%)
|
||||
react-dom: 129.98 KB (2.13%)
|
||||
remarkable: 125.56 KB (2.05%)
|
||||
highlight.js: 111.85 KB (1.83%)
|
||||
js-yaml: 105.01 KB (1.72%)
|
||||
readable-stream: 96.66 KB (1.58%)
|
||||
@swagger-api/apidom-reference: 90.42 KB (1.48%)
|
||||
core-js-pure: 82.79 KB (1.35%)
|
||||
dompurify: 63.43 KB (1.04%)
|
||||
minim: 57.35 KB (0.938%)
|
||||
buffer: 56.99 KB (0.932%)
|
||||
@swagger-api/apidom-ns-json-schema-draft-4: 54.24 KB (0.887%)
|
||||
@swagger-api/apidom-core: 50.31 KB (0.823%)
|
||||
@swagger-api/apidom-ast: 47.25 KB (0.773%)
|
||||
react-syntax-highlighter: 40.15 KB (0.657%)
|
||||
react-redux: 36.88 KB (0.603%)
|
||||
fast-json-patch: 31.89 KB (0.522%)
|
||||
qs: 26.61 KB (0.435%)
|
||||
reselect: 21.43 KB (0.350%)
|
||||
short-unique-id: 18.88 KB (0.309%)
|
||||
sha.js: 18.57 KB (0.304%)
|
||||
object-inspect: 18.44 KB (0.302%)
|
||||
redux: 16.37 KB (0.268%)
|
||||
url-parse: 16.23 KB (0.266%)
|
||||
tslib: 15.87 KB (0.260%)
|
||||
events: 14.54 KB (0.238%)
|
||||
get-intrinsic: 13.01 KB (0.213%)
|
||||
zenscroll: 12.31 KB (0.201%)
|
||||
react-debounce-input: 11.95 KB (0.195%)
|
||||
react-immutable-proptypes: 11.82 KB (0.193%)
|
||||
ret: 10.82 KB (0.177%)
|
||||
lodash.debounce: 10.53 KB (0.172%)
|
||||
unraw: 9.9 KB (0.162%)
|
||||
string_decoder: 9.24 KB (0.151%)
|
||||
xml: 7.39 KB (0.121%)
|
||||
react-copy-to-clipboard: 7.33 KB (0.120%)
|
||||
traverse: 7.15 KB (0.117%)
|
||||
react: 6.94 KB (0.113%)
|
||||
@swagger-api/apidom-json-pointer: 6.39 KB (0.105%)
|
||||
randexp: 6.15 KB (0.101%)
|
||||
react-immutable-pure-component: 6.01 KB (0.0982%)
|
||||
redux-immutable: 5.43 KB (0.0889%)
|
||||
process: 5.29 KB (0.0865%)
|
||||
drange: 4.8 KB (0.0786%)
|
||||
lowlight: 4.42 KB (0.0724%)
|
||||
scheduler: 4.33 KB (0.0708%)
|
||||
@babel/runtime: 4.23 KB (0.0691%)
|
||||
deep-extend: 4.19 KB (0.0686%)
|
||||
deepmerge: 3.95 KB (0.0647%)
|
||||
base64-js: 3.84 KB (0.0628%)
|
||||
stream-browserify: 3.76 KB (0.0615%)
|
||||
@swagger-api/apidom-error: 3.36 KB (0.0549%)
|
||||
side-channel: 3.31 KB (0.0542%)
|
||||
copy-to-clipboard: 3.29 KB (0.0537%)
|
||||
format: 3.26 KB (0.0533%)
|
||||
stampit: 3.16 KB (0.0516%)
|
||||
css.escape: 3.08 KB (0.0504%)
|
||||
serialize-error: 2.93 KB (0.0479%)
|
||||
define-data-property: 2.77 KB (0.0453%)
|
||||
prop-types: 2.6 KB (0.0425%)
|
||||
querystringify: 2.5 KB (0.0410%)
|
||||
xml-but-prettier: 2.17 KB (0.0354%)
|
||||
has-symbols: 2.13 KB (0.0348%)
|
||||
function-bind: 2.12 KB (0.0346%)
|
||||
ieee754: 2.1 KB (0.0344%)
|
||||
@braintree/sanitize-url: 1.98 KB (0.0324%)
|
||||
safe-buffer: 1.63 KB (0.0267%)
|
||||
call-bind: 1.59 KB (0.0260%)
|
||||
util-deprecate: 1.58 KB (0.0258%)
|
||||
randombytes: 1.54 KB (0.0252%)
|
||||
js-file-download: 1.52 KB (0.0248%)
|
||||
classnames: 1.49 KB (0.0244%)
|
||||
use-sync-external-store: 1.28 KB (0.0210%)
|
||||
repeat-string: 1.18 KB (0.0194%)
|
||||
set-function-length: 1.14 KB (0.0187%)
|
||||
@babel/runtime-corejs3: 878 B (0.0140%)
|
||||
has-property-descriptors: 817 B (0.0130%)
|
||||
toggle-selection: 780 B (0.0125%)
|
||||
inherits: 753 B (0.0120%)
|
||||
requires-port: 753 B (0.0120%)
|
||||
fault: 691 B (0.0110%)
|
||||
gopd: 263 B (0.00420%)
|
||||
hasown: 234 B (0.00374%)
|
||||
has-proto: 197 B (0.00315%)
|
||||
object-inspect|.: 15 B (0.000240%)
|
||||
<self>: 2.72 MB (45.5%)
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,120 @@
|
||||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @description Recursive object extending
|
||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
||||
* @license MIT
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* cookie
|
||||
* Copyright(c) 2012-2014 Roman Shtylman
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||
* (c) 2017-2021 Joachim Wester
|
||||
* MIT license
|
||||
*/
|
||||
|
||||
/*!
|
||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||
* (c) 2017-2022 Joachim Wester
|
||||
* MIT licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
||||
|
||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-with-selector.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
/*!
|
||||
* @description Recursive object extending
|
||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
||||
* @license MIT
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,120 @@
|
||||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @description Recursive object extending
|
||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
||||
* @license MIT
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* cookie
|
||||
* Copyright(c) 2012-2014 Roman Shtylman
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||
* (c) 2017-2021 Joachim Wester
|
||||
* MIT license
|
||||
*/
|
||||
|
||||
/*!
|
||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||
* (c) 2017-2022 Joachim Wester
|
||||
* MIT licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
||||
|
||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-with-selector.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
||||
|
||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
File diff suppressed because one or more lines are too long
@ -3,9 +3,9 @@
|
||||
font-family: sans-serif; /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||
}
|
||||
.swagger-ui html {
|
||||
line-height: 1.15;
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
line-height: 1.15;
|
||||
}
|
||||
.swagger-ui body {
|
||||
margin: 0;
|
||||
@ -40,8 +40,8 @@
|
||||
font-size: 1em;
|
||||
}
|
||||
.swagger-ui a {
|
||||
-webkit-text-decoration-skip: objects;
|
||||
background-color: transparent;
|
||||
-webkit-text-decoration-skip: objects;
|
||||
}
|
||||
.swagger-ui abbr[title] {
|
||||
border-bottom: none;
|
||||
@ -2929,6 +2929,7 @@
|
||||
}
|
||||
}
|
||||
.swagger-ui .link {
|
||||
-webkit-text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
.swagger-ui .link,
|
||||
@ -6396,44 +6397,56 @@
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.swagger-ui .strike {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .underline {
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .no-underline {
|
||||
-webkit-text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
@media screen and (min-width: 30em) {
|
||||
.swagger-ui .strike-ns {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .underline-ns {
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .no-underline-ns {
|
||||
-webkit-text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 30em) and (max-width: 60em) {
|
||||
.swagger-ui .strike-m {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .underline-m {
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .no-underline-m {
|
||||
-webkit-text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 60em) {
|
||||
.swagger-ui .strike-l {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .underline-l {
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .no-underline-l {
|
||||
-webkit-text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
@ -6815,33 +6828,33 @@
|
||||
}
|
||||
}
|
||||
.swagger-ui .clip {
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
position: fixed !important;
|
||||
_position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
}
|
||||
@media screen and (min-width: 30em) {
|
||||
.swagger-ui .clip-ns {
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
position: fixed !important;
|
||||
_position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 30em) and (max-width: 60em) {
|
||||
.swagger-ui .clip-m {
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
position: fixed !important;
|
||||
_position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 60em) {
|
||||
.swagger-ui .clip-l {
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
position: fixed !important;
|
||||
_position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
}
|
||||
}
|
||||
.swagger-ui .ws-normal {
|
||||
@ -6973,11 +6986,11 @@
|
||||
}
|
||||
.swagger-ui .underline-hover:focus,
|
||||
.swagger-ui .underline-hover:hover {
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .grow {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
transform: translateZ(0);
|
||||
transition: transform 0.25s ease-out;
|
||||
@ -6991,7 +7004,6 @@
|
||||
}
|
||||
.swagger-ui .grow-large {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
transform: translateZ(0);
|
||||
transition: transform 0.25s ease-in-out;
|
||||
@ -7063,11 +7075,9 @@
|
||||
.swagger-ui .z-inherit {
|
||||
z-index: inherit;
|
||||
}
|
||||
.swagger-ui .z-initial {
|
||||
z-index: auto;
|
||||
}
|
||||
.swagger-ui .z-initial,
|
||||
.swagger-ui .z-unset {
|
||||
z-index: unset;
|
||||
z-index: auto;
|
||||
}
|
||||
.swagger-ui .nested-copy-line-height ol,
|
||||
.swagger-ui .nested-copy-line-height p,
|
||||
@ -7300,6 +7310,11 @@
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.swagger-ui .opblock .opblock-summary-method {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-operation-id,
|
||||
.swagger-ui .opblock .opblock-summary-path,
|
||||
.swagger-ui .opblock .opblock-summary-path__deprecated {
|
||||
@ -7309,7 +7324,6 @@
|
||||
font-family: monospace;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
padding: 0 10px;
|
||||
word-break: break-word;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
@ -7320,16 +7334,15 @@
|
||||
}
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-path {
|
||||
flex-shrink: 0;
|
||||
max-width: calc(100% - 110px - 15rem);
|
||||
flex-shrink: 1;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.swagger-ui .opblock .opblock-summary-path {
|
||||
flex-shrink: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-path__deprecated {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-operation-id {
|
||||
@ -7337,11 +7350,25 @@
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-description {
|
||||
color: #3b4151;
|
||||
flex: 1 1 auto;
|
||||
font-family: sans-serif;
|
||||
font-size: 13px;
|
||||
word-break: break-word;
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-path-description-wrapper {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 0 10px;
|
||||
padding: 0 10px;
|
||||
width: 100%;
|
||||
}
|
||||
@media (max-width: 550px) {
|
||||
.swagger-ui .opblock .opblock-summary-path-description-wrapper {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary {
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
@ -7636,13 +7663,9 @@
|
||||
margin: 3em auto;
|
||||
}
|
||||
.swagger-ui .opblock-body pre.microlight {
|
||||
word-wrap: break-word;
|
||||
background: #333;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
margin: 0;
|
||||
@ -7650,6 +7673,10 @@
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
word-break: break-word;
|
||||
word-wrap: break-word;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
font-weight: 600;
|
||||
}
|
||||
.swagger-ui .opblock-body pre.microlight .headerline {
|
||||
display: block;
|
||||
@ -7672,10 +7699,10 @@
|
||||
.swagger-ui .download-contents {
|
||||
align-items: center;
|
||||
background: #7d8293;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
bottom: 10px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
@ -7696,8 +7723,16 @@
|
||||
.swagger-ui .scheme-container .schemes {
|
||||
align-items: flex-end;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.swagger-ui .scheme-container .schemes > label {
|
||||
.swagger-ui .scheme-container .schemes > .schemes-server-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.swagger-ui .scheme-container .schemes > .schemes-server-container > label {
|
||||
color: #3b4151;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -7706,10 +7741,28 @@
|
||||
font-weight: 700;
|
||||
margin: -20px 15px 0 0;
|
||||
}
|
||||
.swagger-ui .scheme-container .schemes > label select {
|
||||
.swagger-ui
|
||||
.scheme-container
|
||||
.schemes
|
||||
> .schemes-server-container
|
||||
> label
|
||||
select {
|
||||
min-width: 130px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.swagger-ui .scheme-container .schemes:not(:has(.schemes-server-container)) {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.swagger-ui .scheme-container .schemes .auth-wrapper {
|
||||
flex: none;
|
||||
justify-content: none;
|
||||
}
|
||||
.swagger-ui .scheme-container .schemes .auth-wrapper .authorize {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
margin: 0;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.swagger-ui .loading-container {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
@ -7735,9 +7788,7 @@
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.swagger-ui .loading-container .loading:before {
|
||||
-webkit-animation: rotation 1s linear infinite, opacity 0.5s;
|
||||
animation: rotation 1s linear infinite, opacity 0.5s;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
border: 2px solid rgba(85, 85, 85, 0.1);
|
||||
border-radius: 100%;
|
||||
@ -7752,11 +7803,6 @@
|
||||
top: 50%;
|
||||
width: 60px;
|
||||
}
|
||||
@-webkit-keyframes rotation {
|
||||
to {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
@keyframes rotation {
|
||||
to {
|
||||
transform: rotate(1turn);
|
||||
@ -7782,11 +7828,6 @@
|
||||
font-size: 0.7em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
@-webkit-keyframes blinker {
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes blinker {
|
||||
50% {
|
||||
opacity: 0;
|
||||
@ -7927,10 +7968,10 @@
|
||||
border: none;
|
||||
padding: 0 0 0 10px;
|
||||
}
|
||||
.swagger-ui .authorization__btn.locked {
|
||||
.swagger-ui .authorization__btn .locked {
|
||||
opacity: 1;
|
||||
}
|
||||
.swagger-ui .authorization__btn.unlocked {
|
||||
.swagger-ui .authorization__btn .unlocked {
|
||||
opacity: 0.4;
|
||||
}
|
||||
.swagger-ui .model-box-control,
|
||||
@ -7964,14 +8005,13 @@
|
||||
fill: #404040;
|
||||
}
|
||||
.swagger-ui .expand-methods svg {
|
||||
fill: #707070;
|
||||
transition: all 0.3s;
|
||||
fill: #707070;
|
||||
}
|
||||
.swagger-ui button {
|
||||
cursor: pointer;
|
||||
}
|
||||
.swagger-ui button.invalid {
|
||||
-webkit-animation: shake 0.4s 1;
|
||||
animation: shake 0.4s 1;
|
||||
background: #feebeb;
|
||||
border-color: #f93e3e;
|
||||
@ -7990,13 +8030,21 @@
|
||||
width: 30px;
|
||||
}
|
||||
.swagger-ui .copy-to-clipboard button {
|
||||
background: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" aria-hidden="true"><path fill="%23fff" fill-rule="evenodd" d="M4 12h4v1H4v-1zm5-6H4v1h5V6zm2 3V7l-3 3 3 3v-2h5V9h-5zM6.5 8H4v1h2.5V8zM4 11h2.5v-1H4v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10v-2zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1z"/></svg>')
|
||||
background: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" aria-hidden="true"><path fill="%23fff" fill-rule="evenodd" d="M4 12h4v1H4zm5-6H4v1h5zm2 3V7l-3 3 3 3v-2h5V9zM6.5 8H4v1h2.5zM4 11h2.5v-1H4zm9 1h1v2c-.02.28-.11.52-.3.7s-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2s2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1"/></svg>')
|
||||
50% no-repeat;
|
||||
border: none;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
height: 25px;
|
||||
}
|
||||
.swagger-ui .copy-to-clipboard:active {
|
||||
background: #5e626f;
|
||||
}
|
||||
.swagger-ui .opblock-control-arrow {
|
||||
background: none;
|
||||
border: none;
|
||||
text-align: center;
|
||||
}
|
||||
.swagger-ui .curl-command .copy-to-clipboard {
|
||||
bottom: 5px;
|
||||
height: 20px;
|
||||
@ -8008,14 +8056,14 @@
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary .view-line-link.copy-to-clipboard {
|
||||
height: 26px;
|
||||
position: unset;
|
||||
position: static;
|
||||
}
|
||||
.swagger-ui select {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
background: #f7f7f7
|
||||
url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13.418 7.859a.695.695 0 0 1 .978 0 .68.68 0 0 1 0 .969l-3.908 3.83a.697.697 0 0 1-.979 0l-3.908-3.83a.68.68 0 0 1 0-.969.695.695 0 0 1 .978 0L10 11l3.418-3.141z"/></svg>')
|
||||
url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13.418 7.859a.695.695 0 0 1 .978 0 .68.68 0 0 1 0 .969l-3.908 3.83a.697.697 0 0 1-.979 0l-3.908-3.83a.68.68 0 0 1 0-.969.695.695 0 0 1 .978 0L10 11z"/></svg>')
|
||||
right 10px center no-repeat;
|
||||
background-size: 20px;
|
||||
border: 2px solid #41444e;
|
||||
@ -8033,7 +8081,6 @@
|
||||
padding: 5px;
|
||||
}
|
||||
.swagger-ui select.invalid {
|
||||
-webkit-animation: shake 0.4s 1;
|
||||
animation: shake 0.4s 1;
|
||||
background: #feebeb;
|
||||
border-color: #f93e3e;
|
||||
@ -8094,7 +8141,6 @@
|
||||
.swagger-ui input[type="search"].invalid,
|
||||
.swagger-ui input[type="text"].invalid,
|
||||
.swagger-ui textarea.invalid {
|
||||
-webkit-animation: shake 0.4s 1;
|
||||
animation: shake 0.4s 1;
|
||||
background: #feebeb;
|
||||
border-color: #f93e3e;
|
||||
@ -8113,25 +8159,6 @@
|
||||
background-color: #41444e;
|
||||
color: #fff;
|
||||
}
|
||||
@-webkit-keyframes shake {
|
||||
10%,
|
||||
90% {
|
||||
transform: translate3d(-1px, 0, 0);
|
||||
}
|
||||
20%,
|
||||
80% {
|
||||
transform: translate3d(2px, 0, 0);
|
||||
}
|
||||
30%,
|
||||
50%,
|
||||
70% {
|
||||
transform: translate3d(-4px, 0, 0);
|
||||
}
|
||||
40%,
|
||||
60% {
|
||||
transform: translate3d(4px, 0, 0);
|
||||
}
|
||||
}
|
||||
@keyframes shake {
|
||||
10%,
|
||||
90% {
|
||||
@ -8217,7 +8244,7 @@
|
||||
}
|
||||
.swagger-ui .checkbox input[type="checkbox"]:checked + label > .item {
|
||||
background: #e8e8e8
|
||||
url('data:image/svg+xml;charset=utf-8,<svg width="10" height="8" viewBox="3 7 10 8" xmlns="http://www.w3.org/2000/svg"><path fill="%2341474E" fill-rule="evenodd" d="M6.333 15 3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z"/></svg>')
|
||||
url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="8" viewBox="3 7 10 8"><path fill="%2341474E" fill-rule="evenodd" d="M6.333 15 3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z"/></svg>')
|
||||
50% no-repeat;
|
||||
}
|
||||
.swagger-ui .dialog-ux {
|
||||
@ -8304,6 +8331,7 @@
|
||||
color: #a0a0a0 !important;
|
||||
}
|
||||
.swagger-ui .model .deprecated > td:first-of-type {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .model-toggle {
|
||||
@ -8611,7 +8639,8 @@
|
||||
.swagger-ui .parameters-col_description select {
|
||||
border-width: 1px;
|
||||
}
|
||||
.swagger-ui .parameters-col_description .markdown p {
|
||||
.swagger-ui .parameters-col_description .markdown p,
|
||||
.swagger-ui .parameters-col_description .renderedMarkdown p {
|
||||
margin: 0;
|
||||
}
|
||||
.swagger-ui .parameter__name {
|
||||
@ -8658,6 +8687,7 @@
|
||||
}
|
||||
.swagger-ui .parameter__empty_value_toggle input {
|
||||
margin-right: 7px;
|
||||
width: auto;
|
||||
}
|
||||
.swagger-ui .parameter__empty_value_toggle.disabled {
|
||||
opacity: 0.7;
|
||||
@ -8668,7 +8698,8 @@
|
||||
.swagger-ui .response-col_description {
|
||||
width: 99%;
|
||||
}
|
||||
.swagger-ui .response-col_description .markdown p {
|
||||
.swagger-ui .response-col_description .markdown p,
|
||||
.swagger-ui .response-col_description .renderedMarkdown p {
|
||||
margin: 0;
|
||||
}
|
||||
.swagger-ui .response-col_links {
|
||||
@ -8685,18 +8716,31 @@
|
||||
background-color: #1b1b1b;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.swagger-ui .topbar .topbar-wrapper,
|
||||
.swagger-ui .topbar a {
|
||||
.swagger-ui .topbar .topbar-wrapper {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.swagger-ui .topbar .topbar-wrapper g {
|
||||
transform: scale(0.3);
|
||||
}
|
||||
@media (max-width: 550px) {
|
||||
.swagger-ui .topbar .topbar-wrapper {
|
||||
align-items: start;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
.swagger-ui .topbar a {
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
font-family: sans-serif;
|
||||
font-size: 1.5em;
|
||||
font-weight: 700;
|
||||
max-width: 300px;
|
||||
-webkit-text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
.swagger-ui .topbar a span {
|
||||
@ -8712,6 +8756,7 @@
|
||||
border: 2px solid #62a03f;
|
||||
border-radius: 4px 0 0 4px;
|
||||
margin: 0;
|
||||
max-width: 100%;
|
||||
outline: none;
|
||||
width: 100%;
|
||||
}
|
||||
@ -8746,6 +8791,11 @@
|
||||
font-weight: 700;
|
||||
padding: 4px 30px;
|
||||
}
|
||||
@media (max-width: 550px) {
|
||||
.swagger-ui .topbar .download-url-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.swagger-ui .info {
|
||||
margin: 50px 0;
|
||||
}
|
||||
@ -8889,13 +8939,13 @@
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
padding-left: 10px;
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .scope-def {
|
||||
padding: 0 0 20px;
|
||||
}
|
||||
.swagger-ui .errors-wrapper {
|
||||
-webkit-animation: scaleUp 0.5s;
|
||||
animation: scaleUp 0.5s;
|
||||
background: rgba(249, 62, 62, 0.1);
|
||||
border: 2px solid #f93e3e;
|
||||
@ -8924,6 +8974,7 @@
|
||||
}
|
||||
.swagger-ui .errors-wrapper .errors .error-line {
|
||||
cursor: pointer;
|
||||
-webkit-text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.swagger-ui .errors-wrapper hgroup {
|
||||
@ -8937,16 +8988,6 @@
|
||||
font-size: 20px;
|
||||
margin: 0;
|
||||
}
|
||||
@-webkit-keyframes scaleUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
@keyframes scaleUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
@ -8990,5 +9031,273 @@
|
||||
.swagger-ui .renderedMarkdown pre > code {
|
||||
display: block;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12 {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
border-radius: 4px;
|
||||
margin: 0 20px 15px;
|
||||
padding: 12px 0 12px 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12:first-of-type {
|
||||
margin: 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12:last-of-type {
|
||||
margin: 0 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12--embedded {
|
||||
background-color: inherit;
|
||||
padding-bottom: 0;
|
||||
padding-left: inherit;
|
||||
padding-right: inherit;
|
||||
padding-top: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-body {
|
||||
border-left: 1px dashed rgba(0, 0, 0, 0.1);
|
||||
margin: 2px 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-body--collapsed {
|
||||
display: none;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-accordion {
|
||||
border: none;
|
||||
outline: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-accordion__children {
|
||||
display: inline-block;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-accordion__icon {
|
||||
display: inline-block;
|
||||
height: 18px;
|
||||
vertical-align: bottom;
|
||||
width: 18px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-accordion__icon--expanded {
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: 50% 50%;
|
||||
transition: transform 0.15s ease-in;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-accordion__icon--collapsed {
|
||||
transform: rotate(0deg);
|
||||
transform-origin: 50% 50%;
|
||||
transition: transform 0.15s ease-in;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-accordion__icon svg {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-expand-deep-button {
|
||||
border: none;
|
||||
color: #505050;
|
||||
color: #afaeae;
|
||||
font-family: sans-serif;
|
||||
font-size: 12px;
|
||||
padding-right: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword {
|
||||
margin: 5px 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__children {
|
||||
border-left: 1px dashed rgba(0, 0, 0, 0.1);
|
||||
margin: 0 0 0 20px;
|
||||
padding: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__children--collapsed {
|
||||
display: none;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__name {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__name--primary {
|
||||
color: #3b4151;
|
||||
font-style: normal;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__name--secondary {
|
||||
color: #6b6b6b;
|
||||
font-style: italic;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__value {
|
||||
color: #6b6b6b;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__value--primary {
|
||||
color: #3b4151;
|
||||
font-style: normal;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__value--secondary {
|
||||
color: #6b6b6b;
|
||||
font-style: italic;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__value--const,
|
||||
.swagger-ui .json-schema-2020-12-keyword__value--warning {
|
||||
border: 1px dashed #6b6b6b;
|
||||
border-radius: 4px;
|
||||
color: #3b4151;
|
||||
color: #6b6b6b;
|
||||
display: inline-block;
|
||||
font-family: monospace;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
margin-left: 10px;
|
||||
padding: 1px 4px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword__value--warning {
|
||||
border: 1px dashed red;
|
||||
color: red;
|
||||
}
|
||||
.swagger-ui
|
||||
.json-schema-2020-12-keyword__name--secondary
|
||||
+ .json-schema-2020-12-keyword__value--secondary:before {
|
||||
content: "=";
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__attribute {
|
||||
color: #3b4151;
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
padding-left: 10px;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__attribute--primary {
|
||||
color: #55a;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__attribute--muted {
|
||||
color: gray;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__attribute--warning {
|
||||
color: red;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--\$vocabulary ul {
|
||||
border-left: 1px dashed rgba(0, 0, 0, 0.1);
|
||||
margin: 0 0 0 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-\$vocabulary-uri {
|
||||
margin-left: 35px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-\$vocabulary-uri--disabled {
|
||||
-webkit-text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--description {
|
||||
color: #6b6b6b;
|
||||
font-size: 12px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--description p {
|
||||
margin: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__title {
|
||||
color: #505050;
|
||||
display: inline-block;
|
||||
font-family: sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__title .json-schema-2020-12-keyword__name {
|
||||
margin: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-property {
|
||||
margin: 7px 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-property .json-schema-2020-12__title {
|
||||
color: #3b4151;
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--properties > ul {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-property {
|
||||
list-style-type: none;
|
||||
}
|
||||
.swagger-ui
|
||||
.json-schema-2020-12-property--required
|
||||
> .json-schema-2020-12:first-of-type
|
||||
> .json-schema-2020-12-head
|
||||
.json-schema-2020-12__title:after {
|
||||
color: red;
|
||||
content: "*";
|
||||
font-weight: 700;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--patternProperties ul {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.swagger-ui
|
||||
.json-schema-2020-12-keyword--patternProperties
|
||||
.json-schema-2020-12__title:first-of-type:after,
|
||||
.swagger-ui
|
||||
.json-schema-2020-12-keyword--patternProperties
|
||||
.json-schema-2020-12__title:first-of-type:before {
|
||||
color: #55a;
|
||||
content: "/";
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--enum > ul {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--enum > ul li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__constraint {
|
||||
background-color: #805ad5;
|
||||
border-radius: 4px;
|
||||
color: #3b4151;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
margin-left: 10px;
|
||||
padding: 1px 3px;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12__constraint--string {
|
||||
background-color: #d69e2e;
|
||||
color: #fff;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--dependentRequired > ul {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.swagger-ui .json-schema-2020-12-keyword--dependentRequired > ul li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
.swagger-ui
|
||||
.model-box
|
||||
.json-schema-2020-12:not(.json-schema-2020-12--embedded)
|
||||
> .json-schema-2020-12-head
|
||||
.json-schema-2020-12__title:first-of-type {
|
||||
font-size: 16px;
|
||||
}
|
||||
.swagger-ui .model-box > .json-schema-2020-12 {
|
||||
margin: 0;
|
||||
}
|
||||
.swagger-ui .model-box .json-schema-2020-12 {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
.swagger-ui .model-box .json-schema-2020-12-accordion,
|
||||
.swagger-ui .model-box .json-schema-2020-12-expand-deep-button {
|
||||
background-color: transparent;
|
||||
}
|
||||
.swagger-ui
|
||||
.models
|
||||
.json-schema-2020-12:not(.json-schema-2020-12--embedded)
|
||||
> .json-schema-2020-12-head
|
||||
.json-schema-2020-12__title:first-of-type {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=swagger-ui.css.map*/
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
// use PandoraFMS\Modules\Shared\Middlewares\UserTokenMiddleware;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||
@ -21,19 +20,20 @@ return function (App $app, ContainerInterface $container) {
|
||||
) use (
|
||||
$app,
|
||||
$container
|
||||
) {
|
||||
) {
|
||||
global $config;
|
||||
$authorization = $request->getHeader('Authorization');
|
||||
$user = false;
|
||||
if (empty($authorization) === false && empty($authorization[0]) === false) {
|
||||
$bearer = explode('Bearer ', $authorization[0]);
|
||||
if (empty($bearer) === false && isset($bearer[1]) === true) {
|
||||
// $user = \get_db_value(
|
||||
// 'id_usuario',
|
||||
// 'tusuario',
|
||||
// 'api_key',
|
||||
// $bearer[1]
|
||||
// );
|
||||
$user = \db_get_value(
|
||||
'id_user',
|
||||
'tusuario',
|
||||
'api_token',
|
||||
$bearer[1]
|
||||
);
|
||||
|
||||
if ($user !== false) {
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
@ -49,14 +49,7 @@ return function (App $app, ContainerInterface $container) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: XXX.
|
||||
$user = 'admin';
|
||||
$_SESSION['id_usuario'] = $user;
|
||||
$config['id_user'] = $user;
|
||||
|
||||
if (empty($user) === true) {
|
||||
// $userTokenMiddleware = $container->get(UserTokenMiddleware::class);
|
||||
// if ($userTokenMiddleware->check($request) === false) {
|
||||
$response = $app->getResponseFactory()->createResponse();
|
||||
$response->getBody()->write(
|
||||
json_encode(['error' => 'You need to be authenticated to perform this action'])
|
||||
|
@ -5,4 +5,5 @@ use Slim\App;
|
||||
return function (App $app) {
|
||||
(include __DIR__.'/../../../include/lib/Modules/Users/routes.php')($app);
|
||||
(include __DIR__.'/../../../include/lib/Modules/Profiles/routes.php')($app);
|
||||
(include __DIR__.'/../../../include/lib/Modules/Events/routes.php')($app);
|
||||
};
|
||||
|
@ -2,12 +2,12 @@
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"title": "Nueva API de Pandora FMS",
|
||||
"description": "Nueva Api de pandora FMS",
|
||||
"description": "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Libero, quibusdam esse commodi rem nisi cumque quos ut, exercitationem recusandae ipsam fuga qui veritatis non temporibus perferendis earum amet cupiditate eum nam corrupti! Dicta tempora, debitis molestiae corrupti sequi asperiores libero perferendis ut aperiam laboriosam repudiandae neque, rem quidem consectetur. Magnam illum perferendis aspernatur quibusdam esse? Libero eius veritatis quae perspiciatis. Sit recusandae aspernatur possimus autem! Corporis ipsa voluptatem placeat quasi praesentium esse doloremque magni, error, cumque vel, consequatur quam saepe iusto accusantium tempore ab dignissimos alias sint officia fuga voluptas. Vel repudiandae dicta ipsum repellat reprehenderit. Molestiae, ullam dolorum voluptatem necessitatibus itaque officiis ducimus consectetur aut facilis atque aliquid reiciendis voluptas sit incidunt, repellendus soluta quod obcaecati unde quas. Error officiis cumque vero minima amet modi enim, placeat consectetur cupiditate, fugiat odit sunt a earum natus dicta, labore id dolor! Quis laboriosam a quasi fuga! Ullam consectetur, voluptates repellat eveniet delectus officia nostrum amet obcaecati adipisci natus voluptas explicabo dolores similique doloribus. Rerum voluptatibus aperiam quidem necessitatibus, sint dignissimos natus delectus dolorem dicta sunt eum doloribus eligendi similique a at in repellat fuga voluptatem atque consectetur, ratione sit! Magni tenetur quos laborum, excepturi eveniet laboriosam optio aperiam eaque sit iusto.",
|
||||
"termsOfService": "https://example.com/terms/",
|
||||
"contact": {
|
||||
"name": "Nombre del contacto",
|
||||
"url": "https://www.example.com/support",
|
||||
"email": "contacto@example.com"
|
||||
"name": "Pandorafms",
|
||||
"url": "https://pandorafms.com/",
|
||||
"email": "info@pandorafms.com"
|
||||
},
|
||||
"license": {
|
||||
"name": "Apache 2.0",
|
||||
@ -22,6 +22,444 @@
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/event/{idEvent}/comment": {
|
||||
"post": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Creates a new field into events comments",
|
||||
"operationId": "2020a70d1ff3c6f03cd2fd8da18749fd",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"$ref": "#/components/requestBodies/requestBodyEventComment"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/ResponseEventComment"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/event/{idEvent}/comment/{idComment}": {
|
||||
"get": {
|
||||
"tags": ["Events"],
|
||||
"summary": "show field events comments",
|
||||
"operationId": "8af1ae411de1815fcab2f36d14097087",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEventComment"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/ResponseEventComment"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Updates comment for event type",
|
||||
"operationId": "37ee3bcc633964ad0cc9449656d31c06",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEventComment"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"$ref": "#/components/requestBodies/requestBodyEventComment"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/ResponseEventComment"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Delete comment for event type object.",
|
||||
"operationId": "a8bee70746f69bc9e33430e366c42d96",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEventComment"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/successfullyDeleted"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/event/{idEvent}/comment/list": {
|
||||
"post": {
|
||||
"tags": ["Events"],
|
||||
"summary": "List comments event",
|
||||
"operationId": "15f46fb326ae31e90a7c08633c847714",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterPage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterSizePage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterSortField"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterSortDirection"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"$ref": "#/components/requestBodies/requestBodyEventCommentFilter"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List Comments event object",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"properties": {
|
||||
"paginationData": {
|
||||
"$ref": "#/components/schemas/paginationData"
|
||||
},
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/EventComment"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/event": {
|
||||
"post": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Creates a new events",
|
||||
"operationId": "5be1726b27d36b7fccaa31b67aae40ce",
|
||||
"requestBody": {
|
||||
"$ref": "#/components/requestBodies/requestBodyEvent"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/ResponseEvent"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/event/{idEvent}": {
|
||||
"get": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Show event",
|
||||
"operationId": "3a0ffd69081654c5ac8f3f4ed295fdb5",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/ResponseEvent"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Updates an event",
|
||||
"operationId": "975b79e51bbae407e6a31b8146db6ad4",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"$ref": "#/components/requestBodies/requestBodyEvent"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/ResponseEvent"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"tags": ["Events"],
|
||||
"summary": "Deletes an event object.",
|
||||
"operationId": "4e0c40ca422ab13ff8f780989f09d154",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterIdEvent"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/successfullyDeleted"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/event/list": {
|
||||
"post": {
|
||||
"tags": ["Events"],
|
||||
"summary": "List events",
|
||||
"operationId": "64da0a45e128eabdefb12c3496449140",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterPage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterSizePage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterSortField"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/parameters/parameterSortDirection"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"$ref": "#/components/requestBodies/requestBodyEventFilter"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List Events Object",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"properties": {
|
||||
"paginationData": {
|
||||
"$ref": "#/components/schemas/paginationData"
|
||||
},
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/NotFound"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalServerError"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/profile": {
|
||||
"post": {
|
||||
"tags": ["Profiles"],
|
||||
@ -638,10 +1076,285 @@
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"EventComment": {
|
||||
"properties": {
|
||||
"idEventComment": {
|
||||
"description": "id event comment",
|
||||
"type": "integer",
|
||||
"readOnly": true,
|
||||
"nullable": false
|
||||
},
|
||||
"idEvent": {
|
||||
"description": "id event comment",
|
||||
"type": "integer",
|
||||
"readOnly": true,
|
||||
"nullable": false
|
||||
},
|
||||
"utimestamp": {
|
||||
"description": "Event comment utimestamp create",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"readOnly": true,
|
||||
"example": "1704898868",
|
||||
"nullable": true
|
||||
},
|
||||
"comment": {
|
||||
"description": "content of the comment",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": false
|
||||
},
|
||||
"idUser": {
|
||||
"description": "User id create comment",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"readOnly": true,
|
||||
"nullable": false
|
||||
},
|
||||
"action": {
|
||||
"description": "content of the action",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": false
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"EventCommentFilter": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/EventComment"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"idEventComment": {
|
||||
"default": null,
|
||||
"readOnly": false
|
||||
},
|
||||
"freeSearch": {
|
||||
"description": "Find word in label fields.",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Event": {
|
||||
"properties": {
|
||||
"idEvent": {
|
||||
"description": "Id event",
|
||||
"type": "integer",
|
||||
"readOnly": true,
|
||||
"nullable": false
|
||||
},
|
||||
"idAgent": {
|
||||
"description": "Id agent",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"idUser": {
|
||||
"description": "Id user",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"idGroup": {
|
||||
"description": "Id group",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"status": {
|
||||
"description": "Event status, the available status are: new, validated, inprocess",
|
||||
"type": "integer",
|
||||
"default": "new",
|
||||
"enum": ["new", "validated", "inprocess"],
|
||||
"nullable": false
|
||||
},
|
||||
"timestamp": {
|
||||
"description": "Event registration date",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"readOnly": true,
|
||||
"example": "2023-21-02 08:34:16",
|
||||
"nullable": true
|
||||
},
|
||||
"event": {
|
||||
"description": "Description event",
|
||||
"type": "string",
|
||||
"default": "Event created for api",
|
||||
"nullable": false
|
||||
},
|
||||
"utimestamp": {
|
||||
"description": "Event registration date",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"readOnly": true,
|
||||
"example": "1704898868",
|
||||
"nullable": true
|
||||
},
|
||||
"eventType": {
|
||||
"description": "Event status, the available status are: going_unknown, unknown, alert_fired, alert_recovered, alert_ceased, alert_manual_validation, recon_host_detected, system, error, new_agent, going_up_critical, going_down_critical, going_up_warning, going_down_warning, going_up_normal, going_down_normal, configuration_change, ncm",
|
||||
"type": "string",
|
||||
"default": "unknown",
|
||||
"enum": [
|
||||
"going_unknown",
|
||||
"unknown",
|
||||
"alert_fired",
|
||||
"alert_recovered",
|
||||
"alert_ceased",
|
||||
"alert_manual_validation",
|
||||
"recon_host_detected",
|
||||
"system",
|
||||
"error",
|
||||
"new_agent",
|
||||
"going_up_critical",
|
||||
"going_down_critical",
|
||||
"going_up_warning",
|
||||
"going_down_warning",
|
||||
"going_up_normal",
|
||||
"going_down_normal",
|
||||
"configuration_change",
|
||||
"ncm"
|
||||
],
|
||||
"nullable": false
|
||||
},
|
||||
"idAgentModule": {
|
||||
"description": "Id agent module",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"idAlertAm": {
|
||||
"description": "Id alert action",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"criticity": {
|
||||
"description": "Event critcity, the available criticity are: maintenance, informational, normal, warning, critical, minor, major",
|
||||
"type": "integer",
|
||||
"default": "maintenance",
|
||||
"enum": [
|
||||
"maintenance",
|
||||
"informational",
|
||||
"normal",
|
||||
"warning",
|
||||
"critical",
|
||||
"minor",
|
||||
"major"
|
||||
],
|
||||
"nullable": false
|
||||
},
|
||||
"tags": {
|
||||
"description": "Tags",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"source": {
|
||||
"description": "Source",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"idExtra": {
|
||||
"description": "Extra id",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"criticalInstructions": {
|
||||
"description": "Critical instructions",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"warningInstructions": {
|
||||
"description": "Warning instructions",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"unknownInstructions": {
|
||||
"description": "Unknows instructions",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"ownerUser": {
|
||||
"description": "Id user",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"ackUtimestamp": {
|
||||
"description": "Event ack utimestamp",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"readOnly": true,
|
||||
"example": "1704898868",
|
||||
"nullable": true
|
||||
},
|
||||
"customData": {
|
||||
"description": "Custom data",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"data": {
|
||||
"description": "Data",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"moduleStatus": {
|
||||
"description": "Module status",
|
||||
"type": "integer",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
},
|
||||
"eventCustomId": {
|
||||
"description": "Events Custom Id",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"EventFilter": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Event"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"idEvent": {
|
||||
"default": null,
|
||||
"readOnly": false
|
||||
},
|
||||
"freeSearch": {
|
||||
"description": "Find word in name field.",
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Profile": {
|
||||
"properties": {
|
||||
"idProfile": {
|
||||
"description": "Id Incidence Type",
|
||||
"description": "Id Profile",
|
||||
"type": "integer",
|
||||
"readOnly": true,
|
||||
"nullable": false
|
||||
@ -1333,6 +2046,26 @@
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"ResponseEventComment": {
|
||||
"description": "Event comment object",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/EventComment"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ResponseEvent": {
|
||||
"description": "Event object",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ResponseProfile": {
|
||||
"description": "Profile object",
|
||||
"content": {
|
||||
@ -1466,6 +2199,26 @@
|
||||
}
|
||||
},
|
||||
"parameters": {
|
||||
"parameterIdEventComment": {
|
||||
"name": "idComment",
|
||||
"in": "path",
|
||||
"description": "Event comment id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"default": 1
|
||||
}
|
||||
},
|
||||
"parameterIdEvent": {
|
||||
"name": "idEvent",
|
||||
"in": "path",
|
||||
"description": "Event id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"default": 1
|
||||
}
|
||||
},
|
||||
"parameterIdProfile": {
|
||||
"name": "idProfile",
|
||||
"in": "path",
|
||||
@ -1539,6 +2292,46 @@
|
||||
}
|
||||
},
|
||||
"requestBodies": {
|
||||
"requestBodyEventComment": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/EventComment"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"requestBodyEventCommentFilter": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/EventCommentFilter"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"requestBodyEvent": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"requestBodyEventFilter": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/EventFilter"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"requestBodyProfile": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@ -1618,6 +2411,10 @@
|
||||
{
|
||||
"name": "Profiles",
|
||||
"description": "API Endpoints of profiles"
|
||||
},
|
||||
{
|
||||
"name": "Events",
|
||||
"description": "API Endpoints of events"
|
||||
}
|
||||
],
|
||||
"x-tagGroups": [
|
||||
@ -1628,6 +2425,10 @@
|
||||
{
|
||||
"name": "Profiles",
|
||||
"tags": ["Profiles"]
|
||||
},
|
||||
{
|
||||
"name": "Events",
|
||||
"tags": ["Events"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Actions;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\CreateEventCommentService;
|
||||
|
||||
final class CreateEventCommentAction
|
||||
{
|
||||
public function __construct(
|
||||
private CreateEventCommentService $createEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventComment $eventComment): EventComment
|
||||
{
|
||||
return $this->createEventCommentService->__invoke($eventComment);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Actions;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\DeleteEventCommentService;
|
||||
|
||||
final class DeleteEventCommentAction
|
||||
{
|
||||
public function __construct(
|
||||
private DeleteEventCommentService $deleteEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventComment $eventComment): void
|
||||
{
|
||||
$this->deleteEventCommentService->__invoke($eventComment);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Actions;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\GetEventCommentService;
|
||||
|
||||
final class GetEventCommentAction
|
||||
{
|
||||
public function __construct(
|
||||
private GetEventCommentService $getEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(int $idTypeField, int $idComment): EventComment
|
||||
{
|
||||
return $this->getEventCommentService->__invoke($idTypeField, $idComment);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Actions;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentFilter;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\CountEventCommentService;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\ListEventCommentService;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Entities\PaginationData;
|
||||
|
||||
final class ListEventCommentAction
|
||||
{
|
||||
public function __construct(
|
||||
private ListEventCommentService $listEventCommentService,
|
||||
private CountEventCommentService $countEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventCommentFilter $eventCommentFilter): array
|
||||
{
|
||||
return (new PaginationData(
|
||||
$eventCommentFilter->getPage(),
|
||||
$eventCommentFilter->getSizePage(),
|
||||
$this->countEventCommentService->__invoke($eventCommentFilter),
|
||||
$this->listEventCommentService->__invoke($eventCommentFilter)
|
||||
))->toArray();
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Actions;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\UpdateEventCommentService;
|
||||
|
||||
final class UpdateEventCommentAction
|
||||
{
|
||||
public function __construct(
|
||||
private UpdateEventCommentService $updateEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventComment $eventComment, EventComment $oldEventComment): EventComment
|
||||
{
|
||||
return $this->updateEventCommentService->__invoke($eventComment, $oldEventComment);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Controllers;
|
||||
|
||||
use PandoraFMS\Modules\Events\Actions\GetEventAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\CreateEventCommentAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Controllers\Controller;
|
||||
use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class CreateEventCommentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private CreateEventCommentAction $createEventCommentAction,
|
||||
private ValidateAclSystem $acl,
|
||||
private GetEventAction $getEventAction
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
* tags={"Events"},
|
||||
* path="/event/{idEvent}/comment",
|
||||
* summary="Creates a new field into events comments",
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEvent"),
|
||||
* @OA\RequestBody(ref="#/components/requestBodies/requestBodyEventComment"),
|
||||
* @OA\Response(response=200, ref="#/components/responses/ResponseEventComment"),
|
||||
* @OA\Response(response=400, ref="#/components/responses/BadRequest"),
|
||||
* @OA\Response(response=401, ref="#/components/responses/Unauthorized"),
|
||||
* @OA\Response(response=403, ref="#/components/responses/Forbidden"),
|
||||
* @OA\Response(response=404, ref="#/components/responses/NotFound"),
|
||||
* @OA\Response(response=500, ref="#/components/responses/InternalServerError")
|
||||
* )
|
||||
*/
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
$this->acl->validateUserGroups(
|
||||
$event->getIdGroup(),
|
||||
'EW',
|
||||
' tried to write event'
|
||||
);
|
||||
|
||||
// @var EventComment $eventComment.
|
||||
$eventComment = $this->fromRequest($request, EventComment::class);
|
||||
$eventComment->setIdEvent($idEvent);
|
||||
|
||||
$result = $this->createEventCommentAction->__invoke($eventComment);
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Controllers;
|
||||
|
||||
use PandoraFMS\Modules\Events\Actions\GetEventAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\DeleteEventCommentAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\GetEventCommentAction;
|
||||
use PandoraFMS\Modules\Shared\Controllers\Controller;
|
||||
use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class DeleteEventCommentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private DeleteEventCommentAction $deleteEventCommentAction,
|
||||
private ValidateAclSystem $acl,
|
||||
private GetEventAction $getEventAction,
|
||||
private GetEventCommentAction $getEventCommentAction
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Delete(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
* tags={"Events"},
|
||||
* path="/event/{idEvent}/comment/{idComment}",
|
||||
* summary="Delete comment for event type object.",
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEvent"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEventComment"),
|
||||
* @OA\Response(response=200, ref="#/components/responses/successfullyDeleted"),
|
||||
* @OA\Response(response=400, ref="#/components/responses/BadRequest"),
|
||||
* @OA\Response(response=401, ref="#/components/responses/Unauthorized"),
|
||||
* @OA\Response(response=403, ref="#/components/responses/Forbidden"),
|
||||
* @OA\Response(response=404, ref="#/components/responses/NotFound"),
|
||||
* @OA\Response(response=500, ref="#/components/responses/InternalServerError")
|
||||
* )
|
||||
*/
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
$this->acl->validateUserGroups(
|
||||
$event->getIdGroup(),
|
||||
'EM',
|
||||
' tried to manage events'
|
||||
);
|
||||
|
||||
$idEventComment = $this->getParam($request, 'idComment');
|
||||
$eventComment = $this->getEventCommentAction->__invoke($idEvent, $idEventComment);
|
||||
|
||||
$result = $this->deleteEventCommentAction->__invoke($eventComment);
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Controllers;
|
||||
|
||||
use PandoraFMS\Modules\Events\Actions\GetEventAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\GetEventCommentAction;
|
||||
use PandoraFMS\Modules\Shared\Controllers\Controller;
|
||||
use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class GetEventCommentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private GetEventAction $getEventAction,
|
||||
private GetEventCommentAction $getEventCommentAction,
|
||||
private ValidateAclSystem $acl
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
* path="/event/{idEvent}/comment/{idComment}",
|
||||
* tags={"Events"},
|
||||
* summary="show field events comments",
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEvent"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEventComment"),
|
||||
* @OA\Response(response=200, ref="#/components/responses/ResponseEventComment"),
|
||||
* @OA\Response(response=400, ref="#/components/responses/BadRequest"),
|
||||
* @OA\Response(response=401, ref="#/components/responses/Unauthorized"),
|
||||
* @OA\Response(response=403, ref="#/components/responses/Forbidden"),
|
||||
* @OA\Response(response=404, ref="#/components/responses/NotFound"),
|
||||
* @OA\Response(response=500, ref="#/components/responses/InternalServerError")
|
||||
* )
|
||||
*/
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
$this->acl->validateUserGroups(
|
||||
$event->getIdGroup(),
|
||||
'EW',
|
||||
' tried to manage event'
|
||||
);
|
||||
|
||||
$idEventComment = $this->getParam($request, 'idComment');
|
||||
|
||||
$result = $this->getEventCommentAction->__invoke($idEvent, $idEventComment);
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Controllers;
|
||||
|
||||
use PandoraFMS\Modules\Events\Actions\GetEventAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\ListEventCommentAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentFilter;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Controllers\Controller;
|
||||
use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class ListEventCommentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private ListEventCommentAction $listEventCommentAction,
|
||||
private GetEventAction $getEventAction,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
* tags={"Events"},
|
||||
* path="/event/{idEvent}/comment/list",
|
||||
* summary="List comments event",
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEvent"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterPage"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterSizePage"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterSortField"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterSortDirection"),
|
||||
* @OA\RequestBody(ref="#/components/requestBodies/requestBodyEventCommentFilter"),
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="List Comments event object",
|
||||
* content={
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(
|
||||
* @OA\Property(
|
||||
* property="paginationData",
|
||||
* type="object",
|
||||
* ref="#/components/schemas/paginationData",
|
||||
* description="Page object",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="data",
|
||||
* type="array",
|
||||
* @OA\Items(
|
||||
* ref="#/components/schemas/EventComment",
|
||||
* description="Array of fields for comments event object"
|
||||
* )
|
||||
* ),
|
||||
* ),
|
||||
* )
|
||||
* }
|
||||
* ),
|
||||
* @OA\Response(response=400, ref="#/components/responses/BadRequest"),
|
||||
* @OA\Response(response=401, ref="#/components/responses/Unauthorized"),
|
||||
* @OA\Response(response=403, ref="#/components/responses/Forbidden"),
|
||||
* @OA\Response(response=500, ref="#/components/responses/InternalServerError")
|
||||
* )
|
||||
*/
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
$this->acl->validateUserGroups(
|
||||
$event->getIdGroup(),
|
||||
'ER',
|
||||
' tried to manage commments events'
|
||||
);
|
||||
|
||||
// @var EventCommentFilter $eventCommentFilter.
|
||||
$eventCommentFilter = $this->fromRequest($request, EventCommentFilter::class);
|
||||
$eventCommentFilter->getEntityFilter()->setIdEvent($idEvent);
|
||||
|
||||
$result = $this->listEventCommentAction->__invoke($eventCommentFilter);
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Controllers;
|
||||
|
||||
use PandoraFMS\Modules\Events\Actions\GetEventAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\GetEventCommentAction;
|
||||
use PandoraFMS\Modules\Events\Comments\Actions\UpdateEventCommentAction;
|
||||
use PandoraFMS\Modules\Shared\Controllers\Controller;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
/**
|
||||
* @OA\Put(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
* path="/event/{idEvent}/comment/{idComment}",
|
||||
* tags={"Events"},
|
||||
* summary="Updates comment for event type",
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEvent"),
|
||||
* @OA\Parameter(ref="#/components/parameters/parameterIdEventComment"),
|
||||
* @OA\RequestBody(ref="#/components/requestBodies/requestBodyEventComment"),
|
||||
* @OA\Response(response=200, ref="#/components/responses/ResponseEventComment"),
|
||||
* @OA\Response(response=400, ref="#/components/responses/BadRequest"),
|
||||
* @OA\Response(response=401, ref="#/components/responses/Unauthorized"),
|
||||
* @OA\Response(response=403, ref="#/components/responses/Forbidden"),
|
||||
* @OA\Response(response=404, ref="#/components/responses/NotFound"),
|
||||
* @OA\Response(response=500, ref="#/components/responses/InternalServerError")
|
||||
* )
|
||||
*/
|
||||
final class UpdateEventCommentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private UpdateEventCommentAction $updateEventCommentAction,
|
||||
private ValidateAclSystem $acl,
|
||||
private GetEventAction $getEventAction,
|
||||
private GetEventCommentAction $getEventCommentAction
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
$this->acl->validateUserGroups(
|
||||
$event->getIdGroup(),
|
||||
'EW',
|
||||
' tried to manage Comments'
|
||||
);
|
||||
|
||||
$idEventComment = $this->getParam($request, 'idComment');
|
||||
$eventComment = $this->getEventCommentAction->__invoke($idEvent, $idEventComment);
|
||||
|
||||
$oldEventComment = clone $eventComment;
|
||||
|
||||
$params = $this->extractParams($request);
|
||||
$eventComment->fromArray($params);
|
||||
|
||||
$result = $this->updateEventCommentAction->__invoke($eventComment, $oldEventComment);
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
}
|
@ -0,0 +1,215 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Entities;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Entities\Entity;
|
||||
use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="EventComment",
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="idEventComment",
|
||||
* type="integer",
|
||||
* nullable=false,
|
||||
* description="id event comment",
|
||||
* readOnly=true
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="idEvent",
|
||||
* type="integer",
|
||||
* nullable=false,
|
||||
* description="id event comment",
|
||||
* readOnly=true
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="utimestamp",
|
||||
* type="integer",
|
||||
* nullable=true,
|
||||
* default=null,
|
||||
* description="Event comment utimestamp create",
|
||||
* example="1704898868",
|
||||
* readOnly=true
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="comment",
|
||||
* type="string",
|
||||
* nullable=false,
|
||||
* default=null,
|
||||
* description="content of the comment"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="idUser",
|
||||
* type="string",
|
||||
* nullable=false,
|
||||
* default=null,
|
||||
* description="User id create comment",
|
||||
* readOnly=true
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="action",
|
||||
* type="string",
|
||||
* nullable=false,
|
||||
* default=null,
|
||||
* description="content of the action"
|
||||
* )
|
||||
* )
|
||||
*
|
||||
* @OA\Response(
|
||||
* response="ResponseEventComment",
|
||||
* description="Event comment object",
|
||||
* content={
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(
|
||||
* type="object",
|
||||
* ref="#/components/schemas/EventComment",
|
||||
* description="Event comment object"
|
||||
* ),
|
||||
* )
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* @OA\Parameter(
|
||||
* parameter="parameterIdEventComment",
|
||||
* name="idComment",
|
||||
* in="path",
|
||||
* description="Event comment id",
|
||||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* default=1
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @OA\RequestBody(
|
||||
* request="requestBodyEventComment",
|
||||
* required=true,
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/EventComment")
|
||||
* ),
|
||||
* )
|
||||
*/
|
||||
final class EventComment extends Entity
|
||||
{
|
||||
private ?int $idEventComment = null;
|
||||
private ?int $idEvent = null;
|
||||
private ?int $utimestamp = null;
|
||||
private ?string $comment = null;
|
||||
private ?string $idUser = null;
|
||||
private ?string $action = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [
|
||||
'idEventComment' => 1,
|
||||
'idEvent' => 1,
|
||||
'idUser' => 1,
|
||||
'utimestamp' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
'idEventComment' => $this->getIdEventComment(),
|
||||
'idEvent' => $this->getIdEvent(),
|
||||
'utimestamp' => $this->getUtimestamp(),
|
||||
'comment' => $this->getComment(),
|
||||
'idUser' => $this->getIdUser(),
|
||||
'action' => $this->getAction(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
return [
|
||||
'idEventComment' => [
|
||||
Validator::INTEGER,
|
||||
Validator::GREATERTHAN,
|
||||
],
|
||||
'idEvent' => [
|
||||
Validator::INTEGER,
|
||||
Validator::GREATERTHAN,
|
||||
],
|
||||
'utimestamp' => [
|
||||
Validator::INTEGER,
|
||||
Validator::GREATEREQUALTHAN,
|
||||
],
|
||||
'comment' => Validator::STRING,
|
||||
'idUser' => Validator::STRING,
|
||||
'action' => Validator::STRING,
|
||||
];
|
||||
}
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
public function getIdEventComment(): ?int
|
||||
{
|
||||
return $this->idEventComment;
|
||||
}
|
||||
public function setIdEventComment(?int $idEventComment): self
|
||||
{
|
||||
$this->idEventComment = $idEventComment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIdEvent(): ?int
|
||||
{
|
||||
return $this->idEvent;
|
||||
}
|
||||
public function setIdEvent(?int $idEvent): self
|
||||
{
|
||||
$this->idEvent = $idEvent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUtimestamp(): ?int
|
||||
{
|
||||
return $this->utimestamp;
|
||||
}
|
||||
public function setUtimestamp(?int $utimestamp): self
|
||||
{
|
||||
$this->utimestamp = $utimestamp;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getComment(): ?string
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
public function setComment(?string $comment): self
|
||||
{
|
||||
$this->comment = $comment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIdUser(): ?string
|
||||
{
|
||||
return $this->idUser;
|
||||
}
|
||||
public function setIdUser(?string $idUser): self
|
||||
{
|
||||
$this->idUser = $idUser;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAction(): ?string
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
public function setAction(?string $action): self
|
||||
{
|
||||
$this->action = $action;
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Entities;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Builders\Builder;
|
||||
use PandoraFMS\Modules\Shared\Core\DataMapperAbstract;
|
||||
use PandoraFMS\Modules\Shared\Core\MappeableInterface;
|
||||
use PandoraFMS\Modules\Shared\Repositories\Repository;
|
||||
|
||||
final class EventCommentDataMapper extends DataMapperAbstract
|
||||
{
|
||||
public const TABLE_NAME = 'tevent_comment';
|
||||
public const ID_EVENT_COMMENT = 'id';
|
||||
public const ID_EVENT = 'id_event';
|
||||
public const UTIMESTAMP = 'utimestamp';
|
||||
public const COMMENT = 'comment';
|
||||
public const ID_USER = 'id_user';
|
||||
public const ACTION = 'action';
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private Builder $builder,
|
||||
) {
|
||||
parent::__construct(
|
||||
self::TABLE_NAME,
|
||||
self::ID_EVENT_COMMENT,
|
||||
);
|
||||
}
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return EventComment::class;
|
||||
}
|
||||
|
||||
public function fromDatabase(array $data): EventComment
|
||||
{
|
||||
return $this->builder->build(new EventComment(), [
|
||||
'idEventComment' => $data[self::ID_EVENT_COMMENT],
|
||||
'idEvent' => $data[self::ID_EVENT],
|
||||
'utimestamp' => $data[self::UTIMESTAMP],
|
||||
'comment' => $this->repository->safeOutput($data[self::COMMENT]),
|
||||
'idUser' => $this->repository->safeOutput($data[self::ID_USER]),
|
||||
'action' => $this->repository->safeOutput($data[self::ACTION]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function toDatabase(MappeableInterface $data): array
|
||||
{
|
||||
/** @var EventComment $data */
|
||||
return [
|
||||
self::ID_EVENT_COMMENT => $data->getIdEventComment(),
|
||||
self::ID_EVENT => $data->getIdEvent(),
|
||||
self::UTIMESTAMP => $data->getUtimestamp(),
|
||||
self::COMMENT => $this->repository->safeInput($data->getComment()),
|
||||
self::ID_USER => $this->repository->safeInput($data->getIdUser()),
|
||||
self::ACTION => $this->repository->safeInput($data->getAction()),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Entities;
|
||||
|
||||
use PandoraFMS\Modules\Shared\Core\FilterAbstract;
|
||||
use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="EventCommentFilter",
|
||||
* type="object",
|
||||
* allOf={
|
||||
* @OA\Schema(ref="#/components/schemas/EventComment"),
|
||||
* @OA\Schema(
|
||||
* @OA\Property(
|
||||
* property="idEventComment",
|
||||
* default=null,
|
||||
* readOnly=false
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="freeSearch",
|
||||
* type="string",
|
||||
* nullable=true,
|
||||
* default=null,
|
||||
* description="Find word in label fields."
|
||||
* )
|
||||
* )
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* @OA\RequestBody(
|
||||
* request="requestBodyEventCommentFilter",
|
||||
* required=true,
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/EventCommentFilter")
|
||||
* ),
|
||||
* )
|
||||
*/
|
||||
final class EventCommentFilter extends FilterAbstract
|
||||
{
|
||||
private ?string $freeSearch = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setDefaultFieldOrder(EventCommentDataMapper::UTIMESTAMP);
|
||||
$this->setDefaultDirectionOrder($this::DESC);
|
||||
$this->setEntityFilter(new EventComment());
|
||||
}
|
||||
|
||||
public function fieldsTranslate(): array
|
||||
{
|
||||
return [
|
||||
'idEventComment' => EventCommentDataMapper::ID_EVENT_COMMENT,
|
||||
'idEvent' => EventCommentDataMapper::ID_EVENT,
|
||||
'idUser' => EventCommentDataMapper::ID_USER,
|
||||
'utimestamp' => EventCommentDataMapper::UTIMESTAMP,
|
||||
'comment' => EventCommentDataMapper::COMMENT,
|
||||
'action' => EventCommentDataMapper::ACTION,
|
||||
];
|
||||
}
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
'freeSearch' => $this->getFreeSearch(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
$validations = [];
|
||||
if($this->getEntityFilter() !== null) {
|
||||
$validations = $this->getEntityFilter()->getValidations();
|
||||
}
|
||||
$validations['freeSearch'] = Validator::STRING;
|
||||
return $validations;
|
||||
}
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of freeSearch.
|
||||
*
|
||||
* @return ?string
|
||||
*/
|
||||
public function getFreeSearch(): ?string
|
||||
{
|
||||
return $this->freeSearch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of freeSearch.
|
||||
*
|
||||
* @param ?string $freeSearch
|
||||
*
|
||||
*/
|
||||
public function setFreeSearch(?string $freeSearch): self
|
||||
{
|
||||
$this->freeSearch = $freeSearch;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of fieldsFreeSearch.
|
||||
*
|
||||
* @return ?array
|
||||
*/
|
||||
public function getCommentsFreeSearch(): ?array
|
||||
{
|
||||
return [EventCommentDataMapper::COMMENT];
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Repositories;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentDataMapper;
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentFilter;
|
||||
use PandoraFMS\Modules\Shared\Repositories\Repository;
|
||||
|
||||
class EventCommentRepository
|
||||
{
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private EventCommentDataMapper $eventCommentDataMapper
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return EventComments[],
|
||||
*/
|
||||
public function list(EventCommentFilter $eventCommentFilter): array
|
||||
{
|
||||
return $this->repository->__list(
|
||||
$eventCommentFilter,
|
||||
$this->eventCommentDataMapper
|
||||
);
|
||||
}
|
||||
|
||||
public function count(EventCommentFilter $eventCommentFilter): int
|
||||
{
|
||||
return $this->repository->__count(
|
||||
$eventCommentFilter,
|
||||
$this->eventCommentDataMapper
|
||||
);
|
||||
}
|
||||
|
||||
public function getOne(EventCommentFilter $eventCommentFilter): EventComment
|
||||
{
|
||||
return $this->repository->__getOne(
|
||||
$eventCommentFilter,
|
||||
$this->eventCommentDataMapper
|
||||
);
|
||||
}
|
||||
|
||||
public function create(EventComment $eventComment): EventComment
|
||||
{
|
||||
$id = $this->repository->__create($eventComment, $this->eventCommentDataMapper);
|
||||
return $eventComment->setIdEventComment($id);
|
||||
}
|
||||
|
||||
public function update(EventComment $eventComment): EventComment
|
||||
{
|
||||
return $this->repository->__update(
|
||||
$eventComment,
|
||||
$this->eventCommentDataMapper,
|
||||
$eventComment->getIdEventComment()
|
||||
);
|
||||
}
|
||||
|
||||
public function delete(int $id): void
|
||||
{
|
||||
$this->repository->__delete($id, $this->eventCommentDataMapper);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Services;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentFilter;
|
||||
use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
|
||||
final class CountEventCommentService
|
||||
{
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventCommentFilter $eventCommentFilter): int
|
||||
{
|
||||
return $this->eventCommentRepository->count($eventCommentFilter);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Services;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
use PandoraFMS\Modules\Events\Comments\Validations\EventCommentValidation;
|
||||
use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class CreateEventCommentService
|
||||
{
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
private EventCommentValidation $eventCommentValidation,
|
||||
private Audit $audit
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventComment $eventComment): EventComment
|
||||
{
|
||||
$this->eventCommentValidation->__invoke($eventComment);
|
||||
|
||||
$eventComment = $this->eventCommentRepository->create($eventComment);
|
||||
|
||||
//$this->audit->write(
|
||||
// 'Incidence Management',
|
||||
// ' Create Field #'.$eventComment->getIdEventComment().'in a incidence type #'.$eventComment->getIdEvent()
|
||||
//);
|
||||
|
||||
return $eventComment;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Services;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
use PandoraFMS\Modules\Shared\Services\Config;
|
||||
|
||||
final class DeleteEventCommentService
|
||||
{
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private Audit $audit,
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment): void
|
||||
{
|
||||
$idEventComment = $eventComment->getIdEventComment();
|
||||
|
||||
$this->eventCommentRepository->delete($idEventComment);
|
||||
|
||||
// Audit.
|
||||
//$this->audit->write(
|
||||
// 'Incidence Management',
|
||||
// ' Deleted field incidence type #'.$idEventComment
|
||||
//);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Services;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentFilter;
|
||||
use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
|
||||
final class GetEventCommentService
|
||||
{
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(int $idEvent, int $idEventComment): EventComment
|
||||
{
|
||||
$eventCommentFilter = new EventCommentFilter();
|
||||
/** @var EventComment $entityFilter */
|
||||
$entityFilter = $eventCommentFilter->getEntityFilter();
|
||||
$entityFilter->setIdEvent($idEvent);
|
||||
$entityFilter->setIdEventComment($idEventComment);
|
||||
|
||||
return $this->eventCommentRepository->getOne($eventCommentFilter);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Services;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventCommentFilter;
|
||||
use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
|
||||
final class ListEventCommentService
|
||||
{
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventCommentFilter $eventCommentFilter): array
|
||||
{
|
||||
return $this->eventCommentRepository->list($eventCommentFilter);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Services;
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
use PandoraFMS\Modules\Events\Comments\Validations\EventCommentValidation;
|
||||
use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class UpdateEventCommentService
|
||||
{
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
private EventCommentValidation $eventCommentValidation
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventComment $eventComment, EventComment $oldEventComment): EventComment
|
||||
{
|
||||
$this->eventCommentValidation->__invoke($eventComment, $oldEventComment);
|
||||
|
||||
$eventComment = $this->eventCommentRepository->update($eventComment);
|
||||
|
||||
//$this->audit->write(
|
||||
// 'Incidence Management',
|
||||
// ' Update Field #'.$eventComment->getIdEventComment().' in a incidence type #'.$eventComment->getIdEvent()
|
||||
//);
|
||||
|
||||
return $eventComment;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Comments\Validations;
|
||||
|
||||
use PandoraFMS\Core\Config;
|
||||
use PandoraFMS\Modules\Events\Comments\Entities\EventComment;
|
||||
use PandoraFMS\Modules\Events\Comments\Services\GetEventCommentService;
|
||||
use PandoraFMS\Modules\Shared\Exceptions\BadRequestException;
|
||||
use PandoraFMS\Modules\Shared\Services\Timestamp;
|
||||
|
||||
final class EventCommentValidation
|
||||
{
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private Timestamp $timestamp,
|
||||
private GetEventCommentService $getEventCommentService,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(EventComment $eventComment, ?EventComment $oldEventComment = null): void
|
||||
{
|
||||
if (!$eventComment->getComment()) {
|
||||
throw new BadRequestException(__('Comment is missing'));
|
||||
}
|
||||
|
||||
if ($eventComment->getAction() === null) {
|
||||
$eventComment->setAction('Added comment');
|
||||
}
|
||||
|
||||
if ($oldEventComment === null) {
|
||||
$eventComment->setUtimestamp($this->getCurrentUtimestamp());
|
||||
$eventComment->setIdUser($this->config->get('id_user'));
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCurrentUtimestamp(): int
|
||||
{
|
||||
return $this->timestamp->getMysqlSystemUtimestamp();
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ final class CreateEventController extends Controller
|
||||
// @var Event $event.
|
||||
$event = $this->fromRequest($request, Event::class);
|
||||
|
||||
//$this->acl->validate(0, 'UM', ' tried to manage event');
|
||||
$this->acl->validate(0, 'EW', ' tried to write event');
|
||||
|
||||
$result = $this->createEventAction->__invoke($event);
|
||||
|
||||
|
@ -291,7 +291,12 @@ final class Event extends Entity
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return ['idEvent' => 1];
|
||||
return [
|
||||
'idEvent' => 1,
|
||||
'timestamp' => 1,
|
||||
'utimestamp' => 1,
|
||||
'ackUtimestamp' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
@ -333,28 +338,28 @@ final class Event extends Entity
|
||||
],
|
||||
'idAgent' => [
|
||||
EventValidator::INTEGER,
|
||||
EventValidator::GREATERTHAN,
|
||||
EventValidator::GREATEREQUALTHAN,
|
||||
],
|
||||
'idUser' => EventValidator::STRING,
|
||||
'idGroup' => [
|
||||
EventValidator::INTEGER,
|
||||
EventValidator::GREATERTHAN,
|
||||
EventValidator::GREATEREQUALTHAN,
|
||||
],
|
||||
'status' => EventValidator::VALIDSTATUS,
|
||||
'timestamp' => EventValidator::DATETIME,
|
||||
'event' => EventValidator::STRING,
|
||||
'utimestamp' => [
|
||||
EventValidator::INTEGER,
|
||||
EventValidator::GREATERTHAN,
|
||||
EventValidator::GREATEREQUALTHAN,
|
||||
],
|
||||
'eventType' => EventValidator::VALIDTYPE,
|
||||
'idAgentModule' => [
|
||||
EventValidator::INTEGER,
|
||||
EventValidator::GREATERTHAN,
|
||||
EventValidator::GREATEREQUALTHAN,
|
||||
],
|
||||
'idAlertAm' => [
|
||||
EventValidator::INTEGER,
|
||||
EventValidator::GREATERTHAN,
|
||||
EventValidator::GREATEREQUALTHAN,
|
||||
],
|
||||
'criticity' => EventValidator::VALIDSEVERITY,
|
||||
'tags' => EventValidator::STRING,
|
||||
@ -366,7 +371,7 @@ final class Event extends Entity
|
||||
'ownerUser' => EventValidator::STRING,
|
||||
'ackUtimestamp' => [
|
||||
EventValidator::INTEGER,
|
||||
EventValidator::GREATERTHAN,
|
||||
EventValidator::GREATEREQUALTHAN,
|
||||
],
|
||||
'customData' => EventValidator::STRING,
|
||||
'data' => EventValidator::STRING,
|
||||
|
@ -12,7 +12,9 @@ final class CreateEventService
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private EventRepository $eventRepository,
|
||||
private EventValidation $eventValidation
|
||||
private EventValidation $eventValidation,
|
||||
private KeepInProcessStatusExtraIdEventService $keepInProcessStatusExtraIdEventService,
|
||||
private UpdateEventService $updateEventService
|
||||
) {
|
||||
}
|
||||
|
||||
@ -20,6 +22,10 @@ final class CreateEventService
|
||||
{
|
||||
$this->eventValidation->__invoke($event);
|
||||
|
||||
if (empty($event->getIdExtra()) === false) {
|
||||
$event = $this->keepInProcessStatusExtraIdEventService->__invoke($event);
|
||||
}
|
||||
|
||||
$event = $this->eventRepository->create($event);
|
||||
|
||||
$this->audit->write(
|
||||
@ -28,6 +34,11 @@ final class CreateEventService
|
||||
json_encode($event->toArray())
|
||||
);
|
||||
|
||||
if (empty($event->getIdExtra()) === false) {
|
||||
//$this->updateEventService->__invoke();
|
||||
//'UPDATE tevento SET estado = 1, ack_utimestamp = ? WHERE estado IN (0,2) AND id_extra=?'
|
||||
}
|
||||
|
||||
return $event;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Services;
|
||||
|
||||
use PandoraFMS\Core\Config;
|
||||
use PandoraFMS\Modules\Events\Entities\Event;
|
||||
use PandoraFMS\Modules\Events\Entities\EventFilter;
|
||||
use PandoraFMS\Modules\Events\Enums\EventStatusEnum;
|
||||
use PandoraFMS\Modules\Events\Repositories\EventRepository;
|
||||
|
||||
final class KeepInProcessStatusExtraIdEventService
|
||||
{
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private EventRepository $eventRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(Event $event): Event
|
||||
{
|
||||
if((bool) $this->config->get('keep_in_process_status_extra_id') === true) {
|
||||
if($event->getStatus() === EventStatusEnum::NEW) {
|
||||
$eventFilter = new EventFilter();
|
||||
/** @var Event $entityFilter */
|
||||
$entityFilter = $eventFilter->getEntityFilter();
|
||||
$entityFilter->setIdExtra($event->getIdExtra());
|
||||
$entityFilter->setStatus(EventStatusEnum::INPROCESS);
|
||||
$inprocessCount = $this->eventRepository->count($eventFilter);
|
||||
|
||||
if(empty($inprocessCount) === false) {
|
||||
/** @var Event $inprocessLastEvent */
|
||||
$inprocessLastEvent = end($this->eventRepository->list($eventFilter));
|
||||
$event->setAckUtimestamp($inprocessLastEvent->getAckUtimestamp());
|
||||
$event->setEventCustomId($inprocessLastEvent->getEventCustomId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $event;
|
||||
}
|
||||
}
|
@ -2,121 +2,148 @@
|
||||
|
||||
namespace PandoraFMS\Modules\Events\Validations;
|
||||
|
||||
use PandoraFMS\Core\Config;
|
||||
use PandoraFMS\Modules\Events\Entities\Event;
|
||||
use PandoraFMS\Modules\Events\Services\ExistNameEventService;
|
||||
use PandoraFMS\Modules\Events\Enums\EventSeverityEnum;
|
||||
use PandoraFMS\Modules\Events\Enums\EventStatusEnum;
|
||||
use PandoraFMS\Modules\Shared\Exceptions\BadRequestException;
|
||||
use PandoraFMS\Modules\Shared\Services\Timestamp;
|
||||
use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
use PandoraFMS\Modules\Users\Services\GetUserService;
|
||||
|
||||
final class EventValidation
|
||||
{
|
||||
public function __construct(
|
||||
private ExistNameEventService $existNameEventService
|
||||
private ValidateAclSystem $acl,
|
||||
private Config $config,
|
||||
private Timestamp $timestamp,
|
||||
private GetUserService $getUserService
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(Event $event, ?Event $oldEvent = null): void
|
||||
{
|
||||
if (!$event->getName()) {
|
||||
throw new BadRequestException(__('Name is missing'));
|
||||
if (!$event->getEvent()) {
|
||||
throw new BadRequestException(__('Event is missing'));
|
||||
}
|
||||
|
||||
if($oldEvent === null || $oldEvent->getName() !== $event->getName()) {
|
||||
if($this->existNameEventService->__invoke($event->getName()) === true) {
|
||||
throw new BadRequestException(
|
||||
__('Name %s is already exists', $event->getName())
|
||||
);
|
||||
if (!$event->getIdGroup() && $event->getIdGroup() !== 0) {
|
||||
throw new BadRequestException(__('Id group is missing'));
|
||||
}
|
||||
|
||||
if (empty($event->getIdGroup()) === false) {
|
||||
$this->validateGroup($event->getIdGroup());
|
||||
$this->acl->validate($event->getIdGroup(), 'AR', ' tried to read group');
|
||||
}
|
||||
|
||||
if ($event->getIdAgent() === null) {
|
||||
$event->setIdAgent(0);
|
||||
}
|
||||
|
||||
if (empty($event->getIdAgent()) === false) {
|
||||
$this->validateAgent($event->getIdAgent());
|
||||
}
|
||||
|
||||
if ($event->getIdAgentModule() === null) {
|
||||
$event->setIdAgentModule(0);
|
||||
}
|
||||
|
||||
if (empty($event->getIdAgentModule()) === false) {
|
||||
$this->validateAgentModule($event->getIdAgentModule());
|
||||
}
|
||||
|
||||
if ($event->getIdUser() === null) {
|
||||
$event->setIdUser($this->config->get('id_user'));
|
||||
}
|
||||
|
||||
if (empty($event->getIdUser()) === false) {
|
||||
$this->validateUser($event->getIdUser());
|
||||
}
|
||||
|
||||
if ($event->getStatus() === null) {
|
||||
$event->setStatus(EventStatusEnum::NEW);
|
||||
}
|
||||
|
||||
if ($oldEvent === null) {
|
||||
$event->setTimestamp($this->getCurrentTimestamp());
|
||||
$event->setUtimestamp($this->getCurrentUtimestamp());
|
||||
}
|
||||
|
||||
if ($event->getIdAlertAm() === null) {
|
||||
$event->setIdAlertAm(0);
|
||||
}
|
||||
|
||||
if ($event->getCriticity() === null) {
|
||||
$event->setCriticity(EventSeverityEnum::MAINTENANCE);
|
||||
}
|
||||
|
||||
if ($event->getOwnerUser() === null) {
|
||||
$event->setOwnerUser('');
|
||||
}
|
||||
|
||||
if ($event->getAckUtimestamp() === null) {
|
||||
$event->setAckUtimestamp(0);
|
||||
if ($event->getStatus() === EventStatusEnum::VALIDATED
|
||||
|| $event->getStatus() === EventStatusEnum::INPROCESS
|
||||
) {
|
||||
$event->setAckUtimestamp($this->getCurrentUtimestamp());
|
||||
}
|
||||
}
|
||||
|
||||
if($event->getIsAgentView() === null) {
|
||||
$event->setIsAgentView(false);
|
||||
// TODO: readonly ??.
|
||||
if ($event->getModuleStatus() === null) {
|
||||
$event->setModuleStatus(0);
|
||||
}
|
||||
|
||||
if($event->getIsAgentEdit() === null) {
|
||||
$event->setIsAgentEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsAlertEdit() === null) {
|
||||
$event->setIsAlertEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsUserManagement() === null) {
|
||||
$event->setIsUserManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsDbManagement() === null) {
|
||||
$event->setIsDbManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsAlertManagement() === null) {
|
||||
$event->setIsAlertManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsPandoraManagement() === null) {
|
||||
$event->setIsPandoraManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsReportView() === null) {
|
||||
$event->setIsReportView(false);
|
||||
}
|
||||
|
||||
if($event->getIsReportEdit() === null) {
|
||||
$event->setIsReportEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsReportManagement() === null) {
|
||||
$event->setIsReportManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsEventView() === null) {
|
||||
$event->setIsEventView(false);
|
||||
}
|
||||
|
||||
if($event->getIsEventEdit() === null) {
|
||||
$event->setIsEventEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsEventManagement() === null) {
|
||||
$event->setIsEventManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsAgentDisable() === null) {
|
||||
$event->setIsAgentDisable(false);
|
||||
}
|
||||
|
||||
if($event->getIsMapView() === null) {
|
||||
$event->setIsMapView(false);
|
||||
}
|
||||
|
||||
if($event->getIsMapEdit() === null) {
|
||||
$event->setIsMapEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsMapManagement() === null) {
|
||||
$event->setIsMapManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsVconsoleView() === null) {
|
||||
$event->setIsVconsoleView(false);
|
||||
}
|
||||
|
||||
if($event->getIsVconsoleEdit() === null) {
|
||||
$event->setIsVconsoleEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsVconsoleManagement() === null) {
|
||||
$event->setIsVconsoleManagement(false);
|
||||
}
|
||||
|
||||
if($event->getIsNetworkConfigView() === null) {
|
||||
$event->setIsNetworkConfigView(false);
|
||||
}
|
||||
|
||||
if($event->getIsNetworkConfigEdit() === null) {
|
||||
$event->setIsNetworkConfigEdit(false);
|
||||
}
|
||||
|
||||
if($event->getIsNetworkConfigManagement() === null) {
|
||||
$event->setIsNetworkConfigManagement(false);
|
||||
if ($event->getSource() === null) {
|
||||
$event->setSource(\get_product_name());
|
||||
}
|
||||
}
|
||||
|
||||
private function validateUser(string $idUser): void
|
||||
{
|
||||
$this->getUserService->__invoke($idUser);
|
||||
}
|
||||
|
||||
protected function validateGroup(int $idGroup): void
|
||||
{
|
||||
// TODO: create new service for this.
|
||||
if (! (bool) \groups_get_users($idGroup)) {
|
||||
throw new BadRequestException(__('Invalid id group'));
|
||||
}
|
||||
}
|
||||
|
||||
protected function validateAgent(int $idAgent): void
|
||||
{
|
||||
$filter = ['id_agente' => $idAgent];
|
||||
if(\is_metaconsole() === true) {
|
||||
$agent = \agents_get_meta_agents($filter);
|
||||
} else {
|
||||
$agent = \agents_get_agents($filter);
|
||||
}
|
||||
|
||||
if (! (bool) $agent) {
|
||||
throw new BadRequestException(__('Invalid id agent'));
|
||||
}
|
||||
}
|
||||
|
||||
protected function validateAgentModule(int $idAgentModule): void
|
||||
{
|
||||
// TODO: create new service for this.
|
||||
}
|
||||
|
||||
protected function validateAlert(int $idAlert): void
|
||||
{
|
||||
// TODO: create new service for this.
|
||||
}
|
||||
|
||||
protected function getCurrentTimestamp(): string
|
||||
{
|
||||
return $this->timestamp->getMysqlCurrentTimestamp(0);
|
||||
}
|
||||
|
||||
protected function getCurrentUtimestamp(): int
|
||||
{
|
||||
return $this->timestamp->getMysqlSystemUtimestamp();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
use PandoraFMS\Modules\Events\Comments\Controllers\CreateEventCommentController;
|
||||
use PandoraFMS\Modules\Events\Comments\Controllers\DeleteEventCommentController;
|
||||
use PandoraFMS\Modules\Events\Comments\Controllers\GetEventCommentController;
|
||||
use PandoraFMS\Modules\Events\Comments\Controllers\ListEventCommentController;
|
||||
use PandoraFMS\Modules\Events\Comments\Controllers\UpdateEventCommentController;
|
||||
use PandoraFMS\Modules\Events\Controllers\CreateEventController;
|
||||
use PandoraFMS\Modules\Events\Controllers\DeleteEventController;
|
||||
use PandoraFMS\Modules\Events\Controllers\GetEventController;
|
||||
@ -13,4 +18,9 @@ return function (App $app) {
|
||||
$app->post('/event', CreateEventController::class);
|
||||
$app->put('/event/{idEvent}', UpdateEventController::class);
|
||||
$app->delete('/event/{idEvent}', DeleteEventController::class);
|
||||
$app->map(['GET', 'POST'], '/event/{idEvent}/comment/list', ListEventCommentController::class);
|
||||
$app->get('/event/{idEvent}/comment/{idComment}', GetEventCommentController::class);
|
||||
$app->post('/event/{idEvent}/comment', CreateEventCommentController::class);
|
||||
$app->put('/event/{idEvent}/comment/{idComment}', UpdateEventCommentController::class);
|
||||
$app->delete('/event/{idEvent}/comment/{idComment}', DeleteEventCommentController::class);
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ class Builder
|
||||
{
|
||||
foreach ($data as $field => $value) {
|
||||
if (method_exists($entity, 'set'.ucfirst($field)) === false) {
|
||||
throw new BadRequestException(__('Not exists method set%s', ucfirst($field)));
|
||||
throw new BadRequestException(__('Not exists method set %s', ucfirst($field)));
|
||||
}
|
||||
|
||||
$entity->{'set'.ucfirst($field)}($value);
|
||||
|
@ -7,12 +7,12 @@ use OpenApi\Annotations as OA;
|
||||
/**
|
||||
* @OA\Info(
|
||||
* title="Nueva API de Pandora FMS",
|
||||
* description="Nueva Api de pandora FMS",
|
||||
* description="Lorem ipsum dolor sit amet consectetur, adipisicing elit. Libero, quibusdam esse commodi rem nisi cumque quos ut, exercitationem recusandae ipsam fuga qui veritatis non temporibus perferendis earum amet cupiditate eum nam corrupti! Dicta tempora, debitis molestiae corrupti sequi asperiores libero perferendis ut aperiam laboriosam repudiandae neque, rem quidem consectetur. Magnam illum perferendis aspernatur quibusdam esse? Libero eius veritatis quae perspiciatis. Sit recusandae aspernatur possimus autem! Corporis ipsa voluptatem placeat quasi praesentium esse doloremque magni, error, cumque vel, consequatur quam saepe iusto accusantium tempore ab dignissimos alias sint officia fuga voluptas. Vel repudiandae dicta ipsum repellat reprehenderit. Molestiae, ullam dolorum voluptatem necessitatibus itaque officiis ducimus consectetur aut facilis atque aliquid reiciendis voluptas sit incidunt, repellendus soluta quod obcaecati unde quas. Error officiis cumque vero minima amet modi enim, placeat consectetur cupiditate, fugiat odit sunt a earum natus dicta, labore id dolor! Quis laboriosam a quasi fuga! Ullam consectetur, voluptates repellat eveniet delectus officia nostrum amet obcaecati adipisci natus voluptas explicabo dolores similique doloribus. Rerum voluptatibus aperiam quidem necessitatibus, sint dignissimos natus delectus dolorem dicta sunt eum doloribus eligendi similique a at in repellat fuga voluptatem atque consectetur, ratione sit! Magni tenetur quos laborum, excepturi eveniet laboriosam optio aperiam eaque sit iusto.",
|
||||
* termsOfService="https://example.com/terms/",
|
||||
* @OA\Contact(
|
||||
* name="Nombre del contacto",
|
||||
* url="https://www.example.com/support",
|
||||
* email="contacto@example.com"
|
||||
* name="Pandorafms",
|
||||
* url="https://pandorafms.com/",
|
||||
* email="info@pandorafms.com"
|
||||
* ),
|
||||
* @OA\License(
|
||||
* name="Apache 2.0",
|
||||
@ -21,7 +21,8 @@ use OpenApi\Annotations as OA;
|
||||
* version="0.0.1"
|
||||
* ),
|
||||
* @OA\Schemes(
|
||||
* format="http"
|
||||
* format="http",
|
||||
* format="https"
|
||||
* ),
|
||||
* @OA\SecurityScheme(
|
||||
* securityScheme="bearerAuth",
|
||||
@ -43,6 +44,10 @@ use OpenApi\Annotations as OA;
|
||||
* name="Profiles",
|
||||
* description="API Endpoints of profiles"
|
||||
* ),
|
||||
* @OA\Tag(
|
||||
* name="Events",
|
||||
* description="API Endpoints of events"
|
||||
* ),
|
||||
* @OA\OpenApi(
|
||||
* x={
|
||||
* "tagGroups"= {
|
||||
@ -54,6 +59,10 @@ use OpenApi\Annotations as OA;
|
||||
* "name"="Profiles",
|
||||
* "tags"={"Profiles"}
|
||||
* },
|
||||
* {
|
||||
* "name"="Events",
|
||||
* "tags"={"Events"}
|
||||
* },
|
||||
* }
|
||||
* }
|
||||
* ),
|
||||
|
@ -48,7 +48,7 @@ class ValidateAclSystem
|
||||
): void {
|
||||
$idUser ??= $this->config->get('id_user');
|
||||
|
||||
$userGroups = \users_get_groups($idUser, $permissions, false, false);
|
||||
$userGroups = \users_get_groups($idUser, $permissions, true, false);
|
||||
|
||||
$exist = true;
|
||||
if (is_array($idGroup) === true) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user