Files
MokoSuiteCross/source/packages/com_mokosuitecross/src/Service/MokoSuiteCrossServiceInterface.php
T
Jonathan Miller 27505f7501 fix: rename all MOKOJOOMCROSS language keys and events to MOKOSUITECROSS (#128, #138)
Completes the MokoJoomCross → MokoSuiteCross rebrand across all language
string keys, Joomla event names, documentation, and wiki pages.

- 1,151 language key references renamed (COM_, PLG_, PKG_ prefixes)
- Event names renamed (onMokoJoomCross* → onMokoSuiteCross*)
- CLAUDE.md, CHANGELOG.md, wiki docs updated
- Zero mokojoomcross references remaining in codebase

Closes #128, closes #138
2026-06-21 17:23:02 -05:00

85 lines
2.6 KiB
PHP

<?php
/**
* @package MokoSuiteCross
* @subpackage com_mokosuitecross
* @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE
* SPDX-License-Identifier: GPL-3.0-or-later
*/
namespace Joomla\Component\MokoSuiteCross\Administrator\Service;
defined('_JEXEC') or die;
/**
* Interface that all MokoSuiteCross service plugins must implement.
*
* Service plugins in the `mokosuitecross` plugin group register themselves
* by implementing this interface. The system plugin dispatches cross-post
* requests to all enabled service plugins via this contract.
*/
interface MokoSuiteCrossServiceInterface
{
/**
* Get the unique service type identifier.
*
* @return string e.g. 'facebook', 'twitter', 'telegram'
*/
public function getServiceType(): string;
/**
* Get the human-readable service name.
*
* @return string e.g. 'Facebook', 'X / Twitter', 'Telegram'
*/
public function getServiceName(): string;
/**
* Publish content to this service.
*
* @param string $message The rendered message to post
* @param array $media Array of media URLs to attach
* @param array $credentials Decrypted credentials for this service
* @param array $params Service-specific parameters
*
* @return array ['success' => bool, 'platform_post_id' => string, 'response' => array]
*/
public function publish(string $message, array $media, array $credentials, array $params): array;
/**
* Validate that the provided credentials are working.
*
* @param array $credentials Decrypted credentials
*
* @return array ['valid' => bool, 'message' => string, 'account_name' => string]
*/
public function validateCredentials(array $credentials): array;
/**
* Get the maximum message length for this platform.
*
* @return int Maximum characters (0 = no limit)
*/
public function getMaxLength(): int;
/**
* Whether this service supports media attachments.
*
* @return bool
*/
public function supportsMedia(): bool;
/**
* Get the media types this service supports.
*
* Return an array of supported types: 'image', 'video', 'gif', 'document'.
* Services that return an empty array are text-only.
* Default implementation returns ['image'] if supportsMedia() is true.
*
* @return string[] e.g. ['image', 'video', 'gif']
*/
public function getSupportedMediaTypes(): array;
}