Fixed changelog direction so newest changes is listed at top of the file. Finished the init function of super powers. Adds rest function inside super power. Adds super powers to all templates. Updates many helper class methods to now use the utility classes. Adds the method to the component entry file (as-well). Moved most methods from the compiler fields class to powers. #955 Refactored many new builder classes from the registry class. Converted the Content class to two builder classes. Adds option to add additional templates to a module. Resolves #1002 by adding STRING instead of WORD. Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof Changed all CSS and JS to use instead of in compiler code. Adds option to turn jQuery off if UIKIT 3 is added. Adds option to auto write injection boilerplate code in Powers area. Adds option to auto write service provider boilerplate code in the Powers area. Improved the method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead. Major stability improvements all over the new powers complier classes. New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB. Remember to update all plug-ins with this version update (use the package).

This commit is contained in:
2023-10-18 09:26:30 +02:00
parent a77eac9adf
commit e99899f6f1
632 changed files with 30604 additions and 16888 deletions

View File

@@ -67,16 +67,23 @@ abstract class Api
/**
* Load/Reload API.
*
* @param string $url The url.
* @param token $token The token.
* @param string|null $url The url.
* @param token|null $token The token.
*
* @return void
* @since 3.2.0
**/
public function load_(string $url, string $token)
public function load_(?string $url = null, ?string $token = null)
{
$this->uri->setUrl($url);
$this->http->setToken($token);
if ($url !== null)
{
$this->uri->setUrl($url);
}
if ($token !== null)
{
$this->http->setToken($token);
}
}
}

View File

@@ -24,7 +24,7 @@ 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;
use VDM\Joomla\Interfaces\FactoryInterface;
/**

View File

@@ -205,16 +205,19 @@ class Contents extends Api
// Build the request path.
$path = "/repos/{$owner}/{$repo}/contents";
// Get the URI with the specified path.
$uri = $this->uri->get($path);
// Add the 'ref' parameter if it's provided.
if ($ref !== null)
{
$this->uri->setVar('ref', $ref);
$uri->setVar('ref', $ref);
}
// Send the get request.
return $this->response->get(
$this->http->get(
$this->uri->get($path)
$uri
)
);
}
@@ -227,8 +230,8 @@ class Contents extends Api
* @param string $filepath The file path.
* @param string $content The file content.
* @param string $message The commit message.
* @param string $branch The branch name. Defaults to the repository's default branch.
* @param string $sha The blob SHA of the file.
* @param string $branch The branch name. Defaults to the repository's default branch.
* @param string|null $authorName The author name. Defaults to the authenticated user.
* @param string|null $authorEmail The author email. Defaults to the authenticated user.
* @param string|null $committerName The committer name. Defaults to the authenticated user.
@@ -248,8 +251,8 @@ class Contents extends Api
string $filepath,
string $content,
string $message,
string $branch = 'master',
string $sha,
string $branch = 'master',
?string $authorName = null,
?string $authorEmail = null,
?string $committerName = null,
@@ -503,7 +506,6 @@ class Contents extends Api
$this->uri->get($path)
)
);
}
}
}

View File

@@ -179,7 +179,6 @@ class Admin implements ServiceProviderInterface
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}
}
}

View File

@@ -76,9 +76,19 @@ class Jcb implements ServiceProviderInterface
*/
public function getHttp(Container $container): Http
{
return new Http(
Helper::getParams('com_componentbuilder')->get('gitea_token')
);
$add_gitea_url = Helper::getParams('com_componentbuilder')->get('add_custom_gitea_url', 1);
if ($add_gitea_url == 2)
{
return new Http(
Helper::getParams('com_componentbuilder')->get('custom_gitea_token')
);
}
else
{
return new Http(
Helper::getParams('com_componentbuilder')->get('gitea_token')
);
}
}
}

View File

@@ -830,7 +830,6 @@ class Repository implements ServiceProviderInterface
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}
}
}

View File

@@ -66,7 +66,6 @@ class Utilities implements ServiceProviderInterface
public function getResponse(Container $container): Response
{
return new Response();
}
}
}

View File

@@ -44,7 +44,7 @@ final class Response
// Decode the error response and throw an exception.
$message = $this->error($response);
throw new \DomainException("Invalid response received from API.$message", $response->code);
throw new \DomainException("Invalid response received from API. $message", $response->code);
}
@@ -70,7 +70,7 @@ final class Response
// Decode the error response and throw an exception.
$message = $this->error($response);
throw new \DomainException("Invalid response received from API.$message", $response->code);
throw new \DomainException("Invalid response received from API. $message", $response->code);
}
@@ -134,6 +134,10 @@ final class Response
{
return $error->error;
}
elseif (isset($error->message))
{
return $error->message;
}
return '';
}

View File

@@ -107,7 +107,7 @@ final class Uri
**/
public function setUrl(string $url)
{
return $this->url = $url;
$this->url = $url;
}
/**
@@ -120,7 +120,7 @@ final class Uri
**/
private function setEndpoint(string $endpoint)
{
return $this->endpoint = $endpoint;
$this->endpoint = $endpoint;
}
/**
@@ -133,7 +133,7 @@ final class Uri
**/
private function setVersion($version)
{
return $this->version = $version;
$this->version = $version;
}
}