-
Notifications
You must be signed in to change notification settings - Fork 4
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
Willem Poortman
committed
Oct 19, 2020
0 parents
commit 13d1f89
Showing
105 changed files
with
8,604 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,76 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, nationality, personal | ||
appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see | ||
https://www.contributor-covenant.org/faq |
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,15 @@ | ||
Contributing | ||
==================== | ||
Contributions are welcome, and are accepted via pull requests. | ||
Please review these guidelines before submitting any pull requests. | ||
|
||
## Process | ||
1. Fork the project | ||
1. Create a new branch | ||
1. Code, test, commit and push | ||
1. Open a pull request detailing your changes. Make sure to follow the [template](.github/PULL_REQUEST_TEMPLATE.md) | ||
|
||
## Guidelines | ||
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful. | ||
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts. | ||
* Please remember that we follow [SemVer](http://semver.org/). |
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,33 @@ | ||
<!--- | ||
To help process this issue we recommend that you add the following information: | ||
- Summary of the issue, | ||
- Information on your environment, | ||
- Steps to reproduce, | ||
- Expected and actual results, | ||
Fields marked with (*) are required. Please don't remove the template. | ||
--> | ||
|
||
### Preconditions (*) | ||
<!--- | ||
Please provide as detailed information about your environment as possible. | ||
For example Magento version, tag, HEAD, PHP & MySQL version, etc.. | ||
--> | ||
1. | ||
2. | ||
|
||
### Steps to reproduce (*) | ||
<!--- | ||
It is important to provide a set of clear steps to reproduce this bug. | ||
If relevant please include code samples | ||
--> | ||
1. | ||
2. | ||
3. | ||
|
||
### Expected result (*) | ||
<!--- Tell us what should happen --> | ||
1. [Screenshots, logs or description] | ||
|
||
### Actual result (*) | ||
<!--- Tell us what happens instead --> | ||
1. [Screenshots, logs or description] |
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,35 @@ | ||
<!--- | ||
To help process this pull request we recommend that you add the following information: | ||
- Summary of the pull request, | ||
- Issue(s) related to the changes made, | ||
Fields marked with (*) are required. Please don't remove the template. | ||
--> | ||
|
||
<!--- Please provide a general summary of the Pull Request in the Title above --> | ||
|
||
### Description (*) | ||
<!--- | ||
Please provide a description of the changes proposed in the pull request. | ||
Letting us know what has changed and why it needed changing will help us validate this pull request. | ||
--> | ||
|
||
### Related Pull Requests | ||
<!-- related pull request placeholder --> | ||
|
||
### Manual testing scenarios (*) | ||
<!--- | ||
Please provide a set of unambiguous steps to test the proposed code change. | ||
Giving us manual testing scenarios will help with the processing and validation process. | ||
--> | ||
1. ... | ||
2. ... | ||
|
||
### Questions or comments | ||
<!--- | ||
If relevant, here you can ask questions or provide comments on your pull request for the reviewer | ||
For example if you need assistance with writing tests or would like some feedback on one of your development ideas | ||
--> | ||
|
||
### Contribution checklist (*) | ||
- [ ] Pull request has a meaningful description of its purpose | ||
- [ ] All commits are accompanied by meaningful commit messages |
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,159 @@ | ||
<?php | ||
/** | ||
* @author MageHook <[email protected]> | ||
* @package MageHook_Hook | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MageHook\Hook\Api\Data; | ||
|
||
use Magento\Framework\Api\ExtensibleDataInterface; | ||
|
||
/** | ||
* Interface WebhookInterface | ||
* | ||
* @package MageHook\Hook\Api\Data | ||
* | ||
* @api | ||
*/ | ||
interface WebhookInterface extends ExtensibleDataInterface | ||
{ | ||
/** | ||
* Table Columns. | ||
*/ | ||
public const ID = 'id'; | ||
public const CREATED_AT = 'created_at'; | ||
public const DEPLOYMENT_MODE = 'deployment_mode'; | ||
public const TYPE = 'type'; | ||
public const IS_ACTIVE = 'is_active'; | ||
public const NAME = 'name'; | ||
public const EVENT = 'event'; | ||
public const URL = 'url'; | ||
public const COMMENT = 'comment'; | ||
public const QUERY_DATA = 'query_data'; | ||
public const ONLY_SIGNAL = 'only_signal'; | ||
public const CUSTOM_OPTIONS = 'custom_options'; | ||
|
||
public const STATUS_INACTIVE = 0; | ||
public const STATUS_ACTIVE = 1; | ||
public const STATUS_CONCEPT = 2; | ||
|
||
/** | ||
* @return null|string|int | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getCreatedAt(): int; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDeploymentMode(): string; | ||
|
||
/** | ||
* @param string $string | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setDeploymentMode($string): self; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getIsActive(): int; | ||
|
||
/** | ||
* @param int $status | ||
* | ||
* @return $this | ||
*/ | ||
public function setIsActive(int $status): self; | ||
|
||
/** | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setIsNotActive(): self; | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isActive(): bool; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string; | ||
|
||
/** | ||
* @param string $string | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setName($string): self; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getEvent(): string; | ||
|
||
/** | ||
* @param $string | ||
* @param bool $validate | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setEvent($string, $validate = false): self; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUrl(): string; | ||
|
||
/** | ||
* @param $string | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setUrl($string): self; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getQueryData(): array; | ||
|
||
/** | ||
* @param $data | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setQueryData($data): self; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getCustomOptions(): array; | ||
|
||
/** | ||
* @param array $options | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setCustomOptions(array $options): self; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getOnlySignal(): int; | ||
|
||
/** | ||
* @param $int | ||
* | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function setOnlySignal($int): self; | ||
} |
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,70 @@ | ||
<?php | ||
/** | ||
* @author MageHook <[email protected]> | ||
* @package MageHook_Hook | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MageHook\Hook\Api; | ||
|
||
use MageHook\Hook\Api\Data\WebhookInterface; | ||
use Magento\Framework\Api\SearchCriteriaInterface; | ||
use Magento\Framework\Api\SearchResultsInterface; | ||
|
||
/** | ||
* Interface WebhookRepositoryInterface | ||
* | ||
* @package MageHook\Hook\Api | ||
* | ||
* @api | ||
*/ | ||
interface WebhookRepositoryInterface | ||
{ | ||
public const TYPE_ADMINHTML = 'adminhtml'; | ||
|
||
/** | ||
* Get a webhook. | ||
* | ||
* @param int|string $id | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface | ||
*/ | ||
public function get($id): WebhookInterface; | ||
|
||
/** | ||
* Save webhook. | ||
* | ||
* @param \MageHook\Hook\Api\Data\WebhookInterface $statistics | ||
* @throws \Magento\Framework\Exception\CouldNotSaveException | ||
* @return \MageHook\Hook\Api\Data\WebhookInterface|\MageHook\Hook\Model\ResourceModel\Webhook | ||
*/ | ||
public function save(WebhookInterface $statistics); | ||
|
||
/** | ||
* Get all available webhooks. | ||
* | ||
* @param \Magento\Framework\Api\SearchCriteriaInterface $criteria | ||
* @return \Magento\Framework\Api\SearchResultsInterface | ||
*/ | ||
public function getList(SearchCriteriaInterface $criteria): SearchResultsInterface; | ||
|
||
/** | ||
* Get all available webhooks by type. | ||
* | ||
* @param $name | ||
* @param string $type | ||
* @return \Magento\Framework\Api\SearchResultsInterface | ||
*/ | ||
public function getListByName($name, $type = self::TYPE_ADMINHTML): SearchResultsInterface; | ||
|
||
/** | ||
* Delete a webhook. | ||
* | ||
* @param \MageHook\Hook\Api\Data\WebhookInterface $webhook | ||
* @throws \Magento\Framework\Exception\CouldNotDeleteException | ||
* @return mixed | ||
*/ | ||
public function delete(WebhookInterface $webhook); | ||
} |
Oops, something went wrong.