|
|
@ -4,19 +4,19 @@ namespace Darksparrow\DeegraphInteractions\Core; |
|
|
|
|
|
|
|
use Darksparrow\DeegraphInteractions\DataStructures\QueryResponseWrapper; |
|
|
|
use Darksparrow\DeegraphInteractions\DataStructures\ServerInfo; |
|
|
|
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\GrantQuery; |
|
|
|
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\InsertQuery; |
|
|
|
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\PutQuery; |
|
|
|
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\SelectQuery; |
|
|
|
|
|
|
|
class DeegraphServer |
|
|
|
final class DeegraphServer |
|
|
|
{ |
|
|
|
private string $Token; |
|
|
|
private string $Actor; |
|
|
|
protected string $Token; |
|
|
|
protected string $Actor; |
|
|
|
|
|
|
|
|
|
|
|
private string $ServerDomain; |
|
|
|
private int $Port; |
|
|
|
private bool $AllowSelfSignedCerts; |
|
|
|
protected string $ServerDomain; |
|
|
|
protected int $Port; |
|
|
|
protected bool $AllowSelfSignedCerts; |
|
|
|
|
|
|
|
public function __construct( |
|
|
|
string $token, |
|
|
@ -33,6 +33,11 @@ class DeegraphServer |
|
|
|
$this->AllowSelfSignedCerts = $allowSelfSignedCerts; |
|
|
|
} |
|
|
|
|
|
|
|
public function GetActor(): string |
|
|
|
{ |
|
|
|
return $this->Actor; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Runs an API request against the Deegraph Server, and returns back information about the Deegraph Server. |
|
|
|
* @return ServerInfo |
|
|
@ -85,7 +90,9 @@ class DeegraphServer |
|
|
|
* @param InsertQuery|PutQuery|SelectQuery $query Takes in a Query Builder object. |
|
|
|
* @return QueryResponseWrapper |
|
|
|
*/ |
|
|
|
public function RunQuery(InsertQuery|PutQuery|SelectQuery $query): QueryResponseWrapper |
|
|
|
public function RunQuery( |
|
|
|
GrantQuery|InsertQuery|PutQuery|SelectQuery $query |
|
|
|
): QueryResponseWrapper |
|
|
|
{ |
|
|
|
$response = $this->RunRawRequest( |
|
|
|
endpoint: "/api/v1/@query", |
|
|
|