-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b8a7df2
Showing
13 changed files
with
492 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* Copyright © MageSpecialist - Skeeller srl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api; | ||
|
||
/** | ||
* Interface AdapterInterface | ||
* @package MSP\NotifierApi\Api | ||
* @api | ||
*/ | ||
interface AdapterInterface | ||
{ | ||
/** | ||
* Get adapter code | ||
* @return string | ||
*/ | ||
public function getCode(): string; | ||
|
||
/** | ||
* Get adapter description | ||
* @return string | ||
*/ | ||
public function getDescription(): string; | ||
|
||
/** | ||
* Validate message without sending it. Return true on success, throws exception on failure. | ||
* @param string $message | ||
* @return bool | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function validateMessage(string $message): bool; | ||
|
||
/** | ||
* Validate message without sending it. Return true on success, throws exception on failure. | ||
* @param array $params | ||
* @return bool | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function validateParams(array $params = []): bool; | ||
|
||
/** | ||
* Send message to adapter. Return true on success, throws exception on failure. | ||
* @param string $message | ||
* @param array $params | ||
* @return bool | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function sendMessage(string $message, array $params = []): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © MageSpecialist - Skeeller srl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api; | ||
|
||
/** | ||
* Interface AdapterRepositoryInterface | ||
* @package MSP\NotifierApi\Api | ||
* @api | ||
*/ | ||
interface AdapterRepositoryInterface | ||
{ | ||
/** | ||
* Get adapters list | ||
* @return \MSP\NotifierApi\Api\AdapterInterface[] | ||
*/ | ||
public function getAdapters(): array; | ||
|
||
/** | ||
* Get adapter by code | ||
* @param string $code | ||
* @return \MSP\NotifierApi\Api\AdapterInterface | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
*/ | ||
public function getAdapterByCode(string $code): \MSP\NotifierApi\Api\AdapterInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* Automatically created by MageSpecialist CodeMonkey | ||
* https://github.com/magespecialist/m2-MSP_CodeMonkey | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api; | ||
|
||
/** | ||
* @SuppressWarnings(PHPMD.ShortVariable) | ||
*/ | ||
interface ChannelRepositoryInterface | ||
{ | ||
/** | ||
* Save Channel | ||
* @param \MSP\NotifierApi\Api\Data\ChannelInterface $channel | ||
* @return int | ||
*/ | ||
public function save(\MSP\NotifierApi\Api\Data\ChannelInterface $channel): int; | ||
|
||
/** | ||
* Get Channel by id | ||
* @param int $channelIid | ||
* @return \MSP\NotifierApi\Api\Data\ChannelInterface | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
*/ | ||
public function get(int $channelIid): \MSP\NotifierApi\Api\Data\ChannelInterface; | ||
|
||
/** | ||
* Get Channel by code | ||
* @param string $code | ||
* @return \MSP\NotifierApi\Api\Data\ChannelInterface | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
*/ | ||
public function getByCode(string $code): \MSP\NotifierApi\Api\Data\ChannelInterface; | ||
|
||
/** | ||
* Delete Channel | ||
* @param int $channelIid | ||
* @return void | ||
*/ | ||
public function deleteById(int $channelIid); | ||
|
||
/** | ||
* Get a list of Channel | ||
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria | ||
* @return \MSP\NotifierApi\Api\ChannelSearchResultsInterface | ||
*/ | ||
public function getList( | ||
\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null | ||
): \MSP\NotifierApi\Api\ChannelSearchResultsInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* Automatically created by MageSpecialist CodeMonkey | ||
* https://github.com/magespecialist/m2-MSP_CodeMonkey | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api; | ||
|
||
interface ChannelSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface | ||
{ | ||
/** | ||
* Get an array of objects | ||
* @return \MSP\NotifierApi\Api\Data\ChannelInterface[] | ||
*/ | ||
public function getItems(); | ||
|
||
/** | ||
* Set objects list | ||
* @param \MSP\NotifierApi\Api\Data\ChannelInterface[] $items | ||
* @return $this | ||
*/ | ||
public function setItems(array $items); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
/** | ||
* Automatically created by MageSpecialist CodeMonkey | ||
* https://github.com/magespecialist/m2-MSP_CodeMonkey | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api\Data; | ||
|
||
use Magento\Framework\Api\ExtensibleDataInterface; | ||
|
||
interface ChannelInterface extends ExtensibleDataInterface | ||
{ | ||
const ID = 'channel_id'; | ||
const NAME = 'name'; | ||
const ADAPTER_CODE = 'adapter_code'; | ||
const CODE = 'code'; | ||
const ENABLED = 'enabled'; | ||
const CONFIGURATION_JSON = 'configuration_json'; | ||
|
||
/** | ||
* Get value for channel_id | ||
* @return int | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* Set value for channel_id | ||
* @param int $value | ||
* @return void | ||
*/ | ||
public function setId($value); | ||
|
||
/** | ||
* Get value for name | ||
* @return string | ||
*/ | ||
public function getName(); | ||
|
||
/** | ||
* Set value for name | ||
* @param string $value | ||
* @return void | ||
*/ | ||
public function setName($value); | ||
|
||
/** | ||
* Get value for code | ||
* @return string | ||
*/ | ||
public function getCode(); | ||
|
||
/** | ||
* Set value for code | ||
* @param string $value | ||
* @return void | ||
*/ | ||
public function setCode($value); | ||
|
||
/** | ||
* Get value for adapter_code | ||
* @return string | ||
*/ | ||
public function getAdapterCode(); | ||
|
||
/** | ||
* Set value for adapter_code | ||
* @param string $value | ||
* @return void | ||
*/ | ||
public function setAdapterCode($value); | ||
|
||
/** | ||
* Get value for enabled | ||
* @return bool | ||
*/ | ||
public function getEnabled(); | ||
|
||
/** | ||
* Set value for enabled | ||
* @param bool $value | ||
* @return void | ||
*/ | ||
public function setEnabled($value); | ||
|
||
/** | ||
* Get value for configuration_json | ||
* @return string | ||
*/ | ||
public function getConfigurationJson(); | ||
|
||
/** | ||
* Set value for configuration_json | ||
* @param string $value | ||
* @return void | ||
*/ | ||
public function setConfigurationJson($value); | ||
|
||
/** | ||
* Retrieve existing extension attributes object or create a new one | ||
* @return \MSP\NotifierApi\Api\Data\ChannelExtensionInterface|null | ||
*/ | ||
public function getExtensionAttributes(); | ||
|
||
/** | ||
* Set an extension attributes object | ||
* @param \MSP\NotifierApi\Api\Data\ChannelExtensionInterface $extensionAttributes | ||
* @return $this | ||
*/ | ||
public function setExtensionAttributes( | ||
\MSP\NotifierApi\Api\Data\ChannelExtensionInterface $extensionAttributes | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Copyright © MageSpecialist - Skeeller srl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api; | ||
|
||
/** | ||
* Interface AdapterInterface | ||
* @package MSP\NotifierApi\Api | ||
* @api | ||
*/ | ||
interface IsEnabledInterface | ||
{ | ||
/** | ||
* Return true if module is enabled | ||
* @return bool | ||
*/ | ||
public function execute(): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Copyright © MageSpecialist - Skeeller srl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MSP\NotifierApi\Api; | ||
|
||
/** | ||
* Interface SendMessageInterface | ||
* @package MSP\NotifierApi\Api | ||
* @api | ||
*/ | ||
interface SendMessageInterface | ||
{ | ||
/** | ||
* Send a message, return true, Exception on failure | ||
* @param string $channelCode | ||
* @param string $message | ||
* @return bool | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function execute(string $channelCode, string $message): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* MageSpecialist | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @copyright Copyright (c) 2018 Skeeller srl (http://www.magespecialist.it) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "msp/module-notifier-api", | ||
"description": "Multiple channel notifier engine for Magento 2 API", | ||
"require": { | ||
"php": "^7.0|^7.1|^7.2" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Riccardo Tempesta", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Giacomo Mirabassi", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"type": "magento2-module", | ||
"license": "OSL-3.0", | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"MSP\\NotifierApi\\": "" | ||
} | ||
} | ||
} |
Oops, something went wrong.