diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Calendar/ICreateFromString.php | 24 | ||||
-rw-r--r-- | lib/public/Config/BeforePreferenceDeletedEvent.php | 5 | ||||
-rw-r--r-- | lib/public/Config/BeforePreferenceSetEvent.php | 5 | ||||
-rw-r--r-- | lib/public/Config/Exceptions/IncorrectTypeException.php | 5 | ||||
-rw-r--r-- | lib/public/Config/Exceptions/TypeConflictException.php | 5 | ||||
-rw-r--r-- | lib/public/Config/Exceptions/UnknownKeyException.php | 5 | ||||
-rw-r--r-- | lib/public/Config/IUserConfig.php | 2 | ||||
-rw-r--r-- | lib/public/Config/Lexicon/Entry.php | 23 | ||||
-rw-r--r-- | lib/public/Config/Lexicon/ILexicon.php | 4 | ||||
-rw-r--r-- | lib/public/Config/Lexicon/Preset.php | 5 | ||||
-rw-r--r-- | lib/public/Config/Lexicon/Strictness.php | 5 | ||||
-rw-r--r-- | lib/public/Config/ValueType.php | 4 | ||||
-rw-r--r-- | lib/public/Federation/ICloudIdManager.php | 27 | ||||
-rw-r--r-- | lib/public/Federation/ICloudIdResolver.php | 40 | ||||
-rw-r--r-- | lib/public/IAppConfig.php | 28 | ||||
-rw-r--r-- | lib/public/Share/IShare.php | 14 | ||||
-rw-r--r-- | lib/public/Share/IShareProvider.php | 8 |
17 files changed, 178 insertions, 31 deletions
diff --git a/lib/public/Calendar/ICreateFromString.php b/lib/public/Calendar/ICreateFromString.php index 5badaa2d4cf..2bb0f2ffa20 100644 --- a/lib/public/Calendar/ICreateFromString.php +++ b/lib/public/Calendar/ICreateFromString.php @@ -17,9 +17,31 @@ use OCP\Calendar\Exceptions\CalendarException; */ interface ICreateFromString extends ICalendar { /** - * @since 23.0.0 + * Create an event in this calendar from an ICS string. + * + * @param string $name the file name - needs to contain the .ics ending + * @param string $calendarData a string containing a valid VEVENT ics * * @throws CalendarException + * + * @since 23.0.0 + * */ public function createFromString(string $name, string $calendarData): void; + + /** + * Create an event in this calendar from an ICS string using a minimal CalDAV server. + * Usually, the createFromString() method should be preferred. + * + * However, in some cases it is useful to not set up a full CalDAV server. + * Missing features include no iMIP plugin, no invitation emails amongst others. + * + * @param string $name the file name - needs to contain the .ics ending + * @param string $calendarData a string containing a valid VEVENT ics + * + * @throws CalendarException + * + * @since 32.0.0 + */ + public function createFromStringMinimal(string $name, string $calendarData): void; } diff --git a/lib/public/Config/BeforePreferenceDeletedEvent.php b/lib/public/Config/BeforePreferenceDeletedEvent.php index c7026b0f6fc..df89a2900bd 100644 --- a/lib/public/Config/BeforePreferenceDeletedEvent.php +++ b/lib/public/Config/BeforePreferenceDeletedEvent.php @@ -8,11 +8,10 @@ declare(strict_types=1); namespace OCP\Config; +use OCP\AppFramework\Attribute\Listenable; use OCP\EventDispatcher\Event; -/** - * @since 25.0.0 - */ +#[Listenable(since: '25.0.0')] class BeforePreferenceDeletedEvent extends Event { protected string $userId; protected string $appId; diff --git a/lib/public/Config/BeforePreferenceSetEvent.php b/lib/public/Config/BeforePreferenceSetEvent.php index c5abb8429a8..6534e4ae371 100644 --- a/lib/public/Config/BeforePreferenceSetEvent.php +++ b/lib/public/Config/BeforePreferenceSetEvent.php @@ -8,11 +8,10 @@ declare(strict_types=1); namespace OCP\Config; +use OCP\AppFramework\Attribute\Listenable; use OCP\EventDispatcher\Event; -/** - * @since 25.0.0 - */ +#[Listenable(since: '25.0.0')] class BeforePreferenceSetEvent extends Event { protected string $userId; protected string $appId; diff --git a/lib/public/Config/Exceptions/IncorrectTypeException.php b/lib/public/Config/Exceptions/IncorrectTypeException.php index 33c545c7eea..dea33233bfe 100644 --- a/lib/public/Config/Exceptions/IncorrectTypeException.php +++ b/lib/public/Config/Exceptions/IncorrectTypeException.php @@ -9,9 +9,8 @@ declare(strict_types=1); namespace OCP\Config\Exceptions; use Exception; +use OCP\AppFramework\Attribute\Throwable; -/** - * @since 32.0.0 - */ +#[Throwable(since: '32.0.0')] class IncorrectTypeException extends Exception { } diff --git a/lib/public/Config/Exceptions/TypeConflictException.php b/lib/public/Config/Exceptions/TypeConflictException.php index 4b63bb0a763..c78602180e0 100644 --- a/lib/public/Config/Exceptions/TypeConflictException.php +++ b/lib/public/Config/Exceptions/TypeConflictException.php @@ -9,9 +9,8 @@ declare(strict_types=1); namespace OCP\Config\Exceptions; use Exception; +use OCP\AppFramework\Attribute\Throwable; -/** - * @since 32.0.0 - */ +#[Throwable(since: '32.0.0')] class TypeConflictException extends Exception { } diff --git a/lib/public/Config/Exceptions/UnknownKeyException.php b/lib/public/Config/Exceptions/UnknownKeyException.php index 39da4d43d95..beca4c496a2 100644 --- a/lib/public/Config/Exceptions/UnknownKeyException.php +++ b/lib/public/Config/Exceptions/UnknownKeyException.php @@ -9,9 +9,8 @@ declare(strict_types=1); namespace OCP\Config\Exceptions; use Exception; +use OCP\AppFramework\Attribute\Throwable; -/** - * @since 32.0.0 - */ +#[Throwable(since: '32.0.0')] class UnknownKeyException extends Exception { } diff --git a/lib/public/Config/IUserConfig.php b/lib/public/Config/IUserConfig.php index 1179db2671f..cb42608ea75 100644 --- a/lib/public/Config/IUserConfig.php +++ b/lib/public/Config/IUserConfig.php @@ -27,8 +27,6 @@ use OCP\Config\Exceptions\UnknownKeyException; * Similarly, some methods from this class are marked with a warning about ignoring * lazy loading. Use them wisely and only on parts of the code that are called * during specific requests or actions to avoid loading the lazy values all the time. - * - * @since 32.0.0 */ #[Consumable(since: '32.0.0')] interface IUserConfig { diff --git a/lib/public/Config/Lexicon/Entry.php b/lib/public/Config/Lexicon/Entry.php index 95dae44ed11..c810522dde5 100644 --- a/lib/public/Config/Lexicon/Entry.php +++ b/lib/public/Config/Lexicon/Entry.php @@ -9,29 +9,34 @@ declare(strict_types=1); namespace OCP\Config\Lexicon; use Closure; +use OCP\AppFramework\Attribute\Consumable; use OCP\Config\ValueType; /** * Model that represent config values within an app config lexicon. * * @see ILexicon - * @since 32.0.0 */ +#[Consumable(since: '32.0.0')] class Entry { /** @since 32.0.0 */ public const RENAME_INVERT_BOOLEAN = 1; private string $definition = ''; + private string $note = ''; private ?string $default = null; /** - * @param string $key config key, can only contain alphanumerical chars and -._ + * @param string $key config key; can only contain alphanumerical chars and underscore "_" * @param ValueType $type type of config value + * @param string|int|float|bool|array|Closure|null $defaultRaw default value to be used in case none known * @param string $definition optional description of config key available when using occ command * @param bool $lazy set config value as lazy * @param int $flags set flags - * @param string|null $rename previous config key to migrate config value from * @param bool $deprecated set config key as deprecated + * @param string|null $rename source in case of a rename of a config key. + * @param int $options additional bitflag options {@see self::RENAME_INVERT_BOOLEAN} + * @param string $note additional note and warning related to the use of the config key. * * @since 32.0.0 * @psalm-suppress PossiblyInvalidCast @@ -47,6 +52,7 @@ class Entry { private readonly bool $deprecated = false, private readonly ?string $rename = null, private readonly int $options = 0, + string $note = '', ) { // key can only contain alphanumeric chars and underscore "_" if (preg_match('/[^[:alnum:]_]/', $key)) { @@ -56,6 +62,7 @@ class Entry { /** @psalm-suppress UndefinedClass */ if (\OC::$CLI) { // only store definition if ran from CLI $this->definition = $definition; + $this->note = $note; } } @@ -187,6 +194,16 @@ class Entry { } /** + * returns eventual note + * + * @return string + * @since 32.0.0 + */ + public function getNote(): string { + return $this->note; + } + + /** * returns if config key is set as lazy * * @see IAppConfig for details on lazy config values diff --git a/lib/public/Config/Lexicon/ILexicon.php b/lib/public/Config/Lexicon/ILexicon.php index 1dde23714cb..05bf5967f24 100644 --- a/lib/public/Config/Lexicon/ILexicon.php +++ b/lib/public/Config/Lexicon/ILexicon.php @@ -8,16 +8,12 @@ declare(strict_types=1); namespace OCP\Config\Lexicon; -use OCP\AppFramework\Attribute\Consumable; use OCP\AppFramework\Attribute\Implementable; /** * This interface needs to be implemented if you want to define a config lexicon for your application * The config lexicon is used to avoid conflicts and problems when storing/retrieving config values - * - * @since 32.0.0 */ -#[Consumable(since: '32.0.0')] #[Implementable(since: '32.0.0')] interface ILexicon { diff --git a/lib/public/Config/Lexicon/Preset.php b/lib/public/Config/Lexicon/Preset.php index ba0fb66dd3b..6dac8736131 100644 --- a/lib/public/Config/Lexicon/Preset.php +++ b/lib/public/Config/Lexicon/Preset.php @@ -8,6 +8,8 @@ declare(strict_types=1); namespace OCP\Config\Lexicon; +use OCP\AppFramework\Attribute\Consumable; + /** * list of preset to handle the default behavior of the instance * @@ -22,9 +24,8 @@ namespace OCP\Config\Lexicon; * - **Preset::CLUB** - Club/Association * - **Preset::FAMILY** - Family * - **Preset::PRIVATE** - Private - * - * @since 32.0.0 */ +#[Consumable(since: '32.0.0')] enum Preset: int { /** @since 32.0.0 */ case LARGE = 9; diff --git a/lib/public/Config/Lexicon/Strictness.php b/lib/public/Config/Lexicon/Strictness.php index 48e96bfc91c..8136499cb3e 100644 --- a/lib/public/Config/Lexicon/Strictness.php +++ b/lib/public/Config/Lexicon/Strictness.php @@ -8,6 +8,8 @@ declare(strict_types=1); namespace OCP\Config\Lexicon; +use OCP\AppFramework\Attribute\Consumable; + /** * Strictness regarding using not-listed config keys * @@ -15,9 +17,8 @@ namespace OCP\Config\Lexicon; * - **Strictness::NOTICE** - ignore and report * - **Strictness::WARNING** - silently block (returns $default) and report * - **Strictness::EXCEPTION** - block (throws exception) and report - * - * @since 32.0.0 */ +#[Consumable(since: '32.0.0')] enum Strictness { /** @since 32.0.0 */ case IGNORE; // fully ignore diff --git a/lib/public/Config/ValueType.php b/lib/public/Config/ValueType.php index a622c671898..32c734af32b 100644 --- a/lib/public/Config/ValueType.php +++ b/lib/public/Config/ValueType.php @@ -8,15 +8,15 @@ declare(strict_types=1); namespace OCP\Config; +use OCP\AppFramework\Attribute\Consumable; use OCP\Config\Exceptions\IncorrectTypeException; use OCP\IAppConfig; use UnhandledMatchError; /** * Listing of available value type for typed config value - * - * @since 32.0.0 */ +#[Consumable(since: '32.0.0')] enum ValueType: int { /** * @since 32.0.0 diff --git a/lib/public/Federation/ICloudIdManager.php b/lib/public/Federation/ICloudIdManager.php index 03b6ced18f5..29e261ab3af 100644 --- a/lib/public/Federation/ICloudIdManager.php +++ b/lib/public/Federation/ICloudIdManager.php @@ -8,11 +8,14 @@ declare(strict_types=1); */ namespace OCP\Federation; +use OCP\AppFramework\Attribute\Consumable; + /** * Interface for resolving federated cloud ids * * @since 12.0.0 */ +#[Consumable(since: '12.0.0')] interface ICloudIdManager { /** * @param string $cloudId @@ -55,4 +58,28 @@ interface ICloudIdManager { * @since 30.0.0 - Optional parameter $httpsOnly was added */ public function removeProtocolFromUrl(string $url, bool $httpsOnly = false): string; + + /** + * @param string $id The remote cloud id + * @param string $user The user id on the remote server + * @param string $remote The base address of the remote server + * @param ?string $displayName The displayname of the remote user + * + * @since 32.0.0 + */ + public function createCloudId(string $id, string $user, string $remote, ?string $displayName = null): ICloudId; + + /** + * @param $resolver The cloud id resolver to register + * + * @since 32.0.0 + */ + public function registerCloudIdResolver(ICloudIdResolver $resolver): void; + + /** + * @param $resolver The cloud id resolver to unregister + * + * @since 32.0.0 + */ + public function unregisterCloudIdResolver(ICloudIdResolver $resolver): void; } diff --git a/lib/public/Federation/ICloudIdResolver.php b/lib/public/Federation/ICloudIdResolver.php new file mode 100644 index 00000000000..79f9ed11dd7 --- /dev/null +++ b/lib/public/Federation/ICloudIdResolver.php @@ -0,0 +1,40 @@ +<?php + +declare(strict_types=1); + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ +namespace OCP\Federation; + +use OCP\AppFramework\Attribute\Consumable; +use OCP\AppFramework\Attribute\Implementable; + +/** + * Interface for resolving federated cloud ids + * + * @since 32.0.0 + */ +#[Consumable(since: '32.0.0')] +#[Implementable(since: '32.0.0')] +interface ICloudIdResolver { + /** + * @param string $cloudId + * @return ICloudId + * @throws \InvalidArgumentException + * + * @since 32.0.0 + */ + public function resolveCloudId(string $cloudId): ICloudId; + + /** + * Check if the input is a correctly formatted cloud id + * + * @param string $cloudId + * @return bool + * + * @since 32.0.0 + */ + public function isValidCloudId(string $cloudId): bool; +} diff --git a/lib/public/IAppConfig.php b/lib/public/IAppConfig.php index 68d4332146e..d9e3e0d95a7 100644 --- a/lib/public/IAppConfig.php +++ b/lib/public/IAppConfig.php @@ -8,6 +8,7 @@ declare(strict_types=1); */ namespace OCP; +use OCP\Config\ValueType; use OCP\Exceptions\AppConfigUnknownKeyException; /** @@ -450,6 +451,33 @@ interface IAppConfig { public function getDetails(string $app, string $key): array; /** + * returns an array containing details about a config key. + * key/value pair are available only if it exists. + * + * ``` + * [ + * "app" => "myapp", + * "key" => "mykey", + * "value" => "current_value", + * "default" => "default_if_available", + * "definition" => "this is what it does", + * "note" => "enabling this is not compatible with that", + * "lazy" => false, + * "type" => 4, + * "typeString" => "string", + * 'sensitive' => false + * ] + * ``` + * + * @param string $app id of the app + * @param string $key config key + * + * @return array{app: string, key: string, lazy?: bool, valueType?: ValueType, valueTypeName?: string, sensitive?: bool, default?: string, definition?: string, note?: string} + * @since 32.0.0 + */ + public function getKeyDetails(string $app, string $key): array; + + /** * Convert string like 'string', 'integer', 'float', 'bool' or 'array' to * to bitflag {@see VALUE_STRING}, {@see VALUE_INT}, {@see VALUE_FLOAT}, * {@see VALUE_BOOL} and {@see VALUE_ARRAY} diff --git a/lib/public/Share/IShare.php b/lib/public/Share/IShare.php index 5d8c64e1314..a1bdb01fcd2 100644 --- a/lib/public/Share/IShare.php +++ b/lib/public/Share/IShare.php @@ -530,6 +530,20 @@ interface IShare { public function getToken(); /** + * Set the parent of this share + * + * @since 9.0.0 + */ + public function setParent(int $parent): self; + + /** + * Get the parent of this share. + * + * @since 9.0.0 + */ + public function getParent(): ?int; + + /** * Set the target path of this share relative to the recipients user folder. * * @param string $target diff --git a/lib/public/Share/IShareProvider.php b/lib/public/Share/IShareProvider.php index 9d7c8013a36..23187ca833e 100644 --- a/lib/public/Share/IShareProvider.php +++ b/lib/public/Share/IShareProvider.php @@ -208,4 +208,12 @@ interface IShareProvider { * @since 18.0.0 */ public function getAllShares(): iterable; + + /** + * Get all children of this share + * + * @return IShare[] + * @since 9.0.0 + */ + public function getChildren(IShare $parent); } |