first commit
This commit is contained in:
commit
208627be2d
46
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/README.md
Normal file
46
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/README.md
Normal file
@ -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)
|
||||
|
70
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.php
Normal file
70
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
43
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.power
Normal file
43
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/code.power
Normal file
@ -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
|
||||
);
|
||||
}
|
18
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/settings.json
Normal file
18
src/0039c453-cf6d-468b-9232-fc3fc13ca0c2/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
77
src/012af7d0-3436-4cae-b856-be49bdc39a3e/README.md
Normal file
77
src/012af7d0-3436-4cae-b856-be49bdc39a3e/README.md
Normal file
@ -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)
|
||||
|
143
src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.php
Normal file
143
src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
110
src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.power
Normal file
110
src/012af7d0-3436-4cae-b856-be49bdc39a3e/code.power
Normal file
@ -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')
|
||||
);
|
||||
}
|
42
src/012af7d0-3436-4cae-b856-be49bdc39a3e/settings.json
Normal file
42
src/012af7d0-3436-4cae-b856-be49bdc39a3e/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
37
src/0367ac44-18d6-495d-beae-315794ffa89d/README.md
Normal file
37
src/0367ac44-18d6-495d-beae-315794ffa89d/README.md
Normal file
@ -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)
|
||||
|
45
src/0367ac44-18d6-495d-beae-315794ffa89d/code.php
Normal file
45
src/0367ac44-18d6-495d-beae-315794ffa89d/code.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
18
src/0367ac44-18d6-495d-beae-315794ffa89d/code.power
Normal file
18
src/0367ac44-18d6-495d-beae-315794ffa89d/code.power
Normal file
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
18
src/0367ac44-18d6-495d-beae-315794ffa89d/settings.json
Normal file
18
src/0367ac44-18d6-495d-beae-315794ffa89d/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
59
src/04adb831-c257-4657-a2c3-a17096b6b5cf/README.md
Normal file
59
src/04adb831-c257-4657-a2c3-a17096b6b5cf/README.md
Normal file
@ -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)
|
||||
|
108
src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.php
Normal file
108
src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
81
src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.power
Normal file
81
src/04adb831-c257-4657-a2c3-a17096b6b5cf/code.power
Normal file
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
18
src/04adb831-c257-4657-a2c3-a17096b6b5cf/settings.json
Normal file
18
src/04adb831-c257-4657-a2c3-a17096b6b5cf/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
81
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/README.md
Normal file
81
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/README.md
Normal file
@ -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)
|
||||
|
135
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.php
Normal file
135
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
108
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.power
Normal file
108
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/code.power
Normal file
@ -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'
|
||||
);
|
||||
}
|
18
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/settings.json
Normal file
18
src/07fce5f7-eb13-4dda-8870-77c9ad32a7bf/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
149
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/README.md
Normal file
149
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/README.md
Normal file
@ -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)
|
||||
|
332
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.php
Normal file
332
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.php
Normal file
@ -0,0 +1,332 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
290
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.power
Normal file
290
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/code.power
Normal file
@ -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')
|
||||
);
|
||||
}
|
78
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/settings.json
Normal file
78
src/0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
341
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/README.md
Normal file
341
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/README.md
Normal file
@ -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)
|
||||
|
836
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.php
Normal file
836
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.php
Normal file
@ -0,0 +1,836 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
770
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.power
Normal file
770
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/code.power
Normal file
@ -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')
|
||||
);
|
||||
}
|
174
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/settings.json
Normal file
174
src/0bb2b72f-ebcd-46fe-844b-ac5fe715c230/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
131
src/0edb3d51-0a65-443b-883d-3d20325212bb/README.md
Normal file
131
src/0edb3d51-0a65-443b-883d-3d20325212bb/README.md
Normal file
@ -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)
|
||||
|
380
src/0edb3d51-0a65-443b-883d-3d20325212bb/code.php
Normal file
380
src/0edb3d51-0a65-443b-883d-3d20325212bb/code.php
Normal file
@ -0,0 +1,380 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
353
src/0edb3d51-0a65-443b-883d-3d20325212bb/code.power
Normal file
353
src/0edb3d51-0a65-443b-883d-3d20325212bb/code.power
Normal file
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
18
src/0edb3d51-0a65-443b-883d-3d20325212bb/settings.json
Normal file
18
src/0edb3d51-0a65-443b-883d-3d20325212bb/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
76
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/README.md
Normal file
76
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/README.md
Normal file
@ -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)
|
||||
|
167
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.php
Normal file
167
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.php
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
140
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.power
Normal file
140
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/code.power
Normal file
@ -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'
|
||||
);
|
||||
}
|
18
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/settings.json
Normal file
18
src/0f99429a-b517-40ac-a3c1-34c3ef2f36ee/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
37
src/13931443-bad7-4742-b64e-c08042e7b306/README.md
Normal file
37
src/13931443-bad7-4742-b64e-c08042e7b306/README.md
Normal file
@ -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)
|
||||
|
54
src/13931443-bad7-4742-b64e-c08042e7b306/code.php
Normal file
54
src/13931443-bad7-4742-b64e-c08042e7b306/code.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
27
src/13931443-bad7-4742-b64e-c08042e7b306/code.power
Normal file
27
src/13931443-bad7-4742-b64e-c08042e7b306/code.power
Normal file
@ -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)
|
||||
);
|
||||
}
|
18
src/13931443-bad7-4742-b64e-c08042e7b306/settings.json
Normal file
18
src/13931443-bad7-4742-b64e-c08042e7b306/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
66
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/README.md
Normal file
66
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/README.md
Normal file
@ -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)
|
||||
|
142
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.php
Normal file
142
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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 '';
|
||||
}
|
||||
|
||||
}
|
||||
|
113
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.power
Normal file
113
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/code.power
Normal file
@ -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 '';
|
||||
}
|
27
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/settings.json
Normal file
27
src/19eb68d7-1e19-4d14-a0ef-70d719c45e80/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
66
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/README.md
Normal file
66
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/README.md
Normal file
@ -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)
|
||||
|
78
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.php
Normal file
78
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
51
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.power
Normal file
51
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/code.power
Normal file
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
18
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/settings.json
Normal file
18
src/1dda1c2c-1670-4aea-a6b8-49f0bd03b41e/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
100
src/22d65693-917d-47c7-ba5c-8e1f354dc713/README.md
Normal file
100
src/22d65693-917d-47c7-ba5c-8e1f354dc713/README.md
Normal file
@ -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)
|
||||
|
176
src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.php
Normal file
176
src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
149
src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.power
Normal file
149
src/22d65693-917d-47c7-ba5c-8e1f354dc713/code.power
Normal file
@ -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
|
||||
);
|
||||
}
|
18
src/22d65693-917d-47c7-ba5c-8e1f354dc713/settings.json
Normal file
18
src/22d65693-917d-47c7-ba5c-8e1f354dc713/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
66
src/2a6f99df-a327-4477-8079-f57133e6ff36/README.md
Normal file
66
src/2a6f99df-a327-4477-8079-f57133e6ff36/README.md
Normal file
@ -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)
|
||||
|
119
src/2a6f99df-a327-4477-8079-f57133e6ff36/code.php
Normal file
119
src/2a6f99df-a327-4477-8079-f57133e6ff36/code.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
92
src/2a6f99df-a327-4477-8079-f57133e6ff36/code.power
Normal file
92
src/2a6f99df-a327-4477-8079-f57133e6ff36/code.power
Normal file
@ -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'
|
||||
);
|
||||
}
|
18
src/2a6f99df-a327-4477-8079-f57133e6ff36/settings.json
Normal file
18
src/2a6f99df-a327-4477-8079-f57133e6ff36/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
37
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/README.md
Normal file
37
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/README.md
Normal file
@ -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)
|
||||
|
45
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.php
Normal file
45
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
18
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.power
Normal file
18
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/code.power
Normal file
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
18
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/settings.json
Normal file
18
src/2cc6543d-b8c7-4bb9-8845-bfae2fb7a71f/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
51
src/2ccb303f-b115-45fb-b3ea-08a38259681e/README.md
Normal file
51
src/2ccb303f-b115-45fb-b3ea-08a38259681e/README.md
Normal file
@ -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)
|
||||
|
96
src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.php
Normal file
96
src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
69
src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.power
Normal file
69
src/2ccb303f-b115-45fb-b3ea-08a38259681e/code.power
Normal file
@ -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)
|
||||
);
|
||||
}
|
18
src/2ccb303f-b115-45fb-b3ea-08a38259681e/settings.json
Normal file
18
src/2ccb303f-b115-45fb-b3ea-08a38259681e/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
52
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/README.md
Normal file
52
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/README.md
Normal file
@ -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)
|
||||
|
86
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.php
Normal file
86
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
59
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.power
Normal file
59
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/code.power
Normal file
@ -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'
|
||||
);
|
||||
}
|
18
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/settings.json
Normal file
18
src/2d29b342-cb4a-45f9-9cf1-a7347fbc0701/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
64
src/3a4ce297-4536-45be-b3cc-d93474e55528/README.md
Normal file
64
src/3a4ce297-4536-45be-b3cc-d93474e55528/README.md
Normal file
@ -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)
|
||||
|
144
src/3a4ce297-4536-45be-b3cc-d93474e55528/code.php
Normal file
144
src/3a4ce297-4536-45be-b3cc-d93474e55528/code.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
117
src/3a4ce297-4536-45be-b3cc-d93474e55528/code.power
Normal file
117
src/3a4ce297-4536-45be-b3cc-d93474e55528/code.power
Normal file
@ -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
|
||||
);
|
||||
}
|
18
src/3a4ce297-4536-45be-b3cc-d93474e55528/settings.json
Normal file
18
src/3a4ce297-4536-45be-b3cc-d93474e55528/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
58
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/README.md
Normal file
58
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/README.md
Normal file
@ -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)
|
||||
|
101
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.php
Normal file
101
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
74
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.power
Normal file
74
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/code.power
Normal file
@ -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'
|
||||
);
|
||||
}
|
18
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/settings.json
Normal file
18
src/3aba9610-cb22-48e0-b2d7-2a9e708c82e2/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
117
src/3d25ea99-4f33-489a-934c-0e42027e6114/README.md
Normal file
117
src/3d25ea99-4f33-489a-934c-0e42027e6114/README.md
Normal file
@ -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)
|
||||
|
248
src/3d25ea99-4f33-489a-934c-0e42027e6114/code.php
Normal file
248
src/3d25ea99-4f33-489a-934c-0e42027e6114/code.php
Normal file
@ -0,0 +1,248 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
210
src/3d25ea99-4f33-489a-934c-0e42027e6114/code.power
Normal file
210
src/3d25ea99-4f33-489a-934c-0e42027e6114/code.power
Normal file
@ -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')
|
||||
);
|
||||
}
|
62
src/3d25ea99-4f33-489a-934c-0e42027e6114/settings.json
Normal file
62
src/3d25ea99-4f33-489a-934c-0e42027e6114/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
37
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/README.md
Normal file
37
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/README.md
Normal file
@ -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)
|
||||
|
45
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.php
Normal file
45
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
18
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.power
Normal file
18
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/code.power
Normal file
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
18
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/settings.json
Normal file
18
src/3d4ed24c-8250-4fcf-824f-a5f1597f939e/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
52
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/README.md
Normal file
52
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/README.md
Normal file
@ -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)
|
||||
|
83
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.php
Normal file
83
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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);
|
||||
}
|
||||
|
||||
}
|
||||
|
54
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.power
Normal file
54
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/code.power
Normal file
@ -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);
|
||||
}
|
31
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/settings.json
Normal file
31
src/3d7af7a2-dabe-4111-b5fd-c5bfa8755469/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
94
src/403855fb-668d-464a-af45-8e30b198c9d6/README.md
Normal file
94
src/403855fb-668d-464a-af45-8e30b198c9d6/README.md
Normal file
@ -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)
|
||||
|
190
src/403855fb-668d-464a-af45-8e30b198c9d6/code.php
Normal file
190
src/403855fb-668d-464a-af45-8e30b198c9d6/code.php
Normal file
@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
163
src/403855fb-668d-464a-af45-8e30b198c9d6/code.power
Normal file
163
src/403855fb-668d-464a-af45-8e30b198c9d6/code.power
Normal file
@ -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'
|
||||
);
|
||||
}
|
18
src/403855fb-668d-464a-af45-8e30b198c9d6/settings.json
Normal file
18
src/403855fb-668d-464a-af45-8e30b198c9d6/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
133
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/README.md
Normal file
133
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/README.md
Normal file
@ -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)
|
||||
|
294
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.php
Normal file
294
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.php
Normal file
@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
253
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.power
Normal file
253
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/code.power
Normal file
@ -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')
|
||||
);
|
||||
}
|
74
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/settings.json
Normal file
74
src/44396eb8-e14c-47d9-9bdc-8205c0fd2bba/settings.json
Normal file
@ -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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/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": ""
|
||||
}
|
54
src/4612af84-5a42-4ea5-87bf-9d79cc19c330/README.md
Normal file
54
src/4612af84-5a42-4ea5-87bf-9d79cc19c330/README.md
Normal file
@ -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)
|
||||
|
97
src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.php
Normal file
97
src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/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());
|
||||
}
|
||||
|
||||
}
|
||||
|
58
src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.power
Normal file
58
src/4612af84-5a42-4ea5-87bf-9d79cc19c330/code.power
Normal file
@ -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());
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user