commit 208627be2d11a227dc4e331108a077ff8b7e325f Author: Llewellyn van der Merwe Date: Sat Apr 15 17:08:07 2023 +0200 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd240ce --- /dev/null +++ b/README.md @@ -0,0 +1,1252 @@ +``` +███████╗██╗ ██╗██████╗ ███████╗██████╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗ +███████║╚██████╔╝██║ ███████╗██║ ██║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ ███████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗██╔════╝ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝███████╗ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗╚════██║ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║███████║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝╚══════╝ +``` + +### What is JCB Super Powers? +The Joomla Component Builder (JCB) Super Power features are designed to enhance JCB's functionality and streamline the development process. These Super Powers enable developers to efficiently manage and share their custom powers across multiple JCB instances through repositories hosted on [https://git.vdm.dev/[username]/[repository-name]](https://git.vdm.dev). JCB Super Powers are managed using a combination of layers, events, tasks, methods, switches, and algorithms, which work together to provide powerful customization and extensibility options. More details on JCB Super Powers can be found in the [Super Powers Documentation](https://git.vdm.dev/joomla/super-powers/wiki). + +In summary, JCB Super Powers offer a flexible and efficient way to manage and share functionalities between JCB instances. By utilizing a sophisticated system of layers, events, tasks, methods, switches, and algorithms, developers can seamlessly integrate JCB core powers and their custom powers. For more information on how to work with JCB Super Powers, refer to the [Super Powers User Guide](https://git.vdm.dev/joomla/super-powers/wiki). + +### What can I find here? +This repository contains an index (see below) of all the approved powers within the JCB GUI. During the compilation of a component, these powers are automatically added to the repository, ensuring a well-organized and accessible collection of functionalities. + +# Index of powers + +- **Namespace**: [VDM\Joomla\Gitea](#vdm-joomla-gitea) + + - **abstract class Factory** | [Details](src/4612af84-5a42-4ea5-87bf-9d79cc19c330) | [Code](src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.php) | [Settings](src/4612af84-5a42-4ea5-87bf-9d79cc19c330/settings.json) | [4612af84-5a42-4ea5-87bf-9d79cc19c330](src/4612af84-5a42-4ea5-87bf-9d79cc19c330) + - **class Issue** | [Details](src/5c8f9038-d6e9-4788-96df-45019eafbadb) | [Code](src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.php) | [Settings](src/5c8f9038-d6e9-4788-96df-45019eafbadb/settings.json) | [5c8f9038-d6e9-4788-96df-45019eafbadb](src/5c8f9038-d6e9-4788-96df-45019eafbadb) + - **class Labels** | [Details](src/ca53d4cb-7800-4ea2-b06e-7466ded91e49) | [Code](src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.php) | [Settings](src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/settings.json) | [ca53d4cb-7800-4ea2-b06e-7466ded91e49](src/ca53d4cb-7800-4ea2-b06e-7466ded91e49) + - **class Notifications** | [Details](src/c8cbc9bd-ee91-403a-8633-0e8b59619a49) | [Code](src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.php) | [Settings](src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/settings.json) | [c8cbc9bd-ee91-403a-8633-0e8b59619a49](src/c8cbc9bd-ee91-403a-8633-0e8b59619a49) + - **class Organization** | [Details](src/8efd9070-7110-4b8e-bb76-cb1a286d5af2) | [Code](src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.php) | [Settings](src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/settings.json) | [8efd9070-7110-4b8e-bb76-cb1a286d5af2](src/8efd9070-7110-4b8e-bb76-cb1a286d5af2) + - **class Package** | [Details](src/b7ec675d-3197-4458-89d6-ca5d4303af8a) | [Code](src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.php) | [Settings](src/b7ec675d-3197-4458-89d6-ca5d4303af8a/settings.json) | [b7ec675d-3197-4458-89d6-ca5d4303af8a](src/b7ec675d-3197-4458-89d6-ca5d4303af8a) + - **class Repository** | [Details](src/eb6c050d-7100-42b8-a922-f7e7c78a08c2) | [Code](src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.php) | [Settings](src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/settings.json) | [eb6c050d-7100-42b8-a922-f7e7c78a08c2](src/eb6c050d-7100-42b8-a922-f7e7c78a08c2) + - **class User** | [Details](src/4a5694db-bf3c-439b-bf9c-36a487828787) | [Code](src/4a5694db-bf3c-439b-bf9c-36a487828787/code.php) | [Settings](src/4a5694db-bf3c-439b-bf9c-36a487828787/settings.json) | [4a5694db-bf3c-439b-bf9c-36a487828787](src/4a5694db-bf3c-439b-bf9c-36a487828787) +- **Namespace**: [VDM\Joomla\Componentbuilder\Service](#vdm-joomla-componentbuilder-service) + + - **class Gitea** | [Details](src/71acf8d6-32b8-4173-8277-eb9cda29fd64) | [Code](src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.php) | [Settings](src/71acf8d6-32b8-4173-8277-eb9cda29fd64/settings.json) | [71acf8d6-32b8-4173-8277-eb9cda29fd64](src/71acf8d6-32b8-4173-8277-eb9cda29fd64) +- **Namespace**: [VDM\Joomla\Gitea\Abstraction](#vdm-joomla-gitea-abstraction) + + - **abstract class Api** | [Details](src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469) | [Code](src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.php) | [Settings](src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/settings.json) | [3d7af7a2-dabe-4111-b5fd-c5bfa8755469](src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469) +- **Namespace**: [VDM\Joomla\Gitea\Admin](#vdm-joomla-gitea-admin) + + - **class Cron** | [Details](src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0) | [Code](src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.php) | [Settings](src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/settings.json) | [6e1a6731-2587-4ad5-8e70-ca83eba65ee0](src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0) + - **class Organizations** | [Details](src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0) | [Code](src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.php) | [Settings](src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/settings.json) | [5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0](src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0) + - **class Unadopted** | [Details](src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2) | [Code](src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.php) | [Settings](src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/settings.json) | [3aba9610-cb22-48e0-b2d7-2a9e708c82e2](src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2) + - **class Users** | [Details](src/e7c810a1-3d6a-42e4-b45f-bee554f259b3) | [Code](src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.php) | [Settings](src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/settings.json) | [e7c810a1-3d6a-42e4-b45f-bee554f259b3](src/e7c810a1-3d6a-42e4-b45f-bee554f259b3) +- **Namespace**: [VDM\Joomla\Gitea\Issue](#vdm-joomla-gitea-issue) + + - **class Comments** | [Details](src/22d65693-917d-47c7-ba5c-8e1f354dc713) | [Code](src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.php) | [Settings](src/22d65693-917d-47c7-ba5c-8e1f354dc713/settings.json) | [22d65693-917d-47c7-ba5c-8e1f354dc713](src/22d65693-917d-47c7-ba5c-8e1f354dc713) + - **class Deadline** | [Details](src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69) | [Code](src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.php) | [Settings](src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/settings.json) | [61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69](src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69) + - **class Labels** | [Details](src/e819d1a2-4390-432d-be36-3421f2fa861c) | [Code](src/e819d1a2-4390-432d-be36-3421f2fa861c/code.php) | [Settings](src/e819d1a2-4390-432d-be36-3421f2fa861c/settings.json) | [e819d1a2-4390-432d-be36-3421f2fa861c](src/e819d1a2-4390-432d-be36-3421f2fa861c) + - **class Milestones** | [Details](src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9) | [Code](src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.php) | [Settings](src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/settings.json) | [f428beab-10f4-4c0d-bb9e-8c797ed7a7c9](src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9) + - **class Reactions** | [Details](src/e6c2dee6-54b9-4476-8896-2bfa14a87650) | [Code](src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.php) | [Settings](src/e6c2dee6-54b9-4476-8896-2bfa14a87650/settings.json) | [e6c2dee6-54b9-4476-8896-2bfa14a87650](src/e6c2dee6-54b9-4476-8896-2bfa14a87650) + - **class Stopwatch** | [Details](src/a68d1841-65bb-41c8-ac09-cfddf73bb822) | [Code](src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.php) | [Settings](src/a68d1841-65bb-41c8-ac09-cfddf73bb822/settings.json) | [a68d1841-65bb-41c8-ac09-cfddf73bb822](src/a68d1841-65bb-41c8-ac09-cfddf73bb822) + - **class Subscriptions** | [Details](src/acca507d-e632-4349-9e3a-9dba5d19fbf9) | [Code](src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.php) | [Settings](src/acca507d-e632-4349-9e3a-9dba5d19fbf9/settings.json) | [acca507d-e632-4349-9e3a-9dba5d19fbf9](src/acca507d-e632-4349-9e3a-9dba5d19fbf9) + - **class Timeline** | [Details](src/83bb983b-80d8-44d5-917b-03d3c13742b9) | [Code](src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.php) | [Settings](src/83bb983b-80d8-44d5-917b-03d3c13742b9/settings.json) | [83bb983b-80d8-44d5-917b-03d3c13742b9](src/83bb983b-80d8-44d5-917b-03d3c13742b9) + - **class Times** | [Details](src/d273c34e-88c1-438b-98c0-801996f58c29) | [Code](src/d273c34e-88c1-438b-98c0-801996f58c29/code.php) | [Settings](src/d273c34e-88c1-438b-98c0-801996f58c29/settings.json) | [d273c34e-88c1-438b-98c0-801996f58c29](src/d273c34e-88c1-438b-98c0-801996f58c29) +- **Namespace**: [VDM\Joomla\Gitea\Miscellaneous](#vdm-joomla-gitea-miscellaneous) + + - **class Activitypub** | [Details](src/9ae44ddd-9d69-4298-a50b-05129cbebb76) | [Code](src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.php) | [Settings](src/9ae44ddd-9d69-4298-a50b-05129cbebb76/settings.json) | [9ae44ddd-9d69-4298-a50b-05129cbebb76](src/9ae44ddd-9d69-4298-a50b-05129cbebb76) + - **class Gpg** | [Details](src/5974503e-e56c-488b-bee3-f93b90c781df) | [Code](src/5974503e-e56c-488b-bee3-f93b90c781df/code.php) | [Settings](src/5974503e-e56c-488b-bee3-f93b90c781df/settings.json) | [5974503e-e56c-488b-bee3-f93b90c781df](src/5974503e-e56c-488b-bee3-f93b90c781df) + - **class Markdown** | [Details](src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa) | [Code](src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.php) | [Settings](src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/settings.json) | [8f1a0130-e555-4e6a-9fa8-9b99e30b39fa](src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa) + - **class NodeInfo** | [Details](src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f) | [Code](src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.php) | [Settings](src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/settings.json) | [2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f](src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f) + - **class Version** | [Details](src/7fb2cd98-a87d-4f48-9720-033924c69e34) | [Code](src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.php) | [Settings](src/7fb2cd98-a87d-4f48-9720-033924c69e34/settings.json) | [7fb2cd98-a87d-4f48-9720-033924c69e34](src/7fb2cd98-a87d-4f48-9720-033924c69e34) +- **Namespace**: [VDM\Joomla\Gitea\Notifications](#vdm-joomla-gitea-notifications) + + - **class Repository** | [Details](src/3a4ce297-4536-45be-b3cc-d93474e55528) | [Code](src/3a4ce297-4536-45be-b3cc-d93474e55528/code.php) | [Settings](src/3a4ce297-4536-45be-b3cc-d93474e55528/settings.json) | [3a4ce297-4536-45be-b3cc-d93474e55528](src/3a4ce297-4536-45be-b3cc-d93474e55528) + - **class Thread** | [Details](src/db14e345-c3d9-4dda-8534-4963cd6ca6f5) | [Code](src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.php) | [Settings](src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/settings.json) | [db14e345-c3d9-4dda-8534-4963cd6ca6f5](src/db14e345-c3d9-4dda-8534-4963cd6ca6f5) +- **Namespace**: [VDM\Joomla\Gitea\Organization](#vdm-joomla-gitea-organization) + + - **class Hooks** | [Details](src/605d7058-345b-411e-b55d-027edc1ded83) | [Code](src/605d7058-345b-411e-b55d-027edc1ded83/code.php) | [Settings](src/605d7058-345b-411e-b55d-027edc1ded83/settings.json) | [605d7058-345b-411e-b55d-027edc1ded83](src/605d7058-345b-411e-b55d-027edc1ded83) + - **class Labels** | [Details](src/9c9ba4c4-2039-4396-9ea2-621e42e04c89) | [Code](src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.php) | [Settings](src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/settings.json) | [9c9ba4c4-2039-4396-9ea2-621e42e04c89](src/9c9ba4c4-2039-4396-9ea2-621e42e04c89) + - **class Members** | [Details](src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240) | [Code](src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.php) | [Settings](src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/settings.json) | [c1be1e0d-479d-44de-bfe4-cfa4ded7e240](src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240) + - **class PublicMembers** | [Details](src/2a6f99df-a327-4477-8079-f57133e6ff36) | [Code](src/2a6f99df-a327-4477-8079-f57133e6ff36/code.php) | [Settings](src/2a6f99df-a327-4477-8079-f57133e6ff36/settings.json) | [2a6f99df-a327-4477-8079-f57133e6ff36](src/2a6f99df-a327-4477-8079-f57133e6ff36) + - **class Repository** | [Details](src/aeb42050-90e1-4169-907a-fa6cde20caa4) | [Code](src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.php) | [Settings](src/aeb42050-90e1-4169-907a-fa6cde20caa4/settings.json) | [aeb42050-90e1-4169-907a-fa6cde20caa4](src/aeb42050-90e1-4169-907a-fa6cde20caa4) + - **class Teams** | [Details](src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3) | [Code](src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.php) | [Settings](src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/settings.json) | [9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3](src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3) + - **class User** | [Details](src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf) | [Code](src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.php) | [Settings](src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/settings.json) | [b3f6728b-8c88-4ee8-9aa0-bcef400a35bf](src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf) +- **Namespace**: [VDM\Joomla\Gitea\Package](#vdm-joomla-gitea-package) + + - **class Files** | [Details](src/4a54c21f-ac3a-4489-b507-636835541a67) | [Code](src/4a54c21f-ac3a-4489-b507-636835541a67/code.php) | [Settings](src/4a54c21f-ac3a-4489-b507-636835541a67/settings.json) | [4a54c21f-ac3a-4489-b507-636835541a67](src/4a54c21f-ac3a-4489-b507-636835541a67) + - **class Owner** | [Details](src/b5ca512b-f667-4ec6-bc6e-914af41d344a) | [Code](src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.php) | [Settings](src/b5ca512b-f667-4ec6-bc6e-914af41d344a/settings.json) | [b5ca512b-f667-4ec6-bc6e-914af41d344a](src/b5ca512b-f667-4ec6-bc6e-914af41d344a) +- **Namespace**: [VDM\Joomla\Gitea\Repository](#vdm-joomla-gitea-repository) + + - **class Archive** | [Details](src/8a8fce09-a880-4364-a8c4-4ca337e7e951) | [Code](src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.php) | [Settings](src/8a8fce09-a880-4364-a8c4-4ca337e7e951/settings.json) | [8a8fce09-a880-4364-a8c4-4ca337e7e951](src/8a8fce09-a880-4364-a8c4-4ca337e7e951) + - **class Assignees** | [Details](src/66f866a7-f3a0-40ac-ac94-168d60c4a643) | [Code](src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.php) | [Settings](src/66f866a7-f3a0-40ac-ac94-168d60c4a643/settings.json) | [66f866a7-f3a0-40ac-ac94-168d60c4a643](src/66f866a7-f3a0-40ac-ac94-168d60c4a643) + - **class Attachments** | [Details](src/68f930bc-d24f-4ade-bcec-576f82c3c13d) | [Code](src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.php) | [Settings](src/68f930bc-d24f-4ade-bcec-576f82c3c13d/settings.json) | [68f930bc-d24f-4ade-bcec-576f82c3c13d](src/68f930bc-d24f-4ade-bcec-576f82c3c13d) + - **class Branch** | [Details](src/8fd54ec5-d93e-445c-ae27-80b6052dbddd) | [Code](src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.php) | [Settings](src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/settings.json) | [8fd54ec5-d93e-445c-ae27-80b6052dbddd](src/8fd54ec5-d93e-445c-ae27-80b6052dbddd) + - **class Collaborator** | [Details](src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf) | [Code](src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.php) | [Settings](src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/settings.json) | [e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf](src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf) + - **class Commits** | [Details](src/daa18d45-3d4a-4280-b58c-147683e8093c) | [Code](src/daa18d45-3d4a-4280-b58c-147683e8093c/code.php) | [Settings](src/daa18d45-3d4a-4280-b58c-147683e8093c/settings.json) | [daa18d45-3d4a-4280-b58c-147683e8093c](src/daa18d45-3d4a-4280-b58c-147683e8093c) + - **class Contents** | [Details](src/8d1baef6-fcad-49a9-848f-428009cdb989) | [Code](src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php) | [Settings](src/8d1baef6-fcad-49a9-848f-428009cdb989/settings.json) | [8d1baef6-fcad-49a9-848f-428009cdb989](src/8d1baef6-fcad-49a9-848f-428009cdb989) + - **class Forks** | [Details](src/7fbed5f9-54a2-4001-a0d1-4621034166ef) | [Code](src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.php) | [Settings](src/7fbed5f9-54a2-4001-a0d1-4621034166ef/settings.json) | [7fbed5f9-54a2-4001-a0d1-4621034166ef](src/7fbed5f9-54a2-4001-a0d1-4621034166ef) + - **class Gpg** | [Details](src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce) | [Code](src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.php) | [Settings](src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/settings.json) | [93f4bc91-946d-447a-ab5a-4f76e0e1a9ce](src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce) + - **class Hooks** | [Details](src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488) | [Code](src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.php) | [Settings](src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/settings.json) | [463ce0a3-65e0-4a08-8bd2-e3bd0a058488](src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488) + - **class Keys** | [Details](src/501fbf08-9f56-4aa0-96d7-5905b511be08) | [Code](src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.php) | [Settings](src/501fbf08-9f56-4aa0-96d7-5905b511be08/settings.json) | [501fbf08-9f56-4aa0-96d7-5905b511be08](src/501fbf08-9f56-4aa0-96d7-5905b511be08) + - **class Languages** | [Details](src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba) | [Code](src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.php) | [Settings](src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/settings.json) | [c140a62c-ea7b-470f-b8ca-83cfbcdd13ba](src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba) + - **class Media** | [Details](src/c0ee5592-e49f-4937-9b13-f4352afcb430) | [Code](src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.php) | [Settings](src/c0ee5592-e49f-4937-9b13-f4352afcb430/settings.json) | [c0ee5592-e49f-4937-9b13-f4352afcb430](src/c0ee5592-e49f-4937-9b13-f4352afcb430) + - **class Merge** | [Details](src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee) | [Code](src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.php) | [Settings](src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/settings.json) | [0f99429a-b517-40ac-a3c1-34c3ef2f36ee](src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee) + - **class Mirror** | [Details](src/f6249c33-b4bd-4598-8710-0cab230aef94) | [Code](src/f6249c33-b4bd-4598-8710-0cab230aef94/code.php) | [Settings](src/f6249c33-b4bd-4598-8710-0cab230aef94/settings.json) | [f6249c33-b4bd-4598-8710-0cab230aef94](src/f6249c33-b4bd-4598-8710-0cab230aef94) + - **class Mirrors** | [Details](src/403855fb-668d-464a-af45-8e30b198c9d6) | [Code](src/403855fb-668d-464a-af45-8e30b198c9d6/code.php) | [Settings](src/403855fb-668d-464a-af45-8e30b198c9d6/settings.json) | [403855fb-668d-464a-af45-8e30b198c9d6](src/403855fb-668d-464a-af45-8e30b198c9d6) + - **class Notes** | [Details](src/cf8fa194-9f83-4a2a-b52b-ede069188afe) | [Code](src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.php) | [Settings](src/cf8fa194-9f83-4a2a-b52b-ede069188afe/settings.json) | [cf8fa194-9f83-4a2a-b52b-ede069188afe](src/cf8fa194-9f83-4a2a-b52b-ede069188afe) + - **class Patch** | [Details](src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e) | [Code](src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.php) | [Settings](src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/settings.json) | [1dda1c2c-1670-4aea-a6b8-49f0bd03b41e](src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e) + - **class Pulls** | [Details](src/f56114fd-6804-4ce9-8adb-1d521f023c11) | [Code](src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.php) | [Settings](src/f56114fd-6804-4ce9-8adb-1d521f023c11/settings.json) | [f56114fd-6804-4ce9-8adb-1d521f023c11](src/f56114fd-6804-4ce9-8adb-1d521f023c11) + - **class Refs** | [Details](src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d) | [Code](src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.php) | [Settings](src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/settings.json) | [974d9e4c-beef-4c35-a3c6-92b1dd5b145d](src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d) + - **class Releases** | [Details](src/754d737c-3b6f-43f0-8974-2e06a3daf41e) | [Code](src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.php) | [Settings](src/754d737c-3b6f-43f0-8974-2e06a3daf41e/settings.json) | [754d737c-3b6f-43f0-8974-2e06a3daf41e](src/754d737c-3b6f-43f0-8974-2e06a3daf41e) + - **class Remote** | [Details](src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd) | [Code](src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.php) | [Settings](src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/settings.json) | [994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd](src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd) + - **class Reviewers** | [Details](src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5) | [Code](src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.php) | [Settings](src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/settings.json) | [65288a04-bcac-4067-ae2b-6fda9f1e3fd5](src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5) + - **class Reviews** | [Details](src/6a2fffb5-63ff-4a96-b458-632a5ff90814) | [Code](src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.php) | [Settings](src/6a2fffb5-63ff-4a96-b458-632a5ff90814/settings.json) | [6a2fffb5-63ff-4a96-b458-632a5ff90814](src/6a2fffb5-63ff-4a96-b458-632a5ff90814) + - **class Stargazers** | [Details](src/4b355731-bbcc-430f-a451-f94ff9bb1c20) | [Code](src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.php) | [Settings](src/4b355731-bbcc-430f-a451-f94ff9bb1c20/settings.json) | [4b355731-bbcc-430f-a451-f94ff9bb1c20](src/4b355731-bbcc-430f-a451-f94ff9bb1c20) + - **class Statuses** | [Details](src/5f01760a-de24-49f7-b08e-d340c847f86a) | [Code](src/5f01760a-de24-49f7-b08e-d340c847f86a/code.php) | [Settings](src/5f01760a-de24-49f7-b08e-d340c847f86a/settings.json) | [5f01760a-de24-49f7-b08e-d340c847f86a](src/5f01760a-de24-49f7-b08e-d340c847f86a) + - **class Tags** | [Details](src/caf25475-8c9e-4e07-a7f5-f606e98ec880) | [Code](src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.php) | [Settings](src/caf25475-8c9e-4e07-a7f5-f606e98ec880/settings.json) | [caf25475-8c9e-4e07-a7f5-f606e98ec880](src/caf25475-8c9e-4e07-a7f5-f606e98ec880) + - **class Teams** | [Details](src/c7b31fc2-892b-4235-beb2-3413e4432839) | [Code](src/c7b31fc2-892b-4235-beb2-3413e4432839/code.php) | [Settings](src/c7b31fc2-892b-4235-beb2-3413e4432839/settings.json) | [c7b31fc2-892b-4235-beb2-3413e4432839](src/c7b31fc2-892b-4235-beb2-3413e4432839) + - **class Templates** | [Details](src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2) | [Code](src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.php) | [Settings](src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/settings.json) | [8c82b705-04bb-4bd2-ac09-3f590fdf48c2](src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2) + - **class Times** | [Details](src/d7b67b1c-f876-4555-9e54-0645cf519d4c) | [Code](src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.php) | [Settings](src/d7b67b1c-f876-4555-9e54-0645cf519d4c/settings.json) | [d7b67b1c-f876-4555-9e54-0645cf519d4c](src/d7b67b1c-f876-4555-9e54-0645cf519d4c) + - **class Topics** | [Details](src/7f852309-122b-42fb-b2f3-ea9e2d405a9c) | [Code](src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.php) | [Settings](src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/settings.json) | [7f852309-122b-42fb-b2f3-ea9e2d405a9c](src/7f852309-122b-42fb-b2f3-ea9e2d405a9c) + - **class Transfer** | [Details](src/04adb831-c257-4657-a2c3-a17096b6b5cf) | [Code](src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.php) | [Settings](src/04adb831-c257-4657-a2c3-a17096b6b5cf/settings.json) | [04adb831-c257-4657-a2c3-a17096b6b5cf](src/04adb831-c257-4657-a2c3-a17096b6b5cf) + - **class Trees** | [Details](src/78b3346f-c4cf-46b3-941c-656e2d510da0) | [Code](src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.php) | [Settings](src/78b3346f-c4cf-46b3-941c-656e2d510da0/settings.json) | [78b3346f-c4cf-46b3-941c-656e2d510da0](src/78b3346f-c4cf-46b3-941c-656e2d510da0) + - **class Watchers** | [Details](src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7) | [Code](src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.php) | [Settings](src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/settings.json) | [93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7](src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7) + - **class Wiki** | [Details](src/572b9567-1893-400b-bd34-f1a45ef7e503) | [Code](src/572b9567-1893-400b-bd34-f1a45ef7e503/code.php) | [Settings](src/572b9567-1893-400b-bd34-f1a45ef7e503/settings.json) | [572b9567-1893-400b-bd34-f1a45ef7e503](src/572b9567-1893-400b-bd34-f1a45ef7e503) +- **Namespace**: [VDM\Joomla\Gitea\Service](#vdm-joomla-gitea-service) + + - **class Admin** | [Details](src/ddced4c5-667d-4559-873d-d716c17fd85b) | [Code](src/ddced4c5-667d-4559-873d-d716c17fd85b/code.php) | [Settings](src/ddced4c5-667d-4559-873d-d716c17fd85b/settings.json) | [ddced4c5-667d-4559-873d-d716c17fd85b](src/ddced4c5-667d-4559-873d-d716c17fd85b) + - **class Issue** | [Details](src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba) | [Code](src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.php) | [Settings](src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/settings.json) | [44396eb8-e14c-47d9-9bdc-8205c0fd2bba](src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba) + - **class Jcb** | [Details](src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe) | [Code](src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.php) | [Settings](src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/settings.json) | [d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe](src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe) + - **class Miscellaneous** | [Details](src/012af7d0-3436-4cae-b856-be49bdc39a3e) | [Code](src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.php) | [Settings](src/012af7d0-3436-4cae-b856-be49bdc39a3e/settings.json) | [012af7d0-3436-4cae-b856-be49bdc39a3e](src/012af7d0-3436-4cae-b856-be49bdc39a3e) + - **class Notifications** | [Details](src/be57f70f-1214-4d69-8d33-7cd4e312ff70) | [Code](src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.php) | [Settings](src/be57f70f-1214-4d69-8d33-7cd4e312ff70/settings.json) | [be57f70f-1214-4d69-8d33-7cd4e312ff70](src/be57f70f-1214-4d69-8d33-7cd4e312ff70) + - **class Organization** | [Details](src/3d25ea99-4f33-489a-934c-0e42027e6114) | [Code](src/3d25ea99-4f33-489a-934c-0e42027e6114/code.php) | [Settings](src/3d25ea99-4f33-489a-934c-0e42027e6114/settings.json) | [3d25ea99-4f33-489a-934c-0e42027e6114](src/3d25ea99-4f33-489a-934c-0e42027e6114) + - **class Package** | [Details](src/808da4eb-b467-46cf-a767-e7e714f46b5a) | [Code](src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.php) | [Settings](src/808da4eb-b467-46cf-a767-e7e714f46b5a/settings.json) | [808da4eb-b467-46cf-a767-e7e714f46b5a](src/808da4eb-b467-46cf-a767-e7e714f46b5a) + - **class Repository** | [Details](src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230) | [Code](src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.php) | [Settings](src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/settings.json) | [0bb2b72f-ebcd-46fe-844b-ac5fe715c230](src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230) + - **class Settings** | [Details](src/f4d00907-c94a-49b7-8727-d64c1fa74cf5) | [Code](src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.php) | [Settings](src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/settings.json) | [f4d00907-c94a-49b7-8727-d64c1fa74cf5](src/f4d00907-c94a-49b7-8727-d64c1fa74cf5) + - **class User** | [Details](src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e) | [Code](src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.php) | [Settings](src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/settings.json) | [0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e](src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e) + - **class Utilities** | [Details](src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c) | [Code](src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.php) | [Settings](src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/settings.json) | [6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c](src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c) +- **Namespace**: [VDM\Joomla\Gitea\Settings](#vdm-joomla-gitea-settings) + + - **class Api** | [Details](src/5ca71a00-7b44-4c0d-9955-3af054eed43d) | [Code](src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.php) | [Settings](src/5ca71a00-7b44-4c0d-9955-3af054eed43d/settings.json) | [5ca71a00-7b44-4c0d-9955-3af054eed43d](src/5ca71a00-7b44-4c0d-9955-3af054eed43d) + - **class Attachment** | [Details](src/3d4ed24c-8250-4fcf-824f-a5f1597f939e) | [Code](src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.php) | [Settings](src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/settings.json) | [3d4ed24c-8250-4fcf-824f-a5f1597f939e](src/3d4ed24c-8250-4fcf-824f-a5f1597f939e) + - **class Repository** | [Details](src/e7c16db5-bb22-421b-8789-180f6a502b62) | [Code](src/e7c16db5-bb22-421b-8789-180f6a502b62/code.php) | [Settings](src/e7c16db5-bb22-421b-8789-180f6a502b62/settings.json) | [e7c16db5-bb22-421b-8789-180f6a502b62](src/e7c16db5-bb22-421b-8789-180f6a502b62) + - **class Ui** | [Details](src/0367ac44-18d6-495d-beae-315794ffa89d) | [Code](src/0367ac44-18d6-495d-beae-315794ffa89d/code.php) | [Settings](src/0367ac44-18d6-495d-beae-315794ffa89d/settings.json) | [0367ac44-18d6-495d-beae-315794ffa89d](src/0367ac44-18d6-495d-beae-315794ffa89d) +- **Namespace**: [VDM\Joomla\Gitea\User](#vdm-joomla-gitea-user) + + - **class Applications** | [Details](src/4a9e144e-7754-4d3f-9325-9ff792ce4aef) | [Code](src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.php) | [Settings](src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/settings.json) | [4a9e144e-7754-4d3f-9325-9ff792ce4aef](src/4a9e144e-7754-4d3f-9325-9ff792ce4aef) + - **class Emails** | [Details](src/af4b8b77-d773-42a7-9f54-19de463bc49b) | [Code](src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.php) | [Settings](src/af4b8b77-d773-42a7-9f54-19de463bc49b/settings.json) | [af4b8b77-d773-42a7-9f54-19de463bc49b](src/af4b8b77-d773-42a7-9f54-19de463bc49b) + - **class Followers** | [Details](src/13931443-bad7-4742-b64e-c08042e7b306) | [Code](src/13931443-bad7-4742-b64e-c08042e7b306/code.php) | [Settings](src/13931443-bad7-4742-b64e-c08042e7b306/settings.json) | [13931443-bad7-4742-b64e-c08042e7b306](src/13931443-bad7-4742-b64e-c08042e7b306) + - **class Following** | [Details](src/b1788488-f557-4746-9929-73e1d049b4a2) | [Code](src/b1788488-f557-4746-9929-73e1d049b4a2/code.php) | [Settings](src/b1788488-f557-4746-9929-73e1d049b4a2/settings.json) | [b1788488-f557-4746-9929-73e1d049b4a2](src/b1788488-f557-4746-9929-73e1d049b4a2) + - **class Gpg** | [Details](src/f135ca7f-4d50-4480-a15f-feae1a7982ab) | [Code](src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.php) | [Settings](src/f135ca7f-4d50-4480-a15f-feae1a7982ab/settings.json) | [f135ca7f-4d50-4480-a15f-feae1a7982ab](src/f135ca7f-4d50-4480-a15f-feae1a7982ab) + - **class Keys** | [Details](src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d) | [Code](src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.php) | [Settings](src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/settings.json) | [c521f8c3-4e01-4c1a-8f68-f3e9d967651d](src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d) + - **class Repos** | [Details](src/fd560f3e-ce19-474f-86ca-1fb1d3af9992) | [Code](src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.php) | [Settings](src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/settings.json) | [fd560f3e-ce19-474f-86ca-1fb1d3af9992](src/fd560f3e-ce19-474f-86ca-1fb1d3af9992) + - **class Settings** | [Details](src/553b8fc5-46cc-49b7-95ce-992a3c5708f8) | [Code](src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.php) | [Settings](src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/settings.json) | [553b8fc5-46cc-49b7-95ce-992a3c5708f8](src/553b8fc5-46cc-49b7-95ce-992a3c5708f8) + - **class Starred** | [Details](src/884b61d0-1f56-4f5f-a657-acaacdb9634b) | [Code](src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.php) | [Settings](src/884b61d0-1f56-4f5f-a657-acaacdb9634b/settings.json) | [884b61d0-1f56-4f5f-a657-acaacdb9634b](src/884b61d0-1f56-4f5f-a657-acaacdb9634b) + - **class Subscriptions** | [Details](src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf) | [Code](src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.php) | [Settings](src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/settings.json) | [b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf](src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf) + - **class Teams** | [Details](src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3) | [Code](src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.php) | [Settings](src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/settings.json) | [c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3](src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3) + - **class Times** | [Details](src/2ccb303f-b115-45fb-b3ea-08a38259681e) | [Code](src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.php) | [Settings](src/2ccb303f-b115-45fb-b3ea-08a38259681e/settings.json) | [2ccb303f-b115-45fb-b3ea-08a38259681e](src/2ccb303f-b115-45fb-b3ea-08a38259681e) + - **class Tokens** | [Details](src/af49b450-78fb-40bd-8165-48466ebd31a9) | [Code](src/af49b450-78fb-40bd-8165-48466ebd31a9/code.php) | [Settings](src/af49b450-78fb-40bd-8165-48466ebd31a9/settings.json) | [af49b450-78fb-40bd-8165-48466ebd31a9](src/af49b450-78fb-40bd-8165-48466ebd31a9) +- **Namespace**: [VDM\Joomla\Gitea\Utilities](#vdm-joomla-gitea-utilities) + + - **final class Http** | [Details](src/ce40b3d2-226c-4a64-b116-c19455822be1) | [Code](src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php) | [Settings](src/ce40b3d2-226c-4a64-b116-c19455822be1/settings.json) | [ce40b3d2-226c-4a64-b116-c19455822be1](src/ce40b3d2-226c-4a64-b116-c19455822be1) + - **final class Response** | [Details](src/19eb68d7-1e19-4d14-a0ef-70d719c45e80) | [Code](src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.php) | [Settings](src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/settings.json) | [19eb68d7-1e19-4d14-a0ef-70d719c45e80](src/19eb68d7-1e19-4d14-a0ef-70d719c45e80) + - **final class Uri** | [Details](src/61e813c6-a872-4f55-8078-198241170e80) | [Code](src/61e813c6-a872-4f55-8078-198241170e80/code.php) | [Settings](src/61e813c6-a872-4f55-8078-198241170e80/settings.json) | [61e813c6-a872-4f55-8078-198241170e80](src/61e813c6-a872-4f55-8078-198241170e80) +- **Namespace**: [VDM\Joomla\Gitea\Admin\Users](#vdm-joomla-gitea-admin-users) + + - **class Keys** | [Details](src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701) | [Code](src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.php) | [Settings](src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/settings.json) | [2d29b342-cb4a-45f9-9cf1-a7347fbc0701](src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701) + - **class Organization** | [Details](src/0039c453-cf6d-468b-9232-fc3fc13ca0c2) | [Code](src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.php) | [Settings](src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/settings.json) | [0039c453-cf6d-468b-9232-fc3fc13ca0c2](src/0039c453-cf6d-468b-9232-fc3fc13ca0c2) + - **class Repository** | [Details](src/49ae84dc-4474-468f-bf99-c92433fd1cc4) | [Code](src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.php) | [Settings](src/49ae84dc-4474-468f-bf99-c92433fd1cc4/settings.json) | [49ae84dc-4474-468f-bf99-c92433fd1cc4](src/49ae84dc-4474-468f-bf99-c92433fd1cc4) +- **Namespace**: [VDM\Joomla\Gitea\Issue\Reactions](#vdm-joomla-gitea-issue-reactions) + + - **class Comment** | [Details](src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155) | [Code](src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.php) | [Settings](src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/settings.json) | [73b3ebfa-c52a-4a96-a8de-718ff0bbc155](src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155) +- **Namespace**: [VDM\Joomla\Gitea\Issue\Repository](#vdm-joomla-gitea-issue-repository) + + - **class Comments** | [Details](src/63fbd482-688a-4356-b3e4-a676ef357100) | [Code](src/63fbd482-688a-4356-b3e4-a676ef357100/code.php) | [Settings](src/63fbd482-688a-4356-b3e4-a676ef357100/settings.json) | [63fbd482-688a-4356-b3e4-a676ef357100](src/63fbd482-688a-4356-b3e4-a676ef357100) +- **Namespace**: [VDM\Joomla\Gitea\Organization\Teams](#vdm-joomla-gitea-organization-teams) + + - **class Members** | [Details](src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e) | [Code](src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.php) | [Settings](src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/settings.json) | [d9fa532a-dbe8-445f-93dc-398a3cf01c1e](src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e) + - **class Repository** | [Details](src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf) | [Code](src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.php) | [Settings](src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/settings.json) | [07fce5f7-eb13-4dda-8870-77c9ad32a7bf](src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf) +- **Namespace**: [VDM\Joomla\Gitea\Repository\Branch](#vdm-joomla-gitea-repository-branch) + + - **class Protection** | [Details](src/0edb3d51-0a65-443b-883d-3d20325212bb) | [Code](src/0edb3d51-0a65-443b-883d-3d20325212bb/code.php) | [Settings](src/0edb3d51-0a65-443b-883d-3d20325212bb/settings.json) | [0edb3d51-0a65-443b-883d-3d20325212bb](src/0edb3d51-0a65-443b-883d-3d20325212bb) +- **Namespace**: [VDM\Joomla\Gitea\Repository\Hooks](#vdm-joomla-gitea-repository-hooks) + + - **class Git** | [Details](src/a11cacb2-c13a-4482-bf71-1b7d99574a98) | [Code](src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.php) | [Settings](src/a11cacb2-c13a-4482-bf71-1b7d99574a98/settings.json) | [a11cacb2-c13a-4482-bf71-1b7d99574a98](src/a11cacb2-c13a-4482-bf71-1b7d99574a98) + +# Class Diagrams + +## VDM Joomla Gitea +> namespace VDM\Joomla\Gitea +```uml +@startuml + +namespace VDM\Joomla\Gitea #DarkCyan { + + + abstract Factory #Orange { + # static $container + + {static} _() : Mixed + + {static} getContainer() : Container + # {static} createContainer() : Container + } + + class Issue #Gold { + + list() : ?array + + get() : ?object + + create() : ?object + + search() : ?array + + edit() : ?object + + delete() : string + } + + class Labels #Gold { + + create() : ?object + + get() : ?object + + delete() : string + + update() : ?object + } + + class Notifications #Gold { + + list() : ?array + + update() : ?array + + check() : ?object + } + + class Organization #Gold { + + create() : ?object + + get() : ?object + + list() : ?array + + delete() : string + + edit() : ?object + } + + class Package #Gold { + + get() : ?object + + delete() : string + } + + class Repository #Gold { + + search() : ?object + + get() : ?object + + id() : ?object + + delete() : string + + edit() : ?object + + create() : ?object + } + + class User #Gold { + + authenticate() : ?object + + search() : ?object + + get() : o + + followers() : ?array + + following() : ?array + + check() : string + + gpg() : ?array + + heatmap() : ?array + + keys() : ?array + + repos() : ?array + + repos() : ?array + + watched() : ?array + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Service +> namespace VDM\Joomla\Componentbuilder\Service +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Service #Olive { + + + class Gitea #Gold { + + register() : void + + getUri() : Uri + + getHttp() : Http + } +} + + +@enduml +``` + +## VDM Joomla Gitea Abstraction +> namespace VDM\Joomla\Gitea\Abstraction +```uml +@startuml + +namespace VDM\Joomla\Gitea\Abstraction #Olive { + + + abstract Api #Orange { + # Http $http + # Uri $uri + # Response $response + + __construct() + + load_() : void + } +} + + +@enduml +``` + +## VDM Joomla Gitea Admin +> namespace VDM\Joomla\Gitea\Admin +```uml +@startuml + +namespace VDM\Joomla\Gitea\Admin #Olive { + + + class Cron #Gold { + + list() : ?array + + run() : string + } + + class Organizations #Gold { + + list() : ?array + } + + class Unadopted #Gold { + + list() : ?array + + adopt() : string + + delete() : string + } + + class Users #Gold { + + list() : ?array + + create() : ?object + + delete() : string + + edit() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Issue +> namespace VDM\Joomla\Gitea\Issue +```uml +@startuml + +namespace VDM\Joomla\Gitea\Issue #Olive { + + + class Comments #Gold { + + list() : ?array + + get() : ?object + + delete() : string + + edit() : ?object + + add() : ?object + } + + class Deadline #Gold { + + set() : object + } + + class Labels #Gold { + + list() : ?array + + get() : ?array + + replace() : object + + add() : ?array + + remove() : string + + clear() : string + } + + class Milestones #Gold { + + create() : ?object + + list() : ?array + + get() : ?object + + delete() : string + + update() : ?object + } + + class Reactions #Gold { + + list() : ?array + + add() : ?object + + remove() : string + } + + class Stopwatch #Gold { + + start() : string + + stop() : string + + delete() : string + } + + class Subscriptions #Gold { + + get() : ?object + + check() : ?object + + subscribe() : string + + unsubscribe() : string + } + + class Timeline #Gold { + + get() : ?array + } + + class Times #Gold { + + list() : ?array + + add() : ?object + + reset() : string + + delete() : string + } +} + + +@enduml +``` + +## VDM Joomla Gitea Miscellaneous +> namespace VDM\Joomla\Gitea\Miscellaneous +```uml +@startuml + +namespace VDM\Joomla\Gitea\Miscellaneous #Olive { + + + class Activitypub #Gold { + + get() : ?object + + send() : string + } + + class Gpg #Gold { + + get() : ?string + } + + class Markdown #Gold { + + render() : ?string + + raw() : ?string + } + + class NodeInfo #Gold { + + get() : ?object + } + + class Version #Gold { + + get() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Notifications +> namespace VDM\Joomla\Gitea\Notifications +```uml +@startuml + +namespace VDM\Joomla\Gitea\Notifications #Olive { + + + class Repository #Gold { + + get() : ?array + + update() : ?array + } + + class Thread #Gold { + + get() : ?object + + mark() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Organization +> namespace VDM\Joomla\Gitea\Organization +```uml +@startuml + +namespace VDM\Joomla\Gitea\Organization #Olive { + + + class Hooks #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + delete() : string + + update() : ?object + } + + class Labels #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + delete() : string + + update() : ?object + } + + class Members #Gold { + + list() : ?array + + check() : string + + remove() : string + } + + class PublicMembers #Gold { + + list() : ?array + + check() : ?string + + publicize() : ?string + + conceal() : string + } + + class Repository #Gold { + + list() : ?array + + create() : ?object + } + + class Teams #Gold { + + list() : ?array + + get() : ?object + + create() : ?object + + search() : ?object + + delete() : string + + edit() : ?object + } + + class User #Gold { + + list() : ?array + + get() : ?array + + permissions() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Package +> namespace VDM\Joomla\Gitea\Package +```uml +@startuml + +namespace VDM\Joomla\Gitea\Package #Olive { + + + class Files #Gold { + + get() : ?object + } + + class Owner #Gold { + + get() : ?array + } +} + + +@enduml +``` + +## VDM Joomla Gitea Repository +> namespace VDM\Joomla\Gitea\Repository +```uml +@startuml + +namespace VDM\Joomla\Gitea\Repository #Olive { + + + class Archive #Gold { + + get() : string + } + + class Assignees #Gold { + + get() : ?array + } + + class Attachments #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + delete() : string + + edit() : ?object + } + + class Branch #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + delete() : string + } + + class Collaborator #Gold { + + list() : ?array + + check() : string + + add() : string + + delete() : string + + permission() : ?object + } + + class Commits #Gold { + + getList() : ?object + + getCommit() : ?object + + status() : ?object + + statuses() : ?array + + diff() : string + } + + class Contents #Gold { + + get() : mixed + + metadata() : ?object + + create() : ?object + + root() : ?array + + update() : ?object + + delete() : ?object + + editor() : ?string + + blob() : ?object + } + + class Forks #Gold { + + listForks() : ?array + + repo() : ?object + } + + class Gpg #Gold { + + get() : string + } + + class Hooks #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + edit() : ?object + + test() : string + } + + class Keys #Gold { + + list() : ?array + + add() : ?object + + id() : ?object + + delete() : string + } + + class Languages #Gold { + + getLanguages() : ?object + } + + class Media #Gold { + + get() : string + } + + class Merge #Gold { + + check() : string + + pull() : string + + cancel() : string + } + + class Mirror #Gold { + + sync() : string + } + + class Mirrors #Gold { + + get() : ?array + + add() : ?object + + sync() : string + + name() : ?object + + delete() : string + } + + class Notes #Gold { + + get() : ?object + } + + class Patch #Gold { + + applyDiffPatch() : ?object + } + + class Pulls #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + update() : ?object + + diff() : string + + commits() : ?array + + files() : ?array + + merge() : string + + update() : string + } + + class Refs #Gold { + + list() : ?array + + get() : ?array + } + + class Releases #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + delete() : string + + update() : ?object + + getByTag() : ?object + + deleteByTag() : string + } + + class Remote #Gold { + + migrate() : ?object + } + + class Reviewers #Gold { + + request() : ?array + + cancel() : string + + get() : ?array + } + + class Reviews #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + submit() : ?object + + delete() : string + + comments() : ?array + + dismiss() : ?object + + undismiss() : ?object + } + + class Stargazers #Gold { + + list() : ?array + } + + class Statuses #Gold { + + get() : ?array + + create() : ?object + } + + class Tags #Gold { + + list() : ?array + + get() : ?object + + sha() : ?object + + create() : ?object + + delete() : string + } + + class Teams #Gold { + + list() : ?array + + check() : ?object + + add() : string + + delete() : string + } + + class Templates #Gold { + + issue() : ?array + + repo() : ?object + } + + class Times #Gold { + + list() : ?array + } + + class Topics #Gold { + + get() : ?object + + replace() : string + + add() : string + + delete() : string + + search() : ?array + } + + class Transfer #Gold { + + create() : ?object + + accept() : ?object + + reject() : ?object + } + + class Trees #Gold { + + get() : ?object + } + + class Watchers #Gold { + + list() : ?array + + check() : ?object + + watch() : ?object + + unwatch() : string + } + + class Wiki #Gold { + + create() : ?object + + get() : ?object + + pages() : ?array + + delete() : string + + edit() : ?object + + revisions() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Service +> namespace VDM\Joomla\Gitea\Service +```uml +@startuml + +namespace VDM\Joomla\Gitea\Service #Olive { + + + class Admin #Gold { + + register() : void + + getCron() : Cron + + getOrganizations() : Organizations + + getUnadopted() : Unadopted + + getUsers() : Users + + getKeys() : Keys + + getOrganization() : Organization + + getRepository() : Repository + } + + class Issue #Gold { + + register() : void + + getIssue() : Issu + + getComments() : Comments + + getRepoComments() : RepoComments + + getLabels() : Labels + + getIssueLabels() : IssueLabels + + getMilestones() : Milestones + + getReactions() : Reactions + + getComment() : Comment + + getStopwatch() : Stopwatch + + getSubscriptions() : Subscriptions + + getTimeline() : Timeline + + getTimes() : Times + } + + class Jcb #Gold { + + register() : void + + getUri() : Uri + + getHttp() : Http + } + + class Miscellaneous #Gold { + + register() : void + + getActivitypub() : Activitypub + + getGpg() : Gpg + + getMarkdown() : Markdown + + getNodeInfo() : NodeInfo + + getVersion() : Version + } + + class Notifications #Gold { + + register() : void + + getNotifications() : Notifi + + getRepository() : Repository + + getThread() : Thread + } + + class Organization #Gold { + + register() : void + + getOrganization() : Org + + getHooks() : Hooks + + getLabels() : Labels + + getMembers() : Members + + getPublicMembers() : PublicMembers + + getRepository() : Repository + + getTeams() : Teams + + getTeamsMembers() : TeamsMembers + + getTeamsRepository() : TeamsRepository + + getUser() : User + } + + class Package #Gold { + + register() : void + + getPackage() : Pack + + getFiles() : Files + + getOwner() : Owner + } + + class Repository #Gold { + + register() : void + + getRepository() : Repo + + getArchive() : Archive + + getAssignees() : Assignees + + getAttachments() : Attachments + + getBranch() : Branch + + getProtection() : Protection + + getCollaborator() : Collaborator + + getCommits() : Commits + + getContents() : Contents + + getForks() : Forks + + getGpg() : Gpg + + getHooks() : Hooks + + getGit() : Git + + getKeys() : Keys + + getLanguages() : Languages + + getMedia() : Media + + getMerge() : Merge + + getMirror() : Mirror + + getMirrors() : Mirrors + + getNotes() : Notes + + getPatch() : Patch + + getPulls() : Pulls + + getRefs() : Refs + + getReleases() : Releases + + getRemote() : Remote + + getReviewers() : Reviewers + + getReviews() : Reviews + + getStargazers() : Stargazers + + getStatuses() : Statuses + + getTags() : Tags + + getTeams() : Teams + + getTemplates() : Templates + + getTimes() : Times + + getTopics() : Topics + + getTransfer() : Transfer + + getTrees() : Trees + + getWatchers() : Watchers + + getWiki() : Wiki + } + + class Settings #Gold { + + register() : void + + getApi() : Api + + getAttachment() : Attachment + + getRepository() : Repository + + getUi() : Ui + } + + class User #Gold { + + register() : void + + getUser() : Usr + + getApplications() : Applications + + getEmails() : Emails + + getFollowers() : Followers + + getFollowing() : Following + + getGpg() : Gpg + + getKeys() : Keys + + getRepos() : Repos + + getSettings() : Settings + + getStarred() : Starred + + getSubscriptions() : Subscriptions + + getTeams() : Teams + + getTimes() : Times + + getTokens() : Tokens + } + + class Utilities #Gold { + + register() : void + + getUri() : Uri + + getResponse() : Response + } +} + + +@enduml +``` + +## VDM Joomla Gitea Settings +> namespace VDM\Joomla\Gitea\Settings +```uml +@startuml + +namespace VDM\Joomla\Gitea\Settings #Olive { + + + class Api #Gold { + + get() : ?object + } + + class Attachment #Gold { + + get() : ?object + } + + class Repository #Gold { + + get() : ?object + } + + class Ui #Gold { + + get() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea User +> namespace VDM\Joomla\Gitea\User +```uml +@startuml + +namespace VDM\Joomla\Gitea\User #Olive { + + + class Applications #Gold { + + get() : ?array + + id() : ?object + + create() : ?object + + delete() : string + + update() : ?object + } + + class Emails #Gold { + + list() : ?array + + add() : ?array + + delete() : string + } + + class Followers #Gold { + + list() : ?array + } + + class Following #Gold { + + list() : ?array + + check() : bool + + follow() : string + + unfollow() : string + } + + class Gpg #Gold { + + createGPGKey() : ?object + + get() : ?object + + token() : ?string + + verify() : ?object + + list() : ?array + + remove() : string + } + + class Keys #Gold { + + create() : ?object + + list() : ?array + + get() : ?object + + delete() : string + } + + class Repos #Gold { + + create() : ?object + + list() : ?array + + star() : string + + unstar() : string + } + + class Settings #Gold { + + get() : ?object + + update() : ?array + } + + class Starred #Gold { + + list() : ?array + + check() : string + } + + class Subscriptions #Gold { + + list() : ?array + } + + class Teams #Gold { + + list() : ?array + } + + class Times #Gold { + + list() : ?array + + stopwatches() : ?array + } + + class Tokens #Gold { + + list() : ?array + + create() : ?object + + delete() : string + } +} + + +@enduml +``` + +## VDM Joomla Gitea Utilities +> namespace VDM\Joomla\Gitea\Utilities +```uml +@startuml + +namespace VDM\Joomla\Gitea\Utilities #Olive { + + + class Http << (F,LightGreen) >> #Green { + + __construct() + + setToken() + } + + class Response << (F,LightGreen) >> #Green { + + get() : mixed + + get_() : mixed + # body() : mixed + # error() : string + } + + class Uri << (F,LightGreen) >> #Green { + - string $endpoint + - string $version + - string $url + + __construct() + + get() : JoomlaUri + + api() : string + + setUrl() : void + - setEndpoint() : void + - setVersion() : void + } +} + + +@enduml +``` + +## VDM Joomla Gitea Admin Users +> namespace VDM\Joomla\Gitea\Admin\Users +```uml +@startuml + +namespace VDM\Joomla\Gitea\Admin\Users #LightGreen { + + + class Keys #Gold { + + add() : ?object + + delete() : string + } + + class Organization #Gold { + + create() : ?object + } + + class Repository #Gold { + + create() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Issue Reactions +> namespace VDM\Joomla\Gitea\Issue\Reactions +```uml +@startuml + +namespace VDM\Joomla\Gitea\Issue\Reactions #LightGreen { + + + class Comment #Gold { + + list() : ?array + + add() : ?object + + remove() : string + } +} + + +@enduml +``` + +## VDM Joomla Gitea Issue Repository +> namespace VDM\Joomla\Gitea\Issue\Repository +```uml +@startuml + +namespace VDM\Joomla\Gitea\Issue\Repository #LightGreen { + + + class Comments #Gold { + + list() : ?array + } +} + + +@enduml +``` + +## VDM Joomla Gitea Organization Teams +> namespace VDM\Joomla\Gitea\Organization\Teams +```uml +@startuml + +namespace VDM\Joomla\Gitea\Organization\Teams #LightGreen { + + + class Members #Gold { + + list() : ?array + + get() : ?object + + add() : string + + remove() : string + } + + class Repository #Gold { + + list() : ?array + + get() : ?object + + add() : string + + remove() : string + } +} + + +@enduml +``` + +## VDM Joomla Gitea Repository Branch +> namespace VDM\Joomla\Gitea\Repository\Branch +```uml +@startuml + +namespace VDM\Joomla\Gitea\Repository\Branch #LightGreen { + + + class Protection #Gold { + + list() : ?array + + create() : ?object + + get() : ?object + + delete() : string + + edit() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Gitea Repository Hooks +> namespace VDM\Joomla\Gitea\Repository\Hooks +```uml +@startuml + +namespace VDM\Joomla\Gitea\Repository\Hooks #LightGreen { + + + class Git #Gold { + + list() : ?array + + get() : ?object + + delete() : string + + edit() : ?object + } +} + + +@enduml +``` + + +--- +``` + ██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗ + ██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗ + ██║██║ ██║██║ ██║██╔████╔██║██║ ███████║ +██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║ +╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║ + ╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ + ██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗ +██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝ +██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ +██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ +╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ + ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ +██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ +██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗ +██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝ +██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗ +██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║ +╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/README.md b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/README.md new file mode 100644 index 0000000..e74c459 --- /dev/null +++ b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Organization (Details) +> namespace: **VDM\Joomla\Gitea\Admin\Users** +```uml +@startuml +class Organization #Gold { + + create(string $username, string $fullName, ...) : ?object +} + +note right of Organization::create + Create an organization on behalf of a user. + + since: 3.2.0 + return: ?object + + arguments: + string $username + string $fullName + ?string $description = null + ?string $location = null + bool $repoAdminChangeTeamAccess = false + string $visibility = 'public' + ?string $website = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.php b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.php new file mode 100644 index 0000000..ec1843f --- /dev/null +++ b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.php @@ -0,0 +1,70 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin\Users; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Users Organization + * + * @since 3.2.0 + */ +class Organization extends Api +{ + /** + * Create an organization on behalf of a user. + * + * @param string $username The user's display name. + * @param string $fullName The organization full name. + * @param string|null $description The organization description (optional). + * @param string|null $location The organization location (optional). + * @param bool $repoAdminChangeTeamAccess Whether repo admin can change team access (optional). + * @param string $visibility The organization visibility (optional). + * @param string|null $website The organization website (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $username, + string $fullName, + ?string $description = null, + ?string $location = null, + bool $repoAdminChangeTeamAccess = false, + string $visibility = 'public', + ?string $website = null + ): ?object + { + // Build the request path. + $path = "/admin/users/{$username}/orgs"; + + // Set the organization data. + $data = new \stdClass(); + $data->full_name = $fullName; + $data->description = $description; + $data->location = $location; + $data->repo_admin_change_team_access = $repoAdminChangeTeamAccess; + $data->visibility = $visibility; + $data->website = $website; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.power b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.power new file mode 100644 index 0000000..ca08a37 --- /dev/null +++ b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.power @@ -0,0 +1,43 @@ + /** + * Create an organization on behalf of a user. + * + * @param string $username The user's display name. + * @param string $fullName The organization full name. + * @param string|null $description The organization description (optional). + * @param string|null $location The organization location (optional). + * @param bool $repoAdminChangeTeamAccess Whether repo admin can change team access (optional). + * @param string $visibility The organization visibility (optional). + * @param string|null $website The organization website (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $username, + string $fullName, + ?string $description = null, + ?string $location = null, + bool $repoAdminChangeTeamAccess = false, + string $visibility = 'public', + ?string $website = null + ): ?object + { + // Build the request path. + $path = "/admin/users/{$username}/orgs"; + + // Set the organization data. + $data = new \stdClass(); + $data->full_name = $fullName; + $data->description = $description; + $data->location = $location; + $data->repo_admin_change_team_access = $repoAdminChangeTeamAccess; + $data->visibility = $visibility; + $data->website = $website; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } diff --git a/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/settings.json b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/settings.json new file mode 100644 index 0000000..b448c13 --- /dev/null +++ b/src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "0039c453-cf6d-468b-9232-fc3fc13ca0c2", + "implements": null, + "load_selection": null, + "name": "Organization", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Users.Organization", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Users.Organization", + "description": "The Gitea Admin Users Organization\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/012af7d0-3436-4cae-b856-be49bdc39a3e/README.md b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/README.md new file mode 100644 index 0000000..a5ac6d0 --- /dev/null +++ b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Miscellaneous (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Miscellaneous #Gold { + + register(Container $container) : void + + getActivitypub(Container $container) : Activitypub + + getGpg(Container $container) : Gpg + + getMarkdown(Container $container) : Markdown + + getNodeInfo(Container $container) : NodeInfo + + getVersion(Container $container) : Version +} + +note right of Miscellaneous::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Miscellaneous::getActivitypub + Get the Activitypub class + + since: 3.2.0 + return: Activitypub +end note + +note right of Miscellaneous::getGpg + Get the Gpg class + + since: 3.2.0 + return: Gpg +end note + +note right of Miscellaneous::getMarkdown + Get the Markdown class + + since: 3.2.0 + return: Markdown +end note + +note right of Miscellaneous::getNodeInfo + Get the NodeInfo class + + since: 3.2.0 + return: NodeInfo +end note + +note right of Miscellaneous::getVersion + Get the Version class + + since: 3.2.0 + return: Version +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.php b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.php new file mode 100644 index 0000000..14abf45 --- /dev/null +++ b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.php @@ -0,0 +1,143 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Miscellaneous\Activitypub; +use VDM\Joomla\Gitea\Miscellaneous\Gpg; +use VDM\Joomla\Gitea\Miscellaneous\Markdown; +use VDM\Joomla\Gitea\Miscellaneous\NodeInfo; +use VDM\Joomla\Gitea\Miscellaneous\Version; + + +/** + * The Gitea Miscellaneous Service + * + * @since 3.2.0 + */ +class Miscellaneous implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Activitypub::class, 'Gitea.Miscellaneous.Activitypub') + ->share('Gitea.Miscellaneous.Activitypub', [$this, 'getActivitypub'], true); + + $container->alias(Gpg::class, 'Gitea.Miscellaneous.Gpg') + ->share('Gitea.Miscellaneous.Gpg', [$this, 'getGpg'], true); + + $container->alias(Markdown::class, 'Gitea.Miscellaneous.Markdown') + ->share('Gitea.Miscellaneous.Markdown', [$this, 'getMarkdown'], true); + + $container->alias(NodeInfo::class, 'Gitea.Miscellaneous.NodeInfo') + ->share('Gitea.Miscellaneous.NodeInfo', [$this, 'getNodeInfo'], true); + + $container->alias(Version::class, 'Gitea.Miscellaneous.Version') + ->share('Gitea.Miscellaneous.Version', [$this, 'getVersion'], true); + } + + /** + * Get the Activitypub class + * + * @param Container $container The DI container. + * + * @return Activitypub + * @since 3.2.0 + */ + public function getActivitypub(Container $container): Activitypub + { + return new Activitypub( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Gpg class + * + * @param Container $container The DI container. + * + * @return Gpg + * @since 3.2.0 + */ + public function getGpg(Container $container): Gpg + { + return new Gpg( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Markdown class + * + * @param Container $container The DI container. + * + * @return Markdown + * @since 3.2.0 + */ + public function getMarkdown(Container $container): Markdown + { + return new Markdown( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the NodeInfo class + * + * @param Container $container The DI container. + * + * @return NodeInfo + * @since 3.2.0 + */ + public function getNodeInfo(Container $container): NodeInfo + { + return new NodeInfo( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Version class + * + * @param Container $container The DI container. + * + * @return Version + * @since 3.2.0 + */ + public function getVersion(Container $container): Version + { + return new Version( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.power b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.power new file mode 100644 index 0000000..6fed6a4 --- /dev/null +++ b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.power @@ -0,0 +1,110 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Activitypub::class, 'Gitea.Miscellaneous.Activitypub') + ->share('Gitea.Miscellaneous.Activitypub', [$this, 'getActivitypub'], true); + + $container->alias(Gpg::class, 'Gitea.Miscellaneous.Gpg') + ->share('Gitea.Miscellaneous.Gpg', [$this, 'getGpg'], true); + + $container->alias(Markdown::class, 'Gitea.Miscellaneous.Markdown') + ->share('Gitea.Miscellaneous.Markdown', [$this, 'getMarkdown'], true); + + $container->alias(NodeInfo::class, 'Gitea.Miscellaneous.NodeInfo') + ->share('Gitea.Miscellaneous.NodeInfo', [$this, 'getNodeInfo'], true); + + $container->alias(Version::class, 'Gitea.Miscellaneous.Version') + ->share('Gitea.Miscellaneous.Version', [$this, 'getVersion'], true); + } + + /** + * Get the Activitypub class + * + * @param Container $container The DI container. + * + * @return Activitypub + * @since 3.2.0 + */ + public function getActivitypub(Container $container): Activitypub + { + return new Activitypub( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Gpg class + * + * @param Container $container The DI container. + * + * @return Gpg + * @since 3.2.0 + */ + public function getGpg(Container $container): Gpg + { + return new Gpg( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Markdown class + * + * @param Container $container The DI container. + * + * @return Markdown + * @since 3.2.0 + */ + public function getMarkdown(Container $container): Markdown + { + return new Markdown( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the NodeInfo class + * + * @param Container $container The DI container. + * + * @return NodeInfo + * @since 3.2.0 + */ + public function getNodeInfo(Container $container): NodeInfo + { + return new NodeInfo( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Version class + * + * @param Container $container The DI container. + * + * @return Version + * @since 3.2.0 + */ + public function getVersion(Container $container): Version + { + return new Version( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/012af7d0-3436-4cae-b856-be49bdc39a3e/settings.json b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/settings.json new file mode 100644 index 0000000..3bbff58 --- /dev/null +++ b/src/012af7d0-3436-4cae-b856-be49bdc39a3e/settings.json @@ -0,0 +1,42 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "012af7d0-3436-4cae-b856-be49bdc39a3e", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Miscellaneous", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Miscellaneous", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "9ae44ddd-9d69-4298-a50b-05129cbebb76", + "as": "default" + }, + "use_selection1": { + "use": "5974503e-e56c-488b-bee3-f93b90c781df", + "as": "default" + }, + "use_selection2": { + "use": "8f1a0130-e555-4e6a-9fa8-9b99e30b39fa", + "as": "default" + }, + "use_selection3": { + "use": "2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f", + "as": "default" + }, + "use_selection4": { + "use": "7fb2cd98-a87d-4f48-9720-033924c69e34", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Miscellaneous", + "description": "The Gitea Miscellaneous Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/0367ac44-18d6-495d-beae-315794ffa89d/README.md b/src/0367ac44-18d6-495d-beae-315794ffa89d/README.md new file mode 100644 index 0000000..07a1336 --- /dev/null +++ b/src/0367ac44-18d6-495d-beae-315794ffa89d/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Ui (Details) +> namespace: **VDM\Joomla\Gitea\Settings** +```uml +@startuml +class Ui #Gold { + + get() : ?object +} + +note right of Ui::get + Get instance's global settings for UI. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0367ac44-18d6-495d-beae-315794ffa89d/code.php b/src/0367ac44-18d6-495d-beae-315794ffa89d/code.php new file mode 100644 index 0000000..def2668 --- /dev/null +++ b/src/0367ac44-18d6-495d-beae-315794ffa89d/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Settings; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Settings Ui + * + * @since 3.2.0 + */ +class Ui extends Api +{ + /** + * Get instance's global settings for UI. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/ui"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/0367ac44-18d6-495d-beae-315794ffa89d/code.power b/src/0367ac44-18d6-495d-beae-315794ffa89d/code.power new file mode 100644 index 0000000..6a8e58b --- /dev/null +++ b/src/0367ac44-18d6-495d-beae-315794ffa89d/code.power @@ -0,0 +1,18 @@ + /** + * Get instance's global settings for UI. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/ui"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/0367ac44-18d6-495d-beae-315794ffa89d/settings.json b/src/0367ac44-18d6-495d-beae-315794ffa89d/settings.json new file mode 100644 index 0000000..1032482 --- /dev/null +++ b/src/0367ac44-18d6-495d-beae-315794ffa89d/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "0367ac44-18d6-495d-beae-315794ffa89d", + "implements": null, + "load_selection": null, + "name": "Ui", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Settings.Ui", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Settings.Ui", + "description": "The Gitea Settings Ui\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/04adb831-c257-4657-a2c3-a17096b6b5cf/README.md b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/README.md new file mode 100644 index 0000000..a7ae449 --- /dev/null +++ b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/README.md @@ -0,0 +1,59 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Transfer (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Transfer #Gold { + + create(string $owner, string $repo, ...) : ?object + + accept(string $owner, string $repo) : ?object + + reject(string $owner, string $repo) : ?object +} + +note right of Transfer::create + Transfer a repo ownership. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $newOwner + ?array $teamIDs = null +end note + +note right of Transfer::accept + Accept a repo transfer. + + since: 3.2.0 + return: ?object +end note + +note right of Transfer::reject + Reject a repo transfer. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.php b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.php new file mode 100644 index 0000000..b2e80be --- /dev/null +++ b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.php @@ -0,0 +1,108 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Transfer + * + * @since 3.2.0 + */ +class Transfer extends Api +{ + /** + * Transfer a repo ownership. + * + * @param string $owner The current owner name. + * @param string $repo The repository name. + * @param string $newOwner The new owner's name. + * @param array|null $teamIDs Optional. The IDs of the teams that will be granted access. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $newOwner, + ?array $teamIDs = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/transfer"; + + // Set the transfer data. + $data = new \stdClass(); + $data->new_owner = $newOwner; + if ($teamIDs !== null) + { + $data->team_ids = $teamIDs; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 202 + ); + } + + /** + * Accept a repo transfer. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function accept(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/transfer/accept"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 202 + ); + } + + /** + * Reject a repo transfer. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function reject(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/transfer/reject"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.power b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.power new file mode 100644 index 0000000..2c618ef --- /dev/null +++ b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.power @@ -0,0 +1,81 @@ + /** + * Transfer a repo ownership. + * + * @param string $owner The current owner name. + * @param string $repo The repository name. + * @param string $newOwner The new owner's name. + * @param array|null $teamIDs Optional. The IDs of the teams that will be granted access. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $newOwner, + ?array $teamIDs = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/transfer"; + + // Set the transfer data. + $data = new \stdClass(); + $data->new_owner = $newOwner; + if ($teamIDs !== null) + { + $data->team_ids = $teamIDs; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 202 + ); + } + + /** + * Accept a repo transfer. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function accept(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/transfer/accept"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 202 + ); + } + + /** + * Reject a repo transfer. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function reject(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/transfer/reject"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ) + ); + } diff --git a/src/04adb831-c257-4657-a2c3-a17096b6b5cf/settings.json b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/settings.json new file mode 100644 index 0000000..6784cda --- /dev/null +++ b/src/04adb831-c257-4657-a2c3-a17096b6b5cf/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "04adb831-c257-4657-a2c3-a17096b6b5cf", + "implements": null, + "load_selection": null, + "name": "Transfer", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Transfer", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Transfer", + "description": "The Gitea Repository Transfer\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/README.md b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/README.md new file mode 100644 index 0000000..b46b297 --- /dev/null +++ b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/README.md @@ -0,0 +1,81 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea\Organization\Teams** +```uml +@startuml +class Repository #Gold { + + list(int $teamId, int $pageNumber = 1, ...) : ?array + + get(int $teamId, string $organization, ...) : ?object + + add(int $id, string $org, ...) : string + + remove(int $id, string $org, ...) : string +} + +note right of Repository::list + List a team's repos. + + since: 3.2.0 + return: ?array + + arguments: + int $teamId + int $pageNumber = 1 + int $pageSize = 10 +end note + +note right of Repository::get + List a particular repo of the team. + + since: 3.2.0 + return: ?object + + arguments: + int $teamId + string $organization + string $repository +end note + +note right of Repository::add + Add a repository to a team. + + since: 3.2.0 + return: string + + arguments: + int $id + string $org + string $repo +end note + +note right of Repository::remove + Remove a repository from a team. + + since: 3.2.0 + return: string + + arguments: + int $id + string $org + string $repo +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.php b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.php new file mode 100644 index 0000000..f485c09 --- /dev/null +++ b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.php @@ -0,0 +1,135 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization\Teams; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Teams Repository + * + * @since 3.2.0 + */ +class Repository extends Api +{ + /** + * List a team's repos. + * + * @param int $teamId The team ID. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $teamId, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/teams/{$teamId}/repos"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List a particular repo of the team. + * + * @param int $teamId The team ID. + * @param string $organization The organization name. + * @param string $repository The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + int $teamId, + string $organization, + string $repository + ): ?object + { + // Build the request path. + $path = "/teams/{$teamId}/repos/{$organization}/{$repository}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add a repository to a team. + * + * @param int $id The team ID. + * @param string $org The organization name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function add( + int $id, + string $org, + string $repo + ): string + { + // Build the request path. + $path = "/teams/{$id}/repos/{$org}/{$repo}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ),204, 'success' + ); + } + + /** + * Remove a repository from a team. + * + * @param int $id The team ID. + * @param string $org The organization name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function remove(int $id, string $org, string $repo): string + { + // Build the request path. + $path = "/teams/{$id}/repos/{$org}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.power b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.power new file mode 100644 index 0000000..ab53c25 --- /dev/null +++ b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.power @@ -0,0 +1,108 @@ + /** + * List a team's repos. + * + * @param int $teamId The team ID. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $teamId, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/teams/{$teamId}/repos"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List a particular repo of the team. + * + * @param int $teamId The team ID. + * @param string $organization The organization name. + * @param string $repository The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + int $teamId, + string $organization, + string $repository + ): ?object + { + // Build the request path. + $path = "/teams/{$teamId}/repos/{$organization}/{$repository}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add a repository to a team. + * + * @param int $id The team ID. + * @param string $org The organization name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function add( + int $id, + string $org, + string $repo + ): string + { + // Build the request path. + $path = "/teams/{$id}/repos/{$org}/{$repo}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ),204, 'success' + ); + } + + /** + * Remove a repository from a team. + * + * @param int $id The team ID. + * @param string $org The organization name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function remove(int $id, string $org, string $repo): string + { + // Build the request path. + $path = "/teams/{$id}/repos/{$org}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/settings.json b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/settings.json new file mode 100644 index 0000000..0f8e94d --- /dev/null +++ b/src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "07fce5f7-eb13-4dda-8870-77c9ad32a7bf", + "implements": null, + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Teams.Repository", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Teams.Repository", + "description": "The Gitea Organization Teams Repository\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/README.md b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/README.md new file mode 100644 index 0000000..5b2c67b --- /dev/null +++ b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/README.md @@ -0,0 +1,149 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class User (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class User #Gold { + + register(Container $container) : void + + getUser(Container $container) : Usr + + getApplications(Container $container) : Applications + + getEmails(Container $container) : Emails + + getFollowers(Container $container) : Followers + + getFollowing(Container $container) : Following + + getGpg(Container $container) : Gpg + + getKeys(Container $container) : Keys + + getRepos(Container $container) : Repos + + getSettings(Container $container) : Settings + + getStarred(Container $container) : Starred + + getSubscriptions(Container $container) : Subscriptions + + getTeams(Container $container) : Teams + + getTimes(Container $container) : Times + + getTokens(Container $container) : Tokens +} + +note right of User::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of User::getUser + Get the User class + + since: 3.2.0 + return: Usr +end note + +note right of User::getApplications + Get the Applications class + + since: 3.2.0 + return: Applications +end note + +note left of User::getEmails + Get the Emails class + + since: 3.2.0 + return: Emails +end note + +note right of User::getFollowers + Get the Followers class + + since: 3.2.0 + return: Followers +end note + +note left of User::getFollowing + Get the Following class + + since: 3.2.0 + return: Following +end note + +note right of User::getGpg + Get the Gpg class + + since: 3.2.0 + return: Gpg +end note + +note left of User::getKeys + Get the Keys class + + since: 3.2.0 + return: Keys +end note + +note right of User::getRepos + Get the Repos class + + since: 3.2.0 + return: Repos +end note + +note left of User::getSettings + Get the Settings class + + since: 3.2.0 + return: Settings +end note + +note right of User::getStarred + Get the Starred class + + since: 3.2.0 + return: Starred +end note + +note left of User::getSubscriptions + Get the Subscriptions class + + since: 3.2.0 + return: Subscriptions +end note + +note right of User::getTeams + Get the Teams class + + since: 3.2.0 + return: Teams +end note + +note left of User::getTimes + Get the Times class + + since: 3.2.0 + return: Times +end note + +note right of User::getTokens + Get the Tokens class + + since: 3.2.0 + return: Tokens +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.php b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.php new file mode 100644 index 0000000..63bc120 --- /dev/null +++ b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.php @@ -0,0 +1,332 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\User as Usr; +use VDM\Joomla\Gitea\User\Applications; +use VDM\Joomla\Gitea\User\Emails; +use VDM\Joomla\Gitea\User\Followers; +use VDM\Joomla\Gitea\User\Following; +use VDM\Joomla\Gitea\User\Gpg; +use VDM\Joomla\Gitea\User\Keys; +use VDM\Joomla\Gitea\User\Repos; +use VDM\Joomla\Gitea\User\Settings; +use VDM\Joomla\Gitea\User\Starred; +use VDM\Joomla\Gitea\User\Subscriptions; +use VDM\Joomla\Gitea\User\Teams; +use VDM\Joomla\Gitea\User\Times; +use VDM\Joomla\Gitea\User\Tokens; + + +/** + * The Gitea User Service + * + * @since 3.2.0 + */ +class User implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Usr::class, 'Gitea.User') + ->share('Gitea.User', [$this, 'getUser'], true); + + $container->alias(Applications::class, 'Gitea.User.Applications') + ->share('Gitea.User.Applications', [$this, 'getApplications'], true); + + $container->alias(Emails::class, 'Gitea.User.Emails') + ->share('Gitea.User.Emails', [$this, 'getEmails'], true); + + $container->alias(Followers::class, 'Gitea.User.Followers') + ->share('Gitea.User.Followers', [$this, 'getFollowers'], true); + + $container->alias(Following::class, 'Gitea.User.Following') + ->share('Gitea.User.Following', [$this, 'getFollowing'], true); + + $container->alias(Gpg::class, 'Gitea.User.Gpg') + ->share('Gitea.User.Gpg', [$this, 'getGpg'], true); + + $container->alias(Keys::class, 'Gitea.User.Keys') + ->share('Gitea.User.Keys', [$this, 'getKeys'], true); + + $container->alias(Repos::class, 'Gitea.User.Repos') + ->share('Gitea.User.Repos', [$this, 'getRepos'], true); + + $container->alias(Settings::class, 'Gitea.User.Settings') + ->share('Gitea.User.Settings', [$this, 'getSettings'], true); + + $container->alias(Starred::class, 'Gitea.User.Starred') + ->share('Gitea.User.Starred', [$this, 'getStarred'], true); + + $container->alias(Subscriptions::class, 'Gitea.User.Subscriptions') + ->share('Gitea.User.Subscriptions', [$this, 'getSubscriptions'], true); + + $container->alias(Teams::class, 'Gitea.User.Teams') + ->share('Gitea.User.Teams', [$this, 'getTeams'], true); + + $container->alias(Times::class, 'Gitea.User.Times') + ->share('Gitea.User.Times', [$this, 'getTimes'], true); + + $container->alias(Tokens::class, 'Gitea.User.Tokens') + ->share('Gitea.User.Tokens', [$this, 'getTokens'], true); + } + + /** + * Get the User class + * + * @param Container $container The DI container. + * + * @return Usr + * @since 3.2.0 + */ + public function getUser(Container $container): Usr + { + return new Usr( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Applications class + * + * @param Container $container The DI container. + * + * @return Applications + * @since 3.2.0 + */ + public function getApplications(Container $container): Applications + { + return new Applications( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Emails class + * + * @param Container $container The DI container. + * + * @return Emails + * @since 3.2.0 + */ + public function getEmails(Container $container): Emails + { + return new Emails( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Followers class + * + * @param Container $container The DI container. + * + * @return Followers + * @since 3.2.0 + */ + public function getFollowers(Container $container): Followers + { + return new Followers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Following class + * + * @param Container $container The DI container. + * + * @return Following + * @since 3.2.0 + */ + public function getFollowing(Container $container): Following + { + return new Following( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Gpg class + * + * @param Container $container The DI container. + * + * @return Gpg + * @since 3.2.0 + */ + public function getGpg(Container $container): Gpg + { + return new Gpg( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Keys class + * + * @param Container $container The DI container. + * + * @return Keys + * @since 3.2.0 + */ + public function getKeys(Container $container): Keys + { + return new Keys( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repos class + * + * @param Container $container The DI container. + * + * @return Repos + * @since 3.2.0 + */ + public function getRepos(Container $container): Repos + { + return new Repos( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Settings class + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + return new Settings( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Starred class + * + * @param Container $container The DI container. + * + * @return Starred + * @since 3.2.0 + */ + public function getStarred(Container $container): Starred + { + return new Starred( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Subscriptions class + * + * @param Container $container The DI container. + * + * @return Subscriptions + * @since 3.2.0 + */ + public function getSubscriptions(Container $container): Subscriptions + { + return new Subscriptions( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams class + * + * @param Container $container The DI container. + * + * @return Teams + * @since 3.2.0 + */ + public function getTeams(Container $container): Teams + { + return new Teams( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Times class + * + * @param Container $container The DI container. + * + * @return Times + * @since 3.2.0 + */ + public function getTimes(Container $container): Times + { + return new Times( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Tokens class + * + * @param Container $container The DI container. + * + * @return Tokens + * @since 3.2.0 + */ + public function getTokens(Container $container): Tokens + { + return new Tokens( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.power b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.power new file mode 100644 index 0000000..c2c00b7 --- /dev/null +++ b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.power @@ -0,0 +1,290 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Usr::class, 'Gitea.User') + ->share('Gitea.User', [$this, 'getUser'], true); + + $container->alias(Applications::class, 'Gitea.User.Applications') + ->share('Gitea.User.Applications', [$this, 'getApplications'], true); + + $container->alias(Emails::class, 'Gitea.User.Emails') + ->share('Gitea.User.Emails', [$this, 'getEmails'], true); + + $container->alias(Followers::class, 'Gitea.User.Followers') + ->share('Gitea.User.Followers', [$this, 'getFollowers'], true); + + $container->alias(Following::class, 'Gitea.User.Following') + ->share('Gitea.User.Following', [$this, 'getFollowing'], true); + + $container->alias(Gpg::class, 'Gitea.User.Gpg') + ->share('Gitea.User.Gpg', [$this, 'getGpg'], true); + + $container->alias(Keys::class, 'Gitea.User.Keys') + ->share('Gitea.User.Keys', [$this, 'getKeys'], true); + + $container->alias(Repos::class, 'Gitea.User.Repos') + ->share('Gitea.User.Repos', [$this, 'getRepos'], true); + + $container->alias(Settings::class, 'Gitea.User.Settings') + ->share('Gitea.User.Settings', [$this, 'getSettings'], true); + + $container->alias(Starred::class, 'Gitea.User.Starred') + ->share('Gitea.User.Starred', [$this, 'getStarred'], true); + + $container->alias(Subscriptions::class, 'Gitea.User.Subscriptions') + ->share('Gitea.User.Subscriptions', [$this, 'getSubscriptions'], true); + + $container->alias(Teams::class, 'Gitea.User.Teams') + ->share('Gitea.User.Teams', [$this, 'getTeams'], true); + + $container->alias(Times::class, 'Gitea.User.Times') + ->share('Gitea.User.Times', [$this, 'getTimes'], true); + + $container->alias(Tokens::class, 'Gitea.User.Tokens') + ->share('Gitea.User.Tokens', [$this, 'getTokens'], true); + } + + /** + * Get the User class + * + * @param Container $container The DI container. + * + * @return Usr + * @since 3.2.0 + */ + public function getUser(Container $container): Usr + { + return new Usr( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Applications class + * + * @param Container $container The DI container. + * + * @return Applications + * @since 3.2.0 + */ + public function getApplications(Container $container): Applications + { + return new Applications( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Emails class + * + * @param Container $container The DI container. + * + * @return Emails + * @since 3.2.0 + */ + public function getEmails(Container $container): Emails + { + return new Emails( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Followers class + * + * @param Container $container The DI container. + * + * @return Followers + * @since 3.2.0 + */ + public function getFollowers(Container $container): Followers + { + return new Followers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Following class + * + * @param Container $container The DI container. + * + * @return Following + * @since 3.2.0 + */ + public function getFollowing(Container $container): Following + { + return new Following( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Gpg class + * + * @param Container $container The DI container. + * + * @return Gpg + * @since 3.2.0 + */ + public function getGpg(Container $container): Gpg + { + return new Gpg( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Keys class + * + * @param Container $container The DI container. + * + * @return Keys + * @since 3.2.0 + */ + public function getKeys(Container $container): Keys + { + return new Keys( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repos class + * + * @param Container $container The DI container. + * + * @return Repos + * @since 3.2.0 + */ + public function getRepos(Container $container): Repos + { + return new Repos( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Settings class + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + return new Settings( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Starred class + * + * @param Container $container The DI container. + * + * @return Starred + * @since 3.2.0 + */ + public function getStarred(Container $container): Starred + { + return new Starred( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Subscriptions class + * + * @param Container $container The DI container. + * + * @return Subscriptions + * @since 3.2.0 + */ + public function getSubscriptions(Container $container): Subscriptions + { + return new Subscriptions( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams class + * + * @param Container $container The DI container. + * + * @return Teams + * @since 3.2.0 + */ + public function getTeams(Container $container): Teams + { + return new Teams( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Times class + * + * @param Container $container The DI container. + * + * @return Times + * @since 3.2.0 + */ + public function getTimes(Container $container): Times + { + return new Times( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Tokens class + * + * @param Container $container The DI container. + * + * @return Tokens + * @since 3.2.0 + */ + public function getTokens(Container $container): Tokens + { + return new Tokens( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/settings.json b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/settings.json new file mode 100644 index 0000000..6a4d71e --- /dev/null +++ b/src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/settings.json @@ -0,0 +1,78 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "User", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.User", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "4a5694db-bf3c-439b-bf9c-36a487828787", + "as": "Usr" + }, + "use_selection1": { + "use": "4a9e144e-7754-4d3f-9325-9ff792ce4aef", + "as": "default" + }, + "use_selection2": { + "use": "af4b8b77-d773-42a7-9f54-19de463bc49b", + "as": "default" + }, + "use_selection3": { + "use": "13931443-bad7-4742-b64e-c08042e7b306", + "as": "default" + }, + "use_selection4": { + "use": "b1788488-f557-4746-9929-73e1d049b4a2", + "as": "default" + }, + "use_selection5": { + "use": "f135ca7f-4d50-4480-a15f-feae1a7982ab", + "as": "default" + }, + "use_selection6": { + "use": "c521f8c3-4e01-4c1a-8f68-f3e9d967651d", + "as": "default" + }, + "use_selection7": { + "use": "fd560f3e-ce19-474f-86ca-1fb1d3af9992", + "as": "default" + }, + "use_selection8": { + "use": "553b8fc5-46cc-49b7-95ce-992a3c5708f8", + "as": "default" + }, + "use_selection9": { + "use": "884b61d0-1f56-4f5f-a657-acaacdb9634b", + "as": "default" + }, + "use_selection10": { + "use": "b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf", + "as": "default" + }, + "use_selection11": { + "use": "c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3", + "as": "default" + }, + "use_selection12": { + "use": "2ccb303f-b115-45fb-b3ea-08a38259681e", + "as": "default" + }, + "use_selection13": { + "use": "af49b450-78fb-40bd-8165-48466ebd31a9", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.User", + "description": "The Gitea User Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/README.md b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/README.md new file mode 100644 index 0000000..7ed6e4e --- /dev/null +++ b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/README.md @@ -0,0 +1,341 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Repository #Gold { + + register(Container $container) : void + + getRepository(Container $container) : Repo + + getArchive(Container $container) : Archive + + getAssignees(Container $container) : Assignees + + getAttachments(Container $container) : Attachments + + getBranch(Container $container) : Branch + + getProtection(Container $container) : Protection + + getCollaborator(Container $container) : Collaborator + + getCommits(Container $container) : Commits + + getContents(Container $container) : Contents + + getForks(Container $container) : Forks + + getGpg(Container $container) : Gpg + + getHooks(Container $container) : Hooks + + getGit(Container $container) : Git + + getKeys(Container $container) : Keys + + getLanguages(Container $container) : Languages + + getMedia(Container $container) : Media + + getMerge(Container $container) : Merge + + getMirror(Container $container) : Mirror + + getMirrors(Container $container) : Mirrors + + getNotes(Container $container) : Notes + + getPatch(Container $container) : Patch + + getPulls(Container $container) : Pulls + + getRefs(Container $container) : Refs + + getReleases(Container $container) : Releases + + getRemote(Container $container) : Remote + + getReviewers(Container $container) : Reviewers + + getReviews(Container $container) : Reviews + + getStargazers(Container $container) : Stargazers + + getStatuses(Container $container) : Statuses + + getTags(Container $container) : Tags + + getTeams(Container $container) : Teams + + getTemplates(Container $container) : Templates + + getTimes(Container $container) : Times + + getTopics(Container $container) : Topics + + getTransfer(Container $container) : Transfer + + getTrees(Container $container) : Trees + + getWatchers(Container $container) : Watchers + + getWiki(Container $container) : Wiki +} + +note right of Repository::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Repository::getRepository + Get the Repository class + + since: 3.2.0 + return: Repo +end note + +note right of Repository::getArchive + Get the Archive class + + since: 3.2.0 + return: Archive +end note + +note left of Repository::getAssignees + Get the Assignees class + + since: 3.2.0 + return: Assignees +end note + +note right of Repository::getAttachments + Get the Attachments class + + since: 3.2.0 + return: Attachments +end note + +note left of Repository::getBranch + Get the Branch class + + since: 3.2.0 + return: Branch +end note + +note right of Repository::getProtection + Get the Branch Protection class + + since: 3.2.0 + return: Protection +end note + +note left of Repository::getCollaborator + Get the Collaborator class + + since: 3.2.0 + return: Collaborator +end note + +note right of Repository::getCommits + Get the Commits class + + since: 3.2.0 + return: Commits +end note + +note left of Repository::getContents + Get the Contents class + + since: 3.2.0 + return: Contents +end note + +note right of Repository::getForks + Get the Forks class + + since: 3.2.0 + return: Forks +end note + +note left of Repository::getGpg + Get the Gpg class + + since: 3.2.0 + return: Gpg +end note + +note right of Repository::getHooks + Get the Hooks class + + since: 3.2.0 + return: Hooks +end note + +note left of Repository::getGit + Get the Hooks Git class + + since: 3.2.0 + return: Git +end note + +note right of Repository::getKeys + Get the Keys class + + since: 3.2.0 + return: Keys +end note + +note left of Repository::getLanguages + Get the Languages class + + since: 3.2.0 + return: Languages +end note + +note right of Repository::getMedia + Get the Media class + + since: 3.2.0 + return: Media +end note + +note left of Repository::getMerge + Get the Merge class + + since: 3.2.0 + return: Merge +end note + +note right of Repository::getMirror + Get the Mirror class + + since: 3.2.0 + return: Mirror +end note + +note left of Repository::getMirrors + Get the Mirrors class + + since: 3.2.0 + return: Mirrors +end note + +note right of Repository::getNotes + Get the Notes class + + since: 3.2.0 + return: Notes +end note + +note left of Repository::getPatch + Get the Patch class + + since: 3.2.0 + return: Patch +end note + +note right of Repository::getPulls + Get the Pulls class + + since: 3.2.0 + return: Pulls +end note + +note left of Repository::getRefs + Get the Refs class + + since: 3.2.0 + return: Refs +end note + +note right of Repository::getReleases + Get the Releases class + + since: 3.2.0 + return: Releases +end note + +note left of Repository::getRemote + Get the Remote class + + since: 3.2.0 + return: Remote +end note + +note right of Repository::getReviewers + Get the Reviewers class + + since: 3.2.0 + return: Reviewers +end note + +note left of Repository::getReviews + Get the Reviews class + + since: 3.2.0 + return: Reviews +end note + +note right of Repository::getStargazers + Get the Stargazers class + + since: 3.2.0 + return: Stargazers +end note + +note left of Repository::getStatuses + Get the Statuses class + + since: 3.2.0 + return: Statuses +end note + +note right of Repository::getTags + Get the Tags class + + since: 3.2.0 + return: Tags +end note + +note left of Repository::getTeams + Get the Teams class + + since: 3.2.0 + return: Teams +end note + +note right of Repository::getTemplates + Get the Templates class + + since: 3.2.0 + return: Templates +end note + +note left of Repository::getTimes + Get the Times class + + since: 3.2.0 + return: Times +end note + +note right of Repository::getTopics + Get the Topics class + + since: 3.2.0 + return: Topics +end note + +note left of Repository::getTransfer + Get the Transfer class + + since: 3.2.0 + return: Transfer +end note + +note right of Repository::getTrees + Get the Trees class + + since: 3.2.0 + return: Trees +end note + +note left of Repository::getWatchers + Get the Watchers class + + since: 3.2.0 + return: Watchers +end note + +note right of Repository::getWiki + Get the Wiki class + + since: 3.2.0 + return: Wiki +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.php b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.php new file mode 100644 index 0000000..edfab0d --- /dev/null +++ b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.php @@ -0,0 +1,836 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Repository as Repo; +use VDM\Joomla\Gitea\Repository\Archive; +use VDM\Joomla\Gitea\Repository\Assignees; +use VDM\Joomla\Gitea\Repository\Attachments; +use VDM\Joomla\Gitea\Repository\Branch; +use VDM\Joomla\Gitea\Repository\Branch\Protection; +use VDM\Joomla\Gitea\Repository\Collaborator; +use VDM\Joomla\Gitea\Repository\Commits; +use VDM\Joomla\Gitea\Repository\Contents; +use VDM\Joomla\Gitea\Repository\Forks; +use VDM\Joomla\Gitea\Repository\Gpg; +use VDM\Joomla\Gitea\Repository\Hooks; +use VDM\Joomla\Gitea\Repository\Hooks\Git; +use VDM\Joomla\Gitea\Repository\Keys; +use VDM\Joomla\Gitea\Repository\Languages; +use VDM\Joomla\Gitea\Repository\Media; +use VDM\Joomla\Gitea\Repository\Merge; +use VDM\Joomla\Gitea\Repository\Mirror; +use VDM\Joomla\Gitea\Repository\Mirrors; +use VDM\Joomla\Gitea\Repository\Notes; +use VDM\Joomla\Gitea\Repository\Patch; +use VDM\Joomla\Gitea\Repository\Pulls; +use VDM\Joomla\Gitea\Repository\Refs; +use VDM\Joomla\Gitea\Repository\Releases; +use VDM\Joomla\Gitea\Repository\Remote; +use VDM\Joomla\Gitea\Repository\Reviewers; +use VDM\Joomla\Gitea\Repository\Reviews; +use VDM\Joomla\Gitea\Repository\Stargazers; +use VDM\Joomla\Gitea\Repository\Statuses; +use VDM\Joomla\Gitea\Repository\Tags; +use VDM\Joomla\Gitea\Repository\Teams; +use VDM\Joomla\Gitea\Repository\Templates; +use VDM\Joomla\Gitea\Repository\Times; +use VDM\Joomla\Gitea\Repository\Topics; +use VDM\Joomla\Gitea\Repository\Transfer; +use VDM\Joomla\Gitea\Repository\Trees; +use VDM\Joomla\Gitea\Repository\Watchers; +use VDM\Joomla\Gitea\Repository\Wiki; + + +/** + * The Gitea Repository Service + * + * @since 3.2.0 + */ +class Repository implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Repo::class, 'Gitea.Repository') + ->share('Gitea.Repository', [$this, 'getRepository'], true); + + $container->alias(Archive::class, 'Gitea.Repository.Archive') + ->share('Gitea.Repository.Archive', [$this, 'getArchive'], true); + + $container->alias(Assignees::class, 'Gitea.Repository.Assignees') + ->share('Gitea.Repository.Assignees', [$this, 'getAssignees'], true); + + $container->alias(Attachments::class, 'Gitea.Repository.Attachments') + ->share('Gitea.Repository.Attachments', [$this, 'getAttachments'], true); + + $container->alias(Branch::class, 'Gitea.Repository.Branch') + ->share('Gitea.Repository.Branch', [$this, 'getBranch'], true); + + $container->alias(Protection::class, 'Gitea.Repository.Branch.Protection') + ->share('Gitea.Repository.Branch.Protection', [$this, 'getProtection'], true); + + $container->alias(Collaborator::class, 'Gitea.Repository.Collaborator') + ->share('Gitea.Repository.Collaborator', [$this, 'getCollaborator'], true); + + $container->alias(Commits::class, 'Gitea.Repository.Commits') + ->share('Gitea.Repository.Commits', [$this, 'getCommits'], true); + + $container->alias(Contents::class, 'Gitea.Repository.Contents') + ->share('Gitea.Repository.Contents', [$this, 'getContents'], true); + + $container->alias(Forks::class, 'Gitea.Repository.Forks') + ->share('Gitea.Repository.Forks', [$this, 'getForks'], true); + + $container->alias(Gpg::class, 'Gitea.Repository.Gpg') + ->share('Gitea.Repository.Gpg', [$this, 'getGpg'], true); + + $container->alias(Hooks::class, 'Gitea.Repository.Hooks') + ->share('Gitea.Repository.Hooks', [$this, 'getHooks'], true); + + $container->alias(Git::class, 'Gitea.Repository.Hooks.Git') + ->share('Gitea.Repository.Hooks.Git', [$this, 'getGit'], true); + + $container->alias(Keys::class, 'Gitea.Repository.Keys') + ->share('Gitea.Repository.Keys', [$this, 'getKeys'], true); + + $container->alias(Languages::class, 'Gitea.Repository.Languages') + ->share('Gitea.Repository.Languages', [$this, 'getLanguages'], true); + + $container->alias(Media::class, 'Gitea.Repository.Media') + ->share('Gitea.Repository.Media', [$this, 'getMedia'], true); + + $container->alias(Merge::class, 'Gitea.Repository.Merge') + ->share('Gitea.Repository.Merge', [$this, 'getMerge'], true); + + $container->alias(Mirror::class, 'Gitea.Repository.Mirror') + ->share('Gitea.Repository.Mirror', [$this, 'getMirror'], true); + + $container->alias(Mirrors::class, 'Gitea.Repository.Mirrors') + ->share('Gitea.Repository.Mirrors', [$this, 'getMirrors'], true); + + $container->alias(Notes::class, 'Gitea.Repository.Notes') + ->share('Gitea.Repository.Notes', [$this, 'getNotes'], true); + + $container->alias(Patch::class, 'Gitea.Repository.Patch') + ->share('Gitea.Repository.Patch', [$this, 'getPatch'], true); + + $container->alias(Pulls::class, 'Gitea.Repository.Pulls') + ->share('Gitea.Repository.Pulls', [$this, 'getPulls'], true); + + $container->alias(Refs::class, 'Gitea.Repository.Refs') + ->share('Gitea.Repository.Refs', [$this, 'getRefs'], true); + + $container->alias(Releases::class, 'Gitea.Repository.Releases') + ->share('Gitea.Repository.Releases', [$this, 'getReleases'], true); + + $container->alias(Remote::class, 'Gitea.Repository.Remote') + ->share('Gitea.Repository.Remote', [$this, 'getRemote'], true); + + $container->alias(Reviewers::class, 'Gitea.Repository.Reviewers') + ->share('Gitea.Repository.Reviewers', [$this, 'getReviewers'], true); + + $container->alias(Reviews::class, 'Gitea.Repository.Reviews') + ->share('Gitea.Repository.Reviews', [$this, 'getReviews'], true); + + $container->alias(Stargazers::class, 'Gitea.Repository.Stargazers') + ->share('Gitea.Repository.Stargazers', [$this, 'getStargazers'], true); + + $container->alias(Statuses::class, 'Gitea.Repository.Statuses') + ->share('Gitea.Repository.Statuses', [$this, 'getStatuses'], true); + + $container->alias(Tags::class, 'Gitea.Repository.Tags') + ->share('Gitea.Repository.Tags', [$this, 'getTags'], true); + + $container->alias(Teams::class, 'Gitea.Repository.Teams') + ->share('Gitea.Repository.Teams', [$this, 'getTeams'], true); + + $container->alias(Templates::class, 'Gitea.Repository.Templates') + ->share('Gitea.Repository.Templates', [$this, 'getTemplates'], true); + + $container->alias(Times::class, 'Gitea.Repository.Times') + ->share('Gitea.Repository.Times', [$this, 'getTimes'], true); + + $container->alias(Topics::class, 'Gitea.Repository.Topics') + ->share('Gitea.Repository.Topics', [$this, 'getTopics'], true); + + $container->alias(Transfer::class, 'Gitea.Repository.Transfer') + ->share('Gitea.Repository.Transfer', [$this, 'getTransfer'], true); + + $container->alias(Trees::class, 'Gitea.Repository.Trees') + ->share('Gitea.Repository.Trees', [$this, 'getTrees'], true); + + $container->alias(Watchers::class, 'Gitea.Repository.Watchers') + ->share('Gitea.Repository.Watchers', [$this, 'getWatchers'], true); + + $container->alias(Wiki::class, 'Gitea.Repository.Wiki') + ->share('Gitea.Repository.Wiki', [$this, 'getWiki'], true); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repo + * @since 3.2.0 + */ + public function getRepository(Container $container): Repo + { + return new Repo( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Archive class + * + * @param Container $container The DI container. + * + * @return Archive + * @since 3.2.0 + */ + public function getArchive(Container $container): Archive + { + return new Archive( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Assignees class + * + * @param Container $container The DI container. + * + * @return Assignees + * @since 3.2.0 + */ + public function getAssignees(Container $container): Assignees + { + return new Assignees( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Attachments class + * + * @param Container $container The DI container. + * + * @return Attachments + * @since 3.2.0 + */ + public function getAttachments(Container $container): Attachments + { + return new Attachments( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Branch class + * + * @param Container $container The DI container. + * + * @return Branch + * @since 3.2.0 + */ + public function getBranch(Container $container): Branch + { + return new Branch( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Branch Protection class + * + * @param Container $container The DI container. + * + * @return Protection + * @since 3.2.0 + */ + public function getProtection(Container $container): Protection + { + return new Protection( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Collaborator class + * + * @param Container $container The DI container. + * + * @return Collaborator + * @since 3.2.0 + */ + public function getCollaborator(Container $container): Collaborator + { + return new Collaborator( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Commits class + * + * @param Container $container The DI container. + * + * @return Commits + * @since 3.2.0 + */ + public function getCommits(Container $container): Commits + { + return new Commits( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Contents class + * + * @param Container $container The DI container. + * + * @return Contents + * @since 3.2.0 + */ + public function getContents(Container $container): Contents + { + return new Contents( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Forks class + * + * @param Container $container The DI container. + * + * @return Forks + * @since 3.2.0 + */ + public function getForks(Container $container): Forks + { + return new Forks( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Gpg class + * + * @param Container $container The DI container. + * + * @return Gpg + * @since 3.2.0 + */ + public function getGpg(Container $container): Gpg + { + return new Gpg( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Hooks class + * + * @param Container $container The DI container. + * + * @return Hooks + * @since 3.2.0 + */ + public function getHooks(Container $container): Hooks + { + return new Hooks( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Hooks Git class + * + * @param Container $container The DI container. + * + * @return Git + * @since 3.2.0 + */ + public function getGit(Container $container): Git + { + return new Git( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Keys class + * + * @param Container $container The DI container. + * + * @return Keys + * @since 3.2.0 + */ + public function getKeys(Container $container): Keys + { + return new Keys( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Languages class + * + * @param Container $container The DI container. + * + * @return Languages + * @since 3.2.0 + */ + public function getLanguages(Container $container): Languages + { + return new Languages( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Media class + * + * @param Container $container The DI container. + * + * @return Media + * @since 3.2.0 + */ + public function getMedia(Container $container): Media + { + return new Media( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Merge class + * + * @param Container $container The DI container. + * + * @return Merge + * @since 3.2.0 + */ + public function getMerge(Container $container): Merge + { + return new Merge( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Mirror class + * + * @param Container $container The DI container. + * + * @return Mirror + * @since 3.2.0 + */ + public function getMirror(Container $container): Mirror + { + return new Mirror( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Mirrors class + * + * @param Container $container The DI container. + * + * @return Mirrors + * @since 3.2.0 + */ + public function getMirrors(Container $container): Mirrors + { + return new Mirrors( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Notes class + * + * @param Container $container The DI container. + * + * @return Notes + * @since 3.2.0 + */ + public function getNotes(Container $container): Notes + { + return new Notes( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Patch class + * + * @param Container $container The DI container. + * + * @return Patch + * @since 3.2.0 + */ + public function getPatch(Container $container): Patch + { + return new Patch( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Pulls class + * + * @param Container $container The DI container. + * + * @return Pulls + * @since 3.2.0 + */ + public function getPulls(Container $container): Pulls + { + return new Pulls( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Refs class + * + * @param Container $container The DI container. + * + * @return Refs + * @since 3.2.0 + */ + public function getRefs(Container $container): Refs + { + return new Refs( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Releases class + * + * @param Container $container The DI container. + * + * @return Releases + * @since 3.2.0 + */ + public function getReleases(Container $container): Releases + { + return new Releases( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Remote class + * + * @param Container $container The DI container. + * + * @return Remote + * @since 3.2.0 + */ + public function getRemote(Container $container): Remote + { + return new Remote( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reviewers class + * + * @param Container $container The DI container. + * + * @return Reviewers + * @since 3.2.0 + */ + public function getReviewers(Container $container): Reviewers + { + return new Reviewers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reviews class + * + * @param Container $container The DI container. + * + * @return Reviews + * @since 3.2.0 + */ + public function getReviews(Container $container): Reviews + { + return new Reviews( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Stargazers class + * + * @param Container $container The DI container. + * + * @return Stargazers + * @since 3.2.0 + */ + public function getStargazers(Container $container): Stargazers + { + return new Stargazers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Statuses class + * + * @param Container $container The DI container. + * + * @return Statuses + * @since 3.2.0 + */ + public function getStatuses(Container $container): Statuses + { + return new Statuses( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Tags class + * + * @param Container $container The DI container. + * + * @return Tags + * @since 3.2.0 + */ + public function getTags(Container $container): Tags + { + return new Tags( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams class + * + * @param Container $container The DI container. + * + * @return Teams + * @since 3.2.0 + */ + public function getTeams(Container $container): Teams + { + return new Teams( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Templates class + * + * @param Container $container The DI container. + * + * @return Templates + * @since 3.2.0 + */ + public function getTemplates(Container $container): Templates + { + return new Templates( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Times class + * + * @param Container $container The DI container. + * + * @return Times + * @since 3.2.0 + */ + public function getTimes(Container $container): Times + { + return new Times( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Topics class + * + * @param Container $container The DI container. + * + * @return Topics + * @since 3.2.0 + */ + public function getTopics(Container $container): Topics + { + return new Topics( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Transfer class + * + * @param Container $container The DI container. + * + * @return Transfer + * @since 3.2.0 + */ + public function getTransfer(Container $container): Transfer + { + return new Transfer( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Trees class + * + * @param Container $container The DI container. + * + * @return Trees + * @since 3.2.0 + */ + public function getTrees(Container $container): Trees + { + return new Trees( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Watchers class + * + * @param Container $container The DI container. + * + * @return Watchers + * @since 3.2.0 + */ + public function getWatchers(Container $container): Watchers + { + return new Watchers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Wiki class + * + * @param Container $container The DI container. + * + * @return Wiki + * @since 3.2.0 + */ + public function getWiki(Container $container): Wiki + { + return new Wiki( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.power b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.power new file mode 100644 index 0000000..af774ba --- /dev/null +++ b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.power @@ -0,0 +1,770 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Repo::class, 'Gitea.Repository') + ->share('Gitea.Repository', [$this, 'getRepository'], true); + + $container->alias(Archive::class, 'Gitea.Repository.Archive') + ->share('Gitea.Repository.Archive', [$this, 'getArchive'], true); + + $container->alias(Assignees::class, 'Gitea.Repository.Assignees') + ->share('Gitea.Repository.Assignees', [$this, 'getAssignees'], true); + + $container->alias(Attachments::class, 'Gitea.Repository.Attachments') + ->share('Gitea.Repository.Attachments', [$this, 'getAttachments'], true); + + $container->alias(Branch::class, 'Gitea.Repository.Branch') + ->share('Gitea.Repository.Branch', [$this, 'getBranch'], true); + + $container->alias(Protection::class, 'Gitea.Repository.Branch.Protection') + ->share('Gitea.Repository.Branch.Protection', [$this, 'getProtection'], true); + + $container->alias(Collaborator::class, 'Gitea.Repository.Collaborator') + ->share('Gitea.Repository.Collaborator', [$this, 'getCollaborator'], true); + + $container->alias(Commits::class, 'Gitea.Repository.Commits') + ->share('Gitea.Repository.Commits', [$this, 'getCommits'], true); + + $container->alias(Contents::class, 'Gitea.Repository.Contents') + ->share('Gitea.Repository.Contents', [$this, 'getContents'], true); + + $container->alias(Forks::class, 'Gitea.Repository.Forks') + ->share('Gitea.Repository.Forks', [$this, 'getForks'], true); + + $container->alias(Gpg::class, 'Gitea.Repository.Gpg') + ->share('Gitea.Repository.Gpg', [$this, 'getGpg'], true); + + $container->alias(Hooks::class, 'Gitea.Repository.Hooks') + ->share('Gitea.Repository.Hooks', [$this, 'getHooks'], true); + + $container->alias(Git::class, 'Gitea.Repository.Hooks.Git') + ->share('Gitea.Repository.Hooks.Git', [$this, 'getGit'], true); + + $container->alias(Keys::class, 'Gitea.Repository.Keys') + ->share('Gitea.Repository.Keys', [$this, 'getKeys'], true); + + $container->alias(Languages::class, 'Gitea.Repository.Languages') + ->share('Gitea.Repository.Languages', [$this, 'getLanguages'], true); + + $container->alias(Media::class, 'Gitea.Repository.Media') + ->share('Gitea.Repository.Media', [$this, 'getMedia'], true); + + $container->alias(Merge::class, 'Gitea.Repository.Merge') + ->share('Gitea.Repository.Merge', [$this, 'getMerge'], true); + + $container->alias(Mirror::class, 'Gitea.Repository.Mirror') + ->share('Gitea.Repository.Mirror', [$this, 'getMirror'], true); + + $container->alias(Mirrors::class, 'Gitea.Repository.Mirrors') + ->share('Gitea.Repository.Mirrors', [$this, 'getMirrors'], true); + + $container->alias(Notes::class, 'Gitea.Repository.Notes') + ->share('Gitea.Repository.Notes', [$this, 'getNotes'], true); + + $container->alias(Patch::class, 'Gitea.Repository.Patch') + ->share('Gitea.Repository.Patch', [$this, 'getPatch'], true); + + $container->alias(Pulls::class, 'Gitea.Repository.Pulls') + ->share('Gitea.Repository.Pulls', [$this, 'getPulls'], true); + + $container->alias(Refs::class, 'Gitea.Repository.Refs') + ->share('Gitea.Repository.Refs', [$this, 'getRefs'], true); + + $container->alias(Releases::class, 'Gitea.Repository.Releases') + ->share('Gitea.Repository.Releases', [$this, 'getReleases'], true); + + $container->alias(Remote::class, 'Gitea.Repository.Remote') + ->share('Gitea.Repository.Remote', [$this, 'getRemote'], true); + + $container->alias(Reviewers::class, 'Gitea.Repository.Reviewers') + ->share('Gitea.Repository.Reviewers', [$this, 'getReviewers'], true); + + $container->alias(Reviews::class, 'Gitea.Repository.Reviews') + ->share('Gitea.Repository.Reviews', [$this, 'getReviews'], true); + + $container->alias(Stargazers::class, 'Gitea.Repository.Stargazers') + ->share('Gitea.Repository.Stargazers', [$this, 'getStargazers'], true); + + $container->alias(Statuses::class, 'Gitea.Repository.Statuses') + ->share('Gitea.Repository.Statuses', [$this, 'getStatuses'], true); + + $container->alias(Tags::class, 'Gitea.Repository.Tags') + ->share('Gitea.Repository.Tags', [$this, 'getTags'], true); + + $container->alias(Teams::class, 'Gitea.Repository.Teams') + ->share('Gitea.Repository.Teams', [$this, 'getTeams'], true); + + $container->alias(Templates::class, 'Gitea.Repository.Templates') + ->share('Gitea.Repository.Templates', [$this, 'getTemplates'], true); + + $container->alias(Times::class, 'Gitea.Repository.Times') + ->share('Gitea.Repository.Times', [$this, 'getTimes'], true); + + $container->alias(Topics::class, 'Gitea.Repository.Topics') + ->share('Gitea.Repository.Topics', [$this, 'getTopics'], true); + + $container->alias(Transfer::class, 'Gitea.Repository.Transfer') + ->share('Gitea.Repository.Transfer', [$this, 'getTransfer'], true); + + $container->alias(Trees::class, 'Gitea.Repository.Trees') + ->share('Gitea.Repository.Trees', [$this, 'getTrees'], true); + + $container->alias(Watchers::class, 'Gitea.Repository.Watchers') + ->share('Gitea.Repository.Watchers', [$this, 'getWatchers'], true); + + $container->alias(Wiki::class, 'Gitea.Repository.Wiki') + ->share('Gitea.Repository.Wiki', [$this, 'getWiki'], true); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repo + * @since 3.2.0 + */ + public function getRepository(Container $container): Repo + { + return new Repo( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Archive class + * + * @param Container $container The DI container. + * + * @return Archive + * @since 3.2.0 + */ + public function getArchive(Container $container): Archive + { + return new Archive( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Assignees class + * + * @param Container $container The DI container. + * + * @return Assignees + * @since 3.2.0 + */ + public function getAssignees(Container $container): Assignees + { + return new Assignees( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Attachments class + * + * @param Container $container The DI container. + * + * @return Attachments + * @since 3.2.0 + */ + public function getAttachments(Container $container): Attachments + { + return new Attachments( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Branch class + * + * @param Container $container The DI container. + * + * @return Branch + * @since 3.2.0 + */ + public function getBranch(Container $container): Branch + { + return new Branch( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Branch Protection class + * + * @param Container $container The DI container. + * + * @return Protection + * @since 3.2.0 + */ + public function getProtection(Container $container): Protection + { + return new Protection( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Collaborator class + * + * @param Container $container The DI container. + * + * @return Collaborator + * @since 3.2.0 + */ + public function getCollaborator(Container $container): Collaborator + { + return new Collaborator( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Commits class + * + * @param Container $container The DI container. + * + * @return Commits + * @since 3.2.0 + */ + public function getCommits(Container $container): Commits + { + return new Commits( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Contents class + * + * @param Container $container The DI container. + * + * @return Contents + * @since 3.2.0 + */ + public function getContents(Container $container): Contents + { + return new Contents( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Forks class + * + * @param Container $container The DI container. + * + * @return Forks + * @since 3.2.0 + */ + public function getForks(Container $container): Forks + { + return new Forks( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Gpg class + * + * @param Container $container The DI container. + * + * @return Gpg + * @since 3.2.0 + */ + public function getGpg(Container $container): Gpg + { + return new Gpg( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Hooks class + * + * @param Container $container The DI container. + * + * @return Hooks + * @since 3.2.0 + */ + public function getHooks(Container $container): Hooks + { + return new Hooks( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Hooks Git class + * + * @param Container $container The DI container. + * + * @return Git + * @since 3.2.0 + */ + public function getGit(Container $container): Git + { + return new Git( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Keys class + * + * @param Container $container The DI container. + * + * @return Keys + * @since 3.2.0 + */ + public function getKeys(Container $container): Keys + { + return new Keys( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Languages class + * + * @param Container $container The DI container. + * + * @return Languages + * @since 3.2.0 + */ + public function getLanguages(Container $container): Languages + { + return new Languages( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Media class + * + * @param Container $container The DI container. + * + * @return Media + * @since 3.2.0 + */ + public function getMedia(Container $container): Media + { + return new Media( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Merge class + * + * @param Container $container The DI container. + * + * @return Merge + * @since 3.2.0 + */ + public function getMerge(Container $container): Merge + { + return new Merge( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Mirror class + * + * @param Container $container The DI container. + * + * @return Mirror + * @since 3.2.0 + */ + public function getMirror(Container $container): Mirror + { + return new Mirror( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Mirrors class + * + * @param Container $container The DI container. + * + * @return Mirrors + * @since 3.2.0 + */ + public function getMirrors(Container $container): Mirrors + { + return new Mirrors( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Notes class + * + * @param Container $container The DI container. + * + * @return Notes + * @since 3.2.0 + */ + public function getNotes(Container $container): Notes + { + return new Notes( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Patch class + * + * @param Container $container The DI container. + * + * @return Patch + * @since 3.2.0 + */ + public function getPatch(Container $container): Patch + { + return new Patch( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Pulls class + * + * @param Container $container The DI container. + * + * @return Pulls + * @since 3.2.0 + */ + public function getPulls(Container $container): Pulls + { + return new Pulls( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Refs class + * + * @param Container $container The DI container. + * + * @return Refs + * @since 3.2.0 + */ + public function getRefs(Container $container): Refs + { + return new Refs( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Releases class + * + * @param Container $container The DI container. + * + * @return Releases + * @since 3.2.0 + */ + public function getReleases(Container $container): Releases + { + return new Releases( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Remote class + * + * @param Container $container The DI container. + * + * @return Remote + * @since 3.2.0 + */ + public function getRemote(Container $container): Remote + { + return new Remote( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reviewers class + * + * @param Container $container The DI container. + * + * @return Reviewers + * @since 3.2.0 + */ + public function getReviewers(Container $container): Reviewers + { + return new Reviewers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reviews class + * + * @param Container $container The DI container. + * + * @return Reviews + * @since 3.2.0 + */ + public function getReviews(Container $container): Reviews + { + return new Reviews( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Stargazers class + * + * @param Container $container The DI container. + * + * @return Stargazers + * @since 3.2.0 + */ + public function getStargazers(Container $container): Stargazers + { + return new Stargazers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Statuses class + * + * @param Container $container The DI container. + * + * @return Statuses + * @since 3.2.0 + */ + public function getStatuses(Container $container): Statuses + { + return new Statuses( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Tags class + * + * @param Container $container The DI container. + * + * @return Tags + * @since 3.2.0 + */ + public function getTags(Container $container): Tags + { + return new Tags( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams class + * + * @param Container $container The DI container. + * + * @return Teams + * @since 3.2.0 + */ + public function getTeams(Container $container): Teams + { + return new Teams( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Templates class + * + * @param Container $container The DI container. + * + * @return Templates + * @since 3.2.0 + */ + public function getTemplates(Container $container): Templates + { + return new Templates( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Times class + * + * @param Container $container The DI container. + * + * @return Times + * @since 3.2.0 + */ + public function getTimes(Container $container): Times + { + return new Times( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Topics class + * + * @param Container $container The DI container. + * + * @return Topics + * @since 3.2.0 + */ + public function getTopics(Container $container): Topics + { + return new Topics( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Transfer class + * + * @param Container $container The DI container. + * + * @return Transfer + * @since 3.2.0 + */ + public function getTransfer(Container $container): Transfer + { + return new Transfer( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Trees class + * + * @param Container $container The DI container. + * + * @return Trees + * @since 3.2.0 + */ + public function getTrees(Container $container): Trees + { + return new Trees( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Watchers class + * + * @param Container $container The DI container. + * + * @return Watchers + * @since 3.2.0 + */ + public function getWatchers(Container $container): Watchers + { + return new Watchers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Wiki class + * + * @param Container $container The DI container. + * + * @return Wiki + * @since 3.2.0 + */ + public function getWiki(Container $container): Wiki + { + return new Wiki( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/settings.json b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/settings.json new file mode 100644 index 0000000..c2feb17 --- /dev/null +++ b/src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/settings.json @@ -0,0 +1,174 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "0bb2b72f-ebcd-46fe-844b-ac5fe715c230", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Repository", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "eb6c050d-7100-42b8-a922-f7e7c78a08c2", + "as": "Repo" + }, + "use_selection1": { + "use": "8a8fce09-a880-4364-a8c4-4ca337e7e951", + "as": "default" + }, + "use_selection2": { + "use": "66f866a7-f3a0-40ac-ac94-168d60c4a643", + "as": "default" + }, + "use_selection3": { + "use": "68f930bc-d24f-4ade-bcec-576f82c3c13d", + "as": "default" + }, + "use_selection4": { + "use": "8fd54ec5-d93e-445c-ae27-80b6052dbddd", + "as": "default" + }, + "use_selection5": { + "use": "0edb3d51-0a65-443b-883d-3d20325212bb", + "as": "default" + }, + "use_selection6": { + "use": "e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf", + "as": "default" + }, + "use_selection7": { + "use": "daa18d45-3d4a-4280-b58c-147683e8093c", + "as": "default" + }, + "use_selection8": { + "use": "8d1baef6-fcad-49a9-848f-428009cdb989", + "as": "default" + }, + "use_selection9": { + "use": "7fbed5f9-54a2-4001-a0d1-4621034166ef", + "as": "default" + }, + "use_selection10": { + "use": "93f4bc91-946d-447a-ab5a-4f76e0e1a9ce", + "as": "default" + }, + "use_selection11": { + "use": "463ce0a3-65e0-4a08-8bd2-e3bd0a058488", + "as": "default" + }, + "use_selection12": { + "use": "a11cacb2-c13a-4482-bf71-1b7d99574a98", + "as": "default" + }, + "use_selection13": { + "use": "501fbf08-9f56-4aa0-96d7-5905b511be08", + "as": "default" + }, + "use_selection14": { + "use": "c140a62c-ea7b-470f-b8ca-83cfbcdd13ba", + "as": "default" + }, + "use_selection15": { + "use": "c0ee5592-e49f-4937-9b13-f4352afcb430", + "as": "default" + }, + "use_selection16": { + "use": "0f99429a-b517-40ac-a3c1-34c3ef2f36ee", + "as": "default" + }, + "use_selection17": { + "use": "f6249c33-b4bd-4598-8710-0cab230aef94", + "as": "default" + }, + "use_selection18": { + "use": "403855fb-668d-464a-af45-8e30b198c9d6", + "as": "default" + }, + "use_selection19": { + "use": "cf8fa194-9f83-4a2a-b52b-ede069188afe", + "as": "default" + }, + "use_selection20": { + "use": "1dda1c2c-1670-4aea-a6b8-49f0bd03b41e", + "as": "default" + }, + "use_selection21": { + "use": "f56114fd-6804-4ce9-8adb-1d521f023c11", + "as": "default" + }, + "use_selection22": { + "use": "974d9e4c-beef-4c35-a3c6-92b1dd5b145d", + "as": "default" + }, + "use_selection23": { + "use": "754d737c-3b6f-43f0-8974-2e06a3daf41e", + "as": "default" + }, + "use_selection24": { + "use": "994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd", + "as": "default" + }, + "use_selection25": { + "use": "65288a04-bcac-4067-ae2b-6fda9f1e3fd5", + "as": "default" + }, + "use_selection26": { + "use": "6a2fffb5-63ff-4a96-b458-632a5ff90814", + "as": "default" + }, + "use_selection27": { + "use": "4b355731-bbcc-430f-a451-f94ff9bb1c20", + "as": "default" + }, + "use_selection28": { + "use": "5f01760a-de24-49f7-b08e-d340c847f86a", + "as": "default" + }, + "use_selection29": { + "use": "caf25475-8c9e-4e07-a7f5-f606e98ec880", + "as": "default" + }, + "use_selection30": { + "use": "c7b31fc2-892b-4235-beb2-3413e4432839", + "as": "default" + }, + "use_selection31": { + "use": "8c82b705-04bb-4bd2-ac09-3f590fdf48c2", + "as": "default" + }, + "use_selection32": { + "use": "d7b67b1c-f876-4555-9e54-0645cf519d4c", + "as": "default" + }, + "use_selection33": { + "use": "7f852309-122b-42fb-b2f3-ea9e2d405a9c", + "as": "default" + }, + "use_selection34": { + "use": "04adb831-c257-4657-a2c3-a17096b6b5cf", + "as": "default" + }, + "use_selection35": { + "use": "78b3346f-c4cf-46b3-941c-656e2d510da0", + "as": "default" + }, + "use_selection36": { + "use": "93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7", + "as": "default" + }, + "use_selection37": { + "use": "572b9567-1893-400b-bd34-f1a45ef7e503", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Repository", + "description": "The Gitea Repository Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/0edb3d51-0a65-443b-883d-3d20325212bb/README.md b/src/0edb3d51-0a65-443b-883d-3d20325212bb/README.md new file mode 100644 index 0000000..51cdd9c --- /dev/null +++ b/src/0edb3d51-0a65-443b-883d-3d20325212bb/README.md @@ -0,0 +1,131 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Protection (Details) +> namespace: **VDM\Joomla\Gitea\Repository\Branch** +```uml +@startuml +class Protection #Gold { + + list(string $ownerName, string $repositoryName) : ?array + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + delete(string $ownerName, string $repoName, ...) : string + + edit(string $owner, string $repo, ...) : ?object +} + +note right of Protection::list + List branch protections for a repository. + + since: 3.2.0 + return: ?array +end note + +note right of Protection::create + Create a branch protection for a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $branchName + array $approvalsWhitelistUsernames + array $approvalsWhitelistTeams + bool $blockOnOfficialReviewRequests = false + bool $blockOnOutdatedBranch = false + bool $blockOnRejectedReviews = false + bool $dismissStaleApprovals = false + bool $enableApprovalsWhitelist = false + bool $enableMergeWhitelist = false + bool $enablePush = true + bool $enablePushWhitelist = false + bool $enableStatusCheck = false + array $mergeWhitelistUsernames = [] + array $mergeWhitelistTeams = [] + string $protectedFilePatterns = '' + bool $pushWhitelistDeployKeys = false + array $pushWhitelistUsernames = [] + array $pushWhitelistTeams = [] + bool $requireSignedCommits = false + int $requiredApprovals + array $statusCheckContexts = [] + string $unprotectedFilePatterns = '' +end note + +note right of Protection::get + Get a specific branch protection for the repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $branchName +end note + +note right of Protection::delete + Delete a specific branch protection for the repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + string $branchName +end note + +note right of Protection::edit + Edit a branch protection for a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $name + ?array $approvalsWhitelistTeams = null + ?array $approvalsWhitelistUsernames = null + ?bool $blockOnOfficialReviewRequests = null + ?bool $blockOnOutdatedBranch = null + ?bool $blockOnRejectedReviews = null + ?bool $dismissStaleApprovals = null + ?bool $enableApprovalsWhitelist = null + ?bool $enableMergeWhitelist = null + ?bool $enablePush = null + ?bool $enablePushWhitelist = null + ?bool $enableStatusCheck = null + ?array $mergeWhitelistTeams = null + ?array $mergeWhitelistUsernames = null + ?string $protectedFilePatterns = null + ?bool $pushWhitelistDeployKeys = null + ?array $pushWhitelistTeams = null + ?array $pushWhitelistUsernames = null + ?bool $requireSignedCommits = null + ?int $requiredApprovals = null + ?array $statusCheckContexts = null + ?string $unprotectedFilePatterns = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0edb3d51-0a65-443b-883d-3d20325212bb/code.php b/src/0edb3d51-0a65-443b-883d-3d20325212bb/code.php new file mode 100644 index 0000000..946bce2 --- /dev/null +++ b/src/0edb3d51-0a65-443b-883d-3d20325212bb/code.php @@ -0,0 +1,380 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository\Branch; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Branch Protection + * + * @since 3.2.0 + */ +class Protection extends Api +{ + /** + * List branch protections for a repository. + * + * @param string $ownerName The owner name. + * @param string $repositoryName The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $ownerName, string $repositoryName): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repositoryName}/branch_protections"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a branch protection for a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branchName The name of the branch to protect. + * @param array $approvalsWhitelistUsernames An array of usernames that can approve. + * @param array $approvalsWhitelistTeams An array of team names that can approve. + * @param bool $blockOnOfficialReviewRequests Enable/disable blocking on official review requests (optional, default false). + * @param bool $blockOnOutdatedBranch Enable/disable blocking on outdated branch (optional, default false). + * @param bool $blockOnRejectedReviews Enable/disable blocking on rejected reviews (optional, default false). + * @param bool $dismissStaleApprovals Enable/disable dismissing stale approvals (optional, default false). + * @param bool $enableApprovalsWhitelist Enable/disable approvals whitelist (optional, default false). + * @param bool $enableMergeWhitelist Enable/disable merge whitelist (optional, default false). + * @param bool $enablePush Enable/disable push (optional, default true). + * @param bool $enablePushWhitelist Enable/disable push whitelist (optional, default false). + * @param bool $enableStatusCheck Enable/disable status check (optional, default false). + * @param array $mergeWhitelistUsernames An array of usernames that can merge (optional). + * @param array $mergeWhitelistTeams An array of team names that can merge (optional). + * @param string $protectedFilePatterns Protected file patterns (optional). + * @param bool $pushWhitelistDeployKeys Enable/disable push whitelist deploy keys (optional, default false). + * @param array $pushWhitelistUsernames An array of usernames that can push (optional). + * @param array $pushWhitelistTeams An array of team names that can push (optional). + * @param bool $requireSignedCommits Enable/disable requiring signed commits (optional, default false). + * @param int $requiredApprovals Number of required approvals (optional, default 0). + * @param array $statusCheckContexts An array of status check contexts (optional). + * @param string $unprotectedFilePatterns Unprotected file patterns (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $branchName, + array $approvalsWhitelistUsernames, + array $approvalsWhitelistTeams, + bool $blockOnOfficialReviewRequests = false, + bool $blockOnOutdatedBranch = false, + bool $blockOnRejectedReviews = false, + bool $dismissStaleApprovals = false, + bool $enableApprovalsWhitelist = false, + bool $enableMergeWhitelist = false, + bool $enablePush = true, + bool $enablePushWhitelist = false, + bool $enableStatusCheck = false, + array $mergeWhitelistUsernames = [], + array $mergeWhitelistTeams = [], + string $protectedFilePatterns = '', + bool $pushWhitelistDeployKeys = false, + array $pushWhitelistUsernames = [], + array $pushWhitelistTeams = [], + bool $requireSignedCommits = false, + int $requiredApprovals = 0, + array $statusCheckContexts = [], + string $unprotectedFilePatterns = '' + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branch_protections"; + + // Set the branch protection data. + $data = new \stdClass(); + $data->branch_name = $branchName; + $data->approvals_whitelist_usernames = $approvalsWhitelistUsernames; + $data->approvals_whitelist_teams = $approvalsWhitelistTeams; + $data->block_on_official_review_requests = $blockOnOfficialReviewRequests; + $data->block_on_outdated_branch = $blockOnOutdatedBranch; + $data->block_on_rejected_reviews = $blockOnRejectedReviews; + $data->dismiss_stale_approvals = $dismissStaleApprovals; + $data->enable_approvals_whitelist = $enableApprovalsWhitelist; + $data->enable_merge_whitelist = $enableMergeWhitelist; + $data->enable_push = $enablePush; + $data->enable_push_whitelist = $enablePushWhitelist; + $data->enable_status_check = $enableStatusCheck; + $data->merge_whitelist_usernames = $mergeWhitelistUsernames; + $data->merge_whitelist_teams = $mergeWhitelistTeams; + $data->protected_file_patterns = $protectedFilePatterns; + $data->push_whitelist_deploy_keys = $pushWhitelistDeployKeys; + $data->push_whitelist_usernames = $pushWhitelistUsernames; + $data->push_whitelist_teams = $pushWhitelistTeams; + $data->require_signed_commits = $requireSignedCommits; + $data->required_approvals = $requiredApprovals; + $data->status_check_contexts = $statusCheckContexts; + $data->unprotected_file_patterns = $unprotectedFilePatterns; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a specific branch protection for the repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branchName The branch protection name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $branchName + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branch_protections/{$branchName}"; + + // Get the URI object with the given path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a specific branch protection for the repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $branchName The branch protection name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + string $branchName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/branch_protections/{$branchName}"; + + // Set the required variables in the URI. + $this->uri->setVar('owner', $ownerName); + $this->uri->setVar('repo', $repoName); + $this->uri->setVar('name', $branchName); + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a branch protection for a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $name The branch protection name. + * @param array|null $approvalsWhitelistTeams An array of team names that are allowed to approve (optional). + * @param array|null $approvalsWhitelistUsernames An array of usernames that are allowed to approve (optional). + * @param bool|null $blockOnOfficialReviewRequests Block when official review requests are pending (optional). + * @param bool|null $blockOnOutdatedBranch Block when the branch is outdated (optional). + * @param bool|null $blockOnRejectedReviews Block when reviews are rejected (optional). + * @param bool|null $dismissStaleApprovals Dismiss stale approvals when new commits are pushed (optional). + * @param bool|null $enableApprovalsWhitelist Enable/disable approvals whitelist (optional). + * @param bool|null $enableMergeWhitelist Enable/disable merge whitelist (optional). + * @param bool|null $enablePush Enable/disable push (optional). + * @param bool|null $enablePushWhitelist Enable/disable push whitelist (optional). + * @param bool|null $enableStatusCheck Enable/disable status check (optional). + * @param array|null $mergeWhitelistTeams An array of team names that are allowed to merge (optional). + * @param array|null $mergeWhitelistUsernames An array of usernames that are allowed to merge (optional). + * @param string|null $protectedFilePatterns A string pattern for protected files (optional). + * @param bool|null $pushWhitelistDeployKeys Enable/disable push whitelist for deploy keys (optional). + * @param array|null $pushWhitelistTeams An array of team names that are allowed to push (optional). + * @param array|null $pushWhitelistUsernames An array of usernames that are allowed to push (optional). + * @param bool|null $requireSignedCommits Require signed commits (optional). + * @param int|null $requiredApprovals Number of required approvals (optional). + * @param array|null $statusCheckContexts An array of status check contexts (optional). + * @param string|null $unprotectedFilePatterns A string pattern for unprotected files (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + string $name, + ?array $approvalsWhitelistTeams = null, + ?array $approvalsWhitelistUsernames = null, + ?bool $blockOnOfficialReviewRequests = null, + ?bool $blockOnOutdatedBranch = null, + ?bool $blockOnRejectedReviews = null, + ?bool $dismissStaleApprovals = null, + ?bool $enableApprovalsWhitelist = null, + ?bool $enableMergeWhitelist = null, + ?bool $enablePush = null, + ?bool $enablePushWhitelist = null, + ?bool $enableStatusCheck = null, + ?array $mergeWhitelistTeams = null, + ?array $mergeWhitelistUsernames = null, + ?string $protectedFilePatterns = null, + ?bool $pushWhitelistDeployKeys = null, + ?array $pushWhitelistTeams = null, + ?array $pushWhitelistUsernames = null, + ?bool $requireSignedCommits = null, + ?int $requiredApprovals = null, + ?array $statusCheckContexts = null, + ?string $unprotectedFilePatterns = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branch_protections/{$name}"; + + // Set the branch protection data. + $data = new \stdClass(); + + if ($approvalsWhitelistTeams !== null) + { + $data->approvals_whitelist_teams = $approvalsWhitelistTeams; + } + + if ($approvalsWhitelistUsernames !== null) + { + $data->approvals_whitelist_usernames = $approvalsWhitelistUsernames; + } + + if ($blockOnOfficialReviewRequests !== null) + { + $data->block_on_official_review_requests = $blockOnOfficialReviewRequests; + } + + if ($blockOnOutdatedBranch !== null) + { + $data->block_on_outdated_branch = $blockOnOutdatedBranch; + } + + if ($blockOnRejectedReviews !== null) + { + $data->block_on_rejected_reviews = $blockOnRejectedReviews; + } + + if ($dismissStaleApprovals !== null) + { + $data->dismiss_stale_approvals = $dismissStaleApprovals; + } + + if ($enableApprovalsWhitelist !== null) + { + $data->enable_approvals_whitelist = $enableApprovalsWhitelist; + } + + if ($enableMergeWhitelist !== null) + { + $data->enable_merge_whitelist = $enableMergeWhitelist; + } + + if ($enablePush !== null) + { + $data->enable_push = $enablePush; + } + + if ($enablePushWhitelist !== null) + { + $data->enable_push_whitelist = $enablePushWhitelist; + } + + if ($enableStatusCheck !== null) + { + $data->enable_status_check = $enableStatusCheck; + } + + if ($mergeWhitelistTeams !== null) + { + $data->merge_whitelist_teams = $mergeWhitelistTeams; + } + + if ($mergeWhitelistUsernames !== null) + { + $data->merge_whitelist_usernames = $mergeWhitelistUsernames; + } + + if ($protectedFilePatterns !== null) + { + $data->protected_file_patterns = $protectedFilePatterns; + } + + if ($pushWhitelistDeployKeys !== null) + { + $data->push_whitelist_deploy_keys = $pushWhitelistDeployKeys; + } + + if ($pushWhitelistTeams !== null) + { + $data->push_whitelist_teams = $pushWhitelistTeams; + } + + if ($pushWhitelistUsernames !== null) + { + $data->push_whitelist_usernames = $pushWhitelistUsernames; + } + + if ($requireSignedCommits !== null) + { + $data->require_signed_commits = $requireSignedCommits; + } + + if ($requiredApprovals !== null) + { + $data->required_approvals = $requiredApprovals; + } + + if ($statusCheckContexts !== null) + { + $data->status_check_contexts = $statusCheckContexts; + } + + if ($unprotectedFilePatterns !== null) + { + $data->unprotected_file_patterns = $unprotectedFilePatterns; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/0edb3d51-0a65-443b-883d-3d20325212bb/code.power b/src/0edb3d51-0a65-443b-883d-3d20325212bb/code.power new file mode 100644 index 0000000..de3374a --- /dev/null +++ b/src/0edb3d51-0a65-443b-883d-3d20325212bb/code.power @@ -0,0 +1,353 @@ + /** + * List branch protections for a repository. + * + * @param string $ownerName The owner name. + * @param string $repositoryName The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $ownerName, string $repositoryName): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repositoryName}/branch_protections"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a branch protection for a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branchName The name of the branch to protect. + * @param array $approvalsWhitelistUsernames An array of usernames that can approve. + * @param array $approvalsWhitelistTeams An array of team names that can approve. + * @param bool $blockOnOfficialReviewRequests Enable/disable blocking on official review requests (optional, default false). + * @param bool $blockOnOutdatedBranch Enable/disable blocking on outdated branch (optional, default false). + * @param bool $blockOnRejectedReviews Enable/disable blocking on rejected reviews (optional, default false). + * @param bool $dismissStaleApprovals Enable/disable dismissing stale approvals (optional, default false). + * @param bool $enableApprovalsWhitelist Enable/disable approvals whitelist (optional, default false). + * @param bool $enableMergeWhitelist Enable/disable merge whitelist (optional, default false). + * @param bool $enablePush Enable/disable push (optional, default true). + * @param bool $enablePushWhitelist Enable/disable push whitelist (optional, default false). + * @param bool $enableStatusCheck Enable/disable status check (optional, default false). + * @param array $mergeWhitelistUsernames An array of usernames that can merge (optional). + * @param array $mergeWhitelistTeams An array of team names that can merge (optional). + * @param string $protectedFilePatterns Protected file patterns (optional). + * @param bool $pushWhitelistDeployKeys Enable/disable push whitelist deploy keys (optional, default false). + * @param array $pushWhitelistUsernames An array of usernames that can push (optional). + * @param array $pushWhitelistTeams An array of team names that can push (optional). + * @param bool $requireSignedCommits Enable/disable requiring signed commits (optional, default false). + * @param int $requiredApprovals Number of required approvals (optional, default 0). + * @param array $statusCheckContexts An array of status check contexts (optional). + * @param string $unprotectedFilePatterns Unprotected file patterns (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $branchName, + array $approvalsWhitelistUsernames, + array $approvalsWhitelistTeams, + bool $blockOnOfficialReviewRequests = false, + bool $blockOnOutdatedBranch = false, + bool $blockOnRejectedReviews = false, + bool $dismissStaleApprovals = false, + bool $enableApprovalsWhitelist = false, + bool $enableMergeWhitelist = false, + bool $enablePush = true, + bool $enablePushWhitelist = false, + bool $enableStatusCheck = false, + array $mergeWhitelistUsernames = [], + array $mergeWhitelistTeams = [], + string $protectedFilePatterns = '', + bool $pushWhitelistDeployKeys = false, + array $pushWhitelistUsernames = [], + array $pushWhitelistTeams = [], + bool $requireSignedCommits = false, + int $requiredApprovals = 0, + array $statusCheckContexts = [], + string $unprotectedFilePatterns = '' + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branch_protections"; + + // Set the branch protection data. + $data = new \stdClass(); + $data->branch_name = $branchName; + $data->approvals_whitelist_usernames = $approvalsWhitelistUsernames; + $data->approvals_whitelist_teams = $approvalsWhitelistTeams; + $data->block_on_official_review_requests = $blockOnOfficialReviewRequests; + $data->block_on_outdated_branch = $blockOnOutdatedBranch; + $data->block_on_rejected_reviews = $blockOnRejectedReviews; + $data->dismiss_stale_approvals = $dismissStaleApprovals; + $data->enable_approvals_whitelist = $enableApprovalsWhitelist; + $data->enable_merge_whitelist = $enableMergeWhitelist; + $data->enable_push = $enablePush; + $data->enable_push_whitelist = $enablePushWhitelist; + $data->enable_status_check = $enableStatusCheck; + $data->merge_whitelist_usernames = $mergeWhitelistUsernames; + $data->merge_whitelist_teams = $mergeWhitelistTeams; + $data->protected_file_patterns = $protectedFilePatterns; + $data->push_whitelist_deploy_keys = $pushWhitelistDeployKeys; + $data->push_whitelist_usernames = $pushWhitelistUsernames; + $data->push_whitelist_teams = $pushWhitelistTeams; + $data->require_signed_commits = $requireSignedCommits; + $data->required_approvals = $requiredApprovals; + $data->status_check_contexts = $statusCheckContexts; + $data->unprotected_file_patterns = $unprotectedFilePatterns; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a specific branch protection for the repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branchName The branch protection name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $branchName + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branch_protections/{$branchName}"; + + // Get the URI object with the given path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a specific branch protection for the repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $branchName The branch protection name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + string $branchName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/branch_protections/{$branchName}"; + + // Set the required variables in the URI. + $this->uri->setVar('owner', $ownerName); + $this->uri->setVar('repo', $repoName); + $this->uri->setVar('name', $branchName); + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a branch protection for a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $name The branch protection name. + * @param array|null $approvalsWhitelistTeams An array of team names that are allowed to approve (optional). + * @param array|null $approvalsWhitelistUsernames An array of usernames that are allowed to approve (optional). + * @param bool|null $blockOnOfficialReviewRequests Block when official review requests are pending (optional). + * @param bool|null $blockOnOutdatedBranch Block when the branch is outdated (optional). + * @param bool|null $blockOnRejectedReviews Block when reviews are rejected (optional). + * @param bool|null $dismissStaleApprovals Dismiss stale approvals when new commits are pushed (optional). + * @param bool|null $enableApprovalsWhitelist Enable/disable approvals whitelist (optional). + * @param bool|null $enableMergeWhitelist Enable/disable merge whitelist (optional). + * @param bool|null $enablePush Enable/disable push (optional). + * @param bool|null $enablePushWhitelist Enable/disable push whitelist (optional). + * @param bool|null $enableStatusCheck Enable/disable status check (optional). + * @param array|null $mergeWhitelistTeams An array of team names that are allowed to merge (optional). + * @param array|null $mergeWhitelistUsernames An array of usernames that are allowed to merge (optional). + * @param string|null $protectedFilePatterns A string pattern for protected files (optional). + * @param bool|null $pushWhitelistDeployKeys Enable/disable push whitelist for deploy keys (optional). + * @param array|null $pushWhitelistTeams An array of team names that are allowed to push (optional). + * @param array|null $pushWhitelistUsernames An array of usernames that are allowed to push (optional). + * @param bool|null $requireSignedCommits Require signed commits (optional). + * @param int|null $requiredApprovals Number of required approvals (optional). + * @param array|null $statusCheckContexts An array of status check contexts (optional). + * @param string|null $unprotectedFilePatterns A string pattern for unprotected files (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + string $name, + ?array $approvalsWhitelistTeams = null, + ?array $approvalsWhitelistUsernames = null, + ?bool $blockOnOfficialReviewRequests = null, + ?bool $blockOnOutdatedBranch = null, + ?bool $blockOnRejectedReviews = null, + ?bool $dismissStaleApprovals = null, + ?bool $enableApprovalsWhitelist = null, + ?bool $enableMergeWhitelist = null, + ?bool $enablePush = null, + ?bool $enablePushWhitelist = null, + ?bool $enableStatusCheck = null, + ?array $mergeWhitelistTeams = null, + ?array $mergeWhitelistUsernames = null, + ?string $protectedFilePatterns = null, + ?bool $pushWhitelistDeployKeys = null, + ?array $pushWhitelistTeams = null, + ?array $pushWhitelistUsernames = null, + ?bool $requireSignedCommits = null, + ?int $requiredApprovals = null, + ?array $statusCheckContexts = null, + ?string $unprotectedFilePatterns = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branch_protections/{$name}"; + + // Set the branch protection data. + $data = new \stdClass(); + + if ($approvalsWhitelistTeams !== null) + { + $data->approvals_whitelist_teams = $approvalsWhitelistTeams; + } + + if ($approvalsWhitelistUsernames !== null) + { + $data->approvals_whitelist_usernames = $approvalsWhitelistUsernames; + } + + if ($blockOnOfficialReviewRequests !== null) + { + $data->block_on_official_review_requests = $blockOnOfficialReviewRequests; + } + + if ($blockOnOutdatedBranch !== null) + { + $data->block_on_outdated_branch = $blockOnOutdatedBranch; + } + + if ($blockOnRejectedReviews !== null) + { + $data->block_on_rejected_reviews = $blockOnRejectedReviews; + } + + if ($dismissStaleApprovals !== null) + { + $data->dismiss_stale_approvals = $dismissStaleApprovals; + } + + if ($enableApprovalsWhitelist !== null) + { + $data->enable_approvals_whitelist = $enableApprovalsWhitelist; + } + + if ($enableMergeWhitelist !== null) + { + $data->enable_merge_whitelist = $enableMergeWhitelist; + } + + if ($enablePush !== null) + { + $data->enable_push = $enablePush; + } + + if ($enablePushWhitelist !== null) + { + $data->enable_push_whitelist = $enablePushWhitelist; + } + + if ($enableStatusCheck !== null) + { + $data->enable_status_check = $enableStatusCheck; + } + + if ($mergeWhitelistTeams !== null) + { + $data->merge_whitelist_teams = $mergeWhitelistTeams; + } + + if ($mergeWhitelistUsernames !== null) + { + $data->merge_whitelist_usernames = $mergeWhitelistUsernames; + } + + if ($protectedFilePatterns !== null) + { + $data->protected_file_patterns = $protectedFilePatterns; + } + + if ($pushWhitelistDeployKeys !== null) + { + $data->push_whitelist_deploy_keys = $pushWhitelistDeployKeys; + } + + if ($pushWhitelistTeams !== null) + { + $data->push_whitelist_teams = $pushWhitelistTeams; + } + + if ($pushWhitelistUsernames !== null) + { + $data->push_whitelist_usernames = $pushWhitelistUsernames; + } + + if ($requireSignedCommits !== null) + { + $data->require_signed_commits = $requireSignedCommits; + } + + if ($requiredApprovals !== null) + { + $data->required_approvals = $requiredApprovals; + } + + if ($statusCheckContexts !== null) + { + $data->status_check_contexts = $statusCheckContexts; + } + + if ($unprotectedFilePatterns !== null) + { + $data->unprotected_file_patterns = $unprotectedFilePatterns; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/0edb3d51-0a65-443b-883d-3d20325212bb/settings.json b/src/0edb3d51-0a65-443b-883d-3d20325212bb/settings.json new file mode 100644 index 0000000..187cf79 --- /dev/null +++ b/src/0edb3d51-0a65-443b-883d-3d20325212bb/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "0edb3d51-0a65-443b-883d-3d20325212bb", + "implements": null, + "load_selection": null, + "name": "Protection", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Branch.Protection", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Branch.Protection", + "description": "The Gitea Repository Branch Protection\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/README.md b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/README.md new file mode 100644 index 0000000..cab5267 --- /dev/null +++ b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/README.md @@ -0,0 +1,76 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Merge (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Merge #Gold { + + check(string $owner, string $repo, ...) : string + + pull(string $owner, string $repo, ...) : string + + cancel(string $owner, string $repo, ...) : string +} + +note right of Merge::check + Check if a pull request has been merged. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +note right of Merge::pull + Merge a pull request. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + ?string $mergeMethod = null + ?string $mergeCommitId = null + ?string $mergeMessageField = null + ?string $mergeTitleField = null + ?bool $deleteBranchAfterMerge = null + ?bool $forceMerge = null + ?string $headCommitId = null + ?bool $mergeWhenChecksSucceed = null +end note + +note right of Merge::cancel + Cancel the scheduled auto merge for a pull request. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.php b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.php new file mode 100644 index 0000000..2b2cd2d --- /dev/null +++ b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.php @@ -0,0 +1,167 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Merge + * + * @since 3.2.0 + */ +class Merge extends Api +{ + /** + * Check if a pull request has been merged. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * + * @return string + * @since 3.2.0 + **/ + public function check( + string $owner, + string $repo, + int $index + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Merge a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $mergeMethod Merge method to use (optional). + * @param string|null $mergeCommitId Merge commit ID (optional). + * @param string|null $mergeMessageField Merge message field (optional). + * @param string|null $mergeTitleField Merge title field (optional). + * @param bool|null $deleteBranchAfterMerge Delete branch after merge (optional). + * @param bool|null $forceMerge Force merge (optional). + * @param string|null $headCommitId Head commit ID (optional). + * @param bool|null $mergeWhenChecksSucceed Merge when checks succeed (optional). + * + * @return string + * @since 3.2.0 + **/ + public function pull( + string $owner, + string $repo, + int $index, + ?string $mergeMethod = null, + ?string $mergeCommitId = null, + ?string $mergeMessageField = null, + ?string $mergeTitleField = null, + ?bool $deleteBranchAfterMerge = null, + ?bool $forceMerge = null, + ?string $headCommitId = null, + ?bool $mergeWhenChecksSucceed = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Set the merge data. + $data = new \stdClass(); + + if ($mergeMethod !== null) + { + $data->do = $mergeMethod; + } + + if ($mergeCommitId !== null) + { + $data->merge_commit_id = $mergeCommitId; + } + + if ($mergeMessageField !== null) + { + $data->merge_message_field = $mergeMessageField; + } + + if ($mergeTitleField !== null) + { + $data->merge_title_field = $mergeTitleField; + } + + if ($deleteBranchAfterMerge !== null) + { + $data->delete_branch_after_merge = $deleteBranchAfterMerge; + } + + if ($forceMerge !== null) + { + $data->force_merge = $forceMerge; + } + + if ($headCommitId !== null) + { + $data->head_commit_id = $headCommitId; + } + + if ($mergeWhenChecksSucceed !== null) + { + $data->merge_when_checks_succeed = $mergeWhenChecksSucceed; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 200, 'success' + ); + } + + /** + * Cancel the scheduled auto merge for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * + * @return string + * @since 3.2.0 + **/ + public function cancel( + string $owner, + string $repo, + int $index + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + +} + diff --git a/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.power b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.power new file mode 100644 index 0000000..e7d955c --- /dev/null +++ b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.power @@ -0,0 +1,140 @@ + /** + * Check if a pull request has been merged. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * + * @return string + * @since 3.2.0 + **/ + public function check( + string $owner, + string $repo, + int $index + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Merge a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $mergeMethod Merge method to use (optional). + * @param string|null $mergeCommitId Merge commit ID (optional). + * @param string|null $mergeMessageField Merge message field (optional). + * @param string|null $mergeTitleField Merge title field (optional). + * @param bool|null $deleteBranchAfterMerge Delete branch after merge (optional). + * @param bool|null $forceMerge Force merge (optional). + * @param string|null $headCommitId Head commit ID (optional). + * @param bool|null $mergeWhenChecksSucceed Merge when checks succeed (optional). + * + * @return string + * @since 3.2.0 + **/ + public function pull( + string $owner, + string $repo, + int $index, + ?string $mergeMethod = null, + ?string $mergeCommitId = null, + ?string $mergeMessageField = null, + ?string $mergeTitleField = null, + ?bool $deleteBranchAfterMerge = null, + ?bool $forceMerge = null, + ?string $headCommitId = null, + ?bool $mergeWhenChecksSucceed = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Set the merge data. + $data = new \stdClass(); + + if ($mergeMethod !== null) + { + $data->do = $mergeMethod; + } + + if ($mergeCommitId !== null) + { + $data->merge_commit_id = $mergeCommitId; + } + + if ($mergeMessageField !== null) + { + $data->merge_message_field = $mergeMessageField; + } + + if ($mergeTitleField !== null) + { + $data->merge_title_field = $mergeTitleField; + } + + if ($deleteBranchAfterMerge !== null) + { + $data->delete_branch_after_merge = $deleteBranchAfterMerge; + } + + if ($forceMerge !== null) + { + $data->force_merge = $forceMerge; + } + + if ($headCommitId !== null) + { + $data->head_commit_id = $headCommitId; + } + + if ($mergeWhenChecksSucceed !== null) + { + $data->merge_when_checks_succeed = $mergeWhenChecksSucceed; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 200, 'success' + ); + } + + /** + * Cancel the scheduled auto merge for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * + * @return string + * @since 3.2.0 + **/ + public function cancel( + string $owner, + string $repo, + int $index + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } diff --git a/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/settings.json b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/settings.json new file mode 100644 index 0000000..b36717a --- /dev/null +++ b/src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "0f99429a-b517-40ac-a3c1-34c3ef2f36ee", + "implements": null, + "load_selection": null, + "name": "Merge", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Merge", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Merge", + "description": "The Gitea Repository Merge\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/13931443-bad7-4742-b64e-c08042e7b306/README.md b/src/13931443-bad7-4742-b64e-c08042e7b306/README.md new file mode 100644 index 0000000..22416f8 --- /dev/null +++ b/src/13931443-bad7-4742-b64e-c08042e7b306/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Followers (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Followers #Gold { + + list(int $page = 1, int $limit = 10) : ?array +} + +note right of Followers::list + List the authenticated user's followers. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/13931443-bad7-4742-b64e-c08042e7b306/code.php b/src/13931443-bad7-4742-b64e-c08042e7b306/code.php new file mode 100644 index 0000000..71b028a --- /dev/null +++ b/src/13931443-bad7-4742-b64e-c08042e7b306/code.php @@ -0,0 +1,54 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Followers + * + * @since 3.2.0 + */ +class Followers extends Api +{ + /** + * List the authenticated user's followers. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/followers'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + +} + diff --git a/src/13931443-bad7-4742-b64e-c08042e7b306/code.power b/src/13931443-bad7-4742-b64e-c08042e7b306/code.power new file mode 100644 index 0000000..7a2cd57 --- /dev/null +++ b/src/13931443-bad7-4742-b64e-c08042e7b306/code.power @@ -0,0 +1,27 @@ + /** + * List the authenticated user's followers. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/followers'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } diff --git a/src/13931443-bad7-4742-b64e-c08042e7b306/settings.json b/src/13931443-bad7-4742-b64e-c08042e7b306/settings.json new file mode 100644 index 0000000..e90d5a0 --- /dev/null +++ b/src/13931443-bad7-4742-b64e-c08042e7b306/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "13931443-bad7-4742-b64e-c08042e7b306", + "implements": null, + "load_selection": null, + "name": "Followers", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Followers", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Followers", + "description": "The Gitea User Followers\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/README.md b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/README.md new file mode 100644 index 0000000..768ebb0 --- /dev/null +++ b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/README.md @@ -0,0 +1,66 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Response (Details) +> namespace: **VDM\Joomla\Gitea\Utilities** +```uml +@startuml +class Response << (F,LightGreen) >> #Green { + + get(JoomlaResponse $response, int $expectedCode = 200, ...) : mixed + + get_(JoomlaResponse $response, array $validate = [200 => null]) : mixed + # body(JoomlaResponse $response, mixed $default = null) : mixed + # error(JoomlaResponse $response) : string +} + +note right of Response::get + Process the response and decode it. + + since: 3.2.0 + return: mixed + + arguments: + JoomlaResponse $response + int $expectedCode = 200 + mixed $default = null +end note + +note right of Response::get_ + Process the response and decode it. (when we have multiple success codes) + + since: 3.2.0 + return: mixed +end note + +note right of Response::body + Return the body from the response + + since: 3.2.0 + return: mixed +end note + +note right of Response::error + Get the error message from the return object + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.php b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.php new file mode 100644 index 0000000..5e6d764 --- /dev/null +++ b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.php @@ -0,0 +1,142 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Utilities; + + +use Joomla\CMS\Http\Response as JoomlaResponse; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * The Gitea Response + * + * @since 3.2.0 + */ +final class Response +{ + /** + * Process the response and decode it. + * + * @param JoomlaResponse $response The response. + * @param integer $expectedCode The expected "good" code. + * @param mixed $default The default if body not have length + * + * @return mixed + * + * @since 3.2.0 + * @throws \DomainException + **/ + public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null) + { + // Validate the response code. + if ($response->code != $expectedCode) + { + // Decode the error response and throw an exception. + $message = $this->error($response); + + throw new \DomainException("Invalid response received from API.$message", $response->code); + + } + + return $this->body($response, $default); + } + + /** + * Process the response and decode it. (when we have multiple success codes) + * + * @param JoomlaResponse $response The response. + * @param array [$expectedCode => $default] The expected "good" code. and The default if body not have length + * + * @return mixed + * + * @since 3.2.0 + * @throws \DomainException + **/ + public function get_(JoomlaResponse $response, array $validate = [200 => null]) + { + // Validate the response code. + if (!isset($validate[$response->code])) + { + // Decode the error response and throw an exception. + $message = $this->error($response); + + throw new \DomainException("Invalid response received from API.$message", $response->code); + + } + + return $this->body($response, $validate[$response->code]); + } + + /** + * Return the body from the response + * + * @param JoomlaResponse $response The response. + * @param mixed $default The default if body not have length + * + * @return mixed + * @since 3.2.0 + **/ + protected function body(JoomlaResponse $response, $default = null) + { + // check that we have a body and that its JSON + if (isset($response->body) && StringHelper::check($response->body)) + { + if (JsonHelper::check($response->body)) + { + $body = json_decode((string) $response->body); + + if (isset($body->content_base64)) + { + $body->content = base64_decode((string) $body->content_base64); + } + + return $body; + } + + return $response->body; + } + + return $default; + } + + /** + * Get the error message from the return object + * + * @param JoomlaResponse $response The response. + * + * @return string + * @since 3.2.0 + **/ + protected function error(JoomlaResponse $response): string + { + // do we have a json string + if (isset($response->body) && JsonHelper::check($response->body)) + { + $error = json_decode($response->body); + } + else + { + return ''; + } + + // check + if (isset($error->error)) + { + return $error->error; + } + + return ''; + } + +} + diff --git a/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.power b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.power new file mode 100644 index 0000000..ff914b9 --- /dev/null +++ b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.power @@ -0,0 +1,113 @@ + /** + * Process the response and decode it. + * + * @param JoomlaResponse $response The response. + * @param integer $expectedCode The expected "good" code. + * @param mixed $default The default if body not have length + * + * @return mixed + * + * @since 3.2.0 + * @throws \DomainException + **/ + public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null) + { + // Validate the response code. + if ($response->code != $expectedCode) + { + // Decode the error response and throw an exception. + $message = $this->error($response); + + throw new \DomainException("Invalid response received from API.$message", $response->code); + + } + + return $this->body($response, $default); + } + + /** + * Process the response and decode it. (when we have multiple success codes) + * + * @param JoomlaResponse $response The response. + * @param array [$expectedCode => $default] The expected "good" code. and The default if body not have length + * + * @return mixed + * + * @since 3.2.0 + * @throws \DomainException + **/ + public function get_(JoomlaResponse $response, array $validate = [200 => null]) + { + // Validate the response code. + if (!isset($validate[$response->code])) + { + // Decode the error response and throw an exception. + $message = $this->error($response); + + throw new \DomainException("Invalid response received from API.$message", $response->code); + + } + + return $this->body($response, $validate[$response->code]); + } + + /** + * Return the body from the response + * + * @param JoomlaResponse $response The response. + * @param mixed $default The default if body not have length + * + * @return mixed + * @since 3.2.0 + **/ + protected function body(JoomlaResponse $response, $default = null) + { + // check that we have a body and that its JSON + if (isset($response->body) && StringHelper::check($response->body)) + { + if (JsonHelper::check($response->body)) + { + $body = json_decode((string) $response->body); + + if (isset($body->content_base64)) + { + $body->content = base64_decode((string) $body->content_base64); + } + + return $body; + } + + return $response->body; + } + + return $default; + } + + /** + * Get the error message from the return object + * + * @param JoomlaResponse $response The response. + * + * @return string + * @since 3.2.0 + **/ + protected function error(JoomlaResponse $response): string + { + // do we have a json string + if (isset($response->body) && JsonHelper::check($response->body)) + { + $error = json_decode($response->body); + } + else + { + return ''; + } + + // check + if (isset($error->error)) + { + return $error->error; + } + + return ''; + } diff --git a/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/settings.json b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/settings.json new file mode 100644 index 0000000..7ed384f --- /dev/null +++ b/src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "19eb68d7-1e19-4d14-a0ef-70d719c45e80", + "implements": null, + "load_selection": null, + "name": "Response", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Utilities.Response", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Utilities.Response", + "description": "The Gitea Response\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Http\\Response as JoomlaResponse;", + "composer": "" +} \ No newline at end of file diff --git a/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/README.md b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/README.md new file mode 100644 index 0000000..6874124 --- /dev/null +++ b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/README.md @@ -0,0 +1,66 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Patch (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Patch #Gold { + + applyDiffPatch(string $owner, string $repo, ...) : ?object +} + +note right of Patch::applyDiffPatch + Apply a diff patch to a repository. +$options = [ +'description' => 'UpdateFileOptions', +'body' => [ +'content' => 'string', // Content must be base64 encoded. +'sha' => 'string', // The SHA for the file that already exists. +'branch' => 'string', // Branch (optional) to base this file from. If not given, the default branch is used. +'new_branch' => 'string', // New branch (optional) will make a new branch from branch before creating the file. +'from_path' => 'string', // From_path (optional) is the path of the original file which will be moved/renamed to the path in the URL. +'message' => 'string', // Message (optional) for the commit of this file. If not supplied, a default message will be used. +'author' => [ // Identity for a person's identity like an author or committer. +'name' => 'string', +'email' => 'string($email)' +], +'committer' => [ // Identity for a person's identity like an author or committer. +'name' => 'string', +'email' => 'string($email)' +], +'dates' => [ // Store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. +'author' => 'string($date-time)', +'committer' => 'string($date-time)' +], +'signoff' => 'boolean' // Add a Signed-off-by trailer by the committer at the end of the commit log message. +] +] + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + array $option +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.php b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.php new file mode 100644 index 0000000..d7d8007 --- /dev/null +++ b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Patch + * + * @since 3.2.0 + */ +class Patch extends Api +{ + /** + * Apply a diff patch to a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param array $options Options for updating files. + * $options = [ + * 'description' => 'UpdateFileOptions', + * 'body' => [ + * 'content' => 'string', // Content must be base64 encoded. + * 'sha' => 'string', // The SHA for the file that already exists. + * 'branch' => 'string', // Branch (optional) to base this file from. If not given, the default branch is used. + * 'new_branch' => 'string', // New branch (optional) will make a new branch from branch before creating the file. + * 'from_path' => 'string', // From_path (optional) is the path of the original file which will be moved/renamed to the path in the URL. + * 'message' => 'string', // Message (optional) for the commit of this file. If not supplied, a default message will be used. + * 'author' => [ // Identity for a person's identity like an author or committer. + * 'name' => 'string', + * 'email' => 'string($email)' + * ], + * 'committer' => [ // Identity for a person's identity like an author or committer. + * 'name' => 'string', + * 'email' => 'string($email)' + * ], + * 'dates' => [ // Store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. + * 'author' => 'string($date-time)', + * 'committer' => 'string($date-time)' + * ], + * 'signoff' => 'boolean' // Add a Signed-off-by trailer by the committer at the end of the commit log message. + * ] + * ] + * + * @return object|null + * @since 3.2.0 + */ + public function applyDiffPatch( + string $owner, + string $repo, + array $option + ): ?object + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/diffpatch"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($uriPath), + json_encode($options) + ) + ); + } + +} + diff --git a/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.power b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.power new file mode 100644 index 0000000..a733646 --- /dev/null +++ b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.power @@ -0,0 +1,51 @@ + /** + * Apply a diff patch to a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param array $options Options for updating files. + * $options = [ + * 'description' => 'UpdateFileOptions', + * 'body' => [ + * 'content' => 'string', // Content must be base64 encoded. + * 'sha' => 'string', // The SHA for the file that already exists. + * 'branch' => 'string', // Branch (optional) to base this file from. If not given, the default branch is used. + * 'new_branch' => 'string', // New branch (optional) will make a new branch from branch before creating the file. + * 'from_path' => 'string', // From_path (optional) is the path of the original file which will be moved/renamed to the path in the URL. + * 'message' => 'string', // Message (optional) for the commit of this file. If not supplied, a default message will be used. + * 'author' => [ // Identity for a person's identity like an author or committer. + * 'name' => 'string', + * 'email' => 'string($email)' + * ], + * 'committer' => [ // Identity for a person's identity like an author or committer. + * 'name' => 'string', + * 'email' => 'string($email)' + * ], + * 'dates' => [ // Store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. + * 'author' => 'string($date-time)', + * 'committer' => 'string($date-time)' + * ], + * 'signoff' => 'boolean' // Add a Signed-off-by trailer by the committer at the end of the commit log message. + * ] + * ] + * + * @return object|null + * @since 3.2.0 + */ + public function applyDiffPatch( + string $owner, + string $repo, + array $option + ): ?object + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/diffpatch"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($uriPath), + json_encode($options) + ) + ); + } diff --git a/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/settings.json b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/settings.json new file mode 100644 index 0000000..f1c7e10 --- /dev/null +++ b/src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "1dda1c2c-1670-4aea-a6b8-49f0bd03b41e", + "implements": null, + "load_selection": null, + "name": "Patch", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Patch", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Patch", + "description": "The Gitea Repository Patch\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/22d65693-917d-47c7-ba5c-8e1f354dc713/README.md b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/README.md new file mode 100644 index 0000000..a406a00 --- /dev/null +++ b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/README.md @@ -0,0 +1,100 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Comments (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Comments #Gold { + + list(string $owner, string $repo, ...) : ?array + + get(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string + + edit(string $owner, string $repo, ...) : ?object + + add(string $owner, string $repo, ...) : ?object +} + +note right of Comments::list + List all comments on an issue. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + int $page = 1 + int $limit = 10 + ?string $since = null + ?string $before = null +end note + +note right of Comments::get + Get a comment. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $commentId +end note + +note right of Comments::delete + Delete a comment. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $commentId +end note + +note right of Comments::edit + Edit a comment. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $commentId + string $commentBody +end note + +note right of Comments::add + Add a comment to an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $issueIndex + string $commentBody +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.php b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.php new file mode 100644 index 0000000..c244035 --- /dev/null +++ b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.php @@ -0,0 +1,176 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Comments + * + * @since 3.2.0 + */ +class Comments extends Api +{ + /** + * List all comments on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $page The page number to get, defaults to 1. + * @param int $limit The number of comments per page, defaults to 10. + * @param string|null $since The date-time since when to get comments, defaults to null. + * @param string|null $before The date-time before when to get comments, defaults to null. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $index, + int $page = 1, + int $limit = 10, + ?string $since = null, + ?string $before = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/comments"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Set the 'since' and 'before' parameters if not null. + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a comment. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $commentId): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a comment. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $commentId): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a comment. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * @param string $commentBody The new comment body. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit(string $owner, string $repo, int $commentId, string $commentBody): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}"; + + // Build the request data. + $data = new \stdClass(); + $data->body = $commentBody; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Add a comment to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $issueIndex The issue index. + * @param string $commentBody The comment body. + * + * @return object|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $issueIndex, string $commentBody): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$issueIndex}/comments"; + + // Build the request data. + $data = new \stdClass(); + $data->body = $commentBody; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.power b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.power new file mode 100644 index 0000000..0b529c5 --- /dev/null +++ b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.power @@ -0,0 +1,149 @@ + /** + * List all comments on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $page The page number to get, defaults to 1. + * @param int $limit The number of comments per page, defaults to 10. + * @param string|null $since The date-time since when to get comments, defaults to null. + * @param string|null $before The date-time before when to get comments, defaults to null. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $index, + int $page = 1, + int $limit = 10, + ?string $since = null, + ?string $before = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/comments"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Set the 'since' and 'before' parameters if not null. + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a comment. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $commentId): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a comment. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $commentId): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a comment. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * @param string $commentBody The new comment body. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit(string $owner, string $repo, int $commentId, string $commentBody): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}"; + + // Build the request data. + $data = new \stdClass(); + $data->body = $commentBody; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Add a comment to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $issueIndex The issue index. + * @param string $commentBody The comment body. + * + * @return object|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $issueIndex, string $commentBody): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$issueIndex}/comments"; + + // Build the request data. + $data = new \stdClass(); + $data->body = $commentBody; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } diff --git a/src/22d65693-917d-47c7-ba5c-8e1f354dc713/settings.json b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/settings.json new file mode 100644 index 0000000..fb0b543 --- /dev/null +++ b/src/22d65693-917d-47c7-ba5c-8e1f354dc713/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "22d65693-917d-47c7-ba5c-8e1f354dc713", + "implements": null, + "load_selection": null, + "name": "Comments", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Comments", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Comments", + "description": "The Gitea Issue Comments\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2a6f99df-a327-4477-8079-f57133e6ff36/README.md b/src/2a6f99df-a327-4477-8079-f57133e6ff36/README.md new file mode 100644 index 0000000..d00e3a8 --- /dev/null +++ b/src/2a6f99df-a327-4477-8079-f57133e6ff36/README.md @@ -0,0 +1,66 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class PublicMembers (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class PublicMembers #Gold { + + list(string $orgName, int $page = 1, ...) : ?array + + check(string $org, string $username) : ?string + + publicize(string $org, string $username) : ?string + + conceal(string $org, string $username) : string +} + +note right of PublicMembers::list + List an organization's public members. + + since: 3.2.0 + return: ?array + + arguments: + string $orgName + int $page = 1 + int $limit = 10 +end note + +note right of PublicMembers::check + Check if a user is a public member of an organization. + + since: 3.2.0 + return: ?string +end note + +note right of PublicMembers::publicize + Publicize a user's membership. + + since: 3.2.0 + return: ?string +end note + +note right of PublicMembers::conceal + Conceal a user's membership. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2a6f99df-a327-4477-8079-f57133e6ff36/code.php b/src/2a6f99df-a327-4477-8079-f57133e6ff36/code.php new file mode 100644 index 0000000..c828532 --- /dev/null +++ b/src/2a6f99df-a327-4477-8079-f57133e6ff36/code.php @@ -0,0 +1,119 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Public Members + * + * @since 3.2.0 + */ +class PublicMembers extends Api +{ + /** + * List an organization's public members. + * + * @param string $orgName The organization name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $orgName, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/public_members"; + + // Configure the request URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + + /** + * Check if a user is a public member of an organization. + * + * @param string $org The organization name. + * @param string $username The user's username. + * + * @return string|null + * @since 3.2.0 + **/ + public function check(string $org, string $username): ?string + { + // Build the request path. + $path = "/orgs/{$org}/public_members/{$username}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204 + ); + } + + /** + * Publicize a user's membership. + * + * @param string $org The organization name. + * @param string $username The user's username. + * + * @return string|null + * @since 3.2.0 + **/ + public function publicize(string $org, string $username): ?string + { + // Build the request path. + $path = "/orgs/{$org}/public_members/{$username}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204 + ); + } + + /** + * Conceal a user's membership. + * + * @param string $org The organization name. + * @param string $username The user's username. + * + * @return string + * @since 3.2.0 + **/ + public function conceal(string $org, string $username): string + { + // Build the request path. + $path = "/orgs/{$org}/public_members/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/2a6f99df-a327-4477-8079-f57133e6ff36/code.power b/src/2a6f99df-a327-4477-8079-f57133e6ff36/code.power new file mode 100644 index 0000000..44789c4 --- /dev/null +++ b/src/2a6f99df-a327-4477-8079-f57133e6ff36/code.power @@ -0,0 +1,92 @@ + /** + * List an organization's public members. + * + * @param string $orgName The organization name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $orgName, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/public_members"; + + // Configure the request URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + + /** + * Check if a user is a public member of an organization. + * + * @param string $org The organization name. + * @param string $username The user's username. + * + * @return string|null + * @since 3.2.0 + **/ + public function check(string $org, string $username): ?string + { + // Build the request path. + $path = "/orgs/{$org}/public_members/{$username}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204 + ); + } + + /** + * Publicize a user's membership. + * + * @param string $org The organization name. + * @param string $username The user's username. + * + * @return string|null + * @since 3.2.0 + **/ + public function publicize(string $org, string $username): ?string + { + // Build the request path. + $path = "/orgs/{$org}/public_members/{$username}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204 + ); + } + + /** + * Conceal a user's membership. + * + * @param string $org The organization name. + * @param string $username The user's username. + * + * @return string + * @since 3.2.0 + **/ + public function conceal(string $org, string $username): string + { + // Build the request path. + $path = "/orgs/{$org}/public_members/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/2a6f99df-a327-4477-8079-f57133e6ff36/settings.json b/src/2a6f99df-a327-4477-8079-f57133e6ff36/settings.json new file mode 100644 index 0000000..fe1662a --- /dev/null +++ b/src/2a6f99df-a327-4477-8079-f57133e6ff36/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "2a6f99df-a327-4477-8079-f57133e6ff36", + "implements": null, + "load_selection": null, + "name": "PublicMembers", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.PublicMembers", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.PublicMembers", + "description": "The Gitea Organization Public Members\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/README.md b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/README.md new file mode 100644 index 0000000..8183ea9 --- /dev/null +++ b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class NodeInfo (Details) +> namespace: **VDM\Joomla\Gitea\Miscellaneous** +```uml +@startuml +class NodeInfo #Gold { + + get() : ?object +} + +note right of NodeInfo::get + Returns the nodeinfo of the Gitea application. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.php b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.php new file mode 100644 index 0000000..fe714b2 --- /dev/null +++ b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Miscellaneous; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Miscellaneous NodeInfo + * + * @since 3.2.0 + */ +class NodeInfo extends Api +{ + /** + * Returns the nodeinfo of the Gitea application. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/nodeinfo"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.power b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.power new file mode 100644 index 0000000..a5ac56d --- /dev/null +++ b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.power @@ -0,0 +1,18 @@ + /** + * Returns the nodeinfo of the Gitea application. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/nodeinfo"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/settings.json b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/settings.json new file mode 100644 index 0000000..c861fce --- /dev/null +++ b/src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f", + "implements": null, + "load_selection": null, + "name": "NodeInfo", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Miscellaneous.NodeInfo", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous.NodeInfo", + "description": "The Gitea Miscellaneous NodeInfo\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2ccb303f-b115-45fb-b3ea-08a38259681e/README.md b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/README.md new file mode 100644 index 0000000..71b12f0 --- /dev/null +++ b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/README.md @@ -0,0 +1,51 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Times (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Times #Gold { + + list(int $page = 1, int $limit = 10, ...) : ?array + + stopwatches(int $page = 1, int $limit = 10) : ?array +} + +note right of Times::list + List the current user's tracked times. + + since: 3.2.0 + return: ?array + + arguments: + int $page = 1 + int $limit = 10 + ?string $since = null + ?string $before = null +end note + +note right of Times::stopwatches + Get list of all existing stopwatches for the authenticated user. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.php b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.php new file mode 100644 index 0000000..0274058 --- /dev/null +++ b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.php @@ -0,0 +1,96 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Times + * + * @since 3.2.0 + */ +class Times extends Api +{ + /** + * List the current user's tracked times. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * @param string|null $since Optional. Only show times updated after the given time (RFC 3339 format). + * @param string|null $before Optional. Only show times updated before the given time (RFC 3339 format). + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10, + ?string $since = null, + ?string $before = null + ): ?array + { + // Build the request path. + $path = '/user/times'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + if ($since !== null) + { + $url->setVar('since', $since); + } + + if ($before !== null) + { + $url->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Get list of all existing stopwatches for the authenticated user. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function stopwatches( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/stopwatches'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + +} + diff --git a/src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.power b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.power new file mode 100644 index 0000000..7602cb9 --- /dev/null +++ b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.power @@ -0,0 +1,69 @@ + /** + * List the current user's tracked times. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * @param string|null $since Optional. Only show times updated after the given time (RFC 3339 format). + * @param string|null $before Optional. Only show times updated before the given time (RFC 3339 format). + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10, + ?string $since = null, + ?string $before = null + ): ?array + { + // Build the request path. + $path = '/user/times'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + if ($since !== null) + { + $url->setVar('since', $since); + } + + if ($before !== null) + { + $url->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Get list of all existing stopwatches for the authenticated user. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function stopwatches( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/stopwatches'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } diff --git a/src/2ccb303f-b115-45fb-b3ea-08a38259681e/settings.json b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/settings.json new file mode 100644 index 0000000..048eae0 --- /dev/null +++ b/src/2ccb303f-b115-45fb-b3ea-08a38259681e/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "2ccb303f-b115-45fb-b3ea-08a38259681e", + "implements": null, + "load_selection": null, + "name": "Times", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Times", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Times", + "description": "The Gitea User Times\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/README.md b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/README.md new file mode 100644 index 0000000..1b85f0d --- /dev/null +++ b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Keys (Details) +> namespace: **VDM\Joomla\Gitea\Admin\Users** +```uml +@startuml +class Keys #Gold { + + add(string $userName, string $publicKey, ...) : ?object + + delete(string $username, int $id) : string +} + +note right of Keys::add + Add a public key on behalf of a user. + + since: 3.2.0 + return: ?object + + arguments: + string $userName + string $publicKey + string $keyTitle + bool $readOnly = false + ?string $description = null +end note + +note right of Keys::delete + Delete a user's public key. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.php b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.php new file mode 100644 index 0000000..bea01de --- /dev/null +++ b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.php @@ -0,0 +1,86 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin\Users; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Users Keys + * + * @since 3.2.0 + */ +class Keys extends Api +{ + /** + * Add a public key on behalf of a user. + * + * @param string $userName The user's display name. + * @param string $publicKey The public key to add. + * @param string $keyTitle Title of the key to add. + * @param bool $readOnly Whether the key has only read access or read/write (optional). + * @param string|null $description Description of the key (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function add( + string $userName, + string $publicKey, + string $keyTitle, + bool $readOnly = false, + ?string $description = null + ): ?object + { + // Build the request path. + $path = "/admin/users/{$userName}/keys"; + + // Set the key data. + $data = new \stdClass(); + $data->key = $publicKey; + $data->title = $keyTitle; + $data->read_only = $readOnly; + $data->description = $description; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Delete a user's public key. + * + * @param string $username The user's display name. + * @param int $id The public key ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $username, int $id): string + { + // Build the request path. + $path = "/admin/users/{$username}/keys/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.power b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.power new file mode 100644 index 0000000..72b5b7a --- /dev/null +++ b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.power @@ -0,0 +1,59 @@ + /** + * Add a public key on behalf of a user. + * + * @param string $userName The user's display name. + * @param string $publicKey The public key to add. + * @param string $keyTitle Title of the key to add. + * @param bool $readOnly Whether the key has only read access or read/write (optional). + * @param string|null $description Description of the key (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function add( + string $userName, + string $publicKey, + string $keyTitle, + bool $readOnly = false, + ?string $description = null + ): ?object + { + // Build the request path. + $path = "/admin/users/{$userName}/keys"; + + // Set the key data. + $data = new \stdClass(); + $data->key = $publicKey; + $data->title = $keyTitle; + $data->read_only = $readOnly; + $data->description = $description; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Delete a user's public key. + * + * @param string $username The user's display name. + * @param int $id The public key ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $username, int $id): string + { + // Build the request path. + $path = "/admin/users/{$username}/keys/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/settings.json b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/settings.json new file mode 100644 index 0000000..02ebc6e --- /dev/null +++ b/src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "2d29b342-cb4a-45f9-9cf1-a7347fbc0701", + "implements": null, + "load_selection": null, + "name": "Keys", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Users.Keys", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Users.Keys", + "description": "The Gitea Admin Users Keys\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/3a4ce297-4536-45be-b3cc-d93474e55528/README.md b/src/3a4ce297-4536-45be-b3cc-d93474e55528/README.md new file mode 100644 index 0000000..876b670 --- /dev/null +++ b/src/3a4ce297-4536-45be-b3cc-d93474e55528/README.md @@ -0,0 +1,64 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea\Notifications** +```uml +@startuml +class Repository #Gold { + + get(string $owner, string $repo, ...) : ?array + + update(string $owner, string $repo, ...) : ?array +} + +note right of Repository::get + List user's notification threads on a specific repo. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + bool $all = false + array $statusTypes = [] + array $subjectTypes = [] + string $since = '' + string $before = '' + int $page = 1 + int $limit = 10 +end note + +note right of Repository::update + Mark notification threads as read, pinned, or unread on a specific repo. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + ?bool $all = null + ?array $statusTypes = null + ?string $toStatus = null + ?string $lastReadAt = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3a4ce297-4536-45be-b3cc-d93474e55528/code.php b/src/3a4ce297-4536-45be-b3cc-d93474e55528/code.php new file mode 100644 index 0000000..4520391 --- /dev/null +++ b/src/3a4ce297-4536-45be-b3cc-d93474e55528/code.php @@ -0,0 +1,144 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Notifications; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Notifications Repository + * + * @since 3.2.0 + */ +class Repository extends Api +{ + /** + * List user's notification threads on a specific repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param bool $all Show notifications marked as read. + * @param array $statusTypes Show notifications with the provided status types. + * @param array $subjectTypes Filter notifications by subject type. + * @param string $since Show notifications updated after the given time. + * @param string $before Show notifications updated before the given time. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + bool $all = false, + array $statusTypes = [], + array $subjectTypes = [], + string $since = '', + string $before = '', + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + + if ($all) + { + $uri->setVar('all', $all); + } + + if (!empty($statusTypes)) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + + if (!empty($subjectTypes)) + { + $uri->setVar('subject-type', implode(',', $subjectTypes)); + } + + if (!empty($since)) + { + $uri->setVar('since', $since); + } + + if (!empty($before)) + { + $uri->setVar('before', $before); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Mark notification threads as read, pinned, or unread on a specific repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param bool|null $all Mark all notifications on this repo (optional). + * @param array|null $statusTypes Mark notifications with the provided status types (optional). + * @param string|null $toStatus Status to mark notifications as (optional). + * @param string|null $lastReadAt Last point that notifications were checked (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + ?bool $all = null, + ?array $statusTypes = null, + ?string $toStatus = null, + ?string $lastReadAt = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($toStatus !== null) + { + $uri->setVar('to-status', $toStatus); + } + if ($lastReadAt !== null) + { + $uri->setVar('last_read_at', $lastReadAt); + } + + // Send the put request. + return $this->response->get( + $this->http->put($uri, ''), 205 + ); + } + +} + diff --git a/src/3a4ce297-4536-45be-b3cc-d93474e55528/code.power b/src/3a4ce297-4536-45be-b3cc-d93474e55528/code.power new file mode 100644 index 0000000..c70c6e7 --- /dev/null +++ b/src/3a4ce297-4536-45be-b3cc-d93474e55528/code.power @@ -0,0 +1,117 @@ + /** + * List user's notification threads on a specific repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param bool $all Show notifications marked as read. + * @param array $statusTypes Show notifications with the provided status types. + * @param array $subjectTypes Filter notifications by subject type. + * @param string $since Show notifications updated after the given time. + * @param string $before Show notifications updated before the given time. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + bool $all = false, + array $statusTypes = [], + array $subjectTypes = [], + string $since = '', + string $before = '', + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + + if ($all) + { + $uri->setVar('all', $all); + } + + if (!empty($statusTypes)) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + + if (!empty($subjectTypes)) + { + $uri->setVar('subject-type', implode(',', $subjectTypes)); + } + + if (!empty($since)) + { + $uri->setVar('since', $since); + } + + if (!empty($before)) + { + $uri->setVar('before', $before); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Mark notification threads as read, pinned, or unread on a specific repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param bool|null $all Mark all notifications on this repo (optional). + * @param array|null $statusTypes Mark notifications with the provided status types (optional). + * @param string|null $toStatus Status to mark notifications as (optional). + * @param string|null $lastReadAt Last point that notifications were checked (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + ?bool $all = null, + ?array $statusTypes = null, + ?string $toStatus = null, + ?string $lastReadAt = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($toStatus !== null) + { + $uri->setVar('to-status', $toStatus); + } + if ($lastReadAt !== null) + { + $uri->setVar('last_read_at', $lastReadAt); + } + + // Send the put request. + return $this->response->get( + $this->http->put($uri, ''), 205 + ); + } diff --git a/src/3a4ce297-4536-45be-b3cc-d93474e55528/settings.json b/src/3a4ce297-4536-45be-b3cc-d93474e55528/settings.json new file mode 100644 index 0000000..d141472 --- /dev/null +++ b/src/3a4ce297-4536-45be-b3cc-d93474e55528/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "3a4ce297-4536-45be-b3cc-d93474e55528", + "implements": null, + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Notifications.Repository", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Notifications.Repository", + "description": "The Gitea Notifications Repository\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/README.md b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/README.md new file mode 100644 index 0000000..103a8ea --- /dev/null +++ b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Unadopted (Details) +> namespace: **VDM\Joomla\Gitea\Admin** +```uml +@startuml +class Unadopted #Gold { + + list(int $page = 1, int $limit = 10, ...) : ?array + + adopt(string $owner, string $repo) : string + + delete(string $owner, string $repo) : string +} + +note right of Unadopted::list + List unadopted repositories. + + since: 3.2.0 + return: ?array + + arguments: + int $page = 1 + int $limit = 10 + string $pattern = '' +end note + +note right of Unadopted::adopt + Adopt unadopted files as a repository. + + since: 3.2.0 + return: string +end note + +note right of Unadopted::delete + Delete unadopted files. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.php b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.php new file mode 100644 index 0000000..c73cf3e --- /dev/null +++ b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.php @@ -0,0 +1,101 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Unadopted + * + * @since 3.2.0 + */ +class Unadopted extends Api +{ + /** + * List unadopted repositories. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * @param string $pattern Pattern of repositories to search for. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10, string $pattern = ''): ?array + { + // Build the request path. + $path = "/admin/unadopted"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + if (!empty($pattern)) + { + $uri->setVar('pattern', $pattern); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Adopt unadopted files as a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function adopt(string $owner, string $repo): string + { + // Build the request path. + $path = "/admin/unadopted/{$owner}/{$repo}"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Delete unadopted files. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo): string + { + // Build the request path. + $path = "/admin/unadopted/{$owner}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.power b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.power new file mode 100644 index 0000000..161ad73 --- /dev/null +++ b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.power @@ -0,0 +1,74 @@ + /** + * List unadopted repositories. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * @param string $pattern Pattern of repositories to search for. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10, string $pattern = ''): ?array + { + // Build the request path. + $path = "/admin/unadopted"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + if (!empty($pattern)) + { + $uri->setVar('pattern', $pattern); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Adopt unadopted files as a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function adopt(string $owner, string $repo): string + { + // Build the request path. + $path = "/admin/unadopted/{$owner}/{$repo}"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Delete unadopted files. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo): string + { + // Build the request path. + $path = "/admin/unadopted/{$owner}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/settings.json b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/settings.json new file mode 100644 index 0000000..819fa27 --- /dev/null +++ b/src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "3aba9610-cb22-48e0-b2d7-2a9e708c82e2", + "implements": null, + "load_selection": null, + "name": "Unadopted", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Unadopted", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Unadopted", + "description": "The Gitea Admin Unadopted\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/3d25ea99-4f33-489a-934c-0e42027e6114/README.md b/src/3d25ea99-4f33-489a-934c-0e42027e6114/README.md new file mode 100644 index 0000000..d52734a --- /dev/null +++ b/src/3d25ea99-4f33-489a-934c-0e42027e6114/README.md @@ -0,0 +1,117 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Organization (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Organization #Gold { + + register(Container $container) : void + + getOrganization(Container $container) : Org + + getHooks(Container $container) : Hooks + + getLabels(Container $container) : Labels + + getMembers(Container $container) : Members + + getPublicMembers(Container $container) : PublicMembers + + getRepository(Container $container) : Repository + + getTeams(Container $container) : Teams + + getTeamsMembers(Container $container) : TeamsMembers + + getTeamsRepository(Container $container) : TeamsRepository + + getUser(Container $container) : User +} + +note right of Organization::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Organization::getOrganization + Get the Organization class + + since: 3.2.0 + return: Org +end note + +note right of Organization::getHooks + Get the Hooks class + + since: 3.2.0 + return: Hooks +end note + +note left of Organization::getLabels + Get the Labels class + + since: 3.2.0 + return: Labels +end note + +note right of Organization::getMembers + Get the Members class + + since: 3.2.0 + return: Members +end note + +note left of Organization::getPublicMembers + Get the Public Members class + + since: 3.2.0 + return: PublicMembers +end note + +note right of Organization::getRepository + Get the Repository class + + since: 3.2.0 + return: Repository +end note + +note left of Organization::getTeams + Get the Teams class + + since: 3.2.0 + return: Teams +end note + +note right of Organization::getTeamsMembers + Get the Teams Members class + + since: 3.2.0 + return: TeamsMembers +end note + +note left of Organization::getTeamsRepository + Get the Teams Repository class + + since: 3.2.0 + return: TeamsRepository +end note + +note right of Organization::getUser + Get the User class + + since: 3.2.0 + return: User +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3d25ea99-4f33-489a-934c-0e42027e6114/code.php b/src/3d25ea99-4f33-489a-934c-0e42027e6114/code.php new file mode 100644 index 0000000..dab899e --- /dev/null +++ b/src/3d25ea99-4f33-489a-934c-0e42027e6114/code.php @@ -0,0 +1,248 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Organization as Org; +use VDM\Joomla\Gitea\Organization\Hooks; +use VDM\Joomla\Gitea\Organization\Labels; +use VDM\Joomla\Gitea\Organization\Members; +use VDM\Joomla\Gitea\Organization\PublicMembers as PublicMembers; +use VDM\Joomla\Gitea\Organization\Repository; +use VDM\Joomla\Gitea\Organization\Teams; +use VDM\Joomla\Gitea\Organization\Teams\Members as TeamsMembers; +use VDM\Joomla\Gitea\Organization\Teams\Repository as TeamsRepository; +use VDM\Joomla\Gitea\Organization\User; + + +/** + * The Gitea Organization Service + * + * @since 3.2.0 + */ +class Organization implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Org::class, 'Gitea.Organization') + ->share('Gitea.Organization', [$this, 'getOrganization'], true); + + $container->alias(Hooks::class, 'Gitea.Organization.Hooks') + ->share('Gitea.Organization.Hooks', [$this, 'getHooks'], true); + + $container->alias(Labels::class, 'Gitea.Organization.Labels') + ->share('Gitea.Organization.Labels', [$this, 'getLabels'], true); + + $container->alias(Members::class, 'Gitea.Organization.Members') + ->share('Gitea.Organization.Members', [$this, 'getMembers'], true); + + $container->alias(PublicMembers::class, 'Gitea.Organization.Public.Members') + ->share('Gitea.Organization.Public.Members', [$this, 'getPublicMembers'], true); + + $container->alias(Repository::class, 'Gitea.Organization.Repository') + ->share('Gitea.Organization.Repository', [$this, 'getRepository'], true); + + $container->alias(Teams::class, 'Gitea.Organization.Teams') + ->share('Gitea.Organization.Teams', [$this, 'getTeams'], true); + + $container->alias(TeamsMembers::class, 'Gitea.Organization.Teams.Members') + ->share('Gitea.Organization.Teams.Members', [$this, 'getTeamsMembers'], true); + + $container->alias(TeamsRepository::class, 'Gitea.Organization.Teams.Repository') + ->share('Gitea.Organization.Teams.Repository', [$this, 'getTeamsRepository'], true); + + $container->alias(User::class, 'Gitea.Organization.User') + ->share('Gitea.Organization.User', [$this, 'getUser'], true); + } + + /** + * Get the Organization class + * + * @param Container $container The DI container. + * + * @return Org + * @since 3.2.0 + */ + public function getOrganization(Container $container): Org + { + return new Org( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Hooks class + * + * @param Container $container The DI container. + * + * @return Hooks + * @since 3.2.0 + */ + public function getHooks(Container $container): Hooks + { + return new Hooks( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Labels class + * + * @param Container $container The DI container. + * + * @return Labels + * @since 3.2.0 + */ + public function getLabels(Container $container): Labels + { + return new Labels( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Members class + * + * @param Container $container The DI container. + * + * @return Members + * @since 3.2.0 + */ + public function getMembers(Container $container): Members + { + return new Members( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Public Members class + * + * @param Container $container The DI container. + * + * @return PublicMembers + * @since 3.2.0 + */ + public function getPublicMembers(Container $container): PublicMembers + { + return new PublicMembers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams class + * + * @param Container $container The DI container. + * + * @return Teams + * @since 3.2.0 + */ + public function getTeams(Container $container): Teams + { + return new Teams( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams Members class + * + * @param Container $container The DI container. + * + * @return TeamsMembers + * @since 3.2.0 + */ + public function getTeamsMembers(Container $container): TeamsMembers + { + return new TeamsMembers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams Repository class + * + * @param Container $container The DI container. + * + * @return TeamsRepository + * @since 3.2.0 + */ + public function getTeamsRepository(Container $container): TeamsRepository + { + return new TeamsRepository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the User class + * + * @param Container $container The DI container. + * + * @return User + * @since 3.2.0 + */ + public function getUser(Container $container): User + { + return new User( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/3d25ea99-4f33-489a-934c-0e42027e6114/code.power b/src/3d25ea99-4f33-489a-934c-0e42027e6114/code.power new file mode 100644 index 0000000..8dec7ce --- /dev/null +++ b/src/3d25ea99-4f33-489a-934c-0e42027e6114/code.power @@ -0,0 +1,210 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Org::class, 'Gitea.Organization') + ->share('Gitea.Organization', [$this, 'getOrganization'], true); + + $container->alias(Hooks::class, 'Gitea.Organization.Hooks') + ->share('Gitea.Organization.Hooks', [$this, 'getHooks'], true); + + $container->alias(Labels::class, 'Gitea.Organization.Labels') + ->share('Gitea.Organization.Labels', [$this, 'getLabels'], true); + + $container->alias(Members::class, 'Gitea.Organization.Members') + ->share('Gitea.Organization.Members', [$this, 'getMembers'], true); + + $container->alias(PublicMembers::class, 'Gitea.Organization.Public.Members') + ->share('Gitea.Organization.Public.Members', [$this, 'getPublicMembers'], true); + + $container->alias(Repository::class, 'Gitea.Organization.Repository') + ->share('Gitea.Organization.Repository', [$this, 'getRepository'], true); + + $container->alias(Teams::class, 'Gitea.Organization.Teams') + ->share('Gitea.Organization.Teams', [$this, 'getTeams'], true); + + $container->alias(TeamsMembers::class, 'Gitea.Organization.Teams.Members') + ->share('Gitea.Organization.Teams.Members', [$this, 'getTeamsMembers'], true); + + $container->alias(TeamsRepository::class, 'Gitea.Organization.Teams.Repository') + ->share('Gitea.Organization.Teams.Repository', [$this, 'getTeamsRepository'], true); + + $container->alias(User::class, 'Gitea.Organization.User') + ->share('Gitea.Organization.User', [$this, 'getUser'], true); + } + + /** + * Get the Organization class + * + * @param Container $container The DI container. + * + * @return Org + * @since 3.2.0 + */ + public function getOrganization(Container $container): Org + { + return new Org( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Hooks class + * + * @param Container $container The DI container. + * + * @return Hooks + * @since 3.2.0 + */ + public function getHooks(Container $container): Hooks + { + return new Hooks( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Labels class + * + * @param Container $container The DI container. + * + * @return Labels + * @since 3.2.0 + */ + public function getLabels(Container $container): Labels + { + return new Labels( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Members class + * + * @param Container $container The DI container. + * + * @return Members + * @since 3.2.0 + */ + public function getMembers(Container $container): Members + { + return new Members( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Public Members class + * + * @param Container $container The DI container. + * + * @return PublicMembers + * @since 3.2.0 + */ + public function getPublicMembers(Container $container): PublicMembers + { + return new PublicMembers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams class + * + * @param Container $container The DI container. + * + * @return Teams + * @since 3.2.0 + */ + public function getTeams(Container $container): Teams + { + return new Teams( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams Members class + * + * @param Container $container The DI container. + * + * @return TeamsMembers + * @since 3.2.0 + */ + public function getTeamsMembers(Container $container): TeamsMembers + { + return new TeamsMembers( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Teams Repository class + * + * @param Container $container The DI container. + * + * @return TeamsRepository + * @since 3.2.0 + */ + public function getTeamsRepository(Container $container): TeamsRepository + { + return new TeamsRepository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the User class + * + * @param Container $container The DI container. + * + * @return User + * @since 3.2.0 + */ + public function getUser(Container $container): User + { + return new User( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/3d25ea99-4f33-489a-934c-0e42027e6114/settings.json b/src/3d25ea99-4f33-489a-934c-0e42027e6114/settings.json new file mode 100644 index 0000000..aa6b01f --- /dev/null +++ b/src/3d25ea99-4f33-489a-934c-0e42027e6114/settings.json @@ -0,0 +1,62 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "3d25ea99-4f33-489a-934c-0e42027e6114", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Organization", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Organization", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "8efd9070-7110-4b8e-bb76-cb1a286d5af2", + "as": "Org" + }, + "use_selection1": { + "use": "605d7058-345b-411e-b55d-027edc1ded83", + "as": "default" + }, + "use_selection2": { + "use": "9c9ba4c4-2039-4396-9ea2-621e42e04c89", + "as": "default" + }, + "use_selection3": { + "use": "c1be1e0d-479d-44de-bfe4-cfa4ded7e240", + "as": "default" + }, + "use_selection4": { + "use": "2a6f99df-a327-4477-8079-f57133e6ff36", + "as": "PublicMembers" + }, + "use_selection5": { + "use": "aeb42050-90e1-4169-907a-fa6cde20caa4", + "as": "default" + }, + "use_selection6": { + "use": "9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3", + "as": "default" + }, + "use_selection7": { + "use": "d9fa532a-dbe8-445f-93dc-398a3cf01c1e", + "as": "TeamsMembers" + }, + "use_selection8": { + "use": "07fce5f7-eb13-4dda-8870-77c9ad32a7bf", + "as": "TeamsRepository" + }, + "use_selection9": { + "use": "b3f6728b-8c88-4ee8-9aa0-bcef400a35bf", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Organization", + "description": "The Gitea Organization Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/README.md b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/README.md new file mode 100644 index 0000000..775904b --- /dev/null +++ b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Attachment (Details) +> namespace: **VDM\Joomla\Gitea\Settings** +```uml +@startuml +class Attachment #Gold { + + get() : ?object +} + +note right of Attachment::get + Get instance's global settings for Attachment. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.php b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.php new file mode 100644 index 0000000..9219388 --- /dev/null +++ b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Settings; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Settings Attachment + * + * @since 3.2.0 + */ +class Attachment extends Api +{ + /** + * Get instance's global settings for Attachment. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/attachment"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.power b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.power new file mode 100644 index 0000000..e470b8d --- /dev/null +++ b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.power @@ -0,0 +1,18 @@ + /** + * Get instance's global settings for Attachment. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/attachment"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/settings.json b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/settings.json new file mode 100644 index 0000000..4495ac8 --- /dev/null +++ b/src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "3d4ed24c-8250-4fcf-824f-a5f1597f939e", + "implements": null, + "load_selection": null, + "name": "Attachment", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Settings.Attachment", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Settings.Attachment", + "description": "The Gitea Settings Attachment\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/README.md b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/README.md new file mode 100644 index 0000000..d4d0582 --- /dev/null +++ b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Api (Details) +> namespace: **VDM\Joomla\Gitea\Abstraction** +```uml +@startuml +abstract Api #Orange { + # Http $http + # Uri $uri + # Response $response + + __construct(Http $http, Uri $uri, ...) + + load_(string $url, string $token) : void +} + +note right of Api::__construct + Constructor. + + since: 3.2.0 + + arguments: + Http $http + Uri $uri + Response $response +end note + +note right of Api::load_ + Load/Reload API. + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.php b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.php new file mode 100644 index 0000000..7f76657 --- /dev/null +++ b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.php @@ -0,0 +1,83 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Abstraction; + + +use VDM\Joomla\Gitea\Utilities\Http; +use VDM\Joomla\Gitea\Utilities\Uri; +use VDM\Joomla\Gitea\Utilities\Response; + + +/** + * The Gitea Api + * + * @since 3.2.0 + */ +abstract class Api +{ + /** + * The Http class + * + * @var Http + * @since 3.2.0 + */ + protected Http $http; + + /** + * The Uri class + * + * @var Uri + * @since 3.2.0 + */ + protected Uri $uri; + + /** + * The Response class + * + * @var Response + * @since 3.2.0 + */ + protected Response $response; + + /** + * Constructor. + * + * @param Http $http The http class. + * @param Uri $uri The uri class. + * @param Response $response The response class. + * + * @since 3.2.0 + **/ + public function __construct(Http $http, Uri $uri, Response $response) + { + $this->http = $http; + $this->uri = $uri; + $this->response = $response; + } + + /** + * Load/Reload API. + * + * @param string $url The url. + * @param token $token The token. + * + * @return void + * @since 3.2.0 + **/ + public function load_(string $url, string $token) + { + $this->uri->setUrl($url); + $this->http->setToken($token); + } + +} + diff --git a/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.power b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.power new file mode 100644 index 0000000..9e49af4 --- /dev/null +++ b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.power @@ -0,0 +1,54 @@ + /** + * The Http class + * + * @var Http + * @since 3.2.0 + */ + protected Http $http; + + /** + * The Uri class + * + * @var Uri + * @since 3.2.0 + */ + protected Uri $uri; + + /** + * The Response class + * + * @var Response + * @since 3.2.0 + */ + protected Response $response; + + /** + * Constructor. + * + * @param Http $http The http class. + * @param Uri $uri The uri class. + * @param Response $response The response class. + * + * @since 3.2.0 + **/ + public function __construct(Http $http, Uri $uri, Response $response) + { + $this->http = $http; + $this->uri = $uri; + $this->response = $response; + } + + /** + * Load/Reload API. + * + * @param string $url The url. + * @param token $token The token. + * + * @return void + * @since 3.2.0 + **/ + public function load_(string $url, string $token) + { + $this->uri->setUrl($url); + $this->http->setToken($token); + } diff --git a/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/settings.json b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/settings.json new file mode 100644 index 0000000..639f1c8 --- /dev/null +++ b/src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "implements": null, + "load_selection": null, + "name": "Api", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Abstraction.Api", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "ce40b3d2-226c-4a64-b116-c19455822be1", + "as": "default" + }, + "use_selection1": { + "use": "61e813c6-a872-4f55-8078-198241170e80", + "as": "default" + }, + "use_selection2": { + "use": "19eb68d7-1e19-4d14-a0ef-70d719c45e80", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Abstraction.Api", + "description": "The Gitea Api\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/403855fb-668d-464a-af45-8e30b198c9d6/README.md b/src/403855fb-668d-464a-af45-8e30b198c9d6/README.md new file mode 100644 index 0000000..b8f5171 --- /dev/null +++ b/src/403855fb-668d-464a-af45-8e30b198c9d6/README.md @@ -0,0 +1,94 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Mirrors (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Mirrors #Gold { + + get(string $owner, string $repo, ...) : ?array + + add(string $owner, string $repo, ...) : ?object + + sync(string $owner, string $repo) : string + + name(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string +} + +note right of Mirrors::get + Get all push mirrors of the repository. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Mirrors::add + Add a push mirror to the repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $remoteAddress + ?string $remoteUsername = null + ?string $remotePassword = null + string $interval + bool $syncOnCommit +end note + +note right of Mirrors::sync + Sync all push mirrored repositories. + + since: 3.2.0 + return: string +end note + +note right of Mirrors::name + Get push mirror of the repository by remoteName. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $name +end note + +note right of Mirrors::delete + Delete a push mirror from a repository by remoteName. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $name +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/403855fb-668d-464a-af45-8e30b198c9d6/code.php b/src/403855fb-668d-464a-af45-8e30b198c9d6/code.php new file mode 100644 index 0000000..2dd60ed --- /dev/null +++ b/src/403855fb-668d-464a-af45-8e30b198c9d6/code.php @@ -0,0 +1,190 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Mirrors + * + * @since 3.2.0 + */ +class Mirrors extends Api +{ + /** + * Get all push mirrors of the repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + */ + public function get( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors"; + + // Set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a push mirror to the repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $remoteAddress The push mirror address. + * @param string|null $remoteUsername The push mirror user. (Optional) + * @param string|null $remotePassword The push mirror password. (Optional) + * @param string $interval The interval for the push mirror. + * @param bool $syncOnCommit Sync on commit option. + * + * @return object|null + * @since 3.2.0 + */ + public function add( + string $owner, + string $repo, + string $remoteAddress, + ?string $remoteUsername = null, + ?string $remotePassword = null, + string $interval, + bool $syncOnCommit + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors"; + + // Set the mirror data. + $data = new \stdClass(); + $data->remote_address = $remoteAddress; + $data->interval = $interval; + $data->sync_on_commit = $syncOnCommit; + + if ($remoteUsername !== null) + { + $data->remote_username = $remoteUsername; + } + + if ($remotePassword !== null) + { + $data->remote_password = $remotePassword; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Sync all push mirrored repositories. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + */ + public function sync( + string $owner, + string $repo + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors-sync"; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 200, 'success' + ); + } + + /** + * Get push mirror of the repository by remoteName. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $name The remote name. + * + * @return object|null + * @since 3.2.0 + */ + public function name( + string $owner, + string $repo, + string $name + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors/{$name}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a push mirror from a repository by remoteName. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $name The remote name. + * + * @return string + * @since 3.2.0 + */ + public function delete( + string $owner, + string $repo, + string $name + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors/{$name}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + +} + diff --git a/src/403855fb-668d-464a-af45-8e30b198c9d6/code.power b/src/403855fb-668d-464a-af45-8e30b198c9d6/code.power new file mode 100644 index 0000000..59c70f3 --- /dev/null +++ b/src/403855fb-668d-464a-af45-8e30b198c9d6/code.power @@ -0,0 +1,163 @@ + /** + * Get all push mirrors of the repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + */ + public function get( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors"; + + // Set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a push mirror to the repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $remoteAddress The push mirror address. + * @param string|null $remoteUsername The push mirror user. (Optional) + * @param string|null $remotePassword The push mirror password. (Optional) + * @param string $interval The interval for the push mirror. + * @param bool $syncOnCommit Sync on commit option. + * + * @return object|null + * @since 3.2.0 + */ + public function add( + string $owner, + string $repo, + string $remoteAddress, + ?string $remoteUsername = null, + ?string $remotePassword = null, + string $interval, + bool $syncOnCommit + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors"; + + // Set the mirror data. + $data = new \stdClass(); + $data->remote_address = $remoteAddress; + $data->interval = $interval; + $data->sync_on_commit = $syncOnCommit; + + if ($remoteUsername !== null) + { + $data->remote_username = $remoteUsername; + } + + if ($remotePassword !== null) + { + $data->remote_password = $remotePassword; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Sync all push mirrored repositories. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + */ + public function sync( + string $owner, + string $repo + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors-sync"; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 200, 'success' + ); + } + + /** + * Get push mirror of the repository by remoteName. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $name The remote name. + * + * @return object|null + * @since 3.2.0 + */ + public function name( + string $owner, + string $repo, + string $name + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors/{$name}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a push mirror from a repository by remoteName. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $name The remote name. + * + * @return string + * @since 3.2.0 + */ + public function delete( + string $owner, + string $repo, + string $name + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/push_mirrors/{$name}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } diff --git a/src/403855fb-668d-464a-af45-8e30b198c9d6/settings.json b/src/403855fb-668d-464a-af45-8e30b198c9d6/settings.json new file mode 100644 index 0000000..f05e789 --- /dev/null +++ b/src/403855fb-668d-464a-af45-8e30b198c9d6/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "403855fb-668d-464a-af45-8e30b198c9d6", + "implements": null, + "load_selection": null, + "name": "Mirrors", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Mirrors", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Mirrors", + "description": "The Gitea Repository Mirrors\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/README.md b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/README.md new file mode 100644 index 0000000..58583c6 --- /dev/null +++ b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/README.md @@ -0,0 +1,133 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Issue (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Issue #Gold { + + register(Container $container) : void + + getIssue(Container $container) : Issu + + getComments(Container $container) : Comments + + getRepoComments(Container $container) : RepoComments + + getLabels(Container $container) : Labels + + getIssueLabels(Container $container) : IssueLabels + + getMilestones(Container $container) : Milestones + + getReactions(Container $container) : Reactions + + getComment(Container $container) : Comment + + getStopwatch(Container $container) : Stopwatch + + getSubscriptions(Container $container) : Subscriptions + + getTimeline(Container $container) : Timeline + + getTimes(Container $container) : Times +} + +note right of Issue::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Issue::getIssue + Get the Issue class + + since: 3.2.0 + return: Issu +end note + +note right of Issue::getComments + Get the Comments class + + since: 3.2.0 + return: Comments +end note + +note left of Issue::getRepoComments + Get the Repository Comments class + + since: 3.2.0 + return: RepoComments +end note + +note right of Issue::getLabels + Get the Labels class + + since: 3.2.0 + return: Labels +end note + +note left of Issue::getIssueLabels + Get the Issue Labels class + + since: 3.2.0 + return: IssueLabels +end note + +note right of Issue::getMilestones + Get the Milestones class + + since: 3.2.0 + return: Milestones +end note + +note left of Issue::getReactions + Get the Reactions class + + since: 3.2.0 + return: Reactions +end note + +note right of Issue::getComment + Get the Reactions Comment class + + since: 3.2.0 + return: Comment +end note + +note left of Issue::getStopwatch + Get the Stopwatch class + + since: 3.2.0 + return: Stopwatch +end note + +note right of Issue::getSubscriptions + Get the Subscriptions class + + since: 3.2.0 + return: Subscriptions +end note + +note left of Issue::getTimeline + Get the Timeline class + + since: 3.2.0 + return: Timeline +end note + +note right of Issue::getTimes + Get the Times class + + since: 3.2.0 + return: Times +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.php b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.php new file mode 100644 index 0000000..9c49a5a --- /dev/null +++ b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.php @@ -0,0 +1,294 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Issue as Issu; +use VDM\Joomla\Gitea\Issue\Comments; +use VDM\Joomla\Gitea\Issue\Repository\Comments as RepoComments; +use VDM\Joomla\Gitea\Issue\Deadline; +use VDM\Joomla\Gitea\Labels; +use VDM\Joomla\Gitea\Issue\Labels as IssueLabels; +use VDM\Joomla\Gitea\Issue\Milestones; +use VDM\Joomla\Gitea\Issue\Reactions; +use VDM\Joomla\Gitea\Issue\Reactions\Comment; +use VDM\Joomla\Gitea\Issue\Stopwatch; +use VDM\Joomla\Gitea\Issue\Subscriptions; +use VDM\Joomla\Gitea\Issue\Timeline; +use VDM\Joomla\Gitea\Issue\Times; + + +/** + * The Gitea Issue Service + * + * @since 3.2.0 + */ +class Issue implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Issu::class, 'Gitea.Issue') + ->share('Gitea.Issue', [$this, 'getIssue'], true); + + $container->alias(Comments::class, 'Gitea.Issue.Comments') + ->share('Gitea.Issue.Comments', [$this, 'getComments'], true); + + $container->alias(RepoComments::class, 'Gitea.Issue.Repository.Comments') + ->share('Gitea.Issue.Repository.Comments', [$this, 'getRepoComments'], true); + + $container->alias(Deadline::class, 'Gitea.Issue.Deadline') + ->share('Gitea.Issue.Deadline', [$this, 'getDeadline'], true); + + $container->alias(Labels::class, 'Gitea.Labels') + ->share('Gitea.Labels', [$this, 'getLabels'], true); + + $container->alias(IssueLabels::class, 'Gitea.Issue.Labels') + ->share('Gitea.Issue.Labels', [$this, 'getIssueLabels'], true); + + $container->alias(Milestones::class, 'Gitea.Issue.Milestones') + ->share('Gitea.Issue.Milestones', [$this, 'getMilestones'], true); + + $container->alias(Reactions::class, 'Gitea.Issue.Reactions') + ->share('Gitea.Issue.Reactions', [$this, 'getReactions'], true); + + $container->alias(Comment::class, 'Gitea.Issue.Reactions.Comment') + ->share('Gitea.Issue.Reactions.Comment', [$this, 'getComment'], true); + + $container->alias(Stopwatch::class, 'Gitea.Issue.Stopwatch') + ->share('Gitea.Issue.Stopwatch', [$this, 'getStopwatch'], true); + + $container->alias(Subscriptions::class, 'Gitea.Issue.Subscriptions') + ->share('Gitea.Issue.Subscriptions', [$this, 'getSubscriptions'], true); + + $container->alias(Timeline::class, 'Gitea.Issue.Timeline') + ->share('Gitea.Issue.Timeline', [$this, 'getTimeline'], true); + + $container->alias(Times::class, 'Gitea.Issue.Times') + ->share('Gitea.Issue.Times', [$this, 'getTimes'], true); + } + + /** + * Get the Issue class + * + * @param Container $container The DI container. + * + * @return Issu + * @since 3.2.0 + */ + public function getIssue(Container $container): Issu + { + return new Issu( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Comments class + * + * @param Container $container The DI container. + * + * @return Comments + * @since 3.2.0 + */ + public function getComments(Container $container): Comments + { + return new Comments( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository Comments class + * + * @param Container $container The DI container. + * + * @return RepoComments + * @since 3.2.0 + */ + public function getRepoComments(Container $container): RepoComments + { + return new RepoComments( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Labels class + * + * @param Container $container The DI container. + * + * @return Labels + * @since 3.2.0 + */ + public function getLabels(Container $container): Labels + { + return new Labels( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Issue Labels class + * + * @param Container $container The DI container. + * + * @return IssueLabels + * @since 3.2.0 + */ + public function getIssueLabels(Container $container): IssueLabels + { + return new IssueLabels( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Milestones class + * + * @param Container $container The DI container. + * + * @return Milestones + * @since 3.2.0 + */ + public function getMilestones(Container $container): Milestones + { + return new Milestones( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reactions class + * + * @param Container $container The DI container. + * + * @return Reactions + * @since 3.2.0 + */ + public function getReactions(Container $container): Reactions + { + return new Reactions( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reactions Comment class + * + * @param Container $container The DI container. + * + * @return Comment + * @since 3.2.0 + */ + public function getComment(Container $container): Comment + { + return new Comment( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Stopwatch class + * + * @param Container $container The DI container. + * + * @return Stopwatch + * @since 3.2.0 + */ + public function getStopwatch(Container $container): Stopwatch + { + return new Stopwatch( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Subscriptions class + * + * @param Container $container The DI container. + * + * @return Subscriptions + * @since 3.2.0 + */ + public function getSubscriptions(Container $container): Subscriptions + { + return new Subscriptions( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Timeline class + * + * @param Container $container The DI container. + * + * @return Timeline + * @since 3.2.0 + */ + public function getTimeline(Container $container): Timeline + { + return new Timeline( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Times class + * + * @param Container $container The DI container. + * + * @return Times + * @since 3.2.0 + */ + public function getTimes(Container $container): Times + { + return new Times( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.power b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.power new file mode 100644 index 0000000..02913ed --- /dev/null +++ b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.power @@ -0,0 +1,253 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Issu::class, 'Gitea.Issue') + ->share('Gitea.Issue', [$this, 'getIssue'], true); + + $container->alias(Comments::class, 'Gitea.Issue.Comments') + ->share('Gitea.Issue.Comments', [$this, 'getComments'], true); + + $container->alias(RepoComments::class, 'Gitea.Issue.Repository.Comments') + ->share('Gitea.Issue.Repository.Comments', [$this, 'getRepoComments'], true); + + $container->alias(Deadline::class, 'Gitea.Issue.Deadline') + ->share('Gitea.Issue.Deadline', [$this, 'getDeadline'], true); + + $container->alias(Labels::class, 'Gitea.Labels') + ->share('Gitea.Labels', [$this, 'getLabels'], true); + + $container->alias(IssueLabels::class, 'Gitea.Issue.Labels') + ->share('Gitea.Issue.Labels', [$this, 'getIssueLabels'], true); + + $container->alias(Milestones::class, 'Gitea.Issue.Milestones') + ->share('Gitea.Issue.Milestones', [$this, 'getMilestones'], true); + + $container->alias(Reactions::class, 'Gitea.Issue.Reactions') + ->share('Gitea.Issue.Reactions', [$this, 'getReactions'], true); + + $container->alias(Comment::class, 'Gitea.Issue.Reactions.Comment') + ->share('Gitea.Issue.Reactions.Comment', [$this, 'getComment'], true); + + $container->alias(Stopwatch::class, 'Gitea.Issue.Stopwatch') + ->share('Gitea.Issue.Stopwatch', [$this, 'getStopwatch'], true); + + $container->alias(Subscriptions::class, 'Gitea.Issue.Subscriptions') + ->share('Gitea.Issue.Subscriptions', [$this, 'getSubscriptions'], true); + + $container->alias(Timeline::class, 'Gitea.Issue.Timeline') + ->share('Gitea.Issue.Timeline', [$this, 'getTimeline'], true); + + $container->alias(Times::class, 'Gitea.Issue.Times') + ->share('Gitea.Issue.Times', [$this, 'getTimes'], true); + } + + /** + * Get the Issue class + * + * @param Container $container The DI container. + * + * @return Issu + * @since 3.2.0 + */ + public function getIssue(Container $container): Issu + { + return new Issu( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Comments class + * + * @param Container $container The DI container. + * + * @return Comments + * @since 3.2.0 + */ + public function getComments(Container $container): Comments + { + return new Comments( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository Comments class + * + * @param Container $container The DI container. + * + * @return RepoComments + * @since 3.2.0 + */ + public function getRepoComments(Container $container): RepoComments + { + return new RepoComments( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Labels class + * + * @param Container $container The DI container. + * + * @return Labels + * @since 3.2.0 + */ + public function getLabels(Container $container): Labels + { + return new Labels( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Issue Labels class + * + * @param Container $container The DI container. + * + * @return IssueLabels + * @since 3.2.0 + */ + public function getIssueLabels(Container $container): IssueLabels + { + return new IssueLabels( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Milestones class + * + * @param Container $container The DI container. + * + * @return Milestones + * @since 3.2.0 + */ + public function getMilestones(Container $container): Milestones + { + return new Milestones( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reactions class + * + * @param Container $container The DI container. + * + * @return Reactions + * @since 3.2.0 + */ + public function getReactions(Container $container): Reactions + { + return new Reactions( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Reactions Comment class + * + * @param Container $container The DI container. + * + * @return Comment + * @since 3.2.0 + */ + public function getComment(Container $container): Comment + { + return new Comment( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Stopwatch class + * + * @param Container $container The DI container. + * + * @return Stopwatch + * @since 3.2.0 + */ + public function getStopwatch(Container $container): Stopwatch + { + return new Stopwatch( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Subscriptions class + * + * @param Container $container The DI container. + * + * @return Subscriptions + * @since 3.2.0 + */ + public function getSubscriptions(Container $container): Subscriptions + { + return new Subscriptions( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Timeline class + * + * @param Container $container The DI container. + * + * @return Timeline + * @since 3.2.0 + */ + public function getTimeline(Container $container): Timeline + { + return new Timeline( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Times class + * + * @param Container $container The DI container. + * + * @return Times + * @since 3.2.0 + */ + public function getTimes(Container $container): Times + { + return new Times( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/settings.json b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/settings.json new file mode 100644 index 0000000..9501ae3 --- /dev/null +++ b/src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/settings.json @@ -0,0 +1,74 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "44396eb8-e14c-47d9-9bdc-8205c0fd2bba", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Issue", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Issue", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "5c8f9038-d6e9-4788-96df-45019eafbadb", + "as": "Issu" + }, + "use_selection1": { + "use": "22d65693-917d-47c7-ba5c-8e1f354dc713", + "as": "default" + }, + "use_selection2": { + "use": "63fbd482-688a-4356-b3e4-a676ef357100", + "as": "RepoComments" + }, + "use_selection3": { + "use": "61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69", + "as": "default" + }, + "use_selection4": { + "use": "ca53d4cb-7800-4ea2-b06e-7466ded91e49", + "as": "default" + }, + "use_selection5": { + "use": "e819d1a2-4390-432d-be36-3421f2fa861c", + "as": "IssueLabels" + }, + "use_selection6": { + "use": "f428beab-10f4-4c0d-bb9e-8c797ed7a7c9", + "as": "default" + }, + "use_selection7": { + "use": "e6c2dee6-54b9-4476-8896-2bfa14a87650", + "as": "default" + }, + "use_selection8": { + "use": "73b3ebfa-c52a-4a96-a8de-718ff0bbc155", + "as": "default" + }, + "use_selection9": { + "use": "a68d1841-65bb-41c8-ac09-cfddf73bb822", + "as": "default" + }, + "use_selection10": { + "use": "acca507d-e632-4349-9e3a-9dba5d19fbf9", + "as": "default" + }, + "use_selection11": { + "use": "83bb983b-80d8-44d5-917b-03d3c13742b9", + "as": "default" + }, + "use_selection12": { + "use": "d273c34e-88c1-438b-98c0-801996f58c29", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Issue", + "description": "The Gitea Issue Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/README.md b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/README.md new file mode 100644 index 0000000..9a54b55 --- /dev/null +++ b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Factory (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +abstract Factory #Orange { + # static $container + + {static} _(string $key) : Mixed + + {static} getContainer() : Container + # {static} createContainer() : Container +} + +note right of Factory::_ + Get any class from the package container + + since: 3.2.0 + return: Mixed +end note + +note right of Factory::getContainer + Get the global package container + + since: 3.2.0 + return: Container +end note + +note right of Factory::createContainer + Create a container object + + since: 3.2.0 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.php b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.php new file mode 100644 index 0000000..23bb273 --- /dev/null +++ b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.php @@ -0,0 +1,97 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use Joomla\DI\Container; +use VDM\Joomla\Gitea\Service\Utilities; +use VDM\Joomla\Gitea\Service\Jcb; +use VDM\Joomla\Gitea\Service\Settings; +use VDM\Joomla\Gitea\Service\Organization; +use VDM\Joomla\Gitea\Service\User; +use VDM\Joomla\Gitea\Service\Repository; +use VDM\Joomla\Gitea\Service\Package; +use VDM\Joomla\Gitea\Service\Issue; +use VDM\Joomla\Gitea\Service\Notifications; +use VDM\Joomla\Gitea\Service\Miscellaneous; +use VDM\Joomla\Gitea\Service\Admin; +use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface; + + +/** + * Gitea Factory + * + * @since 3.2.0 + */ +abstract class Factory implements FactoryInterface +{ + /** + * Global Package Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Utilities()) + ->registerServiceProvider(new Jcb()) + ->registerServiceProvider(new Settings()) + ->registerServiceProvider(new Organization()) + ->registerServiceProvider(new User()) + ->registerServiceProvider(new Repository()) + ->registerServiceProvider(new Package()) + ->registerServiceProvider(new Issue()) + ->registerServiceProvider(new Notifications()) + ->registerServiceProvider(new Miscellaneous()) + ->registerServiceProvider(new Admin()); + } + +} + diff --git a/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.power b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.power new file mode 100644 index 0000000..6201a64 --- /dev/null +++ b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.power @@ -0,0 +1,58 @@ + /** + * Global Package Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Utilities()) + ->registerServiceProvider(new Jcb()) + ->registerServiceProvider(new Settings()) + ->registerServiceProvider(new Organization()) + ->registerServiceProvider(new User()) + ->registerServiceProvider(new Repository()) + ->registerServiceProvider(new Package()) + ->registerServiceProvider(new Issue()) + ->registerServiceProvider(new Notifications()) + ->registerServiceProvider(new Miscellaneous()) + ->registerServiceProvider(new Admin()); + } diff --git a/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/settings.json b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/settings.json new file mode 100644 index 0000000..1a67439 --- /dev/null +++ b/src/4612af84-5a42-4ea5-87bf-9d79cc19c330/settings.json @@ -0,0 +1,65 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "4612af84-5a42-4ea5-87bf-9d79cc19c330", + "implements": [ + "caf33c5d-858c-4f9a-894f-ab302ec5445a" + ], + "load_selection": null, + "name": "Factory", + "power_version": "1.0.0", + "system_name": "Gitea.Factory", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c", + "as": "default" + }, + "use_selection1": { + "use": "d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe", + "as": "default" + }, + "use_selection2": { + "use": "f4d00907-c94a-49b7-8727-d64c1fa74cf5", + "as": "default" + }, + "use_selection3": { + "use": "3d25ea99-4f33-489a-934c-0e42027e6114", + "as": "default" + }, + "use_selection4": { + "use": "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e", + "as": "default" + }, + "use_selection5": { + "use": "0bb2b72f-ebcd-46fe-844b-ac5fe715c230", + "as": "default" + }, + "use_selection6": { + "use": "808da4eb-b467-46cf-a767-e7e714f46b5a", + "as": "default" + }, + "use_selection7": { + "use": "44396eb8-e14c-47d9-9bdc-8205c0fd2bba", + "as": "default" + }, + "use_selection8": { + "use": "be57f70f-1214-4d69-8d33-7cd4e312ff70", + "as": "default" + }, + "use_selection9": { + "use": "012af7d0-3436-4cae-b856-be49bdc39a3e", + "as": "default" + }, + "use_selection10": { + "use": "ddced4c5-667d-4559-873d-d716c17fd85b", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Factory", + "description": "Gitea Factory\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;", + "composer": "" +} \ No newline at end of file diff --git a/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/README.md b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/README.md new file mode 100644 index 0000000..bfca2ce --- /dev/null +++ b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/README.md @@ -0,0 +1,103 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Hooks (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Hooks #Gold { + + list(string $owner, string $repo, ...) : ?array + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + edit(string $owner, string $repo, ...) : ?object + + test(string $owner, string $repo, ...) : string +} + +note right of Hooks::list + List the hooks in a repository. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Hooks::create + Create a hook in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $type + array $config + bool $active = false + ?array $events = null + string $branchFilter = '' +end note + +note right of Hooks::get + Get a hook. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $hookId +end note + +note right of Hooks::edit + Edit a hook in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $id + array $config + array $events + bool $active +end note + +note right of Hooks::test + Test a push webhook. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $hookId + string $ref = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.php b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.php new file mode 100644 index 0000000..eadb2e6 --- /dev/null +++ b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.php @@ -0,0 +1,214 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Hooks + * + * @since 3.2.0 + */ +class Hooks extends Api +{ + /** + * List the hooks in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks"; + + // Set up the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a hook in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $type The hook type. + * @param array $config The hook configuration. + * @param bool $active The hook's active status (optional, default: false). + * @param array|null $events The events for the hook (optional). + * @param string $branchFilter The branch filter (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $type, + array $config, + string $type, + array $config, + bool $active = false, + ?array $events = null, + string $branchFilter = '' + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks"; + + // Set the hook data. + $data = new \stdClass(); + $data->type = $type; + $data->config = (object) $config; + $data->active = $active; + + if ($events !== null) + { + $data->events = $events; + } + + if (!empty($branchFilter)) + { + $data->branch_filter = $branchFilter; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a hook. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $hookId The hook ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $hookId + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/{$hookId}"; + + // Get the URI for the request path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Edit a hook in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The hook ID. + * @param array $config The hook configuration. + * @param array $events The events to trigger the hook. + * @param bool $active Whether the hook is active. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + int $id, + array $config, + array $events, + bool $active + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/{$id}"; + + // Set the hook data. + $data = new \stdClass(); + $data->config = $config; + $data->events = $events; + $data->active = $active; + + // Send the PATCH request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Test a push webhook. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $hookId The hook ID. + * @param string $ref The name of the commit/branch/tag (optional). + * + * @return string + * @since 3.2.0 + **/ + public function test( + string $owner, + string $repo, + int $hookId, + string $ref = '' + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/{$hookId}/tests"; + + // Get the URI for the request path. + $uri = $this->uri->get($path); + + if (!empty($ref)) + { + $uri->setVar('ref', $ref); + } + + // Send the POST request. + return $this->response->get( + $this->http->post($uri), 204, 'success' + ); + } + +} + diff --git a/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.power b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.power new file mode 100644 index 0000000..f8177bf --- /dev/null +++ b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/code.power @@ -0,0 +1,187 @@ + /** + * List the hooks in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks"; + + // Set up the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a hook in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $type The hook type. + * @param array $config The hook configuration. + * @param bool $active The hook's active status (optional, default: false). + * @param array|null $events The events for the hook (optional). + * @param string $branchFilter The branch filter (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $type, + array $config, + string $type, + array $config, + bool $active = false, + ?array $events = null, + string $branchFilter = '' + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks"; + + // Set the hook data. + $data = new \stdClass(); + $data->type = $type; + $data->config = (object) $config; + $data->active = $active; + + if ($events !== null) + { + $data->events = $events; + } + + if (!empty($branchFilter)) + { + $data->branch_filter = $branchFilter; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a hook. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $hookId The hook ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $hookId + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/{$hookId}"; + + // Get the URI for the request path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Edit a hook in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The hook ID. + * @param array $config The hook configuration. + * @param array $events The events to trigger the hook. + * @param bool $active Whether the hook is active. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + int $id, + array $config, + array $events, + bool $active + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/{$id}"; + + // Set the hook data. + $data = new \stdClass(); + $data->config = $config; + $data->events = $events; + $data->active = $active; + + // Send the PATCH request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Test a push webhook. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $hookId The hook ID. + * @param string $ref The name of the commit/branch/tag (optional). + * + * @return string + * @since 3.2.0 + **/ + public function test( + string $owner, + string $repo, + int $hookId, + string $ref = '' + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/{$hookId}/tests"; + + // Get the URI for the request path. + $uri = $this->uri->get($path); + + if (!empty($ref)) + { + $uri->setVar('ref', $ref); + } + + // Send the POST request. + return $this->response->get( + $this->http->post($uri), 204, 'success' + ); + } diff --git a/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/settings.json b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/settings.json new file mode 100644 index 0000000..5805dd7 --- /dev/null +++ b/src/463ce0a3-65e0-4a08-8bd2-e3bd0a058488/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "463ce0a3-65e0-4a08-8bd2-e3bd0a058488", + "implements": null, + "load_selection": null, + "name": "Hooks", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Hooks", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Hooks", + "description": "The Gitea Repository Hooks\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/README.md b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/README.md new file mode 100644 index 0000000..f8964d5 --- /dev/null +++ b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/README.md @@ -0,0 +1,51 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea\Admin\Users** +```uml +@startuml +class Repository #Gold { + + create(string $username, string $repoName, ...) : ?object +} + +note right of Repository::create + Create a repository on behalf of a user. + + since: 3.2.0 + return: ?object + + arguments: + string $username + string $repoName + ?string $description = null + bool $auto_init = false + ?string $default_branch = null + ?string $gitignores = null + ?string $issue_labels = null + ?string $license = null + bool $private = false + ?string $readme = null + bool $template = false + ?string $trust_model = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.php b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.php new file mode 100644 index 0000000..bfade26 --- /dev/null +++ b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.php @@ -0,0 +1,85 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin\Users; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Users Repository + * + * @since 3.2.0 + */ +class Repository extends Api +{ + /** + * Create a repository on behalf of a user. + * + * @param string $username The user's display name. + * @param string $repoName The repository name. + * @param string|null $description The repository description (optional). + * @param bool $auto_init Whether the repository should be auto-initialized? (optional). + * @param string|null $default_branch Default branch of the repository (optional). + * @param string|null $gitignores Gitignores to use (optional). + * @param string|null $issue_labels Label-Set to use (optional). + * @param string|null $license License to use (optional). + * @param bool $private Whether the repository is private (optional). + * @param string|null $readme Readme of the repository to create (optional). + * @param bool $template Whether the repository is template (optional). + * @param string|null $trust_model TrustModel of the repository (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $username, + string $repoName, + ?string $description = null, + bool $auto_init = false, + ?string $default_branch = null, + ?string $gitignores = null, + ?string $issue_labels = null, + ?string $license = null, + bool $private = false, + ?string $readme = null, + bool $template = false, + ?string $trust_model = null + ): ?object + { + // Build the request path. + $path = "/admin/users/{$username}/repos"; + + // Set the repository data. + $data = new \stdClass(); + $data->name = $repoName; + $data->description = $description; + $data->auto_init = $auto_init; + $data->default_branch = $default_branch; + $data->gitignores = $gitignores; + $data->issue_labels = $issue_labels; + $data->license = $license; + $data->private = $private; + $data->readme = $readme; + $data->template = $template; + $data->trust_model = $trust_model; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.power b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.power new file mode 100644 index 0000000..8c0445c --- /dev/null +++ b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/code.power @@ -0,0 +1,58 @@ + /** + * Create a repository on behalf of a user. + * + * @param string $username The user's display name. + * @param string $repoName The repository name. + * @param string|null $description The repository description (optional). + * @param bool $auto_init Whether the repository should be auto-initialized? (optional). + * @param string|null $default_branch Default branch of the repository (optional). + * @param string|null $gitignores Gitignores to use (optional). + * @param string|null $issue_labels Label-Set to use (optional). + * @param string|null $license License to use (optional). + * @param bool $private Whether the repository is private (optional). + * @param string|null $readme Readme of the repository to create (optional). + * @param bool $template Whether the repository is template (optional). + * @param string|null $trust_model TrustModel of the repository (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $username, + string $repoName, + ?string $description = null, + bool $auto_init = false, + ?string $default_branch = null, + ?string $gitignores = null, + ?string $issue_labels = null, + ?string $license = null, + bool $private = false, + ?string $readme = null, + bool $template = false, + ?string $trust_model = null + ): ?object + { + // Build the request path. + $path = "/admin/users/{$username}/repos"; + + // Set the repository data. + $data = new \stdClass(); + $data->name = $repoName; + $data->description = $description; + $data->auto_init = $auto_init; + $data->default_branch = $default_branch; + $data->gitignores = $gitignores; + $data->issue_labels = $issue_labels; + $data->license = $license; + $data->private = $private; + $data->readme = $readme; + $data->template = $template; + $data->trust_model = $trust_model; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } diff --git a/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/settings.json b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/settings.json new file mode 100644 index 0000000..9311023 --- /dev/null +++ b/src/49ae84dc-4474-468f-bf99-c92433fd1cc4/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "49ae84dc-4474-468f-bf99-c92433fd1cc4", + "implements": null, + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Users.Repository", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Users.Repository", + "description": "The Gitea Admin Users Repository\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/4a54c21f-ac3a-4489-b507-636835541a67/README.md b/src/4a54c21f-ac3a-4489-b507-636835541a67/README.md new file mode 100644 index 0000000..9a1dac4 --- /dev/null +++ b/src/4a54c21f-ac3a-4489-b507-636835541a67/README.md @@ -0,0 +1,43 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Files (Details) +> namespace: **VDM\Joomla\Gitea\Package** +```uml +@startuml +class Files #Gold { + + get(string $owner, string $type, ...) : ?object +} + +note right of Files::get + Gets all files of a package. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $type + string $name + string $version +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4a54c21f-ac3a-4489-b507-636835541a67/code.php b/src/4a54c21f-ac3a-4489-b507-636835541a67/code.php new file mode 100644 index 0000000..c3851c0 --- /dev/null +++ b/src/4a54c21f-ac3a-4489-b507-636835541a67/code.php @@ -0,0 +1,55 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Package; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Package Files + * + * @since 3.2.0 + */ +class Files extends Api +{ + /** + * Gets all files of a package. + * + * @param string $owner The owner of the package. + * @param string $type The type of the package. + * @param string $name The name of the package. + * @param string $version The version of the package. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $type, + string $name, + string $version + ): ?object + { + // Build the request path. + $path = "/packages/{$owner}/{$type}/{$name}/{$version}/files"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/4a54c21f-ac3a-4489-b507-636835541a67/code.power b/src/4a54c21f-ac3a-4489-b507-636835541a67/code.power new file mode 100644 index 0000000..88f4e77 --- /dev/null +++ b/src/4a54c21f-ac3a-4489-b507-636835541a67/code.power @@ -0,0 +1,28 @@ + /** + * Gets all files of a package. + * + * @param string $owner The owner of the package. + * @param string $type The type of the package. + * @param string $name The name of the package. + * @param string $version The version of the package. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $type, + string $name, + string $version + ): ?object + { + // Build the request path. + $path = "/packages/{$owner}/{$type}/{$name}/{$version}/files"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/4a54c21f-ac3a-4489-b507-636835541a67/settings.json b/src/4a54c21f-ac3a-4489-b507-636835541a67/settings.json new file mode 100644 index 0000000..2e6e887 --- /dev/null +++ b/src/4a54c21f-ac3a-4489-b507-636835541a67/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "4a54c21f-ac3a-4489-b507-636835541a67", + "implements": null, + "load_selection": null, + "name": "Files", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Package.Files", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Package.Files", + "description": "The Gitea Package Files\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/4a5694db-bf3c-439b-bf9c-36a487828787/README.md b/src/4a5694db-bf3c-439b-bf9c-36a487828787/README.md new file mode 100644 index 0000000..395489e --- /dev/null +++ b/src/4a5694db-bf3c-439b-bf9c-36a487828787/README.md @@ -0,0 +1,163 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class User (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class User #Gold { + + authenticate() : ?object + + search(string $keyword, ?int $uid = null, ...) : ?object + + get(string $username) : o + + followers(string $userName, int $page = 1, ...) : ?array + + following(string $userName, int $page = 1, ...) : ?array + + check(string $username, string $target) : string + + gpg(string $userName, int $page = 1, ...) : ?array + + heatmap(string $username) : ?array + + keys(string $userName, ?string $fingerprint = null, ...) : ?array + + repos(string $userName, int $page = 1, ...) : ?array + + repos(string $userName, int $page = 1, ...) : ?array + + watched(string $userName, int $page = 1, ...) : ?array +} + +note right of User::authenticate + Get the authenticated user. + + since: 3.2.0 + return: ?object +end note + +note left of User::search + Search for users. + + since: 3.2.0 + return: ?object + + arguments: + string $keyword + ?int $uid = null + int $page = 1 + int $limit = 10 +end note + +note right of User::get + Get a user by their username. + + since: 3.2.0 +end note + +note left of User::followers + List the given user's followers. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + int $page = 1 + int $limit = 10 +end note + +note right of User::following + List the users that the given user is following. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + int $page = 1 + int $limit = 10 +end note + +note left of User::check + Check if one user is following another user. + + since: 3.2.0 + return: string +end note + +note right of User::gpg + List the given user's GPG keys. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + int $page = 1 + int $limit = 10 +end note + +note left of User::heatmap + Get a user's heatmap. + + since: 3.2.0 + return: ?array +end note + +note right of User::keys + List the given user's public keys. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + ?string $fingerprint = null + int $page = 1 + int $limit = 10 +end note + +note left of User::repos + List the repos that the given user has starred. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + int $page = 1 + int $limit = 10 + List the repos that the given user has starred. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + int $page = 1 + int $limit = 10 +end note + +note right of User::watched + List the repositories watched by a user. + + since: 3.2.0 + return: ?array + + arguments: + string $userName + int $page = 1 + int $limit = 10 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4a5694db-bf3c-439b-bf9c-36a487828787/code.php b/src/4a5694db-bf3c-439b-bf9c-36a487828787/code.php new file mode 100644 index 0000000..33579e5 --- /dev/null +++ b/src/4a5694db-bf3c-439b-bf9c-36a487828787/code.php @@ -0,0 +1,365 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User + * + * @since 3.2.0 + */ +class User extends Api +{ + /** + * Get the authenticated user. + * + * @return object|null + * @since 3.2.0 + **/ + public function authenticate(): ?object + { + // Build the request path. + $path = '/user'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Search for users. + * + * @param string $keyword The search keyword. + * @param int|null $uid Optional. ID of the user to search for. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function search( + string $keyword, + ?int $uid = null, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = '/users/search'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('q', $keyword); + + if ($uid !== null) + { + $uri->setVar('uid', $uid); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a user by their username. + * + * @param string $username The username of the user to retrieve. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $username): o?bject + { + // Build the request path. + $path = "/users/{$username}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * List the given user's followers. + * + * @param string $userName The username of the user to retrieve followers for. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function followers( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/followers"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the users that the given user is following. + * + * @param string $userName The username of the user to retrieve the following users for. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function following( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/following"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if one user is following another user. + * + * @param string $username The username of the user to check. + * @param string $target The username of the target user. + * + * @return string + * @since 3.2.0 + **/ + public function check(string $username, string $target): string + { + // Build the request path. + $path = "/users/{$username}/following/{$target}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * List the given user's GPG keys. + * + * @param string $userName The username of the user to retrieve GPG keys for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function gpg( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/gpg_keys"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a user's heatmap. + * + * @param string $username The username of the user to retrieve heatmap for. + * + * @return array|null + * @since 3.2.0 + **/ + public function heatmap(string $username): ?array + { + // Build the request path. + $path = "/users/{$username}/heatmap"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * List the given user's public keys. + * + * @param string $userName The username of the user to retrieve public keys for. + * @param string|null $fingerprint Optional. The fingerprint of the key. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function keys( + string $userName, + ?string $fingerprint = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/keys"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + if ($fingerprint !== null) + { + $uri->setVar('fingerprint', $fingerprint); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the repos that the given user has starred. + * + * @param string $userName The username of the user to retrieve starred repos for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function repos( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/starred"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the repos that the given user has starred. + * + * @param string $userName The username of the user to retrieve starred repos for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function repos( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/starred"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the repositories watched by a user. + * + * @param string $userName The username of the user to retrieve watched repositories for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function watched( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/subscriptions"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/4a5694db-bf3c-439b-bf9c-36a487828787/code.power b/src/4a5694db-bf3c-439b-bf9c-36a487828787/code.power new file mode 100644 index 0000000..ad1c063 --- /dev/null +++ b/src/4a5694db-bf3c-439b-bf9c-36a487828787/code.power @@ -0,0 +1,338 @@ + /** + * Get the authenticated user. + * + * @return object|null + * @since 3.2.0 + **/ + public function authenticate(): ?object + { + // Build the request path. + $path = '/user'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Search for users. + * + * @param string $keyword The search keyword. + * @param int|null $uid Optional. ID of the user to search for. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function search( + string $keyword, + ?int $uid = null, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = '/users/search'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('q', $keyword); + + if ($uid !== null) + { + $uri->setVar('uid', $uid); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a user by their username. + * + * @param string $username The username of the user to retrieve. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $username): o?bject + { + // Build the request path. + $path = "/users/{$username}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * List the given user's followers. + * + * @param string $userName The username of the user to retrieve followers for. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function followers( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/followers"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the users that the given user is following. + * + * @param string $userName The username of the user to retrieve the following users for. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function following( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/following"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if one user is following another user. + * + * @param string $username The username of the user to check. + * @param string $target The username of the target user. + * + * @return string + * @since 3.2.0 + **/ + public function check(string $username, string $target): string + { + // Build the request path. + $path = "/users/{$username}/following/{$target}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * List the given user's GPG keys. + * + * @param string $userName The username of the user to retrieve GPG keys for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function gpg( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/gpg_keys"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a user's heatmap. + * + * @param string $username The username of the user to retrieve heatmap for. + * + * @return array|null + * @since 3.2.0 + **/ + public function heatmap(string $username): ?array + { + // Build the request path. + $path = "/users/{$username}/heatmap"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * List the given user's public keys. + * + * @param string $userName The username of the user to retrieve public keys for. + * @param string|null $fingerprint Optional. The fingerprint of the key. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function keys( + string $userName, + ?string $fingerprint = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/keys"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + if ($fingerprint !== null) + { + $uri->setVar('fingerprint', $fingerprint); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the repos that the given user has starred. + * + * @param string $userName The username of the user to retrieve starred repos for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function repos( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/starred"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the repos that the given user has starred. + * + * @param string $userName The username of the user to retrieve starred repos for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function repos( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/starred"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List the repositories watched by a user. + * + * @param string $userName The username of the user to retrieve watched repositories for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function watched( + string $userName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$userName}/subscriptions"; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/4a5694db-bf3c-439b-bf9c-36a487828787/settings.json b/src/4a5694db-bf3c-439b-bf9c-36a487828787/settings.json new file mode 100644 index 0000000..704b3ed --- /dev/null +++ b/src/4a5694db-bf3c-439b-bf9c-36a487828787/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "4a5694db-bf3c-439b-bf9c-36a487828787", + "implements": null, + "load_selection": null, + "name": "User", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User", + "description": "The Gitea User\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/README.md b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/README.md new file mode 100644 index 0000000..fbde1b9 --- /dev/null +++ b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/README.md @@ -0,0 +1,80 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Applications (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Applications #Gold { + + get(int $page = 1, int $limit = 10) : ?array + + id(int $id) : ?object + + create(string $appName, array $redirectUris, ...) : ?object + + delete(int $id) : string + + update(int $appId, string $appName, ...) : ?object +} + +note right of Applications::get + List the authenticated user's oauth2 applications. + + since: 3.2.0 + return: ?array +end note + +note right of Applications::id + Get an OAuth2 application by ID. + + since: 3.2.0 + return: ?object +end note + +note right of Applications::create + Creates a new OAuth2 application. + + since: 3.2.0 + return: ?object + + arguments: + string $appName + array $redirectUris + bool $confidentialClient = true +end note + +note right of Applications::delete + Delete an OAuth2 application by ID. + + since: 3.2.0 + return: string +end note + +note right of Applications::update + Update an OAuth2 application by ID, this includes regenerating the client secret. + + since: 3.2.0 + return: ?object + + arguments: + int $appId + string $appName + array $redirectUris + bool $confidentialClient = true +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.php b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.php new file mode 100644 index 0000000..10d8dc6 --- /dev/null +++ b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.php @@ -0,0 +1,166 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Applications + * + * @since 3.2.0 + */ +class Applications extends Api +{ + /** + * List the authenticated user's oauth2 applications. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/applications/oauth2'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get an OAuth2 application by ID. + * + * @param int $id The OAuth2 application ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function id(int $id): ?object + { + // Build the request path. + $path = "/user/applications/oauth2/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Creates a new OAuth2 application. + * + * @param string $appName The application name. + * @param array $redirectUris The application redirect URIs. + * @param bool $confidentialClient The confidentiality of the client (default: true). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $appName, + array $redirectUris, + bool $confidentialClient = true + ): ?object + { + // Build the request path. + $path = '/user/applications/oauth2'; + + // Set the application data. + $data = new \stdClass(); + $data->name = $appName; + $data->redirect_uris = $redirectUris; + $data->confidential_client = $confidentialClient; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Delete an OAuth2 application by ID. + * + * @param int $id The OAuth2 application ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(int $id): string + { + // Build the request path. + $path = "/user/applications/oauth2/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update an OAuth2 application by ID, this includes regenerating the client secret. + * + * @param int $appId The OAuth2 application ID. + * @param string $appName The application name. + * @param array $redirectUris The application redirect URIs. + * @param bool $confidentialClient The confidentiality of the client (default: true). + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + int $appId, + string $appName, + array $redirectUris, + bool $confidentialClient = true + ): ?object + { + // Build the request path. + $path = "/user/applications/oauth2/{$appId}"; + + // Set the application data. + $data = new \stdClass(); + $data->name = $appName; + $data->redirect_uris = $redirectUris; + $data->confidential_client = $confidentialClient; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + +} + diff --git a/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.power b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.power new file mode 100644 index 0000000..d93013a --- /dev/null +++ b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/code.power @@ -0,0 +1,139 @@ + /** + * List the authenticated user's oauth2 applications. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/applications/oauth2'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get an OAuth2 application by ID. + * + * @param int $id The OAuth2 application ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function id(int $id): ?object + { + // Build the request path. + $path = "/user/applications/oauth2/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Creates a new OAuth2 application. + * + * @param string $appName The application name. + * @param array $redirectUris The application redirect URIs. + * @param bool $confidentialClient The confidentiality of the client (default: true). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $appName, + array $redirectUris, + bool $confidentialClient = true + ): ?object + { + // Build the request path. + $path = '/user/applications/oauth2'; + + // Set the application data. + $data = new \stdClass(); + $data->name = $appName; + $data->redirect_uris = $redirectUris; + $data->confidential_client = $confidentialClient; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Delete an OAuth2 application by ID. + * + * @param int $id The OAuth2 application ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(int $id): string + { + // Build the request path. + $path = "/user/applications/oauth2/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update an OAuth2 application by ID, this includes regenerating the client secret. + * + * @param int $appId The OAuth2 application ID. + * @param string $appName The application name. + * @param array $redirectUris The application redirect URIs. + * @param bool $confidentialClient The confidentiality of the client (default: true). + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + int $appId, + string $appName, + array $redirectUris, + bool $confidentialClient = true + ): ?object + { + // Build the request path. + $path = "/user/applications/oauth2/{$appId}"; + + // Set the application data. + $data = new \stdClass(); + $data->name = $appName; + $data->redirect_uris = $redirectUris; + $data->confidential_client = $confidentialClient; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } diff --git a/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/settings.json b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/settings.json new file mode 100644 index 0000000..9a2da4e --- /dev/null +++ b/src/4a9e144e-7754-4d3f-9325-9ff792ce4aef/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "4a9e144e-7754-4d3f-9325-9ff792ce4aef", + "implements": null, + "load_selection": null, + "name": "Applications", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Applications", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Applications", + "description": "The Gitea User Applications\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/README.md b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/README.md new file mode 100644 index 0000000..66603fd --- /dev/null +++ b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/README.md @@ -0,0 +1,43 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Stargazers (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Stargazers #Gold { + + list(string $ownerName, string $repoName, ...) : ?array +} + +note right of Stargazers::list + List a repo's stargazers. + + since: 3.2.0 + return: ?array + + arguments: + string $ownerName + string $repoName + int $page = 1 + int $limit = 10 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.php b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.php new file mode 100644 index 0000000..0c72b6d --- /dev/null +++ b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.php @@ -0,0 +1,59 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Stargazers + * + * @since 3.2.0 + */ +class Stargazers extends Api +{ + /** + * List a repo's stargazers. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/stargazers"; + + // Set the page and limit values. + $this->uri->setVar('page', $page); + $this->uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.power b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.power new file mode 100644 index 0000000..b19c1d8 --- /dev/null +++ b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/code.power @@ -0,0 +1,32 @@ + /** + * List a repo's stargazers. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/stargazers"; + + // Set the page and limit values. + $this->uri->setVar('page', $page); + $this->uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/settings.json b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/settings.json new file mode 100644 index 0000000..2e7541d --- /dev/null +++ b/src/4b355731-bbcc-430f-a451-f94ff9bb1c20/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "4b355731-bbcc-430f-a451-f94ff9bb1c20", + "implements": null, + "load_selection": null, + "name": "Stargazers", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Stargazers", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Stargazers", + "description": "The Gitea Repository Stargazers\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/501fbf08-9f56-4aa0-96d7-5905b511be08/README.md b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/README.md new file mode 100644 index 0000000..f1fefbc --- /dev/null +++ b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Keys (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Keys #Gold { + + list(string $owner, string $repo, ...) : ?array + + add(string $owner, string $repo, ...) : ?object + + id(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string +} + +note right of Keys::list + List a repository's keys. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + ?int $keyId = null + ?string $fingerprint = null + int $page = 1 + int $limit = 10 +end note + +note right of Keys::add + Add a key to a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $key + string $title + bool $readOnly +end note + +note right of Keys::id + Get a repository's key by id. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $id +end note + +note right of Keys::delete + Delete a key from a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $id +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.php b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.php new file mode 100644 index 0000000..5e7757f --- /dev/null +++ b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.php @@ -0,0 +1,159 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Keys + * + * @since 3.2.0 + */ +class Keys extends Api +{ + /** + * List a repository's keys. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int|null $keyId The key_id to search for. (Optional) + * @param string|null $fingerprint The fingerprint of the key. (Optional) + * @param int $page The page number of results to return. (Default: 1) + * @param int $limit The page size of results. (Default: 10) + * + * @return array|null + * @since 3.2.0 + */ + public function list(string $owner, string $repo, ?int $keyId = null, ?string $fingerprint = null, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys"; + + // Prepare the URI. + $uri = $this->uri->get($path); + + // Add the optional query parameters. + if ($keyId !== null) + { + $uri->setVar('key_id', $keyId); + } + + if ($fingerprint !== null) + { + $uri->setVar('fingerprint', $fingerprint); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a key to a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $key The public key. + * @param string $title The title of the key. + * @param bool $readOnly Whether the key is read-only. + * + * @return object|null + * @since 3.2.0 + **/ + public function add( + string $owner, + string $repo, + string $key, + string $title, + bool $readOnly + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys"; + + // Set the key data. + $data = new \stdClass(); + $data->key = $key; + $data->title = $title; + $data->read_only = $readOnly; + + // Send the POST request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a repository's key by id. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The key ID. + * + * @return object|null + * @since 3.2.0 + */ + public function id( + string $owner, + string $repo, + int $id + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys/{$id}"; + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a key from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The key ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + int $id + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys/{$id}"; + + // Send the DELETE request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.power b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.power new file mode 100644 index 0000000..89276da --- /dev/null +++ b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/code.power @@ -0,0 +1,132 @@ + /** + * List a repository's keys. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int|null $keyId The key_id to search for. (Optional) + * @param string|null $fingerprint The fingerprint of the key. (Optional) + * @param int $page The page number of results to return. (Default: 1) + * @param int $limit The page size of results. (Default: 10) + * + * @return array|null + * @since 3.2.0 + */ + public function list(string $owner, string $repo, ?int $keyId = null, ?string $fingerprint = null, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys"; + + // Prepare the URI. + $uri = $this->uri->get($path); + + // Add the optional query parameters. + if ($keyId !== null) + { + $uri->setVar('key_id', $keyId); + } + + if ($fingerprint !== null) + { + $uri->setVar('fingerprint', $fingerprint); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a key to a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $key The public key. + * @param string $title The title of the key. + * @param bool $readOnly Whether the key is read-only. + * + * @return object|null + * @since 3.2.0 + **/ + public function add( + string $owner, + string $repo, + string $key, + string $title, + bool $readOnly + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys"; + + // Set the key data. + $data = new \stdClass(); + $data->key = $key; + $data->title = $title; + $data->read_only = $readOnly; + + // Send the POST request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a repository's key by id. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The key ID. + * + * @return object|null + * @since 3.2.0 + */ + public function id( + string $owner, + string $repo, + int $id + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys/{$id}"; + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a key from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The key ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + int $id + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/keys/{$id}"; + + // Send the DELETE request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/501fbf08-9f56-4aa0-96d7-5905b511be08/settings.json b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/settings.json new file mode 100644 index 0000000..dd8c441 --- /dev/null +++ b/src/501fbf08-9f56-4aa0-96d7-5905b511be08/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "501fbf08-9f56-4aa0-96d7-5905b511be08", + "implements": null, + "load_selection": null, + "name": "Keys", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Keys", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Keys", + "description": "The Gitea Repository Keys\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/README.md b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/README.md new file mode 100644 index 0000000..b0fedac --- /dev/null +++ b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Settings (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Settings #Gold { + + get() : ?object + + update(?string $description = null, ?string $diffViewStyle = null, ...) : ?array +} + +note right of Settings::get + Get user settings for the authenticated user. + + since: 3.2.0 + return: ?object +end note + +note right of Settings::update + Update user settings for the authenticated user. + + since: 3.2.0 + return: ?array + + arguments: + ?string $description = null + ?string $diffViewStyle = null + ?string $fullName = null + ?bool $hideActivity = null + ?bool $hideEmail = null + ?string $language = null + ?string $location = null + ?string $theme = null + ?string $website = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.php b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.php new file mode 100644 index 0000000..2118c9e --- /dev/null +++ b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.php @@ -0,0 +1,124 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Settings + * + * @since 3.2.0 + */ +class Settings extends Api +{ + /** + * Get user settings for the authenticated user. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = '/user/settings'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Update user settings for the authenticated user. + * + * @param string|null $description Optional. The description to update. + * @param string|null $diffViewStyle Optional. The diff view style to update. + * @param string|null $fullName Optional. The full name to update. + * @param bool|null $hideActivity Optional. Whether to hide activity or not. + * @param bool|null $hideEmail Optional. Whether to hide email or not. + * @param string|null $language Optional. The language to update. + * @param string|null $location Optional. The location to update. + * @param string|null $theme Optional. The theme to update. + * @param string|null $website Optional. The website to update. + * + * @return array|null + * @since 3.2.0 + **/ + public function update( + ?string $description = null, + ?string $diffViewStyle = null, + ?string $fullName = null, + ?bool $hideActivity = null, + ?bool $hideEmail = null, + ?string $language = null, + ?string $location = null, + ?string $theme = null, + ?string $website = null + ): ?array + { + // Prepare settings data + $settings = []; + if ($description !== null) + { + $settings['description'] = $description; + } + if ($diffViewStyle !== null) + { + $settings['diff_view_style'] = $diffViewStyle; + } + if ($fullName !== null) + { + $settings['full_name'] = $fullName; + } + if ($hideActivity !== null) + { + $settings['hide_activity'] = $hideActivity; + } + if ($hideEmail !== null) + { + $settings['hide_email'] = $hideEmail; + } + if ($language !== null) + { + $settings['language'] = $language; + } + if ($location !== null) + { + $settings['location'] = $location; + } + if ($theme !== null) + { + $settings['theme'] = $theme; + } + if ($website !== null) + { + $settings['website'] = $website; + } + + // Build the request path. + $path = '/user/settings'; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($settings) + ) + ); + } + +} + diff --git a/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.power b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.power new file mode 100644 index 0000000..fca0716 --- /dev/null +++ b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/code.power @@ -0,0 +1,97 @@ + /** + * Get user settings for the authenticated user. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = '/user/settings'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Update user settings for the authenticated user. + * + * @param string|null $description Optional. The description to update. + * @param string|null $diffViewStyle Optional. The diff view style to update. + * @param string|null $fullName Optional. The full name to update. + * @param bool|null $hideActivity Optional. Whether to hide activity or not. + * @param bool|null $hideEmail Optional. Whether to hide email or not. + * @param string|null $language Optional. The language to update. + * @param string|null $location Optional. The location to update. + * @param string|null $theme Optional. The theme to update. + * @param string|null $website Optional. The website to update. + * + * @return array|null + * @since 3.2.0 + **/ + public function update( + ?string $description = null, + ?string $diffViewStyle = null, + ?string $fullName = null, + ?bool $hideActivity = null, + ?bool $hideEmail = null, + ?string $language = null, + ?string $location = null, + ?string $theme = null, + ?string $website = null + ): ?array + { + // Prepare settings data + $settings = []; + if ($description !== null) + { + $settings['description'] = $description; + } + if ($diffViewStyle !== null) + { + $settings['diff_view_style'] = $diffViewStyle; + } + if ($fullName !== null) + { + $settings['full_name'] = $fullName; + } + if ($hideActivity !== null) + { + $settings['hide_activity'] = $hideActivity; + } + if ($hideEmail !== null) + { + $settings['hide_email'] = $hideEmail; + } + if ($language !== null) + { + $settings['language'] = $language; + } + if ($location !== null) + { + $settings['location'] = $location; + } + if ($theme !== null) + { + $settings['theme'] = $theme; + } + if ($website !== null) + { + $settings['website'] = $website; + } + + // Build the request path. + $path = '/user/settings'; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($settings) + ) + ); + } diff --git a/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/settings.json b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/settings.json new file mode 100644 index 0000000..a63a654 --- /dev/null +++ b/src/553b8fc5-46cc-49b7-95ce-992a3c5708f8/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "553b8fc5-46cc-49b7-95ce-992a3c5708f8", + "implements": null, + "load_selection": null, + "name": "Settings", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Settings", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Settings", + "description": "The Gitea User Settings\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/572b9567-1893-400b-bd34-f1a45ef7e503/README.md b/src/572b9567-1893-400b-bd34-f1a45ef7e503/README.md new file mode 100644 index 0000000..6fb13de --- /dev/null +++ b/src/572b9567-1893-400b-bd34-f1a45ef7e503/README.md @@ -0,0 +1,114 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Wiki (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Wiki #Gold { + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + pages(string $owner, string $repo, ...) : ?array + + delete(string $owner, string $repo, ...) : string + + edit(string $owner, string $repo, ...) : ?object + + revisions(string $owner, string $repo, ...) : ?object +} + +note right of Wiki::create + Create a wiki page. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $title + string $contentBase64 + ?string $message = null +end note + +note right of Wiki::get + Get a wiki page. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $pageName +end note + +note right of Wiki::pages + Get all wiki pages. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Wiki::delete + Delete a wiki page. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $pageName +end note + +note right of Wiki::edit + Edit a wiki page. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $pageName + string $title + string $content + string $message = null +end note + +note right of Wiki::revisions + Get revisions of a wiki page. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $pageName + int $page = 1 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/572b9567-1893-400b-bd34-f1a45ef7e503/code.php b/src/572b9567-1893-400b-bd34-f1a45ef7e503/code.php new file mode 100644 index 0000000..7488608 --- /dev/null +++ b/src/572b9567-1893-400b-bd34-f1a45ef7e503/code.php @@ -0,0 +1,232 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Wiki + * + * @since 3.2.0 + */ +class Wiki extends Api +{ + /** + * Create a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $title The title of the wiki page. + * @param string $contentBase64 The base64 encoded content of the wiki page. + * @param string|null $message Optional commit message summarizing the change. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $title, + string $contentBase64, + ?string $message = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/new"; + + // Set the wiki data. + $data = new \stdClass(); + $data->title = $title; + $data->content_base64 = $contentBase64; + + if ($message !== null) + { + $data->message = $message; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $pageName + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/page/{$pageName}"; + + // Set the URI. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get all wiki pages. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function pages( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/pages"; + + // Set the URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $pageName + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/page/{$pageName}"; + + // Get the URI. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + + /** + * Edit a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * @param string $title The new title of the wiki page. + * @param string $content The new content of the wiki page. + * @param string $message The optional commit message summarizing the change. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + string $pageName, + string $title, + string $content, + string $message = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/page/{$pageName}"; + + // Set the wiki data. + $data = new \stdClass(); + $data->title = $title; + $data->content_base64 = base64_encode($content); + + if ($message !== null) + { + $data->message = $message; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Get revisions of a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * @param int $page The page number of results to return (1-based). + * + * @return object|null + * @since 3.2.0 + **/ + public function revisions( + string $owner, + string $repo, + string $pageName, + int $page = 1 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/revisions/{$pageName}"; + + // Set the page number. + $this->uri->setVar('page', $page); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/572b9567-1893-400b-bd34-f1a45ef7e503/code.power b/src/572b9567-1893-400b-bd34-f1a45ef7e503/code.power new file mode 100644 index 0000000..1393932 --- /dev/null +++ b/src/572b9567-1893-400b-bd34-f1a45ef7e503/code.power @@ -0,0 +1,205 @@ + /** + * Create a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $title The title of the wiki page. + * @param string $contentBase64 The base64 encoded content of the wiki page. + * @param string|null $message Optional commit message summarizing the change. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $title, + string $contentBase64, + ?string $message = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/new"; + + // Set the wiki data. + $data = new \stdClass(); + $data->title = $title; + $data->content_base64 = $contentBase64; + + if ($message !== null) + { + $data->message = $message; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $pageName + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/page/{$pageName}"; + + // Set the URI. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get all wiki pages. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function pages( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/pages"; + + // Set the URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $pageName + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/page/{$pageName}"; + + // Get the URI. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + + /** + * Edit a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * @param string $title The new title of the wiki page. + * @param string $content The new content of the wiki page. + * @param string $message The optional commit message summarizing the change. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + string $pageName, + string $title, + string $content, + string $message = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/page/{$pageName}"; + + // Set the wiki data. + $data = new \stdClass(); + $data->title = $title; + $data->content_base64 = base64_encode($content); + + if ($message !== null) + { + $data->message = $message; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Get revisions of a wiki page. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $pageName The name of the wiki page. + * @param int $page The page number of results to return (1-based). + * + * @return object|null + * @since 3.2.0 + **/ + public function revisions( + string $owner, + string $repo, + string $pageName, + int $page = 1 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/wiki/revisions/{$pageName}"; + + // Set the page number. + $this->uri->setVar('page', $page); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/572b9567-1893-400b-bd34-f1a45ef7e503/settings.json b/src/572b9567-1893-400b-bd34-f1a45ef7e503/settings.json new file mode 100644 index 0000000..d9a425b --- /dev/null +++ b/src/572b9567-1893-400b-bd34-f1a45ef7e503/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "572b9567-1893-400b-bd34-f1a45ef7e503", + "implements": null, + "load_selection": null, + "name": "Wiki", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Wiki", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Wiki", + "description": "The Gitea Repository Wiki\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/5974503e-e56c-488b-bee3-f93b90c781df/README.md b/src/5974503e-e56c-488b-bee3-f93b90c781df/README.md new file mode 100644 index 0000000..22a51aa --- /dev/null +++ b/src/5974503e-e56c-488b-bee3-f93b90c781df/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Gpg (Details) +> namespace: **VDM\Joomla\Gitea\Miscellaneous** +```uml +@startuml +class Gpg #Gold { + + get() : ?string +} + +note right of Gpg::get + Get default signing-key.gpg. + + since: 3.2.0 + return: ?string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5974503e-e56c-488b-bee3-f93b90c781df/code.php b/src/5974503e-e56c-488b-bee3-f93b90c781df/code.php new file mode 100644 index 0000000..5a92c54 --- /dev/null +++ b/src/5974503e-e56c-488b-bee3-f93b90c781df/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Miscellaneous; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Miscellaneous Gpg + * + * @since 3.2.0 + */ +class Gpg extends Api +{ + /** + * Get default signing-key.gpg. + * + * @return string|null + * @since 3.2.0 + **/ + public function get(): ?string + { + // Build the request path. + $path = "/signing-key.gpg"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/5974503e-e56c-488b-bee3-f93b90c781df/code.power b/src/5974503e-e56c-488b-bee3-f93b90c781df/code.power new file mode 100644 index 0000000..1cfff4f --- /dev/null +++ b/src/5974503e-e56c-488b-bee3-f93b90c781df/code.power @@ -0,0 +1,18 @@ + /** + * Get default signing-key.gpg. + * + * @return string|null + * @since 3.2.0 + **/ + public function get(): ?string + { + // Build the request path. + $path = "/signing-key.gpg"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/5974503e-e56c-488b-bee3-f93b90c781df/settings.json b/src/5974503e-e56c-488b-bee3-f93b90c781df/settings.json new file mode 100644 index 0000000..ed0b0e4 --- /dev/null +++ b/src/5974503e-e56c-488b-bee3-f93b90c781df/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "5974503e-e56c-488b-bee3-f93b90c781df", + "implements": null, + "load_selection": null, + "name": "Gpg", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Miscellaneous.Gpg", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous.Gpg", + "description": "The Gitea Miscellaneous Gpg\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/5c8f9038-d6e9-4788-96df-45019eafbadb/README.md b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/README.md new file mode 100644 index 0000000..27a041a --- /dev/null +++ b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/README.md @@ -0,0 +1,146 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Issue (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class Issue #Gold { + + list(string $owner, string $repo, ...) : ?array + + get(string $owner, string $repo, ...) : ?object + + create(string $owner, string $repo, ...) : ?object + + search(string $q, int $page = 1, ...) : ?array + + edit(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string +} + +note right of Issue::list + List a repository's issues. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + string $state = 'open' + int $page = 1 + int $limit = 10 + ?string $labels = null + ?string $q = null + ?string $type = null + ?string $milestones = null + ?string $since = null + ?string $before = null + ?string $createdBy = null + ?string $assignedBy = null + ?string $mentionedBy = null +end note + +note right of Issue::get + Get an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index +end note + +note right of Issue::create + Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $issueTitle + ?array $assignees = null + ?string $issueBody = null + ?bool $closed = null + ?string $dueDate = null + ?array $labelIds = null + ?int $milestoneId = null +end note + +note right of Issue::search + Search for issues across the repositories that the user has access to. + + since: 3.2.0 + return: ?array + + arguments: + string $q + int $page = 1 + int $limit = 10 + ?string $state = 'open' + ?string $labels = null + ?string $milestones = null + ?int $priorityRepoId = null + ?string $type = null + ?string $since = null + ?string $before = null + ?bool $assigned = null + ?bool $created = null + ?bool $mentioned = null + ?bool $reviewRequested = null + ?string $owner = null + ?string $team = null +end note + +note right of Issue::edit + Edit an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + ?string $assignee = null + ?array $assignees = null + ?string $body = null + ?string $dueDate = null + ?int $milestone = null + ?string $ref = null + ?string $state = null + ?string $title = null + ?bool $unsetDueDate = null +end note + +note right of Issue::delete + Delete an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.php b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.php new file mode 100644 index 0000000..bfeb418 --- /dev/null +++ b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.php @@ -0,0 +1,406 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue + * + * @since 3.2.0 + */ +class Issue extends Api +{ + /** + * List a repository's issues. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $state The state of the issues to get, defaults to 'open'. + * @param int $page The page to get, defaults to null. + * @param int $limit The number of issues per page, defaults to null. + * @param string|null $labels Comma-separated list of labels, defaults to null. + * @param string|null $q The search string, defaults to null. + * @param string|null $type The type to filter by (issues/pulls), defaults to null. + * @param string|null $milestones Comma-separated list of milestone names or IDs, defaults to null. + * @param string|null $since Only show items updated after the given time, defaults to null. + * @param string|null $before Only show items updated before the given time, defaults to null. + * @param string|null $createdBy Only show items created by the given user, defaults to null. + * @param string|null $assignedBy Only show items assigned to the given user, defaults to null. + * @param string|null $mentionedBy Only show items where the given user is mentioned, defaults to null. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + string $state = 'open', + int $page = 1, + int $limit = 10, + ?string $labels = null, + ?string $q = null, + ?string $type = null, + ?string $milestones = null, + ?string $since = null, + ?string $before = null, + ?string $createdBy = null, + ?string $assignedBy = null, + ?string $mentionedBy = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Set the query parameters + $uri->setVar('state', $state); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + $uri->setVar('labels', $labels); + $uri->setVar('q', $q); + $uri->setVar('type', $type); + $uri->setVar('milestones', $milestones); + $uri->setVar('since', $since); + $uri->setVar('before', $before); + $uri->setVar('created_by', $createdBy); + $uri->setVar('assigned_by', $assignedBy); + $uri->setVar('mentioned_by', $mentionedBy); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $index): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $issueTitle The issue title. + * @param array|null $assignees The array of assignees, defaults to null. + * @param string|null $issueBody The issue body, defaults to null. + * @param bool|null $closed If the issue is closed, defaults to null. + * @param string|null $dueDate The deadline for the issue, format: "YYYY-MM-DD", defaults to null. + * @param array|null $labelIds The array of label IDs to attach to the issue, defaults to null. + * @param int|null $milestoneId The milestone ID, defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $issueTitle, + ?array $assignees = null, + ?string $issueBody = null, + ?bool $closed = null, + ?string $dueDate = null, + ?array $labelIds = null, + ?int $milestoneId = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues"; + + // Build the request data. + $data = new \stdClass(); + $data->title = $issueTitle; + $data->body = $issueBody; + $data->assignees = $assignees; + $data->closed = $closed; + $data->due_date = $dueDate; + $data->labels = $labelIds; + $data->milestone = $milestoneId; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Search for issues across the repositories that the user has access to. + * + * @param string $q Search query. + * @param int $page Page number (default 1). + * @param int $limit Page size (default 10, max 50). + * @param string|null $state Issue state (default open). + * @param string|null $labels Label filter, comma-separated. + * @param string|null $milestones Milestone filter, comma-separated. + * @param int|null $priorityRepoId Repository to prioritize in the results. + * @param string|null $type Filter by type (issues/pulls). + * @param string|null $since Only show notifications updated after the given time (RFC 3339 format). + * @param string|null $before Only show notifications updated before the given time (RFC 3339 format). + * @param bool|null $assigned Filter assigned to you (default false). + * @param bool|null $created Filter created by you (default false). + * @param bool|null $mentioned Filter mentioning you (default false). + * @param bool|null $reviewRequested Filter pulls requesting your review (default false). + * @param string|null $owner Filter by owner. + * @param string|null $team Filter by team (requires organization owner parameter). + * + * @return array|null + * @since 3.2.0 + **/ + public function search( + string $q, + int $page = 1, + int $limit = 10, + ?string $state = 'open', + ?string $labels = null, + ?string $milestones = null, + ?int $priorityRepoId = null, + ?string $type = null, + ?string $since = null, + ?string $before = null, + ?bool $assigned = null, + ?bool $created = null, + ?bool $mentioned = null, + ?bool $reviewRequested = null, + ?string $owner = null, + ?string $team = null + ): ?array + { + // Build the request path. + $path = "/repos/issues/search"; + + // Set the URL parameters. + $uri = $this->uri->get($path); + $uri->setVar('q', $q); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + $uri->setVar('state', $state); + + if ($labels !== null) + { + $uri->setVar('labels', $labels); + } + + if ($milestones !== null) + { + $uri->setVar('milestones', $milestones); + } + + if ($priorityRepoId !== null) + { + $uri->setVar('priority_repo_id', $priorityRepoId); + } + + if ($type !== null) + { + $uri->setVar('type', $type); + } + + if ($since !== null) + { + $uri->setVar('since', $since); + } + + if ($before !== null) + { + $uri->setVar('before', $before); + } + + if ($assigned !== null) + { + $uri->setVar('assigned', $assigned); + } + + if ($created !== null) + { + $uri->setVar('created', $created); + } + + if ($mentioned !== null) + { + $uri->setVar('mentioned', $mentioned); + } + + if ($reviewRequested !== null) + { + $uri->setVar('review_requested', $reviewRequested); + } + + if ($owner !== null) + { + $uri->setVar('owner', $owner); + } + + if ($team !== null) + { + $uri->setVar('team', $team); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Edit an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string|null $assignee The assignee, defaults to null. + * @param array|null $assignees The assignees, defaults to null. + * @param string|null $body The issue body, defaults to null. + * @param string|null $dueDate The due date, defaults to null. + * @param int|null $milestone The milestone, defaults to null. + * @param string|null $ref The reference, defaults to null. + * @param string|null $state The issue state, defaults to null. + * @param string|null $title The issue title, defaults to null. + * @param bool|null $unsetDueDate The flag to unset due date, defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + int $index, + ?string $assignee = null, + ?array $assignees = null, + ?string $body = null, + ?string $dueDate = null, + ?int $milestone = null, + ?string $ref = null, + ?string $state = null, + ?string $title = null, + ?bool $unsetDueDate = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}"; + + // Prepare the issue data. + $editIssueData = new \stdClass(); + + if ($assignee !== null || $assignees !== null) + { + $editIssueData->assignee = new \stdClass(); + + if ($assignee !== null) + { + $editIssueData->assignee->name = $assignee; + } + + if ($assignees !== null) + { + $editIssueData->assignee->names = $assignees; + } + } + + if ($body !== null) + { + $editIssueData->body = $body; + } + + if ($dueDate !== null || $unsetDueDate !== null) + { + $editIssueData->dueDate = new \stdClass(); + + if ($dueDate !== null) + { + $editIssueData->dueDate->date = $dueDate; + } + + if ($unsetDueDate !== null) + { + $editIssueData->dueDate->unset = $unsetDueDate; + } + } + + if ($milestone !== null) + { + $editIssueData->milestone = $milestone; + } + + if ($ref !== null) + { + $editIssueData->ref = $ref; + } + + if ($state !== null) + { + $editIssueData->state = $state; + } + + if ($title !== null) + { + $editIssueData->title = $title; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($editIssueData) + ) + ); + } + + /** + * Delete an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.power b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.power new file mode 100644 index 0000000..d462d9a --- /dev/null +++ b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/code.power @@ -0,0 +1,379 @@ + /** + * List a repository's issues. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $state The state of the issues to get, defaults to 'open'. + * @param int $page The page to get, defaults to null. + * @param int $limit The number of issues per page, defaults to null. + * @param string|null $labels Comma-separated list of labels, defaults to null. + * @param string|null $q The search string, defaults to null. + * @param string|null $type The type to filter by (issues/pulls), defaults to null. + * @param string|null $milestones Comma-separated list of milestone names or IDs, defaults to null. + * @param string|null $since Only show items updated after the given time, defaults to null. + * @param string|null $before Only show items updated before the given time, defaults to null. + * @param string|null $createdBy Only show items created by the given user, defaults to null. + * @param string|null $assignedBy Only show items assigned to the given user, defaults to null. + * @param string|null $mentionedBy Only show items where the given user is mentioned, defaults to null. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + string $state = 'open', + int $page = 1, + int $limit = 10, + ?string $labels = null, + ?string $q = null, + ?string $type = null, + ?string $milestones = null, + ?string $since = null, + ?string $before = null, + ?string $createdBy = null, + ?string $assignedBy = null, + ?string $mentionedBy = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Set the query parameters + $uri->setVar('state', $state); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + $uri->setVar('labels', $labels); + $uri->setVar('q', $q); + $uri->setVar('type', $type); + $uri->setVar('milestones', $milestones); + $uri->setVar('since', $since); + $uri->setVar('before', $before); + $uri->setVar('created_by', $createdBy); + $uri->setVar('assigned_by', $assignedBy); + $uri->setVar('mentioned_by', $mentionedBy); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $index): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $issueTitle The issue title. + * @param array|null $assignees The array of assignees, defaults to null. + * @param string|null $issueBody The issue body, defaults to null. + * @param bool|null $closed If the issue is closed, defaults to null. + * @param string|null $dueDate The deadline for the issue, format: "YYYY-MM-DD", defaults to null. + * @param array|null $labelIds The array of label IDs to attach to the issue, defaults to null. + * @param int|null $milestoneId The milestone ID, defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $issueTitle, + ?array $assignees = null, + ?string $issueBody = null, + ?bool $closed = null, + ?string $dueDate = null, + ?array $labelIds = null, + ?int $milestoneId = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues"; + + // Build the request data. + $data = new \stdClass(); + $data->title = $issueTitle; + $data->body = $issueBody; + $data->assignees = $assignees; + $data->closed = $closed; + $data->due_date = $dueDate; + $data->labels = $labelIds; + $data->milestone = $milestoneId; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Search for issues across the repositories that the user has access to. + * + * @param string $q Search query. + * @param int $page Page number (default 1). + * @param int $limit Page size (default 10, max 50). + * @param string|null $state Issue state (default open). + * @param string|null $labels Label filter, comma-separated. + * @param string|null $milestones Milestone filter, comma-separated. + * @param int|null $priorityRepoId Repository to prioritize in the results. + * @param string|null $type Filter by type (issues/pulls). + * @param string|null $since Only show notifications updated after the given time (RFC 3339 format). + * @param string|null $before Only show notifications updated before the given time (RFC 3339 format). + * @param bool|null $assigned Filter assigned to you (default false). + * @param bool|null $created Filter created by you (default false). + * @param bool|null $mentioned Filter mentioning you (default false). + * @param bool|null $reviewRequested Filter pulls requesting your review (default false). + * @param string|null $owner Filter by owner. + * @param string|null $team Filter by team (requires organization owner parameter). + * + * @return array|null + * @since 3.2.0 + **/ + public function search( + string $q, + int $page = 1, + int $limit = 10, + ?string $state = 'open', + ?string $labels = null, + ?string $milestones = null, + ?int $priorityRepoId = null, + ?string $type = null, + ?string $since = null, + ?string $before = null, + ?bool $assigned = null, + ?bool $created = null, + ?bool $mentioned = null, + ?bool $reviewRequested = null, + ?string $owner = null, + ?string $team = null + ): ?array + { + // Build the request path. + $path = "/repos/issues/search"; + + // Set the URL parameters. + $uri = $this->uri->get($path); + $uri->setVar('q', $q); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + $uri->setVar('state', $state); + + if ($labels !== null) + { + $uri->setVar('labels', $labels); + } + + if ($milestones !== null) + { + $uri->setVar('milestones', $milestones); + } + + if ($priorityRepoId !== null) + { + $uri->setVar('priority_repo_id', $priorityRepoId); + } + + if ($type !== null) + { + $uri->setVar('type', $type); + } + + if ($since !== null) + { + $uri->setVar('since', $since); + } + + if ($before !== null) + { + $uri->setVar('before', $before); + } + + if ($assigned !== null) + { + $uri->setVar('assigned', $assigned); + } + + if ($created !== null) + { + $uri->setVar('created', $created); + } + + if ($mentioned !== null) + { + $uri->setVar('mentioned', $mentioned); + } + + if ($reviewRequested !== null) + { + $uri->setVar('review_requested', $reviewRequested); + } + + if ($owner !== null) + { + $uri->setVar('owner', $owner); + } + + if ($team !== null) + { + $uri->setVar('team', $team); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Edit an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string|null $assignee The assignee, defaults to null. + * @param array|null $assignees The assignees, defaults to null. + * @param string|null $body The issue body, defaults to null. + * @param string|null $dueDate The due date, defaults to null. + * @param int|null $milestone The milestone, defaults to null. + * @param string|null $ref The reference, defaults to null. + * @param string|null $state The issue state, defaults to null. + * @param string|null $title The issue title, defaults to null. + * @param bool|null $unsetDueDate The flag to unset due date, defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + int $index, + ?string $assignee = null, + ?array $assignees = null, + ?string $body = null, + ?string $dueDate = null, + ?int $milestone = null, + ?string $ref = null, + ?string $state = null, + ?string $title = null, + ?bool $unsetDueDate = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}"; + + // Prepare the issue data. + $editIssueData = new \stdClass(); + + if ($assignee !== null || $assignees !== null) + { + $editIssueData->assignee = new \stdClass(); + + if ($assignee !== null) + { + $editIssueData->assignee->name = $assignee; + } + + if ($assignees !== null) + { + $editIssueData->assignee->names = $assignees; + } + } + + if ($body !== null) + { + $editIssueData->body = $body; + } + + if ($dueDate !== null || $unsetDueDate !== null) + { + $editIssueData->dueDate = new \stdClass(); + + if ($dueDate !== null) + { + $editIssueData->dueDate->date = $dueDate; + } + + if ($unsetDueDate !== null) + { + $editIssueData->dueDate->unset = $unsetDueDate; + } + } + + if ($milestone !== null) + { + $editIssueData->milestone = $milestone; + } + + if ($ref !== null) + { + $editIssueData->ref = $ref; + } + + if ($state !== null) + { + $editIssueData->state = $state; + } + + if ($title !== null) + { + $editIssueData->title = $title; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($editIssueData) + ) + ); + } + + /** + * Delete an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/5c8f9038-d6e9-4788-96df-45019eafbadb/settings.json b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/settings.json new file mode 100644 index 0000000..a0300de --- /dev/null +++ b/src/5c8f9038-d6e9-4788-96df-45019eafbadb/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "5c8f9038-d6e9-4788-96df-45019eafbadb", + "implements": null, + "load_selection": null, + "name": "Issue", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "description": "The Gitea Issue\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/README.md b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/README.md new file mode 100644 index 0000000..16accad --- /dev/null +++ b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Api (Details) +> namespace: **VDM\Joomla\Gitea\Settings** +```uml +@startuml +class Api #Gold { + + get() : ?object +} + +note right of Api::get + Get instance's global settings for API. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.php b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.php new file mode 100644 index 0000000..cf2d56f --- /dev/null +++ b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Settings; + + +use VDM\Joomla\Gitea\Abstraction\Api as BaseAPI; + + +/** + * The Gitea Settings Api + * + * @since 3.2.0 + */ +class Api extends BaseAPI +{ + /** + * Get instance's global settings for API. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/api"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.power b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.power new file mode 100644 index 0000000..65f6ccd --- /dev/null +++ b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/code.power @@ -0,0 +1,18 @@ + /** + * Get instance's global settings for API. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/api"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/settings.json b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/settings.json new file mode 100644 index 0000000..d03e319 --- /dev/null +++ b/src/5ca71a00-7b44-4c0d-9955-3af054eed43d/settings.json @@ -0,0 +1,24 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "-1", + "guid": "5ca71a00-7b44-4c0d-9955-3af054eed43d", + "implements": null, + "load_selection": null, + "name": "Api", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Settings.Api", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "as": "BaseAPI" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Settings.Api", + "description": "The Gitea Settings Api\r\n\r\n@since 3.2.0", + "extends_custom": "BaseAPI", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/README.md b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/README.md new file mode 100644 index 0000000..ed33bd6 --- /dev/null +++ b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Organizations (Details) +> namespace: **VDM\Joomla\Gitea\Admin** +```uml +@startuml +class Organizations #Gold { + + list(int $page = 1, int $limit = 10) : ?array +} + +note right of Organizations::list + List all organizations. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.php b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.php new file mode 100644 index 0000000..df1e6b4 --- /dev/null +++ b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.php @@ -0,0 +1,51 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Organizations + * + * @since 3.2.0 + */ +class Organizations extends Api +{ + /** + * List all organizations. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/admin/orgs"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.power b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.power new file mode 100644 index 0000000..ec70740 --- /dev/null +++ b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/code.power @@ -0,0 +1,24 @@ + /** + * List all organizations. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/admin/orgs"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/settings.json b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/settings.json new file mode 100644 index 0000000..6944b1c --- /dev/null +++ b/src/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0", + "implements": null, + "load_selection": null, + "name": "Organizations", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Organizations", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Organizations", + "description": "The Gitea Admin Organizations\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/5f01760a-de24-49f7-b08e-d340c847f86a/README.md b/src/5f01760a-de24-49f7-b08e-d340c847f86a/README.md new file mode 100644 index 0000000..c7a18ac --- /dev/null +++ b/src/5f01760a-de24-49f7-b08e-d340c847f86a/README.md @@ -0,0 +1,63 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Statuses (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Statuses #Gold { + + get(string $ownerName, string $repoName, ...) : ?array + + create(string $ownerName, string $repoName, ...) : ?object +} + +note right of Statuses::get + Get a commit's statuses. + + since: 3.2.0 + return: ?array + + arguments: + string $ownerName + string $repoName + string $commitSha + string $sort = 'recentupdate' + string $state = 'pending' + int $page = 1 + int $limit = 10 +end note + +note right of Statuses::create + Create a commit status. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + string $commitSha + string $state + ?string $context = null + ?string $statusDescription = null + ?string $targetUrl = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5f01760a-de24-49f7-b08e-d340c847f86a/code.php b/src/5f01760a-de24-49f7-b08e-d340c847f86a/code.php new file mode 100644 index 0000000..ba6e3c1 --- /dev/null +++ b/src/5f01760a-de24-49f7-b08e-d340c847f86a/code.php @@ -0,0 +1,122 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Statuses + * + * @since 3.2.0 + */ +class Statuses extends Api +{ + /** + * Get a commit's statuses. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $commitSha The commit SHA. + * @param string $sort The type of sort. + * @param string $state The type of state. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $ownerName, + string $repoName, + string $commitSha, + string $sort = 'recentupdate', + string $state = 'pending', + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/statuses/{$commitSha}"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Set the query parameters. + $uri->setVar('sort', $sort); + $uri->setVar('state', $state); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a commit status. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $commitSha The commit SHA. + * @param string $state The commit status state (error, failure, pending, success, or warning). + * @param string|null $context The context of the status (optional). + * @param string|null $statusDescription The status description (optional). + * @param string|null $targetUrl The URL of the associated build status (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $ownerName, + string $repoName, + string $commitSha, + string $state, + ?string $context = null, + ?string $statusDescription = null, + ?string $targetUrl = null + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/statuses/{$commitSha}"; + + // Set the commit status data + $data = new \stdClass(); + $data->state = $state; + + if ($context !== null) + { + $data->context = $context; + } + + if ($statusDescription !== null) + { + $data->description = $statusDescription; + } + + if ($targetUrl !== null) + { + $data->target_url = $targetUrl; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/5f01760a-de24-49f7-b08e-d340c847f86a/code.power b/src/5f01760a-de24-49f7-b08e-d340c847f86a/code.power new file mode 100644 index 0000000..091c6ae --- /dev/null +++ b/src/5f01760a-de24-49f7-b08e-d340c847f86a/code.power @@ -0,0 +1,95 @@ + /** + * Get a commit's statuses. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $commitSha The commit SHA. + * @param string $sort The type of sort. + * @param string $state The type of state. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $ownerName, + string $repoName, + string $commitSha, + string $sort = 'recentupdate', + string $state = 'pending', + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/statuses/{$commitSha}"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Set the query parameters. + $uri->setVar('sort', $sort); + $uri->setVar('state', $state); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a commit status. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $commitSha The commit SHA. + * @param string $state The commit status state (error, failure, pending, success, or warning). + * @param string|null $context The context of the status (optional). + * @param string|null $statusDescription The status description (optional). + * @param string|null $targetUrl The URL of the associated build status (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $ownerName, + string $repoName, + string $commitSha, + string $state, + ?string $context = null, + ?string $statusDescription = null, + ?string $targetUrl = null + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/statuses/{$commitSha}"; + + // Set the commit status data + $data = new \stdClass(); + $data->state = $state; + + if ($context !== null) + { + $data->context = $context; + } + + if ($statusDescription !== null) + { + $data->description = $statusDescription; + } + + if ($targetUrl !== null) + { + $data->target_url = $targetUrl; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } diff --git a/src/5f01760a-de24-49f7-b08e-d340c847f86a/settings.json b/src/5f01760a-de24-49f7-b08e-d340c847f86a/settings.json new file mode 100644 index 0000000..145f192 --- /dev/null +++ b/src/5f01760a-de24-49f7-b08e-d340c847f86a/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "5f01760a-de24-49f7-b08e-d340c847f86a", + "implements": null, + "load_selection": null, + "name": "Statuses", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Statuses", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Statuses", + "description": "The Gitea Repository Statuses\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/605d7058-345b-411e-b55d-027edc1ded83/README.md b/src/605d7058-345b-411e-b55d-027edc1ded83/README.md new file mode 100644 index 0000000..acffaff --- /dev/null +++ b/src/605d7058-345b-411e-b55d-027edc1ded83/README.md @@ -0,0 +1,90 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Hooks (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class Hooks #Gold { + + list(string $orgName, int $page = 1, ...) : ?array + + create(string $org, string $type, ...) : ?object + + get(string $org, int $id) : ?object + + delete(string $org, int $id) : string + + update(string $orgName, int $hookId, ...) : ?object +} + +note right of Hooks::list + List an organization's webhooks. + + since: 3.2.0 + return: ?array + + arguments: + string $orgName + int $page = 1 + int $limit = 10 +end note + +note right of Hooks::create + Create a hook for an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $org + string $type + string $url + string $secret = '' + bool $events = true + bool $active = true +end note + +note right of Hooks::get + Get a hook for an organization. + + since: 3.2.0 + return: ?object +end note + +note right of Hooks::delete + Delete a hook for an organization. + + since: 3.2.0 + return: string +end note + +note right of Hooks::update + Update a hook for an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $orgName + int $hookId + ?bool $active = null + ?string $branchFilter = null + ?array $config = null + ?array $events = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/605d7058-345b-411e-b55d-027edc1ded83/code.php b/src/605d7058-345b-411e-b55d-027edc1ded83/code.php new file mode 100644 index 0000000..981c065 --- /dev/null +++ b/src/605d7058-345b-411e-b55d-027edc1ded83/code.php @@ -0,0 +1,200 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Organization Hooks + * + * @since 3.2.0 + */ +class Hooks extends Api +{ + /** + * List an organization's webhooks. + * + * @param string $orgName The organization name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $orgName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/hooks"; + + // Get the URI and set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a hook for an organization. + * + * @param string $org The organization name. + * @param string $type The type of hook (e.g. "gitea", "slack", "discord", etc.). + * @param string $url The URL of the hook. + * @param string $secret Optional. The secret for the hook. + * @param bool $events Optional. The events that trigger the hook. + * @param bool $active Optional. Whether the hook is active. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $org, + string $type, + string $url, + string $secret = '', + bool $events = true, + bool $active = true + ): ?object + { + // Set the lines data + $data = new \stdClass(); + $data->type = $type; + $data->config = new \stdClass(); + $data->config->url = $url; + $data->config->secret = $secret; + $data->events = []; + $data->active = $active; + + // Build the request path. + $path = "/orgs/{$org}/hooks"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a hook for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the hook. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $org, int $id): ?object + { + // Build the request path. + $path = "/orgs/{$org}/hooks/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a hook for an organization. + * + * @param string $org The organization name. + * @param int $id The hook ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $org, int $id): string + { + // Build the request path. + $path = "/orgs/{$org}/hooks/{$id}"; + + // Send the DELETE request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a hook for an organization. + * + * @param string $orgName The organization name. + * @param int $hookId The ID of the hook. + * @param bool|null $active Optional. Whether the hook is active. + * @param string|null $branchFilter Optional. Branch filter for the hook. + * @param array|null $config Optional. Configuration for the hook. + * @param array|null $events Optional. Events for the hook. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $orgName, + int $hookId, + ?bool $active = null, + ?string $branchFilter = null, + ?array $config = null, + ?array $events = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + if ($active !== null) + { + $data->active = $active; + } + + if ($branchFilter !== null) + { + $data->branch_filter = $branchFilter; + } + + if ($config !== null) + { + $data->config = (object) $config; + } + + if ($events !== null) + { + $data->events = $events; + } + + // Build the request path. + $path = "/orgs/{$orgName}/hooks/{$hookId}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + +} + diff --git a/src/605d7058-345b-411e-b55d-027edc1ded83/code.power b/src/605d7058-345b-411e-b55d-027edc1ded83/code.power new file mode 100644 index 0000000..6b2797e --- /dev/null +++ b/src/605d7058-345b-411e-b55d-027edc1ded83/code.power @@ -0,0 +1,173 @@ + /** + * List an organization's webhooks. + * + * @param string $orgName The organization name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $orgName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/hooks"; + + // Get the URI and set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a hook for an organization. + * + * @param string $org The organization name. + * @param string $type The type of hook (e.g. "gitea", "slack", "discord", etc.). + * @param string $url The URL of the hook. + * @param string $secret Optional. The secret for the hook. + * @param bool $events Optional. The events that trigger the hook. + * @param bool $active Optional. Whether the hook is active. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $org, + string $type, + string $url, + string $secret = '', + bool $events = true, + bool $active = true + ): ?object + { + // Set the lines data + $data = new \stdClass(); + $data->type = $type; + $data->config = new \stdClass(); + $data->config->url = $url; + $data->config->secret = $secret; + $data->events = []; + $data->active = $active; + + // Build the request path. + $path = "/orgs/{$org}/hooks"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a hook for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the hook. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $org, int $id): ?object + { + // Build the request path. + $path = "/orgs/{$org}/hooks/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a hook for an organization. + * + * @param string $org The organization name. + * @param int $id The hook ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $org, int $id): string + { + // Build the request path. + $path = "/orgs/{$org}/hooks/{$id}"; + + // Send the DELETE request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a hook for an organization. + * + * @param string $orgName The organization name. + * @param int $hookId The ID of the hook. + * @param bool|null $active Optional. Whether the hook is active. + * @param string|null $branchFilter Optional. Branch filter for the hook. + * @param array|null $config Optional. Configuration for the hook. + * @param array|null $events Optional. Events for the hook. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $orgName, + int $hookId, + ?bool $active = null, + ?string $branchFilter = null, + ?array $config = null, + ?array $events = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + if ($active !== null) + { + $data->active = $active; + } + + if ($branchFilter !== null) + { + $data->branch_filter = $branchFilter; + } + + if ($config !== null) + { + $data->config = (object) $config; + } + + if ($events !== null) + { + $data->events = $events; + } + + // Build the request path. + $path = "/orgs/{$orgName}/hooks/{$hookId}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } diff --git a/src/605d7058-345b-411e-b55d-027edc1ded83/settings.json b/src/605d7058-345b-411e-b55d-027edc1ded83/settings.json new file mode 100644 index 0000000..a41e8ce --- /dev/null +++ b/src/605d7058-345b-411e-b55d-027edc1ded83/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "605d7058-345b-411e-b55d-027edc1ded83", + "implements": null, + "load_selection": null, + "name": "Hooks", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Hooks", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Hooks", + "description": "The Gitea Repository Organization Hooks\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/README.md b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/README.md new file mode 100644 index 0000000..2652710 --- /dev/null +++ b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/README.md @@ -0,0 +1,43 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Deadline (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Deadline #Gold { + + set(string $owner, string $repo, ...) : object +} + +note right of Deadline::set + Set an issue deadline. + + since: 3.2.0 + return: object + + arguments: + string $owner + string $repo + int $index + ?string $dueDate +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.php b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.php new file mode 100644 index 0000000..6c13d07 --- /dev/null +++ b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.php @@ -0,0 +1,54 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Deadline + * + * @since 3.2.0 + */ +class Deadline extends Api +{ + /** + * Set an issue deadline. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string|null $dueDate The deadline date string in the format YYYY-MM-DD or null to delete the deadline. + * + * @return object + * @since 3.2.0 + **/ + public function set(string $owner, string $repo, int $index, ?string $dueDate): object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/deadline"; + + // Build the request data. + $data = new \stdClass(); + $data->due_date = $dueDate; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.power b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.power new file mode 100644 index 0000000..483d84d --- /dev/null +++ b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/code.power @@ -0,0 +1,27 @@ + /** + * Set an issue deadline. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string|null $dueDate The deadline date string in the format YYYY-MM-DD or null to delete the deadline. + * + * @return object + * @since 3.2.0 + **/ + public function set(string $owner, string $repo, int $index, ?string $dueDate): object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/deadline"; + + // Build the request data. + $data = new \stdClass(); + $data->due_date = $dueDate; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/settings.json b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/settings.json new file mode 100644 index 0000000..0081e94 --- /dev/null +++ b/src/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69", + "implements": null, + "load_selection": null, + "name": "Deadline", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Deadline", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Deadline", + "description": "The Gitea Issue Deadline\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/61e813c6-a872-4f55-8078-198241170e80/README.md b/src/61e813c6-a872-4f55-8078-198241170e80/README.md new file mode 100644 index 0000000..62f7070 --- /dev/null +++ b/src/61e813c6-a872-4f55-8078-198241170e80/README.md @@ -0,0 +1,88 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Uri (Details) +> namespace: **VDM\Joomla\Gitea\Utilities** +```uml +@startuml +class Uri << (F,LightGreen) >> #Green { + - string $endpoint + - string $version + - string $url + + __construct(string $url = 'https://git.vdm.dev', string $endpoint = 'api', ...) + + get(string $path) : JoomlaUri + + api() : string + + setUrl(string $url) : void + - setEndpoint(string $endpoint) : void + - setVersion(string $version) : void +} + +note right of Uri::__construct + Constructor +example: https://git.vdm.dev + + since: 3.2.0 + + arguments: + string $url = 'https://git.vdm.dev' + string $endpoint = 'api' + string $version = 'v1' +end note + +note right of Uri::get + Method to build and return a full request URL for the request. This method will +add appropriate pagination details if necessary and also prepend the API url +to have a complete URL for the request. + + since: 3.2.0 + return: JoomlaUri +end note + +note right of Uri::api + Get the full API URL + + since: 3.2.0 + return: string +end note + +note right of Uri::setUrl + Set the URL of the API +example: https://git.vdm.dev + + since: 3.2.0 + return: void +end note + +note right of Uri::setEndpoint + Set the endpoint of the API + + since: 3.2.0 + return: void +end note + +note right of Uri::setVersion + Set the version of the API + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/61e813c6-a872-4f55-8078-198241170e80/code.php b/src/61e813c6-a872-4f55-8078-198241170e80/code.php new file mode 100644 index 0000000..d31ac8e --- /dev/null +++ b/src/61e813c6-a872-4f55-8078-198241170e80/code.php @@ -0,0 +1,140 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Utilities; + + +use Joomla\Uri\Uri as JoomlaUri; + + +/** + * The Gitea Uri + * + * @since 3.2.0 + */ +final class Uri +{ + /** + * The api endpoint + * + * @var string + * @since 3.2.0 + */ + private string $endpoint; + + /** + * The api version + * + * @var string + * @since 3.2.0 + */ + private string $version; + + /** + * The api URL + * + * @var string + * @since 3.2.0 + */ + private string $url; + + /** + * Constructor + * + * @param string $url URL to the gitea system + * example: https://git.vdm.dev + * @param string $endpoint Endpoint to the gitea system + * @param string $version Version to the gitea system + * + * @since 3.2.0 + **/ + public function __construct( + string $url = 'https://git.vdm.dev', + string $endpoint = 'api', + string $version = 'v1') + { + // set the API details + $this->setUrl($url); + $this->setEndpoint($endpoint); + $this->setVersion($version); + } + + /** + * Method to build and return a full request URL for the request. This method will + * add appropriate pagination details if necessary and also prepend the API url + * to have a complete URL for the request. + * + * @param string $path URL to inflect + * + * @return JoomlaUri + * @since 3.2.0 + **/ + public function get(string $path): JoomlaUri + { + // Get a new Uri object focusing the api url and given path. + $uri = new JoomlaUri($this->api() . $path); + + return $uri; + } + + /** + * Get the full API URL + * + * @return string + * @since 3.2.0 + **/ + public function api(): string + { + return $this->url . '/' . $this->endpoint . '/' . $this->version; + } + + /** + * Set the URL of the API + * + * @param string $url URL to your gitea system + * example: https://git.vdm.dev + * + * @return void + * @since 3.2.0 + **/ + public function setUrl(string $url) + { + return $this->url = $url; + } + + /** + * Set the endpoint of the API + * + * @param string $endpoint endpoint to your gitea API + * + * @return void + * @since 3.2.0 + **/ + private function setEndpoint(string $endpoint) + { + return $this->endpoint = $endpoint; + } + + /** + * Set the version of the API + * + * @param string $version version to your gitea API + * + * @return void + * @since 3.2.0 + **/ + private function setVersion($version) + { + return $this->version = $version; + } + +} + diff --git a/src/61e813c6-a872-4f55-8078-198241170e80/code.power b/src/61e813c6-a872-4f55-8078-198241170e80/code.power new file mode 100644 index 0000000..c1a708b --- /dev/null +++ b/src/61e813c6-a872-4f55-8078-198241170e80/code.power @@ -0,0 +1,113 @@ + /** + * The api endpoint + * + * @var string + * @since 3.2.0 + */ + private string $endpoint; + + /** + * The api version + * + * @var string + * @since 3.2.0 + */ + private string $version; + + /** + * The api URL + * + * @var string + * @since 3.2.0 + */ + private string $url; + + /** + * Constructor + * + * @param string $url URL to the gitea system + * example: https://git.vdm.dev + * @param string $endpoint Endpoint to the gitea system + * @param string $version Version to the gitea system + * + * @since 3.2.0 + **/ + public function __construct( + string $url = 'https://git.vdm.dev', + string $endpoint = 'api', + string $version = 'v1') + { + // set the API details + $this->setUrl($url); + $this->setEndpoint($endpoint); + $this->setVersion($version); + } + + /** + * Method to build and return a full request URL for the request. This method will + * add appropriate pagination details if necessary and also prepend the API url + * to have a complete URL for the request. + * + * @param string $path URL to inflect + * + * @return JoomlaUri + * @since 3.2.0 + **/ + public function get(string $path): JoomlaUri + { + // Get a new Uri object focusing the api url and given path. + $uri = new JoomlaUri($this->api() . $path); + + return $uri; + } + + /** + * Get the full API URL + * + * @return string + * @since 3.2.0 + **/ + public function api(): string + { + return $this->url . '/' . $this->endpoint . '/' . $this->version; + } + + /** + * Set the URL of the API + * + * @param string $url URL to your gitea system + * example: https://git.vdm.dev + * + * @return void + * @since 3.2.0 + **/ + public function setUrl(string $url) + { + return $this->url = $url; + } + + /** + * Set the endpoint of the API + * + * @param string $endpoint endpoint to your gitea API + * + * @return void + * @since 3.2.0 + **/ + private function setEndpoint(string $endpoint) + { + return $this->endpoint = $endpoint; + } + + /** + * Set the version of the API + * + * @param string $version version to your gitea API + * + * @return void + * @since 3.2.0 + **/ + private function setVersion($version) + { + return $this->version = $version; + } diff --git a/src/61e813c6-a872-4f55-8078-198241170e80/settings.json b/src/61e813c6-a872-4f55-8078-198241170e80/settings.json new file mode 100644 index 0000000..ef81211 --- /dev/null +++ b/src/61e813c6-a872-4f55-8078-198241170e80/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "61e813c6-a872-4f55-8078-198241170e80", + "implements": null, + "load_selection": null, + "name": "Uri", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Utilities.Uri", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Utilities.Uri", + "description": "The Gitea Uri\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\Uri\\Uri as JoomlaUri;", + "composer": "" +} \ No newline at end of file diff --git a/src/63fbd482-688a-4356-b3e4-a676ef357100/README.md b/src/63fbd482-688a-4356-b3e4-a676ef357100/README.md new file mode 100644 index 0000000..00b82ae --- /dev/null +++ b/src/63fbd482-688a-4356-b3e4-a676ef357100/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Comments (Details) +> namespace: **VDM\Joomla\Gitea\Issue\Repository** +```uml +@startuml +class Comments #Gold { + + list(string $owner, string $repo, ...) : ?array +} + +note right of Comments::list + List all comments in a repository. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 + ?string $since = null + ?string $before = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/63fbd482-688a-4356-b3e4-a676ef357100/code.php b/src/63fbd482-688a-4356-b3e4-a676ef357100/code.php new file mode 100644 index 0000000..3ca83fc --- /dev/null +++ b/src/63fbd482-688a-4356-b3e4-a676ef357100/code.php @@ -0,0 +1,67 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Repository Comments + * + * @since 3.2.0 + */ +class Comments extends Api +{ + /** + * List all comments in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $page The page to get, defaults to 1. + * @param int $limit The number of comments per page, defaults to 10. + * @param string|null $since The date-time string to filter updated comments since, defaults to null. + * @param string|null $before The date-time string to filter updated comments before, defaults to null. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $page = 1, int $limit = 10, ?string $since = null, ?string $before = null): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Set the URI variables. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + if ($since !== null) + { + $uri->setVar('since', $since); + } + + if ($before !== null) + { + $uri->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/63fbd482-688a-4356-b3e4-a676ef357100/code.power b/src/63fbd482-688a-4356-b3e4-a676ef357100/code.power new file mode 100644 index 0000000..86c6e06 --- /dev/null +++ b/src/63fbd482-688a-4356-b3e4-a676ef357100/code.power @@ -0,0 +1,40 @@ + /** + * List all comments in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $page The page to get, defaults to 1. + * @param int $limit The number of comments per page, defaults to 10. + * @param string|null $since The date-time string to filter updated comments since, defaults to null. + * @param string|null $before The date-time string to filter updated comments before, defaults to null. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $page = 1, int $limit = 10, ?string $since = null, ?string $before = null): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Set the URI variables. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + if ($since !== null) + { + $uri->setVar('since', $since); + } + + if ($before !== null) + { + $uri->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/63fbd482-688a-4356-b3e4-a676ef357100/settings.json b/src/63fbd482-688a-4356-b3e4-a676ef357100/settings.json new file mode 100644 index 0000000..0fee85c --- /dev/null +++ b/src/63fbd482-688a-4356-b3e4-a676ef357100/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "63fbd482-688a-4356-b3e4-a676ef357100", + "implements": null, + "load_selection": null, + "name": "Comments", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Repository.Comments", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Repository.Comments", + "description": "The Gitea Issue Repository Comments\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/README.md b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/README.md new file mode 100644 index 0000000..33e3513 --- /dev/null +++ b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/README.md @@ -0,0 +1,67 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Reviewers (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Reviewers #Gold { + + request(string $owner, string $repo, ...) : ?array + + cancel(string $owner, string $repo, ...) : string + + get(string $owner, string $repo) : ?array +} + +note right of Reviewers::request + Create review requests for a pull request. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + array $reviewers + ?array $teamReviewers = null +end note + +note right of Reviewers::cancel + Cancel review requests for a pull request. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + array $reviewers + ?array $teamReviewers = null +end note + +note right of Reviewers::get + Return all users that can be requested to review in this repo. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.php b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.php new file mode 100644 index 0000000..ee0a4a0 --- /dev/null +++ b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.php @@ -0,0 +1,126 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Reviewers + * + * @since 3.2.0 + */ +class Reviewers extends Api +{ + /** + * Create review requests for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param array $reviewers Array of reviewers usernames. + * @param array|null $teamReviewers Array of team reviewers (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function request( + string $owner, + string $repo, + int $index, + array $reviewers, + ?array $teamReviewers = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/requested_reviewers"; + + // Set the review requests data. + $data = new \stdClass(); + $data->reviewers = $reviewers; + + if ($teamReviewers !== null) + { + $data->team_reviewers = $teamReviewers; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Cancel review requests for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param array $reviewers Array of reviewers usernames. + * @param array|null $teamReviewers Array of team reviewers (optional). + * + * @return string + * @since 3.2.0 + **/ + public function cancel( + string $owner, + string $repo, + int $index, + array $reviewers, + ?array $teamReviewers = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/requested_reviewers"; + + // Get the URI and set the required variables. + $uri = $this->uri->get($path); + $uri->setVar('reviewers', json_encode($reviewers)); + + if ($teamReviewers !== null) + { + $uri->setVar('teamReviewers', json_encode($teamReviewers)); + } + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + + /** + * Return all users that can be requested to review in this repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/reviewers"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.power b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.power new file mode 100644 index 0000000..4bc910b --- /dev/null +++ b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/code.power @@ -0,0 +1,99 @@ + /** + * Create review requests for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param array $reviewers Array of reviewers usernames. + * @param array|null $teamReviewers Array of team reviewers (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function request( + string $owner, + string $repo, + int $index, + array $reviewers, + ?array $teamReviewers = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/requested_reviewers"; + + // Set the review requests data. + $data = new \stdClass(); + $data->reviewers = $reviewers; + + if ($teamReviewers !== null) + { + $data->team_reviewers = $teamReviewers; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Cancel review requests for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param array $reviewers Array of reviewers usernames. + * @param array|null $teamReviewers Array of team reviewers (optional). + * + * @return string + * @since 3.2.0 + **/ + public function cancel( + string $owner, + string $repo, + int $index, + array $reviewers, + ?array $teamReviewers = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/requested_reviewers"; + + // Get the URI and set the required variables. + $uri = $this->uri->get($path); + $uri->setVar('reviewers', json_encode($reviewers)); + + if ($teamReviewers !== null) + { + $uri->setVar('teamReviewers', json_encode($teamReviewers)); + } + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + + /** + * Return all users that can be requested to review in this repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/reviewers"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/settings.json b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/settings.json new file mode 100644 index 0000000..422200c --- /dev/null +++ b/src/65288a04-bcac-4067-ae2b-6fda9f1e3fd5/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "65288a04-bcac-4067-ae2b-6fda9f1e3fd5", + "implements": null, + "load_selection": null, + "name": "Reviewers", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Reviewers", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Reviewers", + "description": "The Gitea Repository Reviewers\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/README.md b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/README.md new file mode 100644 index 0000000..0bf8c24 --- /dev/null +++ b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Assignees (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Assignees #Gold { + + get(string $owner, string $repo) : ?array +} + +note right of Assignees::get + Return all users that have write access and can be assigned to issues. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.php b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.php new file mode 100644 index 0000000..f6c8c75 --- /dev/null +++ b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.php @@ -0,0 +1,51 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Assignees + * + * @since 3.2.0 + */ +class Assignees extends Api +{ + /** + * Return all users that have write access and can be assigned to issues. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/assignees"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.power b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.power new file mode 100644 index 0000000..5af6e19 --- /dev/null +++ b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/code.power @@ -0,0 +1,24 @@ + /** + * Return all users that have write access and can be assigned to issues. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/assignees"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/settings.json b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/settings.json new file mode 100644 index 0000000..dd0a670 --- /dev/null +++ b/src/66f866a7-f3a0-40ac-ac94-168d60c4a643/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "66f866a7-f3a0-40ac-ac94-168d60c4a643", + "implements": null, + "load_selection": null, + "name": "Assignees", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Assignees", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Assignees", + "description": "The Gitea Repository Assignees\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/README.md b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/README.md new file mode 100644 index 0000000..71458f7 --- /dev/null +++ b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/README.md @@ -0,0 +1,101 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Attachments (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Attachments #Gold { + + list(string $ownerName, string $repoName, ...) : ?array + + create(string $ownerName, string $repoName, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string + + edit(string $owner, string $repo, ...) : ?object +} + +note right of Attachments::list + List release's attachments. + + since: 3.2.0 + return: ?array + + arguments: + string $ownerName + string $repoName + int $releaseId +end note + +note right of Attachments::create + Create a release attachment. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + int $releaseId + string $attachmentFile + string $attachmentName + string $contentType +end note + +note right of Attachments::get + Get a release attachment. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $id + int $attachmentId +end note + +note right of Attachments::delete + Delete a release attachment. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $id + int $attachmentId +end note + +note right of Attachments::edit + Edit a release attachment. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $id + int $attachmentId + ?string $name = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.php b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.php new file mode 100644 index 0000000..121da5d --- /dev/null +++ b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.php @@ -0,0 +1,196 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Attachments + * + * @since 3.2.0 + */ +class Attachments extends Api +{ + /** + * List release's attachments. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + int $releaseId + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}/assets"; + + // Retrieve the URI object with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a release attachment. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * @param string $attachmentFile The attachment file content. + * @param string $attachmentName The attachment file name. + * @param string $contentType The attachment content type. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $ownerName, + string $repoName, + int $releaseId, + string $attachmentFile, + string $attachmentName, + string $contentType + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}/assets"; + + // Retrieve the URI object with the path. + $uri = $this->uri->get($path); + + // Add the attachment name as a query parameter. + $uri->setVar('name', $attachmentName); + + // Set the request headers. + $headers = [ + "Content-Type: {$contentType}", + "Content-Disposition: attachment; filename={$attachmentName}" + ]; + + // Send the post request. + return $this->response->get( + $this->http->post( + $uri, $attachmentFile, $headers + ), 201 + ); + } + + /** + * Get a release attachment. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The release ID. + * @param int $attachmentId The attachment ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $id, + int $attachmentId + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/releases/{$id}/assets/{$attachmentId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a release attachment. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The release ID. + * @param int $attachmentId The attachment ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + int $id, + int $attachmentId + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/releases/{$id}/assets/{$attachmentId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a release attachment. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The release ID. + * @param int $attachmentId The attachment ID. + * @param string|null $name The new name of the attachment (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + int $id, + int $attachmentId, + ?string $name = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/releases/{$id}/assets/{$attachmentId}"; + + // Set the attachment data + $data = new \stdClass(); + + if ($name !== null) + { + $data->name = $name; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.power b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.power new file mode 100644 index 0000000..0b800b2 --- /dev/null +++ b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/code.power @@ -0,0 +1,169 @@ + /** + * List release's attachments. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + int $releaseId + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}/assets"; + + // Retrieve the URI object with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a release attachment. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * @param string $attachmentFile The attachment file content. + * @param string $attachmentName The attachment file name. + * @param string $contentType The attachment content type. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $ownerName, + string $repoName, + int $releaseId, + string $attachmentFile, + string $attachmentName, + string $contentType + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}/assets"; + + // Retrieve the URI object with the path. + $uri = $this->uri->get($path); + + // Add the attachment name as a query parameter. + $uri->setVar('name', $attachmentName); + + // Set the request headers. + $headers = [ + "Content-Type: {$contentType}", + "Content-Disposition: attachment; filename={$attachmentName}" + ]; + + // Send the post request. + return $this->response->get( + $this->http->post( + $uri, $attachmentFile, $headers + ), 201 + ); + } + + /** + * Get a release attachment. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The release ID. + * @param int $attachmentId The attachment ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $id, + int $attachmentId + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/releases/{$id}/assets/{$attachmentId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a release attachment. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The release ID. + * @param int $attachmentId The attachment ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + int $id, + int $attachmentId + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/releases/{$id}/assets/{$attachmentId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a release attachment. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $id The release ID. + * @param int $attachmentId The attachment ID. + * @param string|null $name The new name of the attachment (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + int $id, + int $attachmentId, + ?string $name = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/releases/{$id}/assets/{$attachmentId}"; + + // Set the attachment data + $data = new \stdClass(); + + if ($name !== null) + { + $data->name = $name; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/settings.json b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/settings.json new file mode 100644 index 0000000..d4f7bb2 --- /dev/null +++ b/src/68f930bc-d24f-4ade-bcec-576f82c3c13d/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "68f930bc-d24f-4ade-bcec-576f82c3c13d", + "implements": null, + "load_selection": null, + "name": "Attachments", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Attachments", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Attachments", + "description": "The Gitea Repository Attachments\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/README.md b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/README.md new file mode 100644 index 0000000..034b4d2 --- /dev/null +++ b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/README.md @@ -0,0 +1,149 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Reviews (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Reviews #Gold { + + list(string $owner, string $repo, ...) : ?array + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + submit(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string + + comments(string $owner, string $repo, ...) : ?array + + dismiss(string $owner, string $repo, ...) : ?object + + undismiss(string $owner, string $repo, ...) : ?object +} + +note right of Reviews::list + List all reviews for a pull request. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + int $page = 1 + int $limit = 10 +end note + +note left of Reviews::create + Create a review for a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + string $body + string $event + ?array $comments = null + ?string $commitId = null +end note + +note right of Reviews::get + Get a specific review for a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + int $id +end note + +note left of Reviews::submit + Submit a pending review to a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + int $id + string $body + string $event +end note + +note right of Reviews::delete + Delete a specific review from a pull request. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + int $id +end note + +note left of Reviews::comments + Get the comments of a specific review for a pull request. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + int $id +end note + +note right of Reviews::dismiss + Dismiss a review for a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + int $id + string $message + bool $priors = false +end note + +note left of Reviews::undismiss + Cancel the dismissal of a review for a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + int $id +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.php b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.php new file mode 100644 index 0000000..17e3ac3 --- /dev/null +++ b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.php @@ -0,0 +1,321 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Reviews + * + * @since 3.2.0 + */ +class Reviews extends Api +{ + /** + * List all reviews for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $index, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews"; + + // Get the URI. + $uri = $this->uri->get($path); + + // Set query parameters. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string $body The review body text. + * @param string $event The review event type (APPROVE, REQUEST_CHANGES, COMMENT). + * @param array|null $comments An array of CreatePullReviewComment objects. + * @param string|null $commitId The commit ID. + * + * @return object|null + * @since 3.2.0 + */ + public function create( + string $owner, + string $repo, + int $index, + string $body, + string $event, + ?array $comments = null, + ?string $commitId = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews"; + + // Set the review data. + $data = new \stdClass(); + $data->body = $body; + $data->event = $event; + + // Add comments if available. + if ($comments !== null) + { + $data->comments = $comments; + } + + // Add commitId if available. + if ($commitId !== null) + { + $data->commit_id = $commitId; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Get a specific review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return object|null + * @since 3.2.0 + */ + public function get( + string $owner, + string $repo, + int $index, + int $id + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}"; + + // Set the variables for the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('index', $index); + $uri->setVar('id', $id); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Submit a pending review to a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * @param string $body The review body text. + * @param string $event The review event type (APPROVE, REQUEST_CHANGES, COMMENT). + * + * @return object|null + * @since 3.2.0 + */ + public function submit( + string $owner, + string $repo, + int $index, + int $id, + string $body, + string $event + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}"; + + // Set the review data. + $data = new \stdClass(); + $data->body = $body; + $data->event = $event; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Delete a specific review from a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return string + * @since 3.2.0 + */ + public function delete( + string $owner, + string $repo, + int $index, + int $id + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}"; + + // Set the variables for the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('index', $index); + $uri->setVar('id', $id); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + + /** + * Get the comments of a specific review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return array|null + * @since 3.2.0 + */ + public function comments( + string $owner, + string $repo, + int $index, + int $id + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}/comments"; + + // Set the variables for the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('index', $index); + $uri->setVar('id', $id); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Dismiss a review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * @param string $message The dismissal message. + * @param bool $priors The flag to dismiss prior reviews. + * + * @return object|null + * @since 3.2.0 + */ + public function dismiss( + string $owner, + string $repo, + int $index, + int $id, + string $message, + bool $priors = false + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}/dismissals"; + + // Set the dismissal data. + $data = new \stdClass(); + $data->message = $message; + $data->priors = $priors; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Cancel the dismissal of a review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return object|null + * @since 3.2.0 + */ + public function undismiss( + string $owner, + string $repo, + int $index, + int $id + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}/undismissals"; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.power b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.power new file mode 100644 index 0000000..2e32ff5 --- /dev/null +++ b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/code.power @@ -0,0 +1,294 @@ + /** + * List all reviews for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $index, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews"; + + // Get the URI. + $uri = $this->uri->get($path); + + // Set query parameters. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string $body The review body text. + * @param string $event The review event type (APPROVE, REQUEST_CHANGES, COMMENT). + * @param array|null $comments An array of CreatePullReviewComment objects. + * @param string|null $commitId The commit ID. + * + * @return object|null + * @since 3.2.0 + */ + public function create( + string $owner, + string $repo, + int $index, + string $body, + string $event, + ?array $comments = null, + ?string $commitId = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews"; + + // Set the review data. + $data = new \stdClass(); + $data->body = $body; + $data->event = $event; + + // Add comments if available. + if ($comments !== null) + { + $data->comments = $comments; + } + + // Add commitId if available. + if ($commitId !== null) + { + $data->commit_id = $commitId; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Get a specific review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return object|null + * @since 3.2.0 + */ + public function get( + string $owner, + string $repo, + int $index, + int $id + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}"; + + // Set the variables for the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('index', $index); + $uri->setVar('id', $id); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Submit a pending review to a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * @param string $body The review body text. + * @param string $event The review event type (APPROVE, REQUEST_CHANGES, COMMENT). + * + * @return object|null + * @since 3.2.0 + */ + public function submit( + string $owner, + string $repo, + int $index, + int $id, + string $body, + string $event + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}"; + + // Set the review data. + $data = new \stdClass(); + $data->body = $body; + $data->event = $event; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Delete a specific review from a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return string + * @since 3.2.0 + */ + public function delete( + string $owner, + string $repo, + int $index, + int $id + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}"; + + // Set the variables for the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('index', $index); + $uri->setVar('id', $id); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + + /** + * Get the comments of a specific review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return array|null + * @since 3.2.0 + */ + public function comments( + string $owner, + string $repo, + int $index, + int $id + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}/comments"; + + // Set the variables for the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('index', $index); + $uri->setVar('id', $id); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Dismiss a review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * @param string $message The dismissal message. + * @param bool $priors The flag to dismiss prior reviews. + * + * @return object|null + * @since 3.2.0 + */ + public function dismiss( + string $owner, + string $repo, + int $index, + int $id, + string $message, + bool $priors = false + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}/dismissals"; + + // Set the dismissal data. + $data = new \stdClass(); + $data->message = $message; + $data->priors = $priors; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Cancel the dismissal of a review for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $id The review ID. + * + * @return object|null + * @since 3.2.0 + */ + public function undismiss( + string $owner, + string $repo, + int $index, + int $id + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/reviews/{$id}/undismissals"; + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ) + ); + } diff --git a/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/settings.json b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/settings.json new file mode 100644 index 0000000..57bd9cc --- /dev/null +++ b/src/6a2fffb5-63ff-4a96-b458-632a5ff90814/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "6a2fffb5-63ff-4a96-b458-632a5ff90814", + "implements": null, + "load_selection": null, + "name": "Reviews", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Reviews", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Reviews", + "description": "The Gitea Repository Reviews\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/README.md b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/README.md new file mode 100644 index 0000000..d1bb910 --- /dev/null +++ b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Cron (Details) +> namespace: **VDM\Joomla\Gitea\Admin** +```uml +@startuml +class Cron #Gold { + + list(int $page = 1, int $limit = 10) : ?array + + run(string $task) : string +} + +note right of Cron::list + List cron tasks. + + since: 3.2.0 + return: ?array +end note + +note right of Cron::run + Run cron task. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.php b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.php new file mode 100644 index 0000000..04031c2 --- /dev/null +++ b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.php @@ -0,0 +1,72 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Cron + * + * @since 3.2.0 + */ +class Cron extends Api +{ + /** + * List cron tasks. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/admin/cron"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Run cron task. + * + * @param string $task The cron task to run. + * + * @return string + * @since 3.2.0 + **/ + public function run(string $task): string + { + // Build the request path. + $path = "/admin/cron/{$task}"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.power b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.power new file mode 100644 index 0000000..c7ca003 --- /dev/null +++ b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/code.power @@ -0,0 +1,45 @@ + /** + * List cron tasks. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/admin/cron"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Run cron task. + * + * @param string $task The cron task to run. + * + * @return string + * @since 3.2.0 + **/ + public function run(string $task): string + { + // Build the request path. + $path = "/admin/cron/{$task}"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/settings.json b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/settings.json new file mode 100644 index 0000000..da0348e --- /dev/null +++ b/src/6e1a6731-2587-4ad5-8e70-ca83eba65ee0/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "6e1a6731-2587-4ad5-8e70-ca83eba65ee0", + "implements": null, + "load_selection": null, + "name": "Cron", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Cron", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Cron", + "description": "The Gitea Admin Cron\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/README.md b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/README.md new file mode 100644 index 0000000..1e657bd --- /dev/null +++ b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Utilities (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Utilities #Gold { + + register(Container $container) : void + + getUri(Container $container) : Uri + + getResponse(Container $container) : Response +} + +note right of Utilities::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Utilities::getUri + Get the Uri class + + since: 3.2.0 + return: Uri +end note + +note right of Utilities::getResponse + Get the Response class + + since: 3.2.0 + return: Response +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.php b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.php new file mode 100644 index 0000000..09112d2 --- /dev/null +++ b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.php @@ -0,0 +1,72 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Utilities\Uri; +use VDM\Joomla\Gitea\Utilities\Response; + + +/** + * The Gitea Utilities Service + * + * @since 3.2.0 + */ +class Utilities implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'Gitea.Utilities.Uri') + ->share('Gitea.Utilities.Uri', [$this, 'getUri'], true); + + $container->alias(Response::class, 'Gitea.Utilities.Response') + ->share('Gitea.Utilities.Response', [$this, 'getResponse'], true); + } + + /** + * Get the Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + return new Uri(); + } + + /** + * Get the Response class + * + * @param Container $container The DI container. + * + * @return Response + * @since 3.2.0 + */ + public function getResponse(Container $container): Response + { + return new Response(); + } + +} + diff --git a/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.power b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.power new file mode 100644 index 0000000..56c423c --- /dev/null +++ b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/code.power @@ -0,0 +1,42 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'Gitea.Utilities.Uri') + ->share('Gitea.Utilities.Uri', [$this, 'getUri'], true); + + $container->alias(Response::class, 'Gitea.Utilities.Response') + ->share('Gitea.Utilities.Response', [$this, 'getResponse'], true); + } + + /** + * Get the Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + return new Uri(); + } + + /** + * Get the Response class + * + * @param Container $container The DI container. + * + * @return Response + * @since 3.2.0 + */ + public function getResponse(Container $container): Response + { + return new Response(); + } diff --git a/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/settings.json b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/settings.json new file mode 100644 index 0000000..e32a3df --- /dev/null +++ b/src/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c/settings.json @@ -0,0 +1,30 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Utilities", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Utilities", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "61e813c6-a872-4f55-8078-198241170e80", + "as": "default" + }, + "use_selection1": { + "use": "19eb68d7-1e19-4d14-a0ef-70d719c45e80", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Utilities", + "description": "The Gitea Utilities Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/README.md b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/README.md new file mode 100644 index 0000000..930ca33 --- /dev/null +++ b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Gitea (Details) +> namespace: **VDM\Joomla\Componentbuilder\Service** +```uml +@startuml +class Gitea #Gold { + + register(Container $container) : void + + getUri(Container $container) : Uri + + getHttp(Container $container) : Http +} + +note right of Gitea::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Gitea::getUri + Get the Dynamic Uri class + + since: 3.2.0 + return: Uri +end note + +note right of Gitea::getHttp + Get the Http class + + since: 3.2.0 + return: Http +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.php b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.php new file mode 100644 index 0000000..9287313 --- /dev/null +++ b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.php @@ -0,0 +1,84 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Utilities\Uri; +use VDM\Joomla\Gitea\Utilities\Http; + + +/** + * The Gitea Utilities Service + * + * @since 3.2.0 + */ +class Gitea implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'Gitea.Dynamic.Uri') + ->share('Gitea.Dynamic.Uri', [$this, 'getUri'], true); + + $container->alias(Http::class, 'Gitea.Utilities.Http') + ->share('Gitea.Utilities.Http', [$this, 'getHttp'], true); + } + + /** + * Get the Dynamic Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + // get the global gitea URL + $add_gitea_url = $container->get('Config')->get('add_custom_gitea_url', 1); + $gitea_url = $container->get('Config')->get('custom_gitea_url'); + + // only load this if we have a custom URL set + if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false) + { + return new Uri($gitea_url); + } + + return $container->get('Gitea.Utilities.Uri'); + } + + /** + * Get the Http class + * + * @param Container $container The DI container. + * + * @return Http + * @since 3.2.0 + */ + public function getHttp(Container $container): Http + { + return new Http( + $container->get('Config')->get('gitea_token') + ); + } + +} + diff --git a/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.power b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.power new file mode 100644 index 0000000..f56cd6c --- /dev/null +++ b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/code.power @@ -0,0 +1,54 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'Gitea.Dynamic.Uri') + ->share('Gitea.Dynamic.Uri', [$this, 'getUri'], true); + + $container->alias(Http::class, 'Gitea.Utilities.Http') + ->share('Gitea.Utilities.Http', [$this, 'getHttp'], true); + } + + /** + * Get the Dynamic Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + // get the global gitea URL + $add_gitea_url = $container->get('Config')->get('add_custom_gitea_url', 1); + $gitea_url = $container->get('Config')->get('custom_gitea_url'); + + // only load this if we have a custom URL set + if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false) + { + return new Uri($gitea_url); + } + + return $container->get('Gitea.Utilities.Uri'); + } + + /** + * Get the Http class + * + * @param Container $container The DI container. + * + * @return Http + * @since 3.2.0 + */ + public function getHttp(Container $container): Http + { + return new Http( + $container->get('Config')->get('gitea_token') + ); + } diff --git a/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/settings.json b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/settings.json new file mode 100644 index 0000000..4535379 --- /dev/null +++ b/src/71acf8d6-32b8-4173-8277-eb9cda29fd64/settings.json @@ -0,0 +1,30 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "71acf8d6-32b8-4173-8277-eb9cda29fd64", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Gitea", + "power_version": "1.0.0", + "system_name": "JCB.Service.Gitea", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "61e813c6-a872-4f55-8078-198241170e80", + "as": "default" + }, + "use_selection1": { + "use": "ce40b3d2-226c-4a64-b116-c19455822be1", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Service.Gitea", + "description": "The Gitea Utilities Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/README.md b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/README.md new file mode 100644 index 0000000..75c6329 --- /dev/null +++ b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/README.md @@ -0,0 +1,70 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Comment (Details) +> namespace: **VDM\Joomla\Gitea\Issue\Reactions** +```uml +@startuml +class Comment #Gold { + + list(string $owner, string $repo, ...) : ?array + + add(string $owner, string $repo, ...) : ?object + + remove(string $owner, string $repo, ...) : string +} + +note right of Comment::list + Get a list of reactions from a comment of an issue. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $commentId +end note + +note right of Comment::add + Add a reaction to a comment of an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $commentId + string $content +end note + +note right of Comment::remove + Remove a reaction from a comment of an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $commentId + string $content +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.php b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.php new file mode 100644 index 0000000..0f2ca78 --- /dev/null +++ b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.php @@ -0,0 +1,103 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue\Reactions; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Reactions Comment + * + * @since 3.2.0 + */ +class Comment extends Api +{ + /** + * Get a list of reactions from a comment of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $commentId): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}/reactions"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add a reaction to a comment of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * @param string $content The reaction to add, e.g. "+1". + * + * @return object|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $commentId, string $content): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}/reactions"; + + // Build the request data. + $data = new \stdClass(); + $data->content = $content; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Remove a reaction from a comment of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * @param string $content The reaction to remove, e.g. "+1". + * + * @return string + * @since 3.2.0 + **/ + public function remove(string $owner, string $repo, int $commentId, string $content): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}/reactions"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('content', $content); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 200, 'success' + ); + } + +} + diff --git a/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.power b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.power new file mode 100644 index 0000000..d079fd8 --- /dev/null +++ b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/code.power @@ -0,0 +1,76 @@ + /** + * Get a list of reactions from a comment of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $commentId): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}/reactions"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add a reaction to a comment of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * @param string $content The reaction to add, e.g. "+1". + * + * @return object|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $commentId, string $content): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}/reactions"; + + // Build the request data. + $data = new \stdClass(); + $data->content = $content; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Remove a reaction from a comment of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $commentId The comment ID. + * @param string $content The reaction to remove, e.g. "+1". + * + * @return string + * @since 3.2.0 + **/ + public function remove(string $owner, string $repo, int $commentId, string $content): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/comments/{$commentId}/reactions"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('content', $content); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 200, 'success' + ); + } diff --git a/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/settings.json b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/settings.json new file mode 100644 index 0000000..0c37ff2 --- /dev/null +++ b/src/73b3ebfa-c52a-4a96-a8de-718ff0bbc155/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "73b3ebfa-c52a-4a96-a8de-718ff0bbc155", + "implements": null, + "load_selection": null, + "name": "Comment", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Reactions.Comment", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Reactions.Comment", + "description": "The Gitea Issue Reactions Comment\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/README.md b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/README.md new file mode 100644 index 0000000..2d5a439 --- /dev/null +++ b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/README.md @@ -0,0 +1,134 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Releases (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Releases #Gold { + + list(string $ownerName, string $repoName, ...) : ?array + + create(string $ownerName, string $repoName, ...) : ?object + + get(string $ownerName, string $repoName, ...) : ?object + + delete(string $ownerName, string $repoName, ...) : string + + update(string $ownerName, string $repoName, ...) : ?object + + getByTag(string $ownerName, string $repoName, ...) : ?object + + deleteByTag(string $ownerName, string $repoName, ...) : string +} + +note right of Releases::list + List a repo's releases. + + since: 3.2.0 + return: ?array + + arguments: + string $ownerName + string $repoName + ?bool $draft = null + ?bool $preRelease = null + int $page = 1 + int $limit = 10 +end note + +note right of Releases::create + Create a release. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + string $tagName + string $targetCommitish + string $releaseName + string $releaseBody + bool $isDraft = false + bool $isPrerelease = false +end note + +note right of Releases::get + Get a release by ID. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + int $releaseId +end note + +note right of Releases::delete + Delete a release by ID. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + int $releaseId +end note + +note right of Releases::update + Update a release. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + int $releaseId + ?string $tagName = null + ?string $targetCommitish = null + ?string $releaseName = null + ?string $description = null + ?bool $isDraft = null + ?bool $isPrerelease = null +end note + +note right of Releases::getByTag + Get a release by tag name. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + string $tagName +end note + +note right of Releases::deleteByTag + Delete a release by tag name. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + string $tagName +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.php b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.php new file mode 100644 index 0000000..5723b56 --- /dev/null +++ b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.php @@ -0,0 +1,309 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Releases + * + * @since 3.2.0 + */ +class Releases extends Api +{ + /** + * List a repo's releases. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param bool|null $draft Filter (exclude/include) drafts (optional). + * @param bool|null $preRelease Filter (exclude/include) pre-releases (optional). + * @param int $page Page number of results to return (1-based, optional). + * @param int $limit Page size of results (optional). + * + * @return array|null + * @since 3.2.0 + */ + public function list( + string $ownerName, + string $repoName, + ?bool $draft = null, + ?bool $preRelease = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases"; + + // Set additional URI values. + $this->uri->setVar('page', $page); + $this->uri->setVar('limit', $limit); + + if ($draft !== null) + { + $this->uri->setVar('draft', $draft); + } + + if ($preRelease !== null) + { + $this->uri->setVar('pre-release', $preRelease); + } + + // Send the request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create a release. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $tagName The tag name. + * @param string $targetCommitish The commitish value that determines where the Git tag is created from. + * @param string $releaseName The name of the release. + * @param string $releaseBody The description of the release. + * @param bool $isDraft Whether the release is a draft. + * @param bool $isPrerelease Whether the release is a pre-release. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $ownerName, + string $repoName, + string $tagName, + string $targetCommitish, + string $releaseName, + string $releaseBody, + bool $isDraft = false, + bool $isPrerelease = false + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases"; + + // Set the release data + $data = new \stdClass(); + $data->tag_name = $tagName; + $data->target_commitish = $targetCommitish; + $data->name = $releaseName; + $data->body = $releaseBody; + $data->draft = $isDraft; + $data->prerelease = $isPrerelease; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a release by ID. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $ownerName, + string $repoName, + int $releaseId + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a release by ID. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + int $releaseId + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a release. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * @param string|null $tagName The tag name (optional). + * @param string|null $targetCommitish The commitish value that determines where the Git tag is created from (optional). + * @param string|null $releaseName The name of the release (optional). + * @param string|null $description The description of the release (optional). + * @param bool|null $isDraft Whether the release is a draft (optional). + * @param bool|null $isPrerelease Whether the release is a pre-release (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $ownerName, + string $repoName, + int $releaseId, + ?string $tagName = null, + ?string $targetCommitish = null, + ?string $releaseName = null, + ?string $description = null, + ?bool $isDraft = null, + ?bool $isPrerelease = null + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}"; + + // Set the release data + $data = new \stdClass(); + + if ($tagName !== null || $targetCommitish !== null || $releaseName !== null || $description !== null || $isDraft !== null || $isPrerelease !== null) + { + $data->editReleaseOption = new \stdClass(); + + if ($tagName !== null) + { + $data->editReleaseOption->tag_name = $tagName; + } + + if ($targetCommitish !== null) + { + $data->editReleaseOption->target_commitish = $targetCommitish; + } + + if ($releaseName !== null) + { + $data->editReleaseOption->name = $releaseName; + } + + if ($description !== null) + { + $data->editReleaseOption->body = $description; + } + + if ($isDraft !== null) + { + $data->editReleaseOption->draft = $isDraft; + } + + if ($isPrerelease !== null) + { + $data->editReleaseOption->prerelease = $isPrerelease; + } + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Get a release by tag name. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $tagName The tag name. + * + * @return object|null + * @since 3.2.0 + **/ + public function getByTag( + string $ownerName, + string $repoName, + string $tagName + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/tags/{$tagName}"; + + // Configure the URI with the path. + $this->uri->setVar('owner', $ownerName); + $this->uri->setVar('repo', $repoName); + $this->uri->setVar('tag', $tagName); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a release by tag name. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $tagName The tag name. + * + * @return string + * @since 3.2.0 + **/ + public function deleteByTag( + string $ownerName, + string $repoName, + string $tagName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/tags/{$tagName}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.power b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.power new file mode 100644 index 0000000..15c06fe --- /dev/null +++ b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/code.power @@ -0,0 +1,282 @@ + /** + * List a repo's releases. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param bool|null $draft Filter (exclude/include) drafts (optional). + * @param bool|null $preRelease Filter (exclude/include) pre-releases (optional). + * @param int $page Page number of results to return (1-based, optional). + * @param int $limit Page size of results (optional). + * + * @return array|null + * @since 3.2.0 + */ + public function list( + string $ownerName, + string $repoName, + ?bool $draft = null, + ?bool $preRelease = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases"; + + // Set additional URI values. + $this->uri->setVar('page', $page); + $this->uri->setVar('limit', $limit); + + if ($draft !== null) + { + $this->uri->setVar('draft', $draft); + } + + if ($preRelease !== null) + { + $this->uri->setVar('pre-release', $preRelease); + } + + // Send the request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create a release. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $tagName The tag name. + * @param string $targetCommitish The commitish value that determines where the Git tag is created from. + * @param string $releaseName The name of the release. + * @param string $releaseBody The description of the release. + * @param bool $isDraft Whether the release is a draft. + * @param bool $isPrerelease Whether the release is a pre-release. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $ownerName, + string $repoName, + string $tagName, + string $targetCommitish, + string $releaseName, + string $releaseBody, + bool $isDraft = false, + bool $isPrerelease = false + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases"; + + // Set the release data + $data = new \stdClass(); + $data->tag_name = $tagName; + $data->target_commitish = $targetCommitish; + $data->name = $releaseName; + $data->body = $releaseBody; + $data->draft = $isDraft; + $data->prerelease = $isPrerelease; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a release by ID. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $ownerName, + string $repoName, + int $releaseId + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a release by ID. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + int $releaseId + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a release. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $releaseId The release ID. + * @param string|null $tagName The tag name (optional). + * @param string|null $targetCommitish The commitish value that determines where the Git tag is created from (optional). + * @param string|null $releaseName The name of the release (optional). + * @param string|null $description The description of the release (optional). + * @param bool|null $isDraft Whether the release is a draft (optional). + * @param bool|null $isPrerelease Whether the release is a pre-release (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $ownerName, + string $repoName, + int $releaseId, + ?string $tagName = null, + ?string $targetCommitish = null, + ?string $releaseName = null, + ?string $description = null, + ?bool $isDraft = null, + ?bool $isPrerelease = null + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/{$releaseId}"; + + // Set the release data + $data = new \stdClass(); + + if ($tagName !== null || $targetCommitish !== null || $releaseName !== null || $description !== null || $isDraft !== null || $isPrerelease !== null) + { + $data->editReleaseOption = new \stdClass(); + + if ($tagName !== null) + { + $data->editReleaseOption->tag_name = $tagName; + } + + if ($targetCommitish !== null) + { + $data->editReleaseOption->target_commitish = $targetCommitish; + } + + if ($releaseName !== null) + { + $data->editReleaseOption->name = $releaseName; + } + + if ($description !== null) + { + $data->editReleaseOption->body = $description; + } + + if ($isDraft !== null) + { + $data->editReleaseOption->draft = $isDraft; + } + + if ($isPrerelease !== null) + { + $data->editReleaseOption->prerelease = $isPrerelease; + } + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Get a release by tag name. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $tagName The tag name. + * + * @return object|null + * @since 3.2.0 + **/ + public function getByTag( + string $ownerName, + string $repoName, + string $tagName + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/tags/{$tagName}"; + + // Configure the URI with the path. + $this->uri->setVar('owner', $ownerName); + $this->uri->setVar('repo', $repoName); + $this->uri->setVar('tag', $tagName); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a release by tag name. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $tagName The tag name. + * + * @return string + * @since 3.2.0 + **/ + public function deleteByTag( + string $ownerName, + string $repoName, + string $tagName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/releases/tags/{$tagName}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/settings.json b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/settings.json new file mode 100644 index 0000000..10d953c --- /dev/null +++ b/src/754d737c-3b6f-43f0-8974-2e06a3daf41e/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "754d737c-3b6f-43f0-8974-2e06a3daf41e", + "implements": null, + "load_selection": null, + "name": "Releases", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Releases", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Releases", + "description": "The Gitea Repository Releases\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/78b3346f-c4cf-46b3-941c-656e2d510da0/README.md b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/README.md new file mode 100644 index 0000000..ad356c8 --- /dev/null +++ b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Trees (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Trees #Gold { + + get(string $owner, string $repo, ...) : ?object +} + +note right of Trees::get + Get the tree of a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $sha + bool $recursive = false + int $page = 1 + int $perPage = 30 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.php b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.php new file mode 100644 index 0000000..a9e1974 --- /dev/null +++ b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Trees + * + * @since 3.2.0 + */ +class Trees extends Api +{ + /** + * Get the tree of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The commit SHA. + * @param bool $recursive Show all directories and files. + * @param int $page Page number. + * @param int $perPage Number of items per page. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $sha, + bool $recursive = false, + int $page = 1, + int $perPage = 30 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/trees/{$sha}"; + + // Set URI variables. + $uri = $this->uri->get($path); + $uri->setVar('recursive', $recursive); + $uri->setVar('page', $page); + $uri->setVar('per_page', $perPage); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.power b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.power new file mode 100644 index 0000000..335a6f1 --- /dev/null +++ b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/code.power @@ -0,0 +1,36 @@ + /** + * Get the tree of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The commit SHA. + * @param bool $recursive Show all directories and files. + * @param int $page Page number. + * @param int $perPage Number of items per page. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $sha, + bool $recursive = false, + int $page = 1, + int $perPage = 30 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/trees/{$sha}"; + + // Set URI variables. + $uri = $this->uri->get($path); + $uri->setVar('recursive', $recursive); + $uri->setVar('page', $page); + $uri->setVar('per_page', $perPage); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/78b3346f-c4cf-46b3-941c-656e2d510da0/settings.json b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/settings.json new file mode 100644 index 0000000..225c013 --- /dev/null +++ b/src/78b3346f-c4cf-46b3-941c-656e2d510da0/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "78b3346f-c4cf-46b3-941c-656e2d510da0", + "implements": null, + "load_selection": null, + "name": "Trees", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Trees", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Trees", + "description": "The Gitea Repository Trees\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/README.md b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/README.md new file mode 100644 index 0000000..083b771 --- /dev/null +++ b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/README.md @@ -0,0 +1,95 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Topics (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Topics #Gold { + + get(string $owner, string $repo, ...) : ?object + + replace(string $ownerName, string $repoName, ...) : string + + add(string $ownerName, string $repoName, ...) : string + + delete(string $ownerName, string $repoName, ...) : string + + search(string $searchKeyword, int $page = 1, ...) : ?array +} + +note right of Topics::get + Get the list of topics that a repository has. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Topics::replace + Replace the list of topics for a repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + array $topicNames +end note + +note right of Topics::add + Add a topic to a repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + string $topicName +end note + +note right of Topics::delete + Delete a topic from a repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + string $topicName +end note + +note right of Topics::search + Search topics via keyword. + + since: 3.2.0 + return: ?array + + arguments: + string $searchKeyword + int $page = 1 + int $limit = 10 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.php b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.php new file mode 100644 index 0000000..bbd24b8 --- /dev/null +++ b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.php @@ -0,0 +1,175 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Topics + * + * @since 3.2.0 + */ +class Topics extends Api +{ + /** + * Get the list of topics that a repository has. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/topics"; + + // Set query parameters for pagination. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Replace the list of topics for a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param array $topicNames The new list of topics. + * + * @return string + * @since 3.2.0 + **/ + public function replace( + string $ownerName, + string $repoName, + array $topicNames + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/topics"; + + // Set the topics data. + $data = new \stdClass(); + $data->topics = $topicNames; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), + json_encode($data) + ), 204, 'success' + ); + } + + /** + * Add a topic to a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $topicName The topic to add. + * + * @return string + * @since 3.2.0 + **/ + public function add( + string $ownerName, + string $repoName, + string $topicName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/topics/{$topicName}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Delete a topic from a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $topicName The topic to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + string $topicName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/topics/{$topicName}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Search topics via keyword. + * + * @param string $searchKeyword The keyword to search for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function search( + string $searchKeyword, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/topics/search"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('q', $searchKeyword); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.power b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.power new file mode 100644 index 0000000..27b8ceb --- /dev/null +++ b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/code.power @@ -0,0 +1,148 @@ + /** + * Get the list of topics that a repository has. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/topics"; + + // Set query parameters for pagination. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Replace the list of topics for a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param array $topicNames The new list of topics. + * + * @return string + * @since 3.2.0 + **/ + public function replace( + string $ownerName, + string $repoName, + array $topicNames + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/topics"; + + // Set the topics data. + $data = new \stdClass(); + $data->topics = $topicNames; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), + json_encode($data) + ), 204, 'success' + ); + } + + /** + * Add a topic to a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $topicName The topic to add. + * + * @return string + * @since 3.2.0 + **/ + public function add( + string $ownerName, + string $repoName, + string $topicName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/topics/{$topicName}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Delete a topic from a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $topicName The topic to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + string $topicName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/topics/{$topicName}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Search topics via keyword. + * + * @param string $searchKeyword The keyword to search for. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function search( + string $searchKeyword, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/topics/search"; + + // Set the query parameters. + $uri = $this->uri->get($path); + $uri->setVar('q', $searchKeyword); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/settings.json b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/settings.json new file mode 100644 index 0000000..3ae9762 --- /dev/null +++ b/src/7f852309-122b-42fb-b2f3-ea9e2d405a9c/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "7f852309-122b-42fb-b2f3-ea9e2d405a9c", + "implements": null, + "load_selection": null, + "name": "Topics", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Topics", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Topics", + "description": "The Gitea Repository Topics\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/7fb2cd98-a87d-4f48-9720-033924c69e34/README.md b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/README.md new file mode 100644 index 0000000..040439c --- /dev/null +++ b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Version (Details) +> namespace: **VDM\Joomla\Gitea\Miscellaneous** +```uml +@startuml +class Version #Gold { + + get() : ?object +} + +note right of Version::get + Returns the version of the Gitea application. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.php b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.php new file mode 100644 index 0000000..696db50 --- /dev/null +++ b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Miscellaneous; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Miscellaneous Version + * + * @since 3.2.0 + */ +class Version extends Api +{ + /** + * Returns the version of the Gitea application. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/version"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.power b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.power new file mode 100644 index 0000000..a517fcb --- /dev/null +++ b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/code.power @@ -0,0 +1,18 @@ + /** + * Returns the version of the Gitea application. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/version"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/7fb2cd98-a87d-4f48-9720-033924c69e34/settings.json b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/settings.json new file mode 100644 index 0000000..7e4961c --- /dev/null +++ b/src/7fb2cd98-a87d-4f48-9720-033924c69e34/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "7fb2cd98-a87d-4f48-9720-033924c69e34", + "implements": null, + "load_selection": null, + "name": "Version", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Miscellaneous.Version", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous.Version", + "description": "The Gitea Miscellaneous Version\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/README.md b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/README.md new file mode 100644 index 0000000..f653713 --- /dev/null +++ b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Forks (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Forks #Gold { + + listForks(string $owner, string $repo, ...) : ?array + + repo(string $owner, string $repo, ...) : ?object +} + +note right of Forks::listForks + List a repository's forks. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Forks::repo + Fork a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $forkName = '' + string $organization = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.php b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.php new file mode 100644 index 0000000..224e286 --- /dev/null +++ b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.php @@ -0,0 +1,102 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Forks + * + * @since 3.2.0 + */ +class Forks extends Api +{ + /** + * List a repository's forks. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + */ + public function listForks( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/forks"; + + // Set the query parameters. + $uri = $this->uri->get($uriPath); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Fork a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $forkName The name of the forked repository (optional). + * @param string $organization The organization name (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function repo( + string $owner, + string $repo, + string $forkName = '', + string $organization = '' + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/forks"; + + // Set the fork data. + $data = new \stdClass(); + + if (!empty($forkName)) + { + $data->name = $forkName; + } + + if (!empty($organization)) + { + $data->organization = $organization; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 202 + ); + } + + +} + diff --git a/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.power b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.power new file mode 100644 index 0000000..d687a10 --- /dev/null +++ b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/code.power @@ -0,0 +1,75 @@ + /** + * List a repository's forks. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + */ + public function listForks( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/forks"; + + // Set the query parameters. + $uri = $this->uri->get($uriPath); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Fork a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $forkName The name of the forked repository (optional). + * @param string $organization The organization name (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function repo( + string $owner, + string $repo, + string $forkName = '', + string $organization = '' + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/forks"; + + // Set the fork data. + $data = new \stdClass(); + + if (!empty($forkName)) + { + $data->name = $forkName; + } + + if (!empty($organization)) + { + $data->organization = $organization; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 202 + ); + } + diff --git a/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/settings.json b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/settings.json new file mode 100644 index 0000000..5dfbcd5 --- /dev/null +++ b/src/7fbed5f9-54a2-4001-a0d1-4621034166ef/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "7fbed5f9-54a2-4001-a0d1-4621034166ef", + "implements": null, + "load_selection": null, + "name": "Forks", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Forks", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Forks", + "description": "The Gitea Repository Forks\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/808da4eb-b467-46cf-a767-e7e714f46b5a/README.md b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/README.md new file mode 100644 index 0000000..4a2388b --- /dev/null +++ b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Package (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Package #Gold { + + register(Container $container) : void + + getPackage(Container $container) : Pack + + getFiles(Container $container) : Files + + getOwner(Container $container) : Owner +} + +note right of Package::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Package::getPackage + Get the Package class + + since: 3.2.0 + return: Pack +end note + +note right of Package::getFiles + Get the Files class + + since: 3.2.0 + return: Files +end note + +note right of Package::getOwner + Get the Owner class + + since: 3.2.0 + return: Owner +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.php b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.php new file mode 100644 index 0000000..75d92cb --- /dev/null +++ b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.php @@ -0,0 +1,101 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Package as Pack; +use VDM\Joomla\Gitea\Package\Files; +use VDM\Joomla\Gitea\Package\Owner; + + +/** + * The Gitea Package Service + * + * @since 3.2.0 + */ +class Package implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Pack::class, 'Gitea.Package') + ->share('Gitea.Package', [$this, 'getPackage'], true); + + $container->alias(Files::class, 'Gitea.Package.Files') + ->share('Gitea.Package.Files', [$this, 'getFiles'], true); + + $container->alias(Owner::class, 'Gitea.Package.Owner') + ->share('Gitea.Package.Owner', [$this, 'getOwner'], true); + } + + /** + * Get the Package class + * + * @param Container $container The DI container. + * + * @return Pack + * @since 3.2.0 + */ + public function getPackage(Container $container): Pack + { + return new Pack( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Files class + * + * @param Container $container The DI container. + * + * @return Files + * @since 3.2.0 + */ + public function getFiles(Container $container): Files + { + return new Files( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Owner class + * + * @param Container $container The DI container. + * + * @return Owner + * @since 3.2.0 + */ + public function getOwner(Container $container): Owner + { + return new Owner( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.power b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.power new file mode 100644 index 0000000..8a994a4 --- /dev/null +++ b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/code.power @@ -0,0 +1,70 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Pack::class, 'Gitea.Package') + ->share('Gitea.Package', [$this, 'getPackage'], true); + + $container->alias(Files::class, 'Gitea.Package.Files') + ->share('Gitea.Package.Files', [$this, 'getFiles'], true); + + $container->alias(Owner::class, 'Gitea.Package.Owner') + ->share('Gitea.Package.Owner', [$this, 'getOwner'], true); + } + + /** + * Get the Package class + * + * @param Container $container The DI container. + * + * @return Pack + * @since 3.2.0 + */ + public function getPackage(Container $container): Pack + { + return new Pack( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Files class + * + * @param Container $container The DI container. + * + * @return Files + * @since 3.2.0 + */ + public function getFiles(Container $container): Files + { + return new Files( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Owner class + * + * @param Container $container The DI container. + * + * @return Owner + * @since 3.2.0 + */ + public function getOwner(Container $container): Owner + { + return new Owner( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/808da4eb-b467-46cf-a767-e7e714f46b5a/settings.json b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/settings.json new file mode 100644 index 0000000..08aa1fd --- /dev/null +++ b/src/808da4eb-b467-46cf-a767-e7e714f46b5a/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "808da4eb-b467-46cf-a767-e7e714f46b5a", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Package", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Package", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "b7ec675d-3197-4458-89d6-ca5d4303af8a", + "as": "Pack" + }, + "use_selection1": { + "use": "4a54c21f-ac3a-4489-b507-636835541a67", + "as": "default" + }, + "use_selection2": { + "use": "b5ca512b-f667-4ec6-bc6e-914af41d344a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Package", + "description": "The Gitea Package Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/83bb983b-80d8-44d5-917b-03d3c13742b9/README.md b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/README.md new file mode 100644 index 0000000..429fab7 --- /dev/null +++ b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Timeline (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Timeline #Gold { + + get(string $owner, string $repo, ...) : ?array +} + +note right of Timeline::get + List all comments and events on an issue. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + ?string $since = null + ?int $page = null + ?int $limit = null + ?string $before = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.php b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.php new file mode 100644 index 0000000..4c54937 --- /dev/null +++ b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Timeline + * + * @since 3.2.0 + */ +class Timeline extends Api +{ + /** + * List all comments and events on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string|null $since Optional. If provided, only comments updated since the specified time are returned. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * @param string|null $before Optional. If provided, only comments updated before the provided time are returned. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $index, + ?string $since = null, + ?int $page = null, + ?int $limit = null, + ?string $before = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/timeline"; + + // Set the query parameters. + $uri = $this->uri->get($path); + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.power b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.power new file mode 100644 index 0000000..9e1d72f --- /dev/null +++ b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/code.power @@ -0,0 +1,51 @@ + /** + * List all comments and events on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string|null $since Optional. If provided, only comments updated since the specified time are returned. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * @param string|null $before Optional. If provided, only comments updated before the provided time are returned. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $index, + ?string $since = null, + ?int $page = null, + ?int $limit = null, + ?string $before = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/timeline"; + + // Set the query parameters. + $uri = $this->uri->get($path); + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/83bb983b-80d8-44d5-917b-03d3c13742b9/settings.json b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/settings.json new file mode 100644 index 0000000..862011e --- /dev/null +++ b/src/83bb983b-80d8-44d5-917b-03d3c13742b9/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "83bb983b-80d8-44d5-917b-03d3c13742b9", + "implements": null, + "load_selection": null, + "name": "Timeline", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Timeline", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Timeline", + "description": "The Gitea Issue Timeline\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/README.md b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/README.md new file mode 100644 index 0000000..e4014bb --- /dev/null +++ b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Starred (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Starred #Gold { + + list(int $page = 1, int $limit = 10) : ?array + + check(string $owner, string $repo) : string +} + +note right of Starred::list + List the repos that the authenticated user has starred. + + since: 3.2.0 + return: ?array +end note + +note right of Starred::check + Check whether the authenticated user is starring the repo. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.php b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.php new file mode 100644 index 0000000..2414066 --- /dev/null +++ b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.php @@ -0,0 +1,76 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Starred + * + * @since 3.2.0 + */ +class Starred extends Api +{ + /** + * List the repos that the authenticated user has starred. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/starred'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Check whether the authenticated user is starring the repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function check(string $owner, string $repo): string + { + // Build the request path. + $path = "/user/starred/{$owner}/{$repo}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.power b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.power new file mode 100644 index 0000000..f9093f7 --- /dev/null +++ b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/code.power @@ -0,0 +1,49 @@ + /** + * List the repos that the authenticated user has starred. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/starred'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Check whether the authenticated user is starring the repo. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function check(string $owner, string $repo): string + { + // Build the request path. + $path = "/user/starred/{$owner}/{$repo}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/settings.json b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/settings.json new file mode 100644 index 0000000..1d4415d --- /dev/null +++ b/src/884b61d0-1f56-4f5f-a657-acaacdb9634b/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "884b61d0-1f56-4f5f-a657-acaacdb9634b", + "implements": null, + "load_selection": null, + "name": "Starred", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Starred", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Starred", + "description": "The Gitea User Starred\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/README.md b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/README.md new file mode 100644 index 0000000..a8225e4 --- /dev/null +++ b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/README.md @@ -0,0 +1,42 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Archive (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Archive #Gold { + + get(string $owner, string $repo, ...) : string +} + +note right of Archive::get + Get an archive of a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $archive +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.php b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.php new file mode 100644 index 0000000..8cc3499 --- /dev/null +++ b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.php @@ -0,0 +1,58 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Archive + * + * @since 3.2.0 + */ +class Archive extends Api +{ + /** + * Get an archive of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $archive The archive format, e.g., "zip" or "tar.gz". + * + * @return string + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $archive + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/archive/{$archive}"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('archive', $archive); + + // Send the get request. + return $this->response->get( + $this->http->get($uri), 200, 'success' + ); + } + + +} + diff --git a/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.power b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.power new file mode 100644 index 0000000..21870f9 --- /dev/null +++ b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/code.power @@ -0,0 +1,31 @@ + /** + * Get an archive of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $archive The archive format, e.g., "zip" or "tar.gz". + * + * @return string + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $archive + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/archive/{$archive}"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('archive', $archive); + + // Send the get request. + return $this->response->get( + $this->http->get($uri), 200, 'success' + ); + } + diff --git a/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/settings.json b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/settings.json new file mode 100644 index 0000000..594ce96 --- /dev/null +++ b/src/8a8fce09-a880-4364-a8c4-4ca337e7e951/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "8a8fce09-a880-4364-a8c4-4ca337e7e951", + "implements": null, + "load_selection": null, + "name": "Archive", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Archive", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Archive", + "description": "The Gitea Repository Archive\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/README.md b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/README.md new file mode 100644 index 0000000..8ddb3f7 --- /dev/null +++ b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/README.md @@ -0,0 +1,51 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Templates (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Templates #Gold { + + issue(string $owner, string $repo) : ?array + + repo(string $templateOwner, string $templateRepo, ...) : ?object +} + +note right of Templates::issue + Get available issue templates for a repository. + + since: 3.2.0 + return: ?array +end note + +note right of Templates::repo + Create a repository using a template. + + since: 3.2.0 + return: ?object + + arguments: + string $templateOwner + string $templateRepo + string $name + array $options = [] +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.php b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.php new file mode 100644 index 0000000..40246fc --- /dev/null +++ b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.php @@ -0,0 +1,91 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Templates + * + * @since 3.2.0 + */ +class Templates extends Api +{ + /** + * Get available issue templates for a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function issue(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issue_templates"; + + // Get the URI. + $uri = $this->uri->get($path); + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a repository using a template. + * + * @param string $templateOwner The template owner's name. + * @param string $templateRepo The template repository name. + * @param string $name The name of the new repository. + * @param array $options Optional. Additional options for the new repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function repo( + string $templateOwner, + string $templateRepo, + string $name, + array $options = [] + ): ?object + { + // Build the request path. + $path = "/repos/{$templateOwner}/{$templateRepo}/generate"; + + // Set the repo data. + $data = new \stdClass(); + $data->name = $name; + + foreach ($options as $key => $value) + { + if ($value !== null) + { + $data->{$key} = $value; + } + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.power b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.power new file mode 100644 index 0000000..5a70e02 --- /dev/null +++ b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/code.power @@ -0,0 +1,64 @@ + /** + * Get available issue templates for a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function issue(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issue_templates"; + + // Get the URI. + $uri = $this->uri->get($path); + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a repository using a template. + * + * @param string $templateOwner The template owner's name. + * @param string $templateRepo The template repository name. + * @param string $name The name of the new repository. + * @param array $options Optional. Additional options for the new repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function repo( + string $templateOwner, + string $templateRepo, + string $name, + array $options = [] + ): ?object + { + // Build the request path. + $path = "/repos/{$templateOwner}/{$templateRepo}/generate"; + + // Set the repo data. + $data = new \stdClass(); + $data->name = $name; + + foreach ($options as $key => $value) + { + if ($value !== null) + { + $data->{$key} = $value; + } + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } diff --git a/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/settings.json b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/settings.json new file mode 100644 index 0000000..212c828 --- /dev/null +++ b/src/8c82b705-04bb-4bd2-ac09-3f590fdf48c2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "8c82b705-04bb-4bd2-ac09-3f590fdf48c2", + "implements": null, + "load_selection": null, + "name": "Templates", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Templates", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Templates", + "description": "The Gitea Repository Templates\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md b/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md new file mode 100644 index 0000000..6d2d5ba --- /dev/null +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md @@ -0,0 +1,174 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Contents (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Contents #Gold { + + get(string $owner, string $repo, ...) : mixed + + metadata(string $owner, string $repo, ...) : ?object + + create(string $owner, string $repo, ...) : ?object + + root(string $owner, string $repo, ...) : ?array + + update(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : ?object + + editor(string $owner, string $repo, ...) : ?string + + blob(string $owner, string $repo, ...) : ?object +} + +note right of Contents::get + Get a file from a repository. +Default the repository's default branch (usually master). + + since: 3.2.0 + return: mixed + + arguments: + string $owner + string $repo + string $filepath + ?string $ref = null +end note + +note left of Contents::metadata + Get the metadata and contents (if a file) of an entry in a repository, +or a list of entries if a directory. +Default the repository's default branch (usually master). + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $filepath + ?string $ref = null +end note + +note right of Contents::create + Create a file in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $filepath + string $content + string $message + string $branch = 'master' + ?string $authorName = null + ?string $authorEmail = null + ?string $committerName = null + ?string $committerEmail = null + ?bool $newBranch = false + ?string $authorDate = null + ?string $committerDate = null + ?bool $signoff = null +end note + +note left of Contents::root + Get the metadata of all the entries of the root directory. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + ?string $ref = null +end note + +note right of Contents::update + Update a file in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $filepath + string $content + string $message + string $branch = 'master' + string $sha + ?string $authorName = null + ?string $authorEmail = null + ?string $committerName = null + ?string $committerEmail = null + ?string $authorDate = null + ?string $committerDate = null + ?string $fromPath = null + ?string $newBranch = null + ?bool $signoff = null +end note + +note left of Contents::delete + Delete a file in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $filepath + string $message + string $sha + ?string $branch = null + ?string $authorName = null + ?string $authorEmail = null + ?string $committerName = null + ?string $committerEmail = null + ?string $authorDate = null + ?string $committerDate = null + ?string $newBranch = null + ?bool $signoff = null +end note + +note right of Contents::editor + Get the EditorConfig definitions of a file in a repository. + + since: 3.2.0 + return: ?string + + arguments: + string $owner + string $repo + string $filepath + string $ref = null +end note + +note left of Contents::blob + Get the blob of a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $sha +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php new file mode 100644 index 0000000..982403c --- /dev/null +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php @@ -0,0 +1,509 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Contents + * + * @since 3.2.0 + */ +class Contents extends Api +{ + /** + * Get a file from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref Optional. The name of the commit/branch/tag. + * Default the repository's default branch (usually master). + * + * @return mixed + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $filepath, ?string $ref = null) + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/raw/{$filepath}"; + + // Get the URI with the specified path. + $uri = $this->uri->get($path); + + // Add the ref parameter if provided. + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get the metadata and contents (if a file) of an entry in a repository, + * or a list of entries if a directory. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file or directory path. + * @param string|null $ref Optional. The name of the commit/branch/tag. + * Default the repository's default branch (usually master). + * + * @return object|null + * @since 3.2.0 + **/ + public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Get the URI with the specified path. + $uri = $this->uri->get($path); + + // Add the ref parameter if provided. + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $content The file content. + * @param string $message The commit message. + * @param string $branch The branch name. Defaults to the repository's default branch. + * @param string|null $authorName The author's name. + * @param string|null $authorEmail The author's email. + * @param string|null $committerName The committer's name. + * @param string|null $committerEmail The committer's email. + * @param bool|null $newBranch Whether to create a new branch. Defaults to false. + * @param string|null $authorDate The author's date. + * @param string|null $committerDate The committer's date. + * @param bool|null $signoff Add a Signed-off-by trailer. Defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $filepath, + string $content, + string $message, + string $branch = 'master', + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?bool $newBranch = false, + ?string $authorDate = null, + ?string $committerDate = null, + ?bool $signoff = null + ): ?object { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Set the post data + $data = new \stdClass(); + $data->content = base64_encode($content); + $data->message = $message; + $data->branch = $branch; + + if ($authorName !== null || $authorEmail !== null) + { + $data->author = new \stdClass(); + if ($authorName !== null) + { + $data->author->name = $authorName; + } + if ($authorEmail !== null) + { + $data->author->email = $authorEmail; + } + } + + if ($committerName !== null || $committerEmail !== null) + { + $data->committer = new \stdClass(); + if ($committerName !== null) + { + $data->committer->name = $committerName; + } + if ($committerEmail !== null) + { + $data->committer->email = $committerEmail; + } + } + + if ($newBranch !== null) + { + $data->new_branch = $newBranch; + } + + if ($authorDate !== null || $committerDate !== null) + { + $data->dates = new \stdClass(); + if ($authorDate !== null) + { + $data->dates->author = $authorDate; + } + if ($committerDate !== null) + { + $data->dates->committer = $committerDate; + } + } + + if ($signoff !== null) + { + $data->signoff = $signoff; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get the metadata of all the entries of the root directory. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $ref The name of the commit/branch/tag. Default the repository's default branch (usually master). + * + * @return array|null + * @since 3.2.0 + **/ + public function root(string $owner, string $repo, ?string $ref = null): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents"; + + // Add the 'ref' parameter if it's provided. + if ($ref !== null) + { + $this->uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Update a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $content The file content. + * @param string $message The commit message. + * @param string $branch The branch name. Defaults to the repository's default branch. + * @param string $sha The blob SHA of the file. + * @param string|null $authorName The author name. Defaults to the authenticated user. + * @param string|null $authorEmail The author email. Defaults to the authenticated user. + * @param string|null $committerName The committer name. Defaults to the authenticated user. + * @param string|null $committerEmail The committer email. Defaults to the authenticated user. + * @param string|null $authorDate The author date. + * @param string|null $committerDate The committer date. + * @param string|null $fromPath The original file path to move/rename. + * @param string|null $newBranch The new branch to create from the specified branch. + * @param bool|null $signoff Add a Signed-off-by trailer. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $filepath, + string $content, + string $message, + string $branch = 'master', + string $sha, + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?string $fromPath = null, + ?string $newBranch = null, + ?bool $signoff = null + ): ?object { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Set the file data. + $data = new \stdClass(); + $data->content = base64_encode($content); + $data->message = $message; + $data->branch = $branch; + $data->sha = $sha; + + if ($authorName !== null || $authorEmail !== null) + { + $data->author = new \stdClass(); + + if ($authorName !== null) + { + $data->author->name = $authorName; + } + + if ($authorEmail !== null) + { + $data->author->email = $authorEmail; + } + } + + if ($committerName !== null || $committerEmail !== null) + { + $data->committer = new \stdClass(); + + if ($committerName !== null) + { + $data->committer->name = $committerName; + } + + if ($committerEmail !== null) + { + $data->committer->email = $committerEmail; + } + } + + if ($authorDate !== null || $committerDate !== null) + { + $data->dates = new \stdClass(); + + if ($authorDate !== null) + { + $data->dates->author = $authorDate; + } + + if ($committerDate !== null) + { + $data->dates->committer = $committerDate; + } + } + + if ($fromPath !== null) + { + $data->from_path = $fromPath; + } + + if ($newBranch !== null) + { + $data->new_branch = $newBranch; + } + + if ($signoff !== null) + { + $data->signoff = $signoff; + } + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Delete a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $message The commit message. + * @param string $branch The branch name (optional). + * @param string $sha The blob SHA of the file. + * @param string $authorName The author name (optional). + * @param string $authorEmail The author email (optional). + * @param string $committerName The committer name (optional). + * @param string $committerEmail The committer email (optional). + * @param string $authorDate The author date (optional). + * @param string $committerDate The committer date (optional). + * @param string $newBranch The new branch name (optional). + * @param bool $signoff Add a Signed-off-by trailer (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $filepath, + string $message, + string $sha, + ?string $branch = null, + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?string $newBranch = null, + ?bool $signoff = null + ): ?object { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Set the file data. + $data = new \stdClass(); + $data->message = $message; + $data->sha = $sha; + + if ($branch !== null) { + $data->branch = $branch; + } + + if ($authorName !== null || $authorEmail !== null) + { + $data->author = new \stdClass(); + + if ($authorName !== null) + { + $data->author->name = $authorName; + } + + if ($authorEmail !== null) + { + $data->author->email = $authorEmail; + } + } + + if ($committerName !== null || $committerEmail !== null) + { + $data->committer = new \stdClass(); + + if ($committerName !== null) + { + $data->committer->name = $committerName; + } + + if ($committerEmail !== null) + { + $data->committer->email = $committerEmail; + } + } + + if ($authorDate !== null || $committerDate !== null) + { + $data->dates = new \stdClass(); + + if ($authorDate !== null) + { + $data->dates->author = $authorDate; + } + + if ($committerDate !== null) + { + $data->dates->committer = $committerDate; + } + } + + if ($newBranch !== null) + { + $data->new_branch = $newBranch; + } + + if ($signoff !== null) + { + $data->signoff = $signoff; + } + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Get the EditorConfig definitions of a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $ref The name of the commit/branch/tag. + * + * @return string|null + * @since 3.2.0 + **/ + public function editor(string $owner, string $repo, string $filepath, string $ref = null): ?string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/editorconfig/{$filepath}"; + + // Set the request parameters. + $uri = $this->uri->get($path); + + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get the blob of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The SHA hash of the blob. + * + * @return object|null + * @since 3.2.0 + **/ + public function blob(string $owner, string $repo, string $sha): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/blobs/{$sha}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power new file mode 100644 index 0000000..8a1bb52 --- /dev/null +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power @@ -0,0 +1,482 @@ + /** + * Get a file from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref Optional. The name of the commit/branch/tag. + * Default the repository's default branch (usually master). + * + * @return mixed + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $filepath, ?string $ref = null) + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/raw/{$filepath}"; + + // Get the URI with the specified path. + $uri = $this->uri->get($path); + + // Add the ref parameter if provided. + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get the metadata and contents (if a file) of an entry in a repository, + * or a list of entries if a directory. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file or directory path. + * @param string|null $ref Optional. The name of the commit/branch/tag. + * Default the repository's default branch (usually master). + * + * @return object|null + * @since 3.2.0 + **/ + public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Get the URI with the specified path. + $uri = $this->uri->get($path); + + // Add the ref parameter if provided. + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $content The file content. + * @param string $message The commit message. + * @param string $branch The branch name. Defaults to the repository's default branch. + * @param string|null $authorName The author's name. + * @param string|null $authorEmail The author's email. + * @param string|null $committerName The committer's name. + * @param string|null $committerEmail The committer's email. + * @param bool|null $newBranch Whether to create a new branch. Defaults to false. + * @param string|null $authorDate The author's date. + * @param string|null $committerDate The committer's date. + * @param bool|null $signoff Add a Signed-off-by trailer. Defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $filepath, + string $content, + string $message, + string $branch = 'master', + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?bool $newBranch = false, + ?string $authorDate = null, + ?string $committerDate = null, + ?bool $signoff = null + ): ?object { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Set the post data + $data = new \stdClass(); + $data->content = base64_encode($content); + $data->message = $message; + $data->branch = $branch; + + if ($authorName !== null || $authorEmail !== null) + { + $data->author = new \stdClass(); + if ($authorName !== null) + { + $data->author->name = $authorName; + } + if ($authorEmail !== null) + { + $data->author->email = $authorEmail; + } + } + + if ($committerName !== null || $committerEmail !== null) + { + $data->committer = new \stdClass(); + if ($committerName !== null) + { + $data->committer->name = $committerName; + } + if ($committerEmail !== null) + { + $data->committer->email = $committerEmail; + } + } + + if ($newBranch !== null) + { + $data->new_branch = $newBranch; + } + + if ($authorDate !== null || $committerDate !== null) + { + $data->dates = new \stdClass(); + if ($authorDate !== null) + { + $data->dates->author = $authorDate; + } + if ($committerDate !== null) + { + $data->dates->committer = $committerDate; + } + } + + if ($signoff !== null) + { + $data->signoff = $signoff; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get the metadata of all the entries of the root directory. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $ref The name of the commit/branch/tag. Default the repository's default branch (usually master). + * + * @return array|null + * @since 3.2.0 + **/ + public function root(string $owner, string $repo, ?string $ref = null): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents"; + + // Add the 'ref' parameter if it's provided. + if ($ref !== null) + { + $this->uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Update a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $content The file content. + * @param string $message The commit message. + * @param string $branch The branch name. Defaults to the repository's default branch. + * @param string $sha The blob SHA of the file. + * @param string|null $authorName The author name. Defaults to the authenticated user. + * @param string|null $authorEmail The author email. Defaults to the authenticated user. + * @param string|null $committerName The committer name. Defaults to the authenticated user. + * @param string|null $committerEmail The committer email. Defaults to the authenticated user. + * @param string|null $authorDate The author date. + * @param string|null $committerDate The committer date. + * @param string|null $fromPath The original file path to move/rename. + * @param string|null $newBranch The new branch to create from the specified branch. + * @param bool|null $signoff Add a Signed-off-by trailer. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $filepath, + string $content, + string $message, + string $branch = 'master', + string $sha, + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?string $fromPath = null, + ?string $newBranch = null, + ?bool $signoff = null + ): ?object { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Set the file data. + $data = new \stdClass(); + $data->content = base64_encode($content); + $data->message = $message; + $data->branch = $branch; + $data->sha = $sha; + + if ($authorName !== null || $authorEmail !== null) + { + $data->author = new \stdClass(); + + if ($authorName !== null) + { + $data->author->name = $authorName; + } + + if ($authorEmail !== null) + { + $data->author->email = $authorEmail; + } + } + + if ($committerName !== null || $committerEmail !== null) + { + $data->committer = new \stdClass(); + + if ($committerName !== null) + { + $data->committer->name = $committerName; + } + + if ($committerEmail !== null) + { + $data->committer->email = $committerEmail; + } + } + + if ($authorDate !== null || $committerDate !== null) + { + $data->dates = new \stdClass(); + + if ($authorDate !== null) + { + $data->dates->author = $authorDate; + } + + if ($committerDate !== null) + { + $data->dates->committer = $committerDate; + } + } + + if ($fromPath !== null) + { + $data->from_path = $fromPath; + } + + if ($newBranch !== null) + { + $data->new_branch = $newBranch; + } + + if ($signoff !== null) + { + $data->signoff = $signoff; + } + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Delete a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $message The commit message. + * @param string $branch The branch name (optional). + * @param string $sha The blob SHA of the file. + * @param string $authorName The author name (optional). + * @param string $authorEmail The author email (optional). + * @param string $committerName The committer name (optional). + * @param string $committerEmail The committer email (optional). + * @param string $authorDate The author date (optional). + * @param string $committerDate The committer date (optional). + * @param string $newBranch The new branch name (optional). + * @param bool $signoff Add a Signed-off-by trailer (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $filepath, + string $message, + string $sha, + ?string $branch = null, + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?string $newBranch = null, + ?bool $signoff = null + ): ?object { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/contents/{$filepath}"; + + // Set the file data. + $data = new \stdClass(); + $data->message = $message; + $data->sha = $sha; + + if ($branch !== null) { + $data->branch = $branch; + } + + if ($authorName !== null || $authorEmail !== null) + { + $data->author = new \stdClass(); + + if ($authorName !== null) + { + $data->author->name = $authorName; + } + + if ($authorEmail !== null) + { + $data->author->email = $authorEmail; + } + } + + if ($committerName !== null || $committerEmail !== null) + { + $data->committer = new \stdClass(); + + if ($committerName !== null) + { + $data->committer->name = $committerName; + } + + if ($committerEmail !== null) + { + $data->committer->email = $committerEmail; + } + } + + if ($authorDate !== null || $committerDate !== null) + { + $data->dates = new \stdClass(); + + if ($authorDate !== null) + { + $data->dates->author = $authorDate; + } + + if ($committerDate !== null) + { + $data->dates->committer = $committerDate; + } + } + + if ($newBranch !== null) + { + $data->new_branch = $newBranch; + } + + if ($signoff !== null) + { + $data->signoff = $signoff; + } + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Get the EditorConfig definitions of a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $ref The name of the commit/branch/tag. + * + * @return string|null + * @since 3.2.0 + **/ + public function editor(string $owner, string $repo, string $filepath, string $ref = null): ?string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/editorconfig/{$filepath}"; + + // Set the request parameters. + $uri = $this->uri->get($path); + + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get the blob of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The SHA hash of the blob. + * + * @return object|null + * @since 3.2.0 + **/ + public function blob(string $owner, string $repo, string $sha): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/blobs/{$sha}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/settings.json b/src/8d1baef6-fcad-49a9-848f-428009cdb989/settings.json new file mode 100644 index 0000000..2040ed2 --- /dev/null +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "8d1baef6-fcad-49a9-848f-428009cdb989", + "implements": null, + "load_selection": null, + "name": "Contents", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Contents", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Contents", + "description": "The Gitea Repository Contents\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/README.md b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/README.md new file mode 100644 index 0000000..4322c7d --- /dev/null +++ b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/README.md @@ -0,0 +1,87 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Organization (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class Organization #Gold { + + create(string $login, string $fullName, ...) : ?object + + get(string $org) : ?object + + list(int $page = 1, int $limit = 10) : ?array + + delete(string $org) : string + + edit(string $org, ?string $fullName = null, ...) : ?object +} + +note right of Organization::create + Create an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $login + string $fullName + string $email + string $description = '' + bool $repoAdmin = false + bool $teamAdmin = false +end note + +note right of Organization::get + Get an organization. + + since: 3.2.0 + return: ?object +end note + +note right of Organization::list + Get a list of organizations. + + since: 3.2.0 + return: ?array +end note + +note right of Organization::delete + Delete an organization. + + since: 3.2.0 + return: string +end note + +note right of Organization::edit + Edit an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $org + ?string $fullName = null + ?string $email = null + ?string $location = null + ?string $description = null + ?bool $repoAdmin = null + ?string $visibility = null + ?string $website = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.php b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.php new file mode 100644 index 0000000..0e7255c --- /dev/null +++ b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.php @@ -0,0 +1,209 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization + * + * @since 3.2.0 + */ +class Organization extends Api +{ + /** + * Create an organization. + * + * @param string $login Required. The organization's username. + * @param string $fullName Required. The full name of the organization. + * @param string $email Required. The email of the organization. + * @param string $description Optional. The description of the organization. + * @param bool $repoAdmin Optional. Whether the user has repository admin access. + * @param bool $teamAdmin Optional. Whether the user has team admin access. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $login, + string $fullName, + string $email, + string $description = '', + bool $repoAdmin = false, + bool $teamAdmin = false + ): ?object + { + // Set the lines data + $data = new \stdClass(); + $data->username = $login; + $data->full_name = $fullName; + $data->email = $email; + $data->description = $description; + $data->repo_admin_change_team_access = $repoAdmin; + $data->team_admin_change_team_access = $teamAdmin; + + // Build the request path. + $path = '/orgs'; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get an organization. + * + * @param string $org The organization name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $org): ?object + { + // Build the request path. + $path = "/orgs/{$org}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get a list of organizations. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/orgs'; + + // Get the URI and set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete an organization. + * + * @param string $org The organization name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $org): string + { + // Build the request path. + $path = "/orgs/{$org}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit an organization. + * + * @param string $org The organization name. + * @param string $fullName Optional. The full name of the organization. + * @param string $location Optional. The location of the organization. + * @param string $description Optional. The description of the organization. + * @param bool $repoAdmin Optional. Whether the user has repository admin access. + * @param string $visibility Optional. The visibility of the organization (public, limited, or private). + * @param string $website Optional. The website of the organization. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $org, + ?string $fullName = null, + ?string $email = null, + ?string $location = null, + ?string $description = null, + ?bool $repoAdmin = null, + ?string $visibility = null, + ?string $website = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + if ($fullName !== null) + { + $data->full_name = $fullName; + } + + if ($location !== null) + { + $data->location = $location; + } + + if ($description !== null) + { + $data->description = $description; + } + + if ($repoAdmin !== null) + { + $data->repo_admin_change_team_access = $repoAdmin; + } + + if ($visibility !== null) + { + $data->visibility = $visibility; + } + + if ($website !== null) + { + $data->website = $website; + } + + // Build the request path. + $path = "/orgs/{$org}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + +} + diff --git a/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.power b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.power new file mode 100644 index 0000000..db02390 --- /dev/null +++ b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/code.power @@ -0,0 +1,182 @@ + /** + * Create an organization. + * + * @param string $login Required. The organization's username. + * @param string $fullName Required. The full name of the organization. + * @param string $email Required. The email of the organization. + * @param string $description Optional. The description of the organization. + * @param bool $repoAdmin Optional. Whether the user has repository admin access. + * @param bool $teamAdmin Optional. Whether the user has team admin access. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $login, + string $fullName, + string $email, + string $description = '', + bool $repoAdmin = false, + bool $teamAdmin = false + ): ?object + { + // Set the lines data + $data = new \stdClass(); + $data->username = $login; + $data->full_name = $fullName; + $data->email = $email; + $data->description = $description; + $data->repo_admin_change_team_access = $repoAdmin; + $data->team_admin_change_team_access = $teamAdmin; + + // Build the request path. + $path = '/orgs'; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get an organization. + * + * @param string $org The organization name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $org): ?object + { + // Build the request path. + $path = "/orgs/{$org}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get a list of organizations. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/orgs'; + + // Get the URI and set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete an organization. + * + * @param string $org The organization name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $org): string + { + // Build the request path. + $path = "/orgs/{$org}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit an organization. + * + * @param string $org The organization name. + * @param string $fullName Optional. The full name of the organization. + * @param string $location Optional. The location of the organization. + * @param string $description Optional. The description of the organization. + * @param bool $repoAdmin Optional. Whether the user has repository admin access. + * @param string $visibility Optional. The visibility of the organization (public, limited, or private). + * @param string $website Optional. The website of the organization. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $org, + ?string $fullName = null, + ?string $email = null, + ?string $location = null, + ?string $description = null, + ?bool $repoAdmin = null, + ?string $visibility = null, + ?string $website = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + if ($fullName !== null) + { + $data->full_name = $fullName; + } + + if ($location !== null) + { + $data->location = $location; + } + + if ($description !== null) + { + $data->description = $description; + } + + if ($repoAdmin !== null) + { + $data->repo_admin_change_team_access = $repoAdmin; + } + + if ($visibility !== null) + { + $data->visibility = $visibility; + } + + if ($website !== null) + { + $data->website = $website; + } + + // Build the request path. + $path = "/orgs/{$org}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } diff --git a/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/settings.json b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/settings.json new file mode 100644 index 0000000..db6b849 --- /dev/null +++ b/src/8efd9070-7110-4b8e-bb76-cb1a286d5af2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "8efd9070-7110-4b8e-bb76-cb1a286d5af2", + "implements": null, + "load_selection": null, + "name": "Organization", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "description": "The Gitea Organization\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/README.md b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/README.md new file mode 100644 index 0000000..6e9ca95 --- /dev/null +++ b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/README.md @@ -0,0 +1,51 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Markdown (Details) +> namespace: **VDM\Joomla\Gitea\Miscellaneous** +```uml +@startuml +class Markdown #Gold { + + render(string $markdownText, bool $isWikiPage = false, ...) : ?string + + raw(string $rawMarkdown) : ?string +} + +note right of Markdown::render + Render a markdown document as HTML. + + since: 3.2.0 + return: ?string + + arguments: + string $markdownText + bool $isWikiPage = false + string $context = 'string' + string $mode = 'string' +end note + +note right of Markdown::raw + Render raw markdown as HTML. + + since: 3.2.0 + return: ?string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.php b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.php new file mode 100644 index 0000000..f6f54e5 --- /dev/null +++ b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.php @@ -0,0 +1,87 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Miscellaneous; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Miscellaneous Markdown + * + * @since 3.2.0 + */ +class Markdown extends Api +{ + /** + * Render a markdown document as HTML. + * + * @param string $markdownText The markdown text to render. + * @param bool $isWikiPage Is it a wiki page? + * @param string $context Context to render. + * @param string $mode Mode to render. + * + * @return string|null + * @since 3.2.0 + **/ + public function render( + string $markdownText, + bool $isWikiPage = false, + string $context = 'string', + string $mode = 'string' + ): ?string + { + // Build the request path. + $path = "/markdown"; + + // Set the markdown data. + $data = new \stdClass(); + $data->Text = $markdownText; + $data->Wiki = $isWikiPage; + $data->Context = $context; + $data->Mode = $mode; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data), + ['accept' => 'text/html'] + ) + ); + } + + /** + * Render raw markdown as HTML. + * + * @param string $rawMarkdown The raw markdown text to render. + * + * @return string|null + * @since 3.2.0 + **/ + public function raw(string $rawMarkdown): ?string + { + // Build the request path. + $path = "/markdown/raw"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + $rawMarkdown, + ['Content-Type' => 'text/plain', 'accept' => 'text/html'] + ) + ); + } + +} + diff --git a/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.power b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.power new file mode 100644 index 0000000..ec3fe85 --- /dev/null +++ b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/code.power @@ -0,0 +1,60 @@ + /** + * Render a markdown document as HTML. + * + * @param string $markdownText The markdown text to render. + * @param bool $isWikiPage Is it a wiki page? + * @param string $context Context to render. + * @param string $mode Mode to render. + * + * @return string|null + * @since 3.2.0 + **/ + public function render( + string $markdownText, + bool $isWikiPage = false, + string $context = 'string', + string $mode = 'string' + ): ?string + { + // Build the request path. + $path = "/markdown"; + + // Set the markdown data. + $data = new \stdClass(); + $data->Text = $markdownText; + $data->Wiki = $isWikiPage; + $data->Context = $context; + $data->Mode = $mode; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data), + ['accept' => 'text/html'] + ) + ); + } + + /** + * Render raw markdown as HTML. + * + * @param string $rawMarkdown The raw markdown text to render. + * + * @return string|null + * @since 3.2.0 + **/ + public function raw(string $rawMarkdown): ?string + { + // Build the request path. + $path = "/markdown/raw"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + $rawMarkdown, + ['Content-Type' => 'text/plain', 'accept' => 'text/html'] + ) + ); + } diff --git a/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/settings.json b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/settings.json new file mode 100644 index 0000000..7277352 --- /dev/null +++ b/src/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "8f1a0130-e555-4e6a-9fa8-9b99e30b39fa", + "implements": null, + "load_selection": null, + "name": "Markdown", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Miscellaneous.Markdown", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous.Markdown", + "description": "The Gitea Miscellaneous Markdown\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/README.md b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/README.md new file mode 100644 index 0000000..644c456 --- /dev/null +++ b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/README.md @@ -0,0 +1,83 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Branch (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Branch #Gold { + + list(string $owner, string $repo, ...) : ?array + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string +} + +note right of Branch::list + List a repository's branches. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Branch::create + Create a branch. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $branch_name + string $old_branch +end note + +note right of Branch::get + Retrieve a specific branch from a repository, including its effective branch protection. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $branch +end note + +note right of Branch::delete + Delete a specific branch from a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $branch +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.php b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.php new file mode 100644 index 0000000..0936bbe --- /dev/null +++ b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.php @@ -0,0 +1,148 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Branch + * + * @since 3.2.0 + */ +class Branch extends Api +{ + /** + * List a repository's branches. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a branch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branch_name The name of the new branch. + * @param string $old_branch The name of the existing branch from which to create the new branch. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $branch_name, + string $old_branch + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches"; + + // Set the branch data. + $data = new \stdClass(); + $data->branch_name = $branch_name; + $data->old_branch = $old_branch; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Retrieve a specific branch from a repository, including its effective branch protection. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branch The branch name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $branch): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches/{$branch}"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('branch', $branch); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a specific branch from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branch The branch name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $branch + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches/{$branch}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.power b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.power new file mode 100644 index 0000000..1aa00d1 --- /dev/null +++ b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/code.power @@ -0,0 +1,121 @@ + /** + * List a repository's branches. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a branch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branch_name The name of the new branch. + * @param string $old_branch The name of the existing branch from which to create the new branch. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $branch_name, + string $old_branch + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches"; + + // Set the branch data. + $data = new \stdClass(); + $data->branch_name = $branch_name; + $data->old_branch = $old_branch; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Retrieve a specific branch from a repository, including its effective branch protection. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branch The branch name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $branch): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches/{$branch}"; + + // Set the required variables to the URI. + $uri = $this->uri->get($path); + $uri->setVar('owner', $owner); + $uri->setVar('repo', $repo); + $uri->setVar('branch', $branch); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a specific branch from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $branch The branch name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $branch + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/branches/{$branch}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/settings.json b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/settings.json new file mode 100644 index 0000000..8983451 --- /dev/null +++ b/src/8fd54ec5-d93e-445c-ae27-80b6052dbddd/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "8fd54ec5-d93e-445c-ae27-80b6052dbddd", + "implements": null, + "load_selection": null, + "name": "Branch", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Branch", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Branch", + "description": "The Gitea Repository Branch\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/README.md b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/README.md new file mode 100644 index 0000000..83ac0d2 --- /dev/null +++ b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/README.md @@ -0,0 +1,73 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Watchers (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Watchers #Gold { + + list(string $ownerName, string $repoName, ...) : ?array + + check(string $ownerName, string $repoName) : ?object + + watch(string $ownerName, string $repoName, ...) : ?object + + unwatch(string $ownerName, string $repoName) : string +} + +note right of Watchers::list + List a repo's watchers. + + since: 3.2.0 + return: ?array + + arguments: + string $ownerName + string $repoName + int $page = 1 + int $limit = 10 +end note + +note right of Watchers::check + Check if the current user is watching a repo. + + since: 3.2.0 + return: ?object +end note + +note right of Watchers::watch + Watch a repo. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + bool $subscribed = true + bool $ignored = false +end note + +note right of Watchers::unwatch + Unwatch a repo. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.php b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.php new file mode 100644 index 0000000..131482a --- /dev/null +++ b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.php @@ -0,0 +1,140 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Watchers + * + * @since 3.2.0 + */ +class Watchers extends Api +{ + /** + * List a repo's watchers. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscribers"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Set the page and limit query parameters. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if the current user is watching a repo. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function check(string $ownerName, string $repoName): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscription"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Watch a repo. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param bool $subscribed Determine if notifications should be received from this repository. + * @param bool $ignored Determine if all notifications should be blocked from this repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function watch( + string $ownerName, + string $repoName, + bool $subscribed = true, + bool $ignored = false + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscription"; + + // Set the subscription data + $data = new \stdClass(); + $data->subscribed = $subscribed; + $data->ignored = $ignored; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Unwatch a repo. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function unwatch(string $ownerName, string $repoName): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscription"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + +} + diff --git a/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.power b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.power new file mode 100644 index 0000000..c4c0a78 --- /dev/null +++ b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/code.power @@ -0,0 +1,113 @@ + /** + * List a repo's watchers. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscribers"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Set the page and limit query parameters. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if the current user is watching a repo. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function check(string $ownerName, string $repoName): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscription"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Watch a repo. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param bool $subscribed Determine if notifications should be received from this repository. + * @param bool $ignored Determine if all notifications should be blocked from this repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function watch( + string $ownerName, + string $repoName, + bool $subscribed = true, + bool $ignored = false + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscription"; + + // Set the subscription data + $data = new \stdClass(); + $data->subscribed = $subscribed; + $data->ignored = $ignored; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Unwatch a repo. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function unwatch(string $ownerName, string $repoName): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/subscription"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } diff --git a/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/settings.json b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/settings.json new file mode 100644 index 0000000..e4b74c9 --- /dev/null +++ b/src/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7", + "implements": null, + "load_selection": null, + "name": "Watchers", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Watchers", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Watchers", + "description": "The Gitea Repository Watchers\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/README.md b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/README.md new file mode 100644 index 0000000..1cbe3b4 --- /dev/null +++ b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Gpg (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Gpg #Gold { + + get(string $ownerName, string $repoName) : string +} + +note right of Gpg::get + Get signing-key.gpg for a given repository. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.php b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.php new file mode 100644 index 0000000..0a6c317 --- /dev/null +++ b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.php @@ -0,0 +1,48 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Gpg + * + * @since 3.2.0 + */ +class Gpg extends Api +{ + /** + * Get signing-key.gpg for a given repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function get(string $ownerName, string $repoName): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/signing-key.gpg"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.power b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.power new file mode 100644 index 0000000..d633648 --- /dev/null +++ b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/code.power @@ -0,0 +1,21 @@ + /** + * Get signing-key.gpg for a given repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function get(string $ownerName, string $repoName): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/signing-key.gpg"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/settings.json b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/settings.json new file mode 100644 index 0000000..55a9456 --- /dev/null +++ b/src/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "93f4bc91-946d-447a-ab5a-4f76e0e1a9ce", + "implements": null, + "load_selection": null, + "name": "Gpg", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Gpg", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Gpg", + "description": "The Gitea Repository Gpg\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/README.md b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/README.md new file mode 100644 index 0000000..667e008 --- /dev/null +++ b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/README.md @@ -0,0 +1,50 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Refs (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Refs #Gold { + + list(string $owner, string $repo) : ?array + + get(string $owner, string $repo, ...) : ?array +} + +note right of Refs::list + Get specified ref or filtered repository's refs. + + since: 3.2.0 + return: ?array +end note + +note right of Refs::get + Get specified ref. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + string $ref +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.php b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.php new file mode 100644 index 0000000..6abc591 --- /dev/null +++ b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.php @@ -0,0 +1,77 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Refs + * + * @since 3.2.0 + */ +class Refs extends Api +{ + /** + * Get specified ref or filtered repository's refs. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/refs"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get specified ref. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $ref The ref name. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $ref + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/refs/{$ref}"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.power b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.power new file mode 100644 index 0000000..c215ecb --- /dev/null +++ b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/code.power @@ -0,0 +1,50 @@ + /** + * Get specified ref or filtered repository's refs. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/refs"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get specified ref. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $ref The ref name. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $ref + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/refs/{$ref}"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/settings.json b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/settings.json new file mode 100644 index 0000000..043c8b2 --- /dev/null +++ b/src/974d9e4c-beef-4c35-a3c6-92b1dd5b145d/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "974d9e4c-beef-4c35-a3c6-92b1dd5b145d", + "implements": null, + "load_selection": null, + "name": "Refs", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Refs", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Refs", + "description": "The Gitea Repository Refs\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/README.md b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/README.md new file mode 100644 index 0000000..eae4e67 --- /dev/null +++ b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/README.md @@ -0,0 +1,49 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Remote (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Remote #Gold { + + migrate(string $cloneAddr, string $repoName, ...) : ?object +} + +note right of Remote::migrate + Migrate a remote git repository. + + since: 3.2.0 + return: ?object + + arguments: + string $cloneAddr + string $repoName + string $repoOwner + string $uid + string $description = '' + bool $private = false + ?string $authToken = null + ?string $authUsername = null + ?string $authPassword = null + array $options = [] +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.php b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.php new file mode 100644 index 0000000..f1bf114 --- /dev/null +++ b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.php @@ -0,0 +1,96 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Remote + * + * @since 3.2.0 + */ +class Remote extends Api +{ + /** + * Migrate a remote git repository. + * + * @param string $cloneAddr The URL to clone the repository from. + * @param string $repoName The desired name for the new repository. + * @param string $repoOwner The name of the user or organization who will own the repo after migration. + * @param string $uid The ID of the user that will own the new repository (deprecated). + * @param string $description The description for the new repository (optional). + * @param bool $private Set the repository to private (optional, default false). + * @param string|null $authToken Authentication token (optional). + * @param string|null $authUsername Authentication username (optional). + * @param string|null $authPassword Authentication password (optional). + * @param array $options Additional migration options (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function migrate( + string $cloneAddr, + string $repoName, + string $repoOwner, + string $uid, + string $description = '', + bool $private = false, + ?string $authToken = null, + ?string $authUsername = null, + ?string $authPassword = null, + array $options = [] + ): ?object + { + // Build the request path. + $path = "/repos/migrate"; + + // Set the repository migration data. + $data = new \stdClass(); + $data->cloneAddr = $cloneAddr; + $data->repoName = $repoName; + $data->repoOwner = $repoOwner; + $data->uid = $uid; + $data->description = $description; + $data->private = $private; + + if ($authToken !== null) + { + $data->authToken = $authToken; + } + + if ($authUsername !== null) + { + $data->authUsername = $authUsername; + } + + if ($authPassword !== null) + { + $data->authPassword = $authPassword; + } + + foreach ($options as $key => $val) + { + $data->{$key} = $val; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.power b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.power new file mode 100644 index 0000000..4ab1425 --- /dev/null +++ b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/code.power @@ -0,0 +1,69 @@ + /** + * Migrate a remote git repository. + * + * @param string $cloneAddr The URL to clone the repository from. + * @param string $repoName The desired name for the new repository. + * @param string $repoOwner The name of the user or organization who will own the repo after migration. + * @param string $uid The ID of the user that will own the new repository (deprecated). + * @param string $description The description for the new repository (optional). + * @param bool $private Set the repository to private (optional, default false). + * @param string|null $authToken Authentication token (optional). + * @param string|null $authUsername Authentication username (optional). + * @param string|null $authPassword Authentication password (optional). + * @param array $options Additional migration options (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function migrate( + string $cloneAddr, + string $repoName, + string $repoOwner, + string $uid, + string $description = '', + bool $private = false, + ?string $authToken = null, + ?string $authUsername = null, + ?string $authPassword = null, + array $options = [] + ): ?object + { + // Build the request path. + $path = "/repos/migrate"; + + // Set the repository migration data. + $data = new \stdClass(); + $data->cloneAddr = $cloneAddr; + $data->repoName = $repoName; + $data->repoOwner = $repoOwner; + $data->uid = $uid; + $data->description = $description; + $data->private = $private; + + if ($authToken !== null) + { + $data->authToken = $authToken; + } + + if ($authUsername !== null) + { + $data->authUsername = $authUsername; + } + + if ($authPassword !== null) + { + $data->authPassword = $authPassword; + } + + foreach ($options as $key => $val) + { + $data->{$key} = $val; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } diff --git a/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/settings.json b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/settings.json new file mode 100644 index 0000000..bf2eede --- /dev/null +++ b/src/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd", + "implements": null, + "load_selection": null, + "name": "Remote", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Remote", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Remote", + "description": "The Gitea Repository Remote\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/README.md b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/README.md new file mode 100644 index 0000000..ce2d14c --- /dev/null +++ b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Activitypub (Details) +> namespace: **VDM\Joomla\Gitea\Miscellaneous** +```uml +@startuml +class Activitypub #Gold { + + get(string $username) : ?object + + send(string $username, object $postData) : string +} + +note right of Activitypub::get + Returns the Person actor for a user. + + since: 3.2.0 + return: ?object +end note + +note right of Activitypub::send + Send to the user's inbox. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.php b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.php new file mode 100644 index 0000000..78c6d27 --- /dev/null +++ b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.php @@ -0,0 +1,69 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Miscellaneous; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Miscellaneous Activitypub + * + * @since 3.2.0 + */ +class Activitypub extends Api +{ + /** + * Returns the Person actor for a user. + * + * @param string $username The user's username. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $username): ?object + { + // Build the request path. + $path = "/activitypub/user/{$username}"; + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Send to the user's inbox. + * + * @param string $username The user's username. + * @param object $postData The post data. + * + * @return string + * @since 3.2.0 + **/ + public function send(string $username, object $postData): string + { + // Build the request path. + $path = "/activitypub/user/{$username}/inbox"; + + // Send the POST request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($postData) + ), 204, 'success' + ); + } + +} + diff --git a/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.power b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.power new file mode 100644 index 0000000..d7c7316 --- /dev/null +++ b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/code.power @@ -0,0 +1,42 @@ + /** + * Returns the Person actor for a user. + * + * @param string $username The user's username. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $username): ?object + { + // Build the request path. + $path = "/activitypub/user/{$username}"; + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Send to the user's inbox. + * + * @param string $username The user's username. + * @param object $postData The post data. + * + * @return string + * @since 3.2.0 + **/ + public function send(string $username, object $postData): string + { + // Build the request path. + $path = "/activitypub/user/{$username}/inbox"; + + // Send the POST request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($postData) + ), 204, 'success' + ); + } diff --git a/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/settings.json b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/settings.json new file mode 100644 index 0000000..b0c3480 --- /dev/null +++ b/src/9ae44ddd-9d69-4298-a50b-05129cbebb76/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "9ae44ddd-9d69-4298-a50b-05129cbebb76", + "implements": null, + "load_selection": null, + "name": "Activitypub", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Miscellaneous.Activitypub", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous.Activitypub", + "description": "The Gitea Miscellaneous Activitypub\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/README.md b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/README.md new file mode 100644 index 0000000..21624e1 --- /dev/null +++ b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/README.md @@ -0,0 +1,110 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Teams (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class Teams #Gold { + + list(string $organization, int $pageNumber = 1, ...) : ?array + + get(int $id) : ?object + + create(string $organization, string $name, ...) : ?object + + search(string $organization, string $keywords, ...) : ?object + + delete(int $id) : string + + edit(int $teamId, ?string $teamName = null, ...) : ?object +} + +note right of Teams::list + List an organization's teams. + + since: 3.2.0 + return: ?array + + arguments: + string $organization + int $pageNumber = 1 + int $pageSize = 10 +end note + +note right of Teams::get + Get a team. + + since: 3.2.0 + return: ?object +end note + +note right of Teams::create + Create a team. + + since: 3.2.0 + return: ?object + + arguments: + string $organization + string $name + string $description + array $repoNames = [] + string $permission = 'read' + array $units = [] + array $unitsMap = [] + bool $canCreateOrgRepo = null + bool $includesAllRepositories = null +end note + +note right of Teams::search + Search for teams within an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $organization + string $keywords + bool $includeDesc = true + int $page = 1 + int $limit = 10 +end note + +note right of Teams::delete + Delete a team. + + since: 3.2.0 + return: string +end note + +note right of Teams::edit + Edit a team. + + since: 3.2.0 + return: ?object + + arguments: + int $teamId + ?string $teamName = null + ?string $teamDescription = null + ?string $teamPermission = null + ?bool $canCreateOrgRepo = null + ?bool $includesAllRepositories = null + ?array $units = null + ?array $unitsMap = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.php b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.php new file mode 100644 index 0000000..46a27b0 --- /dev/null +++ b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.php @@ -0,0 +1,274 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Teams + * + * @since 3.2.0 + */ +class Teams extends Api +{ + /** + * List an organization's teams. + * + * @param string $organization The organization name. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $organization, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$organization}/teams"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a team. + * + * @param int $id The team ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/teams/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create a team. + * + * @param string $organization The organization name. + * @param string $name The name of the team. + * @param string $description The description of the team. + * @param array $repoNames An array of repository names for the team (optional). + * @param string $permission The team's permission level (optional). + * @param array $units Units for the team (optional). + * @param array $unitsMap Units map for the team (optional). + * @param bool $canCreateOrgRepo Can create organization repository flag (optional). + * @param bool $includesAllRepositories Includes all repositories flag (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $organization, + string $name, + string $description, + array $repoNames = [], + string $permission = 'read', + array $units = [], + array $unitsMap = [], + bool $canCreateOrgRepo = null, + bool $includesAllRepositories = null + ): ?object + { + // Build the request path. + $path = "/orgs/{$organization}/teams"; + + // Set the team data. + $data = new \stdClass(); + $data->name = $name; + $data->description = $description; + $data->permission = $permission; + + if (!empty($repoNames)) + { + $data->repo_names = $repoNames; + } + + if (!empty($units)) + { + $data->units = $units; + } + + if (!empty($unitsMap)) + { + $data->units_map = (object)$unitsMap; + } + + if ($canCreateOrgRepo !== null) + { + $data->can_create_org_repo = $canCreateOrgRepo; + } + + if ($includesAllRepositories !== null) + { + $data->includes_all_repositories = $includesAllRepositories; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Search for teams within an organization. + * + * @param string $organization The organization name. + * @param string $keywords The search keywords. + * @param bool $includeDesc Include search within team description (defaults to true). + * @param int $page The page number. + * @param int $limit The number of results per page. + * + * @return object|null + * @since 3.2.0 + **/ + public function search( + string $organization, + string $keywords, + bool $includeDesc = true, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = "/orgs/{$organization}/teams/search"; + + // Configure the request URI. + $uri = $this->uri->get($path); + $uri->setVar('q', $keywords); + $uri->setVar('include_desc', $includeDesc); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a team. + * + * @param int $id The team ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(int $id): string + { + // Build the request path. + $path = "/teams/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a team. + * + * @param int $teamId The team ID. + * @param string|null $teamName The team name (optional). + * @param string|null $teamDescription The team description (optional). + * @param string|null $teamPermission The team's permission level (optional). + * @param bool|null $canCreateOrgRepo Can team create organization repositories (optional). + * @param bool|null $includesAllRepositories Include all repositories (optional). + * @param array|null $units List of units (optional). + * @param array|null $unitsMap Units map (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + int $teamId, + ?string $teamName = null, + ?string $teamDescription = null, + ?string $teamPermission = null, + ?bool $canCreateOrgRepo = null, + ?bool $includesAllRepositories = null, + ?array $units = null, + ?array $unitsMap = null + ): ?object + { + // Build the request path. + $path = "/teams/{$teamId}"; + + // Set the team data. + $data = new \stdClass(); + if ($teamName !== null) + { + $data->name = $teamName; + } + if ($teamDescription !== null) + { + $data->description = $teamDescription; + } + if ($teamPermission !== null) + { + $data->permission = $teamPermission; + } + if ($canCreateOrgRepo !== null) + { + $data->can_create_org_repo = $canCreateOrgRepo; + } + if ($includesAllRepositories !== null) + { + $data->includes_all_repositories = $includesAllRepositories; + } + if ($units !== null) + { + $data->units = $units; + } + if ($unitsMap !== null) + { + $data->units_map = $unitsMap; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.power b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.power new file mode 100644 index 0000000..2f1d925 --- /dev/null +++ b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/code.power @@ -0,0 +1,247 @@ + /** + * List an organization's teams. + * + * @param string $organization The organization name. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $organization, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$organization}/teams"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a team. + * + * @param int $id The team ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/teams/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create a team. + * + * @param string $organization The organization name. + * @param string $name The name of the team. + * @param string $description The description of the team. + * @param array $repoNames An array of repository names for the team (optional). + * @param string $permission The team's permission level (optional). + * @param array $units Units for the team (optional). + * @param array $unitsMap Units map for the team (optional). + * @param bool $canCreateOrgRepo Can create organization repository flag (optional). + * @param bool $includesAllRepositories Includes all repositories flag (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $organization, + string $name, + string $description, + array $repoNames = [], + string $permission = 'read', + array $units = [], + array $unitsMap = [], + bool $canCreateOrgRepo = null, + bool $includesAllRepositories = null + ): ?object + { + // Build the request path. + $path = "/orgs/{$organization}/teams"; + + // Set the team data. + $data = new \stdClass(); + $data->name = $name; + $data->description = $description; + $data->permission = $permission; + + if (!empty($repoNames)) + { + $data->repo_names = $repoNames; + } + + if (!empty($units)) + { + $data->units = $units; + } + + if (!empty($unitsMap)) + { + $data->units_map = (object)$unitsMap; + } + + if ($canCreateOrgRepo !== null) + { + $data->can_create_org_repo = $canCreateOrgRepo; + } + + if ($includesAllRepositories !== null) + { + $data->includes_all_repositories = $includesAllRepositories; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Search for teams within an organization. + * + * @param string $organization The organization name. + * @param string $keywords The search keywords. + * @param bool $includeDesc Include search within team description (defaults to true). + * @param int $page The page number. + * @param int $limit The number of results per page. + * + * @return object|null + * @since 3.2.0 + **/ + public function search( + string $organization, + string $keywords, + bool $includeDesc = true, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = "/orgs/{$organization}/teams/search"; + + // Configure the request URI. + $uri = $this->uri->get($path); + $uri->setVar('q', $keywords); + $uri->setVar('include_desc', $includeDesc); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a team. + * + * @param int $id The team ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(int $id): string + { + // Build the request path. + $path = "/teams/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a team. + * + * @param int $teamId The team ID. + * @param string|null $teamName The team name (optional). + * @param string|null $teamDescription The team description (optional). + * @param string|null $teamPermission The team's permission level (optional). + * @param bool|null $canCreateOrgRepo Can team create organization repositories (optional). + * @param bool|null $includesAllRepositories Include all repositories (optional). + * @param array|null $units List of units (optional). + * @param array|null $unitsMap Units map (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + int $teamId, + ?string $teamName = null, + ?string $teamDescription = null, + ?string $teamPermission = null, + ?bool $canCreateOrgRepo = null, + ?bool $includesAllRepositories = null, + ?array $units = null, + ?array $unitsMap = null + ): ?object + { + // Build the request path. + $path = "/teams/{$teamId}"; + + // Set the team data. + $data = new \stdClass(); + if ($teamName !== null) + { + $data->name = $teamName; + } + if ($teamDescription !== null) + { + $data->description = $teamDescription; + } + if ($teamPermission !== null) + { + $data->permission = $teamPermission; + } + if ($canCreateOrgRepo !== null) + { + $data->can_create_org_repo = $canCreateOrgRepo; + } + if ($includesAllRepositories !== null) + { + $data->includes_all_repositories = $includesAllRepositories; + } + if ($units !== null) + { + $data->units = $units; + } + if ($unitsMap !== null) + { + $data->units_map = $unitsMap; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/settings.json b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/settings.json new file mode 100644 index 0000000..5451241 --- /dev/null +++ b/src/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3", + "implements": null, + "load_selection": null, + "name": "Teams", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Teams", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Teams", + "description": "The Gitea Organization Teams\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/README.md b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/README.md new file mode 100644 index 0000000..c73af6d --- /dev/null +++ b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/README.md @@ -0,0 +1,87 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Labels (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class Labels #Gold { + + list(string $orgName, int $pageNum = 1, ...) : ?array + + create(string $org, string $name, ...) : ?object + + get(string $org, int $id) : ?object + + delete(string $org, int $id) : string + + update(string $org, int $id, ...) : ?object +} + +note right of Labels::list + List an organization's labels. + + since: 3.2.0 + return: ?array + + arguments: + string $orgName + int $pageNum = 1 + int $pageSize = 10 +end note + +note right of Labels::create + Create a label for an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $org + string $name + string $color + string $description = '' +end note + +note right of Labels::get + Get a single label for an organization. + + since: 3.2.0 + return: ?object +end note + +note right of Labels::delete + Delete a label for an organization. + + since: 3.2.0 + return: string +end note + +note right of Labels::update + Update a label for an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $org + int $id + string $name = '' + string $color = '' + string $description = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.php b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.php new file mode 100644 index 0000000..0836501 --- /dev/null +++ b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.php @@ -0,0 +1,183 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Labels + * + * @since 3.2.0 + */ +class Labels extends Api +{ + /** + * List an organization's labels. + * + * @param string $orgName The organization name. + * @param int $pageNum Page number of results to return (1-based). + * @param int $pageSize Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $orgName, + int $pageNum = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/labels"; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $pageNum); + $url->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Create a label for an organization. + * + * @param string $org The organization name. + * @param string $name The name of the label. + * @param string $color The color of the label. + * @param string $description Optional. The description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $org, + string $name, + string $color, + string $description = '' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + $data->name = $name; + $data->color = $color; + $data->description = $description; + + // Build the request path. + $path = "/orgs/{$org}/labels"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a single label for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $org, int $id): ?object + { + // Build the request path. + $path = "/orgs/{$org}/labels/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a label for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the label. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $org, int $id): string + { + // Build the request path. + $path = "/orgs/{$org}/labels/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a label for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the label. + * @param string $name Optional. The name of the label. + * @param string $color Optional. The color of the label. + * @param string $description Optional. The description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $org, + int $id, + string $name = '', + string $color = '', + string $description = '' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + if ($name) { + $data->name = $name; + } + + if ($color) { + $data->color = $color; + } + + if ($description) { + $data->description = $description; + } + + // Build the request path. + $path = "/orgs/{$org}/labels/{$id}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + +} + diff --git a/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.power b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.power new file mode 100644 index 0000000..86baae9 --- /dev/null +++ b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/code.power @@ -0,0 +1,156 @@ + /** + * List an organization's labels. + * + * @param string $orgName The organization name. + * @param int $pageNum Page number of results to return (1-based). + * @param int $pageSize Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $orgName, + int $pageNum = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/labels"; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $pageNum); + $url->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Create a label for an organization. + * + * @param string $org The organization name. + * @param string $name The name of the label. + * @param string $color The color of the label. + * @param string $description Optional. The description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $org, + string $name, + string $color, + string $description = '' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + $data->name = $name; + $data->color = $color; + $data->description = $description; + + // Build the request path. + $path = "/orgs/{$org}/labels"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a single label for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $org, int $id): ?object + { + // Build the request path. + $path = "/orgs/{$org}/labels/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a label for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the label. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $org, int $id): string + { + // Build the request path. + $path = "/orgs/{$org}/labels/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a label for an organization. + * + * @param string $org The organization name. + * @param int $id The ID of the label. + * @param string $name Optional. The name of the label. + * @param string $color Optional. The color of the label. + * @param string $description Optional. The description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $org, + int $id, + string $name = '', + string $color = '', + string $description = '' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + if ($name) { + $data->name = $name; + } + + if ($color) { + $data->color = $color; + } + + if ($description) { + $data->description = $description; + } + + // Build the request path. + $path = "/orgs/{$org}/labels/{$id}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } diff --git a/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/settings.json b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/settings.json new file mode 100644 index 0000000..df9e5f6 --- /dev/null +++ b/src/9c9ba4c4-2039-4396-9ea2-621e42e04c89/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "9c9ba4c4-2039-4396-9ea2-621e42e04c89", + "implements": null, + "load_selection": null, + "name": "Labels", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Labels", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Labels", + "description": "The Gitea Organization Labels\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/README.md b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/README.md new file mode 100644 index 0000000..f7fefbe --- /dev/null +++ b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Git (Details) +> namespace: **VDM\Joomla\Gitea\Repository\Hooks** +```uml +@startuml +class Git #Gold { + + list(string $ownerName, string $repoName) : ?array + + get(string $ownerName, string $repoName, ...) : ?object + + delete(string $ownerName, string $repositoryName, ...) : string + + edit(string $owner, string $repo, ...) : ?object +} + +note right of Git::list + List the Git hooks in a repository. + + since: 3.2.0 + return: ?array +end note + +note right of Git::get + Get a Git hook. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerName + string $repoName + int $hookId +end note + +note right of Git::delete + Delete a Git hook in a repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repositoryName + string $hookId +end note + +note right of Git::edit + Edit a Git hook in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $hookId + array $hookOptions +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.php b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.php new file mode 100644 index 0000000..0b0a849 --- /dev/null +++ b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.php @@ -0,0 +1,137 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository\Hooks; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Hooks Git + * + * @since 3.2.0 + */ +class Git extends Api +{ + /** + * List the Git hooks in a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $ownerName, string $repoName): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/hooks/git"; + + // Get the URI object with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a Git hook. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $hookId The Git hook ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $ownerName, + string $repoName, + int $hookId + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/hooks/git/{$hookId}"; + + // Get the URI object with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a Git hook in a repository. + * + * @param string $ownerName The owner name. + * @param string $repositoryName The repository name. + * @param string $hookId The Git hook ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repositoryName, + string $hookId + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repositoryName}/hooks/git/{$hookId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a Git hook in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $hookId The Git hook ID. + * @param array $hookOptions The hook configuration. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + string $hookId, + array $hookOptions + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/git/{$hookId}"; + + // Set the hook data. + $data = new \stdClass(); + $data->config = (object) $hookOptions; + + // Send the PATCH request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.power b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.power new file mode 100644 index 0000000..c60e5c6 --- /dev/null +++ b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/code.power @@ -0,0 +1,110 @@ + /** + * List the Git hooks in a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $ownerName, string $repoName): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/hooks/git"; + + // Get the URI object with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a Git hook. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param int $hookId The Git hook ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $ownerName, + string $repoName, + int $hookId + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/hooks/git/{$hookId}"; + + // Get the URI object with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Delete a Git hook in a repository. + * + * @param string $ownerName The owner name. + * @param string $repositoryName The repository name. + * @param string $hookId The Git hook ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repositoryName, + string $hookId + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repositoryName}/hooks/git/{$hookId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a Git hook in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $hookId The Git hook ID. + * @param array $hookOptions The hook configuration. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + string $hookId, + array $hookOptions + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/hooks/git/{$hookId}"; + + // Set the hook data. + $data = new \stdClass(); + $data->config = (object) $hookOptions; + + // Send the PATCH request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/settings.json b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/settings.json new file mode 100644 index 0000000..c527047 --- /dev/null +++ b/src/a11cacb2-c13a-4482-bf71-1b7d99574a98/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "a11cacb2-c13a-4482-bf71-1b7d99574a98", + "implements": null, + "load_selection": null, + "name": "Git", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Hooks.Git", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Hooks.Git", + "description": "The Gitea Repository Hooks Git\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/README.md b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/README.md new file mode 100644 index 0000000..69012bd --- /dev/null +++ b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/README.md @@ -0,0 +1,68 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Stopwatch (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Stopwatch #Gold { + + start(string $owner, string $repo, ...) : string + + stop(string $owner, string $repo, ...) : string + + delete(string $owner, string $repo, ...) : string +} + +note right of Stopwatch::start + Start stopwatch on an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +note right of Stopwatch::stop + Stop an issue's existing stopwatch. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +note right of Stopwatch::delete + Delete an issue's existing stopwatch. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.php b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.php new file mode 100644 index 0000000..6745416 --- /dev/null +++ b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.php @@ -0,0 +1,95 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Stopwatch + * + * @since 3.2.0 + */ +class Stopwatch extends Api +{ + /** + * Start stopwatch on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function start(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/start"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), '' + ), 201, 'success' + ); + } + + /** + * Stop an issue's existing stopwatch. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function stop(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/stop"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), '' + ), 201, 'success' + ); + } + + /** + * Delete an issue's existing stopwatch. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/delete"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.power b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.power new file mode 100644 index 0000000..cb990b1 --- /dev/null +++ b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/code.power @@ -0,0 +1,68 @@ + /** + * Start stopwatch on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function start(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/start"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), '' + ), 201, 'success' + ); + } + + /** + * Stop an issue's existing stopwatch. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function stop(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/stop"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), '' + ), 201, 'success' + ); + } + + /** + * Delete an issue's existing stopwatch. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/delete"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/settings.json b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/settings.json new file mode 100644 index 0000000..3a3fbdd --- /dev/null +++ b/src/a68d1841-65bb-41c8-ac09-cfddf73bb822/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "a68d1841-65bb-41c8-ac09-cfddf73bb822", + "implements": null, + "load_selection": null, + "name": "Stopwatch", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Stopwatch", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Stopwatch", + "description": "The Gitea Issue Stopwatch\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/README.md b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/README.md new file mode 100644 index 0000000..814b941 --- /dev/null +++ b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/README.md @@ -0,0 +1,85 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Subscriptions (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Subscriptions #Gold { + + get(string $owner, string $repo, ...) : ?object + + check(string $owner, string $repo, ...) : ?object + + subscribe(string $owner, string $repo, ...) : string + + unsubscribe(string $owner, string $repo, ...) : string +} + +note right of Subscriptions::get + Get users who subscribed on an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + ?int $page = null + ?int $limit = null +end note + +note right of Subscriptions::check + Check if user is subscribed to an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index +end note + +note right of Subscriptions::subscribe + Subscribe user to issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + string $user +end note + +note right of Subscriptions::unsubscribe + Unsubscribe user from issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + string $user +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.php b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.php new file mode 100644 index 0000000..c29bfb6 --- /dev/null +++ b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.php @@ -0,0 +1,137 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Subscriptions + * + * @since 3.2.0 + */ +class Subscriptions extends Api +{ + /** + * Get users who subscribed on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $index, + ?int $page = null, + ?int $limit = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions"; + + // Set the query parameters. + $uri = $this->uri->get($path); + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if user is subscribed to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return object|null + * @since 3.2.0 + **/ + public function check(string $owner, string $repo, int $index): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions/check"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Subscribe user to issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $user The username to subscribe. + * + * @return string + * @since 3.2.0 + **/ + public function subscribe(string $owner, string $repo, int $index, string $user): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions/{$user}"; + + // Send the put request. + return $this->response->get_( + $this->http->put( + $this->uri->get($path), '' + ), [200 => 'already subscribed', 201 => 'success'] + ); + } + + /** + * Unsubscribe user from issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $user The username to unsubscribe. + * + * @return string + * @since 3.2.0 + **/ + public function unsubscribe(string $owner, string $repo, int $index, string $user): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions/{$user}"; + + // Send the delete request. + return $this->response->get_( + $this->http->delete( + $this->uri->get($path) + ), [200 => 'already unsubscribed', 201 => 'success'] + ); + } + +} + diff --git a/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.power b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.power new file mode 100644 index 0000000..5e178f9 --- /dev/null +++ b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/code.power @@ -0,0 +1,110 @@ + /** + * Get users who subscribed on an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + int $index, + ?int $page = null, + ?int $limit = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions"; + + // Set the query parameters. + $uri = $this->uri->get($path); + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if user is subscribed to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return object|null + * @since 3.2.0 + **/ + public function check(string $owner, string $repo, int $index): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions/check"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Subscribe user to issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $user The username to subscribe. + * + * @return string + * @since 3.2.0 + **/ + public function subscribe(string $owner, string $repo, int $index, string $user): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions/{$user}"; + + // Send the put request. + return $this->response->get_( + $this->http->put( + $this->uri->get($path), '' + ), [200 => 'already subscribed', 201 => 'success'] + ); + } + + /** + * Unsubscribe user from issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $user The username to unsubscribe. + * + * @return string + * @since 3.2.0 + **/ + public function unsubscribe(string $owner, string $repo, int $index, string $user): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/subscriptions/{$user}"; + + // Send the delete request. + return $this->response->get_( + $this->http->delete( + $this->uri->get($path) + ), [200 => 'already unsubscribed', 201 => 'success'] + ); + } diff --git a/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/settings.json b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/settings.json new file mode 100644 index 0000000..d69b40f --- /dev/null +++ b/src/acca507d-e632-4349-9e3a-9dba5d19fbf9/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "acca507d-e632-4349-9e3a-9dba5d19fbf9", + "implements": null, + "load_selection": null, + "name": "Subscriptions", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Subscriptions", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Subscriptions", + "description": "The Gitea Issue Subscriptions\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/aeb42050-90e1-4169-907a-fa6cde20caa4/README.md b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/README.md new file mode 100644 index 0000000..0f2c005 --- /dev/null +++ b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/README.md @@ -0,0 +1,64 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class Repository #Gold { + + list(string $org, int $pageNumber = 1, ...) : ?array + + create(string $org, string $repoName, ...) : ?object +} + +note right of Repository::list + List an organization's repos. + + since: 3.2.0 + return: ?array + + arguments: + string $org + int $pageNumber = 1 + int $pageSize = 10 +end note + +note right of Repository::create + Create a repository in an organization. + + since: 3.2.0 + return: ?object + + arguments: + string $org + string $repoName + ?string $description = null + ?bool $autoInit = null + ?string $defaultBranch = null + ?string $gitignores = null + ?string $issueLabels = null + ?string $license = null + ?bool $private = null + ?string $readme = null + ?bool $template = null + ?string $trustModel = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.php b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.php new file mode 100644 index 0000000..18c5384 --- /dev/null +++ b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.php @@ -0,0 +1,145 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Repository + * + * @since 3.2.0 + */ +class Repository extends Api +{ + /** + * List an organization's repos. + * + * @param string $org The organization name. + * @param int $pageNumber The page number. + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $org, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$org}/repos"; + + // Configure the request URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a repository in an organization. + * + * @param string $org The organization name. + * @param string $repoName The name of the repository. + * @param string|null $description The description of the repository (optional). + * @param bool|null $autoInit Whether the repository should be auto-initialized (optional). + * @param string|null $defaultBranch Default branch of the repository (optional). + * @param string|null $gitignores Gitignores to use (optional). + * @param string|null $issueLabels Label-set to use (optional). + * @param string|null $license License to use (optional). + * @param bool|null $private Whether the repository is private (optional). + * @param string|null $readme Readme of the repository to create (optional). + * @param bool|null $template Whether the repository is a template (optional). + * @param string|null $trustModel Trust model of the repository (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $org, + string $repoName, + ?string $description = null, + ?bool $autoInit = null, + ?string $defaultBranch = null, + ?string $gitignores = null, + ?string $issueLabels = null, + ?string $license = null, + ?bool $private = null, + ?string $readme = null, + ?bool $template = null, + ?string $trustModel = null + ): ?object + { + // Build the request path. + $path = "/orgs/{$org}/repos"; + + // Set the repository data. + $data = new \stdClass(); + $data->name = $repoName; + if ($description !== null) + { + $data->description = $description; + } + if ($autoInit !== null) + { + $data->auto_init = $autoInit; + } + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + if ($gitignores !== null) + { + $data->gitignores = $gitignores; + } + if ($issueLabels !== null) + { + $data->issue_labels = $issueLabels; + } + if ($license !== null) + { + $data->license = $license; + } + if ($private !== null) + { + $data->private = $private; + } + if ($readme !== null) + { + $data->readme = $readme; + } + if ($template !== null) + { + $data->template = $template; + } + if ($trustModel !== null) + { + $data->trust_model = $trustModel; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.power b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.power new file mode 100644 index 0000000..7539e69 --- /dev/null +++ b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/code.power @@ -0,0 +1,118 @@ + /** + * List an organization's repos. + * + * @param string $org The organization name. + * @param int $pageNumber The page number. + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $org, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$org}/repos"; + + // Configure the request URI. + $uri = $this->uri->get($path); + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a repository in an organization. + * + * @param string $org The organization name. + * @param string $repoName The name of the repository. + * @param string|null $description The description of the repository (optional). + * @param bool|null $autoInit Whether the repository should be auto-initialized (optional). + * @param string|null $defaultBranch Default branch of the repository (optional). + * @param string|null $gitignores Gitignores to use (optional). + * @param string|null $issueLabels Label-set to use (optional). + * @param string|null $license License to use (optional). + * @param bool|null $private Whether the repository is private (optional). + * @param string|null $readme Readme of the repository to create (optional). + * @param bool|null $template Whether the repository is a template (optional). + * @param string|null $trustModel Trust model of the repository (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $org, + string $repoName, + ?string $description = null, + ?bool $autoInit = null, + ?string $defaultBranch = null, + ?string $gitignores = null, + ?string $issueLabels = null, + ?string $license = null, + ?bool $private = null, + ?string $readme = null, + ?bool $template = null, + ?string $trustModel = null + ): ?object + { + // Build the request path. + $path = "/orgs/{$org}/repos"; + + // Set the repository data. + $data = new \stdClass(); + $data->name = $repoName; + if ($description !== null) + { + $data->description = $description; + } + if ($autoInit !== null) + { + $data->auto_init = $autoInit; + } + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + if ($gitignores !== null) + { + $data->gitignores = $gitignores; + } + if ($issueLabels !== null) + { + $data->issue_labels = $issueLabels; + } + if ($license !== null) + { + $data->license = $license; + } + if ($private !== null) + { + $data->private = $private; + } + if ($readme !== null) + { + $data->readme = $readme; + } + if ($template !== null) + { + $data->template = $template; + } + if ($trustModel !== null) + { + $data->trust_model = $trustModel; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/aeb42050-90e1-4169-907a-fa6cde20caa4/settings.json b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/settings.json new file mode 100644 index 0000000..5c8dd64 --- /dev/null +++ b/src/aeb42050-90e1-4169-907a-fa6cde20caa4/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "aeb42050-90e1-4169-907a-fa6cde20caa4", + "implements": null, + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Repository", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Repository", + "description": "The Gitea Organization Repository\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/af49b450-78fb-40bd-8165-48466ebd31a9/README.md b/src/af49b450-78fb-40bd-8165-48466ebd31a9/README.md new file mode 100644 index 0000000..1ace208 --- /dev/null +++ b/src/af49b450-78fb-40bd-8165-48466ebd31a9/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Tokens (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Tokens #Gold { + + list(string $username, ?int $page = null, ...) : ?array + + create(string $username, string $name) : ?object + + delete(string $username, string $token) : string +} + +note right of Tokens::list + List the authenticated user's access tokens. + + since: 3.2.0 + return: ?array + + arguments: + string $username + ?int $page = null + ?int $limit = null +end note + +note right of Tokens::create + Create an access token for a user. + + since: 3.2.0 + return: ?object +end note + +note right of Tokens::delete + Delete an access token for a user. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/af49b450-78fb-40bd-8165-48466ebd31a9/code.php b/src/af49b450-78fb-40bd-8165-48466ebd31a9/code.php new file mode 100644 index 0000000..431ba71 --- /dev/null +++ b/src/af49b450-78fb-40bd-8165-48466ebd31a9/code.php @@ -0,0 +1,111 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Tokens + * + * @since 3.2.0 + */ +class Tokens extends Api +{ + /** + * List the authenticated user's access tokens. + * + * @param string $username The username of the authenticated user to retrieve access tokens for. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $username, + ?int $page = null, + ?int $limit = null + ): ?array + { + // Build the request path. + $path = "/users/{$username}/tokens"; + + // Build the URL + $url = $this->uri->get($path); + if ($page !== null) + { + $url->setVar('page', $page); + } + if ($limit !== null) + { + $url->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Create an access token for a user. + * + * @param string $username The username of the user to create the access token for. + * @param string $name The name of the access token. + * + * @return object|null + * @since 3.2.0 + **/ + public function create(string $username, string $name): ?object + { + // Build the request path. + $path = "/users/{$username}/tokens"; + + // Set the token data + $data = new \stdClass(); + $data->name = $name; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Delete an access token for a user. + * + * @param string $username The username of the user to delete the access token for. + * @param string $token The token to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $username, string $token): string + { + // Build the request path. + $path = "/users/{$username}/tokens/{$token}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/af49b450-78fb-40bd-8165-48466ebd31a9/code.power b/src/af49b450-78fb-40bd-8165-48466ebd31a9/code.power new file mode 100644 index 0000000..e05ae99 --- /dev/null +++ b/src/af49b450-78fb-40bd-8165-48466ebd31a9/code.power @@ -0,0 +1,84 @@ + /** + * List the authenticated user's access tokens. + * + * @param string $username The username of the authenticated user to retrieve access tokens for. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $username, + ?int $page = null, + ?int $limit = null + ): ?array + { + // Build the request path. + $path = "/users/{$username}/tokens"; + + // Build the URL + $url = $this->uri->get($path); + if ($page !== null) + { + $url->setVar('page', $page); + } + if ($limit !== null) + { + $url->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Create an access token for a user. + * + * @param string $username The username of the user to create the access token for. + * @param string $name The name of the access token. + * + * @return object|null + * @since 3.2.0 + **/ + public function create(string $username, string $name): ?object + { + // Build the request path. + $path = "/users/{$username}/tokens"; + + // Set the token data + $data = new \stdClass(); + $data->name = $name; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Delete an access token for a user. + * + * @param string $username The username of the user to delete the access token for. + * @param string $token The token to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $username, string $token): string + { + // Build the request path. + $path = "/users/{$username}/tokens/{$token}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/af49b450-78fb-40bd-8165-48466ebd31a9/settings.json b/src/af49b450-78fb-40bd-8165-48466ebd31a9/settings.json new file mode 100644 index 0000000..b2dc0cf --- /dev/null +++ b/src/af49b450-78fb-40bd-8165-48466ebd31a9/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "af49b450-78fb-40bd-8165-48466ebd31a9", + "implements": null, + "load_selection": null, + "name": "Tokens", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Tokens", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Tokens", + "description": "The Gitea User Tokens\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/af4b8b77-d773-42a7-9f54-19de463bc49b/README.md b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/README.md new file mode 100644 index 0000000..8a6ab46 --- /dev/null +++ b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Emails (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Emails #Gold { + + list() : ?array + + add(array $emails) : ?array + + delete(array $emails) : string +} + +note right of Emails::list + List the authenticated user's email addresses. + + since: 3.2.0 + return: ?array +end note + +note right of Emails::add + Add email addresses for the authenticated user. + + since: 3.2.0 + return: ?array +end note + +note right of Emails::delete + Delete email addresses for the authenticated user. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.php b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.php new file mode 100644 index 0000000..aa63b28 --- /dev/null +++ b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.php @@ -0,0 +1,94 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Emails + * + * @since 3.2.0 + */ +class Emails extends Api +{ + /** + * List the authenticated user's email addresses. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(): ?array + { + // Build the request path. + $path = '/user/emails'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add email addresses for the authenticated user. + * + * @param array $emails An array of email addresses to add. + * + * @return array|null + * @since 3.2.0 + **/ + public function add(array $emails): ?array + { + // Build the request path. + $path = '/user/emails'; + + // Create the request body. + $body = new \stdClass(); + $body->emails = $emails; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($body) + ), 201 + ); + } + + /** + * Delete email addresses for the authenticated user. + * + * @param array $$emails An array of email addresses to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(array $emails): string + { + // Build the request path. + $path = '/user/emails'; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('emails', json_encode($emails)); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } + +} + diff --git a/src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.power b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.power new file mode 100644 index 0000000..9f2071d --- /dev/null +++ b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/code.power @@ -0,0 +1,67 @@ + /** + * List the authenticated user's email addresses. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(): ?array + { + // Build the request path. + $path = '/user/emails'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add email addresses for the authenticated user. + * + * @param array $emails An array of email addresses to add. + * + * @return array|null + * @since 3.2.0 + **/ + public function add(array $emails): ?array + { + // Build the request path. + $path = '/user/emails'; + + // Create the request body. + $body = new \stdClass(); + $body->emails = $emails; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($body) + ), 201 + ); + } + + /** + * Delete email addresses for the authenticated user. + * + * @param array $$emails An array of email addresses to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(array $emails): string + { + // Build the request path. + $path = '/user/emails'; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('emails', json_encode($emails)); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 204, 'success' + ); + } diff --git a/src/af4b8b77-d773-42a7-9f54-19de463bc49b/settings.json b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/settings.json new file mode 100644 index 0000000..3ef1ab1 --- /dev/null +++ b/src/af4b8b77-d773-42a7-9f54-19de463bc49b/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "af4b8b77-d773-42a7-9f54-19de463bc49b", + "implements": null, + "load_selection": null, + "name": "Emails", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Emails", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Emails", + "description": "The Gitea User Emails\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b1788488-f557-4746-9929-73e1d049b4a2/README.md b/src/b1788488-f557-4746-9929-73e1d049b4a2/README.md new file mode 100644 index 0000000..e8f0fc9 --- /dev/null +++ b/src/b1788488-f557-4746-9929-73e1d049b4a2/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Following (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Following #Gold { + + list(int $page = 1, int $limit = 10) : ?array + + check(string $username) : bool + + follow(string $username) : string + + unfollow(string $username) : string +} + +note right of Following::list + List the users that the authenticated user is following. + + since: 3.2.0 + return: ?array +end note + +note right of Following::check + Check whether a user is followed by the authenticated user. + + since: 3.2.0 + return: bool +end note + +note right of Following::follow + Follow a user. + + since: 3.2.0 + return: string +end note + +note right of Following::unfollow + Unfollow a user. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b1788488-f557-4746-9929-73e1d049b4a2/code.php b/src/b1788488-f557-4746-9929-73e1d049b4a2/code.php new file mode 100644 index 0000000..3392449 --- /dev/null +++ b/src/b1788488-f557-4746-9929-73e1d049b4a2/code.php @@ -0,0 +1,122 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Following + * + * @since 3.2.0 + */ +class Following extends Api +{ + /** + * List the users that the authenticated user is following. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/following'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Check whether a user is followed by the authenticated user. + * + * @param string $username The username to check. + * + * @return bool + * @since 3.2.0 + **/ + public function check(string $username): bool + { + // Build the request path. + $path = "/user/following/{$username}"; + + // Send the get request. + $response = $this->http->get( + $this->uri->get($path) + ); + + // Check if the user is followed by the authenticated user. + if ($response->code === 204) + { + return true; + } + return false; + } + + /** + * Follow a user. + * + * @param string $username The username to follow. + * + * @return string + * @since 3.2.0 + **/ + public function follow(string $username): string + { + // Build the request path. + $path = "/user/following/{$username}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Unfollow a user. + * + * @param string $username The username to unfollow. + * + * @return string + * @since 3.2.0 + **/ + public function unfollow(string $username): string + { + // Build the request path. + $path = "/user/following/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/b1788488-f557-4746-9929-73e1d049b4a2/code.power b/src/b1788488-f557-4746-9929-73e1d049b4a2/code.power new file mode 100644 index 0000000..2f77742 --- /dev/null +++ b/src/b1788488-f557-4746-9929-73e1d049b4a2/code.power @@ -0,0 +1,95 @@ + /** + * List the users that the authenticated user is following. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/following'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Check whether a user is followed by the authenticated user. + * + * @param string $username The username to check. + * + * @return bool + * @since 3.2.0 + **/ + public function check(string $username): bool + { + // Build the request path. + $path = "/user/following/{$username}"; + + // Send the get request. + $response = $this->http->get( + $this->uri->get($path) + ); + + // Check if the user is followed by the authenticated user. + if ($response->code === 204) + { + return true; + } + return false; + } + + /** + * Follow a user. + * + * @param string $username The username to follow. + * + * @return string + * @since 3.2.0 + **/ + public function follow(string $username): string + { + // Build the request path. + $path = "/user/following/{$username}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Unfollow a user. + * + * @param string $username The username to unfollow. + * + * @return string + * @since 3.2.0 + **/ + public function unfollow(string $username): string + { + // Build the request path. + $path = "/user/following/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/b1788488-f557-4746-9929-73e1d049b4a2/settings.json b/src/b1788488-f557-4746-9929-73e1d049b4a2/settings.json new file mode 100644 index 0000000..0dba259 --- /dev/null +++ b/src/b1788488-f557-4746-9929-73e1d049b4a2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "b1788488-f557-4746-9929-73e1d049b4a2", + "implements": null, + "load_selection": null, + "name": "Following", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Following", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Following", + "description": "The Gitea User Following\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/README.md b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/README.md new file mode 100644 index 0000000..62b3116 --- /dev/null +++ b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class User (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class User #Gold { + + list(int $pageNumber = 1, int $pageSize = 10) : ?array + + get(string $username, int $pageNumber = 1, ...) : ?array + + permissions(string $username, string $org) : ?object +} + +note right of User::list + List the current user's organizations. + + since: 3.2.0 + return: ?array +end note + +note right of User::get + List a user's organizations. + + since: 3.2.0 + return: ?array + + arguments: + string $username + int $pageNumber = 1 + int $pageSize = 10 +end note + +note right of User::permissions + Get user permissions in an organization. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.php b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.php new file mode 100644 index 0000000..b59fe9b --- /dev/null +++ b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.php @@ -0,0 +1,111 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization User + * + * @since 3.2.0 + */ +class User extends Api +{ + /** + * List the current user's organizations. + * + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/user/orgs"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List a user's organizations. + * + * @param string $username The user's username. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $username, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$username}/orgs"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get user permissions in an organization. + * + * @param string $username The user's username. + * @param string $org The organization name. + * + * @return object|null + * @since 3.2.0 + **/ + public function permissions(string $username, string $org): ?object + { + // Build the request path. + $path = "/users/{$username}/orgs/{$org}/permissions"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + +} + diff --git a/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.power b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.power new file mode 100644 index 0000000..554fb85 --- /dev/null +++ b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/code.power @@ -0,0 +1,84 @@ + /** + * List the current user's organizations. + * + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/user/orgs"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List a user's organizations. + * + * @param string $username The user's username. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $username, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/users/{$username}/orgs"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get user permissions in an organization. + * + * @param string $username The user's username. + * @param string $org The organization name. + * + * @return object|null + * @since 3.2.0 + **/ + public function permissions(string $username, string $org): ?object + { + // Build the request path. + $path = "/users/{$username}/orgs/{$org}/permissions"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + diff --git a/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/settings.json b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/settings.json new file mode 100644 index 0000000..29c8851 --- /dev/null +++ b/src/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "b3f6728b-8c88-4ee8-9aa0-bcef400a35bf", + "implements": null, + "load_selection": null, + "name": "User", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.User", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.User", + "description": "The Gitea Organization User\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/README.md b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/README.md new file mode 100644 index 0000000..ba2d10c --- /dev/null +++ b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/README.md @@ -0,0 +1,44 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Owner (Details) +> namespace: **VDM\Joomla\Gitea\Package** +```uml +@startuml +class Owner #Gold { + + get(string $owner, int $page = 1, ...) : ?array +} + +note right of Owner::get + Gets all packages of an owner. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + int $page = 1 + int $limit = 10 + ?string $type = null + ?string $nameFilter = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.php b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.php new file mode 100644 index 0000000..93960d1 --- /dev/null +++ b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.php @@ -0,0 +1,68 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Package; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Package Owner + * + * @since 3.2.0 + */ +class Owner extends Api +{ + /** + * Gets all packages of an owner. + * + * @param string $owner The owner of the packages. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * @param string|null $type Package type filter (optional). + * @param string|null $name Filter Name filter (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + int $page = 1, + int $limit = 10, + ?string $type = null, + ?string $nameFilter = null + ): ?array + { + // Build the request path. + $path = "/packages/{$owner}"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + if ($type !== null) + { + $uri->setVar('type', $type); + } + if ($nameFilter !== null) + { + $uri->setVar('q', $nameFilter); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.power b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.power new file mode 100644 index 0000000..62b9064 --- /dev/null +++ b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/code.power @@ -0,0 +1,41 @@ + /** + * Gets all packages of an owner. + * + * @param string $owner The owner of the packages. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * @param string|null $type Package type filter (optional). + * @param string|null $name Filter Name filter (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function get( + string $owner, + int $page = 1, + int $limit = 10, + ?string $type = null, + ?string $nameFilter = null + ): ?array + { + // Build the request path. + $path = "/packages/{$owner}"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + if ($type !== null) + { + $uri->setVar('type', $type); + } + if ($nameFilter !== null) + { + $uri->setVar('q', $nameFilter); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/settings.json b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/settings.json new file mode 100644 index 0000000..517e285 --- /dev/null +++ b/src/b5ca512b-f667-4ec6-bc6e-914af41d344a/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "b5ca512b-f667-4ec6-bc6e-914af41d344a", + "implements": null, + "load_selection": null, + "name": "Owner", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Package.Owner", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Package.Owner", + "description": "The Gitea Package Owner\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/README.md b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/README.md new file mode 100644 index 0000000..5d06c3e --- /dev/null +++ b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Subscriptions (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Subscriptions #Gold { + + list(int $page = 1, int $limit = 10) : ?array +} + +note right of Subscriptions::list + List repositories watched by the authenticated user. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.php b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.php new file mode 100644 index 0000000..b627803 --- /dev/null +++ b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.php @@ -0,0 +1,54 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Subscriptions + * + * @since 3.2.0 + */ +class Subscriptions extends Api +{ + /** + * List repositories watched by the authenticated user. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/subscriptions'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + +} + diff --git a/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.power b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.power new file mode 100644 index 0000000..6933b48 --- /dev/null +++ b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/code.power @@ -0,0 +1,27 @@ + /** + * List repositories watched by the authenticated user. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/subscriptions'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } diff --git a/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/settings.json b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/settings.json new file mode 100644 index 0000000..dcc44e9 --- /dev/null +++ b/src/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf", + "implements": null, + "load_selection": null, + "name": "Subscriptions", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Subscriptions", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Subscriptions", + "description": "The Gitea User Subscriptions\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/README.md b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/README.md new file mode 100644 index 0000000..72a3176 --- /dev/null +++ b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Package (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class Package #Gold { + + get(string $owner, string $type, ...) : ?object + + delete(string $owner, string $type, ...) : string +} + +note right of Package::get + Gets a package. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $type + string $name + string $version +end note + +note right of Package::delete + Delete a package. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $type + string $name + string $version +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.php b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.php new file mode 100644 index 0000000..8fb1ac2 --- /dev/null +++ b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.php @@ -0,0 +1,84 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Package + * + * @since 3.2.0 + */ +class Package extends Api +{ + /** + * Gets a package. + * + * @param string $owner The owner of the package. + * @param string $type The type of the package. + * @param string $name The name of the package. + * @param string $version The version of the package. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $type, + string $name, + string $version + ): ?object + { + // Build the request path. + $path = "/packages/{$owner}/{$type}/{$name}/{$version}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a package. + * + * @param string $owner The owner of the package. + * @param string $type The type of the package. + * @param string $name The name of the package. + * @param string $version The version of the package. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $type, + string $name, + string $version + ): string + { + // Build the request path. + $path = "/packages/{$owner}/{$type}/{$name}/{$version}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.power b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.power new file mode 100644 index 0000000..591e039 --- /dev/null +++ b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/code.power @@ -0,0 +1,57 @@ + /** + * Gets a package. + * + * @param string $owner The owner of the package. + * @param string $type The type of the package. + * @param string $name The name of the package. + * @param string $version The version of the package. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $type, + string $name, + string $version + ): ?object + { + // Build the request path. + $path = "/packages/{$owner}/{$type}/{$name}/{$version}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a package. + * + * @param string $owner The owner of the package. + * @param string $type The type of the package. + * @param string $name The name of the package. + * @param string $version The version of the package. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $type, + string $name, + string $version + ): string + { + // Build the request path. + $path = "/packages/{$owner}/{$type}/{$name}/{$version}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/settings.json b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/settings.json new file mode 100644 index 0000000..67d32db --- /dev/null +++ b/src/b7ec675d-3197-4458-89d6-ca5d4303af8a/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "b7ec675d-3197-4458-89d6-ca5d4303af8a", + "implements": null, + "load_selection": null, + "name": "Package", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Package", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Package", + "description": "The Gitea Package\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/README.md b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/README.md new file mode 100644 index 0000000..fa3783e --- /dev/null +++ b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Notifications (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Notifications #Gold { + + register(Container $container) : void + + getNotifications(Container $container) : Notifi + + getRepository(Container $container) : Repository + + getThread(Container $container) : Thread +} + +note right of Notifications::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Notifications::getNotifications + Get the Notifications class + + since: 3.2.0 + return: Notifi +end note + +note right of Notifications::getRepository + Get the Repository class + + since: 3.2.0 + return: Repository +end note + +note right of Notifications::getThread + Get the Thread class + + since: 3.2.0 + return: Thread +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.php b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.php new file mode 100644 index 0000000..b6b5a29 --- /dev/null +++ b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.php @@ -0,0 +1,101 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Notifications as Notifi; +use VDM\Joomla\Gitea\Notifications\Repository; +use VDM\Joomla\Gitea\Notifications\Thread; + + +/** + * The Gitea Notifications Service + * + * @since 3.2.0 + */ +class Notifications implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Notifi::class, 'Gitea.Notifications') + ->share('Gitea.Notifications', [$this, 'getNotifications'], true); + + $container->alias(Repository::class, 'Gitea.Notifications.Repository') + ->share('Gitea.Notifications.Repository', [$this, 'getRepository'], true); + + $container->alias(Thread::class, 'Gitea.Notifications.Thread') + ->share('Gitea.Notifications.Thread', [$this, 'getThread'], true); + } + + /** + * Get the Notifications class + * + * @param Container $container The DI container. + * + * @return Notifi + * @since 3.2.0 + */ + public function getNotifications(Container $container): Notifi + { + return new Notifi( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Thread class + * + * @param Container $container The DI container. + * + * @return Thread + * @since 3.2.0 + */ + public function getThread(Container $container): Thread + { + return new Thread( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.power b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.power new file mode 100644 index 0000000..3b74cd9 --- /dev/null +++ b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/code.power @@ -0,0 +1,70 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Notifi::class, 'Gitea.Notifications') + ->share('Gitea.Notifications', [$this, 'getNotifications'], true); + + $container->alias(Repository::class, 'Gitea.Notifications.Repository') + ->share('Gitea.Notifications.Repository', [$this, 'getRepository'], true); + + $container->alias(Thread::class, 'Gitea.Notifications.Thread') + ->share('Gitea.Notifications.Thread', [$this, 'getThread'], true); + } + + /** + * Get the Notifications class + * + * @param Container $container The DI container. + * + * @return Notifi + * @since 3.2.0 + */ + public function getNotifications(Container $container): Notifi + { + return new Notifi( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Thread class + * + * @param Container $container The DI container. + * + * @return Thread + * @since 3.2.0 + */ + public function getThread(Container $container): Thread + { + return new Thread( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/settings.json b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/settings.json new file mode 100644 index 0000000..a501243 --- /dev/null +++ b/src/be57f70f-1214-4d69-8d33-7cd4e312ff70/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "be57f70f-1214-4d69-8d33-7cd4e312ff70", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Notifications", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Notifications", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "c8cbc9bd-ee91-403a-8633-0e8b59619a49", + "as": "Notifi" + }, + "use_selection1": { + "use": "3a4ce297-4536-45be-b3cc-d93474e55528", + "as": "default" + }, + "use_selection2": { + "use": "db14e345-c3d9-4dda-8534-4963cd6ca6f5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Notifications", + "description": "The Gitea Notifications Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/c0ee5592-e49f-4937-9b13-f4352afcb430/README.md b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/README.md new file mode 100644 index 0000000..b65254b --- /dev/null +++ b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/README.md @@ -0,0 +1,43 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Media (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Media #Gold { + + get(string $owner, string $repo, ...) : string +} + +note right of Media::get + Get a file or its LFS object from a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $filepath + ?string $ref = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.php b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.php new file mode 100644 index 0000000..74ea839 --- /dev/null +++ b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Media + * + * @since 3.2.0 + */ +class Media extends Api +{ + /** + * Get a file or its LFS object from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref The name of the commit/branch/tag. (Optional) + * + * @return string + * @since 3.2.0 + */ + public function get( + string $owner, + string $repo, + string $filepath, + ?string $ref = null + ): string + { + // Build the request path. + $encodedFilepath = rawurlencode($filepath); + $path = "/repos/{$owner}/{$repo}/media/{$encodedFilepath}"; + + // Prepare the URI. + $uri = $this->uri->get($path); + + // Add the 'ref' query parameter if provided. + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the GET request. + return $this->response->get( + $this->http->get($uri), 200, 'success' + ); + } + +} + diff --git a/src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.power b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.power new file mode 100644 index 0000000..43aa7c8 --- /dev/null +++ b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/code.power @@ -0,0 +1,36 @@ + /** + * Get a file or its LFS object from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref The name of the commit/branch/tag. (Optional) + * + * @return string + * @since 3.2.0 + */ + public function get( + string $owner, + string $repo, + string $filepath, + ?string $ref = null + ): string + { + // Build the request path. + $encodedFilepath = rawurlencode($filepath); + $path = "/repos/{$owner}/{$repo}/media/{$encodedFilepath}"; + + // Prepare the URI. + $uri = $this->uri->get($path); + + // Add the 'ref' query parameter if provided. + if ($ref !== null) + { + $uri->setVar('ref', $ref); + } + + // Send the GET request. + return $this->response->get( + $this->http->get($uri), 200, 'success' + ); + } diff --git a/src/c0ee5592-e49f-4937-9b13-f4352afcb430/settings.json b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/settings.json new file mode 100644 index 0000000..588e4eb --- /dev/null +++ b/src/c0ee5592-e49f-4937-9b13-f4352afcb430/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c0ee5592-e49f-4937-9b13-f4352afcb430", + "implements": null, + "load_selection": null, + "name": "Media", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Media", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Media", + "description": "The Gitea Repository Media\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/README.md b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/README.md new file mode 100644 index 0000000..d01a53a --- /dev/null +++ b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Languages (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Languages #Gold { + + getLanguages(string $owner, string $repo) : ?object +} + +note right of Languages::getLanguages + Get languages and number of bytes of code written in a repository. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.php b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.php new file mode 100644 index 0000000..e4f4f0e --- /dev/null +++ b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.php @@ -0,0 +1,49 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Languages + * + * @since 3.2.0 + */ +class Languages extends Api +{ + /** + * Get languages and number of bytes of code written in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function getLanguages(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/languages"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.power b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.power new file mode 100644 index 0000000..b46cd11 --- /dev/null +++ b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/code.power @@ -0,0 +1,22 @@ + /** + * Get languages and number of bytes of code written in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function getLanguages(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/languages"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/settings.json b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/settings.json new file mode 100644 index 0000000..ff32f58 --- /dev/null +++ b/src/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c140a62c-ea7b-470f-b8ca-83cfbcdd13ba", + "implements": null, + "load_selection": null, + "name": "Languages", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Languages", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Languages", + "description": "The Gitea Repository Languages\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/README.md b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/README.md new file mode 100644 index 0000000..6426b52 --- /dev/null +++ b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Members (Details) +> namespace: **VDM\Joomla\Gitea\Organization** +```uml +@startuml +class Members #Gold { + + list(string $orgName, int $page = 1, ...) : ?array + + check(string $org, string $username) : string + + remove(string $org, string $username) : string +} + +note right of Members::list + Get a list of members of an organization. + + since: 3.2.0 + return: ?array + + arguments: + string $orgName + int $page = 1 + int $limit = 10 +end note + +note right of Members::check + Check if a user is a member of an organization. + + since: 3.2.0 + return: string +end note + +note right of Members::remove + Remove a member from an organization. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.php b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.php new file mode 100644 index 0000000..97bf82b --- /dev/null +++ b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.php @@ -0,0 +1,100 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Members + * + * @since 3.2.0 + */ +class Members extends Api +{ + /** + * Get a list of members of an organization. + * + * @param string $orgName The organization name. + * @param int $page The page number. + * @param int $limit The number of members per page. + * + * @return array|null The organization members. + * @since 3.2.0 + */ + public function list( + string $orgName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/members"; + + // Get the URI and set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if a user is a member of an organization. + * + * @param string $org The organization name. + * @param string $username The username. + * + * @return string Whether the user is a member of the organization. + * @since 3.2.0 + */ + public function check(string $org, string $username): string + { + // Build the request path. + $path = "/orgs/{$org}/members/{$username}"; + + // Send the request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Remove a member from an organization. + * + * @param string $org The organization name. + * @param string $username The username of the user to remove. + * + * @return string Whether the user was successfully removed from the organization. + * @since 3.2.0 + */ + public function remove(string $org, string $username): string + { + // Build the request path. + $path = "/orgs/{$org}/members/{$username}"; + + // Send the request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.power b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.power new file mode 100644 index 0000000..b6fd41a --- /dev/null +++ b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/code.power @@ -0,0 +1,73 @@ + /** + * Get a list of members of an organization. + * + * @param string $orgName The organization name. + * @param int $page The page number. + * @param int $limit The number of members per page. + * + * @return array|null The organization members. + * @since 3.2.0 + */ + public function list( + string $orgName, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/orgs/{$orgName}/members"; + + // Get the URI and set query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if a user is a member of an organization. + * + * @param string $org The organization name. + * @param string $username The username. + * + * @return string Whether the user is a member of the organization. + * @since 3.2.0 + */ + public function check(string $org, string $username): string + { + // Build the request path. + $path = "/orgs/{$org}/members/{$username}"; + + // Send the request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Remove a member from an organization. + * + * @param string $org The organization name. + * @param string $username The username of the user to remove. + * + * @return string Whether the user was successfully removed from the organization. + * @since 3.2.0 + */ + public function remove(string $org, string $username): string + { + // Build the request path. + $path = "/orgs/{$org}/members/{$username}"; + + // Send the request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/settings.json b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/settings.json new file mode 100644 index 0000000..91c4a0a --- /dev/null +++ b/src/c1be1e0d-479d-44de-bfe4-cfa4ded7e240/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c1be1e0d-479d-44de-bfe4-cfa4ded7e240", + "implements": null, + "load_selection": null, + "name": "Members", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Members", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Members", + "description": "The Gitea Organization Members\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/README.md b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/README.md new file mode 100644 index 0000000..3a3f40b --- /dev/null +++ b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Teams (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Teams #Gold { + + list(int $page = 1, int $limit = 10) : ?array +} + +note right of Teams::list + List all the teams a user belongs to. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.php b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.php new file mode 100644 index 0000000..ce3f32b --- /dev/null +++ b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.php @@ -0,0 +1,54 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Teams + * + * @since 3.2.0 + */ +class Teams extends Api +{ + /** + * List all the teams a user belongs to. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/teams'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + +} + diff --git a/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.power b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.power new file mode 100644 index 0000000..6a32ad9 --- /dev/null +++ b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.power @@ -0,0 +1,27 @@ + /** + * List all the teams a user belongs to. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/teams'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } diff --git a/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/settings.json b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/settings.json new file mode 100644 index 0000000..70989a7 --- /dev/null +++ b/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3", + "implements": null, + "load_selection": null, + "name": "Teams", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Teams", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Teams", + "description": "The Gitea User Teams\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/README.md b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/README.md new file mode 100644 index 0000000..0db255d --- /dev/null +++ b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/README.md @@ -0,0 +1,71 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Keys (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Keys #Gold { + + create(string $title, string $key, ...) : ?object + + list(?string $fingerprint = null, int $page = 1, ...) : ?array + + get(int $id) : ?object + + delete(int $id) : string +} + +note right of Keys::create + Create a public key for the authenticated user. + + since: 3.2.0 + return: ?object + + arguments: + string $title + string $key + bool $readOnly = false +end note + +note right of Keys::list + List the authenticated user's public keys. + + since: 3.2.0 + return: ?array + + arguments: + ?string $fingerprint = null + int $page = 1 + int $limit = 10 +end note + +note right of Keys::get + Get a public key for the authenticated user. + + since: 3.2.0 + return: ?object +end note + +note right of Keys::delete + Delete a public key for the authenticated user. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.php b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.php new file mode 100644 index 0000000..ed22c40 --- /dev/null +++ b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.php @@ -0,0 +1,135 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Keys + * + * @since 3.2.0 + */ +class Keys extends Api +{ + /** + * Create a public key for the authenticated user. + * + * @param string $title The title of the public key. + * @param string $key The content of the public key. + * @param bool $readOnly Optional. True if the key has only read access, false for read/write access. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $title, + string $key, + bool $readOnly = false + ): ?object + { + // Build the request path. + $path = '/user/keys'; + + // Set the public key data. + $data = new \stdClass(); + $data->title = $title; + $data->key = $key; + $data->read_only = $readOnly; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * List the authenticated user's public keys. + * + * @param string|null $fingerprint Optional. The fingerprint of the key. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + ?string $fingerprint = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/keys'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + if ($fingerprint !== null) { + $uri->setVar('fingerprint', $fingerprint); + } + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a public key for the authenticated user. + * + * @param int $id The public key ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/user/keys/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a public key for the authenticated user. + * + * @param int $id The public key ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(int $id): string + { + // Build the request path. + $path = "/user/keys/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.power b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.power new file mode 100644 index 0000000..3dc3f41 --- /dev/null +++ b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/code.power @@ -0,0 +1,108 @@ + /** + * Create a public key for the authenticated user. + * + * @param string $title The title of the public key. + * @param string $key The content of the public key. + * @param bool $readOnly Optional. True if the key has only read access, false for read/write access. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $title, + string $key, + bool $readOnly = false + ): ?object + { + // Build the request path. + $path = '/user/keys'; + + // Set the public key data. + $data = new \stdClass(); + $data->title = $title; + $data->key = $key; + $data->read_only = $readOnly; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * List the authenticated user's public keys. + * + * @param string|null $fingerprint Optional. The fingerprint of the key. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + ?string $fingerprint = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/keys'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + if ($fingerprint !== null) { + $uri->setVar('fingerprint', $fingerprint); + } + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a public key for the authenticated user. + * + * @param int $id The public key ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/user/keys/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a public key for the authenticated user. + * + * @param int $id The public key ID. + * + * @return string + * @since 3.2.0 + **/ + public function delete(int $id): string + { + // Build the request path. + $path = "/user/keys/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/settings.json b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/settings.json new file mode 100644 index 0000000..4650568 --- /dev/null +++ b/src/c521f8c3-4e01-4c1a-8f68-f3e9d967651d/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c521f8c3-4e01-4c1a-8f68-f3e9d967651d", + "implements": null, + "load_selection": null, + "name": "Keys", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Keys", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Keys", + "description": "The Gitea User Keys\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c7b31fc2-892b-4235-beb2-3413e4432839/README.md b/src/c7b31fc2-892b-4235-beb2-3413e4432839/README.md new file mode 100644 index 0000000..08f5d00 --- /dev/null +++ b/src/c7b31fc2-892b-4235-beb2-3413e4432839/README.md @@ -0,0 +1,76 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Teams (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Teams #Gold { + + list(string $ownerOfRepo, string $nameOfRepo) : ?array + + check(string $ownerOfRepo, string $nameOfRepo, ...) : ?object + + add(string $ownerName, string $repoName, ...) : string + + delete(string $ownerName, string $repoName, ...) : string +} + +note right of Teams::list + List a repository's teams. + + since: 3.2.0 + return: ?array +end note + +note right of Teams::check + Check if a team is assigned to a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $ownerOfRepo + string $nameOfRepo + string $teamName +end note + +note right of Teams::add + Add a team to a repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + string $teamName +end note + +note right of Teams::delete + Delete a team from a repository. + + since: 3.2.0 + return: string + + arguments: + string $ownerName + string $repoName + string $teamName +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c7b31fc2-892b-4235-beb2-3413e4432839/code.php b/src/c7b31fc2-892b-4235-beb2-3413e4432839/code.php new file mode 100644 index 0000000..cb39f7c --- /dev/null +++ b/src/c7b31fc2-892b-4235-beb2-3413e4432839/code.php @@ -0,0 +1,133 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Teams + * + * @since 3.2.0 + */ +class Teams extends Api +{ + /** + * List a repository's teams. + * + * @param string $ownerOfRepo The owner name. + * @param string $nameOfRepo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $ownerOfRepo, string $nameOfRepo): ?array + { + // Build the request path. + $path = "/repos/{$ownerOfRepo}/{$nameOfRepo}/teams"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if a team is assigned to a repository. + * + * @param string $ownerOfRepo The owner name. + * @param string $nameOfRepo The repository name. + * @param string $teamName The team name. + * + * @return object|null + * @since 3.2.0 + **/ + public function check( + string $ownerOfRepo, + string $nameOfRepo, + string $teamName + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerOfRepo}/{$nameOfRepo}/teams/{$teamName}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a team to a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $teamName The team name. + * + * @return string + * @since 3.2.0 + **/ + public function add( + string $ownerName, + string $repoName, + string $teamName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/teams/{$teamName}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Delete a team from a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $teamName The team name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + string $teamName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/teams/{$teamName}"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), + 204, 'success' + ); + } + +} + diff --git a/src/c7b31fc2-892b-4235-beb2-3413e4432839/code.power b/src/c7b31fc2-892b-4235-beb2-3413e4432839/code.power new file mode 100644 index 0000000..6f1dbf4 --- /dev/null +++ b/src/c7b31fc2-892b-4235-beb2-3413e4432839/code.power @@ -0,0 +1,106 @@ + /** + * List a repository's teams. + * + * @param string $ownerOfRepo The owner name. + * @param string $nameOfRepo The repository name. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $ownerOfRepo, string $nameOfRepo): ?array + { + // Build the request path. + $path = "/repos/{$ownerOfRepo}/{$nameOfRepo}/teams"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if a team is assigned to a repository. + * + * @param string $ownerOfRepo The owner name. + * @param string $nameOfRepo The repository name. + * @param string $teamName The team name. + * + * @return object|null + * @since 3.2.0 + **/ + public function check( + string $ownerOfRepo, + string $nameOfRepo, + string $teamName + ): ?object + { + // Build the request path. + $path = "/repos/{$ownerOfRepo}/{$nameOfRepo}/teams/{$teamName}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a team to a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $teamName The team name. + * + * @return string + * @since 3.2.0 + **/ + public function add( + string $ownerName, + string $repoName, + string $teamName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/teams/{$teamName}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Delete a team from a repository. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $teamName The team name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $ownerName, + string $repoName, + string $teamName + ): string + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/teams/{$teamName}"; + + // Prepare the URI with the path. + $uri = $this->uri->get($path); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), + 204, 'success' + ); + } diff --git a/src/c7b31fc2-892b-4235-beb2-3413e4432839/settings.json b/src/c7b31fc2-892b-4235-beb2-3413e4432839/settings.json new file mode 100644 index 0000000..cd72560 --- /dev/null +++ b/src/c7b31fc2-892b-4235-beb2-3413e4432839/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c7b31fc2-892b-4235-beb2-3413e4432839", + "implements": null, + "load_selection": null, + "name": "Teams", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Teams", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Teams", + "description": "The Gitea Repository Teams\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/README.md b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/README.md new file mode 100644 index 0000000..75059ef --- /dev/null +++ b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/README.md @@ -0,0 +1,68 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Notifications (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class Notifications #Gold { + + list(?bool $all = null, ?array $statusTypes = null, ...) : ?array + + update(?string $lastReadAt = null, ?bool $all = null, ...) : ?array + + check() : ?object +} + +note right of Notifications::list + List user's notification threads. + + since: 3.2.0 + return: ?array + + arguments: + ?bool $all = null + ?array $statusTypes = null + ?array $subjectType = null + ?string $since = null + ?string $before = null + int $page = 1 + int $limit = 10 +end note + +note right of Notifications::update + Mark notification threads as read, pinned, or unread. + + since: 3.2.0 + return: ?array + + arguments: + ?string $lastReadAt = null + ?bool $all = null + ?array $statusTypes = null + ?string $toStatus = null +end note + +note right of Notifications::check + Check if unread notifications exist. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.php b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.php new file mode 100644 index 0000000..ffe33a8 --- /dev/null +++ b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.php @@ -0,0 +1,149 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Notifications + * + * @since 3.2.0 + */ +class Notifications extends Api +{ + /** + * List user's notification threads. + * + * @param bool|null $all Show notifications marked as read (optional). + * @param array|null $statusTypes Show notifications with the provided status types (optional). + * @param array|null $subjectType Filter notifications by subject type (optional). + * @param string|null $since Show notifications updated after the given time (optional). + * @param string|null $before Show notifications updated before the given time (optional). + * @param int $page Page number of results to return (optional). + * @param int $limit Page size of results (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + ?bool $all = null, + ?array $statusTypes = null, + ?array $subjectType = null, + ?string $since = null, + ?string $before = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($subjectType !== null) + { + $uri->setVar('subject-type', implode(',', $subjectType)); + } + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Mark notification threads as read, pinned, or unread. + * + * @param string|null $lastReadAt Describes the last point that notifications were checked (optional). + * @param bool|null $all If true, mark all notifications on this repo (optional). + * @param array|null $statusTypes Mark notifications with the provided status types (optional). + * @param string|null $toStatus Status to mark notifications as (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function update( + ?string $lastReadAt = null, + ?bool $all = null, + ?array $statusTypes = null, + ?string $toStatus = null + ): ?array + { + // Build the request path. + $path = "/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($lastReadAt !== null) + { + $uri->setVar('last_read_at', $lastReadAt); + } + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($toStatus !== null) + { + $uri->setVar('to-status', $toStatus); + } + + // Send the put request. + return $this->response->get( + $this->http->put($uri, ''), 205 + ); + } + + /** + * Check if unread notifications exist. + * + * @return object|null + * @since 3.2.0 + **/ + public function check(): ?object + { + // Build the request path. + $path = "/notifications/new"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.power b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.power new file mode 100644 index 0000000..bbbb5de --- /dev/null +++ b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/code.power @@ -0,0 +1,122 @@ + /** + * List user's notification threads. + * + * @param bool|null $all Show notifications marked as read (optional). + * @param array|null $statusTypes Show notifications with the provided status types (optional). + * @param array|null $subjectType Filter notifications by subject type (optional). + * @param string|null $since Show notifications updated after the given time (optional). + * @param string|null $before Show notifications updated before the given time (optional). + * @param int $page Page number of results to return (optional). + * @param int $limit Page size of results (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + ?bool $all = null, + ?array $statusTypes = null, + ?array $subjectType = null, + ?string $since = null, + ?string $before = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($subjectType !== null) + { + $uri->setVar('subject-type', implode(',', $subjectType)); + } + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Mark notification threads as read, pinned, or unread. + * + * @param string|null $lastReadAt Describes the last point that notifications were checked (optional). + * @param bool|null $all If true, mark all notifications on this repo (optional). + * @param array|null $statusTypes Mark notifications with the provided status types (optional). + * @param string|null $toStatus Status to mark notifications as (optional). + * + * @return array|null + * @since 3.2.0 + **/ + public function update( + ?string $lastReadAt = null, + ?bool $all = null, + ?array $statusTypes = null, + ?string $toStatus = null + ): ?array + { + // Build the request path. + $path = "/notifications"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($lastReadAt !== null) + { + $uri->setVar('last_read_at', $lastReadAt); + } + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($toStatus !== null) + { + $uri->setVar('to-status', $toStatus); + } + + // Send the put request. + return $this->response->get( + $this->http->put($uri, ''), 205 + ); + } + + /** + * Check if unread notifications exist. + * + * @return object|null + * @since 3.2.0 + **/ + public function check(): ?object + { + // Build the request path. + $path = "/notifications/new"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/settings.json b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/settings.json new file mode 100644 index 0000000..ed0719a --- /dev/null +++ b/src/c8cbc9bd-ee91-403a-8633-0e8b59619a49/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "c8cbc9bd-ee91-403a-8633-0e8b59619a49", + "implements": null, + "load_selection": null, + "name": "Notifications", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Notifications", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Notifications", + "description": "The Gitea Notifications\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/README.md b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/README.md new file mode 100644 index 0000000..dc5034c --- /dev/null +++ b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Labels (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class Labels #Gold { + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string + + update(string $owner, string $repo, ...) : ?object +} + +note right of Labels::create + Create a label. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $labelName + string $labelColor + string $labelDescription = '' +end note + +note right of Labels::get + Get a single label. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $id +end note + +note right of Labels::delete + Delete a label. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $id +end note + +note right of Labels::update + Update a label. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $id + string $labelName = '' + string $labelColor = '' + string $labelDescription = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.php b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.php new file mode 100644 index 0000000..43f2c9f --- /dev/null +++ b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.php @@ -0,0 +1,162 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Labels + * + * @since 3.2.0 + */ +class Labels extends Api +{ + /** + * Create a label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $labelName The name of the label. + * @param string $labelColor The color of the label, in hexadecimal format with the leading '#'. + * @param string $labelDescription Optional. The description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function create(string $owner, string $repo, string $labelName, string $labelColor, string $labelDescription = ''): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the needed data. + $data->name = $labelName; + $data->color = $labelColor; + if (!empty($labelDescription)) + { + $data->description = $labelDescription; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a single label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $id The ID of the label to retrieve. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $id): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $id The ID of the label to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, string $id): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $id The ID of the label to update. + * @param string $labelName Optional. The new name of the label. + * @param string $labelColor Optional. The new color of the label, in hexadecimal format without the leading '#'. + * @param string $labelDescription Optional. The new description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $id, + string $labelName = '', + string $labelColor = '', + string $labelDescription = '' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the optional data that has been provided. + if (!empty($labelName)) + { + $data->name = $labelName; + } + + if (!empty($labelColor)) + { + $data->color = $labelColor; + } + + if (!empty($labelDescription)) + { + $data->description = $labelDescription; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels/{$id}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + +} + diff --git a/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.power b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.power new file mode 100644 index 0000000..eaaaa9e --- /dev/null +++ b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/code.power @@ -0,0 +1,135 @@ + /** + * Create a label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $labelName The name of the label. + * @param string $labelColor The color of the label, in hexadecimal format with the leading '#'. + * @param string $labelDescription Optional. The description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function create(string $owner, string $repo, string $labelName, string $labelColor, string $labelDescription = ''): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the needed data. + $data->name = $labelName; + $data->color = $labelColor; + if (!empty($labelDescription)) + { + $data->description = $labelDescription; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a single label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $id The ID of the label to retrieve. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $id): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $id The ID of the label to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, string $id): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a label. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $id The ID of the label to update. + * @param string $labelName Optional. The new name of the label. + * @param string $labelColor Optional. The new color of the label, in hexadecimal format without the leading '#'. + * @param string $labelDescription Optional. The new description of the label. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $id, + string $labelName = '', + string $labelColor = '', + string $labelDescription = '' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the optional data that has been provided. + if (!empty($labelName)) + { + $data->name = $labelName; + } + + if (!empty($labelColor)) + { + $data->color = $labelColor; + } + + if (!empty($labelDescription)) + { + $data->description = $labelDescription; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels/{$id}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } diff --git a/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/settings.json b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/settings.json new file mode 100644 index 0000000..b5cbd71 --- /dev/null +++ b/src/ca53d4cb-7800-4ea2-b06e-7466ded91e49/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "ca53d4cb-7800-4ea2-b06e-7466ded91e49", + "implements": null, + "load_selection": null, + "name": "Labels", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Labels", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Labels", + "description": "The Gitea Labels\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/README.md b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/README.md new file mode 100644 index 0000000..21232e5 --- /dev/null +++ b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/README.md @@ -0,0 +1,97 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Tags (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Tags #Gold { + + list(string $owner, string $repo, ...) : ?array + + get(string $owner, string $repo, ...) : ?object + + sha(string $owner, string $repo, ...) : ?object + + create(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string +} + +note right of Tags::list + List a repository's tags + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + ?int $page = 1 + ?int $limit = 10 +end note + +note right of Tags::get + Get the tag of a repository by tag name. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $tag +end note + +note right of Tags::sha + Get the tag object of an annotated tag (not lightweight tags). + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $sha +end note + +note right of Tags::create + Create a new git tag in a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $tagName + string $target + string $message +end note + +note right of Tags::delete + Delete a repository's tag by name. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $tag +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.php b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.php new file mode 100644 index 0000000..600bfc2 --- /dev/null +++ b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.php @@ -0,0 +1,182 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Tags + * + * @since 3.2.0 + */ +class Tags extends Api +{ + /** + * List a repository's tags + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param int|null $page The page number of results to return (1-based). + * @param int|null $limit The page size of results, default maximum page size is 10. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + ?int $page = 1, + ?int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Add query parameters if they are provided. + if ($page !== null) + { + $uri->setVar('page', $page); + } + + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get the tag of a repository by tag name. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $tag The tag name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $tag): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags/{$tag}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get the tag object of an annotated tag (not lightweight tags). + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string $sha The sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags. + * + * @return object|null + * @since 3.2.0 + **/ + public function sha( + string $owner, + string $repo, + string $sha + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/tags/{$sha}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a new git tag in a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string $tagName The name of the tag. + * @param string $target The SHA of the git object this is tagging. + * @param string $message The tag message. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $tagName, + string $target, + string $message + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags"; + + // Set the tag data + $data = new \stdClass(); + $data->tag_name = $tagName; + $data->target = $target; + $data->message = $message; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Delete a repository's tag by name. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $tag The tag name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $tag + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags/{$tag}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'succes' + ); + } + +} + diff --git a/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.power b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.power new file mode 100644 index 0000000..bcfc359 --- /dev/null +++ b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/code.power @@ -0,0 +1,155 @@ + /** + * List a repository's tags + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param int|null $page The page number of results to return (1-based). + * @param int|null $limit The page size of results, default maximum page size is 10. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + ?int $page = 1, + ?int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Add query parameters if they are provided. + if ($page !== null) + { + $uri->setVar('page', $page); + } + + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get the tag of a repository by tag name. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $tag The tag name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $tag): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags/{$tag}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get the tag object of an annotated tag (not lightweight tags). + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string $sha The sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags. + * + * @return object|null + * @since 3.2.0 + **/ + public function sha( + string $owner, + string $repo, + string $sha + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/tags/{$sha}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Create a new git tag in a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string $tagName The name of the tag. + * @param string $target The SHA of the git object this is tagging. + * @param string $message The tag message. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $tagName, + string $target, + string $message + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags"; + + // Set the tag data + $data = new \stdClass(); + $data->tag_name = $tagName; + $data->target = $target; + $data->message = $message; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Delete a repository's tag by name. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $tag The tag name. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $tag + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/tags/{$tag}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'succes' + ); + } diff --git a/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/settings.json b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/settings.json new file mode 100644 index 0000000..882a79d --- /dev/null +++ b/src/caf25475-8c9e-4e07-a7f5-f606e98ec880/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "caf25475-8c9e-4e07-a7f5-f606e98ec880", + "implements": null, + "load_selection": null, + "name": "Tags", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Tags", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Tags", + "description": "The Gitea Repository Tags\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/ce40b3d2-226c-4a64-b116-c19455822be1/README.md b/src/ce40b3d2-226c-4a64-b116-c19455822be1/README.md new file mode 100644 index 0000000..acceb23 --- /dev/null +++ b/src/ce40b3d2-226c-4a64-b116-c19455822be1/README.md @@ -0,0 +1,43 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Http (Details) +> namespace: **VDM\Joomla\Gitea\Utilities** +```uml +@startuml +class Http << (F,LightGreen) >> #Green { + + __construct(?string $token) + + setToken(string $token) +} + +note right of Http::__construct + Constructor. + + since: 3.2.0 +end note + +note right of Http::setToken + Change the Token. + + since: 3.2.0 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php new file mode 100644 index 0000000..7f0b817 --- /dev/null +++ b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Utilities; + + +use Joomla\CMS\Http\Http as JoomlaHttp; +use Joomla\Registry\Registry; + + +/** + * The Gitea Http + * + * @since 3.2.0 + */ +final class Http extends JoomlaHttp +{ + /** + * Constructor. + * + * @param string|null $token The Gitea API token. + * + * @since 3.2.0 + * @throws \InvalidArgumentException + **/ + public function __construct(?string $token) + { + // setup config + $config = [ + 'userAgent' => 'JoomlaGitea/3.0', + 'headers' => [ + 'Content-Type' => 'application/json' + ] + ]; + + // add the token if given + if (is_string($token)) + { + $config['headers']['Authorization'] = 'token ' . $token; + } + + $options = new Registry($config); + + // run parent constructor + parent::__construct($options); + } + + /** + * Change the Token. + * + * @param string $token The Gitea API token. + * + * @since 3.2.0 + **/ + public function setToken(string $token) + { + // get the current headers + $headers = (array) $this->getOption('headers', [ + 'Content-Type' => 'application/json' + ] + ); + + // add the token + $headers['Authorization'] = 'token ' . $token; + + $this->setOption('headers', $headers); + } + +} + diff --git a/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power new file mode 100644 index 0000000..9ea3730 --- /dev/null +++ b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power @@ -0,0 +1,50 @@ + /** + * Constructor. + * + * @param string|null $token The Gitea API token. + * + * @since 3.2.0 + * @throws \InvalidArgumentException + **/ + public function __construct(?string $token) + { + // setup config + $config = [ + 'userAgent' => 'JoomlaGitea/3.0', + 'headers' => [ + 'Content-Type' => 'application/json' + ] + ]; + + // add the token if given + if (is_string($token)) + { + $config['headers']['Authorization'] = 'token ' . $token; + } + + $options = new Registry($config); + + // run parent constructor + parent::__construct($options); + } + + /** + * Change the Token. + * + * @param string $token The Gitea API token. + * + * @since 3.2.0 + **/ + public function setToken(string $token) + { + // get the current headers + $headers = (array) $this->getOption('headers', [ + 'Content-Type' => 'application/json' + ] + ); + + // add the token + $headers['Authorization'] = 'token ' . $token; + + $this->setOption('headers', $headers); + } diff --git a/src/ce40b3d2-226c-4a64-b116-c19455822be1/settings.json b/src/ce40b3d2-226c-4a64-b116-c19455822be1/settings.json new file mode 100644 index 0000000..2a80050 --- /dev/null +++ b/src/ce40b3d2-226c-4a64-b116-c19455822be1/settings.json @@ -0,0 +1,19 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "-1", + "guid": "ce40b3d2-226c-4a64-b116-c19455822be1", + "implements": null, + "load_selection": null, + "name": "Http", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Utilities.Http", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Utilities.Http", + "description": "The Gitea Http\r\n\r\n@since 3.2.0", + "extends_custom": "JoomlaHttp", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Http\\Http as JoomlaHttp;\r\nuse Joomla\\Registry\\Registry;", + "composer": "" +} \ No newline at end of file diff --git a/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/README.md b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/README.md new file mode 100644 index 0000000..2931750 --- /dev/null +++ b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/README.md @@ -0,0 +1,42 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Notes (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Notes #Gold { + + get(string $owner, string $repo, ...) : ?object +} + +note right of Notes::get + Get a note corresponding to a single commit from a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $commitSha +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.php b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.php new file mode 100644 index 0000000..823d613 --- /dev/null +++ b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.php @@ -0,0 +1,53 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Notes + * + * @since 3.2.0 + */ +class Notes extends Api +{ + /** + * Get a note corresponding to a single commit from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $commitSha The SHA hash of the commit. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $commitSha + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/notes/{$commitSha}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.power b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.power new file mode 100644 index 0000000..a792f31 --- /dev/null +++ b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/code.power @@ -0,0 +1,26 @@ + /** + * Get a note corresponding to a single commit from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $commitSha The SHA hash of the commit. + * + * @return object|null + * @since 3.2.0 + **/ + public function get( + string $owner, + string $repo, + string $commitSha + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/notes/{$commitSha}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/settings.json b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/settings.json new file mode 100644 index 0000000..9779f69 --- /dev/null +++ b/src/cf8fa194-9f83-4a2a-b52b-ede069188afe/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "cf8fa194-9f83-4a2a-b52b-ede069188afe", + "implements": null, + "load_selection": null, + "name": "Notes", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Notes", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Notes", + "description": "The Gitea Repository Notes\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/d273c34e-88c1-438b-98c0-801996f58c29/README.md b/src/d273c34e-88c1-438b-98c0-801996f58c29/README.md new file mode 100644 index 0000000..47b2dff --- /dev/null +++ b/src/d273c34e-88c1-438b-98c0-801996f58c29/README.md @@ -0,0 +1,90 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Times (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Times #Gold { + + list(string $owner, string $repo, ...) : ?array + + add(string $owner, string $repo, ...) : ?object + + reset(string $owner, string $repo, ...) : string + + delete(string $owner, string $repo, ...) : string +} + +note right of Times::list + List an issue's tracked times. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + string $user = null + string $since = null + string $before = null + int $page = null + int $limit = null +end note + +note right of Times::add + Add tracked time to an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + int $time + string $created = null + string $userName = null +end note + +note right of Times::reset + Reset a tracked time of an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +note right of Times::delete + Delete specific tracked time. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + int $id +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d273c34e-88c1-438b-98c0-801996f58c29/code.php b/src/d273c34e-88c1-438b-98c0-801996f58c29/code.php new file mode 100644 index 0000000..7c33c2a --- /dev/null +++ b/src/d273c34e-88c1-438b-98c0-801996f58c29/code.php @@ -0,0 +1,179 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Times + * + * @since 3.2.0 + */ +class Times extends Api +{ + /** + * List an issue's tracked times. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $user Optional. Filter by user. + * @param string $since Optional. Show times updated after the given time. + * @param string $before Optional. Show times updated before the given time. + * @param int $page Optional. Page number of results to return (1-based). + * @param int $limit Optional. Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $index, + string $user = null, + string $since = null, + string $before = null, + int $page = null, + int $limit = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times"; + + // Prepare the query parameters. + $uri = $this->uri->get($path); + if ($user !== null) + { + $uri->setVar('user', $user); + } + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request with the query parameters. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add tracked time to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $time The tracked time in seconds. + * @param string $created Optional. The date and time of the tracked time in RFC 3339 format. + * @param string $userName Optional. User who spent the time. + * + * @return object|null + * @since 3.2.0 + **/ + public function add( + string $owner, + string $repo, + int $index, + int $time, + string $created = null, + string $userName = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the needed data. + $data->time = $time; + if ($created !== null) + { + $data->created = $created; + } + if ($userName !== null) + { + $data->user_name = $userName; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Reset a tracked time of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function reset(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Delete specific tracked time. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $id The ID of the tracked time to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $index, int $id): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/d273c34e-88c1-438b-98c0-801996f58c29/code.power b/src/d273c34e-88c1-438b-98c0-801996f58c29/code.power new file mode 100644 index 0000000..f50d0e6 --- /dev/null +++ b/src/d273c34e-88c1-438b-98c0-801996f58c29/code.power @@ -0,0 +1,152 @@ + /** + * List an issue's tracked times. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $user Optional. Filter by user. + * @param string $since Optional. Show times updated after the given time. + * @param string $before Optional. Show times updated before the given time. + * @param int $page Optional. Page number of results to return (1-based). + * @param int $limit Optional. Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + int $index, + string $user = null, + string $since = null, + string $before = null, + int $page = null, + int $limit = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times"; + + // Prepare the query parameters. + $uri = $this->uri->get($path); + if ($user !== null) + { + $uri->setVar('user', $user); + } + if ($since !== null) + { + $uri->setVar('since', $since); + } + if ($before !== null) + { + $uri->setVar('before', $before); + } + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request with the query parameters. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add tracked time to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $time The tracked time in seconds. + * @param string $created Optional. The date and time of the tracked time in RFC 3339 format. + * @param string $userName Optional. User who spent the time. + * + * @return object|null + * @since 3.2.0 + **/ + public function add( + string $owner, + string $repo, + int $index, + int $time, + string $created = null, + string $userName = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the needed data. + $data->time = $time; + if ($created !== null) + { + $data->created = $created; + } + if ($userName !== null) + { + $data->user_name = $userName; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ) + ); + } + + /** + * Reset a tracked time of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function reset(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Delete specific tracked time. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $id The ID of the tracked time to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, int $index, int $id): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/times/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/d273c34e-88c1-438b-98c0-801996f58c29/settings.json b/src/d273c34e-88c1-438b-98c0-801996f58c29/settings.json new file mode 100644 index 0000000..f88cd8b --- /dev/null +++ b/src/d273c34e-88c1-438b-98c0-801996f58c29/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "d273c34e-88c1-438b-98c0-801996f58c29", + "implements": null, + "load_selection": null, + "name": "Times", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Times", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Times", + "description": "The Gitea Issue Times\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/README.md b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/README.md new file mode 100644 index 0000000..f3e0e19 --- /dev/null +++ b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Jcb (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Jcb #Gold { + + register(Container $container) : void + + getUri(Container $container) : Uri + + getHttp(Container $container) : Http +} + +note right of Jcb::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Jcb::getUri + Get the Dynamic Uri class + + since: 3.2.0 + return: Uri +end note + +note right of Jcb::getHttp + Get the Http class + + since: 3.2.0 + return: Http +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.php b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.php new file mode 100644 index 0000000..5e6a7a8 --- /dev/null +++ b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.php @@ -0,0 +1,85 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Utilities\Uri; +use VDM\Joomla\Gitea\Utilities\Http; +use VDM\Joomla\Utilities\Component\Helper; + + +/** + * The Gitea Utilities Service + * + * @since 3.2.0 + */ +class Jcb implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'Gitea.Dynamic.Uri') + ->share('Gitea.Dynamic.Uri', [$this, 'getUri'], true); + + $container->alias(Http::class, 'Gitea.Utilities.Http') + ->share('Gitea.Utilities.Http', [$this, 'getHttp'], true); + } + + /** + * Get the Dynamic Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + // get the global gitea URL + $add_gitea_url = Helper::getParams('com_componentbuilder')->get('add_custom_gitea_url', 1); + $gitea_url = Helper::getParams('com_componentbuilder')->get('custom_gitea_url'); + + // only load this if we have a custom URL set + if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false) + { + return new Uri($gitea_url); + } + + return $container->get('Gitea.Utilities.Uri'); + } + + /** + * Get the Http class + * + * @param Container $container The DI container. + * + * @return Http + * @since 3.2.0 + */ + public function getHttp(Container $container): Http + { + return new Http( + Helper::getParams('com_componentbuilder')->get('gitea_token') + ); + } + +} + diff --git a/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.power b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.power new file mode 100644 index 0000000..136917f --- /dev/null +++ b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/code.power @@ -0,0 +1,54 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'Gitea.Dynamic.Uri') + ->share('Gitea.Dynamic.Uri', [$this, 'getUri'], true); + + $container->alias(Http::class, 'Gitea.Utilities.Http') + ->share('Gitea.Utilities.Http', [$this, 'getHttp'], true); + } + + /** + * Get the Dynamic Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + // get the global gitea URL + $add_gitea_url = Helper::getParams('com_componentbuilder')->get('add_custom_gitea_url', 1); + $gitea_url = Helper::getParams('com_componentbuilder')->get('custom_gitea_url'); + + // only load this if we have a custom URL set + if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false) + { + return new Uri($gitea_url); + } + + return $container->get('Gitea.Utilities.Uri'); + } + + /** + * Get the Http class + * + * @param Container $container The DI container. + * + * @return Http + * @since 3.2.0 + */ + public function getHttp(Container $container): Http + { + return new Http( + Helper::getParams('com_componentbuilder')->get('gitea_token') + ); + } diff --git a/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/settings.json b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/settings.json new file mode 100644 index 0000000..b9acbfb --- /dev/null +++ b/src/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Jcb", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Jcb", + "type": "class", + "use_selection": { + "use_selection2": { + "use": "61e813c6-a872-4f55-8078-198241170e80", + "as": "default" + }, + "use_selection0": { + "use": "ce40b3d2-226c-4a64-b116-c19455822be1", + "as": "default" + }, + "use_selection1": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Jcb", + "description": "The Gitea Utilities Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/README.md b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/README.md new file mode 100644 index 0000000..ac8c238 --- /dev/null +++ b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Times (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Times #Gold { + + list(string $ownerName, string $repoName, ...) : ?array +} + +note right of Times::list + List a repo's tracked times. + + since: 3.2.0 + return: ?array + + arguments: + string $ownerName + string $repoName + string $user = null + string $since = null + string $before = null + int $page = 1 + int $limit = 10 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.php b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.php new file mode 100644 index 0000000..bae1416 --- /dev/null +++ b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.php @@ -0,0 +1,80 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Times + * + * @since 3.2.0 + */ +class Times extends Api +{ + /** + * List a repo's tracked times. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $user Optional filter by user (available for issue managers). + * @param string $since Only show times updated after the given time. This is a timestamp in RFC 3339 format. + * @param string $before Only show times updated before the given time. This is a timestamp in RFC 3339 format. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + string $user = null, + string $since = null, + string $before = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/times"; + + // Set the query parameters. + $uri = $this->uri->get($path); + + if ($user !== null) + { + $uri->setVar('user', $user); + } + + if ($since !== null) + { + $uri->setVar('since', $since); + } + + if ($before !== null) + { + $uri->setVar('before', $before); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.power b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.power new file mode 100644 index 0000000..40ec65a --- /dev/null +++ b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/code.power @@ -0,0 +1,53 @@ + /** + * List a repo's tracked times. + * + * @param string $ownerName The owner name. + * @param string $repoName The repository name. + * @param string $user Optional filter by user (available for issue managers). + * @param string $since Only show times updated after the given time. This is a timestamp in RFC 3339 format. + * @param string $before Only show times updated before the given time. This is a timestamp in RFC 3339 format. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $ownerName, + string $repoName, + string $user = null, + string $since = null, + string $before = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$ownerName}/{$repoName}/times"; + + // Set the query parameters. + $uri = $this->uri->get($path); + + if ($user !== null) + { + $uri->setVar('user', $user); + } + + if ($since !== null) + { + $uri->setVar('since', $since); + } + + if ($before !== null) + { + $uri->setVar('before', $before); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/settings.json b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/settings.json new file mode 100644 index 0000000..7f09b98 --- /dev/null +++ b/src/d7b67b1c-f876-4555-9e54-0645cf519d4c/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "d7b67b1c-f876-4555-9e54-0645cf519d4c", + "implements": null, + "load_selection": null, + "name": "Times", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Times", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Times", + "description": "The Gitea Repository Times\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/README.md b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/README.md new file mode 100644 index 0000000..2afb761 --- /dev/null +++ b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/README.md @@ -0,0 +1,66 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Members (Details) +> namespace: **VDM\Joomla\Gitea\Organization\Teams** +```uml +@startuml +class Members #Gold { + + list(int $teamId, int $pageNumber = 1, ...) : ?array + + get(int $id, string $username) : ?object + + add(int $id, string $username) : string + + remove(int $id, string $username) : string +} + +note right of Members::list + List a team's members. + + since: 3.2.0 + return: ?array + + arguments: + int $teamId + int $pageNumber = 1 + int $pageSize = 10 +end note + +note right of Members::get + List a particular member of the team. + + since: 3.2.0 + return: ?object +end note + +note right of Members::add + Add a team member. + + since: 3.2.0 + return: string +end note + +note right of Members::remove + Remove a team member. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.php b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.php new file mode 100644 index 0000000..89e9145 --- /dev/null +++ b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.php @@ -0,0 +1,124 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Organization\Teams; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Organization Teams Members + * + * @since 3.2.0 + */ +class Members extends Api +{ + /** + * List a team's members. + * + * @param int $teamId The team ID. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $teamId, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/teams/{$teamId}/members"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List a particular member of the team. + * + * @param int $id The team ID. + * @param string $username The user's username. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id, string $username): ?object + { + // Build the request path. + $path = "/teams/{$id}/members/{$username}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add a team member. + * + * @param int $id The team ID. + * @param string $username The user's username. + * + * @return string + * @since 3.2.0 + **/ + public function add(int $id, string $username): string + { + // Build the request path. + $path = "/teams/{$id}/members/{$username}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Remove a team member. + * + * @param int $id The team ID. + * @param string $username The user's username. + * + * @return string + * @since 3.2.0 + **/ + public function remove(int $id, string $username): string + { + // Build the request path. + $path = "/teams/{$id}/members/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.power b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.power new file mode 100644 index 0000000..8759e28 --- /dev/null +++ b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/code.power @@ -0,0 +1,97 @@ + /** + * List a team's members. + * + * @param int $teamId The team ID. + * @param int $pageNumber The page number of results to return (1-based). + * @param int $pageSize The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $teamId, + int $pageNumber = 1, + int $pageSize = 10 + ): ?array + { + // Build the request path. + $path = "/teams/{$teamId}/members"; + + // Get the URI object. + $uri = $this->uri->get($path); + + // Add the query parameters for page number and page size. + $uri->setVar('page', $pageNumber); + $uri->setVar('limit', $pageSize); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * List a particular member of the team. + * + * @param int $id The team ID. + * @param string $username The user's username. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id, string $username): ?object + { + // Build the request path. + $path = "/teams/{$id}/members/{$username}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Add a team member. + * + * @param int $id The team ID. + * @param string $username The user's username. + * + * @return string + * @since 3.2.0 + **/ + public function add(int $id, string $username): string + { + // Build the request path. + $path = "/teams/{$id}/members/{$username}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Remove a team member. + * + * @param int $id The team ID. + * @param string $username The user's username. + * + * @return string + * @since 3.2.0 + **/ + public function remove(int $id, string $username): string + { + // Build the request path. + $path = "/teams/{$id}/members/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/settings.json b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/settings.json new file mode 100644 index 0000000..8040511 --- /dev/null +++ b/src/d9fa532a-dbe8-445f-93dc-398a3cf01c1e/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "d9fa532a-dbe8-445f-93dc-398a3cf01c1e", + "implements": null, + "load_selection": null, + "name": "Members", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Organization.Teams.Members", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Organization.Teams.Members", + "description": "The Gitea Organization Teams Members\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/daa18d45-3d4a-4280-b58c-147683e8093c/README.md b/src/daa18d45-3d4a-4280-b58c-147683e8093c/README.md new file mode 100644 index 0000000..dd71ecb --- /dev/null +++ b/src/daa18d45-3d4a-4280-b58c-147683e8093c/README.md @@ -0,0 +1,105 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Commits (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Commits #Gold { + + getList(string $owner, string $repo, ...) : ?object + + getCommit(string $owner, string $repo, ...) : ?object + + status(string $owner, string $repo, ...) : ?object + + statuses(string $owner, string $repo, ...) : ?array + + diff(string $owner, string $repo, ...) : string +} + +note right of Commits::getList + Get a list of all commits from a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + ?string $sha = null + ?string $path = null + ?bool $stat = true + ?int $page = 1 + ?int $limit = 10 +end note + +note right of Commits::getCommit + Get a single commit from a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $sha +end note + +note right of Commits::status + Get a commit's combined status, by branch/tag/commit reference. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $ref + int $page = 1 + int $limit = 10 +end note + +note right of Commits::statuses + Get a commit's statuses, by branch/tag/commit reference. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + string $ref + string $sort = null + string $state = null + int $page = 1 + int $limit = 10 +end note + +note right of Commits::diff + Get a commit's diff or patch. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $sha + string $diffType +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/daa18d45-3d4a-4280-b58c-147683e8093c/code.php b/src/daa18d45-3d4a-4280-b58c-147683e8093c/code.php new file mode 100644 index 0000000..d8142c2 --- /dev/null +++ b/src/daa18d45-3d4a-4280-b58c-147683e8093c/code.php @@ -0,0 +1,225 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Commit + * + * @since 3.2.0 + */ +class Commits extends Api +{ + /** + * Get a list of all commits from a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string|null $sha SHA or branch to start listing commits from (usually 'master'). + * @param string|null $path Filepath of a file/dir. + * @param bool|null $stat Include diff stats for every commit (disable for speedup, default 'true'). + * @param int|null $page Page number of results to return (1-based). + * @param int|null $limit Page size of results (ignored if used with 'path'). + * + * @return array|null + * @since 3.2.0 + */ + public function getList( + string $owner, + string $repo, + ?string $sha = null, + ?string $path = null, + ?bool $stat = true, + ?int $page = 1, + ?int $limit = 10 + ): ?object + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/commits"; + + // Set query parameters. + $uri = $this->uri->get($uriPath); + + if ($sha !== null) + { + $uri->setVar('sha', $sha); + } + + if ($path !== null) + { + $uri->setVar('path', $path); + } + + if ($stat !== null) + { + $uri->setVar('stat', $stat ? 'true' : 'false'); + } + + if ($page !== null) + { + $uri->setVar('page', $page); + } + + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a single commit from a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string $sha A git ref or commit sha. + * + * @return object|null + * @since 3.2.0 + */ + public function getCommit(string $owner, string $repo, string $sha): ?object + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/git/commits/{$sha}"; + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($uriPath) + ) + ); + } + + /** + * Get a commit's combined status, by branch/tag/commit reference. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $ref The branch, tag, or commit reference. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function status( + string $owner, + string $repo, + string $ref, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/commits/{$ref}/status"; + + // Set up the URI with the required parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a commit's statuses, by branch/tag/commit reference. + * + * @param string $owner The owner of the repository. + * @param string $repo The name of the repository. + * @param string $ref The branch, tag, or commit reference. + * @param string $sort The type of sort. Available values: oldest, recentupdate, leastupdate, leastindex, highestindex. + * @param string $state The type of state. Available values: pending, success, error, failure, warning. + * @param int $page The page number of results to return (1-based). Default value: 1. + * @param int $limit The page size of results. Default value: 10. + * + * @return array|null + * @since 3.2.0 + */ + public function statuses( + string $owner, + string $repo, + string $ref, + string $sort = null, + string $state = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/commits/{$ref}/statuses"; + + // Add query parameters to the URI. + $uri = $this->uri->get($path); + + if ($sort !== null) + { + $uri->setVar('sort', $sort); + } + + if ($state !== null) + { + $uri->setVar('state', $state); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the GET request. + $response = $this->http->get($uri); + return $this->response->get($response); + } + + /** + * Get a commit's diff or patch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The SHA hash of the commit. + * @param string $diffType The diff type, either 'diff' or 'patch'. + * + * @return string + * @since 3.2.0 + **/ + public function diff( + string $owner, + string $repo, + string $sha, + string $diffType + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/commits/{$sha}"; + + // Set the diffType as a variable in the URI. + $this->uri->setVar('diffType', $diffType); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + +} + diff --git a/src/daa18d45-3d4a-4280-b58c-147683e8093c/code.power b/src/daa18d45-3d4a-4280-b58c-147683e8093c/code.power new file mode 100644 index 0000000..196ca3f --- /dev/null +++ b/src/daa18d45-3d4a-4280-b58c-147683e8093c/code.power @@ -0,0 +1,198 @@ + /** + * Get a list of all commits from a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string|null $sha SHA or branch to start listing commits from (usually 'master'). + * @param string|null $path Filepath of a file/dir. + * @param bool|null $stat Include diff stats for every commit (disable for speedup, default 'true'). + * @param int|null $page Page number of results to return (1-based). + * @param int|null $limit Page size of results (ignored if used with 'path'). + * + * @return array|null + * @since 3.2.0 + */ + public function getList( + string $owner, + string $repo, + ?string $sha = null, + ?string $path = null, + ?bool $stat = true, + ?int $page = 1, + ?int $limit = 10 + ): ?object + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/commits"; + + // Set query parameters. + $uri = $this->uri->get($uriPath); + + if ($sha !== null) + { + $uri->setVar('sha', $sha); + } + + if ($path !== null) + { + $uri->setVar('path', $path); + } + + if ($stat !== null) + { + $uri->setVar('stat', $stat ? 'true' : 'false'); + } + + if ($page !== null) + { + $uri->setVar('page', $page); + } + + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the GET request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a single commit from a repository. + * + * @param string $owner The owner of the repo. + * @param string $repo The name of the repo. + * @param string $sha A git ref or commit sha. + * + * @return object|null + * @since 3.2.0 + */ + public function getCommit(string $owner, string $repo, string $sha): ?object + { + // Build the request path. + $uriPath = "/repos/{$owner}/{$repo}/git/commits/{$sha}"; + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($uriPath) + ) + ); + } + + /** + * Get a commit's combined status, by branch/tag/commit reference. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $ref The branch, tag, or commit reference. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return object|null + * @since 3.2.0 + **/ + public function status( + string $owner, + string $repo, + string $ref, + int $page = 1, + int $limit = 10 + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/commits/{$ref}/status"; + + // Set up the URI with the required parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a commit's statuses, by branch/tag/commit reference. + * + * @param string $owner The owner of the repository. + * @param string $repo The name of the repository. + * @param string $ref The branch, tag, or commit reference. + * @param string $sort The type of sort. Available values: oldest, recentupdate, leastupdate, leastindex, highestindex. + * @param string $state The type of state. Available values: pending, success, error, failure, warning. + * @param int $page The page number of results to return (1-based). Default value: 1. + * @param int $limit The page size of results. Default value: 10. + * + * @return array|null + * @since 3.2.0 + */ + public function statuses( + string $owner, + string $repo, + string $ref, + string $sort = null, + string $state = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/commits/{$ref}/statuses"; + + // Add query parameters to the URI. + $uri = $this->uri->get($path); + + if ($sort !== null) + { + $uri->setVar('sort', $sort); + } + + if ($state !== null) + { + $uri->setVar('state', $state); + } + + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the GET request. + $response = $this->http->get($uri); + return $this->response->get($response); + } + + /** + * Get a commit's diff or patch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The SHA hash of the commit. + * @param string $diffType The diff type, either 'diff' or 'patch'. + * + * @return string + * @since 3.2.0 + **/ + public function diff( + string $owner, + string $repo, + string $sha, + string $diffType + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/git/commits/{$sha}"; + + // Set the diffType as a variable in the URI. + $this->uri->setVar('diffType', $diffType); + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + diff --git a/src/daa18d45-3d4a-4280-b58c-147683e8093c/settings.json b/src/daa18d45-3d4a-4280-b58c-147683e8093c/settings.json new file mode 100644 index 0000000..80f1b74 --- /dev/null +++ b/src/daa18d45-3d4a-4280-b58c-147683e8093c/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "daa18d45-3d4a-4280-b58c-147683e8093c", + "implements": null, + "load_selection": null, + "name": "Commits", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Commits", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Commits", + "description": "The Gitea Repository Commit\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/README.md b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/README.md new file mode 100644 index 0000000..e3d593c --- /dev/null +++ b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Thread (Details) +> namespace: **VDM\Joomla\Gitea\Notifications** +```uml +@startuml +class Thread #Gold { + + get(int $id) : ?object + + mark(int $id, ?string $lastReadAt = null, ...) : ?object +} + +note right of Thread::get + Get notification thread by ID. + + since: 3.2.0 + return: ?object +end note + +note right of Thread::mark + Mark notification threads as read, pinned, or unread by ID. + + since: 3.2.0 + return: ?object + + arguments: + int $id + ?string $lastReadAt = null + ?bool $all = null + ?array $statusTypes = null + ?string $toStatus = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.php b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.php new file mode 100644 index 0000000..ae8daaa --- /dev/null +++ b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.php @@ -0,0 +1,96 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Notifications; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Notifications Thread + * + * @since 3.2.0 + */ +class Thread extends Api +{ + /** + * Get notification thread by ID. + * + * @param int $id The notification thread ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/notifications/threads/{$id}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Mark notification threads as read, pinned, or unread by ID. + * + * @param int $id The notification thread ID. + * @param string|null $lastReadAt Last point that notifications were checked (optional). + * @param bool|null $all Mark all notifications on this repo (optional). + * @param array|null $statusTypes Mark notifications with the provided status types (optional). + * @param string|null $toStatus Status to mark notifications as (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function mark( + int $id, + ?string $lastReadAt = null, + ?bool $all = null, + ?array $statusTypes = null, + ?string $toStatus = null + ): ?object + { + // Build the request path. + $path = "/notifications/threads/{$id}"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($lastReadAt !== null) + { + $uri->setVar('last_read_at', $lastReadAt); + } + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($toStatus !== null) + { + $uri->setVar('to-status', $toStatus); + } + + // Send the put request. + return $this->response->get( + $this->http->put($uri, ''), 205 + ); + } + +} + diff --git a/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.power b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.power new file mode 100644 index 0000000..e1dc9c0 --- /dev/null +++ b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/code.power @@ -0,0 +1,69 @@ + /** + * Get notification thread by ID. + * + * @param int $id The notification thread ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/notifications/threads/{$id}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Mark notification threads as read, pinned, or unread by ID. + * + * @param int $id The notification thread ID. + * @param string|null $lastReadAt Last point that notifications were checked (optional). + * @param bool|null $all Mark all notifications on this repo (optional). + * @param array|null $statusTypes Mark notifications with the provided status types (optional). + * @param string|null $toStatus Status to mark notifications as (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function mark( + int $id, + ?string $lastReadAt = null, + ?bool $all = null, + ?array $statusTypes = null, + ?string $toStatus = null + ): ?object + { + // Build the request path. + $path = "/notifications/threads/{$id}"; + + // Configure the URI with query parameters. + $uri = $this->uri->get($path); + if ($lastReadAt !== null) + { + $uri->setVar('last_read_at', $lastReadAt); + } + if ($all !== null) + { + $uri->setVar('all', $all); + } + if ($statusTypes !== null) + { + $uri->setVar('status-types', implode(',', $statusTypes)); + } + if ($toStatus !== null) + { + $uri->setVar('to-status', $toStatus); + } + + // Send the put request. + return $this->response->get( + $this->http->put($uri, ''), 205 + ); + } diff --git a/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/settings.json b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/settings.json new file mode 100644 index 0000000..434c2ae --- /dev/null +++ b/src/db14e345-c3d9-4dda-8534-4963cd6ca6f5/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "db14e345-c3d9-4dda-8534-4963cd6ca6f5", + "implements": null, + "load_selection": null, + "name": "Thread", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Notifications.Thread", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Notifications.Thread", + "description": "The Gitea Notifications Thread\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/ddced4c5-667d-4559-873d-d716c17fd85b/README.md b/src/ddced4c5-667d-4559-873d-d716c17fd85b/README.md new file mode 100644 index 0000000..32bfbfe --- /dev/null +++ b/src/ddced4c5-667d-4559-873d-d716c17fd85b/README.md @@ -0,0 +1,93 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Admin (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Admin #Gold { + + register(Container $container) : void + + getCron(Container $container) : Cron + + getOrganizations(Container $container) : Organizations + + getUnadopted(Container $container) : Unadopted + + getUsers(Container $container) : Users + + getKeys(Container $container) : Keys + + getOrganization(Container $container) : Organization + + getRepository(Container $container) : Repository +} + +note right of Admin::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Admin::getCron + Get the Cron class + + since: 3.2.0 + return: Cron +end note + +note right of Admin::getOrganizations + Get the Organizations class + + since: 3.2.0 + return: Organizations +end note + +note left of Admin::getUnadopted + Get the Unadopted class + + since: 3.2.0 + return: Unadopted +end note + +note right of Admin::getUsers + Get the Users class + + since: 3.2.0 + return: Users +end note + +note left of Admin::getKeys + Get the Keys class + + since: 3.2.0 + return: Keys +end note + +note right of Admin::getOrganization + Get the Organization class + + since: 3.2.0 + return: Organization +end note + +note left of Admin::getRepository + Get the Repository class + + since: 3.2.0 + return: Repository +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ddced4c5-667d-4559-873d-d716c17fd85b/code.php b/src/ddced4c5-667d-4559-873d-d716c17fd85b/code.php new file mode 100644 index 0000000..be64aa1 --- /dev/null +++ b/src/ddced4c5-667d-4559-873d-d716c17fd85b/code.php @@ -0,0 +1,185 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Admin\Cron; +use VDM\Joomla\Gitea\Admin\Organizations; +use VDM\Joomla\Gitea\Admin\Unadopted; +use VDM\Joomla\Gitea\Admin\Users; +use VDM\Joomla\Gitea\Admin\Users\Keys; +use VDM\Joomla\Gitea\Admin\Users\Organization; +use VDM\Joomla\Gitea\Admin\Users\Repository; + + +/** + * The Gitea Admin Service + * + * @since 3.2.0 + */ +class Admin implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Cron::class, 'Gitea.Admin.Cron') + ->share('Gitea.Admin.Cron', [$this, 'getCron'], true); + + $container->alias(Organizations::class, 'Gitea.Admin.Organizations') + ->share('Gitea.Admin.Organizations', [$this, 'getOrganizations'], true); + + $container->alias(Unadopted::class, 'Gitea.Admin.Unadopted') + ->share('Gitea.Admin.Unadopted', [$this, 'getUnadopted'], true); + + $container->alias(Users::class, 'Gitea.Admin.Users') + ->share('Gitea.Admin.Users', [$this, 'getUsers'], true); + + $container->alias(Keys::class, 'Gitea.Admin.Users.Keys') + ->share('Gitea.Admin.Users.Keys', [$this, 'getKeys'], true); + + $container->alias(Organization::class, 'Gitea.Admin.Users.Organization') + ->share('Gitea.Admin.Users.Organization', [$this, 'getOrganization'], true); + + $container->alias(Repository::class, 'Gitea.Admin.Users.Repository') + ->share('Gitea.Admin.Users.Repository', [$this, 'getRepository'], true); + } + + /** + * Get the Cron class + * + * @param Container $container The DI container. + * + * @return Cron + * @since 3.2.0 + */ + public function getCron(Container $container): Cron + { + return new Cron( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Organizations class + * + * @param Container $container The DI container. + * + * @return Organizations + * @since 3.2.0 + */ + public function getOrganizations(Container $container): Organizations + { + return new Organizations( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Unadopted class + * + * @param Container $container The DI container. + * + * @return Unadopted + * @since 3.2.0 + */ + public function getUnadopted(Container $container): Unadopted + { + return new Unadopted( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Users class + * + * @param Container $container The DI container. + * + * @return Users + * @since 3.2.0 + */ + public function getUsers(Container $container): Users + { + return new Users( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Keys class + * + * @param Container $container The DI container. + * + * @return Keys + * @since 3.2.0 + */ + public function getKeys(Container $container): Keys + { + return new Keys( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Organization class + * + * @param Container $container The DI container. + * + * @return Organization + * @since 3.2.0 + */ + public function getOrganization(Container $container): Organization + { + return new Organization( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + +} + diff --git a/src/ddced4c5-667d-4559-873d-d716c17fd85b/code.power b/src/ddced4c5-667d-4559-873d-d716c17fd85b/code.power new file mode 100644 index 0000000..7047821 --- /dev/null +++ b/src/ddced4c5-667d-4559-873d-d716c17fd85b/code.power @@ -0,0 +1,150 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Cron::class, 'Gitea.Admin.Cron') + ->share('Gitea.Admin.Cron', [$this, 'getCron'], true); + + $container->alias(Organizations::class, 'Gitea.Admin.Organizations') + ->share('Gitea.Admin.Organizations', [$this, 'getOrganizations'], true); + + $container->alias(Unadopted::class, 'Gitea.Admin.Unadopted') + ->share('Gitea.Admin.Unadopted', [$this, 'getUnadopted'], true); + + $container->alias(Users::class, 'Gitea.Admin.Users') + ->share('Gitea.Admin.Users', [$this, 'getUsers'], true); + + $container->alias(Keys::class, 'Gitea.Admin.Users.Keys') + ->share('Gitea.Admin.Users.Keys', [$this, 'getKeys'], true); + + $container->alias(Organization::class, 'Gitea.Admin.Users.Organization') + ->share('Gitea.Admin.Users.Organization', [$this, 'getOrganization'], true); + + $container->alias(Repository::class, 'Gitea.Admin.Users.Repository') + ->share('Gitea.Admin.Users.Repository', [$this, 'getRepository'], true); + } + + /** + * Get the Cron class + * + * @param Container $container The DI container. + * + * @return Cron + * @since 3.2.0 + */ + public function getCron(Container $container): Cron + { + return new Cron( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Organizations class + * + * @param Container $container The DI container. + * + * @return Organizations + * @since 3.2.0 + */ + public function getOrganizations(Container $container): Organizations + { + return new Organizations( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Unadopted class + * + * @param Container $container The DI container. + * + * @return Unadopted + * @since 3.2.0 + */ + public function getUnadopted(Container $container): Unadopted + { + return new Unadopted( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Users class + * + * @param Container $container The DI container. + * + * @return Users + * @since 3.2.0 + */ + public function getUsers(Container $container): Users + { + return new Users( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Keys class + * + * @param Container $container The DI container. + * + * @return Keys + * @since 3.2.0 + */ + public function getKeys(Container $container): Keys + { + return new Keys( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Organization class + * + * @param Container $container The DI container. + * + * @return Organization + * @since 3.2.0 + */ + public function getOrganization(Container $container): Organization + { + return new Organization( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } diff --git a/src/ddced4c5-667d-4559-873d-d716c17fd85b/settings.json b/src/ddced4c5-667d-4559-873d-d716c17fd85b/settings.json new file mode 100644 index 0000000..f5fdf4f --- /dev/null +++ b/src/ddced4c5-667d-4559-873d-d716c17fd85b/settings.json @@ -0,0 +1,50 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "ddced4c5-667d-4559-873d-d716c17fd85b", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Admin", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Admin", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "6e1a6731-2587-4ad5-8e70-ca83eba65ee0", + "as": "default" + }, + "use_selection1": { + "use": "5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0", + "as": "default" + }, + "use_selection2": { + "use": "3aba9610-cb22-48e0-b2d7-2a9e708c82e2", + "as": "default" + }, + "use_selection3": { + "use": "e7c810a1-3d6a-42e4-b45f-bee554f259b3", + "as": "default" + }, + "use_selection4": { + "use": "2d29b342-cb4a-45f9-9cf1-a7347fbc0701", + "as": "default" + }, + "use_selection5": { + "use": "0039c453-cf6d-468b-9232-fc3fc13ca0c2", + "as": "default" + }, + "use_selection6": { + "use": "49ae84dc-4474-468f-bf99-c92433fd1cc4", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Admin", + "description": "The Gitea Admin Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/README.md b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/README.md new file mode 100644 index 0000000..3c5387a --- /dev/null +++ b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/README.md @@ -0,0 +1,96 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Collaborator (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Collaborator #Gold { + + list(string $owner, string $repo, ...) : ?array + + check(string $owner, string $repo, ...) : string + + add(string $owner, string $repo, ...) : string + + delete(string $owner, string $repo, ...) : string + + permission(string $owner, string $repo, ...) : ?object +} + +note right of Collaborator::list + List a repository's collaborators. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Collaborator::check + Check if a user is a collaborator of a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $collaborator +end note + +note right of Collaborator::add + Add a collaborator to a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $collaborator + string $permission = null +end note + +note right of Collaborator::delete + Delete a collaborator from a repository. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $collaborator +end note + +note right of Collaborator::permission + Get repository permissions for a user. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $collaborator +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.php b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.php new file mode 100644 index 0000000..38ee512 --- /dev/null +++ b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.php @@ -0,0 +1,175 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Collaborator + * + * @since 3.2.0 + */ +class Collaborator extends Api +{ + /** + * List a repository's collaborators. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Set the page and limit variables. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if a user is a collaborator of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * + * @return string + * @since 3.2.0 + **/ + public function check( + string $owner, + string $repo, + string $collaborator + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri), 204, 'success' + ); + } + + /** + * Add a collaborator to a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * @param string $permission The permission level for the collaborator (optional). + * + * @return string + * @since 3.2.0 + **/ + public function add( + string $owner, + string $repo, + string $collaborator, + string $permission = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Prepare the request body. + $body = new stdClass(); + if ($permission !== null) { + $body->permission = $permission; + } + $bodyJson = json_encode($body); + + // Send the put request. + return $this->response->get( + $this->http->put($uri, $bodyJson), 204, 'success' + ); + } + + /** + * Delete a collaborator from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $collaborator + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Get repository permissions for a user. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * + * @return object|null + * @since 3.2.0 + **/ + public function permission( + string $owner, + string $repo, + string $collaborator + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}/permission"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + +} + diff --git a/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.power b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.power new file mode 100644 index 0000000..91557fa --- /dev/null +++ b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/code.power @@ -0,0 +1,148 @@ + /** + * List a repository's collaborators. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Set the page and limit variables. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Check if a user is a collaborator of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * + * @return string + * @since 3.2.0 + **/ + public function check( + string $owner, + string $repo, + string $collaborator + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri), 204, 'success' + ); + } + + /** + * Add a collaborator to a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * @param string $permission The permission level for the collaborator (optional). + * + * @return string + * @since 3.2.0 + **/ + public function add( + string $owner, + string $repo, + string $collaborator, + string $permission = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Prepare the request body. + $body = new stdClass(); + if ($permission !== null) { + $body->permission = $permission; + } + $bodyJson = json_encode($body); + + // Send the put request. + return $this->response->get( + $this->http->put($uri, $bodyJson), 204, 'success' + ); + } + + /** + * Delete a collaborator from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * + * @return string + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $collaborator + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Get repository permissions for a user. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $collaborator The collaborator username. + * + * @return object|null + * @since 3.2.0 + **/ + public function permission( + string $owner, + string $repo, + string $collaborator + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/collaborators/{$collaborator}/permission"; + + // Get the URI object for the path. + $uri = $this->uri->get($path); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } diff --git a/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/settings.json b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/settings.json new file mode 100644 index 0000000..62d98f8 --- /dev/null +++ b/src/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf", + "implements": null, + "load_selection": null, + "name": "Collaborator", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Collaborator", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Collaborator", + "description": "The Gitea Repository Collaborator\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/README.md b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/README.md new file mode 100644 index 0000000..5bbcd1d --- /dev/null +++ b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/README.md @@ -0,0 +1,72 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Reactions (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Reactions #Gold { + + list(string $owner, string $repo, ...) : ?array + + add(string $owner, string $repo, ...) : ?object + + remove(string $owner, string $repo, ...) : string +} + +note right of Reactions::list + Get a list reactions of an issue. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + int $page = 1 + int $limit = 10 +end note + +note right of Reactions::add + Add a reaction to an issue. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + string $content +end note + +note right of Reactions::remove + Remove a reaction from an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + string $content +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.php b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.php new file mode 100644 index 0000000..7595295 --- /dev/null +++ b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.php @@ -0,0 +1,110 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Reactions + * + * @since 3.2.0 + */ +class Reactions extends Api +{ + /** + * Get a list reactions of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $page The page to get, defaults to 1. + * @param int $limit The number of reactions per page, defaults to 10. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $index, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/reactions"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Set the URI variables. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a reaction to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $content The name of the reaction to add. + * + * @return object|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $index, string $content): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/reactions"; + + // Build the request data. + $data = new \stdClass(); + $data->content = $content; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Remove a reaction from an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $content The name of the reaction to remove. + * + * @return string + * @since 3.2.0 + **/ + public function remove(string $owner, string $repo, int $index, string $content): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/reactions"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('content', $content); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 200, 'success' + ); + } + +} + diff --git a/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.power b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.power new file mode 100644 index 0000000..a381f5c --- /dev/null +++ b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/code.power @@ -0,0 +1,83 @@ + /** + * Get a list reactions of an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $page The page to get, defaults to 1. + * @param int $limit The number of reactions per page, defaults to 10. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $index, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/reactions"; + + // Build the URI. + $uri = $this->uri->get($path); + + // Set the URI variables. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Add a reaction to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $content The name of the reaction to add. + * + * @return object|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $index, string $content): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/reactions"; + + // Build the request data. + $data = new \stdClass(); + $data->content = $content; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Remove a reaction from an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param string $content The name of the reaction to remove. + * + * @return string + * @since 3.2.0 + **/ + public function remove(string $owner, string $repo, int $index, string $content): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/reactions"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('content', $content); + + // Send the delete request. + return $this->response->get( + $this->http->delete($uri), 200, 'success' + ); + } diff --git a/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/settings.json b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/settings.json new file mode 100644 index 0000000..3890803 --- /dev/null +++ b/src/e6c2dee6-54b9-4476-8896-2bfa14a87650/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "e6c2dee6-54b9-4476-8896-2bfa14a87650", + "implements": null, + "load_selection": null, + "name": "Reactions", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Reactions", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Reactions", + "description": "The Gitea Issue Reactions\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e7c16db5-bb22-421b-8789-180f6a502b62/README.md b/src/e7c16db5-bb22-421b-8789-180f6a502b62/README.md new file mode 100644 index 0000000..1fb34eb --- /dev/null +++ b/src/e7c16db5-bb22-421b-8789-180f6a502b62/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea\Settings** +```uml +@startuml +class Repository #Gold { + + get() : ?object +} + +note right of Repository::get + Get instance's global settings for repositories. + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e7c16db5-bb22-421b-8789-180f6a502b62/code.php b/src/e7c16db5-bb22-421b-8789-180f6a502b62/code.php new file mode 100644 index 0000000..adbf908 --- /dev/null +++ b/src/e7c16db5-bb22-421b-8789-180f6a502b62/code.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Settings; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Settings Repository + * + * @since 3.2.0 + */ +class Repository extends Api +{ + /** + * Get instance's global settings for repositories. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/repository"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + +} + diff --git a/src/e7c16db5-bb22-421b-8789-180f6a502b62/code.power b/src/e7c16db5-bb22-421b-8789-180f6a502b62/code.power new file mode 100644 index 0000000..27414d9 --- /dev/null +++ b/src/e7c16db5-bb22-421b-8789-180f6a502b62/code.power @@ -0,0 +1,18 @@ + /** + * Get instance's global settings for repositories. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(): ?object + { + // Build the request path. + $path = "/settings/repository"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } diff --git a/src/e7c16db5-bb22-421b-8789-180f6a502b62/settings.json b/src/e7c16db5-bb22-421b-8789-180f6a502b62/settings.json new file mode 100644 index 0000000..8ce1178 --- /dev/null +++ b/src/e7c16db5-bb22-421b-8789-180f6a502b62/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "e7c16db5-bb22-421b-8789-180f6a502b62", + "implements": null, + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Settings.Repository", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Settings.Repository", + "description": "The Gitea Settings Repository\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/README.md b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/README.md new file mode 100644 index 0000000..6bdc06e --- /dev/null +++ b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/README.md @@ -0,0 +1,94 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Users (Details) +> namespace: **VDM\Joomla\Gitea\Admin** +```uml +@startuml +class Users #Gold { + + list(int $page = 1, int $limit = 10) : ?array + + create(string $loginName, string $email, ...) : ?object + + delete(string $username) : string + + edit(string $username, string $loginName, ...) : ?object +} + +note right of Users::list + List all users. + + since: 3.2.0 + return: ?array +end note + +note right of Users::create + Create a user with extended options. + + since: 3.2.0 + return: ?object + + arguments: + string $loginName + string $email + string $password + string $username + ?string $fullName = null + ?bool $mustChangePassword = null + ?bool $restricted = null + ?bool $sendNotify = null + ?int $sourceId = null + ?string $visibility = null +end note + +note right of Users::delete + Delete a user. + + since: 3.2.0 + return: string +end note + +note right of Users::edit + Edit an existing user. + + since: 3.2.0 + return: ?object + + arguments: + string $username + string $loginName + int $sourceId + bool $active = false + bool $admin = false + bool $allowCreateOrganization = false + bool $allowGitHook = false + bool $allowImportLocal = false + string $description = '' + string $email = '' + string $fullName = '' + string $location = '' + int $maxRepoCreation + bool $mustChangePassword = false + string $password = '' + bool $prohibitLogin = false + bool $restricted = false + string $visibility = '' + string $website = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.php b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.php new file mode 100644 index 0000000..47ec3e5 --- /dev/null +++ b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.php @@ -0,0 +1,207 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Admin; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Admin Users + * + * @since 3.2.0 + */ +class Users extends Api +{ + /** + * List all users. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/admin/users"; + + // build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Create a user with extended options. + * + * @param string $loginName The user's login name. + * @param string $email The user's email address. + * @param string $password The user's password. + * @param string|null $username The username. + * @param string|null $fullName The user's full name (optional). + * @param bool|null $mustChangePassword User must change password on next login (optional). + * @param bool|null $restricted Restrict the user (optional). + * @param bool|null $sendNotify Send a notification email to the user (optional). + * @param int|null $sourceId Source ID (optional). + * @param string|null $visibility The user's visibility (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $loginName, + string $email, + string $password, + string $username, + ?string $fullName = null, + ?bool $mustChangePassword = null, + ?bool $restricted = null, + ?bool $sendNotify = null, + ?int $sourceId = null, + ?string $visibility = null + ): ?object + { + // Build the request path. + $path = "/admin/users"; + + // Set the user data. + $data = new \stdClass(); + $data->login_name = $loginName; + $data->email = $email; + $data->password = $password; + $data->username = $username; + $data->full_name = $fullName; + $data->must_change_password = $mustChangePassword; + $data->restricted = $restricted; + $data->send_notify = $sendNotify; + $data->source_id = $sourceId; + $data->visibility = $visibility; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Delete a user. + * + * @param string $username The user's display name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $username): string + { + // Build the request path. + $path = "/admin/users/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit an existing user. + * + * @param string $username The user's display name. + * @param string $loginName The user's login name. + * @param int $sourceId The user's source ID. + * @param bool $active Optional. Is the user active? Default: false. + * @param bool $admin Optional. Is the user an admin? Default: false. + * @param bool $allowCreateOrganization Optional. Can the user create an organization? Default: false. + * @param bool $allowGitHook Optional. Can the user create Git hooks? Default: false. + * @param bool $allowImportLocal Optional. Can the user import local repositories? Default: false. + * @param string $description Optional. The user's description. Default: ''. + * @param string $email Optional. The user's email address. Default: ''. + * @param string $fullName Optional. The user's full name. Default: ''. + * @param string $location Optional. The user's location. Default: ''. + * @param int $maxRepoCreation Optional. Maximum repositories the user can create. Default: 0. + * @param bool $mustChangePassword Optional. Must the user change their password? Default: false. + * @param string $password Optional. The user's password. Default: ''. + * @param bool $prohibitLogin Optional. Is the user's login prohibited? Default: false. + * @param bool $restricted Optional. Is the user restricted? Default: false. + * @param string $visibility Optional. The user's visibility setting. Default: ''. + * @param string $website Optional. The user's website. Default: ''. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $username, + string $loginName, + int $sourceId, + bool $active = false, + bool $admin = false, + bool $allowCreateOrganization = false, + bool $allowGitHook = false, + bool $allowImportLocal = false, + string $description = '', + string $email = '', + string $fullName = '', + string $location = '', + int $maxRepoCreation = 0, + bool $mustChangePassword = false, + string $password = '', + bool $prohibitLogin = false, + bool $restricted = false, + string $visibility = '', + string $website = '' + ): ?object + { + // Build the request path. + $path = "/admin/users/{$username}"; + + // Set the data. + $data = [ + 'login_name' => $loginName, + 'source_id' => $sourceId, + 'active' => $active, + 'admin' => $admin, + 'allow_create_organization' => $allowCreateOrganization, + 'allow_git_hook' => $allowGitHook, + 'allow_import_local' => $allowImportLocal, + 'description' => $description, + 'email' => $email, + 'full_name' => $fullName, + 'location' => $location, + 'max_repo_creation' => $maxRepoCreation, + 'must_change_password' => $mustChangePassword, + 'password' => $password, + 'prohibit_login' => $prohibitLogin, + 'restricted' => $restricted, + 'visibility' => $visibility, + 'website' => $website + ]; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + +} + diff --git a/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.power b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.power new file mode 100644 index 0000000..920de51 --- /dev/null +++ b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/code.power @@ -0,0 +1,180 @@ + /** + * List all users. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/admin/users"; + + // build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Create a user with extended options. + * + * @param string $loginName The user's login name. + * @param string $email The user's email address. + * @param string $password The user's password. + * @param string|null $username The username. + * @param string|null $fullName The user's full name (optional). + * @param bool|null $mustChangePassword User must change password on next login (optional). + * @param bool|null $restricted Restrict the user (optional). + * @param bool|null $sendNotify Send a notification email to the user (optional). + * @param int|null $sourceId Source ID (optional). + * @param string|null $visibility The user's visibility (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $loginName, + string $email, + string $password, + string $username, + ?string $fullName = null, + ?bool $mustChangePassword = null, + ?bool $restricted = null, + ?bool $sendNotify = null, + ?int $sourceId = null, + ?string $visibility = null + ): ?object + { + // Build the request path. + $path = "/admin/users"; + + // Set the user data. + $data = new \stdClass(); + $data->login_name = $loginName; + $data->email = $email; + $data->password = $password; + $data->username = $username; + $data->full_name = $fullName; + $data->must_change_password = $mustChangePassword; + $data->restricted = $restricted; + $data->send_notify = $sendNotify; + $data->source_id = $sourceId; + $data->visibility = $visibility; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Delete a user. + * + * @param string $username The user's display name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $username): string + { + // Build the request path. + $path = "/admin/users/{$username}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit an existing user. + * + * @param string $username The user's display name. + * @param string $loginName The user's login name. + * @param int $sourceId The user's source ID. + * @param bool $active Optional. Is the user active? Default: false. + * @param bool $admin Optional. Is the user an admin? Default: false. + * @param bool $allowCreateOrganization Optional. Can the user create an organization? Default: false. + * @param bool $allowGitHook Optional. Can the user create Git hooks? Default: false. + * @param bool $allowImportLocal Optional. Can the user import local repositories? Default: false. + * @param string $description Optional. The user's description. Default: ''. + * @param string $email Optional. The user's email address. Default: ''. + * @param string $fullName Optional. The user's full name. Default: ''. + * @param string $location Optional. The user's location. Default: ''. + * @param int $maxRepoCreation Optional. Maximum repositories the user can create. Default: 0. + * @param bool $mustChangePassword Optional. Must the user change their password? Default: false. + * @param string $password Optional. The user's password. Default: ''. + * @param bool $prohibitLogin Optional. Is the user's login prohibited? Default: false. + * @param bool $restricted Optional. Is the user restricted? Default: false. + * @param string $visibility Optional. The user's visibility setting. Default: ''. + * @param string $website Optional. The user's website. Default: ''. + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $username, + string $loginName, + int $sourceId, + bool $active = false, + bool $admin = false, + bool $allowCreateOrganization = false, + bool $allowGitHook = false, + bool $allowImportLocal = false, + string $description = '', + string $email = '', + string $fullName = '', + string $location = '', + int $maxRepoCreation = 0, + bool $mustChangePassword = false, + string $password = '', + bool $prohibitLogin = false, + bool $restricted = false, + string $visibility = '', + string $website = '' + ): ?object + { + // Build the request path. + $path = "/admin/users/{$username}"; + + // Set the data. + $data = [ + 'login_name' => $loginName, + 'source_id' => $sourceId, + 'active' => $active, + 'admin' => $admin, + 'allow_create_organization' => $allowCreateOrganization, + 'allow_git_hook' => $allowGitHook, + 'allow_import_local' => $allowImportLocal, + 'description' => $description, + 'email' => $email, + 'full_name' => $fullName, + 'location' => $location, + 'max_repo_creation' => $maxRepoCreation, + 'must_change_password' => $mustChangePassword, + 'password' => $password, + 'prohibit_login' => $prohibitLogin, + 'restricted' => $restricted, + 'visibility' => $visibility, + 'website' => $website + ]; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } diff --git a/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/settings.json b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/settings.json new file mode 100644 index 0000000..7bca124 --- /dev/null +++ b/src/e7c810a1-3d6a-42e4-b45f-bee554f259b3/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "e7c810a1-3d6a-42e4-b45f-bee554f259b3", + "implements": null, + "load_selection": null, + "name": "Users", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Admin.Users", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Admin.Users", + "description": "The Gitea Admin Users\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e819d1a2-4390-432d-be36-3421f2fa861c/README.md b/src/e819d1a2-4390-432d-be36-3421f2fa861c/README.md new file mode 100644 index 0000000..016a058 --- /dev/null +++ b/src/e819d1a2-4390-432d-be36-3421f2fa861c/README.md @@ -0,0 +1,111 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Labels (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Labels #Gold { + + list(string $owner, string $repo, ...) : ?array + + get(string $owner, string $repo, ...) : ?array + + replace(string $owner, string $repo, ...) : object + + add(string $owner, string $repo, ...) : ?array + + remove(string $owner, string $repo, ...) : string + + clear(string $owner, string $repo, ...) : string +} + +note right of Labels::list + Get all of a repository's labels. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $page = 1 + int $limit = 10 +end note + +note right of Labels::get + Get an issue's labels. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index +end note + +note right of Labels::replace + Replace an issue's labels. + + since: 3.2.0 + return: object + + arguments: + string $owner + string $repo + int $index + array $labels +end note + +note right of Labels::add + Add a label to an issue. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + array $labels +end note + +note right of Labels::remove + Remove a label from an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + int $labelId +end note + +note right of Labels::clear + Remove all labels from an issue. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e819d1a2-4390-432d-be36-3421f2fa861c/code.php b/src/e819d1a2-4390-432d-be36-3421f2fa861c/code.php new file mode 100644 index 0000000..fda80dc --- /dev/null +++ b/src/e819d1a2-4390-432d-be36-3421f2fa861c/code.php @@ -0,0 +1,181 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Labels + * + * @since 3.2.0 + */ +class Labels extends Api +{ + /** + * Get all of a repository's labels. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels"; + + // Get the URI object with the request path. + $uri = $this->uri->get($path); + + // Add the page and limit query parameters if provided. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get an issue's labels. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return array|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $index): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Replace an issue's labels. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param array $labels An array of labels to replace the current issue labels. + * + * @return object + * @since 3.2.0 + **/ + public function replace(string $owner, string $repo, int $index, array $labels): object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Build the request data. + $data = new \stdClass(); + $data->labels = $labels; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Add a label to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param array $labels An array of label IDs to add. + * + * @return array|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $index, array $labels): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Build the request data. + $data = new \stdClass(); + $data->labels = $labels; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Remove a label from an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $labelId The ID of the label to remove. + * + * @return string + * @since 3.2.0 + **/ + public function remove(string $owner, string $repo, int $index, int $labelId): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels/{$labelId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Remove all labels from an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function clear(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/e819d1a2-4390-432d-be36-3421f2fa861c/code.power b/src/e819d1a2-4390-432d-be36-3421f2fa861c/code.power new file mode 100644 index 0000000..3ed7212 --- /dev/null +++ b/src/e819d1a2-4390-432d-be36-3421f2fa861c/code.power @@ -0,0 +1,154 @@ + /** + * Get all of a repository's labels. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $page The page number of results to return (1-based). + * @param int $limit The page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list(string $owner, string $repo, int $page = 1, int $limit = 10): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/labels"; + + // Get the URI object with the request path. + $uri = $this->uri->get($path); + + // Add the page and limit query parameters if provided. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get an issue's labels. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return array|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $index): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Replace an issue's labels. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param array $labels An array of labels to replace the current issue labels. + * + * @return object + * @since 3.2.0 + **/ + public function replace(string $owner, string $repo, int $index, array $labels): object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Build the request data. + $data = new \stdClass(); + $data->labels = $labels; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Add a label to an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param array $labels An array of label IDs to add. + * + * @return array|null + * @since 3.2.0 + **/ + public function add(string $owner, string $repo, int $index, array $labels): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Build the request data. + $data = new \stdClass(); + $data->labels = $labels; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Remove a label from an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * @param int $labelId The ID of the label to remove. + * + * @return string + * @since 3.2.0 + **/ + public function remove(string $owner, string $repo, int $index, int $labelId): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels/{$labelId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Remove all labels from an issue. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param int $index The issue index. + * + * @return string + * @since 3.2.0 + **/ + public function clear(string $owner, string $repo, int $index): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/issues/{$index}/labels"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/e819d1a2-4390-432d-be36-3421f2fa861c/settings.json b/src/e819d1a2-4390-432d-be36-3421f2fa861c/settings.json new file mode 100644 index 0000000..29ff371 --- /dev/null +++ b/src/e819d1a2-4390-432d-be36-3421f2fa861c/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "e819d1a2-4390-432d-be36-3421f2fa861c", + "implements": null, + "load_selection": null, + "name": "Labels", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Labels", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Labels", + "description": "The Gitea Issue Labels\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/README.md b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/README.md new file mode 100644 index 0000000..e3b605f --- /dev/null +++ b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/README.md @@ -0,0 +1,127 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repository (Details) +> namespace: **VDM\Joomla\Gitea** +```uml +@startuml +class Repository #Gold { + + search(string $q, array $options = [], ...) : ?object + + get(string $owner, string $repo) : ?object + + id(string $owner, string $repo) : ?object + + delete(string $owner, string $repo) : string + + edit(string $owner, string $repo, ...) : ?object + + create(string $name, ?string $description = null, ...) : ?object +} + +note right of Repository::search + Search for repositories. + + since: 3.2.0 + return: ?object + + arguments: + string $q + array $options = [] + int $page = 1 + int $limit = 10 + string $sort = 'alpha' + string $order = 'asc' +end note + +note right of Repository::get + Get a repository. + + since: 3.2.0 + return: ?object +end note + +note right of Repository::id + Get a repository by owner and repo name. + + since: 3.2.0 + return: ?object +end note + +note right of Repository::delete + Delete a repository. + + since: 3.2.0 + return: string +end note + +note right of Repository::edit + Edit a repository's properties. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + ?string $description = null + ?string $website = null + ?bool $private = null + ?bool $hasIssues = null + ?bool $hasWiki = null + ?bool $hasProjects = null + ?bool $allowManualMerge = null + ?bool $allowMergeCommits = null + ?bool $allowRebase = null + ?bool $allowRebaseExplicit = null + ?bool $allowRebaseUpdate = null + ?bool $allowSquashMerge = null + ?bool $archived = null + ?bool $autodetectManualMerge = null + ?string $defaultBranch = null + ?bool $defaultDeleteBranchAfterMerge = null + ?string $defaultMergeStyle = null + ?bool $enablePrune = null + ?object $externalTracker = null + ?object $externalWiki = null + ?bool $hasPullRequests = null + ?bool $ignoreWhitespaceConflicts = null + ?object $internalTracker = null + ?string $mirrorInterval = null + ?bool $template = null +end note + +note right of Repository::create + Create a repository. + + since: 3.2.0 + return: ?object + + arguments: + string $name + ?string $description = null + ?bool $private = null + ?bool $autoInit = null + ?string $defaultBranch = null + ?string $gitignores = null + ?string $issueLabels = null + ?string $license = null + ?string $readme = null + ?bool $template = null + ?string $trustModel = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.php b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.php new file mode 100644 index 0000000..c1e7126 --- /dev/null +++ b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.php @@ -0,0 +1,439 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository + * + * @since 3.2.0 + */ +class Repository extends Api +{ + /** + * Search for repositories. + * + * @param string $q The search query. + * @param array $options Additional search options (optional). + * @param int $page The page number (optional). + * @param int $limit The number of items per page (optional). + * @param string $sort The sort order (optional). + * @param string $order The order direction (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function search( + string $q, + array $options = [], + int $page = 1, + int $limit = 10, + string $sort = 'alpha', + string $order = 'asc' + ): ?object + { + // Build the request path. + $path = '/repos/search'; + + // Create the URI object and set URL values. + $uri = $this->uri->get($path); + $uri->setVar('q', $q); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + $uri->setVar('sort', $sort); + $uri->setVar('order', $order); + + foreach ($options as $key => $val) + { + $uri->setVar($key, $val); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get a repository by owner and repo name. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function id(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a repository's properties. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $description The repository description (optional). + * @param string|null $website The repository website (optional). + * @param bool|null $private Set the repository to private (optional). + * @param bool|null $hasIssues Set the repository to have issues (optional). + * @param bool|null $hasWiki Set the repository to have a wiki (optional). + * @param bool|null $hasProjects Set the repository to have projects (optional). + * @param bool|null $allowManualMerge Allow manual merge of pull requests (optional). + * @param bool|null $allowMergeCommits Allow merge commits for pull requests (optional). + * @param bool|null $allowRebase Allow rebase-merging pull requests (optional). + * @param bool|null $allowRebaseExplicit Allow rebase with explicit merge commits (optional). + * @param bool|null $allowRebaseUpdate Allow updating pull request branch by rebase (optional). + * @param bool|null $allowSquashMerge Allow squash-merging pull requests (optional). + * @param bool|null $archived + * @param bool|null $archived Set to true to archive this repository (optional). + * @param bool|null $autodetectManualMerge Enable AutodetectManualMerge (optional). + * @param string|null $defaultBranch Sets the default branch for this repository (optional). + * @param bool|null $defaultDeleteBranchAfterMerge Set to true to delete pr branch after merge by default (optional). + * @param string|null $defaultMergeStyle Set to a merge style to be used by this repository (optional). + * @param bool|null $enablePrune Enable prune - remove obsolete remote-tracking references (optional). + * @param object|null $externalTracker External tracker settings (optional). + * @param object|null $externalWiki External wiki settings (optional). + * @param bool|null $hasPullRequests Set the repository to have pull requests (optional). + * @param bool|null $ignoreWhitespaceConflicts Ignore whitespace for conflicts (optional). + * @param object|null $internalTracker Internal tracker settings (optional). + * @param string|null $mirrorInterval Set the mirror interval time (optional). + * @param bool|null $template Set to true to make this repository a template (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + ?string $description = null, + ?string $website = null, + ?bool $private = null, + ?bool $hasIssues = null, + ?bool $hasWiki = null, + ?bool $hasProjects = null, + ?bool $allowManualMerge = null, + ?bool $allowMergeCommits = null, + ?bool $allowRebase = null, + ?bool $allowRebaseExplicit = null, + ?bool $allowRebaseUpdate = null, + ?bool $allowSquashMerge = null, + ?bool $archived = null, + ?bool $autodetectManualMerge = null, + ?string $defaultBranch = null, + ?bool $defaultDeleteBranchAfterMerge = null, + ?string $defaultMergeStyle = null, + ?bool $enablePrune = null, + ?object $externalTracker = null, + ?object $externalWiki = null, + ?bool $hasPullRequests = null, + ?bool $ignoreWhitespaceConflicts = null, + ?object $internalTracker = null, + ?string $mirrorInterval = null, + ?bool $template = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Set the repository properties to update. + $data = new \stdClass(); + + if ($description !== null) + { + $data->description = $description; + } + + if ($website !== null) + { + $data->website = $website; + } + + if ($private !== null) + { + $data->private = $private; + } + + if ($hasIssues !== null) + { + $data->has_issues = $hasIssues; + } + + if ($hasWiki !== null) + { + $data->has_wiki = $hasWiki; + } + + if ($hasProjects !== null) + { + $data->has_projects = $hasProjects; + } + + // Add the additional properties to update. + if ($allowManualMerge !== null) + { + $data->allow_manual_merge = $allowManualMerge; + } + + if ($allowMergeCommits !== null) + { + $data->allow_merge_commits = $allowMergeCommits; + } + + if ($allowRebase !== null) + { + $data->allow_rebase = $allowRebase; + } + + if ($allowRebaseExplicit !== null) + { + $data->allow_rebase_explicit = $allowRebaseExplicit; + } + + if ($allowRebaseUpdate !== null) + { + $data->allow_rebase_update = $allowRebaseUpdate; + } + + if ($allowSquashMerge !== null) + { + $data->allow_squash_merge = $allowSquashMerge; + } + + if ($archived !== null) + { + $data->archived = $archived; + } + + if ($autodetectManualMerge !== null) + { + $data->autodetect_manual_merge = $autodetectManualMerge; + } + + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + + if ($defaultDeleteBranchAfterMerge !== null) + { + $data->default_delete_branch_after_merge = $defaultDeleteBranchAfterMerge; + } + + if ($defaultMergeStyle !== + null) + { + $data->default_merge_style = $defaultMergeStyle; + } + + if ($enablePrune !== null) + { + $data->enable_prune = $enablePrune; + } + + if ($externalTracker !== null) + { + $data->external_tracker = $externalTracker; + } + + if ($externalWiki !== null) + { + $data->external_wiki = $externalWiki; + } + + if ($hasPullRequests !== null) + { + $data->has_pull_requests = $hasPullRequests; + } + + if ($ignoreWhitespaceConflicts !== null) + { + $data->ignore_whitespace_conflicts = $ignoreWhitespaceConflicts; + } + + if ($internalTracker !== null) + { + $data->internal_tracker = $internalTracker; + } + + if ($mirrorInterval !== null) + { + $data->mirror_interval = $mirrorInterval; + } + + if ($template !== null) + { + $data->template = $template; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Create a repository. + * + * @param string $name The name of the new repository. + * @param string|null $description Optional. The description of the new repository. + * @param bool|null $private Optional. Set to true if the new repository should be private. + * @param bool|null $autoInit Optional. Set to true to initialize the repository with a README. + * @param string|null $defaultBranch Optional. Default branch of the repository (used when initializes and in template). + * @param string|null $gitignores Optional. The desired .gitignore templates to apply. + * @param string|null $issueLabels Optional. Label-Set to use. + * @param string|null $license Optional. The desired license for the repository. + * @param string|null $readme Optional. Readme of the repository to create. + * @param bool|null $template Optional. Set to true if the repository is a template. + * @param string|null $trustModel Optional. TrustModel of the repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $name, + ?string $description = null, + ?bool $private = null, + ?bool $autoInit = null, + ?string $defaultBranch = null, + ?string $gitignores = null, + ?string $issueLabels = null, + ?string $license = null, + ?string $readme = null, + ?bool $template = null, + ?string $trustModel = null + ): ?object { + // Build the request path. + $path = "/user/repos"; + + // Set the repo data. + $data = new \stdClass(); + $data->name = $name; + + if ($description !== null) + { + $data->description = $description; + } + + if ($private !== null) + { + $data->private = $private; + } + + if ($autoInit !== null) + { + $data->auto_init = $autoInit; + } + + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + + if ($gitignores !== null) + { + $data->gitignores = $gitignores; + } + + if ($issueLabels !== null) + { + $data->issue_labels = $issueLabels; + } + + if ($license !== null) + { + $data->license = $license; + } + + if ($readme !== null) + { + $data->readme = $readme; + } + + if ($template !== null) + { + $data->template = $template; + } + + if ($trustModel !== null) + { + $data->trust_model = $trustModel; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + +} + diff --git a/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.power b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.power new file mode 100644 index 0000000..00a7d3b --- /dev/null +++ b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/code.power @@ -0,0 +1,412 @@ + /** + * Search for repositories. + * + * @param string $q The search query. + * @param array $options Additional search options (optional). + * @param int $page The page number (optional). + * @param int $limit The number of items per page (optional). + * @param string $sort The sort order (optional). + * @param string $order The order direction (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function search( + string $q, + array $options = [], + int $page = 1, + int $limit = 10, + string $sort = 'alpha', + string $order = 'asc' + ): ?object + { + // Build the request path. + $path = '/repos/search'; + + // Create the URI object and set URL values. + $uri = $this->uri->get($path); + $uri->setVar('q', $q); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + $uri->setVar('sort', $sort); + $uri->setVar('order', $order); + + foreach ($options as $key => $val) + { + $uri->setVar($key, $val); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get a repository by owner and repo name. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return object|null + * @since 3.2.0 + **/ + public function id(string $owner, string $repo): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Edit a repository's properties. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $description The repository description (optional). + * @param string|null $website The repository website (optional). + * @param bool|null $private Set the repository to private (optional). + * @param bool|null $hasIssues Set the repository to have issues (optional). + * @param bool|null $hasWiki Set the repository to have a wiki (optional). + * @param bool|null $hasProjects Set the repository to have projects (optional). + * @param bool|null $allowManualMerge Allow manual merge of pull requests (optional). + * @param bool|null $allowMergeCommits Allow merge commits for pull requests (optional). + * @param bool|null $allowRebase Allow rebase-merging pull requests (optional). + * @param bool|null $allowRebaseExplicit Allow rebase with explicit merge commits (optional). + * @param bool|null $allowRebaseUpdate Allow updating pull request branch by rebase (optional). + * @param bool|null $allowSquashMerge Allow squash-merging pull requests (optional). + * @param bool|null $archived + * @param bool|null $archived Set to true to archive this repository (optional). + * @param bool|null $autodetectManualMerge Enable AutodetectManualMerge (optional). + * @param string|null $defaultBranch Sets the default branch for this repository (optional). + * @param bool|null $defaultDeleteBranchAfterMerge Set to true to delete pr branch after merge by default (optional). + * @param string|null $defaultMergeStyle Set to a merge style to be used by this repository (optional). + * @param bool|null $enablePrune Enable prune - remove obsolete remote-tracking references (optional). + * @param object|null $externalTracker External tracker settings (optional). + * @param object|null $externalWiki External wiki settings (optional). + * @param bool|null $hasPullRequests Set the repository to have pull requests (optional). + * @param bool|null $ignoreWhitespaceConflicts Ignore whitespace for conflicts (optional). + * @param object|null $internalTracker Internal tracker settings (optional). + * @param string|null $mirrorInterval Set the mirror interval time (optional). + * @param bool|null $template Set to true to make this repository a template (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function edit( + string $owner, + string $repo, + ?string $description = null, + ?string $website = null, + ?bool $private = null, + ?bool $hasIssues = null, + ?bool $hasWiki = null, + ?bool $hasProjects = null, + ?bool $allowManualMerge = null, + ?bool $allowMergeCommits = null, + ?bool $allowRebase = null, + ?bool $allowRebaseExplicit = null, + ?bool $allowRebaseUpdate = null, + ?bool $allowSquashMerge = null, + ?bool $archived = null, + ?bool $autodetectManualMerge = null, + ?string $defaultBranch = null, + ?bool $defaultDeleteBranchAfterMerge = null, + ?string $defaultMergeStyle = null, + ?bool $enablePrune = null, + ?object $externalTracker = null, + ?object $externalWiki = null, + ?bool $hasPullRequests = null, + ?bool $ignoreWhitespaceConflicts = null, + ?object $internalTracker = null, + ?string $mirrorInterval = null, + ?bool $template = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}"; + + // Set the repository properties to update. + $data = new \stdClass(); + + if ($description !== null) + { + $data->description = $description; + } + + if ($website !== null) + { + $data->website = $website; + } + + if ($private !== null) + { + $data->private = $private; + } + + if ($hasIssues !== null) + { + $data->has_issues = $hasIssues; + } + + if ($hasWiki !== null) + { + $data->has_wiki = $hasWiki; + } + + if ($hasProjects !== null) + { + $data->has_projects = $hasProjects; + } + + // Add the additional properties to update. + if ($allowManualMerge !== null) + { + $data->allow_manual_merge = $allowManualMerge; + } + + if ($allowMergeCommits !== null) + { + $data->allow_merge_commits = $allowMergeCommits; + } + + if ($allowRebase !== null) + { + $data->allow_rebase = $allowRebase; + } + + if ($allowRebaseExplicit !== null) + { + $data->allow_rebase_explicit = $allowRebaseExplicit; + } + + if ($allowRebaseUpdate !== null) + { + $data->allow_rebase_update = $allowRebaseUpdate; + } + + if ($allowSquashMerge !== null) + { + $data->allow_squash_merge = $allowSquashMerge; + } + + if ($archived !== null) + { + $data->archived = $archived; + } + + if ($autodetectManualMerge !== null) + { + $data->autodetect_manual_merge = $autodetectManualMerge; + } + + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + + if ($defaultDeleteBranchAfterMerge !== null) + { + $data->default_delete_branch_after_merge = $defaultDeleteBranchAfterMerge; + } + + if ($defaultMergeStyle !== + null) + { + $data->default_merge_style = $defaultMergeStyle; + } + + if ($enablePrune !== null) + { + $data->enable_prune = $enablePrune; + } + + if ($externalTracker !== null) + { + $data->external_tracker = $externalTracker; + } + + if ($externalWiki !== null) + { + $data->external_wiki = $externalWiki; + } + + if ($hasPullRequests !== null) + { + $data->has_pull_requests = $hasPullRequests; + } + + if ($ignoreWhitespaceConflicts !== null) + { + $data->ignore_whitespace_conflicts = $ignoreWhitespaceConflicts; + } + + if ($internalTracker !== null) + { + $data->internal_tracker = $internalTracker; + } + + if ($mirrorInterval !== null) + { + $data->mirror_interval = $mirrorInterval; + } + + if ($template !== null) + { + $data->template = $template; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ) + ); + } + + /** + * Create a repository. + * + * @param string $name The name of the new repository. + * @param string|null $description Optional. The description of the new repository. + * @param bool|null $private Optional. Set to true if the new repository should be private. + * @param bool|null $autoInit Optional. Set to true to initialize the repository with a README. + * @param string|null $defaultBranch Optional. Default branch of the repository (used when initializes and in template). + * @param string|null $gitignores Optional. The desired .gitignore templates to apply. + * @param string|null $issueLabels Optional. Label-Set to use. + * @param string|null $license Optional. The desired license for the repository. + * @param string|null $readme Optional. Readme of the repository to create. + * @param bool|null $template Optional. Set to true if the repository is a template. + * @param string|null $trustModel Optional. TrustModel of the repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $name, + ?string $description = null, + ?bool $private = null, + ?bool $autoInit = null, + ?string $defaultBranch = null, + ?string $gitignores = null, + ?string $issueLabels = null, + ?string $license = null, + ?string $readme = null, + ?bool $template = null, + ?string $trustModel = null + ): ?object { + // Build the request path. + $path = "/user/repos"; + + // Set the repo data. + $data = new \stdClass(); + $data->name = $name; + + if ($description !== null) + { + $data->description = $description; + } + + if ($private !== null) + { + $data->private = $private; + } + + if ($autoInit !== null) + { + $data->auto_init = $autoInit; + } + + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + + if ($gitignores !== null) + { + $data->gitignores = $gitignores; + } + + if ($issueLabels !== null) + { + $data->issue_labels = $issueLabels; + } + + if ($license !== null) + { + $data->license = $license; + } + + if ($readme !== null) + { + $data->readme = $readme; + } + + if ($template !== null) + { + $data->template = $template; + } + + if ($trustModel !== null) + { + $data->trust_model = $trustModel; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } diff --git a/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/settings.json b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/settings.json new file mode 100644 index 0000000..56d9219 --- /dev/null +++ b/src/eb6c050d-7100-42b8-a922-f7e7c78a08c2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "eb6c050d-7100-42b8-a922-f7e7c78a08c2", + "implements": null, + "load_selection": null, + "name": "Repository", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "description": "The Gitea Repository\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/README.md b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/README.md new file mode 100644 index 0000000..b6964da --- /dev/null +++ b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Gpg (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Gpg #Gold { + + createGPGKey(string $armoredPublicKey, ?string $armoredSignature = null) : ?object + + get(int $id) : ?object + + token() : ?string + + verify(string $armoredPublicKey) : ?object + + list(int $page = 1, int $limit = 10) : ?array + + remove(int $id) : string +} + +note right of Gpg::createGPGKey + Create a GPG key for the authenticated user. + + since: 3.2.0 + return: ?object +end note + +note right of Gpg::get + Get a GPG key for the authenticated user. + + since: 3.2.0 + return: ?object +end note + +note right of Gpg::token + Get a token to verify. + + since: 3.2.0 + return: ?string +end note + +note right of Gpg::verify + Verify a GPG key. + + since: 3.2.0 + return: ?object +end note + +note right of Gpg::list + List the authenticated user's GPG keys. + + since: 3.2.0 + return: ?array +end note + +note right of Gpg::remove + Remove a GPG key for the authenticated user. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.php b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.php new file mode 100644 index 0000000..bf8f6c6 --- /dev/null +++ b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.php @@ -0,0 +1,173 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Gpg + * + * @since 3.2.0 + */ +class Gpg extends Api +{ + /** + * Create a GPG key for the authenticated user. + * + * @param string $armoredPublicKey The armored public GPG key. + * @param string|null $armoredSignature The armored signature (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function createGPGKey( + string $armoredPublicKey, + ?string $armoredSignature = null + ): ?object + { + // Build the request path. + $path = '/user/gpg_keys'; + + // Set the GPG key data. + $data = array_filter([ + 'armored_public_key' => $armoredPublicKey, + 'armored_signature' => $armoredSignature + ]); + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a GPG key for the authenticated user. + * + * @param int $id The GPG key ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/user/gpg_keys/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get a token to verify. + * + * @return string|null + * @since 3.2.0 + **/ + public function token(): ?string + { + // Build the request path. + $path = '/user/gpg_key_token'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Verify a GPG key. + * + * @param string $armoredPublicKey The armored public GPG key. + * + * @return object|null + * @since 3.2.0 + **/ + public function verify(string $armoredPublicKey): ?object + { + // Build the request path. + $path = '/user/gpg_key_verify'; + + // Set the GPG key data. + $data = new \stdClass(); + $data->armoredPublicKey = $armoredPublicKey; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * List the authenticated user's GPG keys. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/gpg_keys'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Remove a GPG key for the authenticated user. + * + * @param int $id The GPG key ID. + * + * @return string + * @since 3.2.0 + **/ + public function remove(int $id): string + { + // Build the request path. + $path = "/user/gpg_keys/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.power b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.power new file mode 100644 index 0000000..97d6395 --- /dev/null +++ b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/code.power @@ -0,0 +1,146 @@ + /** + * Create a GPG key for the authenticated user. + * + * @param string $armoredPublicKey The armored public GPG key. + * @param string|null $armoredSignature The armored signature (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function createGPGKey( + string $armoredPublicKey, + ?string $armoredSignature = null + ): ?object + { + // Build the request path. + $path = '/user/gpg_keys'; + + // Set the GPG key data. + $data = array_filter([ + 'armored_public_key' => $armoredPublicKey, + 'armored_signature' => $armoredSignature + ]); + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get a GPG key for the authenticated user. + * + * @param int $id The GPG key ID. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(int $id): ?object + { + // Build the request path. + $path = "/user/gpg_keys/{$id}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Get a token to verify. + * + * @return string|null + * @since 3.2.0 + **/ + public function token(): ?string + { + // Build the request path. + $path = '/user/gpg_key_token'; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Verify a GPG key. + * + * @param string $armoredPublicKey The armored public GPG key. + * + * @return object|null + * @since 3.2.0 + **/ + public function verify(string $armoredPublicKey): ?object + { + // Build the request path. + $path = '/user/gpg_key_verify'; + + // Set the GPG key data. + $data = new \stdClass(); + $data->armoredPublicKey = $armoredPublicKey; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * List the authenticated user's GPG keys. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/gpg_keys'; + + // Build the URL + $url = $this->uri->get($path); + $url->setVar('page', $page); + $url->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($url) + ); + } + + /** + * Remove a GPG key for the authenticated user. + * + * @param int $id The GPG key ID. + * + * @return string + * @since 3.2.0 + **/ + public function remove(int $id): string + { + // Build the request path. + $path = "/user/gpg_keys/{$id}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/settings.json b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/settings.json new file mode 100644 index 0000000..4bae7ee --- /dev/null +++ b/src/f135ca7f-4d50-4480-a15f-feae1a7982ab/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "f135ca7f-4d50-4480-a15f-feae1a7982ab", + "implements": null, + "load_selection": null, + "name": "Gpg", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Gpg", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Gpg", + "description": "The Gitea User Gpg\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/README.md b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/README.md new file mode 100644 index 0000000..fa4ca51 --- /dev/null +++ b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/README.md @@ -0,0 +1,104 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Milestones (Details) +> namespace: **VDM\Joomla\Gitea\Issue** +```uml +@startuml +class Milestones #Gold { + + create(string $owner, string $repo, ...) : ?object + + list(string $owner, string $repo, ...) : ?array + + get(string $owner, string $repo, ...) : ?object + + delete(string $owner, string $repo, ...) : string + + update(string $owner, string $repo, ...) : ?object +} + +note right of Milestones::create + Create a milestone. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $title + ?string $description = null + ?string $dueOn = null + ?string $state = 'open' +end note + +note right of Milestones::list + Get all of a repository's opened milestones. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + ?string $state = 'open' + ?string $name = null + ?int $page = null + ?int $limit = null +end note + +note right of Milestones::get + Get a milestone. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $milestoneId +end note + +note right of Milestones::delete + Delete a milestone. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + string $milestoneId +end note + +note right of Milestones::update + Update a milestone. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $milestoneId + string $title = null + string $description = null + string $dueOn = null + string $state = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.php b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.php new file mode 100644 index 0000000..5178a73 --- /dev/null +++ b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.php @@ -0,0 +1,230 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Issue; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Issue Milestones + * + * @since 3.2.0 + */ +class Milestones extends Api +{ + /** + * Create a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $title The title of the milestone. + * @param string|null $description Optional. The description of the milestone. + * @param string|null $dueOn Optional. The due date of the milestone. + * @param string|null $state Optional. The state of the milestone. Default is 'open'. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $title, + ?string $description = null, + ?string $dueOn = null, + ?string $state = 'open' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the required data. + $data->title = $title; + + // Set all the optional data that has been provided. + if ($description !== null) + { + $data->description = $description; + } + if ($dueOn !== null) + { + $data->due_on = $dueOn; + } + if ($state !== null) + { + $data->state = $state; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get all of a repository's opened milestones. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string|null $state Optional. Milestone state. Recognized values are open, closed, and all. Defaults to "open". + * @param string|null $name Optional. Filter by milestone name. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + ?string $state = 'open', + ?string $name = null, + ?int $page = null, + ?int $limit = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('state', $state); + if ($name !== null) + { + $uri->setVar('name', $name); + } + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $milestoneId The ID of the milestone. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $milestoneId): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones/{$milestoneId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $milestoneId The ID of the milestone to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, string $milestoneId): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones/{$milestoneId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $milestoneId The ID of the milestone to update. + * @param string $title Optional. The new title of the milestone. + * @param string $description Optional. The new description of the milestone. + * @param string $dueOn Optional. The new due date of the milestone. + * @param string $state Optional. The new state of the milestone. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $milestoneId, + string $title = null, + string $description = null, + string $dueOn = null, + string $state = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the optional data that has been provided. + if ($title !== null) + { + $data->title = $title; + } + if ($description !== null) + { + $data->description = $description; + } + if ($dueOn !== null) + { + $data->due_on = $dueOn; + } + if ($state !== null) + { + $data->state = $state; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones/{$milestoneId}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } + +} + diff --git a/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.power b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.power new file mode 100644 index 0000000..91f5512 --- /dev/null +++ b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/code.power @@ -0,0 +1,203 @@ + /** + * Create a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $title The title of the milestone. + * @param string|null $description Optional. The description of the milestone. + * @param string|null $dueOn Optional. The due date of the milestone. + * @param string|null $state Optional. The state of the milestone. Default is 'open'. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $title, + ?string $description = null, + ?string $dueOn = null, + ?string $state = 'open' + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the required data. + $data->title = $title; + + // Set all the optional data that has been provided. + if ($description !== null) + { + $data->description = $description; + } + if ($dueOn !== null) + { + $data->due_on = $dueOn; + } + if ($state !== null) + { + $data->state = $state; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones"; + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * Get all of a repository's opened milestones. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string|null $state Optional. Milestone state. Recognized values are open, closed, and all. Defaults to "open". + * @param string|null $name Optional. Filter by milestone name. + * @param int|null $page Optional. Page number of results to return (1-based). + * @param int|null $limit Optional. Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + string $owner, + string $repo, + ?string $state = 'open', + ?string $name = null, + ?int $page = null, + ?int $limit = null + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones"; + + // Build the URI. + $uri = $this->uri->get($path); + $uri->setVar('state', $state); + if ($name !== null) + { + $uri->setVar('name', $name); + } + if ($page !== null) + { + $uri->setVar('page', $page); + } + if ($limit !== null) + { + $uri->setVar('limit', $limit); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $milestoneId The ID of the milestone. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $milestoneId): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones/{$milestoneId}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Delete a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $milestoneId The ID of the milestone to delete. + * + * @return string + * @since 3.2.0 + **/ + public function delete(string $owner, string $repo, string $milestoneId): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones/{$milestoneId}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + + /** + * Update a milestone. + * + * @param string $owner The owner name. + * @param string $repo The repo name. + * @param string $milestoneId The ID of the milestone to update. + * @param string $title Optional. The new title of the milestone. + * @param string $description Optional. The new description of the milestone. + * @param string $dueOn Optional. The new due date of the milestone. + * @param string $state Optional. The new state of the milestone. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $milestoneId, + string $title = null, + string $description = null, + string $dueOn = null, + string $state = null + ): ?object + { + // Set the lines data + $data = new \stdClass(); + + // Set all the optional data that has been provided. + if ($title !== null) + { + $data->title = $title; + } + if ($description !== null) + { + $data->description = $description; + } + if ($dueOn !== null) + { + $data->due_on = $dueOn; + } + if ($state !== null) + { + $data->state = $state; + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/milestones/{$milestoneId}"; + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), + json_encode($data) + ) + ); + } diff --git a/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/settings.json b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/settings.json new file mode 100644 index 0000000..73d98a2 --- /dev/null +++ b/src/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "f428beab-10f4-4c0d-bb9e-8c797ed7a7c9", + "implements": null, + "load_selection": null, + "name": "Milestones", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Issue.Milestones", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Issue.Milestones", + "description": "The Gitea Issue Milestones\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/README.md b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/README.md new file mode 100644 index 0000000..1ae77b4 --- /dev/null +++ b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/README.md @@ -0,0 +1,69 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Settings (Details) +> namespace: **VDM\Joomla\Gitea\Service** +```uml +@startuml +class Settings #Gold { + + register(Container $container) : void + + getApi(Container $container) : Api + + getAttachment(Container $container) : Attachment + + getRepository(Container $container) : Repository + + getUi(Container $container) : Ui +} + +note right of Settings::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Settings::getApi + Get the Api class + + since: 3.2.0 + return: Api +end note + +note right of Settings::getAttachment + Get the Attachment class + + since: 3.2.0 + return: Attachment +end note + +note right of Settings::getRepository + Get the Repository class + + since: 3.2.0 + return: Repository +end note + +note right of Settings::getUi + Get the Ui class + + since: 3.2.0 + return: Ui +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.php b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.php new file mode 100644 index 0000000..e4b1a7e --- /dev/null +++ b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.php @@ -0,0 +1,123 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Gitea\Settings\Api; +use VDM\Joomla\Gitea\Settings\Attachment; +use VDM\Joomla\Gitea\Settings\Repository; +use VDM\Joomla\Gitea\Settings\Ui; + + +/** + * The Gitea Settings Service + * + * @since 3.2.0 + */ +class Settings implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Api::class, 'Gitea.Settings.Api') + ->share('Gitea.Settings.Api', [$this, 'getApi'], true); + + $container->alias(Attachment::class, 'Gitea.Settings.Attachment') + ->share('Gitea.Settings.Attachment', [$this, 'getAttachment'], true); + + $container->alias(Repository::class, 'Gitea.Settings.Repository') + ->share('Gitea.Settings.Repository', [$this, 'getRepository'], true); + + $container->alias(Ui::class, 'Gitea.Settings.Ui') + ->share('Gitea.Settings.Ui', [$this, 'getUi'], true); + } + + /** + * Get the Api class + * + * @param Container $container The DI container. + * + * @return Api + * @since 3.2.0 + */ + public function getApi(Container $container): Api + { + return new Api( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Attachment class + * + * @param Container $container The DI container. + * + * @return Attachment + * @since 3.2.0 + */ + public function getAttachment(Container $container): Attachment + { + return new Attachment( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Ui class + * + * @param Container $container The DI container. + * + * @return Ui + * @since 3.2.0 + */ + public function getUi(Container $container): Ui + { + return new Ui( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + +} + diff --git a/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.power b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.power new file mode 100644 index 0000000..1a1089b --- /dev/null +++ b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/code.power @@ -0,0 +1,91 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Api::class, 'Gitea.Settings.Api') + ->share('Gitea.Settings.Api', [$this, 'getApi'], true); + + $container->alias(Attachment::class, 'Gitea.Settings.Attachment') + ->share('Gitea.Settings.Attachment', [$this, 'getAttachment'], true); + + $container->alias(Repository::class, 'Gitea.Settings.Repository') + ->share('Gitea.Settings.Repository', [$this, 'getRepository'], true); + + $container->alias(Ui::class, 'Gitea.Settings.Ui') + ->share('Gitea.Settings.Ui', [$this, 'getUi'], true); + } + + /** + * Get the Api class + * + * @param Container $container The DI container. + * + * @return Api + * @since 3.2.0 + */ + public function getApi(Container $container): Api + { + return new Api( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Attachment class + * + * @param Container $container The DI container. + * + * @return Attachment + * @since 3.2.0 + */ + public function getAttachment(Container $container): Attachment + { + return new Attachment( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Repository class + * + * @param Container $container The DI container. + * + * @return Repository + * @since 3.2.0 + */ + public function getRepository(Container $container): Repository + { + return new Repository( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + + /** + * Get the Ui class + * + * @param Container $container The DI container. + * + * @return Ui + * @since 3.2.0 + */ + public function getUi(Container $container): Ui + { + return new Ui( + $container->get('Gitea.Utilities.Http'), + $container->get('Gitea.Dynamic.Uri'), + $container->get('Gitea.Utilities.Response') + ); + } + diff --git a/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/settings.json b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/settings.json new file mode 100644 index 0000000..b234da9 --- /dev/null +++ b/src/f4d00907-c94a-49b7-8727-d64c1fa74cf5/settings.json @@ -0,0 +1,38 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "f4d00907-c94a-49b7-8727-d64c1fa74cf5", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Settings", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Service.Settings", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "5ca71a00-7b44-4c0d-9955-3af054eed43d", + "as": "default" + }, + "use_selection1": { + "use": "3d4ed24c-8250-4fcf-824f-a5f1597f939e", + "as": "default" + }, + "use_selection2": { + "use": "e7c16db5-bb22-421b-8789-180f6a502b62", + "as": "default" + }, + "use_selection3": { + "use": "0367ac44-18d6-495d-beae-315794ffa89d", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Gitea\\Service.Settings", + "description": "The Gitea Settings Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/f56114fd-6804-4ce9-8adb-1d521f023c11/README.md b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/README.md new file mode 100644 index 0000000..a19cae6 --- /dev/null +++ b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/README.md @@ -0,0 +1,184 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Pulls (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Pulls #Gold { + + list(string $owner, string $repo, ...) : ?array + + create(string $owner, string $repo, ...) : ?object + + get(string $owner, string $repo, ...) : ?object + + update(string $owner, string $repo, ...) : ?object + + diff(string $owner, string $repo, ...) : string + + commits(string $owner, string $repo, ...) : ?array + + files(string $owner, string $repo, ...) : ?array + + merge(string $owner, string $repo, ...) : string + + update(string $owner, string $repo, ...) : string +} + +note right of Pulls::list + List a repository's pull requests. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + ?string $state = null + ?string $sort = null + ?int $milestone = null + ?array $labels = null + int $page = 1 + int $limit = 10 +end note + +note left of Pulls::create + Create a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + string $title + string $head + string $base + ?string $body = null + ?string $assignee = null + ?array $assignees = null + ?array $labels = null + ?int $milestone = null + ?string $dueDate = null +end note + +note right of Pulls::get + Get a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index +end note + +note left of Pulls::update + Update a pull request. + + since: 3.2.0 + return: ?object + + arguments: + string $owner + string $repo + int $index + ?string $title = null + ?string $body = null + ?string $assignee = null + ?array $assignees = null + ?string $base = null + ?string $state = null + ?array $labels = null + ?int $milestone = null + ?string $dueDate = null + ?bool $unsetDueDate = null + ?bool $allowMaintainerEdit = null + Merge PR's baseBranch into headBranch. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + ?string $style = null +end note + +note right of Pulls::diff + Get a pull request diff or patch. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + string $diffType + bool $binary = false +end note + +note left of Pulls::commits + Get commits for a pull request. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + int $page = 1 + int $limit = 10 +end note + +note right of Pulls::files + Get changed files for a pull request. + + since: 3.2.0 + return: ?array + + arguments: + string $owner + string $repo + int $index + ?string $skipTo = null + ?string $whitespace = null + int $page = 1 + int $limit = 10 +end note + +note left of Pulls::merge + Merge a pull request. + + since: 3.2.0 + return: string + + arguments: + string $owner + string $repo + int $index + ?string $do = null + ?string $mergeCommitId = null + ?string $mergeMessageField = null + ?string $mergeTitleField = null + ?bool $deleteBranchAfterMerge = null + ?bool $forceMerge = null + ?string $headCommitId = null + ?bool $mergeWhenChecksSucceed = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.php b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.php new file mode 100644 index 0000000..a979e79 --- /dev/null +++ b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.php @@ -0,0 +1,547 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Pulls + * + * @since 3.2.0 + */ +class Pulls extends Api +{ + /** + * List a repository's pull requests. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $state State of pull request: open, closed, or all (optional). + * @param string|null $sort Type of sort (optional). + * @param int|null $milestone ID of the milestone (optional). + * @param array|null $labels Label IDs (optional). + * @param int $page Page number of results to return (1-based, default: 1). + * @param int $limit Page size of results (default: 10). + * + * @return array|null + * @since 3.2.0 + */ + public function list( + string $owner, + string $repo, + ?string $state = null, + ?string $sort = null, + ?int $milestone = null, + ?array $labels = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls"; + + // Set query parameters. + $this->uri->setVar('page', $page); + $this->uri->setVar('limit', $limit); + + if ($state !== null) + { + $this->uri->setVar('state', $state); + } + + if ($sort !== null) + { + $this->uri->setVar('sort', $sort); + } + + if ($milestone !== null) + { + $this->uri->setVar('milestone', $milestone); + } + + if ($labels !== null) + { + $this->uri->setVar('labels', implode(',', $labels)); + } + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $title The title of the pull request. + * @param string $head The head branch. + * @param string $base The base branch. + * @param string|null $body The description of the pull request (optional). + * @param string|null $assignee The assignee of the pull request (optional). + * @param array|null $assignees Additional assignees (optional). + * @param array|null $labels Label IDs (optional). + * @param int|null $milestone ID of the milestone (optional). + * @param string|null $dueDate Due date of the pull request (optional). + * + * @return object|null + * @since 3.2.0 + */ + public function create( + string $owner, + string $repo, + string $title, + string $head, + string $base, + ?string $body = null, + ?string $assignee = null, + ?array $assignees = null, + ?array $labels = null, + ?int $milestone = null, + ?string $dueDate = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls"; + + // Set the pull request data. + $data = new \stdClass(); + $data->title = $title; + $data->head = $head; + $data->base = $base; + + if ($body !== null) + { + $data->body = $body; + } + + if ($assignee !== null) + { + $data->assignee = $assignee; + } + + if ($assignees !== null) + { + $data->assignees = $assignees; + } + + if ($labels !== null) + { + $data->labels = $labels; + } + + if ($milestone !== null) + { + $data->milestone = $milestone; + } + + if ($dueDate !== null) + { + $data->due_date = $dueDate; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $index): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Update a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $title The title of the pull request (optional). + * @param string|null $body The description of the pull request (optional). + * @param string|null $assignee The assignee of the pull request (optional). + * @param array|null $assignees Additional assignees (optional). + * @param string|null $base The base branch (optional). + * @param string|null $state The state of the pull request (optional). + * @param array|null $labels Label IDs (optional). + * @param int|null $milestone ID of the milestone (optional). + * @param string|null $dueDate Due date of the pull request (optional). + * @param bool|null $unsetDueDate Whether to unset the due date (optional). + * @param bool|null $allowMaintainerEdit Allow maintainer to edit the pull request (optional). + * + * @return object|null + * @since 3.2.0 + */ + public function update( + string $owner, + string $repo, + int $index, + ?string $title = null, + ?string $body = null, + ?string $assignee = null, + ?array $assignees = null, + ?string $base = null, + ?string $state = null, + ?array $labels = null, + ?int $milestone = null, + ?string $dueDate = null, + ?bool $unsetDueDate = null, + ?bool $allowMaintainerEdit = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}"; + + // Set the pull request data. + $data = new \stdClass(); + + if ($title !== null) + { + $data->title = $title; + } + + if ($body !== null) + { + $data->body = $body; + } + + if ($assignee !== null) + { + $data->assignee = $assignee; + } + + if ($assignees !== null) + { + $data->assignees = $assignees; + } + + if ($base !== null) + { + $data->base = $base; + } + + if ($state !== null) + { + $data->state = $state; + } + + if ($labels !== null) + { + $data->labels = $labels; + } + + if ($milestone !== null) + { + $data->milestone = $milestone; + } + + if ($dueDate !== null) + { + $data->due_date = $dueDate; + } + + if ($unsetDueDate !== null) + { + $data->unset_due_date = $unsetDueDate; + } + + if ($allowMaintainerEdit !== null) + { + $data->allow_maintainer_edit = $allowMaintainerEdit; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a pull request diff or patch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string $diffType The type of the requested data, either "diff" or "patch". + * @param bool $binary Whether to include binary file changes. If true, the diff is applicable with git apply. + * + * @return string + * @since 3.2.0 + **/ + public function diff( + string $owner, + string $repo, + int $index, + string $diffType, + bool $binary = false + ): string + { + // Validate the diff type. + if (!in_array($diffType, ['diff', 'patch'])) + { + throw new \InvalidArgumentException('Invalid diff type. Allowed types are "diff" and "patch".'); + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}.{$diffType}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Set the binary query parameter if required. + if ($binary) + { + $uri->setVar('binary', 'true'); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get commits for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function commits( + string $owner, + string $repo, + int $index, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/commits"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Set the page and limit query parameters. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get changed files for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string $skipTo Skip to the given file. + * @param string $whitespace Whitespace behavior. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function files( + string $owner, + string $repo, + int $index, + ?string $skipTo = null, + ?string $whitespace = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/files"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Set the skip-to, whitespace, page, and limit query parameters if needed. + if ($skipTo !== null) + { + $uri->setVar('skip-to', $skipTo); + } + if ($whitespace !== null) + { + $uri->setVar('whitespace', $whitespace); + } + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Merge a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $do Merge method. + * @param string|null $mergeCommitId Merge commit ID. + * @param string|null $mergeMessageField Merge message field. + * @param string|null $mergeTitleField Merge title field. + * @param bool|null $deleteBranchAfterMerge Whether to delete the branch after merge. + * @param bool|null $forceMerge Whether to force merge. + * @param string|null $headCommitId Head commit ID. + * @param bool|null $mergeWhenChecksSucceed Whether to merge when checks succeed. + * + * @return string + * @since 3.2.0 + **/ + public function merge( + string $owner, + string $repo, + int $index, + ?string $do = null, + ?string $mergeCommitId = null, + ?string $mergeMessageField = null, + ?string $mergeTitleField = null, + ?bool $deleteBranchAfterMerge = null, + ?bool $forceMerge = null, + ?string $headCommitId = null, + ?bool $mergeWhenChecksSucceed = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Set the merge data. + $data = new \stdClass(); + + if ($do !== null) + { + $data->do = $do; + } + + if ($mergeCommitId !== null) + { + $data->merge_commit_id = $mergeCommitId; + } + + if ($mergeMessageField !== null) + { + $data->merge_message_field = $mergeMessageField; + } + + if ($mergeTitleField !== null) + { + $data->merge_title_field = $mergeTitleField; + } + + if ($deleteBranchAfterMerge !== null) + { + $data->delete_branch_after_merge = $deleteBranchAfterMerge; + } + + if ($forceMerge !== null) + { + $data->force_merge = $forceMerge; + } + + if ($headCommitId !== null) + { + $data->head_commit_id = $headCommitId; + } + + if ($mergeWhenChecksSucceed !== null) + { + $data->merge_when_checks_succeed = $mergeWhenChecksSucceed; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 200, 'success' + ); + } + + /** + * Merge PR's baseBranch into headBranch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $style How to update the pull request. (Optional) + * + * @return string + * @since 3.2.0 + */ + public function update( + string $owner, + string $repo, + int $index, + ?string $style = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/update"; + + // Set the merge data. + $data = new \stdClass(); + + if ($style !== null) + { + $data->style = $style; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 200, 'success' + ); + } + +} + diff --git a/src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.power b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.power new file mode 100644 index 0000000..ce8cb88 --- /dev/null +++ b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/code.power @@ -0,0 +1,520 @@ + /** + * List a repository's pull requests. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $state State of pull request: open, closed, or all (optional). + * @param string|null $sort Type of sort (optional). + * @param int|null $milestone ID of the milestone (optional). + * @param array|null $labels Label IDs (optional). + * @param int $page Page number of results to return (1-based, default: 1). + * @param int $limit Page size of results (default: 10). + * + * @return array|null + * @since 3.2.0 + */ + public function list( + string $owner, + string $repo, + ?string $state = null, + ?string $sort = null, + ?int $milestone = null, + ?array $labels = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls"; + + // Set query parameters. + $this->uri->setVar('page', $page); + $this->uri->setVar('limit', $limit); + + if ($state !== null) + { + $this->uri->setVar('state', $state); + } + + if ($sort !== null) + { + $this->uri->setVar('sort', $sort); + } + + if ($milestone !== null) + { + $this->uri->setVar('milestone', $milestone); + } + + if ($labels !== null) + { + $this->uri->setVar('labels', implode(',', $labels)); + } + + // Send the GET request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Create a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $title The title of the pull request. + * @param string $head The head branch. + * @param string $base The base branch. + * @param string|null $body The description of the pull request (optional). + * @param string|null $assignee The assignee of the pull request (optional). + * @param array|null $assignees Additional assignees (optional). + * @param array|null $labels Label IDs (optional). + * @param int|null $milestone ID of the milestone (optional). + * @param string|null $dueDate Due date of the pull request (optional). + * + * @return object|null + * @since 3.2.0 + */ + public function create( + string $owner, + string $repo, + string $title, + string $head, + string $base, + ?string $body = null, + ?string $assignee = null, + ?array $assignees = null, + ?array $labels = null, + ?int $milestone = null, + ?string $dueDate = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls"; + + // Set the pull request data. + $data = new \stdClass(); + $data->title = $title; + $data->head = $head; + $data->base = $base; + + if ($body !== null) + { + $data->body = $body; + } + + if ($assignee !== null) + { + $data->assignee = $assignee; + } + + if ($assignees !== null) + { + $data->assignees = $assignees; + } + + if ($labels !== null) + { + $data->labels = $labels; + } + + if ($milestone !== null) + { + $data->milestone = $milestone; + } + + if ($dueDate !== null) + { + $data->due_date = $dueDate; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * + * @return object|null + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, int $index): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}"; + + // Send the get request. + return $this->response->get( + $this->http->get( + $this->uri->get($path) + ) + ); + } + + /** + * Update a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $title The title of the pull request (optional). + * @param string|null $body The description of the pull request (optional). + * @param string|null $assignee The assignee of the pull request (optional). + * @param array|null $assignees Additional assignees (optional). + * @param string|null $base The base branch (optional). + * @param string|null $state The state of the pull request (optional). + * @param array|null $labels Label IDs (optional). + * @param int|null $milestone ID of the milestone (optional). + * @param string|null $dueDate Due date of the pull request (optional). + * @param bool|null $unsetDueDate Whether to unset the due date (optional). + * @param bool|null $allowMaintainerEdit Allow maintainer to edit the pull request (optional). + * + * @return object|null + * @since 3.2.0 + */ + public function update( + string $owner, + string $repo, + int $index, + ?string $title = null, + ?string $body = null, + ?string $assignee = null, + ?array $assignees = null, + ?string $base = null, + ?string $state = null, + ?array $labels = null, + ?int $milestone = null, + ?string $dueDate = null, + ?bool $unsetDueDate = null, + ?bool $allowMaintainerEdit = null + ): ?object + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}"; + + // Set the pull request data. + $data = new \stdClass(); + + if ($title !== null) + { + $data->title = $title; + } + + if ($body !== null) + { + $data->body = $body; + } + + if ($assignee !== null) + { + $data->assignee = $assignee; + } + + if ($assignees !== null) + { + $data->assignees = $assignees; + } + + if ($base !== null) + { + $data->base = $base; + } + + if ($state !== null) + { + $data->state = $state; + } + + if ($labels !== null) + { + $data->labels = $labels; + } + + if ($milestone !== null) + { + $data->milestone = $milestone; + } + + if ($dueDate !== null) + { + $data->due_date = $dueDate; + } + + if ($unsetDueDate !== null) + { + $data->unset_due_date = $unsetDueDate; + } + + if ($allowMaintainerEdit !== null) + { + $data->allow_maintainer_edit = $allowMaintainerEdit; + } + + // Send the patch request. + return $this->response->get( + $this->http->patch( + $this->uri->get($path), json_encode($data) + ), 201 + ); + } + + /** + * Get a pull request diff or patch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string $diffType The type of the requested data, either "diff" or "patch". + * @param bool $binary Whether to include binary file changes. If true, the diff is applicable with git apply. + * + * @return string + * @since 3.2.0 + **/ + public function diff( + string $owner, + string $repo, + int $index, + string $diffType, + bool $binary = false + ): string + { + // Validate the diff type. + if (!in_array($diffType, ['diff', 'patch'])) + { + throw new \InvalidArgumentException('Invalid diff type. Allowed types are "diff" and "patch".'); + } + + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}.{$diffType}"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Set the binary query parameter if required. + if ($binary) + { + $uri->setVar('binary', 'true'); + } + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get commits for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function commits( + string $owner, + string $repo, + int $index, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/commits"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Set the page and limit query parameters. + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Get changed files for a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string $skipTo Skip to the given file. + * @param string $whitespace Whitespace behavior. + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function files( + string $owner, + string $repo, + int $index, + ?string $skipTo = null, + ?string $whitespace = null, + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/files"; + + // Get the URI with the path. + $uri = $this->uri->get($path); + + // Set the skip-to, whitespace, page, and limit query parameters if needed. + if ($skipTo !== null) + { + $uri->setVar('skip-to', $skipTo); + } + if ($whitespace !== null) + { + $uri->setVar('whitespace', $whitespace); + } + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Merge a pull request. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $do Merge method. + * @param string|null $mergeCommitId Merge commit ID. + * @param string|null $mergeMessageField Merge message field. + * @param string|null $mergeTitleField Merge title field. + * @param bool|null $deleteBranchAfterMerge Whether to delete the branch after merge. + * @param bool|null $forceMerge Whether to force merge. + * @param string|null $headCommitId Head commit ID. + * @param bool|null $mergeWhenChecksSucceed Whether to merge when checks succeed. + * + * @return string + * @since 3.2.0 + **/ + public function merge( + string $owner, + string $repo, + int $index, + ?string $do = null, + ?string $mergeCommitId = null, + ?string $mergeMessageField = null, + ?string $mergeTitleField = null, + ?bool $deleteBranchAfterMerge = null, + ?bool $forceMerge = null, + ?string $headCommitId = null, + ?bool $mergeWhenChecksSucceed = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/merge"; + + // Set the merge data. + $data = new \stdClass(); + + if ($do !== null) + { + $data->do = $do; + } + + if ($mergeCommitId !== null) + { + $data->merge_commit_id = $mergeCommitId; + } + + if ($mergeMessageField !== null) + { + $data->merge_message_field = $mergeMessageField; + } + + if ($mergeTitleField !== null) + { + $data->merge_title_field = $mergeTitleField; + } + + if ($deleteBranchAfterMerge !== null) + { + $data->delete_branch_after_merge = $deleteBranchAfterMerge; + } + + if ($forceMerge !== null) + { + $data->force_merge = $forceMerge; + } + + if ($headCommitId !== null) + { + $data->head_commit_id = $headCommitId; + } + + if ($mergeWhenChecksSucceed !== null) + { + $data->merge_when_checks_succeed = $mergeWhenChecksSucceed; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 200, 'success' + ); + } + + /** + * Merge PR's baseBranch into headBranch. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param int $index The pull request index. + * @param string|null $style How to update the pull request. (Optional) + * + * @return string + * @since 3.2.0 + */ + public function update( + string $owner, + string $repo, + int $index, + ?string $style = null + ): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/pulls/{$index}/update"; + + // Set the merge data. + $data = new \stdClass(); + + if ($style !== null) + { + $data->style = $style; + } + + // Send the request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), json_encode($data) + ), 200, 'success' + ); + } diff --git a/src/f56114fd-6804-4ce9-8adb-1d521f023c11/settings.json b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/settings.json new file mode 100644 index 0000000..e13884b --- /dev/null +++ b/src/f56114fd-6804-4ce9-8adb-1d521f023c11/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "f56114fd-6804-4ce9-8adb-1d521f023c11", + "implements": null, + "load_selection": null, + "name": "Pulls", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Pulls", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Pulls", + "description": "The Gitea Repository Pulls\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/f6249c33-b4bd-4598-8710-0cab230aef94/README.md b/src/f6249c33-b4bd-4598-8710-0cab230aef94/README.md new file mode 100644 index 0000000..7515b5a --- /dev/null +++ b/src/f6249c33-b4bd-4598-8710-0cab230aef94/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Mirror (Details) +> namespace: **VDM\Joomla\Gitea\Repository** +```uml +@startuml +class Mirror #Gold { + + sync(string $owner, string $repo) : string +} + +note right of Mirror::sync + Sync a mirrored repository. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f6249c33-b4bd-4598-8710-0cab230aef94/code.php b/src/f6249c33-b4bd-4598-8710-0cab230aef94/code.php new file mode 100644 index 0000000..37e3b57 --- /dev/null +++ b/src/f6249c33-b4bd-4598-8710-0cab230aef94/code.php @@ -0,0 +1,48 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\Repository; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea Repository Mirror + * + * @since 3.2.0 + */ +class Mirror extends Api +{ + /** + * Sync a mirrored repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + */ + public function sync(string $owner, string $repo): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/mirror-sync"; + + // Send the POST request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 200, 'success' + ); + } + +} + diff --git a/src/f6249c33-b4bd-4598-8710-0cab230aef94/code.power b/src/f6249c33-b4bd-4598-8710-0cab230aef94/code.power new file mode 100644 index 0000000..690d7a0 --- /dev/null +++ b/src/f6249c33-b4bd-4598-8710-0cab230aef94/code.power @@ -0,0 +1,21 @@ + /** + * Sync a mirrored repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + */ + public function sync(string $owner, string $repo): string + { + // Build the request path. + $path = "/repos/{$owner}/{$repo}/mirror-sync"; + + // Send the POST request. + return $this->response->get( + $this->http->post( + $this->uri->get($path) + ), 200, 'success' + ); + } diff --git a/src/f6249c33-b4bd-4598-8710-0cab230aef94/settings.json b/src/f6249c33-b4bd-4598-8710-0cab230aef94/settings.json new file mode 100644 index 0000000..3625df4 --- /dev/null +++ b/src/f6249c33-b4bd-4598-8710-0cab230aef94/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "f6249c33-b4bd-4598-8710-0cab230aef94", + "implements": null, + "load_selection": null, + "name": "Mirror", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.Repository.Mirror", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\Repository.Mirror", + "description": "The Gitea Repository Mirror\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/README.md b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/README.md new file mode 100644 index 0000000..cd31a4a --- /dev/null +++ b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/README.md @@ -0,0 +1,74 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Repos (Details) +> namespace: **VDM\Joomla\Gitea\User** +```uml +@startuml +class Repos #Gold { + + create(string $name, ?string $description = null, ...) : ?object + + list(int $page = 1, int $limit = 10) : ?array + + star(string $owner, string $repo) : string + + unstar(string $owner, string $repo) : string +} + +note right of Repos::create + Create a repository for the authenticated user. + + since: 3.2.0 + return: ?object + + arguments: + string $name + ?string $description = null + bool $private = false + bool $autoInit = false + ?string $defaultBranch = null + ?string $gitignores = null + ?string $issueLabels = null + ?string $license = null + ?string $readme = null + ?bool $template = null + ?string $trustModel = null +end note + +note right of Repos::list + List the repos that the authenticated user owns. + + since: 3.2.0 + return: ?array +end note + +note right of Repos::star + Star the given repo for the authenticated user. + + since: 3.2.0 + return: string +end note + +note right of Repos::unstar + Unstar the given repo for the authenticated user. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.php b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.php new file mode 100644 index 0000000..a7f8021 --- /dev/null +++ b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.php @@ -0,0 +1,188 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Gitea\User; + + +use VDM\Joomla\Gitea\Abstraction\Api; + + +/** + * The Gitea User Repos + * + * @since 3.2.0 + */ +class Repos extends Api +{ + /** + * Create a repository for the authenticated user. + * + * @param string $name The name of the repository. + * @param string|null $description Optional. The description of the repository. + * @param bool $private Optional. Indicates whether the repository should be private or not. + * @param bool $autoInit Optional. Indicates whether the repository should be auto-initialized. + * @param string|null $defaultBranch Optional. The default branch of the repository. + * @param string|null $gitignores Optional. Gitignores to use. + * @param string|null $issueLabels Optional. Label-Set to use. + * @param string|null $license Optional. License to use. + * @param string|null $readme Optional. Readme of the repository to create. + * @param bool|null $template Optional. Whether the repository is a template. + * @param string|null $trustModel Optional. TrustModel of the repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $name, + ?string $description = null, + bool $private = false, + bool $autoInit = false, + ?string $defaultBranch = null, + ?string $gitignores = null, + ?string $issueLabels = null, + ?string $license = null, + ?string $readme = null, + ?bool $template = null, + ?string $trustModel = null + ): ?object { + // Build the request path. + $path = '/user/repos'; + + // Set the repository data. + $data = new \stdClass(); + $data->name = $name; + + if ($description !== null) + { + $data->description = $description; + } + + $data->private = $private; + $data->auto_init = $autoInit; + + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + + if ($gitignores !== null) + { + $data->gitignores = $gitignores; + } + + if ($issueLabels !== null) + { + $data->issue_labels = $issueLabels; + } + + if ($license !== null) + { + $data->license = $license; + } + + if ($readme !== null) + { + $data->readme = $readme; + } + + if ($template !== null) + { + $data->template = $template; + } + + if ($trustModel !== null) + { + $data->trust_model = $trustModel; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * List the repos that the authenticated user owns. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/repos'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Star the given repo for the authenticated user. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function star(string $owner, string $repo): string + { + // Build the request path. + $path = "/user/starred/{$owner}/{$repo}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Unstar the given repo for the authenticated user. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function unstar(string $owner, string $repo): string + { + // Build the request path. + $path = "/user/starred/{$owner}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } + +} + diff --git a/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.power b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.power new file mode 100644 index 0000000..0d56d8d --- /dev/null +++ b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/code.power @@ -0,0 +1,161 @@ + /** + * Create a repository for the authenticated user. + * + * @param string $name The name of the repository. + * @param string|null $description Optional. The description of the repository. + * @param bool $private Optional. Indicates whether the repository should be private or not. + * @param bool $autoInit Optional. Indicates whether the repository should be auto-initialized. + * @param string|null $defaultBranch Optional. The default branch of the repository. + * @param string|null $gitignores Optional. Gitignores to use. + * @param string|null $issueLabels Optional. Label-Set to use. + * @param string|null $license Optional. License to use. + * @param string|null $readme Optional. Readme of the repository to create. + * @param bool|null $template Optional. Whether the repository is a template. + * @param string|null $trustModel Optional. TrustModel of the repository. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $name, + ?string $description = null, + bool $private = false, + bool $autoInit = false, + ?string $defaultBranch = null, + ?string $gitignores = null, + ?string $issueLabels = null, + ?string $license = null, + ?string $readme = null, + ?bool $template = null, + ?string $trustModel = null + ): ?object { + // Build the request path. + $path = '/user/repos'; + + // Set the repository data. + $data = new \stdClass(); + $data->name = $name; + + if ($description !== null) + { + $data->description = $description; + } + + $data->private = $private; + $data->auto_init = $autoInit; + + if ($defaultBranch !== null) + { + $data->default_branch = $defaultBranch; + } + + if ($gitignores !== null) + { + $data->gitignores = $gitignores; + } + + if ($issueLabels !== null) + { + $data->issue_labels = $issueLabels; + } + + if ($license !== null) + { + $data->license = $license; + } + + if ($readme !== null) + { + $data->readme = $readme; + } + + if ($template !== null) + { + $data->template = $template; + } + + if ($trustModel !== null) + { + $data->trust_model = $trustModel; + } + + // Send the post request. + return $this->response->get( + $this->http->post( + $this->uri->get($path), + json_encode($data) + ), 201 + ); + } + + /** + * List the repos that the authenticated user owns. + * + * @param int $page Page number of results to return (1-based). + * @param int $limit Page size of results. + * + * @return array|null + * @since 3.2.0 + **/ + public function list( + int $page = 1, + int $limit = 10 + ): ?array + { + // Build the request path. + $path = '/user/repos'; + + // Build the URI with query parameters. + $uri = $this->uri->get($path); + $uri->setVar('page', $page); + $uri->setVar('limit', $limit); + + // Send the get request. + return $this->response->get( + $this->http->get($uri) + ); + } + + /** + * Star the given repo for the authenticated user. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function star(string $owner, string $repo): string + { + // Build the request path. + $path = "/user/starred/{$owner}/{$repo}"; + + // Send the put request. + return $this->response->get( + $this->http->put( + $this->uri->get($path), '' + ), 204, 'success' + ); + } + + /** + * Unstar the given repo for the authenticated user. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * + * @return string + * @since 3.2.0 + **/ + public function unstar(string $owner, string $repo): string + { + // Build the request path. + $path = "/user/starred/{$owner}/{$repo}"; + + // Send the delete request. + return $this->response->get( + $this->http->delete( + $this->uri->get($path) + ), 204, 'success' + ); + } diff --git a/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/settings.json b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/settings.json new file mode 100644 index 0000000..31273eb --- /dev/null +++ b/src/fd560f3e-ce19-474f-86ca-1fb1d3af9992/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "fd560f3e-ce19-474f-86ca-1fb1d3af9992", + "implements": null, + "load_selection": null, + "name": "Repos", + "power_version": "1.0.0", + "system_name": "Joomla.Gitea.User.Repos", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Gitea\\User.Repos", + "description": "The Gitea User Repos\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json new file mode 100644 index 0000000..3a33d83 --- /dev/null +++ b/super-powers.json @@ -0,0 +1,1142 @@ +{ + "61e813c6-a872-4f55-8078-198241170e80": { + "name": "Uri", + "type": "final class", + "namespace": "VDM\\Joomla\\Gitea\\Utilities", + "code": "src\/61e813c6-a872-4f55-8078-198241170e80\/code.php", + "power": "src\/61e813c6-a872-4f55-8078-198241170e80\/code.power", + "settings": "src\/61e813c6-a872-4f55-8078-198241170e80\/settings.json", + "path": "src\/61e813c6-a872-4f55-8078-198241170e80", + "guid": "61e813c6-a872-4f55-8078-198241170e80" + }, + "19eb68d7-1e19-4d14-a0ef-70d719c45e80": { + "name": "Response", + "type": "final class", + "namespace": "VDM\\Joomla\\Gitea\\Utilities", + "code": "src\/19eb68d7-1e19-4d14-a0ef-70d719c45e80\/code.php", + "power": "src\/19eb68d7-1e19-4d14-a0ef-70d719c45e80\/code.power", + "settings": "src\/19eb68d7-1e19-4d14-a0ef-70d719c45e80\/settings.json", + "path": "src\/19eb68d7-1e19-4d14-a0ef-70d719c45e80", + "guid": "19eb68d7-1e19-4d14-a0ef-70d719c45e80" + }, + "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c": { + "name": "Utilities", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c\/code.php", + "power": "src\/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c\/code.power", + "settings": "src\/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c\/settings.json", + "path": "src\/6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c", + "guid": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c" + }, + "ce40b3d2-226c-4a64-b116-c19455822be1": { + "name": "Http", + "type": "final class", + "namespace": "VDM\\Joomla\\Gitea\\Utilities", + "code": "src\/ce40b3d2-226c-4a64-b116-c19455822be1\/code.php", + "power": "src\/ce40b3d2-226c-4a64-b116-c19455822be1\/code.power", + "settings": "src\/ce40b3d2-226c-4a64-b116-c19455822be1\/settings.json", + "path": "src\/ce40b3d2-226c-4a64-b116-c19455822be1", + "guid": "ce40b3d2-226c-4a64-b116-c19455822be1" + }, + "d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe": { + "name": "Jcb", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe\/code.php", + "power": "src\/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe\/code.power", + "settings": "src\/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe\/settings.json", + "path": "src\/d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe", + "guid": "d2e997a1-bbf7-4f28-8a7c-ce5c68061cfe" + }, + "3d7af7a2-dabe-4111-b5fd-c5bfa8755469": { + "name": "Api", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Gitea\\Abstraction", + "code": "src\/3d7af7a2-dabe-4111-b5fd-c5bfa8755469\/code.php", + "power": "src\/3d7af7a2-dabe-4111-b5fd-c5bfa8755469\/code.power", + "settings": "src\/3d7af7a2-dabe-4111-b5fd-c5bfa8755469\/settings.json", + "path": "src\/3d7af7a2-dabe-4111-b5fd-c5bfa8755469", + "guid": "3d7af7a2-dabe-4111-b5fd-c5bfa8755469" + }, + "5ca71a00-7b44-4c0d-9955-3af054eed43d": { + "name": "Api", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Settings", + "code": "src\/5ca71a00-7b44-4c0d-9955-3af054eed43d\/code.php", + "power": "src\/5ca71a00-7b44-4c0d-9955-3af054eed43d\/code.power", + "settings": "src\/5ca71a00-7b44-4c0d-9955-3af054eed43d\/settings.json", + "path": "src\/5ca71a00-7b44-4c0d-9955-3af054eed43d", + "guid": "5ca71a00-7b44-4c0d-9955-3af054eed43d" + }, + "3d4ed24c-8250-4fcf-824f-a5f1597f939e": { + "name": "Attachment", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Settings", + "code": "src\/3d4ed24c-8250-4fcf-824f-a5f1597f939e\/code.php", + "power": "src\/3d4ed24c-8250-4fcf-824f-a5f1597f939e\/code.power", + "settings": "src\/3d4ed24c-8250-4fcf-824f-a5f1597f939e\/settings.json", + "path": "src\/3d4ed24c-8250-4fcf-824f-a5f1597f939e", + "guid": "3d4ed24c-8250-4fcf-824f-a5f1597f939e" + }, + "e7c16db5-bb22-421b-8789-180f6a502b62": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Settings", + "code": "src\/e7c16db5-bb22-421b-8789-180f6a502b62\/code.php", + "power": "src\/e7c16db5-bb22-421b-8789-180f6a502b62\/code.power", + "settings": "src\/e7c16db5-bb22-421b-8789-180f6a502b62\/settings.json", + "path": "src\/e7c16db5-bb22-421b-8789-180f6a502b62", + "guid": "e7c16db5-bb22-421b-8789-180f6a502b62" + }, + "0367ac44-18d6-495d-beae-315794ffa89d": { + "name": "Ui", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Settings", + "code": "src\/0367ac44-18d6-495d-beae-315794ffa89d\/code.php", + "power": "src\/0367ac44-18d6-495d-beae-315794ffa89d\/code.power", + "settings": "src\/0367ac44-18d6-495d-beae-315794ffa89d\/settings.json", + "path": "src\/0367ac44-18d6-495d-beae-315794ffa89d", + "guid": "0367ac44-18d6-495d-beae-315794ffa89d" + }, + "f4d00907-c94a-49b7-8727-d64c1fa74cf5": { + "name": "Settings", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/f4d00907-c94a-49b7-8727-d64c1fa74cf5\/code.php", + "power": "src\/f4d00907-c94a-49b7-8727-d64c1fa74cf5\/code.power", + "settings": "src\/f4d00907-c94a-49b7-8727-d64c1fa74cf5\/settings.json", + "path": "src\/f4d00907-c94a-49b7-8727-d64c1fa74cf5", + "guid": "f4d00907-c94a-49b7-8727-d64c1fa74cf5" + }, + "8efd9070-7110-4b8e-bb76-cb1a286d5af2": { + "name": "Organization", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/8efd9070-7110-4b8e-bb76-cb1a286d5af2\/code.php", + "power": "src\/8efd9070-7110-4b8e-bb76-cb1a286d5af2\/code.power", + "settings": "src\/8efd9070-7110-4b8e-bb76-cb1a286d5af2\/settings.json", + "path": "src\/8efd9070-7110-4b8e-bb76-cb1a286d5af2", + "guid": "8efd9070-7110-4b8e-bb76-cb1a286d5af2" + }, + "605d7058-345b-411e-b55d-027edc1ded83": { + "name": "Hooks", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/605d7058-345b-411e-b55d-027edc1ded83\/code.php", + "power": "src\/605d7058-345b-411e-b55d-027edc1ded83\/code.power", + "settings": "src\/605d7058-345b-411e-b55d-027edc1ded83\/settings.json", + "path": "src\/605d7058-345b-411e-b55d-027edc1ded83", + "guid": "605d7058-345b-411e-b55d-027edc1ded83" + }, + "9c9ba4c4-2039-4396-9ea2-621e42e04c89": { + "name": "Labels", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/9c9ba4c4-2039-4396-9ea2-621e42e04c89\/code.php", + "power": "src\/9c9ba4c4-2039-4396-9ea2-621e42e04c89\/code.power", + "settings": "src\/9c9ba4c4-2039-4396-9ea2-621e42e04c89\/settings.json", + "path": "src\/9c9ba4c4-2039-4396-9ea2-621e42e04c89", + "guid": "9c9ba4c4-2039-4396-9ea2-621e42e04c89" + }, + "c1be1e0d-479d-44de-bfe4-cfa4ded7e240": { + "name": "Members", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/c1be1e0d-479d-44de-bfe4-cfa4ded7e240\/code.php", + "power": "src\/c1be1e0d-479d-44de-bfe4-cfa4ded7e240\/code.power", + "settings": "src\/c1be1e0d-479d-44de-bfe4-cfa4ded7e240\/settings.json", + "path": "src\/c1be1e0d-479d-44de-bfe4-cfa4ded7e240", + "guid": "c1be1e0d-479d-44de-bfe4-cfa4ded7e240" + }, + "2a6f99df-a327-4477-8079-f57133e6ff36": { + "name": "PublicMembers", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/2a6f99df-a327-4477-8079-f57133e6ff36\/code.php", + "power": "src\/2a6f99df-a327-4477-8079-f57133e6ff36\/code.power", + "settings": "src\/2a6f99df-a327-4477-8079-f57133e6ff36\/settings.json", + "path": "src\/2a6f99df-a327-4477-8079-f57133e6ff36", + "guid": "2a6f99df-a327-4477-8079-f57133e6ff36" + }, + "aeb42050-90e1-4169-907a-fa6cde20caa4": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/aeb42050-90e1-4169-907a-fa6cde20caa4\/code.php", + "power": "src\/aeb42050-90e1-4169-907a-fa6cde20caa4\/code.power", + "settings": "src\/aeb42050-90e1-4169-907a-fa6cde20caa4\/settings.json", + "path": "src\/aeb42050-90e1-4169-907a-fa6cde20caa4", + "guid": "aeb42050-90e1-4169-907a-fa6cde20caa4" + }, + "9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3": { + "name": "Teams", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3\/code.php", + "power": "src\/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3\/code.power", + "settings": "src\/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3\/settings.json", + "path": "src\/9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3", + "guid": "9c886ee5-ff14-44c3-a3dd-6a30ebf32ca3" + }, + "d9fa532a-dbe8-445f-93dc-398a3cf01c1e": { + "name": "Members", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization\\Teams", + "code": "src\/d9fa532a-dbe8-445f-93dc-398a3cf01c1e\/code.php", + "power": "src\/d9fa532a-dbe8-445f-93dc-398a3cf01c1e\/code.power", + "settings": "src\/d9fa532a-dbe8-445f-93dc-398a3cf01c1e\/settings.json", + "path": "src\/d9fa532a-dbe8-445f-93dc-398a3cf01c1e", + "guid": "d9fa532a-dbe8-445f-93dc-398a3cf01c1e" + }, + "07fce5f7-eb13-4dda-8870-77c9ad32a7bf": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization\\Teams", + "code": "src\/07fce5f7-eb13-4dda-8870-77c9ad32a7bf\/code.php", + "power": "src\/07fce5f7-eb13-4dda-8870-77c9ad32a7bf\/code.power", + "settings": "src\/07fce5f7-eb13-4dda-8870-77c9ad32a7bf\/settings.json", + "path": "src\/07fce5f7-eb13-4dda-8870-77c9ad32a7bf", + "guid": "07fce5f7-eb13-4dda-8870-77c9ad32a7bf" + }, + "b3f6728b-8c88-4ee8-9aa0-bcef400a35bf": { + "name": "User", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Organization", + "code": "src\/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf\/code.php", + "power": "src\/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf\/code.power", + "settings": "src\/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf\/settings.json", + "path": "src\/b3f6728b-8c88-4ee8-9aa0-bcef400a35bf", + "guid": "b3f6728b-8c88-4ee8-9aa0-bcef400a35bf" + }, + "3d25ea99-4f33-489a-934c-0e42027e6114": { + "name": "Organization", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/3d25ea99-4f33-489a-934c-0e42027e6114\/code.php", + "power": "src\/3d25ea99-4f33-489a-934c-0e42027e6114\/code.power", + "settings": "src\/3d25ea99-4f33-489a-934c-0e42027e6114\/settings.json", + "path": "src\/3d25ea99-4f33-489a-934c-0e42027e6114", + "guid": "3d25ea99-4f33-489a-934c-0e42027e6114" + }, + "4a5694db-bf3c-439b-bf9c-36a487828787": { + "name": "User", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/4a5694db-bf3c-439b-bf9c-36a487828787\/code.php", + "power": "src\/4a5694db-bf3c-439b-bf9c-36a487828787\/code.power", + "settings": "src\/4a5694db-bf3c-439b-bf9c-36a487828787\/settings.json", + "path": "src\/4a5694db-bf3c-439b-bf9c-36a487828787", + "guid": "4a5694db-bf3c-439b-bf9c-36a487828787" + }, + "4a9e144e-7754-4d3f-9325-9ff792ce4aef": { + "name": "Applications", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/4a9e144e-7754-4d3f-9325-9ff792ce4aef\/code.php", + "power": "src\/4a9e144e-7754-4d3f-9325-9ff792ce4aef\/code.power", + "settings": "src\/4a9e144e-7754-4d3f-9325-9ff792ce4aef\/settings.json", + "path": "src\/4a9e144e-7754-4d3f-9325-9ff792ce4aef", + "guid": "4a9e144e-7754-4d3f-9325-9ff792ce4aef" + }, + "af4b8b77-d773-42a7-9f54-19de463bc49b": { + "name": "Emails", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/af4b8b77-d773-42a7-9f54-19de463bc49b\/code.php", + "power": "src\/af4b8b77-d773-42a7-9f54-19de463bc49b\/code.power", + "settings": "src\/af4b8b77-d773-42a7-9f54-19de463bc49b\/settings.json", + "path": "src\/af4b8b77-d773-42a7-9f54-19de463bc49b", + "guid": "af4b8b77-d773-42a7-9f54-19de463bc49b" + }, + "13931443-bad7-4742-b64e-c08042e7b306": { + "name": "Followers", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/13931443-bad7-4742-b64e-c08042e7b306\/code.php", + "power": "src\/13931443-bad7-4742-b64e-c08042e7b306\/code.power", + "settings": "src\/13931443-bad7-4742-b64e-c08042e7b306\/settings.json", + "path": "src\/13931443-bad7-4742-b64e-c08042e7b306", + "guid": "13931443-bad7-4742-b64e-c08042e7b306" + }, + "b1788488-f557-4746-9929-73e1d049b4a2": { + "name": "Following", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/b1788488-f557-4746-9929-73e1d049b4a2\/code.php", + "power": "src\/b1788488-f557-4746-9929-73e1d049b4a2\/code.power", + "settings": "src\/b1788488-f557-4746-9929-73e1d049b4a2\/settings.json", + "path": "src\/b1788488-f557-4746-9929-73e1d049b4a2", + "guid": "b1788488-f557-4746-9929-73e1d049b4a2" + }, + "f135ca7f-4d50-4480-a15f-feae1a7982ab": { + "name": "Gpg", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/f135ca7f-4d50-4480-a15f-feae1a7982ab\/code.php", + "power": "src\/f135ca7f-4d50-4480-a15f-feae1a7982ab\/code.power", + "settings": "src\/f135ca7f-4d50-4480-a15f-feae1a7982ab\/settings.json", + "path": "src\/f135ca7f-4d50-4480-a15f-feae1a7982ab", + "guid": "f135ca7f-4d50-4480-a15f-feae1a7982ab" + }, + "c521f8c3-4e01-4c1a-8f68-f3e9d967651d": { + "name": "Keys", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/c521f8c3-4e01-4c1a-8f68-f3e9d967651d\/code.php", + "power": "src\/c521f8c3-4e01-4c1a-8f68-f3e9d967651d\/code.power", + "settings": "src\/c521f8c3-4e01-4c1a-8f68-f3e9d967651d\/settings.json", + "path": "src\/c521f8c3-4e01-4c1a-8f68-f3e9d967651d", + "guid": "c521f8c3-4e01-4c1a-8f68-f3e9d967651d" + }, + "fd560f3e-ce19-474f-86ca-1fb1d3af9992": { + "name": "Repos", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/fd560f3e-ce19-474f-86ca-1fb1d3af9992\/code.php", + "power": "src\/fd560f3e-ce19-474f-86ca-1fb1d3af9992\/code.power", + "settings": "src\/fd560f3e-ce19-474f-86ca-1fb1d3af9992\/settings.json", + "path": "src\/fd560f3e-ce19-474f-86ca-1fb1d3af9992", + "guid": "fd560f3e-ce19-474f-86ca-1fb1d3af9992" + }, + "553b8fc5-46cc-49b7-95ce-992a3c5708f8": { + "name": "Settings", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/553b8fc5-46cc-49b7-95ce-992a3c5708f8\/code.php", + "power": "src\/553b8fc5-46cc-49b7-95ce-992a3c5708f8\/code.power", + "settings": "src\/553b8fc5-46cc-49b7-95ce-992a3c5708f8\/settings.json", + "path": "src\/553b8fc5-46cc-49b7-95ce-992a3c5708f8", + "guid": "553b8fc5-46cc-49b7-95ce-992a3c5708f8" + }, + "884b61d0-1f56-4f5f-a657-acaacdb9634b": { + "name": "Starred", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/884b61d0-1f56-4f5f-a657-acaacdb9634b\/code.php", + "power": "src\/884b61d0-1f56-4f5f-a657-acaacdb9634b\/code.power", + "settings": "src\/884b61d0-1f56-4f5f-a657-acaacdb9634b\/settings.json", + "path": "src\/884b61d0-1f56-4f5f-a657-acaacdb9634b", + "guid": "884b61d0-1f56-4f5f-a657-acaacdb9634b" + }, + "b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf": { + "name": "Subscriptions", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf\/code.php", + "power": "src\/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf\/code.power", + "settings": "src\/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf\/settings.json", + "path": "src\/b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf", + "guid": "b6e17249-5afc-4bc0-a4aa-8d2241c1ccaf" + }, + "c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3": { + "name": "Teams", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3\/code.php", + "power": "src\/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3\/code.power", + "settings": "src\/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3\/settings.json", + "path": "src\/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3", + "guid": "c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3" + }, + "2ccb303f-b115-45fb-b3ea-08a38259681e": { + "name": "Times", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/2ccb303f-b115-45fb-b3ea-08a38259681e\/code.php", + "power": "src\/2ccb303f-b115-45fb-b3ea-08a38259681e\/code.power", + "settings": "src\/2ccb303f-b115-45fb-b3ea-08a38259681e\/settings.json", + "path": "src\/2ccb303f-b115-45fb-b3ea-08a38259681e", + "guid": "2ccb303f-b115-45fb-b3ea-08a38259681e" + }, + "af49b450-78fb-40bd-8165-48466ebd31a9": { + "name": "Tokens", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\User", + "code": "src\/af49b450-78fb-40bd-8165-48466ebd31a9\/code.php", + "power": "src\/af49b450-78fb-40bd-8165-48466ebd31a9\/code.power", + "settings": "src\/af49b450-78fb-40bd-8165-48466ebd31a9\/settings.json", + "path": "src\/af49b450-78fb-40bd-8165-48466ebd31a9", + "guid": "af49b450-78fb-40bd-8165-48466ebd31a9" + }, + "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e": { + "name": "User", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e\/code.php", + "power": "src\/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e\/code.power", + "settings": "src\/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e\/settings.json", + "path": "src\/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e", + "guid": "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e" + }, + "eb6c050d-7100-42b8-a922-f7e7c78a08c2": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/eb6c050d-7100-42b8-a922-f7e7c78a08c2\/code.php", + "power": "src\/eb6c050d-7100-42b8-a922-f7e7c78a08c2\/code.power", + "settings": "src\/eb6c050d-7100-42b8-a922-f7e7c78a08c2\/settings.json", + "path": "src\/eb6c050d-7100-42b8-a922-f7e7c78a08c2", + "guid": "eb6c050d-7100-42b8-a922-f7e7c78a08c2" + }, + "8a8fce09-a880-4364-a8c4-4ca337e7e951": { + "name": "Archive", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/8a8fce09-a880-4364-a8c4-4ca337e7e951\/code.php", + "power": "src\/8a8fce09-a880-4364-a8c4-4ca337e7e951\/code.power", + "settings": "src\/8a8fce09-a880-4364-a8c4-4ca337e7e951\/settings.json", + "path": "src\/8a8fce09-a880-4364-a8c4-4ca337e7e951", + "guid": "8a8fce09-a880-4364-a8c4-4ca337e7e951" + }, + "66f866a7-f3a0-40ac-ac94-168d60c4a643": { + "name": "Assignees", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/66f866a7-f3a0-40ac-ac94-168d60c4a643\/code.php", + "power": "src\/66f866a7-f3a0-40ac-ac94-168d60c4a643\/code.power", + "settings": "src\/66f866a7-f3a0-40ac-ac94-168d60c4a643\/settings.json", + "path": "src\/66f866a7-f3a0-40ac-ac94-168d60c4a643", + "guid": "66f866a7-f3a0-40ac-ac94-168d60c4a643" + }, + "68f930bc-d24f-4ade-bcec-576f82c3c13d": { + "name": "Attachments", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/68f930bc-d24f-4ade-bcec-576f82c3c13d\/code.php", + "power": "src\/68f930bc-d24f-4ade-bcec-576f82c3c13d\/code.power", + "settings": "src\/68f930bc-d24f-4ade-bcec-576f82c3c13d\/settings.json", + "path": "src\/68f930bc-d24f-4ade-bcec-576f82c3c13d", + "guid": "68f930bc-d24f-4ade-bcec-576f82c3c13d" + }, + "8fd54ec5-d93e-445c-ae27-80b6052dbddd": { + "name": "Branch", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/8fd54ec5-d93e-445c-ae27-80b6052dbddd\/code.php", + "power": "src\/8fd54ec5-d93e-445c-ae27-80b6052dbddd\/code.power", + "settings": "src\/8fd54ec5-d93e-445c-ae27-80b6052dbddd\/settings.json", + "path": "src\/8fd54ec5-d93e-445c-ae27-80b6052dbddd", + "guid": "8fd54ec5-d93e-445c-ae27-80b6052dbddd" + }, + "0edb3d51-0a65-443b-883d-3d20325212bb": { + "name": "Protection", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository\\Branch", + "code": "src\/0edb3d51-0a65-443b-883d-3d20325212bb\/code.php", + "power": "src\/0edb3d51-0a65-443b-883d-3d20325212bb\/code.power", + "settings": "src\/0edb3d51-0a65-443b-883d-3d20325212bb\/settings.json", + "path": "src\/0edb3d51-0a65-443b-883d-3d20325212bb", + "guid": "0edb3d51-0a65-443b-883d-3d20325212bb" + }, + "e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf": { + "name": "Collaborator", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf\/code.php", + "power": "src\/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf\/code.power", + "settings": "src\/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf\/settings.json", + "path": "src\/e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf", + "guid": "e5d342ee-caf9-4b29-b7b6-2b81a8ef58cf" + }, + "daa18d45-3d4a-4280-b58c-147683e8093c": { + "name": "Commits", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/daa18d45-3d4a-4280-b58c-147683e8093c\/code.php", + "power": "src\/daa18d45-3d4a-4280-b58c-147683e8093c\/code.power", + "settings": "src\/daa18d45-3d4a-4280-b58c-147683e8093c\/settings.json", + "path": "src\/daa18d45-3d4a-4280-b58c-147683e8093c", + "guid": "daa18d45-3d4a-4280-b58c-147683e8093c" + }, + "8d1baef6-fcad-49a9-848f-428009cdb989": { + "name": "Contents", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/8d1baef6-fcad-49a9-848f-428009cdb989\/code.php", + "power": "src\/8d1baef6-fcad-49a9-848f-428009cdb989\/code.power", + "settings": "src\/8d1baef6-fcad-49a9-848f-428009cdb989\/settings.json", + "path": "src\/8d1baef6-fcad-49a9-848f-428009cdb989", + "guid": "8d1baef6-fcad-49a9-848f-428009cdb989" + }, + "7fbed5f9-54a2-4001-a0d1-4621034166ef": { + "name": "Forks", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/7fbed5f9-54a2-4001-a0d1-4621034166ef\/code.php", + "power": "src\/7fbed5f9-54a2-4001-a0d1-4621034166ef\/code.power", + "settings": "src\/7fbed5f9-54a2-4001-a0d1-4621034166ef\/settings.json", + "path": "src\/7fbed5f9-54a2-4001-a0d1-4621034166ef", + "guid": "7fbed5f9-54a2-4001-a0d1-4621034166ef" + }, + "93f4bc91-946d-447a-ab5a-4f76e0e1a9ce": { + "name": "Gpg", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce\/code.php", + "power": "src\/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce\/code.power", + "settings": "src\/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce\/settings.json", + "path": "src\/93f4bc91-946d-447a-ab5a-4f76e0e1a9ce", + "guid": "93f4bc91-946d-447a-ab5a-4f76e0e1a9ce" + }, + "463ce0a3-65e0-4a08-8bd2-e3bd0a058488": { + "name": "Hooks", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/463ce0a3-65e0-4a08-8bd2-e3bd0a058488\/code.php", + "power": "src\/463ce0a3-65e0-4a08-8bd2-e3bd0a058488\/code.power", + "settings": "src\/463ce0a3-65e0-4a08-8bd2-e3bd0a058488\/settings.json", + "path": "src\/463ce0a3-65e0-4a08-8bd2-e3bd0a058488", + "guid": "463ce0a3-65e0-4a08-8bd2-e3bd0a058488" + }, + "a11cacb2-c13a-4482-bf71-1b7d99574a98": { + "name": "Git", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository\\Hooks", + "code": "src\/a11cacb2-c13a-4482-bf71-1b7d99574a98\/code.php", + "power": "src\/a11cacb2-c13a-4482-bf71-1b7d99574a98\/code.power", + "settings": "src\/a11cacb2-c13a-4482-bf71-1b7d99574a98\/settings.json", + "path": "src\/a11cacb2-c13a-4482-bf71-1b7d99574a98", + "guid": "a11cacb2-c13a-4482-bf71-1b7d99574a98" + }, + "501fbf08-9f56-4aa0-96d7-5905b511be08": { + "name": "Keys", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/501fbf08-9f56-4aa0-96d7-5905b511be08\/code.php", + "power": "src\/501fbf08-9f56-4aa0-96d7-5905b511be08\/code.power", + "settings": "src\/501fbf08-9f56-4aa0-96d7-5905b511be08\/settings.json", + "path": "src\/501fbf08-9f56-4aa0-96d7-5905b511be08", + "guid": "501fbf08-9f56-4aa0-96d7-5905b511be08" + }, + "c140a62c-ea7b-470f-b8ca-83cfbcdd13ba": { + "name": "Languages", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba\/code.php", + "power": "src\/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba\/code.power", + "settings": "src\/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba\/settings.json", + "path": "src\/c140a62c-ea7b-470f-b8ca-83cfbcdd13ba", + "guid": "c140a62c-ea7b-470f-b8ca-83cfbcdd13ba" + }, + "c0ee5592-e49f-4937-9b13-f4352afcb430": { + "name": "Media", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/c0ee5592-e49f-4937-9b13-f4352afcb430\/code.php", + "power": "src\/c0ee5592-e49f-4937-9b13-f4352afcb430\/code.power", + "settings": "src\/c0ee5592-e49f-4937-9b13-f4352afcb430\/settings.json", + "path": "src\/c0ee5592-e49f-4937-9b13-f4352afcb430", + "guid": "c0ee5592-e49f-4937-9b13-f4352afcb430" + }, + "0f99429a-b517-40ac-a3c1-34c3ef2f36ee": { + "name": "Merge", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/0f99429a-b517-40ac-a3c1-34c3ef2f36ee\/code.php", + "power": "src\/0f99429a-b517-40ac-a3c1-34c3ef2f36ee\/code.power", + "settings": "src\/0f99429a-b517-40ac-a3c1-34c3ef2f36ee\/settings.json", + "path": "src\/0f99429a-b517-40ac-a3c1-34c3ef2f36ee", + "guid": "0f99429a-b517-40ac-a3c1-34c3ef2f36ee" + }, + "f6249c33-b4bd-4598-8710-0cab230aef94": { + "name": "Mirror", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/f6249c33-b4bd-4598-8710-0cab230aef94\/code.php", + "power": "src\/f6249c33-b4bd-4598-8710-0cab230aef94\/code.power", + "settings": "src\/f6249c33-b4bd-4598-8710-0cab230aef94\/settings.json", + "path": "src\/f6249c33-b4bd-4598-8710-0cab230aef94", + "guid": "f6249c33-b4bd-4598-8710-0cab230aef94" + }, + "403855fb-668d-464a-af45-8e30b198c9d6": { + "name": "Mirrors", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/403855fb-668d-464a-af45-8e30b198c9d6\/code.php", + "power": "src\/403855fb-668d-464a-af45-8e30b198c9d6\/code.power", + "settings": "src\/403855fb-668d-464a-af45-8e30b198c9d6\/settings.json", + "path": "src\/403855fb-668d-464a-af45-8e30b198c9d6", + "guid": "403855fb-668d-464a-af45-8e30b198c9d6" + }, + "cf8fa194-9f83-4a2a-b52b-ede069188afe": { + "name": "Notes", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/cf8fa194-9f83-4a2a-b52b-ede069188afe\/code.php", + "power": "src\/cf8fa194-9f83-4a2a-b52b-ede069188afe\/code.power", + "settings": "src\/cf8fa194-9f83-4a2a-b52b-ede069188afe\/settings.json", + "path": "src\/cf8fa194-9f83-4a2a-b52b-ede069188afe", + "guid": "cf8fa194-9f83-4a2a-b52b-ede069188afe" + }, + "1dda1c2c-1670-4aea-a6b8-49f0bd03b41e": { + "name": "Patch", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e\/code.php", + "power": "src\/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e\/code.power", + "settings": "src\/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e\/settings.json", + "path": "src\/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e", + "guid": "1dda1c2c-1670-4aea-a6b8-49f0bd03b41e" + }, + "f56114fd-6804-4ce9-8adb-1d521f023c11": { + "name": "Pulls", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/f56114fd-6804-4ce9-8adb-1d521f023c11\/code.php", + "power": "src\/f56114fd-6804-4ce9-8adb-1d521f023c11\/code.power", + "settings": "src\/f56114fd-6804-4ce9-8adb-1d521f023c11\/settings.json", + "path": "src\/f56114fd-6804-4ce9-8adb-1d521f023c11", + "guid": "f56114fd-6804-4ce9-8adb-1d521f023c11" + }, + "974d9e4c-beef-4c35-a3c6-92b1dd5b145d": { + "name": "Refs", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/974d9e4c-beef-4c35-a3c6-92b1dd5b145d\/code.php", + "power": "src\/974d9e4c-beef-4c35-a3c6-92b1dd5b145d\/code.power", + "settings": "src\/974d9e4c-beef-4c35-a3c6-92b1dd5b145d\/settings.json", + "path": "src\/974d9e4c-beef-4c35-a3c6-92b1dd5b145d", + "guid": "974d9e4c-beef-4c35-a3c6-92b1dd5b145d" + }, + "754d737c-3b6f-43f0-8974-2e06a3daf41e": { + "name": "Releases", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/754d737c-3b6f-43f0-8974-2e06a3daf41e\/code.php", + "power": "src\/754d737c-3b6f-43f0-8974-2e06a3daf41e\/code.power", + "settings": "src\/754d737c-3b6f-43f0-8974-2e06a3daf41e\/settings.json", + "path": "src\/754d737c-3b6f-43f0-8974-2e06a3daf41e", + "guid": "754d737c-3b6f-43f0-8974-2e06a3daf41e" + }, + "994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd": { + "name": "Remote", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd\/code.php", + "power": "src\/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd\/code.power", + "settings": "src\/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd\/settings.json", + "path": "src\/994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd", + "guid": "994f4ffe-6030-4bfd-a0b1-4e1aa54bb8cd" + }, + "65288a04-bcac-4067-ae2b-6fda9f1e3fd5": { + "name": "Reviewers", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/65288a04-bcac-4067-ae2b-6fda9f1e3fd5\/code.php", + "power": "src\/65288a04-bcac-4067-ae2b-6fda9f1e3fd5\/code.power", + "settings": "src\/65288a04-bcac-4067-ae2b-6fda9f1e3fd5\/settings.json", + "path": "src\/65288a04-bcac-4067-ae2b-6fda9f1e3fd5", + "guid": "65288a04-bcac-4067-ae2b-6fda9f1e3fd5" + }, + "6a2fffb5-63ff-4a96-b458-632a5ff90814": { + "name": "Reviews", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/6a2fffb5-63ff-4a96-b458-632a5ff90814\/code.php", + "power": "src\/6a2fffb5-63ff-4a96-b458-632a5ff90814\/code.power", + "settings": "src\/6a2fffb5-63ff-4a96-b458-632a5ff90814\/settings.json", + "path": "src\/6a2fffb5-63ff-4a96-b458-632a5ff90814", + "guid": "6a2fffb5-63ff-4a96-b458-632a5ff90814" + }, + "4b355731-bbcc-430f-a451-f94ff9bb1c20": { + "name": "Stargazers", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/4b355731-bbcc-430f-a451-f94ff9bb1c20\/code.php", + "power": "src\/4b355731-bbcc-430f-a451-f94ff9bb1c20\/code.power", + "settings": "src\/4b355731-bbcc-430f-a451-f94ff9bb1c20\/settings.json", + "path": "src\/4b355731-bbcc-430f-a451-f94ff9bb1c20", + "guid": "4b355731-bbcc-430f-a451-f94ff9bb1c20" + }, + "5f01760a-de24-49f7-b08e-d340c847f86a": { + "name": "Statuses", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/5f01760a-de24-49f7-b08e-d340c847f86a\/code.php", + "power": "src\/5f01760a-de24-49f7-b08e-d340c847f86a\/code.power", + "settings": "src\/5f01760a-de24-49f7-b08e-d340c847f86a\/settings.json", + "path": "src\/5f01760a-de24-49f7-b08e-d340c847f86a", + "guid": "5f01760a-de24-49f7-b08e-d340c847f86a" + }, + "caf25475-8c9e-4e07-a7f5-f606e98ec880": { + "name": "Tags", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/caf25475-8c9e-4e07-a7f5-f606e98ec880\/code.php", + "power": "src\/caf25475-8c9e-4e07-a7f5-f606e98ec880\/code.power", + "settings": "src\/caf25475-8c9e-4e07-a7f5-f606e98ec880\/settings.json", + "path": "src\/caf25475-8c9e-4e07-a7f5-f606e98ec880", + "guid": "caf25475-8c9e-4e07-a7f5-f606e98ec880" + }, + "c7b31fc2-892b-4235-beb2-3413e4432839": { + "name": "Teams", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/c7b31fc2-892b-4235-beb2-3413e4432839\/code.php", + "power": "src\/c7b31fc2-892b-4235-beb2-3413e4432839\/code.power", + "settings": "src\/c7b31fc2-892b-4235-beb2-3413e4432839\/settings.json", + "path": "src\/c7b31fc2-892b-4235-beb2-3413e4432839", + "guid": "c7b31fc2-892b-4235-beb2-3413e4432839" + }, + "8c82b705-04bb-4bd2-ac09-3f590fdf48c2": { + "name": "Templates", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/8c82b705-04bb-4bd2-ac09-3f590fdf48c2\/code.php", + "power": "src\/8c82b705-04bb-4bd2-ac09-3f590fdf48c2\/code.power", + "settings": "src\/8c82b705-04bb-4bd2-ac09-3f590fdf48c2\/settings.json", + "path": "src\/8c82b705-04bb-4bd2-ac09-3f590fdf48c2", + "guid": "8c82b705-04bb-4bd2-ac09-3f590fdf48c2" + }, + "d7b67b1c-f876-4555-9e54-0645cf519d4c": { + "name": "Times", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/d7b67b1c-f876-4555-9e54-0645cf519d4c\/code.php", + "power": "src\/d7b67b1c-f876-4555-9e54-0645cf519d4c\/code.power", + "settings": "src\/d7b67b1c-f876-4555-9e54-0645cf519d4c\/settings.json", + "path": "src\/d7b67b1c-f876-4555-9e54-0645cf519d4c", + "guid": "d7b67b1c-f876-4555-9e54-0645cf519d4c" + }, + "7f852309-122b-42fb-b2f3-ea9e2d405a9c": { + "name": "Topics", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/7f852309-122b-42fb-b2f3-ea9e2d405a9c\/code.php", + "power": "src\/7f852309-122b-42fb-b2f3-ea9e2d405a9c\/code.power", + "settings": "src\/7f852309-122b-42fb-b2f3-ea9e2d405a9c\/settings.json", + "path": "src\/7f852309-122b-42fb-b2f3-ea9e2d405a9c", + "guid": "7f852309-122b-42fb-b2f3-ea9e2d405a9c" + }, + "04adb831-c257-4657-a2c3-a17096b6b5cf": { + "name": "Transfer", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/04adb831-c257-4657-a2c3-a17096b6b5cf\/code.php", + "power": "src\/04adb831-c257-4657-a2c3-a17096b6b5cf\/code.power", + "settings": "src\/04adb831-c257-4657-a2c3-a17096b6b5cf\/settings.json", + "path": "src\/04adb831-c257-4657-a2c3-a17096b6b5cf", + "guid": "04adb831-c257-4657-a2c3-a17096b6b5cf" + }, + "78b3346f-c4cf-46b3-941c-656e2d510da0": { + "name": "Trees", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/78b3346f-c4cf-46b3-941c-656e2d510da0\/code.php", + "power": "src\/78b3346f-c4cf-46b3-941c-656e2d510da0\/code.power", + "settings": "src\/78b3346f-c4cf-46b3-941c-656e2d510da0\/settings.json", + "path": "src\/78b3346f-c4cf-46b3-941c-656e2d510da0", + "guid": "78b3346f-c4cf-46b3-941c-656e2d510da0" + }, + "93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7": { + "name": "Watchers", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7\/code.php", + "power": "src\/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7\/code.power", + "settings": "src\/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7\/settings.json", + "path": "src\/93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7", + "guid": "93d704d3-aed8-4ee5-a25e-e7fbfb23b5c7" + }, + "572b9567-1893-400b-bd34-f1a45ef7e503": { + "name": "Wiki", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Repository", + "code": "src\/572b9567-1893-400b-bd34-f1a45ef7e503\/code.php", + "power": "src\/572b9567-1893-400b-bd34-f1a45ef7e503\/code.power", + "settings": "src\/572b9567-1893-400b-bd34-f1a45ef7e503\/settings.json", + "path": "src\/572b9567-1893-400b-bd34-f1a45ef7e503", + "guid": "572b9567-1893-400b-bd34-f1a45ef7e503" + }, + "0bb2b72f-ebcd-46fe-844b-ac5fe715c230": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/0bb2b72f-ebcd-46fe-844b-ac5fe715c230\/code.php", + "power": "src\/0bb2b72f-ebcd-46fe-844b-ac5fe715c230\/code.power", + "settings": "src\/0bb2b72f-ebcd-46fe-844b-ac5fe715c230\/settings.json", + "path": "src\/0bb2b72f-ebcd-46fe-844b-ac5fe715c230", + "guid": "0bb2b72f-ebcd-46fe-844b-ac5fe715c230" + }, + "b7ec675d-3197-4458-89d6-ca5d4303af8a": { + "name": "Package", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/b7ec675d-3197-4458-89d6-ca5d4303af8a\/code.php", + "power": "src\/b7ec675d-3197-4458-89d6-ca5d4303af8a\/code.power", + "settings": "src\/b7ec675d-3197-4458-89d6-ca5d4303af8a\/settings.json", + "path": "src\/b7ec675d-3197-4458-89d6-ca5d4303af8a", + "guid": "b7ec675d-3197-4458-89d6-ca5d4303af8a" + }, + "4a54c21f-ac3a-4489-b507-636835541a67": { + "name": "Files", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Package", + "code": "src\/4a54c21f-ac3a-4489-b507-636835541a67\/code.php", + "power": "src\/4a54c21f-ac3a-4489-b507-636835541a67\/code.power", + "settings": "src\/4a54c21f-ac3a-4489-b507-636835541a67\/settings.json", + "path": "src\/4a54c21f-ac3a-4489-b507-636835541a67", + "guid": "4a54c21f-ac3a-4489-b507-636835541a67" + }, + "b5ca512b-f667-4ec6-bc6e-914af41d344a": { + "name": "Owner", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Package", + "code": "src\/b5ca512b-f667-4ec6-bc6e-914af41d344a\/code.php", + "power": "src\/b5ca512b-f667-4ec6-bc6e-914af41d344a\/code.power", + "settings": "src\/b5ca512b-f667-4ec6-bc6e-914af41d344a\/settings.json", + "path": "src\/b5ca512b-f667-4ec6-bc6e-914af41d344a", + "guid": "b5ca512b-f667-4ec6-bc6e-914af41d344a" + }, + "808da4eb-b467-46cf-a767-e7e714f46b5a": { + "name": "Package", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/808da4eb-b467-46cf-a767-e7e714f46b5a\/code.php", + "power": "src\/808da4eb-b467-46cf-a767-e7e714f46b5a\/code.power", + "settings": "src\/808da4eb-b467-46cf-a767-e7e714f46b5a\/settings.json", + "path": "src\/808da4eb-b467-46cf-a767-e7e714f46b5a", + "guid": "808da4eb-b467-46cf-a767-e7e714f46b5a" + }, + "5c8f9038-d6e9-4788-96df-45019eafbadb": { + "name": "Issue", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/5c8f9038-d6e9-4788-96df-45019eafbadb\/code.php", + "power": "src\/5c8f9038-d6e9-4788-96df-45019eafbadb\/code.power", + "settings": "src\/5c8f9038-d6e9-4788-96df-45019eafbadb\/settings.json", + "path": "src\/5c8f9038-d6e9-4788-96df-45019eafbadb", + "guid": "5c8f9038-d6e9-4788-96df-45019eafbadb" + }, + "22d65693-917d-47c7-ba5c-8e1f354dc713": { + "name": "Comments", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/22d65693-917d-47c7-ba5c-8e1f354dc713\/code.php", + "power": "src\/22d65693-917d-47c7-ba5c-8e1f354dc713\/code.power", + "settings": "src\/22d65693-917d-47c7-ba5c-8e1f354dc713\/settings.json", + "path": "src\/22d65693-917d-47c7-ba5c-8e1f354dc713", + "guid": "22d65693-917d-47c7-ba5c-8e1f354dc713" + }, + "63fbd482-688a-4356-b3e4-a676ef357100": { + "name": "Comments", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue\\Repository", + "code": "src\/63fbd482-688a-4356-b3e4-a676ef357100\/code.php", + "power": "src\/63fbd482-688a-4356-b3e4-a676ef357100\/code.power", + "settings": "src\/63fbd482-688a-4356-b3e4-a676ef357100\/settings.json", + "path": "src\/63fbd482-688a-4356-b3e4-a676ef357100", + "guid": "63fbd482-688a-4356-b3e4-a676ef357100" + }, + "61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69": { + "name": "Deadline", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69\/code.php", + "power": "src\/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69\/code.power", + "settings": "src\/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69\/settings.json", + "path": "src\/61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69", + "guid": "61ddd1b9-4b74-44bd-a7ee-f743cd4c2f69" + }, + "ca53d4cb-7800-4ea2-b06e-7466ded91e49": { + "name": "Labels", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/ca53d4cb-7800-4ea2-b06e-7466ded91e49\/code.php", + "power": "src\/ca53d4cb-7800-4ea2-b06e-7466ded91e49\/code.power", + "settings": "src\/ca53d4cb-7800-4ea2-b06e-7466ded91e49\/settings.json", + "path": "src\/ca53d4cb-7800-4ea2-b06e-7466ded91e49", + "guid": "ca53d4cb-7800-4ea2-b06e-7466ded91e49" + }, + "e819d1a2-4390-432d-be36-3421f2fa861c": { + "name": "Labels", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/e819d1a2-4390-432d-be36-3421f2fa861c\/code.php", + "power": "src\/e819d1a2-4390-432d-be36-3421f2fa861c\/code.power", + "settings": "src\/e819d1a2-4390-432d-be36-3421f2fa861c\/settings.json", + "path": "src\/e819d1a2-4390-432d-be36-3421f2fa861c", + "guid": "e819d1a2-4390-432d-be36-3421f2fa861c" + }, + "f428beab-10f4-4c0d-bb9e-8c797ed7a7c9": { + "name": "Milestones", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9\/code.php", + "power": "src\/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9\/code.power", + "settings": "src\/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9\/settings.json", + "path": "src\/f428beab-10f4-4c0d-bb9e-8c797ed7a7c9", + "guid": "f428beab-10f4-4c0d-bb9e-8c797ed7a7c9" + }, + "e6c2dee6-54b9-4476-8896-2bfa14a87650": { + "name": "Reactions", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/e6c2dee6-54b9-4476-8896-2bfa14a87650\/code.php", + "power": "src\/e6c2dee6-54b9-4476-8896-2bfa14a87650\/code.power", + "settings": "src\/e6c2dee6-54b9-4476-8896-2bfa14a87650\/settings.json", + "path": "src\/e6c2dee6-54b9-4476-8896-2bfa14a87650", + "guid": "e6c2dee6-54b9-4476-8896-2bfa14a87650" + }, + "73b3ebfa-c52a-4a96-a8de-718ff0bbc155": { + "name": "Comment", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue\\Reactions", + "code": "src\/73b3ebfa-c52a-4a96-a8de-718ff0bbc155\/code.php", + "power": "src\/73b3ebfa-c52a-4a96-a8de-718ff0bbc155\/code.power", + "settings": "src\/73b3ebfa-c52a-4a96-a8de-718ff0bbc155\/settings.json", + "path": "src\/73b3ebfa-c52a-4a96-a8de-718ff0bbc155", + "guid": "73b3ebfa-c52a-4a96-a8de-718ff0bbc155" + }, + "a68d1841-65bb-41c8-ac09-cfddf73bb822": { + "name": "Stopwatch", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/a68d1841-65bb-41c8-ac09-cfddf73bb822\/code.php", + "power": "src\/a68d1841-65bb-41c8-ac09-cfddf73bb822\/code.power", + "settings": "src\/a68d1841-65bb-41c8-ac09-cfddf73bb822\/settings.json", + "path": "src\/a68d1841-65bb-41c8-ac09-cfddf73bb822", + "guid": "a68d1841-65bb-41c8-ac09-cfddf73bb822" + }, + "acca507d-e632-4349-9e3a-9dba5d19fbf9": { + "name": "Subscriptions", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/acca507d-e632-4349-9e3a-9dba5d19fbf9\/code.php", + "power": "src\/acca507d-e632-4349-9e3a-9dba5d19fbf9\/code.power", + "settings": "src\/acca507d-e632-4349-9e3a-9dba5d19fbf9\/settings.json", + "path": "src\/acca507d-e632-4349-9e3a-9dba5d19fbf9", + "guid": "acca507d-e632-4349-9e3a-9dba5d19fbf9" + }, + "83bb983b-80d8-44d5-917b-03d3c13742b9": { + "name": "Timeline", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/83bb983b-80d8-44d5-917b-03d3c13742b9\/code.php", + "power": "src\/83bb983b-80d8-44d5-917b-03d3c13742b9\/code.power", + "settings": "src\/83bb983b-80d8-44d5-917b-03d3c13742b9\/settings.json", + "path": "src\/83bb983b-80d8-44d5-917b-03d3c13742b9", + "guid": "83bb983b-80d8-44d5-917b-03d3c13742b9" + }, + "d273c34e-88c1-438b-98c0-801996f58c29": { + "name": "Times", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Issue", + "code": "src\/d273c34e-88c1-438b-98c0-801996f58c29\/code.php", + "power": "src\/d273c34e-88c1-438b-98c0-801996f58c29\/code.power", + "settings": "src\/d273c34e-88c1-438b-98c0-801996f58c29\/settings.json", + "path": "src\/d273c34e-88c1-438b-98c0-801996f58c29", + "guid": "d273c34e-88c1-438b-98c0-801996f58c29" + }, + "44396eb8-e14c-47d9-9bdc-8205c0fd2bba": { + "name": "Issue", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/44396eb8-e14c-47d9-9bdc-8205c0fd2bba\/code.php", + "power": "src\/44396eb8-e14c-47d9-9bdc-8205c0fd2bba\/code.power", + "settings": "src\/44396eb8-e14c-47d9-9bdc-8205c0fd2bba\/settings.json", + "path": "src\/44396eb8-e14c-47d9-9bdc-8205c0fd2bba", + "guid": "44396eb8-e14c-47d9-9bdc-8205c0fd2bba" + }, + "c8cbc9bd-ee91-403a-8633-0e8b59619a49": { + "name": "Notifications", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/c8cbc9bd-ee91-403a-8633-0e8b59619a49\/code.php", + "power": "src\/c8cbc9bd-ee91-403a-8633-0e8b59619a49\/code.power", + "settings": "src\/c8cbc9bd-ee91-403a-8633-0e8b59619a49\/settings.json", + "path": "src\/c8cbc9bd-ee91-403a-8633-0e8b59619a49", + "guid": "c8cbc9bd-ee91-403a-8633-0e8b59619a49" + }, + "3a4ce297-4536-45be-b3cc-d93474e55528": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Notifications", + "code": "src\/3a4ce297-4536-45be-b3cc-d93474e55528\/code.php", + "power": "src\/3a4ce297-4536-45be-b3cc-d93474e55528\/code.power", + "settings": "src\/3a4ce297-4536-45be-b3cc-d93474e55528\/settings.json", + "path": "src\/3a4ce297-4536-45be-b3cc-d93474e55528", + "guid": "3a4ce297-4536-45be-b3cc-d93474e55528" + }, + "db14e345-c3d9-4dda-8534-4963cd6ca6f5": { + "name": "Thread", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Notifications", + "code": "src\/db14e345-c3d9-4dda-8534-4963cd6ca6f5\/code.php", + "power": "src\/db14e345-c3d9-4dda-8534-4963cd6ca6f5\/code.power", + "settings": "src\/db14e345-c3d9-4dda-8534-4963cd6ca6f5\/settings.json", + "path": "src\/db14e345-c3d9-4dda-8534-4963cd6ca6f5", + "guid": "db14e345-c3d9-4dda-8534-4963cd6ca6f5" + }, + "be57f70f-1214-4d69-8d33-7cd4e312ff70": { + "name": "Notifications", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/be57f70f-1214-4d69-8d33-7cd4e312ff70\/code.php", + "power": "src\/be57f70f-1214-4d69-8d33-7cd4e312ff70\/code.power", + "settings": "src\/be57f70f-1214-4d69-8d33-7cd4e312ff70\/settings.json", + "path": "src\/be57f70f-1214-4d69-8d33-7cd4e312ff70", + "guid": "be57f70f-1214-4d69-8d33-7cd4e312ff70" + }, + "9ae44ddd-9d69-4298-a50b-05129cbebb76": { + "name": "Activitypub", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous", + "code": "src\/9ae44ddd-9d69-4298-a50b-05129cbebb76\/code.php", + "power": "src\/9ae44ddd-9d69-4298-a50b-05129cbebb76\/code.power", + "settings": "src\/9ae44ddd-9d69-4298-a50b-05129cbebb76\/settings.json", + "path": "src\/9ae44ddd-9d69-4298-a50b-05129cbebb76", + "guid": "9ae44ddd-9d69-4298-a50b-05129cbebb76" + }, + "5974503e-e56c-488b-bee3-f93b90c781df": { + "name": "Gpg", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous", + "code": "src\/5974503e-e56c-488b-bee3-f93b90c781df\/code.php", + "power": "src\/5974503e-e56c-488b-bee3-f93b90c781df\/code.power", + "settings": "src\/5974503e-e56c-488b-bee3-f93b90c781df\/settings.json", + "path": "src\/5974503e-e56c-488b-bee3-f93b90c781df", + "guid": "5974503e-e56c-488b-bee3-f93b90c781df" + }, + "8f1a0130-e555-4e6a-9fa8-9b99e30b39fa": { + "name": "Markdown", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous", + "code": "src\/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa\/code.php", + "power": "src\/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa\/code.power", + "settings": "src\/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa\/settings.json", + "path": "src\/8f1a0130-e555-4e6a-9fa8-9b99e30b39fa", + "guid": "8f1a0130-e555-4e6a-9fa8-9b99e30b39fa" + }, + "2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f": { + "name": "NodeInfo", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous", + "code": "src\/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f\/code.php", + "power": "src\/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f\/code.power", + "settings": "src\/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f\/settings.json", + "path": "src\/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f", + "guid": "2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f" + }, + "7fb2cd98-a87d-4f48-9720-033924c69e34": { + "name": "Version", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Miscellaneous", + "code": "src\/7fb2cd98-a87d-4f48-9720-033924c69e34\/code.php", + "power": "src\/7fb2cd98-a87d-4f48-9720-033924c69e34\/code.power", + "settings": "src\/7fb2cd98-a87d-4f48-9720-033924c69e34\/settings.json", + "path": "src\/7fb2cd98-a87d-4f48-9720-033924c69e34", + "guid": "7fb2cd98-a87d-4f48-9720-033924c69e34" + }, + "012af7d0-3436-4cae-b856-be49bdc39a3e": { + "name": "Miscellaneous", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/012af7d0-3436-4cae-b856-be49bdc39a3e\/code.php", + "power": "src\/012af7d0-3436-4cae-b856-be49bdc39a3e\/code.power", + "settings": "src\/012af7d0-3436-4cae-b856-be49bdc39a3e\/settings.json", + "path": "src\/012af7d0-3436-4cae-b856-be49bdc39a3e", + "guid": "012af7d0-3436-4cae-b856-be49bdc39a3e" + }, + "6e1a6731-2587-4ad5-8e70-ca83eba65ee0": { + "name": "Cron", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin", + "code": "src\/6e1a6731-2587-4ad5-8e70-ca83eba65ee0\/code.php", + "power": "src\/6e1a6731-2587-4ad5-8e70-ca83eba65ee0\/code.power", + "settings": "src\/6e1a6731-2587-4ad5-8e70-ca83eba65ee0\/settings.json", + "path": "src\/6e1a6731-2587-4ad5-8e70-ca83eba65ee0", + "guid": "6e1a6731-2587-4ad5-8e70-ca83eba65ee0" + }, + "5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0": { + "name": "Organizations", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin", + "code": "src\/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0\/code.php", + "power": "src\/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0\/code.power", + "settings": "src\/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0\/settings.json", + "path": "src\/5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0", + "guid": "5d42c91a-6e4d-4c26-80d7-1b1d27cb35e0" + }, + "3aba9610-cb22-48e0-b2d7-2a9e708c82e2": { + "name": "Unadopted", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin", + "code": "src\/3aba9610-cb22-48e0-b2d7-2a9e708c82e2\/code.php", + "power": "src\/3aba9610-cb22-48e0-b2d7-2a9e708c82e2\/code.power", + "settings": "src\/3aba9610-cb22-48e0-b2d7-2a9e708c82e2\/settings.json", + "path": "src\/3aba9610-cb22-48e0-b2d7-2a9e708c82e2", + "guid": "3aba9610-cb22-48e0-b2d7-2a9e708c82e2" + }, + "e7c810a1-3d6a-42e4-b45f-bee554f259b3": { + "name": "Users", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin", + "code": "src\/e7c810a1-3d6a-42e4-b45f-bee554f259b3\/code.php", + "power": "src\/e7c810a1-3d6a-42e4-b45f-bee554f259b3\/code.power", + "settings": "src\/e7c810a1-3d6a-42e4-b45f-bee554f259b3\/settings.json", + "path": "src\/e7c810a1-3d6a-42e4-b45f-bee554f259b3", + "guid": "e7c810a1-3d6a-42e4-b45f-bee554f259b3" + }, + "2d29b342-cb4a-45f9-9cf1-a7347fbc0701": { + "name": "Keys", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin\\Users", + "code": "src\/2d29b342-cb4a-45f9-9cf1-a7347fbc0701\/code.php", + "power": "src\/2d29b342-cb4a-45f9-9cf1-a7347fbc0701\/code.power", + "settings": "src\/2d29b342-cb4a-45f9-9cf1-a7347fbc0701\/settings.json", + "path": "src\/2d29b342-cb4a-45f9-9cf1-a7347fbc0701", + "guid": "2d29b342-cb4a-45f9-9cf1-a7347fbc0701" + }, + "0039c453-cf6d-468b-9232-fc3fc13ca0c2": { + "name": "Organization", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin\\Users", + "code": "src\/0039c453-cf6d-468b-9232-fc3fc13ca0c2\/code.php", + "power": "src\/0039c453-cf6d-468b-9232-fc3fc13ca0c2\/code.power", + "settings": "src\/0039c453-cf6d-468b-9232-fc3fc13ca0c2\/settings.json", + "path": "src\/0039c453-cf6d-468b-9232-fc3fc13ca0c2", + "guid": "0039c453-cf6d-468b-9232-fc3fc13ca0c2" + }, + "49ae84dc-4474-468f-bf99-c92433fd1cc4": { + "name": "Repository", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Admin\\Users", + "code": "src\/49ae84dc-4474-468f-bf99-c92433fd1cc4\/code.php", + "power": "src\/49ae84dc-4474-468f-bf99-c92433fd1cc4\/code.power", + "settings": "src\/49ae84dc-4474-468f-bf99-c92433fd1cc4\/settings.json", + "path": "src\/49ae84dc-4474-468f-bf99-c92433fd1cc4", + "guid": "49ae84dc-4474-468f-bf99-c92433fd1cc4" + }, + "ddced4c5-667d-4559-873d-d716c17fd85b": { + "name": "Admin", + "type": "class", + "namespace": "VDM\\Joomla\\Gitea\\Service", + "code": "src\/ddced4c5-667d-4559-873d-d716c17fd85b\/code.php", + "power": "src\/ddced4c5-667d-4559-873d-d716c17fd85b\/code.power", + "settings": "src\/ddced4c5-667d-4559-873d-d716c17fd85b\/settings.json", + "path": "src\/ddced4c5-667d-4559-873d-d716c17fd85b", + "guid": "ddced4c5-667d-4559-873d-d716c17fd85b" + }, + "4612af84-5a42-4ea5-87bf-9d79cc19c330": { + "name": "Factory", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Gitea", + "code": "src\/4612af84-5a42-4ea5-87bf-9d79cc19c330\/code.php", + "power": "src\/4612af84-5a42-4ea5-87bf-9d79cc19c330\/code.power", + "settings": "src\/4612af84-5a42-4ea5-87bf-9d79cc19c330\/settings.json", + "path": "src\/4612af84-5a42-4ea5-87bf-9d79cc19c330", + "guid": "4612af84-5a42-4ea5-87bf-9d79cc19c330" + }, + "71acf8d6-32b8-4173-8277-eb9cda29fd64": { + "name": "Gitea", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Service", + "code": "src\/71acf8d6-32b8-4173-8277-eb9cda29fd64\/code.php", + "power": "src\/71acf8d6-32b8-4173-8277-eb9cda29fd64\/code.power", + "settings": "src\/71acf8d6-32b8-4173-8277-eb9cda29fd64\/settings.json", + "path": "src\/71acf8d6-32b8-4173-8277-eb9cda29fd64", + "guid": "71acf8d6-32b8-4173-8277-eb9cda29fd64" + } +} \ No newline at end of file