diff --git a/classes/ocis_manager.php b/classes/ocis_manager.php index 1328bf20..d5e882fd 100644 --- a/classes/ocis_manager.php +++ b/classes/ocis_manager.php @@ -630,7 +630,7 @@ public function get_file_list(): array { if ($receivedshares !== null) { foreach ($receivedshares as $share) { if ( - $share->isClientSyncronize() === true && + $share->isClientSynchronized() === true && $share->getId() === $resource->getId() && $share->isUiHidden() === true ) { diff --git a/composer.json b/composer.json index 83b5dc13..d006afa5 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ } ], "require": { - "owncloud/ocis-php-sdk": "^1.0.0" + "owncloud/ocis-php-sdk": "dev-bump-ocis-latest-commit-id" }, "replace": { "guzzlehttp/guzzle": "*", diff --git a/composer.lock b/composer.lock index e9df98fb..c84c9f73 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e32c891ef2691d54736523e198263690", + "content-hash": "a1088b148d3a0455e7b724c6f6d291d6", "packages": [ { "name": "owncloud/libre-graph-api-php", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/owncloud/libre-graph-api-php.git", - "reference": "cb414b614a1dc9dee1a320ea3862f56b11c3d70c" + "reference": "c728b27030e08689768562ea3b79694f9e5b09aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owncloud/libre-graph-api-php/zipball/cb414b614a1dc9dee1a320ea3862f56b11c3d70c", - "reference": "cb414b614a1dc9dee1a320ea3862f56b11c3d70c", + "url": "https://api.github.com/repos/owncloud/libre-graph-api-php/zipball/c728b27030e08689768562ea3b79694f9e5b09aa", + "reference": "c728b27030e08689768562ea3b79694f9e5b09aa", "shasum": "" }, "require": { @@ -65,26 +65,26 @@ "issues": "https://github.com/owncloud/libre-graph-api-php/issues", "source": "https://github.com/owncloud/libre-graph-api-php/tree/main" }, - "time": "2024-01-15T11:05:29+00:00" + "time": "2024-01-30T15:23:40+00:00" }, { "name": "owncloud/ocis-php-sdk", - "version": "v1.0.0-rc.1", + "version": "dev-bump-ocis-latest-commit-id", "source": { "type": "git", "url": "https://github.com/owncloud/ocis-php-sdk.git", - "reference": "7f7da9e348729c1f4f30e14d58cc963ceb67459a" + "reference": "e4f4b897cf835ee4d8d74153c5c13bfa36d03cca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owncloud/ocis-php-sdk/zipball/7f7da9e348729c1f4f30e14d58cc963ceb67459a", - "reference": "7f7da9e348729c1f4f30e14d58cc963ceb67459a", + "url": "https://api.github.com/repos/owncloud/ocis-php-sdk/zipball/e4f4b897cf835ee4d8d74153c5c13bfa36d03cca", + "reference": "e4f4b897cf835ee4d8d74153c5c13bfa36d03cca", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", - "owncloud/libre-graph-api-php": "dev-main#cb414b614a1dc9dee1a320ea3862f56b11c3d70c", + "owncloud/libre-graph-api-php": "dev-main#c728b27030e08689768562ea3b79694f9e5b09aa", "php": "^8.1", "sabre/dav": "^4.6" }, @@ -104,10 +104,10 @@ "Apache-2.0" ], "support": { - "source": "https://github.com/owncloud/ocis-php-sdk/tree/v1.0.0-rc.1", + "source": "https://github.com/owncloud/ocis-php-sdk/tree/bump-ocis-latest-commit-id", "issues": "https://github.com/owncloud/ocis-php-sdk/issues" }, - "time": "2024-01-18T07:09:27+00:00" + "time": "2024-02-22T06:35:30+00:00" }, { "name": "psr/log", @@ -686,29 +686,30 @@ }, { "name": "moodlehq/moodle-cs", - "version": "v3.3.12", + "version": "v3.3.15", "source": { "type": "git", "url": "https://github.com/moodlehq/moodle-cs.git", - "reference": "9e3dcb07bfb3d0642f74e15253a5b44388782425" + "reference": "3a95fd8402231bfbac4e55301ed151518f2043c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/9e3dcb07bfb3d0642f74e15253a5b44388782425", - "reference": "9e3dcb07bfb3d0642f74e15253a5b44388782425", + "url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/3a95fd8402231bfbac4e55301ed151518f2043c3", + "reference": "3a95fd8402231bfbac4e55301ed151518f2043c3", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "phpcompatibility/php-compatibility": "dev-develop#306cd263", "phpcsstandards/phpcsextra": "^1.2.1", - "squizlabs/php_codesniffer": "^3.8.0" + "squizlabs/php_codesniffer": "^3.8.1" }, "replace": { "moodlehq/moodle-local_codechecker": "3.1.0" }, "require-dev": { "mikey179/vfsstream": "^1.6", + "nikic/php-parser": "^4.18", "overtrue/phplint": "^3.4.0 | ^9.0.4", "phpmd/phpmd": "^2.11", "phpunit/phpunit": "^9.6", @@ -749,7 +750,7 @@ "source": "https://github.com/moodlehq/moodle-cs", "wiki": "https://github.com/moodlehq/moodle-cs/wiki" }, - "time": "2023-12-19T15:30:23+00:00" + "time": "2024-02-15T18:18:01+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -757,18 +758,18 @@ "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "34a67f7eb4ec715df26d90429ea8cce88e0b38ff" + "reference": "e5cd2e244097fb62c5ac8f1153a26a73c3a50438" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/34a67f7eb4ec715df26d90429ea8cce88e0b38ff", - "reference": "34a67f7eb4ec715df26d90429ea8cce88e0b38ff", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e5cd2e244097fb62c5ac8f1153a26a73c3a50438", + "reference": "e5cd2e244097fb62c5ac8f1153a26a73c3a50438", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.5", - "squizlabs/php_codesniffer": "^3.7.1" + "phpcsstandards/phpcsutils": "^1.0.9", + "squizlabs/php_codesniffer": "^3.8.0" }, "replace": { "wimg/php-compatibility": "*" @@ -825,7 +826,21 @@ "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2023-12-04T17:28:03+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-02-12T16:57:44+00:00" }, { "name": "phpcsstandards/phpcsextra", @@ -995,16 +1010,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.1", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", - "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { @@ -1071,15 +1086,17 @@ "type": "open_collective" } ], - "time": "2024-01-11T20:47:48+00:00" + "time": "2024-02-16T15:06:51+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "owncloud/ocis-php-sdk": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/vendor/autoload.php b/vendor/autoload.php index 89fece88..124ed896 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -3,8 +3,21 @@ // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { - echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - exit(1); + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); } require_once __DIR__ . '/composer/autoload_real.php'; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index afef3fa2..7824d8f7 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,35 +42,37 @@ */ class ClassLoader { - /** @var ?string */ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -78,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -87,29 +88,29 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -121,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -130,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -139,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -148,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -157,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -175,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -201,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -222,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -232,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -252,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -272,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -290,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -425,7 +423,8 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -476,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { @@ -555,18 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index c6b54af7..51e734a7 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 030c5043..119d8dc4 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -33,25 +33,18 @@ public static function getLoader() $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit09c89e6e5da82c9d423c896384ac6d3f::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire09c89e6e5da82c9d423c896384ac6d3f($fileIdentifier, $file); + $filesToLoad = \Composer\Autoload\ComposerStaticInit09c89e6e5da82c9d423c896384ac6d3f::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire09c89e6e5da82c9d423c896384ac6d3f($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 5892a3c3..bf712b01 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -7,12 +7,12 @@ "source": { "type": "git", "url": "https://github.com/owncloud/libre-graph-api-php.git", - "reference": "cb414b614a1dc9dee1a320ea3862f56b11c3d70c" + "reference": "c728b27030e08689768562ea3b79694f9e5b09aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owncloud/libre-graph-api-php/zipball/cb414b614a1dc9dee1a320ea3862f56b11c3d70c", - "reference": "cb414b614a1dc9dee1a320ea3862f56b11c3d70c", + "url": "https://api.github.com/repos/owncloud/libre-graph-api-php/zipball/c728b27030e08689768562ea3b79694f9e5b09aa", + "reference": "c728b27030e08689768562ea3b79694f9e5b09aa", "shasum": "" }, "require": { @@ -28,7 +28,7 @@ "overtrue/phplint": "^9.0", "phpunit/phpunit": "^9.0" }, - "time": "2024-01-15T11:05:29+00:00", + "time": "2024-01-30T15:23:40+00:00", "default-branch": true, "type": "library", "installation-source": "dist", @@ -66,23 +66,23 @@ }, { "name": "owncloud/ocis-php-sdk", - "version": "v1.0.0-rc.1", - "version_normalized": "1.0.0.0-RC1", + "version": "dev-bump-ocis-latest-commit-id", + "version_normalized": "dev-bump-ocis-latest-commit-id", "source": { "type": "git", "url": "https://github.com/owncloud/ocis-php-sdk.git", - "reference": "7f7da9e348729c1f4f30e14d58cc963ceb67459a" + "reference": "e4f4b897cf835ee4d8d74153c5c13bfa36d03cca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owncloud/ocis-php-sdk/zipball/7f7da9e348729c1f4f30e14d58cc963ceb67459a", - "reference": "7f7da9e348729c1f4f30e14d58cc963ceb67459a", + "url": "https://api.github.com/repos/owncloud/ocis-php-sdk/zipball/e4f4b897cf835ee4d8d74153c5c13bfa36d03cca", + "reference": "e4f4b897cf835ee4d8d74153c5c13bfa36d03cca", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", - "owncloud/libre-graph-api-php": "dev-main#cb414b614a1dc9dee1a320ea3862f56b11c3d70c", + "owncloud/libre-graph-api-php": "dev-main#c728b27030e08689768562ea3b79694f9e5b09aa", "php": "^8.1", "sabre/dav": "^4.6" }, @@ -92,7 +92,7 @@ "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^10.5" }, - "time": "2024-01-18T07:09:27+00:00", + "time": "2024-02-22T06:35:30+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -104,7 +104,7 @@ "Apache-2.0" ], "support": { - "source": "https://github.com/owncloud/ocis-php-sdk/tree/v1.0.0-rc.1", + "source": "https://github.com/owncloud/ocis-php-sdk/tree/bump-ocis-latest-commit-id", "issues": "https://github.com/owncloud/ocis-php-sdk/issues" }, "install-path": "../owncloud/ocis-php-sdk" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index dcecbbc5..8e0d650f 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'owncloud/moodle-repository_ocis', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'a4fd5829e33db2715d0726ef8d79a89adcf917fa', + 'reference' => '0d1c9bef899cf861550b101785fd18e64034b3a7', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -25,7 +25,7 @@ 'owncloud/libre-graph-api-php' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cb414b614a1dc9dee1a320ea3862f56b11c3d70c', + 'reference' => 'c728b27030e08689768562ea3b79694f9e5b09aa', 'type' => 'library', 'install_path' => __DIR__ . '/../owncloud/libre-graph-api-php', 'aliases' => array( @@ -36,16 +36,16 @@ 'owncloud/moodle-repository_ocis' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'a4fd5829e33db2715d0726ef8d79a89adcf917fa', + 'reference' => '0d1c9bef899cf861550b101785fd18e64034b3a7', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'owncloud/ocis-php-sdk' => array( - 'pretty_version' => 'v1.0.0-rc.1', - 'version' => '1.0.0.0-RC1', - 'reference' => '7f7da9e348729c1f4f30e14d58cc963ceb67459a', + 'pretty_version' => 'dev-bump-ocis-latest-commit-id', + 'version' => 'dev-bump-ocis-latest-commit-id', + 'reference' => 'e4f4b897cf835ee4d8d74153c5c13bfa36d03cca', 'type' => 'library', 'install_path' => __DIR__ . '/../owncloud/ocis-php-sdk', 'aliases' => array(), diff --git a/vendor/owncloud/libre-graph-api-php/README.md b/vendor/owncloud/libre-graph-api-php/README.md index d240c548..2f2273a4 100644 --- a/vendor/owncloud/libre-graph-api-php/README.md +++ b/vendor/owncloud/libre-graph-api-php/README.md @@ -210,7 +210,7 @@ Class | Method | HTTP request | Description - [Quota](docs/Model/Quota.md) - [RemoteItem](docs/Model/RemoteItem.md) - [SharePointIdentitySet](docs/Model/SharePointIdentitySet.md) -- [Shared](docs/Model/Shared.md) +- [SharingInvitation](docs/Model/SharingInvitation.md) - [SharingLink](docs/Model/SharingLink.md) - [SharingLinkPassword](docs/Model/SharingLinkPassword.md) - [SharingLinkType](docs/Model/SharingLinkType.md) diff --git a/vendor/owncloud/libre-graph-api-php/src/Model/DriveItem.php b/vendor/owncloud/libre-graph-api-php/src/Model/DriveItem.php index 45f4f495..98c17120 100644 --- a/vendor/owncloud/libre-graph-api-php/src/Model/DriveItem.php +++ b/vendor/owncloud/libre-graph-api-php/src/Model/DriveItem.php @@ -87,7 +87,9 @@ class DriveItem implements ModelInterface, ArrayAccess, JsonSerializable 'children' => '\OpenAPI\Client\Model\DriveItem[]', 'permissions' => '\OpenAPI\Client\Model\Permission[]', 'audio' => '\OpenAPI\Client\Model\Audio', - 'video' => '\OpenAPI\Client\Model\Video' + 'video' => '\OpenAPI\Client\Model\Video', + 'at_client_synchronize' => 'bool', + 'at_ui_hidden' => 'bool' ]; /** @@ -124,7 +126,9 @@ class DriveItem implements ModelInterface, ArrayAccess, JsonSerializable 'children' => null, 'permissions' => null, 'audio' => null, - 'video' => null + 'video' => null, + 'at_client_synchronize' => null, + 'at_ui_hidden' => null ]; /** @@ -161,7 +165,9 @@ class DriveItem implements ModelInterface, ArrayAccess, JsonSerializable 'children' => false, 'permissions' => false, 'audio' => false, - 'video' => false + 'video' => false, + 'at_client_synchronize' => false, + 'at_ui_hidden' => false ]; /** @@ -278,7 +284,9 @@ public function isNullableSetToNull(string $property): bool 'children' => 'children', 'permissions' => 'permissions', 'audio' => 'audio', - 'video' => 'video' + 'video' => 'video', + 'at_client_synchronize' => '@client.synchronize', + 'at_ui_hidden' => '@UI.Hidden' ]; /** @@ -315,7 +323,9 @@ public function isNullableSetToNull(string $property): bool 'children' => 'setChildren', 'permissions' => 'setPermissions', 'audio' => 'setAudio', - 'video' => 'setVideo' + 'video' => 'setVideo', + 'at_client_synchronize' => 'setAtClientSynchronize', + 'at_ui_hidden' => 'setAtUiHidden' ]; /** @@ -352,7 +362,9 @@ public function isNullableSetToNull(string $property): bool 'children' => 'getChildren', 'permissions' => 'getPermissions', 'audio' => 'getAudio', - 'video' => 'getVideo' + 'video' => 'getVideo', + 'at_client_synchronize' => 'getAtClientSynchronize', + 'at_ui_hidden' => 'getAtUiHidden' ]; /** @@ -440,6 +452,8 @@ public function __construct(array $data = null) $this->setIfExists('permissions', $data ?? [], null); $this->setIfExists('audio', $data ?? [], null); $this->setIfExists('video', $data ?? [], null); + $this->setIfExists('at_client_synchronize', $data ?? [], null); + $this->setIfExists('at_ui_hidden', $data ?? [], null); } /** @@ -1284,6 +1298,60 @@ public function setVideo(?\OpenAPI\Client\Model\Video $video): static return $this; } + + /** + * Gets at_client_synchronize + * + * @return bool|null + */ + public function getAtClientSynchronize(): ?bool + { + return $this->container['at_client_synchronize']; + } + + /** + * Sets at_client_synchronize + * + * @param bool|null $at_client_synchronize Indicates if the item is synchronized with the underlying storage provider. Read-only. + * + * @return $this + */ + public function setAtClientSynchronize(?bool $at_client_synchronize): static + { + if (is_null($at_client_synchronize)) { + throw new InvalidArgumentException('non-nullable at_client_synchronize cannot be null'); + } + $this->container['at_client_synchronize'] = $at_client_synchronize; + + return $this; + } + + /** + * Gets at_ui_hidden + * + * @return bool|null + */ + public function getAtUiHidden(): ?bool + { + return $this->container['at_ui_hidden']; + } + + /** + * Sets at_ui_hidden + * + * @param bool|null $at_ui_hidden Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissons. + * + * @return $this + */ + public function setAtUiHidden(?bool $at_ui_hidden): static + { + if (is_null($at_ui_hidden)) { + throw new InvalidArgumentException('non-nullable at_ui_hidden cannot be null'); + } + $this->container['at_ui_hidden'] = $at_ui_hidden; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/vendor/owncloud/libre-graph-api-php/src/Model/Permission.php b/vendor/owncloud/libre-graph-api-php/src/Model/Permission.php index 73df82da..af871f7a 100644 --- a/vendor/owncloud/libre-graph-api-php/src/Model/Permission.php +++ b/vendor/owncloud/libre-graph-api-php/src/Model/Permission.php @@ -67,8 +67,7 @@ class Permission implements ModelInterface, ArrayAccess, JsonSerializable 'roles' => 'string[]', 'granted_to_identities' => '\OpenAPI\Client\Model\IdentitySet[]', 'at_libre_graph_permissions_actions' => 'string[]', - 'at_client_synchronize' => 'bool', - 'at_ui_hidden' => 'bool' + 'invitation' => '\OpenAPI\Client\Model\SharingInvitation' ]; /** @@ -85,8 +84,7 @@ class Permission implements ModelInterface, ArrayAccess, JsonSerializable 'roles' => null, 'granted_to_identities' => null, 'at_libre_graph_permissions_actions' => null, - 'at_client_synchronize' => null, - 'at_ui_hidden' => null + 'invitation' => null ]; /** @@ -103,8 +101,7 @@ class Permission implements ModelInterface, ArrayAccess, JsonSerializable 'roles' => false, 'granted_to_identities' => false, 'at_libre_graph_permissions_actions' => false, - 'at_client_synchronize' => false, - 'at_ui_hidden' => false + 'invitation' => false ]; /** @@ -201,8 +198,7 @@ public function isNullableSetToNull(string $property): bool 'roles' => 'roles', 'granted_to_identities' => 'grantedToIdentities', 'at_libre_graph_permissions_actions' => '@libre.graph.permissions.actions', - 'at_client_synchronize' => '@client.synchronize', - 'at_ui_hidden' => '@ui.hidden' + 'invitation' => 'invitation' ]; /** @@ -219,8 +215,7 @@ public function isNullableSetToNull(string $property): bool 'roles' => 'setRoles', 'granted_to_identities' => 'setGrantedToIdentities', 'at_libre_graph_permissions_actions' => 'setAtLibreGraphPermissionsActions', - 'at_client_synchronize' => 'setAtClientSynchronize', - 'at_ui_hidden' => 'setAtUiHidden' + 'invitation' => 'setInvitation' ]; /** @@ -237,8 +232,7 @@ public function isNullableSetToNull(string $property): bool 'roles' => 'getRoles', 'granted_to_identities' => 'getGrantedToIdentities', 'at_libre_graph_permissions_actions' => 'getAtLibreGraphPermissionsActions', - 'at_client_synchronize' => 'getAtClientSynchronize', - 'at_ui_hidden' => 'getAtUiHidden' + 'invitation' => 'getInvitation' ]; /** @@ -305,8 +299,7 @@ public function __construct(array $data = null) $this->setIfExists('roles', $data ?? [], null); $this->setIfExists('granted_to_identities', $data ?? [], null); $this->setIfExists('at_libre_graph_permissions_actions', $data ?? [], null); - $this->setIfExists('at_client_synchronize', $data ?? [], null); - $this->setIfExists('at_ui_hidden', $data ?? [], null); + $this->setIfExists('invitation', $data ?? [], null); } /** @@ -577,55 +570,28 @@ public function setAtLibreGraphPermissionsActions(?array $at_libre_graph_permiss } /** - * Gets at_client_synchronize + * Gets invitation * - * @return bool|null - */ - public function getAtClientSynchronize(): ?bool - { - return $this->container['at_client_synchronize']; - } - - /** - * Sets at_client_synchronize - * - * @param bool|null $at_client_synchronize Indicates if the item is synchronized with the underlying storage provider. Read-only. - * - * @return $this - */ - public function setAtClientSynchronize(?bool $at_client_synchronize): static - { - if (is_null($at_client_synchronize)) { - throw new InvalidArgumentException('non-nullable at_client_synchronize cannot be null'); - } - $this->container['at_client_synchronize'] = $at_client_synchronize; - - return $this; - } - - /** - * Gets at_ui_hidden - * - * @return bool|null + * @return \OpenAPI\Client\Model\SharingInvitation|null */ - public function getAtUiHidden(): ?bool + public function getInvitation(): ?\OpenAPI\Client\Model\SharingInvitation { - return $this->container['at_ui_hidden']; + return $this->container['invitation']; } /** - * Sets at_ui_hidden + * Sets invitation * - * @param bool|null $at_ui_hidden Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissons. + * @param \OpenAPI\Client\Model\SharingInvitation|null $invitation invitation * * @return $this */ - public function setAtUiHidden(?bool $at_ui_hidden): static + public function setInvitation(?\OpenAPI\Client\Model\SharingInvitation $invitation): static { - if (is_null($at_ui_hidden)) { - throw new InvalidArgumentException('non-nullable at_ui_hidden cannot be null'); + if (is_null($invitation)) { + throw new InvalidArgumentException('non-nullable invitation cannot be null'); } - $this->container['at_ui_hidden'] = $at_ui_hidden; + $this->container['invitation'] = $invitation; return $this; } diff --git a/vendor/owncloud/libre-graph-api-php/src/Model/RemoteItem.php b/vendor/owncloud/libre-graph-api-php/src/Model/RemoteItem.php index fba27c53..0ecf3e07 100644 --- a/vendor/owncloud/libre-graph-api-php/src/Model/RemoteItem.php +++ b/vendor/owncloud/libre-graph-api-php/src/Model/RemoteItem.php @@ -75,7 +75,6 @@ class RemoteItem implements ModelInterface, ArrayAccess, JsonSerializable 'e_tag' => 'string', 'c_tag' => 'string', 'parent_reference' => '\OpenAPI\Client\Model\ItemReference', - 'shared' => '\OpenAPI\Client\Model\Shared', 'permissions' => '\OpenAPI\Client\Model\Permission[]', 'size' => 'int', 'special_folder' => '\OpenAPI\Client\Model\SpecialFolder', @@ -105,7 +104,6 @@ class RemoteItem implements ModelInterface, ArrayAccess, JsonSerializable 'e_tag' => null, 'c_tag' => null, 'parent_reference' => null, - 'shared' => null, 'permissions' => null, 'size' => 'int64', 'special_folder' => null, @@ -135,7 +133,6 @@ class RemoteItem implements ModelInterface, ArrayAccess, JsonSerializable 'e_tag' => false, 'c_tag' => false, 'parent_reference' => false, - 'shared' => false, 'permissions' => false, 'size' => false, 'special_folder' => false, @@ -245,7 +242,6 @@ public function isNullableSetToNull(string $property): bool 'e_tag' => 'eTag', 'c_tag' => 'cTag', 'parent_reference' => 'parentReference', - 'shared' => 'shared', 'permissions' => 'permissions', 'size' => 'size', 'special_folder' => 'specialFolder', @@ -275,7 +271,6 @@ public function isNullableSetToNull(string $property): bool 'e_tag' => 'setETag', 'c_tag' => 'setCTag', 'parent_reference' => 'setParentReference', - 'shared' => 'setShared', 'permissions' => 'setPermissions', 'size' => 'setSize', 'special_folder' => 'setSpecialFolder', @@ -305,7 +300,6 @@ public function isNullableSetToNull(string $property): bool 'e_tag' => 'getETag', 'c_tag' => 'getCTag', 'parent_reference' => 'getParentReference', - 'shared' => 'getShared', 'permissions' => 'getPermissions', 'size' => 'getSize', 'special_folder' => 'getSpecialFolder', @@ -385,7 +379,6 @@ public function __construct(array $data = null) $this->setIfExists('e_tag', $data ?? [], null); $this->setIfExists('c_tag', $data ?? [], null); $this->setIfExists('parent_reference', $data ?? [], null); - $this->setIfExists('shared', $data ?? [], null); $this->setIfExists('permissions', $data ?? [], null); $this->setIfExists('size', $data ?? [], null); $this->setIfExists('special_folder', $data ?? [], null); @@ -885,33 +878,6 @@ public function setParentReference(?\OpenAPI\Client\Model\ItemReference $parent_ return $this; } - /** - * Gets shared - * - * @return \OpenAPI\Client\Model\Shared|null - */ - public function getShared(): ?\OpenAPI\Client\Model\Shared - { - return $this->container['shared']; - } - - /** - * Sets shared - * - * @param \OpenAPI\Client\Model\Shared|null $shared shared - * - * @return $this - */ - public function setShared(?\OpenAPI\Client\Model\Shared $shared): static - { - if (is_null($shared)) { - throw new InvalidArgumentException('non-nullable shared cannot be null'); - } - $this->container['shared'] = $shared; - - return $this; - } - /** * Gets permissions * diff --git a/vendor/owncloud/libre-graph-api-php/src/Model/Shared.php b/vendor/owncloud/libre-graph-api-php/src/Model/SharingInvitation.php similarity index 65% rename from vendor/owncloud/libre-graph-api-php/src/Model/Shared.php rename to vendor/owncloud/libre-graph-api-php/src/Model/SharingInvitation.php index 6eb9063e..95400735 100644 --- a/vendor/owncloud/libre-graph-api-php/src/Model/Shared.php +++ b/vendor/owncloud/libre-graph-api-php/src/Model/SharingInvitation.php @@ -1,6 +1,6 @@ */ -class Shared implements ModelInterface, ArrayAccess, JsonSerializable +class SharingInvitation implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +51,7 @@ class Shared implements ModelInterface, ArrayAccess, JsonSerializable * * @var string */ - protected static string $openAPIModelName = 'shared'; + protected static string $openAPIModelName = 'sharingInvitation'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,10 +59,7 @@ class Shared implements ModelInterface, ArrayAccess, JsonSerializable * @var array */ protected static array $openAPITypes = [ - 'owner' => '\OpenAPI\Client\Model\IdentitySet', - 'scope' => 'string', - 'shared_by' => '\OpenAPI\Client\Model\IdentitySet', - 'shared_date_time' => '\DateTime' + 'invited_by' => '\OpenAPI\Client\Model\IdentitySet' ]; /** @@ -70,10 +68,7 @@ class Shared implements ModelInterface, ArrayAccess, JsonSerializable * @var array */ protected static array $openAPIFormats = [ - 'owner' => null, - 'scope' => null, - 'shared_by' => null, - 'shared_date_time' => 'date-time' + 'invited_by' => null ]; /** @@ -82,10 +77,7 @@ class Shared implements ModelInterface, ArrayAccess, JsonSerializable * @var array */ protected static array $openAPINullables = [ - 'owner' => false, - 'scope' => false, - 'shared_by' => false, - 'shared_date_time' => false + 'invited_by' => false ]; /** @@ -174,10 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var array */ protected static array $attributeMap = [ - 'owner' => 'owner', - 'scope' => 'scope', - 'shared_by' => 'sharedBy', - 'shared_date_time' => 'sharedDateTime' + 'invited_by' => 'invitedBy' ]; /** @@ -186,10 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var array */ protected static array $setters = [ - 'owner' => 'setOwner', - 'scope' => 'setScope', - 'shared_by' => 'setSharedBy', - 'shared_date_time' => 'setSharedDateTime' + 'invited_by' => 'setInvitedBy' ]; /** @@ -198,10 +184,7 @@ public function isNullableSetToNull(string $property): bool * @var array */ protected static array $getters = [ - 'owner' => 'getOwner', - 'scope' => 'getScope', - 'shared_by' => 'getSharedBy', - 'shared_date_time' => 'getSharedDateTime' + 'invited_by' => 'getInvitedBy' ]; /** @@ -260,10 +243,7 @@ public function getModelName(): string */ public function __construct(array $data = null) { - $this->setIfExists('owner', $data ?? [], null); - $this->setIfExists('scope', $data ?? [], null); - $this->setIfExists('shared_by', $data ?? [], null); - $this->setIfExists('shared_date_time', $data ?? [], null); + $this->setIfExists('invited_by', $data ?? [], null); } /** @@ -293,10 +273,6 @@ public function listInvalidProperties(): array { $invalidProperties = []; - if (!is_null($this->container['shared_date_time']) && !preg_match("/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/", $this->container['shared_date_time'])) { - $invalidProperties[] = "invalid value for 'shared_date_time', must be conform to the pattern /^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/."; - } - return $invalidProperties; } @@ -313,114 +289,28 @@ public function valid(): bool /** - * Gets owner + * Gets invited_by * * @return \OpenAPI\Client\Model\IdentitySet|null */ - public function getOwner(): ?\OpenAPI\Client\Model\IdentitySet + public function getInvitedBy(): ?\OpenAPI\Client\Model\IdentitySet { - return $this->container['owner']; + return $this->container['invited_by']; } /** - * Sets owner + * Sets invited_by * - * @param \OpenAPI\Client\Model\IdentitySet|null $owner owner + * @param \OpenAPI\Client\Model\IdentitySet|null $invited_by invited_by * * @return $this */ - public function setOwner(?\OpenAPI\Client\Model\IdentitySet $owner): static + public function setInvitedBy(?\OpenAPI\Client\Model\IdentitySet $invited_by): static { - if (is_null($owner)) { - throw new InvalidArgumentException('non-nullable owner cannot be null'); + if (is_null($invited_by)) { + throw new InvalidArgumentException('non-nullable invited_by cannot be null'); } - $this->container['owner'] = $owner; - - return $this; - } - - /** - * Gets scope - * - * @return string|null - */ - public function getScope(): ?string - { - return $this->container['scope']; - } - - /** - * Sets scope - * - * @param string|null $scope Indicates the scope of how the item is shared: anonymous, organization, or users. Read-only. - * - * @return $this - */ - public function setScope(?string $scope): static - { - if (is_null($scope)) { - throw new InvalidArgumentException('non-nullable scope cannot be null'); - } - $this->container['scope'] = $scope; - - return $this; - } - - /** - * Gets shared_by - * - * @return \OpenAPI\Client\Model\IdentitySet|null - */ - public function getSharedBy(): ?\OpenAPI\Client\Model\IdentitySet - { - return $this->container['shared_by']; - } - - /** - * Sets shared_by - * - * @param \OpenAPI\Client\Model\IdentitySet|null $shared_by shared_by - * - * @return $this - */ - public function setSharedBy(?\OpenAPI\Client\Model\IdentitySet $shared_by): static - { - if (is_null($shared_by)) { - throw new InvalidArgumentException('non-nullable shared_by cannot be null'); - } - $this->container['shared_by'] = $shared_by; - - return $this; - } - - /** - * Gets shared_date_time - * - * @return \DateTime|null - */ - public function getSharedDateTime(): ?\DateTime - { - return $this->container['shared_date_time']; - } - - /** - * Sets shared_date_time - * - * @param \DateTime|null $shared_date_time The UTC date and time when the item was shared. Read-only. - * - * @return $this - */ - public function setSharedDateTime(?\DateTime $shared_date_time): static - { - if (is_null($shared_date_time)) { - throw new InvalidArgumentException('non-nullable shared_date_time cannot be null'); - } - - if ((!preg_match("/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/", ObjectSerializer::toString($shared_date_time)))) { - throw new InvalidArgumentException("invalid value for \$shared_date_time when calling Shared., must conform to the pattern /^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/."); - } - - $this->container['shared_date_time'] = $shared_date_time; + $this->container['invited_by'] = $invited_by; return $this; } diff --git a/vendor/owncloud/ocis-php-sdk/composer.json b/vendor/owncloud/ocis-php-sdk/composer.json index f1c68123..ffa2ef81 100644 --- a/vendor/owncloud/ocis-php-sdk/composer.json +++ b/vendor/owncloud/ocis-php-sdk/composer.json @@ -16,7 +16,7 @@ "require": { "php": "^8.1", "sabre/dav": "^4.6", - "owncloud/libre-graph-api-php": "dev-main#cb414b614a1dc9dee1a320ea3862f56b11c3d70c", + "owncloud/libre-graph-api-php": "dev-main#c728b27030e08689768562ea3b79694f9e5b09aa", "ext-json": "*", "ext-curl": "*" }, diff --git a/vendor/owncloud/ocis-php-sdk/src/Exception/ExceptionHelper.php b/vendor/owncloud/ocis-php-sdk/src/Exception/ExceptionHelper.php index 9425ff45..b6d1d9af 100644 --- a/vendor/owncloud/ocis-php-sdk/src/Exception/ExceptionHelper.php +++ b/vendor/owncloud/ocis-php-sdk/src/Exception/ExceptionHelper.php @@ -4,6 +4,7 @@ use GuzzleHttp\Exception\GuzzleException; use OpenAPI\Client\ApiException; +use OpenAPI\Client\Model\OdataError; use Sabre\HTTP\ClientException as SabreClientException; use Sabre\HTTP\ClientHttpException as SabreClientHttpException; @@ -18,7 +19,7 @@ class ExceptionHelper * that is more specific to the HTTP error */ public static function getHttpErrorException( - GuzzleException|ApiException|SabreClientHttpException|SabreClientException $e + GuzzleException|ApiException|SabreClientHttpException|SabreClientException|HttpException $e ): BadRequestException| NotFoundException| ForbiddenException| @@ -90,4 +91,44 @@ public static function getHttpErrorException( ), }; } + + /** + * Takes an OdataError object and returns a custom exception + * that is more specific to the error if it has a numeric error code. + * Otherwise, it returns an InvalidResponseException + * + * @param string $methodName the name of the method that received the OdataError + */ + public static function getExceptionFromOdataError( + OdataError $odataError, + string $methodName + ): BadRequestException| + NotFoundException| + ForbiddenException| + UnauthorizedException| + HttpException| + ConflictException| + TooEarlyException| + InternalServerErrorException { + $error = $odataError->getError(); + $errorCode = $error->getCode(); + $errorMessage = $error->getMessage(); + if (is_numeric($errorCode)) { + $genericHttpException = new HttpException( + $errorMessage, + (int) $errorCode + ); + return self::getHttpErrorException($genericHttpException); + } + // The error code was not numeric, which is not really expected to happen. + // So throw an InternalServerErrorException with numeric code 500 and + // put the details in the exception message so that the caller has a chance + // to understand what happened. + return new InternalServerErrorException( + "$methodName returned an OdataError with code '" . + $errorCode . + "' and message '" . $errorMessage . "'", + 500 + ); + } } diff --git a/vendor/owncloud/ocis-php-sdk/src/Ocis.php b/vendor/owncloud/ocis-php-sdk/src/Ocis.php index 03adbc2e..791e5088 100644 --- a/vendor/owncloud/ocis-php-sdk/src/Ocis.php +++ b/vendor/owncloud/ocis-php-sdk/src/Ocis.php @@ -48,7 +48,7 @@ */ class Ocis { - private const DECODE_TOKEN_ERROR_MESSAGE = 'could not decode token'; + private const DECODE_TOKEN_ERROR_MESSAGE = 'Could not decode token.'; public const FUNCTION_NOT_IMPLEMENTED_YET_ERROR_MESSAGE = 'This function is not implemented yet! Place, name and signature of the function might change!'; private string $serviceUrl; @@ -234,22 +234,43 @@ private function getServiceUrlFromWebfinger(string $webfingerUrl): string { $tokenDataArray = explode(".", $this->accessToken); if (!array_key_exists(1, $tokenDataArray)) { - throw new \InvalidArgumentException(self::DECODE_TOKEN_ERROR_MESSAGE); + throw new \InvalidArgumentException( + self::DECODE_TOKEN_ERROR_MESSAGE . + " No payload found." + ); } - $plainPayload = base64_decode($tokenDataArray[1], true); + $plainPayload = base64_decode(\strtr($tokenDataArray[1], '-_', '+/'), true); if (!$plainPayload) { - throw new \InvalidArgumentException(self::DECODE_TOKEN_ERROR_MESSAGE); + throw new \InvalidArgumentException( + self::DECODE_TOKEN_ERROR_MESSAGE . + " Payload not Base64Url encoded." + ); } $tokenPayload = json_decode($plainPayload, true); - if (!is_array($tokenPayload) || !array_key_exists('iss', $tokenPayload)) { - throw new \InvalidArgumentException(self::DECODE_TOKEN_ERROR_MESSAGE); + if (!is_array($tokenPayload)) { + throw new \InvalidArgumentException( + self::DECODE_TOKEN_ERROR_MESSAGE . + " Payload not valid JSON." + ); + } + if (!array_key_exists('iss', $tokenPayload)) { + throw new \InvalidArgumentException( + self::DECODE_TOKEN_ERROR_MESSAGE . + " Payload does not contain 'iss' key." + ); } if (!is_string($tokenPayload['iss'])) { - throw new \InvalidArgumentException(self::DECODE_TOKEN_ERROR_MESSAGE); + throw new \InvalidArgumentException( + self::DECODE_TOKEN_ERROR_MESSAGE . + " 'iss' key is not a string." + ); } $iss = parse_url($tokenPayload['iss']); if (!is_array($iss) || !array_key_exists('host', $iss)) { - throw new \InvalidArgumentException(self::DECODE_TOKEN_ERROR_MESSAGE); + throw new \InvalidArgumentException( + self::DECODE_TOKEN_ERROR_MESSAGE . + " Content of 'iss' has no 'host' part." + ); } try { $webfingerResponse = $this->guzzle->get($webfingerUrl . '?resource=acct:me@' . $iss['host']); @@ -320,10 +341,7 @@ public function getAllDrives( throw ExceptionHelper::getHttpErrorException($e); } if ($allDrivesList instanceof OdataError) { - // ToDo: understand how this can happen, and what to do about it. - throw new InvalidResponseException( - "listAllDrives returned an OdataError - " . $allDrivesList->getError() - ); + throw ExceptionHelper::getExceptionFromOdataError($allDrivesList, "listAllDrives"); } $apiDrives = $allDrivesList->getValue(); $apiDrives = $apiDrives ?? []; @@ -380,10 +398,7 @@ public function getMyDrives( } if ($allDrivesList instanceof OdataError) { - // ToDo: understand how this can happen, and what to do about it. - throw new InvalidResponseException( - "listMyDrives returned an OdataError - " . $allDrivesList->getError() - ); + throw ExceptionHelper::getExceptionFromOdataError($allDrivesList, "listMyDrives"); } $apiDrives = $allDrivesList->getValue(); $apiDrives = $apiDrives ?? []; diff --git a/vendor/owncloud/ocis-php-sdk/src/ShareReceived.php b/vendor/owncloud/ocis-php-sdk/src/ShareReceived.php index d09f1ba0..fe59ec1e 100644 --- a/vendor/owncloud/ocis-php-sdk/src/ShareReceived.php +++ b/vendor/owncloud/ocis-php-sdk/src/ShareReceived.php @@ -4,8 +4,6 @@ use OpenAPI\Client\Model\DriveItem; use OpenAPI\Client\Model\Identity; -use OpenAPI\Client\Model\ItemReference; -use OpenAPI\Client\Model\Permission; use OpenAPI\Client\Model\RemoteItem; use Owncloud\OcisPhpSdk\Exception\InvalidResponseException; @@ -30,17 +28,13 @@ public function __construct( /** * @throws InvalidResponseException */ - public function getId(): ?string + public function getId(): string { - if (empty($this->shareReceived->getId()) && $this->isClientSyncronize() === false) { - return null; - } - if (empty($this->shareReceived->getId()) && $this->isClientSyncronize() === true) { - throw new InvalidResponseException( + return empty($this->shareReceived->getId()) + ? throw new InvalidResponseException( "Invalid Id '" . print_r($this->shareReceived->getId(), true) . "'" - ); - } - return $this->shareReceived->getId(); + ) + : $this->shareReceived->getId(); } /** @@ -59,89 +53,38 @@ public function getName(): string /** * @throws InvalidResponseException */ - public function getEtag(): ?string + public function getEtag(): string { - if (empty($this->shareReceived->getETag()) && $this->isClientSyncronize() === false) { - return null; - } - if (empty($this->shareReceived->getETag()) && $this->isClientSyncronize() === true) { - throw new InvalidResponseException( + return empty($this->shareReceived->getETag()) + ? throw new InvalidResponseException( "Invalid Etag '" . print_r($this->shareReceived->getETag(), true) . "'" - ); - } - return $this->shareReceived->getETag(); - } - - /** - * @throws InvalidResponseException - */ - private function getParentReference(): ?ItemReference - { - if (empty($this->shareReceived->getParentReference()) && $this->isClientSyncronize() === false) { - return null; - } - if (empty($this->shareReceived->getParentReference()) && $this->isClientSyncronize() === true) { - throw new InvalidResponseException( - "Invalid parentReference of received share '" . - print_r($this->shareReceived->getParentReference(), true) . "'" - ); - } - return $this->shareReceived->getParentReference(); + ) + : $this->shareReceived->getETag(); } /** + * @return \DateTimeImmutable * @throws InvalidResponseException */ - public function getParentDriveId(): ?string + public function getLastModifiedDateTime(): \DateTimeImmutable { - $parentReference = $this->getParentReference(); - if ($parentReference === null) { - return null; - } - if (empty($parentReference->getDriveId()) && $this->isClientSyncronize() === false) { - return null; - } - if (empty($parentReference->getDriveId()) && $this->isClientSyncronize() === true) { + $time = $this->shareReceived->getLastModifiedDateTime(); + if (empty($time)) { throw new InvalidResponseException( - "Invalid driveId returned in parentReference of received share '" . - print_r($parentReference->getDriveId(), true) . "'" + "Invalid last modified DateTime'" . print_r($time, true) . "'" ); } - return $parentReference->getDriveId(); - } - - /** - * @throws InvalidResponseException - */ - public function getParentDriveType(): ?DriveType - { - $parentReference = $this->getParentReference(); - if ($parentReference === null) { - return null; - } - if (empty($parentReference->getDriveType()) && $this->isClientSyncronize() === false) { - return null; - } - $driveTypeString = (string)$parentReference->getDriveType(); - $driveType = DriveType::tryFrom($driveTypeString); - if ($driveType instanceof DriveType) { - return $driveType; - } - - throw new InvalidResponseException( - 'Invalid driveType returned in parentReference of received share: "' . - print_r($driveTypeString, true) . '"' - ); + return \DateTimeImmutable::createFromMutable($time); } /** * @throws InvalidResponseException */ - private function getRemoteItem(): RemoteItem + public function getRemoteItem(): RemoteItem { - return empty($this -> shareReceived -> getRemoteItem()) + return empty($this->shareReceived->getRemoteItem()) ? throw new InvalidResponseException( - "Invalid remote item '" . print_r($this -> shareReceived -> getParentReference(), true) . "'" + "Invalid remote item '" . print_r($this->shareReceived->getParentReference(), true) . "'" ) : $this->shareReceived->getRemoteItem(); } @@ -159,113 +102,40 @@ public function getRemoteItemId(): string : $remoteItem->getId(); } - /** - * @return string - * @throws InvalidResponseException - */ - public function getRemoteItemName(): string - { - $remoteItem = $this->getRemoteItem(); - return empty($remoteItem->getName()) - ? throw new InvalidResponseException( - "Invalid remote item name '" . print_r($remoteItem, true) . "'" - ) - : $remoteItem->getName(); - } - - /** - * @return int - * @throws InvalidResponseException - */ - public function getRemoteItemSize(): int - { - $remoteItem = $this->getRemoteItem(); - return empty($remoteItem->getSize()) - ? throw new InvalidResponseException( - "Invalid remote item size '" . print_r($remoteItem, true) . "'" - ) - : $remoteItem->getSize(); - } - /** * @throws InvalidResponseException */ - private function getShared(): \OpenAPI\Client\Model\Shared + private function getCreatedByUser(): Identity { - $remoteItem = $this->getRemoteItem(); - - return empty($remoteItem->getShared()) ? + return empty($this->shareReceived->getCreatedBy()) + || empty($this->shareReceived->getCreatedBy()->getUser()) ? throw new InvalidResponseException( - "Invalid shared '" . print_r($remoteItem, true) . "'" - ) : $remoteItem->getShared(); + "Invalid share createdBy information '" . print_r($this->shareReceived->getCreatedBy(), true) . "'" + ) : $this->shareReceived->getCreatedBy()->getUser(); } /** - * @return \DateTimeImmutable * @throws InvalidResponseException */ - public function getRemoteItemSharedDateTime(): \DateTimeImmutable + public function getCreatedByDisplayName(): string { - $sharedInfo = $this->getShared(); - $time = $sharedInfo->getSharedDateTime(); - if (empty($time)) { - throw new InvalidResponseException( - "Invalid shared DateTime'" . print_r($sharedInfo->getSharedDateTime(), true) . "'" - ); - } - return \DateTimeImmutable::createFromMutable($time); - } - - /** - * @throws InvalidResponseException - */ - private function getOwnerUser(): Identity - { - return empty($this->getShared()->getOwner()) - || empty($this->getShared()->getOwner()->getUser()) ? - throw new InvalidResponseException( - "Invalid owner information '" . print_r($this->getShared()->getOwner(), true) . "'" - ) : $this->getShared()->getOwner()->getUser(); - } - - /** - * @throws InvalidResponseException - */ - public function getOwnerName(): string - { - $ownerUser = $this->getOwnerUser(); - return empty($ownerUser->getDisplayName()) + $createdByUser = $this->getCreatedByUser(); + return empty($createdByUser->getDisplayName()) ? throw new InvalidResponseException( - "Invalid share owner name '" . print_r($ownerUser, true) . "'" + "Invalid share owner name '" . print_r($createdByUser, true) . "'" ) - : $ownerUser->getDisplayName(); - } - - /** - * @throws InvalidResponseException - */ - public function getOwnerId(): string - { - $ownerUser = $this->getOwnerUser(); - return empty($ownerUser->getId()) ? throw new InvalidResponseException( - "Invalid share owner id '" . print_r($ownerUser->getId(), true) . "'" - ) : $ownerUser->getId(); + : $createdByUser->getDisplayName(); } /** - * gets the first permission of the remote item - * in theory there might be more that one permission, but currently there is no such case in ocis - * @return Permission * @throws InvalidResponseException */ - private function getRemoteItemPermission() + public function getCreatedByUserId(): string { - $remoteItem = $this->getRemoteItem(); - $permissions = $remoteItem->getPermissions(); - if ($permissions === null || sizeof($permissions) !== 1) { - throw new InvalidResponseException('Invalid permissions in remoteItem'); - } - return $permissions[0]; + $createdByUser = $this->getCreatedByUser(); + return empty($createdByUser->getId()) ? throw new InvalidResponseException( + "Invalid share owner id '" . print_r($createdByUser->getId(), true) . "'" + ) : $createdByUser->getId(); } /** @@ -273,22 +143,23 @@ private function getRemoteItemPermission() */ public function isUiHidden(): bool { - $uiHidden = $this->getRemoteItemPermission()->getAtUiHidden(); - if ($uiHidden === null) { - throw new InvalidResponseException('Invalid "@ui.hidden" parameter in permission'); + $uiHidden = $this->shareReceived->getAtUiHidden(); + if (is_bool($uiHidden)) { + return $uiHidden; } - return $uiHidden; + throw new InvalidResponseException('Invalid "@ui.hidden" parameter in permission'); } /** * @throws InvalidResponseException */ - public function isClientSyncronize(): bool + public function isClientSynchronized(): bool { - $clientSyncronize = $this->getRemoteItemPermission()->getAtClientSynchronize(); - if ($clientSyncronize === null) { - throw new InvalidResponseException('Invalid "@client.synchronize" parameter in permission'); + $clientSyncronize = $this->shareReceived->getAtClientSynchronize(); + if (is_bool($clientSyncronize)) { + return $clientSyncronize; } - return $clientSyncronize; + throw new InvalidResponseException('Invalid "@client.synchronize" parameter in permission'); + } }