From 2f97431c931fd6d42c8575d1bcadd473186daae6 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 10:54:10 +0300 Subject: [PATCH 01/14] add rest table --- integration/rest.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 integration/rest.md diff --git a/integration/rest.md b/integration/rest.md new file mode 100644 index 0000000..e81055d --- /dev/null +++ b/integration/rest.md @@ -0,0 +1,24 @@ +--- +tile: "Rest API" +description: > + Rest API detailed doc +parent: "integration" +--- + +| Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| +| ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | +| Login | [http://localhost:3000/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | +| Logout | [http://localhost:3000/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | +| Modify config role | [http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | +| Get config role value | [http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | +| Create new user | [http://localhost:3000/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | +| Delete user | [http://localhost:3000/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | +| Get All Users | [http://localhost:3000/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| +| Modify User Role | [http://localhost:3000/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | +| Create new Graph | [http://localhost:3000/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | +| Delete Graph | [http://localhost:3000/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | +| Get All Graphs | [http://localhost:3000/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | +| Run A Query | [http://localhost:3000/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | +| Duplicate A Graph | [http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | +| Create New Schema | [http://localhost:3000/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| +| Delete A Schema | [http://localhost:3000/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file From f55f2a0265ee620f10135d271efdc60b4d3abaff Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 10:56:54 +0300 Subject: [PATCH 02/14] remove http://localhost:3000/ from path --- integration/rest.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/integration/rest.md b/integration/rest.md index e81055d..5a7bfc0 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -7,18 +7,18 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [http://localhost:3000/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | -| Logout | [http://localhost:3000/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | -| Modify config role | [http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | -| Get config role value | [http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | -| Create new user | [http://localhost:3000/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | -| Delete user | [http://localhost:3000/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | -| Get All Users | [http://localhost:3000/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| -| Modify User Role | [http://localhost:3000/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | -| Create new Graph | [http://localhost:3000/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | -| Delete Graph | [http://localhost:3000/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | -| Get All Graphs | [http://localhost:3000/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | -| Run A Query | [http://localhost:3000/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | -| Duplicate A Graph | [http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | -| Create New Schema | [http://localhost:3000/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| -| Delete A Schema | [http://localhost:3000/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file +| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | +| Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | +| Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | +| Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | +| Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | +| Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | +| Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| +| Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | +| Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | +| Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | +| Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | +| Run A Query | [/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | +| Duplicate A Graph | [/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | +| Create New Schema | [/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| +| Delete A Schema | [/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file From 0dfc25184ca4f90499e7bae528dc629ac314c1dd Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:00:37 +0300 Subject: [PATCH 03/14] format json --- integration/rest.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/integration/rest.md b/integration/rest.md index 5a7bfc0..1064fa2 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -7,7 +7,14 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | +| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200 + +```json +{ "credentials": {"id": "credentials","name": "Credentials","type": "credentials","signinUrl": "http://localhost:3000/api/auth/signin/credentials","callbackUrl": "http://localhost:3000/api/auth/callback/credentials" +}} +``` + +| This request is used for user authentication. | | Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | | Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | | Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | From 4bf4ef829dcb2cf17762f6e614cfb8d4ef31ac26 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:02:44 +0300 Subject: [PATCH 04/14] format json --- integration/rest.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/integration/rest.md b/integration/rest.md index 1064fa2..5072efb 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -7,14 +7,7 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200 - -```json -{ "credentials": {"id": "credentials","name": "Credentials","type": "credentials","signinUrl": "http://localhost:3000/api/auth/signin/credentials","callbackUrl": "http://localhost:3000/api/auth/callback/credentials" -}} -``` - -| This request is used for user authentication. | +| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
}
| This request is used for user authentication. | | Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | | Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | | Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | From 4f9f4320ef3d11e150d89ba86e9b7d99aab78ee0 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:05:09 +0300 Subject: [PATCH 05/14] format json --- integration/rest.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/integration/rest.md b/integration/rest.md index 5072efb..12e4254 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -7,7 +7,14 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
}
| This request is used for user authentication. | +| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{"credentials": {\
+"id": "credentials",\
+"name": "Credentials",\
+"type": "credentials",\
+"signinUrl": "http://localhost:3000/api/auth/signin/credentials",\
+"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"\
+}\
+}
| This request is used for user authentication. | | Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | | Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | | Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | From 46fb192f9288d5e467bec10f02bc4477bc155c50 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:05:40 +0300 Subject: [PATCH 06/14] format json --- integration/rest.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration/rest.md b/integration/rest.md index 12e4254..7c3532b 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -7,7 +7,8 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{"credentials": {\
+| Login         | [/api/auth/providers](http://localhost:3000/api/auth/providers)                                                                             | GET            | None                                            | None                                                                                                  | None                                                                                                                                       | Status Code: 200 
+
{"credentials": {\
 "id": "credentials",\
 "name": "Credentials",\
 "type": "credentials",\

From 12787f205a0a06dbad9a77a010ab4262d9a4ad39 Mon Sep 17 00:00:00 2001
From: Guy Korland 
Date: Mon, 9 Sep 2024 11:06:48 +0300
Subject: [PATCH 07/14] format json

---
 integration/rest.md | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/integration/rest.md b/integration/rest.md
index 7c3532b..5a7bfc0 100644
--- a/integration/rest.md
+++ b/integration/rest.md
@@ -7,15 +7,7 @@ parent: "integration"
 
 | Request Name  | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description|
 | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- |
-| Login         | [/api/auth/providers](http://localhost:3000/api/auth/providers)                                                                             | GET            | None                                            | None                                                                                                  | None                                                                                                                                       | Status Code: 200 
-
{"credentials": {\
-"id": "credentials",\
-"name": "Credentials",\
-"type": "credentials",\
-"signinUrl": "http://localhost:3000/api/auth/signin/credentials",\
-"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"\
-}\
-}
| This request is used for user authentication. | +| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | | Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | | Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | | Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | From 87643b44e8872e47f27fe50f7fe78bc6734948ba Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:08:48 +0300 Subject: [PATCH 08/14] format json --- integration/rest.md | 46 +++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/integration/rest.md b/integration/rest.md index 5a7bfc0..8566c49 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -1,24 +1,38 @@ --- tile: "Rest API" description: > - Rest API detailed doc + Rest API detailed doc parent: "integration" --- | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | -| Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | -| Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | -| Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | -| Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | -| Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | -| Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| -| Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | -| Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | -| Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | -| Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | -| Run A Query | [/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | -| Duplicate A Graph | [/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | -| Create New Schema | [/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| -| Delete A Schema | [/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file +| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | + +| Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | + +| Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | + +| Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | + +| Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | + +| Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | + +| Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| + +| Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | + +| Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | + +| Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | + +| Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | + +| Run A Query | [/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | + +| Duplicate A Graph | [/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | + +| Create New Schema | [/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| + +| Delete A Schema | [/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file From 55d2607b47c57845dcc8786ebcb81903688e2261 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:09:41 +0300 Subject: [PATCH 09/14] fix table --- integration/rest.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/integration/rest.md b/integration/rest.md index 8566c49..b99ceea 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -8,31 +8,17 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | | Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | - | Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | - | Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | - | Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | - | Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | - | Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | - | Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| - | Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | - | Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | - | Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | - | Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | - | Run A Query | [/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | - | Duplicate A Graph | [/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | - | Create New Schema | [/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| - | Delete A Schema | [/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file From c09d7e414bdb2fd62992a8b6d3115441f6431125 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:23:41 +0300 Subject: [PATCH 10/14] Update integration/rest.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- integration/rest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/rest.md b/integration/rest.md index b99ceea..1c8c6ba 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -1,5 +1,5 @@ --- -tile: "Rest API" +title: "Rest API" description: > Rest API detailed doc parent: "integration" From 603cd0480f45fb779a6949c70424c8ecd749f69c Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:26:19 +0300 Subject: [PATCH 11/14] fix typos --- integration/rest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/rest.md b/integration/rest.md index 1c8c6ba..22a3b58 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -14,7 +14,7 @@ parent: "integration" | Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | | Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | | Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| -| Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | +| Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g. Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g. Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | | Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | | Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | | Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | From 17c5384fe3b595a0d0a0fce11ef7c52e483444e8 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 9 Sep 2024 11:30:47 +0300 Subject: [PATCH 12/14] fix wordlist --- .wordlist.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.wordlist.txt b/.wordlist.txt index 679284b..5c9c159 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -266,3 +266,27 @@ RDB scalable scalability falkorDB + + +GraphName +api +auth +callbackUrl +csrf +csrfToken +destinationGraphName +graphName +http +json +queryData +schemaName +signin +signinUrl +signout +sourceName +url +urlencoded +userName +www +yourQuery +yourSourceName \ No newline at end of file From 961ff5084f660f9b335fb5399c8c84f1ef31a396 Mon Sep 17 00:00:00 2001 From: Naseem Ali <34807727+Naseem77@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:26:05 +0300 Subject: [PATCH 13/14] implement swagger2markdown --- integration/rest.md | 363 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 346 insertions(+), 17 deletions(-) diff --git a/integration/rest.md b/integration/rest.md index 22a3b58..0eb27ab 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -5,20 +5,349 @@ description: > parent: "integration" --- -| Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| -| ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | -| Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | -| Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | -| Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | -| Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | -| Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | -| Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | -| Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| -| Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g. Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g. Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | -| Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | -| Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | -| Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | -| Run A Query | [/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | -| Duplicate A Graph | [/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | -| Create New Schema | [/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| -| Delete A Schema | [/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file +### **Login** - `GET /api/auth/providers` + +This endpoint retrieves information about authentication providers and their respective URLs for sign-in and callback. + +#### Responses + +- **200**: Successful authentication provider retrieval + - Content-Type: `application/json` + - Example response: + + ```json + { + "credentials": { + "id": "credentials", + "name": "Credentials", + "type": "credentials", + "signinUrl": "http://localhost:3000/api/auth/signin/credentials", + "callbackUrl": "http://localhost:3000/api/auth/callback/credentials" + } + } + ``` + +### **Logout** - `POST /api/auth/signout` + +This endpoint signs out a user, ending their authenticated session. + +#### Request Body + +- Content-Type: `application/x-www-form-urlencoded` +- Example request: + + ```json + { + "csrfToken": "insert csrfToken", + "callbackUrl": "/login", + "json": true + } + ``` + +#### Responses + +- **200**: Successful logout + - Content-Type: `application/json` + - Example response: + + ```json + { + "url": "http://localhost:3000/api/auth/signout?csrf=true" + } + ``` + +### **Set Configuration Value** - `POST /api/config` + +This endpoint sets a configuration value for `MAX_QUEUED_QUERIES`. + +#### Parameters + +- `cookie` (header, required): Cookie header with session and auth tokens. +- `config` (query, required): The configuration name. +- `value` (query, required): The integer value to set. + +#### Responses + +- **200**: Successful configuration update + - Content-Type: `application/json` + - Example response: + + ```json + { + "config": "OK" + } + ``` + +### **Get Configuration Value** - `GET /api/config` + +This endpoint retrieves the value for `MAX_QUEUED_QUERIES`. + +#### Parameters + +- `cookie` (header, required): Cookie header with session and auth tokens. +- `config` (query, required): The name of the configuration to retrieve. + +#### Responses + +- **200**: Successful configuration retrieval + - Content-Type: `application/json` + - Example response: + + ```json + { + "config": [ + "MAX_QUEUED_QUERIES", + 25 + ] + } + ``` + +### **Create New User** - `POST /api/user` + +This endpoint creates a new user with specified credentials. + +#### Request Body + +- Content-Type: `application/json` +- Example request: + + ```json + { + "username": "user", + "password": "Pass123@", + "role": "Read-Write" + } + ``` + +#### Responses + +- **201**: User created successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "message": "User created" + } + ``` + +### **Delete User** - `POST /api/user` + +This endpoint deletes a user based on their username and role. + +#### Request Body + +- Content-Type: `application/json` +- Example request: + + ```json + { + "users": [ + { + "username": "userName", + "role": "Read-Write" + } + ] + } + ``` + +#### Responses + +- **200**: User deleted successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "message": "User deleted" + } + ``` + +### **Get All Users** - `GET /api/user` + +This endpoint retrieves a list of all users. + +#### Responses + +- **200**: List of users retrieved successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "result": [ + { + "username": "default", + "role": "Admin", + "checked": false + } + ] + } + ``` + +### **Modify A User** - `PATCH /api/user/{userName}` + +This endpoint updates the role of a specific user. + +#### Parameters + +- `cookie` (header, required): Cookie header with session and auth tokens. +- `userName` (path, required): The username of the user to modify. +- `role` (query, required): The new role to assign to the user (`Admin`, `Read-Only`, `Read-Write`). + +#### Responses + +- **200**: User updated successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "message": "User role updated" + } + ``` + +### **Create A Graph & Run A Query** - `GET /api/graph/{graphName}` + +This endpoint creates a graph and runs a query. + +#### Parameters + +- `cookie` (header, required): Cookie header with session and auth tokens. +- `graphName` (path, required): The name of the graph to be created. +- `query` (query, required): The query to run, such as `RETURN 1`. + +#### Responses + +- **200**: Graph created and query executed + - Content-Type: `application/json` + - Example response: + + ```json + { + "result": { + "metadata": [ + "Nodes created: 40", + "Relationships created: 20", + "Cached execution: 1", + "Query internal execution time: 0.201420 milliseconds" + ], + "data": [ + { + "queryData": "exampleData" + } + ] + } + } + ``` + +### **Delete A Graph** - `DELETE /api/graph/{graphName}` + +This endpoint deletes a specified graph. + +#### Parameters + +- `cookie` (header, required): Cookie header with session and auth tokens. +- `graphName` (path, required): The name of the graph to be deleted. + +#### Responses + +- **200**: Graph deleted successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "message": "GraphName graph deleted" + } + ``` + +### **Get All Graphs** - `GET /api/graph` + +This endpoint retrieves a list of all graphs. + +#### Responses + +- **200**: List of graphs retrieved successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "result": [ + "graphName" + ] + } + ``` + +### **Duplicate A Graph** - `POST /api/graph/{destinationGraphName}` + +This endpoint duplicates a graph from source to destination. + +#### Parameters + +- `destinationGraphName` (path, required): The name of the destination graph. +- `sourceName` (query, required): The name of the source graph to duplicate. + +#### Responses + +- **200**: Graph duplicated successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "success": "OK" + } + ``` + +### **Create New Schema & Run A Query** - `GET /api/graph/{schemaName}` + +This endpoint creates a new schema and runs a query. + +#### Parameters + +- `schemaName` (path, required): The name of the schema to create. +- `query` (query, required): The query to execute. + +#### Responses + +- **200**: Schema created and query executed + - Content-Type: `application/json` + - Example response: + + ```json + { + "result": { + "metadata": [ + "Cached execution: 0", + "Query internal execution time: 0.153307 milliseconds" + ], + "data": [ + { + "1": 1 + } + ] + } + } + ``` + +### **Delete A Schema** - `DELETE /api/graph/{schemaName}` + +This endpoint deletes a specified schema. + +#### Parameters + +- `schemaName` (path, required): The name of the schema to delete. + +#### Responses + +- **200**: Schema deleted successfully + - Content-Type: `application/json` + - Example response: + + ```json + { + "message": "SchemaName schema deleted" + } + ``` From dff5471df9f43067a806bb9e2c43b60bc849aa3a Mon Sep 17 00:00:00 2001 From: Naseem Ali <34807727+Naseem77@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:27:45 +0300 Subject: [PATCH 14/14] table of content --- integration/rest.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/integration/rest.md b/integration/rest.md index 0eb27ab..1597c27 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -5,6 +5,25 @@ description: > parent: "integration" --- +## Table of Contents + +- [Login - GET /api/auth/providers](#login---get-apiauthproviders) +- [Logout - POST /api/auth/signout](#logout---post-apiauthsignout) +- [Set Configuration Value - POST /api/config](#set-configuration-value---post-apiconfig) +- [Get Configuration Value - GET /api/config](#get-configuration-value---get-apiconfig) +- [Create New User - POST /api/user](#create-new-user---post-apiuser) +- [Delete User - POST /api/user](#delete-user---post-apiuser) +- [Get All Users - GET /api/user](#get-all-users---get-apiuser) +- [Modify a User - PATCH /api/user/{userName}](#modify-a-user---patch-apiuserusername) +- [Create a Graph & Run A Query - GET /api/graph/{graphName}](#create-a-graph--run-a-query---get-apigraphgraphname) +- [Delete a Graph - DELETE /api/graph/{graphName}](#delete-a-graph---delete-apigraphgraphname) +- [Get All Graphs - GET /api/graph](#get-all-graphs---get-apigraph) +- [Duplicate a Graph - POST /api/graph/{destinationGraphName}](#duplicate-a-graph---post-apigraphdestinationgraphname) +- [Create New Schema & Run A Query - GET /api/graph/{schemaName}](#create-new-schema--run-a-query---get-apigraphschemaname) +- [Delete a Schema - DELETE /api/graph/{schemaName}](#delete-a-schema---delete-apigraphschemaname) + +--- + ### **Login** - `GET /api/auth/providers` This endpoint retrieves information about authentication providers and their respective URLs for sign-in and callback.