migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,115 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl>
*
* @author Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Activity;
/**
* @since 20.0.0
*/
abstract class ActivitySettings implements ISetting {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 20.0.0
*/
abstract public function getIdentifier();
/**
* @return string A translated string
* @since 20.0.0
*/
abstract public function getName();
/**
* @return string Lowercase a-z and underscore only group identifier
* @since 20.0.0
*/
abstract public function getGroupIdentifier();
/**
* @return string A translated string for the settings group
* @since 20.0.0
*/
abstract public function getGroupName();
/**
* @return int whether the filter should be rather on the top or bottom of
* the admin section. The filters are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* @since 20.0.0
*/
abstract public function getPriority();
/**
* @return bool True when the option can be changed for the mail
* @since 20.0.0
*/
public function canChangeMail() {
return true;
}
/**
* @return bool True when the option can be changed for the notification
* @since 20.0.0
*/
public function canChangeNotification() {
return true;
}
/**
* @return bool Whether or not an activity email should be send by default
* @since 20.0.0
*/
public function isDefaultEnabledMail() {
return false;
}
/**
* @return bool Whether or not an activity notification should be send by default
* @since 20.0.0
*/
public function isDefaultEnabledNotification() {
return $this->isDefaultEnabledMail() && !$this->canChangeMail();
}
/**
* Left in for backwards compatibility
*
* @return bool
* @since 20.0.0
*/
public function canChangeStream() {
return false;
}
/**
* Left in for backwards compatibility
*
* @return bool
* @since 20.0.0
*/
public function isDefaultEnabledStream() {
return true;
}
}
@@ -0,0 +1,43 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
// use OCP namespace for all classes that are considered public.
// This means that they should be used by apps instead of the internal ownCloud classes
namespace OCP\Activity;
/**
* Interface IConsumer
*
* @since 6.0.0
*/
interface IConsumer {
/**
* @param IEvent $event
* @return null
* @since 6.0.0
* @since 8.2.0 Replaced the parameters with an IEvent object
*/
public function receive(IEvent $event);
}
+372
View File
@@ -0,0 +1,372 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
// use OCP namespace for all classes that are considered public.
// This means that they should be used by apps instead of the internal ownCloud classes
namespace OCP\Activity;
/**
* Interface IEvent
*
* @since 8.2.0
*/
interface IEvent {
/**
* Set the app of the activity
*
* @param string $app
* @return IEvent
* @throws \InvalidArgumentException if the app id is invalid
* @since 8.2.0
*/
public function setApp(string $app): self;
/**
* Set the type of the activity
*
* @param string $type
* @return IEvent
* @throws \InvalidArgumentException if the type is invalid
* @since 8.2.0
*/
public function setType(string $type): self;
/**
* Set the affected user of the activity
*
* @param string $user
* @return IEvent
* @throws \InvalidArgumentException if the affected user is invalid
* @since 8.2.0
*/
public function setAffectedUser(string $user): self;
/**
* Set the author of the activity
*
* @param string $author
* @return IEvent
* @throws \InvalidArgumentException if the author is invalid
* @since 8.2.0
*/
public function setAuthor(string $author): self;
/**
* Set the author of the activity
*
* @param int $timestamp
* @return IEvent
* @throws \InvalidArgumentException if the timestamp is invalid
* @since 8.2.0
*/
public function setTimestamp(int $timestamp): self;
/**
* Set the subject of the activity
*
* @param string $subject
* @param array $parameters
* @return IEvent
* @throws \InvalidArgumentException if the subject or parameters are invalid
* @since 8.2.0
*/
public function setSubject(string $subject, array $parameters = []): self;
/**
* Set a parsed subject
*
* HTML is not allowed in the parsed subject and will be escaped
* automatically by the clients. You can use the RichObjectString system
* provided by the Nextcloud server to highlight important parameters via
* the setRichSubject method.
*
* See https://github.com/nextcloud/server/issues/1706 for more information.
*
* @param string $subject
* @return $this
* @throws \InvalidArgumentException if the subject is invalid
* @since 11.0.0
*/
public function setParsedSubject(string $subject): self;
/**
* @return string
* @since 11.0.0
*/
public function getParsedSubject(): string;
/**
* Set a RichObjectString subject
*
* HTML is not allowed in the rich subject and will be escaped automatically
* by the clients, but you can use the RichObjectString system provided by
* the Nextcloud server to highlight important parameters.
*
* See https://github.com/nextcloud/server/issues/1706 for more information.
*
* @param string $subject
* @param array $parameters
* @return $this
* @throws \InvalidArgumentException if the subject or parameters are invalid
* @since 11.0.0
*/
public function setRichSubject(string $subject, array $parameters = []): self;
/**
* @return string
* @since 11.0.0
*/
public function getRichSubject(): string;
/**
* @return array[]
* @since 11.0.0
*/
public function getRichSubjectParameters(): array;
/**
* Set the message of the activity
*
* @param string $message
* @param array $parameters
* @return IEvent
* @throws \InvalidArgumentException if the message or parameters are invalid
* @since 8.2.0
*/
public function setMessage(string $message, array $parameters = []): self;
/**
* Set a parsed message
*
* HTML is not allowed in the parsed message and will be escaped
* automatically by the clients. You can use the RichObjectString system
* provided by the Nextcloud server to highlight important parameters via
* the setRichMessage method.
*
* See https://github.com/nextcloud/server/issues/1706 for more information.
*
* @param string $message
* @return $this
* @throws \InvalidArgumentException if the message is invalid
* @since 11.0.0
*/
public function setParsedMessage(string $message): self;
/**
* @return string
* @since 11.0.0
*/
public function getParsedMessage(): string;
/**
* Set a RichObjectString message
*
* HTML is not allowed in the rich message and will be escaped automatically
* by the clients, but you can use the RichObjectString system provided by
* the Nextcloud server to highlight important parameters.
*
* See https://github.com/nextcloud/server/issues/1706 for more information.
*
* @param string $message
* @param array $parameters
* @return $this
* @throws \InvalidArgumentException if the message or parameters are invalid
* @since 11.0.0
*/
public function setRichMessage(string $message, array $parameters = []): self;
/**
* @return string
* @since 11.0.0
*/
public function getRichMessage(): string;
/**
* @return array[]
* @since 11.0.0
*/
public function getRichMessageParameters(): array;
/**
* Set the object of the activity
*
* @param string $objectType
* @param int $objectId
* @param string $objectName
* @return IEvent
* @throws \InvalidArgumentException if the object is invalid
* @since 8.2.0
*/
public function setObject(string $objectType, int $objectId, string $objectName = ''): self;
/**
* Set the link of the activity
*
* @param string $link
* @return IEvent
* @throws \InvalidArgumentException if the link is invalid
* @since 8.2.0
*/
public function setLink(string $link): self;
/**
* @return string
* @since 8.2.0
*/
public function getApp(): string;
/**
* @return string
* @since 8.2.0
*/
public function getType(): string;
/**
* @return string
* @since 8.2.0
*/
public function getAffectedUser(): string;
/**
* @return string
* @since 8.2.0
*/
public function getAuthor(): string;
/**
* @return int
* @since 8.2.0
*/
public function getTimestamp(): int;
/**
* @return string
* @since 8.2.0
*/
public function getSubject(): string;
/**
* @return array
* @since 8.2.0
*/
public function getSubjectParameters(): array;
/**
* @return string
* @since 8.2.0
*/
public function getMessage(): string;
/**
* @return array
* @since 8.2.0
*/
public function getMessageParameters(): array;
/**
* @return string
* @since 8.2.0
*/
public function getObjectType(): string;
/**
* @return int
* @since 8.2.0
*/
public function getObjectId(): int;
/**
* @return string
* @since 8.2.0
*/
public function getObjectName(): string;
/**
* @return string
* @since 8.2.0
*/
public function getLink(): string;
/**
* @param string $icon
* @return $this
* @throws \InvalidArgumentException if the icon is invalid
* @since 11.0.0
*/
public function setIcon(string $icon): self;
/**
* @return string
* @since 11.0.0
*/
public function getIcon(): string;
/**
* @param IEvent $child
* @return $this
* @since 11.0.0 - Since 15.0.0 returns $this
*/
public function setChildEvent(IEvent $child): self;
/**
* @return IEvent|null
* @since 11.0.0
*/
public function getChildEvent();
/**
* @return bool
* @since 11.0.0
*/
public function isValid(): bool;
/**
* @return bool
* @since 11.0.0
*/
public function isValidParsed(): bool;
/**
* Set whether or not a notification should be automatically generated for this activity.
*
* Set this to `false` if the app already generates a notification for the event.
*
* @param bool $generate
* @return IEvent
* @since 20.0.0
*/
public function setGenerateNotification(bool $generate): self;
/**
* whether or not a notification should be automatically generated for this activity.
*
* @return bool
* @since 20.0.0
*/
public function getGenerateNotification(): bool;
}
@@ -0,0 +1,61 @@
<?php
/**
* @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Activity;
/**
* Interface EventMerger
*
* @since 11.0
*/
interface IEventMerger {
/**
* Combines two events when possible to have grouping:
*
* Example1: Two events with subject '{user} created {file}' and
* $mergeParameter file with different file and same user will be merged
* to '{user} created {file1} and {file2}' and the childEvent on the return
* will be set, if the events have been merged.
*
* Example2: Two events with subject '{user} created {file}' and
* $mergeParameter file with same file and same user will be merged to
* '{user} created {file1}' and the childEvent on the return will be set, if
* the events have been merged.
*
* The following requirements have to be met, in order to be merged:
* - Both events need to have the same `getApp()`
* - Both events must not have a message `getMessage()`
* - Both events need to have the same subject `getSubject()`
* - Both events need to have the same object type `getObjectType()`
* - The time difference between both events must not be bigger then 3 hours
* - Only up to 5 events can be merged.
* - All parameters apart from such starting with $mergeParameter must be
* the same for both events.
*
* @param string $mergeParameter
* @param IEvent $event
* @param IEvent|null $previousEvent
* @return IEvent
* @since 11.0
*/
public function mergeEvents($mergeParameter, IEvent $event, IEvent $previousEvent = null);
}
@@ -0,0 +1,43 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Björn Schießle <bjoern@schiessle.org>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Activity;
/**
* Interface IExtension
*
* @since 8.0.0
*/
interface IExtension {
public const METHOD_STREAM = 'stream';
public const METHOD_MAIL = 'email';
public const METHOD_NOTIFICATION = 'notification';
public const PRIORITY_VERYLOW = 10;
public const PRIORITY_LOW = 20;
public const PRIORITY_MEDIUM = 30;
public const PRIORITY_HIGH = 40;
public const PRIORITY_VERYHIGH = 50;
}
@@ -0,0 +1,69 @@
<?php
/**
* @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Activity;
/**
* Interface IFilter
*
* @since 11.0.0
*/
interface IFilter {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
*/
public function getIdentifier();
/**
* @return string A translated string
* @since 11.0.0
*/
public function getName();
/**
* @return int whether the filter should be rather on the top or bottom of
* the admin section. The filters are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority();
/**
* @return string Full URL to an icon, empty string when none is given
* @since 11.0.0
*/
public function getIcon();
/**
* @param string[] $types
* @return string[] An array of allowed apps from which activities should be displayed
* @since 11.0.0
*/
public function filterTypes(array $types);
/**
* @return string[] An array of allowed apps from which activities should be displayed
* @since 11.0.0
*/
public function allowedApps();
}
@@ -0,0 +1,176 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Activity;
/**
* Interface IManager
*
* @since 6.0.0
*/
interface IManager {
/**
* Generates a new IEvent object
*
* Make sure to call at least the following methods before sending it to the
* app with via the publish() method:
* - setApp()
* - setType()
* - setAffectedUser()
* - setSubject()
* - setObject()
*
* @return IEvent
* @since 8.2.0
*/
public function generateEvent(): IEvent;
/**
* Publish an event to the activity consumers
*
* Make sure to call at least the following methods before sending an Event:
* - setApp()
* - setType()
* - setAffectedUser()
* - setSubject()
* - setObject()
*
* @param IEvent $event
* @throws \BadMethodCallException if required values have not been set
* @since 8.2.0
*/
public function publish(IEvent $event): void;
/**
* In order to improve lazy loading a closure can be registered which will be called in case
* activity consumers are actually requested
*
* $callable has to return an instance of \OCP\Activity\IConsumer
*
* @param \Closure $callable
* @since 6.0.0
*/
public function registerConsumer(\Closure $callable): void;
/**
* @param string $filter Class must implement OCA\Activity\IFilter
* @since 11.0.0
*/
public function registerFilter(string $filter): void;
/**
* @return IFilter[]
* @since 11.0.0
*/
public function getFilters(): array;
/**
* @param string $id
* @return IFilter
* @throws \InvalidArgumentException when the filter was not found
* @since 11.0.0
*/
public function getFilterById(string $id): IFilter;
/**
* @param string $setting Class must implement OCA\Activity\ISetting
* @since 11.0.0
*/
public function registerSetting(string $setting): void;
/**
* @return ActivitySettings[]
* @since 11.0.0
*/
public function getSettings(): array;
/**
* @param string $provider Class must implement OCA\Activity\IProvider
* @since 11.0.0
*/
public function registerProvider(string $provider): void;
/**
* @return IProvider[]
* @since 11.0.0
*/
public function getProviders(): array;
/**
* @param string $id
* @return ActivitySettings
* @throws \InvalidArgumentException when the setting was not found
* @since 11.0.0
*/
public function getSettingById(string $id): ActivitySettings;
/**
* @param string $type
* @param int $id
* @since 8.2.0
*/
public function setFormattingObject(string $type, int $id): void;
/**
* @return bool
* @since 8.2.0
*/
public function isFormattingFilteredObject(): bool;
/**
* @param bool $status Set to true, when parsing events should not use SVG icons
* @since 12.0.1
*/
public function setRequirePNG(bool $status): void;
/**
* @return bool
* @since 12.0.1
*/
public function getRequirePNG(): bool;
/**
* Set the user we need to use
*
* @param string|null $currentUserId
* @throws \UnexpectedValueException If the user is invalid
* @since 9.0.1
*/
public function setCurrentUserId(string $currentUserId = null): void;
/**
* Get the user we need to use
*
* Either the user is logged in, or we try to get it from the token
*
* @return string
* @throws \UnexpectedValueException If the token is invalid, does not exist or is not unique
* @since 8.1.0
*/
public function getCurrentUserId(): string;
}
@@ -0,0 +1,42 @@
<?php
/**
* @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Activity;
/**
* Interface IProvider
*
* @since 11.0.0
*/
interface IProvider {
/**
* @param string $language The language which should be used for translating, e.g. "en"
* @param IEvent $event The current event which should be parsed
* @param IEvent|null $previousEvent A potential previous event which you can combine with the current one.
* To do so, simply use setChildEvent($previousEvent) after setting the
* combined subject on the current event.
* @return IEvent
* @throws \InvalidArgumentException Should be thrown if your provider does not know this event
* @since 11.0.0
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null);
}
@@ -0,0 +1,74 @@
<?php
/**
* @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Activity;
/**
* Interface ISetting
*
* @since 11.0.0
*/
interface ISetting {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
*/
public function getIdentifier();
/**
* @return string A translated string
* @since 11.0.0
*/
public function getName();
/**
* @return int whether the filter should be rather on the top or bottom of
* the admin section. The filters are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority();
/**
* @return bool True when the option can be changed for the stream
* @since 11.0.0
*/
public function canChangeStream();
/**
* @return bool True when the option can be changed for the stream
* @since 11.0.0
*/
public function isDefaultEnabledStream();
/**
* @return bool True when the option can be changed for the mail
* @since 11.0.0
*/
public function canChangeMail();
/**
* @return bool True when the option can be changed for the stream
* @since 11.0.0
*/
public function isDefaultEnabledMail();
}