diff --git a/composer.lock b/composer.lock index d1dcfc64..fd964c63 100644 --- a/composer.lock +++ b/composer.lock @@ -143,16 +143,16 @@ }, { "name": "phpoffice/math", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/Math.git", - "reference": "f0f8cad98624459c540cdd61d2a174d834471773" + "reference": "fc2eb6d1a61b058d5dac77197059db30ee3c8329" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/Math/zipball/f0f8cad98624459c540cdd61d2a174d834471773", - "reference": "f0f8cad98624459c540cdd61d2a174d834471773", + "url": "https://api.github.com/repos/PHPOffice/Math/zipball/fc2eb6d1a61b058d5dac77197059db30ee3c8329", + "reference": "fc2eb6d1a61b058d5dac77197059db30ee3c8329", "shasum": "" }, "require": { @@ -167,8 +167,7 @@ "type": "library", "autoload": { "psr-4": { - "PhpOffice\\Math\\": "src/Math/", - "Tests\\PhpOffice\\Math\\": "tests/Math/" + "PhpOffice\\Math\\": "src/Math/" } }, "notification-url": "https://packagist.org/downloads/", @@ -190,22 +189,22 @@ ], "support": { "issues": "https://github.com/PHPOffice/Math/issues", - "source": "https://github.com/PHPOffice/Math/tree/0.1.0" + "source": "https://github.com/PHPOffice/Math/tree/0.2.0" }, - "time": "2023-09-25T12:08:20+00:00" + "time": "2024-08-12T07:30:45+00:00" }, { "name": "phpoffice/phpword", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PHPWord.git", - "reference": "e76b701ef538cb749641514fcbc31a68078550fa" + "reference": "8392134ce4b5dba65130ba956231a1602b848b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/e76b701ef538cb749641514fcbc31a68078550fa", - "reference": "e76b701ef538cb749641514fcbc31a68078550fa", + "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/8392134ce4b5dba65130ba956231a1602b848b7f", + "reference": "8392134ce4b5dba65130ba956231a1602b848b7f", "shasum": "" }, "require": { @@ -213,7 +212,7 @@ "ext-json": "*", "ext-xml": "*", "php": "^7.1|^8.0", - "phpoffice/math": "^0.1" + "phpoffice/math": "^0.2" }, "require-dev": { "dompdf/dompdf": "^2.0", @@ -299,24 +298,24 @@ ], "support": { "issues": "https://github.com/PHPOffice/PHPWord/issues", - "source": "https://github.com/PHPOffice/PHPWord/tree/1.2.0" + "source": "https://github.com/PHPOffice/PHPWord/tree/1.3.0" }, - "time": "2023-11-30T11:22:23+00:00" + "time": "2024-08-30T18:03:42+00:00" } ], "packages-dev": [ { "name": "adhocore/cli", - "version": "v1.7.1", + "version": "v1.9.3", "source": { "type": "git", "url": "https://github.com/adhocore/php-cli.git", - "reference": "3fde60a838912e71c82ed0f48048685dc32dbc77" + "reference": "86be16e3c3b42d76fcdb32529bcded0fedb925d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/adhocore/php-cli/zipball/3fde60a838912e71c82ed0f48048685dc32dbc77", - "reference": "3fde60a838912e71c82ed0f48048685dc32dbc77", + "url": "https://api.github.com/repos/adhocore/php-cli/zipball/86be16e3c3b42d76fcdb32529bcded0fedb925d3", + "reference": "86be16e3c3b42d76fcdb32529bcded0fedb925d3", "shasum": "" }, "require": { @@ -327,6 +326,9 @@ }, "type": "library", "autoload": { + "files": [ + "src/functions.php" + ], "psr-4": { "Ahc\\Cli\\": "src/" } @@ -361,7 +363,7 @@ ], "support": { "issues": "https://github.com/adhocore/php-cli/issues", - "source": "https://github.com/adhocore/php-cli/tree/v1.7.1" + "source": "https://github.com/adhocore/php-cli/tree/v1.9.3" }, "funding": [ { @@ -373,7 +375,7 @@ "type": "github" } ], - "time": "2024-03-28T08:30:12+00:00" + "time": "2024-12-04T03:40:29+00:00" }, { "name": "doctrine/instantiator", @@ -445,18 +447,64 @@ ], "time": "2022-12-30T00:23:10+00:00" }, + { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.22.0", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.61.1", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.5.29" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + }, + "time": "2024-08-16T20:44:35+00:00" + }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -495,7 +543,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -503,23 +551,24 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nextcloud/coding-standard", - "version": "v1.2.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e" + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", - "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", "shasum": "" }, "require": { + "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", "php": "^7.3|^8.0", "php-cs-fixer/shim": "^3.17" }, @@ -542,9 +591,9 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" }, - "time": "2024-02-01T14:54:37+00:00" + "time": "2024-10-14T16:49:05+00:00" }, { "name": "nextcloud/ocp", @@ -552,20 +601,20 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "b0127d6fd2932bf1fdffe334ae59fdd6c8272029" + "reference": "e14d7d0897b96b3c32aff426721e8e198c884730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/b0127d6fd2932bf1fdffe334ae59fdd6c8272029", - "reference": "b0127d6fd2932bf1fdffe334ae59fdd6c8272029", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/e14d7d0897b96b3c32aff426721e8e198c884730", + "reference": "e14d7d0897b96b3c32aff426721e8e198c884730", "shasum": "" }, "require": { - "php": "~8.0 || ~8.1 || ~8.2 || ~8.3", + "php": "~8.1 || ~8.2 || ~8.3", "psr/clock": "^1.0", "psr/container": "^2.0.2", "psr/event-dispatcher": "^1.0", - "psr/log": "^1.1.4" + "psr/log": "^3.0.2" }, "default-branch": true, "type": "library", @@ -582,27 +631,31 @@ { "name": "Christoph Wurst", "email": "christoph@winzerhof-wurst.at" + }, + { + "name": "Joas Schilling", + "email": "coding@schilljs.com" } ], - "description": "Composer package containing Nextcloud's public API (classes, interfaces)", + "description": "Composer package containing Nextcloud's public OCP API and the unstable NCU API", "support": { "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2024-08-14T08:51:54+00:00" + "time": "2024-12-19T00:46:23+00:00" }, { "name": "nextcloud/openapi-extractor", - "version": "v1.0.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nextcloud-releases/openapi-extractor.git", - "reference": "88e347097db28b6e3f8f3c221502b80a4f455b1f" + "reference": "c0761cb7a3a0cd29c85ede9f27883d7f9f477bd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-releases/openapi-extractor/zipball/88e347097db28b6e3f8f3c221502b80a4f455b1f", - "reference": "88e347097db28b6e3f8f3c221502b80a4f455b1f", + "url": "https://api.github.com/repos/nextcloud-releases/openapi-extractor/zipball/c0761cb7a3a0cd29c85ede9f27883d7f9f477bd0", + "reference": "c0761cb7a3a0cd29c85ede9f27883d7f9f477bd0", "shasum": "" }, "require": { @@ -614,11 +667,12 @@ }, "require-dev": { "nextcloud/coding-standard": "^1.2", - "nextcloud/ocp": "dev-master" + "nextcloud/ocp": "dev-master", + "rector/rector": "^2.0" }, "bin": [ - "generate-spec", - "merge-specs" + "bin/generate-spec", + "bin/merge-specs" ], "type": "library", "autoload": { @@ -633,22 +687,22 @@ "description": "A tool for extracting OpenAPI specifications from Nextcloud source code", "support": { "issues": "https://github.com/nextcloud-releases/openapi-extractor/issues", - "source": "https://github.com/nextcloud-releases/openapi-extractor/tree/v1.0.0" + "source": "https://github.com/nextcloud-releases/openapi-extractor/tree/v1.3.0" }, - "time": "2024-08-20T16:46:27+00:00" + "time": "2024-12-17T16:34:26+00:00" }, { "name": "nikic/php-parser", - "version": "v5.1.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { @@ -691,9 +745,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, - "time": "2024-07-01T20:03:41+00:00" + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phar-io/manifest", @@ -815,16 +869,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.62.0", + "version": "v3.65.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae" + "reference": "4983ec79b9dee926695ac324ea6e8d291935525d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/7a91d5ce45c486f5b445d95901228507a02f60ae", - "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/4983ec79b9dee926695ac324ea6e8d291935525d", + "reference": "4983ec79b9dee926695ac324ea6e8d291935525d", "shasum": "" }, "require": { @@ -861,22 +915,22 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.62.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.65.0" }, - "time": "2024-08-07T17:03:46+00:00" + "time": "2024-11-25T00:39:41+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.29.1", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -908,41 +962,41 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-05-31T08:52:43+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -951,7 +1005,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -980,7 +1034,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -988,7 +1042,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1233,16 +1287,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.20", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "49d7820565836236411f5dc002d16dd689cde42f" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", - "reference": "49d7820565836236411f5dc002d16dd689cde42f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -1253,11 +1307,11 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-code-coverage": "^9.2.32", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.4", @@ -1316,7 +1370,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -1332,20 +1386,20 @@ "type": "tidelift" } ], - "time": "2024-07-10T11:45:39+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "psalm/phar", - "version": "5.25.0", + "version": "5.26.1", "source": { "type": "git", "url": "https://github.com/psalm/phar.git", - "reference": "d42708449bd2d99ec6509924332fd94263974b20" + "reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/phar/zipball/d42708449bd2d99ec6509924332fd94263974b20", - "reference": "d42708449bd2d99ec6509924332fd94263974b20", + "url": "https://api.github.com/repos/psalm/phar/zipball/8a38e7ad04499a0ccd2c506fd1da6fc01fff4547", + "reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547", "shasum": "" }, "require": { @@ -1365,9 +1419,9 @@ "description": "Composer-based Psalm Phar", "support": { "issues": "https://github.com/psalm/phar/issues", - "source": "https://github.com/psalm/phar/tree/5.25.0" + "source": "https://github.com/psalm/phar/tree/5.26.1" }, - "time": "2024-06-19T20:02:02+00:00" + "time": "2024-09-09T16:22:43+00:00" }, { "name": "psr/clock", @@ -1522,30 +1576,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1566,9 +1620,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "sebastian/cli-parser", diff --git a/lib/Controller/AssistantApiController.php b/lib/Controller/AssistantApiController.php index b867bf92..cf122738 100644 --- a/lib/Controller/AssistantApiController.php +++ b/lib/Controller/AssistantApiController.php @@ -76,7 +76,7 @@ public function notifyWhenReady(int $ocpTaskId): DataResponse { * * Get all available task types that the assistant can handle. * - * @return DataResponse}, array{}> + * @return DataResponse}, array{}> * * 200: Available task types returned */ @@ -94,7 +94,7 @@ public function getAvailableTaskTypes(): DataResponse { * Get a list of assistant tasks for the current user. * * @param string|null $taskTypeId Task type id. If null, tasks of all task types will be retrieved - * @return DataResponse}, array{}>|DataResponse + * @return DataResponse}, array{}>|DataResponse * * 200: User tasks returned * 404: No tasks found @@ -139,7 +139,7 @@ public function parseTextFromFile(?string $filePath = null, ?int $fileId = null) try { $text = $this->assistantService->parseTextFromFile($this->userId, $filePath, $fileId); - } catch (\Exception | \Throwable $e) { + } catch (\Exception|\Throwable $e) { return new DataResponse($e->getMessage(), Http::STATUS_BAD_REQUEST); } return new DataResponse([ @@ -280,7 +280,7 @@ public function getOutputFilePreview(int $ocpTaskId, int $fileId): RedirectRespo } elseif ($preview['type'] === 'icon') { return new RedirectResponse($preview['icon']); } - } catch (Exception | Throwable $e) { + } catch (Exception|Throwable $e) { $this->logger->error('getImage error', ['exception' => $e]); return new DataResponse('', Http::STATUS_NOT_FOUND); } diff --git a/lib/Controller/AssistantController.php b/lib/Controller/AssistantController.php index abc69240..17fee784 100644 --- a/lib/Controller/AssistantController.php +++ b/lib/Controller/AssistantController.php @@ -44,7 +44,7 @@ public function getAssistantTaskResultPage(int $taskId): TemplateResponse { $this->initialStateService->provideInitialState('task', $task->jsonSerialize()); return new TemplateResponse(Application::APP_ID, 'assistantPage'); } - } catch (Exception | \Throwable $e) { + } catch (Exception|\Throwable $e) { } } return new TemplateResponse('', '403', [], TemplateResponse::RENDER_AS_ERROR, Http::STATUS_FORBIDDEN); diff --git a/lib/Controller/ChattyLLMController.php b/lib/Controller/ChattyLLMController.php index bb976737..cfa7df0e 100644 --- a/lib/Controller/ChattyLLMController.php +++ b/lib/Controller/ChattyLLMController.php @@ -26,7 +26,6 @@ use OCP\TaskProcessing\Exception\ValidationException; use OCP\TaskProcessing\IManager as ITaskProcessingManager; use OCP\TaskProcessing\Task; -use OCP\TaskProcessing\TaskTypes\TextToText; use OCP\TaskProcessing\TaskTypes\TextToTextChat; use Psr\Log\LoggerInterface; @@ -90,7 +89,7 @@ public function newSession(int $timestamp, ?string $title = null): JSONResponse return new JSONResponse([ 'session' => $session, ]); - } catch (\OCP\DB\Exception | \RuntimeException $e) { + } catch (\OCP\DB\Exception|\RuntimeException $e) { $this->logger->warning('Failed to create a chat session', ['exception' => $e]); return new JSONResponse(['error' => $this->l10n->t('Failed to create a chat session')], Http::STATUS_INTERNAL_SERVER_ERROR); } @@ -112,7 +111,7 @@ public function updateSessionTitle(int $sessionId, string $title): JSONResponse try { $this->sessionMapper->updateSessionTitle($this->userId, $sessionId, $title); return new JSONResponse(); - } catch (\OCP\DB\Exception | \RuntimeException $e) { + } catch (\OCP\DB\Exception|\RuntimeException $e) { $this->logger->warning('Failed to update the chat session', ['exception' => $e]); return new JSONResponse(['error' => $this->l10n->t('Failed to update the chat session')], Http::STATUS_INTERNAL_SERVER_ERROR); } @@ -134,7 +133,7 @@ public function deleteSession(int $sessionId): JSONResponse { $this->sessionMapper->deleteSession($this->userId, $sessionId); $this->messageMapper->deleteMessagesBySession($sessionId); return new JSONResponse(); - } catch (\OCP\DB\Exception | \RuntimeException $e) { + } catch (\OCP\DB\Exception|\RuntimeException $e) { $this->logger->warning('Failed to delete the chat session', ['exception' => $e]); return new JSONResponse(['error' => $this->l10n->t('Failed to delete the chat session')], Http::STATUS_INTERNAL_SERVER_ERROR); } @@ -266,7 +265,7 @@ public function deleteMessage(int $messageId, int $sessionId): JSONResponse { $this->messageMapper->deleteMessageById($messageId); return new JSONResponse(); - } catch (\OCP\DB\Exception | \RuntimeException $e) { + } catch (\OCP\DB\Exception|\RuntimeException $e) { $this->logger->warning('Failed to delete a chat message', ['exception' => $e]); return new JSONResponse(['error' => $this->l10n->t('Failed to delete a chat message')], Http::STATUS_INTERNAL_SERVER_ERROR); } @@ -642,7 +641,7 @@ private function checkIfSessionIsThinking(string $customId): void { * @throws ValidationException */ private function scheduleLLMChatTask( - string $newPrompt, string $systemPrompt, array $history, int $sessionId, bool $isMessage = true + string $newPrompt, string $systemPrompt, array $history, int $sessionId, bool $isMessage = true, ): ?int { $customId = ($isMessage ? 'chatty-llm:' diff --git a/lib/Controller/ConfigController.php b/lib/Controller/ConfigController.php index 69b8f175..f37ec830 100644 --- a/lib/Controller/ConfigController.php +++ b/lib/Controller/ConfigController.php @@ -21,7 +21,7 @@ public function __construct( IRequest $request, private IConfig $config, private IAppConfig $appConfig, - private ?string $userId + private ?string $userId, ) { parent::__construct($appName, $request); } diff --git a/lib/Controller/PreviewController.php b/lib/Controller/PreviewController.php index 06ec41cc..3ff4d75b 100644 --- a/lib/Controller/PreviewController.php +++ b/lib/Controller/PreviewController.php @@ -1,4 +1,5 @@ logger->error('getImage error', ['exception' => $e]); return new DataResponse('', Http::STATUS_NOT_FOUND); } diff --git a/lib/Db/TaskNotification.php b/lib/Db/TaskNotification.php index d076a47f..e2ff0577 100644 --- a/lib/Db/TaskNotification.php +++ b/lib/Db/TaskNotification.php @@ -7,6 +7,7 @@ namespace OCA\Assistant\Db; use OCP\AppFramework\Db\Entity; +use OCP\DB\Types; /** * @method \int getOcpTaskId() @@ -22,8 +23,8 @@ class TaskNotification extends Entity implements \JsonSerializable { public function __construct() { - $this->addType('ocp_task_id', 'int'); - $this->addType('timestamp', 'int'); + $this->addType('ocp_task_id', Types::INTEGER); + $this->addType('timestamp', Types::INTEGER); } #[\ReturnTypeWillChange] diff --git a/lib/Event/BeforeAssistantNotificationEvent.php b/lib/Event/BeforeAssistantNotificationEvent.php index f21cd0bd..ca4c4988 100644 --- a/lib/Event/BeforeAssistantNotificationEvent.php +++ b/lib/Event/BeforeAssistantNotificationEvent.php @@ -59,7 +59,7 @@ public function getNotificationTarget(): ?string { /** * @param string|null $notificationTarget URL that will be used as target for the notification and its main action, - * null means the assistant will take care of rendering the result (in a modal or by setting a dedicated NC page showing the result) + * null means the assistant will take care of rendering the result (in a modal or by setting a dedicated NC page showing the result) * @return void */ public function setNotificationTarget(?string $notificationTarget): void { @@ -75,7 +75,7 @@ public function getNotificationActionLabel(): ?string { /** * @param string|null $notificationActionLabel Label of the main notification action - * null will not change the default action label + * null will not change the default action label * @return void */ public function setNotificationActionLabel(?string $notificationActionLabel): void { diff --git a/lib/Listener/SpeechToText/SpeechToTextReferenceListener.php b/lib/Listener/SpeechToText/SpeechToTextReferenceListener.php index aed2c6a1..0121ff60 100644 --- a/lib/Listener/SpeechToText/SpeechToTextReferenceListener.php +++ b/lib/Listener/SpeechToText/SpeechToTextReferenceListener.php @@ -1,4 +1,5 @@ * diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 077ac096..c7b4a5d4 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -98,7 +98,7 @@ public function prepare(INotification $notification, string $languageCode): INot $taskType = $availableTaskTypes[$params['taskTypeId']]; $taskTypeName = $taskType['name']; } - } catch (\Exception | \Throwable $e) { + } catch (\Exception|\Throwable $e) { $this->logger->debug('Impossible to get task type ' . $params['taskTypeId'], ['exception' => $e]); } diff --git a/lib/Reference/FreePromptReferenceProvider.php b/lib/Reference/FreePromptReferenceProvider.php index da986089..d64fc64e 100644 --- a/lib/Reference/FreePromptReferenceProvider.php +++ b/lib/Reference/FreePromptReferenceProvider.php @@ -17,7 +17,7 @@ public function __construct( private IL10N $l10n, private IURLGenerator $urlGenerator, private IReferenceManager $referenceManager, - private ?string $userId + private ?string $userId, ) { } diff --git a/lib/Reference/SpeechToTextReferenceProvider.php b/lib/Reference/SpeechToTextReferenceProvider.php index 869920c6..126798a8 100644 --- a/lib/Reference/SpeechToTextReferenceProvider.php +++ b/lib/Reference/SpeechToTextReferenceProvider.php @@ -1,4 +1,5 @@ * @@ -35,7 +36,7 @@ public function __construct( private IL10N $l10n, private IURLGenerator $urlGenerator, private IReferenceManager $referenceManager, - private ?string $userId + private ?string $userId, ) { } diff --git a/lib/Reference/Text2ImageReferenceProvider.php b/lib/Reference/Text2ImageReferenceProvider.php index fad9cdab..eb0a5938 100644 --- a/lib/Reference/Text2ImageReferenceProvider.php +++ b/lib/Reference/Text2ImageReferenceProvider.php @@ -18,7 +18,7 @@ public function __construct( private IL10N $l10n, private IURLGenerator $urlGenerator, private IReferenceManager $referenceManager, - private ?string $userId + private ?string $userId, ) { } diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 221c656a..6a3ed77c 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -52,14 +52,17 @@ * appId: string, * completionExpectedAt: integer|null, * customId: string|null, - * id: int|null, - * input: array, + * id: int, + * input: array|numeric|string>, * lastUpdated: integer, - * output: array, + * output: array|numeric|string>|null, * progress: float|null, * status: string, * type: string, * userId: string|null, + * endedAt: int|null, + * scheduledAt: int|null, + * startedAt: int|null, * } */ class ResponseDefinitions { diff --git a/lib/Service/AssistantService.php b/lib/Service/AssistantService.php index 8fce3ad6..7ec1fe03 100644 --- a/lib/Service/AssistantService.php +++ b/lib/Service/AssistantService.php @@ -557,7 +557,7 @@ public function parseTextFromFile(string $userId, ?string $filePath = null, ?int try { $userFolder = $this->rootFolder->getUserFolder($userId); - } catch (\OC\User\NoUserException | NotPermittedException $e) { + } catch (\OC\User\NoUserException|NotPermittedException $e) { throw new \Exception('Could not access user storage.'); } @@ -577,7 +577,7 @@ public function parseTextFromFile(string $userId, ?string $filePath = null, ?int } else { throw new \Exception('Provided path does not point to a file.'); } - } catch (LockedException | GenericFileException | NotPermittedException $e) { + } catch (LockedException|GenericFileException|NotPermittedException $e) { throw new \Exception('File could not be accessed.'); } diff --git a/lib/Service/NotificationService.php b/lib/Service/NotificationService.php index faa8331e..e2042913 100644 --- a/lib/Service/NotificationService.php +++ b/lib/Service/NotificationService.php @@ -52,7 +52,7 @@ public function sendNotification(Task $task, ?string $customTarget = null, ?stri $notification->setApp(Application::APP_ID) ->setUser($task->getUserId()) ->setDateTime(new DateTime()) - ->setObject($objectType, (string) ($task->getId() ?? 0)) + ->setObject($objectType, (string)($task->getId() ?? 0)) ->setSubject($subject, $params); $manager->notify($notification); diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 8aaaabd7..7005bb22 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -41,7 +41,7 @@ public function getForm(): TemplateResponse { $speechToTextEnabled = $this->appConfig->getValueString(Application::APP_ID, 'speech_to_text_picker_enabled', '1') === '1'; $chattyLLMUserInstructions = $this->appConfig->getValueString(Application::APP_ID, 'chat_user_instructions', Application::CHAT_USER_INSTRUCTIONS); $chattyLLMUserInstructionsTitle = $this->appConfig->getValueString(Application::APP_ID, 'chat_user_instructions_title', Application::CHAT_USER_INSTRUCTIONS_TITLE); - $chattyLLMLastNMessages = (int) $this->appConfig->getValueString(Application::APP_ID, 'chat_last_n_messages', '10'); + $chattyLLMLastNMessages = (int)$this->appConfig->getValueString(Application::APP_ID, 'chat_last_n_messages', '10'); $adminConfig = [ 'text_processing_available' => $taskProcessingAvailable, diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php index 1d22d3eb..2b222908 100644 --- a/lib/Settings/PersonalSection.php +++ b/lib/Settings/PersonalSection.php @@ -10,7 +10,7 @@ class PersonalSection implements IIconSection { public function __construct( private IURLGenerator $urlGenerator, - private IL10N $l + private IL10N $l, ) { } @@ -35,8 +35,8 @@ public function getName(): string { /** * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. */ public function getPriority(): int { return 40; diff --git a/openapi.json b/openapi.json index a0eeaa08..c7ee7148 100644 --- a/openapi.json +++ b/openapi.json @@ -98,7 +98,10 @@ "progress", "status", "type", - "userId" + "userId", + "endedAt", + "scheduledAt", + "startedAt" ], "properties": { "appId": { @@ -115,13 +118,32 @@ }, "id": { "type": "integer", - "format": "int64", - "nullable": true + "format": "int64" }, "input": { "type": "object", "additionalProperties": { - "type": "object" + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] + } + }, + { + "type": "number" + }, + { + "type": "string" + } + ] } }, "lastUpdated": { @@ -130,8 +152,29 @@ }, "output": { "type": "object", + "nullable": true, "additionalProperties": { - "type": "object" + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] + } + }, + { + "type": "number" + }, + { + "type": "string" + } + ] } }, "progress": { @@ -148,6 +191,21 @@ "userId": { "type": "string", "nullable": true + }, + "endedAt": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "scheduledAt": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "startedAt": { + "type": "integer", + "format": "int64", + "nullable": true } } }, diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index a1dc3d18..7d91178c 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,15 @@ - + + + + $serializedTasks])]]> + $taskTypes])]]> + + + }, array{}>|DataResponse]]> + }, array{}>]]> + + - $content], Application::APP_ID . ':chatty-llm', $this->userId, $customId)]]> + userId, + $customId + )]]> + userId, $customId)]]>