|
|
@ -42,7 +42,7 @@ class DeegraphServer |
|
|
|
* |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
private function RunRawRequest( |
|
|
|
private function runRawRequest( |
|
|
|
UUID $actorID, |
|
|
|
string $endpoint, |
|
|
|
string $method = "GET", |
|
|
@ -128,7 +128,7 @@ class DeegraphServer |
|
|
|
message: "Deegraph server responded with an internal error code", |
|
|
|
code: 0, |
|
|
|
previous: null, |
|
|
|
// trade: isset($server_output["@trace"]) ? $server_output["@trace"] : null |
|
|
|
// trade: isset($server_output["@trace"]) ? $server_output["@trace"] : null |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
@ -140,9 +140,9 @@ class DeegraphServer |
|
|
|
return $temp; |
|
|
|
} |
|
|
|
|
|
|
|
public function RunQuery(UUID $actorID, string $queryString): array |
|
|
|
public function runQuery(UUID $actorID, string $queryString): array |
|
|
|
{ |
|
|
|
return $this->RunRawRequest( |
|
|
|
return $this->runRawRequest( |
|
|
|
actorID: $actorID, |
|
|
|
endpoint: "/api/v1/@query", |
|
|
|
method: "POST", |
|
|
@ -150,9 +150,9 @@ class DeegraphServer |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public function GetRawNode(UUID $actorID, UUID $nodeID): DeegraphNodeDetails |
|
|
|
public function getRawNode(UUID $actorID, UUID $nodeID): DeegraphNodeDetails |
|
|
|
{ |
|
|
|
$response = $this->RunRawRequest( |
|
|
|
$response = $this->runRawRequest( |
|
|
|
actorID: $actorID, |
|
|
|
endpoint: "/api/v1/{$nodeID}", |
|
|
|
method: "GET", |
|
|
@ -165,9 +165,9 @@ class DeegraphServer |
|
|
|
* Runs an API request against the Deegraph Server, and returns back information about the Deegraph Server. |
|
|
|
* @return ServerInfo |
|
|
|
*/ |
|
|
|
public function ServerInfo(UUID $actorID): ServerInfo |
|
|
|
public function serverInfo(UUID $actorID): ServerInfo |
|
|
|
{ |
|
|
|
$response = $this->RunRawRequest( |
|
|
|
$response = $this->runRawRequest( |
|
|
|
actorID: $actorID, |
|
|
|
endpoint: "/api/v1/@server_info", |
|
|
|
method: "GET", |
|
|
@ -177,9 +177,9 @@ class DeegraphServer |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function CreateNewNode( |
|
|
|
public function createNewNode( |
|
|
|
UUID $actorID, |
|
|
|
string $dataURL, |
|
|
|
?string $dataURL = null, |
|
|
|
?string $schema = null, |
|
|
|
?UUID $creator = null |
|
|
|
): NewNodeDetails |
|
|
@ -190,7 +190,7 @@ class DeegraphServer |
|
|
|
if($schema != null) |
|
|
|
$body["@schema"] = $schema; |
|
|
|
|
|
|
|
$response = $this->RunRawRequest( |
|
|
|
$response = $this->runRawRequest( |
|
|
|
actorID: $actorID, |
|
|
|
endpoint: "/api/v1/@new", |
|
|
|
method: "PUT", |
|
|
|