Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Refine knownledge compilation REST APIs (#17624)

Wang Qi9db2e2314a1c
diff --git a/api/apps/restful_apis/compilation_template_api.py b/api/apps/restful_apis/compilation_template_api.py
index 8895bb102c..95ac44b8ab 100644
--- a/api/apps/restful_apis/compilation_template_api.py
+++ b/api/apps/restful_apis/compilation_template_api.py
@@ -25,7 +25,7 @@ from api.utils.api_utils import get_json_result, server_error_response
_validate_template_payload = validate_template_payload
[email protected]("/compilation_templates/builtins", methods=["GET"]) # noqa: F821
[email protected]("/compilation-templates/builtins", methods=["GET"]) # noqa: F821
@login_required
def list_builtin_templates() -> Response:
"""Built-in template palette — used as the per-child pre-fill in the
@@ -54,7 +54,7 @@ def list_builtin_templates() -> Response:
return server_error_response(exc)
[email protected]("/compilation_templates/wiki_presets", methods=["GET"]) # noqa: F821
[email protected]("/compilation-templates/wiki-presets", methods=["GET"]) # noqa: F821
@login_required
def list_wiki_presets() -> Response:
"""Wiki page-structure presets loaded from
diff --git a/api/apps/restful_apis/compilation_template_group_api.py b/api/apps/restful_apis/compilation_template_group_api.py
index 18c9d83519..bb8c84d40f 100644
--- a/api/apps/restful_apis/compilation_template_group_api.py
+++ b/api/apps/restful_apis/compilation_template_group_api.py
@@ -66,7 +66,7 @@ def _validate_group_payload(req: dict, require_all: bool = True) -> str:
return ""
[email protected]("/compilation_template_groups", methods=["GET"]) # noqa: F821
[email protected]("/compilation-template-groups", methods=["GET"]) # noqa: F821
@login_required
def list_groups() -> Response:
keywords = request.args.get("keywords", "")
@@ -86,7 +86,7 @@ def list_groups() -> Response:
return server_error_response(exc)
[email protected]("/compilation_template_groups/<group_id>", methods=["GET"]) # noqa: F821
[email protected]("/compilation-template-groups/<group_id>", methods=["GET"]) # noqa: F821
@login_required
def detail(group_id: str) -> Response:
try:
@@ -98,7 +98,7 @@ def detail(group_id: str) -> Response:
return server_error_response(exc)
[email protected]("/compilation_template_groups", methods=["POST"]) # noqa: F821
[email protected]("/compilation-template-groups", methods=["POST"]) # noqa: F821
@login_required
@validate_request("name", "templates")
async def create() -> Response:
@@ -125,7 +125,7 @@ async def create() -> Response:
return server_error_response(exc)
[email protected]("/compilation_template_groups/<group_id>", methods=["PUT"]) # noqa: F821
[email protected]("/compilation-template-groups/<group_id>", methods=["PUT"]) # noqa: F821
@login_required
async def update(group_id: str) -> Response:
req = await get_request_json()
@@ -160,7 +160,7 @@ async def update(group_id: str) -> Response:
return server_error_response(exc)
[email protected]("/compilation_template_groups/<group_id>", methods=["DELETE"]) # noqa: F821
[email protected]("/compilation-template-groups/<group_id>", methods=["DELETE"]) # noqa: F821
@login_required
def delete(group_id: str) -> Response:
try:
diff --git a/api/apps/restful_apis/dataset_api.py b/api/apps/restful_apis/dataset_api.py
index f2b0dc0a48..fd2429d520 100644
--- a/api/apps/restful_apis/dataset_api.py
+++ b/api/apps/restful_apis/dataset_api.py
@@ -16,7 +16,7 @@
import logging
from peewee import OperationalError
-from quart import request
+from quart import request, make_response
from common.constants import RetCode
from api.apps import login_required, current_user
from api.utils.api_utils import get_error_argument_result, get_error_data_result, get_json_result, get_result, add_tenant_id_to_kwargs
@@ -578,22 +578,19 @@ async def get_knowledge_graph(tenant_id, dataset_id):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/any_artifact", methods=["GET"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/artifacts", methods=["HEAD"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def has_any_wiki(tenant_id, dataset_id):
"""Probe whether this dataset has any compiled artifact pages.
- GET /api/v1/datasets/<dataset_id>/any_artifact
- Success: {"code": 0, "data": {"has": bool}}
The frontend uses this to decide whether to surface the Artifact tab
in the dataset sidebar.
"""
try:
success, result = await dataset_api_service.has_any_wiki(dataset_id, tenant_id)
- if success:
- return get_result(data=result)
- return get_result(data=False, message=result, code=RetCode.AUTHENTICATION_ERROR)
+ response = await make_response("", 200 if success and result["has"] else 404)
+ return response
except Exception as e:
logging.exception(e)
return get_error_data_result(message="Internal server error")
@@ -633,13 +630,13 @@ async def list_wiki_pages(tenant_id, dataset_id):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/artifacts_topics", methods=["GET"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/artifacts/topics", methods=["GET"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def list_wiki_topics(tenant_id, dataset_id):
"""List wiki topics for the dataset Artifact tab.
- GET /api/v1/datasets/<dataset_id>/artifacts_topics?page=1&page_size=200
+ GET /api/v1/datasets/<dataset_id>/artifacts/topics?page=1&page_size=200
Success: {"code": 0, "data": {"total": int, "items": [{topic, title, slug}]}}
"""
try:
@@ -708,13 +705,13 @@ async def get_wiki_graph(tenant_id, dataset_id):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/artifacts_structure", methods=["GET"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/artifacts/structure", methods=["GET"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def get_dataset_structure(tenant_id, dataset_id):
"""Return the dataset-scope (KB-wide) structure graph for one kind.
- GET /api/v1/datasets/<dataset_id>/artifacts_structure?kind=<kind>
+ GET /api/v1/datasets/<dataset_id>/artifacts/structure?kind=<kind>
where ``kind`` is one of:
graph | mindmap | timeline | session_essence | session_graph
@@ -755,13 +752,13 @@ async def get_dataset_structure(tenant_id, dataset_id):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/artifacts_structure", methods=["DELETE"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/artifacts/structure", methods=["DELETE"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
def delete_dataset_structure(tenant_id, dataset_id):
"""Delete the dataset-scope (KB-wide) structure graph for one kind.
- DELETE /api/v1/datasets/<dataset_id>/artifacts_structure?kind=<kind>
+ DELETE /api/v1/datasets/<dataset_id>/artifacts/structure?kind=<kind>
Optional query param: wipe=false cancels the task without deleting stored rows.
"""
kind = request.args.get("kind", "")
@@ -874,20 +871,15 @@ async def get_wiki_page(tenant_id, dataset_id, page_type, slug):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/any_skill", methods=["GET"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/skills", methods=["HEAD"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def has_any_skill(tenant_id, dataset_id):
- """Probe whether this dataset has a compiled Corpus2Skill tree.
-
- GET /api/v1/datasets/<dataset_id>/any_skill
- Success: {"code": 0, "data": {"has": bool}}
- """
+ """Probe whether this dataset has a compiled Corpus2Skill tree."""
try:
success, result = await dataset_api_service.has_any_skill(dataset_id, tenant_id)
- if success:
- return get_result(data=result)
- return get_result(data=False, message=result, code=RetCode.AUTHENTICATION_ERROR)
+ response = await make_response("", 200 if success and result["has"] else 404)
+ return response
except Exception as e:
logging.exception(e)
return get_error_data_result(message="Internal server error")
@@ -960,13 +952,13 @@ async def get_skill_page(tenant_id, dataset_id, skill_kwd):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/nav", methods=["GET"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/navigation", methods=["GET"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def list_dataset_nav(tenant_id, dataset_id):
"""First level of the dataset navigation tree — the top-level clusters.
- GET /api/v1/datasets/<dataset_id>/nav
+ GET /api/v1/datasets/<dataset_id>/navigation
Success: {"code": 0, "data": {"total": <n>, "items": [{name, description, doc_count, type, has_children}, ...]}}
"""
try:
@@ -982,13 +974,13 @@ async def list_dataset_nav(tenant_id, dataset_id):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/nav/<path:name>/children", methods=["GET"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/navigation/<path:name>/children", methods=["GET"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def list_dataset_nav_children(tenant_id, dataset_id, name):
"""Direct children of a navigation node (hierarchical, one level per call).
- GET /api/v1/datasets/<dataset_id>/nav/<name>/children
+ GET /api/v1/datasets/<dataset_id>/navigation/<name>/children
Success: {"code": 0, "data": {"total": <n>, "items": [{name, description, doc_count, type, doc_id, has_children}, ...]}}
"""
try:
@@ -1005,13 +997,13 @@ async def list_dataset_nav_children(tenant_id, dataset_id, name):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/nav", methods=["DELETE"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/navigation", methods=["DELETE"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def delete_dataset_nav(tenant_id, dataset_id):
"""Delete the entire dataset navigation tree.
- DELETE /api/v1/datasets/<dataset_id>/nav
+ DELETE /api/v1/datasets/<dataset_id>/navigation
Success: {"code": 0, "data": {"deleted": <n>}}
"""
try:
@@ -1027,13 +1019,13 @@ async def delete_dataset_nav(tenant_id, dataset_id):
return get_error_data_result(message="Internal server error")
[email protected]("/datasets/<dataset_id>/nav/<path:name>", methods=["DELETE"]) # noqa: F821
[email protected]("/datasets/<dataset_id>/navigation/<path:name>", methods=["DELETE"]) # noqa: F821
@login_required
@add_tenant_id_to_kwargs
async def delete_dataset_nav_node(tenant_id, dataset_id, name):
"""Delete one navigation node and its whole subtree.
- DELETE /api/v1/datasets/<dataset_id>/nav/<name>
+ DELETE /api/v1/datasets/<dataset_id>/navigation/<name>
Success: {"code": 0, "data": {"deleted": <n>}}
"""
try:
diff --git a/api/apps/restful_apis/file_commit_api.py b/api/apps/restful_apis/file_commit_api.py
index aaeb9522a4..37c35ec884 100644
--- a/api/apps/restful_apis/file_commit_api.py
+++ b/api/apps/restful_apis/file_commit_api.py
@@ -362,13 +362,12 @@ def _register_commit_routes(prefix, param_name, resolver_type=None):
# Register datasets first, workspace second, folders last —
# the last call's handlers overwrite module-level names for test access.
_register_commit_routes("/datasets/<entity_id>", "entity_id", resolver_type="datasets")
-_register_commit_routes("/workspace/<entity_id>", "entity_id") # alias — workspace_id == folder_id
-_register_commit_routes("/folders/<entity_id>", "entity_id") # direct — entity_id == folder_id (wins)
+_register_commit_routes("/workspaces/<entity_id>", "entity_id")
# /memories and /skills routes are not mounted until resolvers are implemented.
# ── File version history (shared across all entity types) ─────────────────
[email protected]("/files/<file_id>/versions", methods=["GET"]) # noqa: F821
[email protected]("/workspace-files/<file_id>/versions", methods=["GET"]) # noqa: F821
@login_required
async def get_file_version_history(file_id):
try:
diff --git a/api/apps/services/structure_graph_common.py b/api/apps/services/structure_graph_common.py
index 1cedb546f5..fd862d2dbd 100644
--- a/api/apps/services/structure_graph_common.py
+++ b/api/apps/services/structure_graph_common.py
@@ -17,7 +17,7 @@
"""Shared structure-graph subgraph sampling.
Both the per-document (``/datasets/<id>/documents/<doc>/structure/graph``) and
-the dataset-wide (``/datasets/<id>/artifacts_structure``) endpoints render
+the dataset-wide (``/datasets/<id>/artifacts/structure``) endpoints render
per-template structure graphs. For large graphs we don't return every
entity/relation — we fetch a representative subgraph from the raw
``knowledge_graph_kwd`` rows (which carry ``mention_count_int`` / ``name_kwd`` /
diff --git a/docs/references/http_api_reference.md b/docs/references/http_api_reference.md
index 1469945941..533fd7906a 100644
--- a/docs/references/http_api_reference.md
+++ b/docs/references/http_api_reference.md
@@ -6955,7 +6955,7 @@ curl --request POST \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'file=@./test1.txt' \
--form 'file=@./test2.pdf' \
- --form 'parent_id={folder_id}'
+ --form 'parent_id={workspace_id}'
```
##### Request parameters
@@ -7168,7 +7168,7 @@ curl --request POST \
--data '{
"name": "New Folder",
"type": "folder",
- "parent_id": "{folder_id}"
+ "parent_id": "{workspace_id}"
}'
```
@@ -7709,17 +7709,16 @@ or
### Create commit
-**POST** `/api/v1/folders/{folder_id}/commits`
+**POST** `/api/v1/workspaces/{workspace_id}/commits`
-Creates a new snapshot commit for the specified folder.
+Creates a new snapshot commit for the specified workspace.
This endpoint also supports:
-- `/api/v1/workspace/{workspace_id}/commits` (alias, workspace_id == folder_id)
-- `/api/v1/datasets/{dataset_id}/commits` (resolves dataset to its folder)
+- `/api/v1/datasets/{dataset_id}/commits` (resolves dataset to its workspace)
#### Request
- Method: POST
-- URL: `/api/v1/folders/{folder_id}/commits`
+- URL: `/api/v1/workspaces/{workspace_id}/commits`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
- Body:
@@ -7732,7 +7731,7 @@ This endpoint also supports:
```bash
curl --request POST \
- --url http://{address}/api/v1/folders/{folder_id}/commits \
+ --url http://{address}/api/v1/workspaces/{workspace_id}/commits \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
@@ -7797,17 +7796,16 @@ Failure:
### List commits
-**GET** `/api/v1/folders/{folder_id}/commits`
+**GET** `/api/v1/workspaces/{workspace_id}/commits`
Lists all commits for the specified folder with pagination.
Also available at:
-- `/api/v1/workspace/{workspace_id}/commits`
- `/api/v1/datasets/{dataset_id}/commits`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/commits`
+- URL: `/api/v1/workspaces/{workspace_id}/commits`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
- Query:
@@ -7820,7 +7818,7 @@ Also available at:
```bash
curl --request GET \
- --url 'http://{address}/api/v1/folders/{folder_id}/commits?page=1&page_size=15' \
+ --url 'http://{address}/api/v1/workspaces/{workspace_id}/commits?page=1&page_size=15' \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -7865,17 +7863,16 @@ Success:
### Get commit
-**GET** `/api/v1/folders/{folder_id}/commits/{commit_id}`
+**GET** `/api/v1/workspaces/{workspace_id}/commits/{commit_id}`
Retrieves the details of a specific commit, including its file changes.
Also available at:
-- `/api/v1/workspace/{workspace_id}/commits/{commit_id}`
- `/api/v1/datasets/{dataset_id}/commits/{commit_id}`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/commits/{commit_id}`
+- URL: `/api/v1/workspaces/{workspace_id}/commits/{commit_id}`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
@@ -7883,7 +7880,7 @@ Also available at:
```bash
curl --request GET \
- --url http://{address}/api/v1/folders/{folder_id}/commits/{commit_id} \
+ --url http://{address}/api/v1/workspaces/{workspace_id}/commits/{commit_id} \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -7936,17 +7933,16 @@ Failure:
### List commit files
-**GET** `/api/v1/folders/{folder_id}/commits/{commit_id}/files`
+**GET** `/api/v1/workspaces/{workspace_id}/commits/{commit_id}/files`
Lists the file changes associated with a specific commit.
Also available at:
-- `/api/v1/workspace/{workspace_id}/commits/{commit_id}/files`
- `/api/v1/datasets/{dataset_id}/commits/{commit_id}/files`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/commits/{commit_id}/files`
+- URL: `/api/v1/workspaces/{workspace_id}/commits/{commit_id}/files`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
@@ -7954,7 +7950,7 @@ Also available at:
```bash
curl --request GET \
- --url http://{address}/api/v1/folders/{folder_id}/commits/{commit_id}/files \
+ --url http://{address}/api/v1/workspaces/{workspace_id}/commits/{commit_id}/files \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -7985,17 +7981,16 @@ Success:
### Diff commits
-**GET** `/api/v1/folders/{folder_id}/commits/diff?from={commit_id}&to={commit_id}`
+**GET** `/api/v1/workspaces/{workspace_id}/commits/diff?from={commit_id}&to={commit_id}`
Compares two commits and returns the differences.
Also available at:
-- `/api/v1/workspace/{workspace_id}/commits/diff?from=...&to=...`
- `/api/v1/datasets/{dataset_id}/commits/diff?from=...&to=...`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/commits/diff`
+- URL: `/api/v1/workspaces/{workspace_id}/commits/diff`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
- Query:
@@ -8008,7 +8003,7 @@ Also available at:
```bash
curl --request GET \
- --url 'http://{address}/api/v1/folders/{folder_id}/commits/diff?from=from_commit_id&to=to_commit_id' \
+ --url 'http://{address}/api/v1/workspaces/{workspace_id}/commits/diff?from=from_commit_id&to=to_commit_id' \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -8053,17 +8048,16 @@ Failure:
### Get uncommitted changes
-**GET** `/api/v1/folders/{folder_id}/changes`
+**GET** `/api/v1/workspaces/{workspace_id}/changes`
Returns the uncommitted changes for the specified folder (similar to `git status`).
Also available at:
-- `/api/v1/workspace/{workspace_id}/changes`
- `/api/v1/datasets/{dataset_id}/changes`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/changes`
+- URL: `/api/v1/workspaces/{workspace_id}/changes`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
@@ -8071,7 +8065,7 @@ Also available at:
```bash
curl --request GET \
- --url http://{address}/api/v1/folders/{folder_id}/changes \
+ --url http://{address}/api/v1/workspaces/{workspace_id}/changes \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -8106,17 +8100,16 @@ Success:
### Get commit tree
-**GET** `/api/v1/folders/{folder_id}/commits/{commit_id}/tree`
+**GET** `/api/v1/workspaces/{workspace_id}/commits/{commit_id}/tree`
Retrieves the full folder tree snapshot as it existed at a specific commit.
Also available at:
-- `/api/v1/workspace/{workspace_id}/commits/{commit_id}/tree`
- `/api/v1/datasets/{dataset_id}/commits/{commit_id}/tree`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/commits/{commit_id}/tree`
+- URL: `/api/v1/workspaces/{workspace_id}/commits/{commit_id}/tree`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
@@ -8124,7 +8117,7 @@ Also available at:
```bash
curl --request GET \
- --url http://{address}/api/v1/folders/{folder_id}/commits/{commit_id}/tree \
+ --url http://{address}/api/v1/workspaces/{workspace_id}/commits/{commit_id}/tree \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -8174,17 +8167,16 @@ Success:
### Get commit file content
-**GET** `/api/v1/folders/{folder_id}/commits/{commit_id}/files/{file_id}/content`
+**GET** `/api/v1/workspaces/{workspace_id}/commits/{commit_id}/files/{file_id}/content`
Retrieves the file content as it existed at a specific commit.
Also available at:
-- `/api/v1/workspace/{workspace_id}/commits/{commit_id}/files/{file_id}/content`
- `/api/v1/datasets/{dataset_id}/commits/{commit_id}/files/{file_id}/content`
#### Request
- Method: GET
-- URL: `/api/v1/folders/{folder_id}/commits/{commit_id}/files/{file_id}/content`
+- URL: `/api/v1/workspaces/{workspace_id}/commits/{commit_id}/files/{file_id}/content`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
@@ -8192,7 +8184,7 @@ Also available at:
```bash
curl --request GET \
- --url http://{address}/api/v1/folders/{folder_id}/commits/{commit_id}/files/{file_id}/content \
+ --url http://{address}/api/v1/workspaces/{workspace_id}/commits/{commit_id}/files/{file_id}/content \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
@@ -8220,16 +8212,16 @@ Failure:
---
-### Get file version history
+### Get a workspace file version history
-**GET** `/api/v1/files/{file_id}/versions`
+**GET** `/api/v1/workspace-files/{file_id}/versions`
Returns the version history for a specific file across all commits.
#### Request
- Method: GET
-- URL: `/api/v1/files/{file_id}/versions`
+- URL: `/api/v1/workspace-files/{file_id}/versions`
- Headers:
- `'Authorization: Bearer <YOUR_API_KEY>'`
@@ -8237,7 +8229,7 @@ Returns the version history for a specific file across all commits.
```bash
curl --request GET \
- --url http://{address}/api/v1/files/{file_id}/versions \
+ --url http://{address}/api/v1/workspace-files/{file_id}/versions \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```
diff --git a/test/testcases/restful_api/test_file_commit_routes_unit.py b/test/testcases/restful_api/test_file_commit_routes_unit.py
index 79eb07b17f..9573929eb1 100644
--- a/test/testcases/restful_api/test_file_commit_routes_unit.py
+++ b/test/testcases/restful_api/test_file_commit_routes_unit.py
@@ -743,7 +743,7 @@ def test_get_file_version_history(monkeypatch):
@pytest.mark.p2
def test_workspace_alias(monkeypatch):
- """Verify /workspace/ alias routes work the same as /folders/."""
+ """Verify /workspaces/ alias routes work the same as /folders/."""
module = _load_module(monkeypatch)
FileTestModel.create(id="f1", parent_id="ws-folder", tenant_id="t1", created_by="test-user", name="a.txt", type="txt")
diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts
index 93bccfbc99..83c8371b6b 100644
--- a/web/src/utils/api.ts
+++ b/web/src/utils/api.ts
@@ -162,7 +162,7 @@ export default {
artifactsAlteration: (datasetId: string) =>
`${restAPIv1}/datasets/${datasetId}/artifacts/alteration`,
artifactsTopicList: (datasetId: string) =>
- `${restAPIv1}/datasets/${datasetId}/artifacts_topics`,
+ `${restAPIv1}/datasets/${datasetId}/artifacts/topics`,
getArtifactPage: (datasetId: string, pageType: string, slug: string) =>
`${restAPIv1}/datasets/${datasetId}/artifacts/${pageType}/${slug}`,
listWikiCommits: (datasetId: string) =>
@@ -172,7 +172,7 @@ export default {
getArtifactGraph: (datasetId: string) =>
`${restAPIv1}/datasets/${datasetId}/artifacts/graph`,
artifactsStructure: (datasetId: string) =>
- `${restAPIv1}/datasets/${datasetId}/artifacts_structure`,
+ `${restAPIv1}/datasets/${datasetId}/artifacts/structure`,
clearWiki: (datasetId: string) =>
`${restAPIv1}/datasets/${datasetId}/artifacts`,
getDatasetSkillTree: (datasetId: string) =>
@@ -190,16 +190,16 @@ export default {
.map((s) => encodeURIComponent(s))
.join('/')}`,
getDatasetNav: (datasetId: string) =>
- `${restAPIv1}/datasets/${datasetId}/nav`,
+ `${restAPIv1}/datasets/${datasetId}/navigation`,
getDatasetNavChildren: (datasetId: string, name: string) =>
- `${restAPIv1}/datasets/${datasetId}/nav/${name
+ `${restAPIv1}/datasets/${datasetId}/navigation/${name
.split('/')
.map((s) => encodeURIComponent(s))
.join('/')}/children`,
deleteDatasetNav: (datasetId: string) =>
- `${restAPIv1}/datasets/${datasetId}/nav`,
+ `${restAPIv1}/datasets/${datasetId}/navigation`,
deleteDatasetNavNode: (datasetId: string, name: string) =>
- `${restAPIv1}/datasets/${datasetId}/nav/${name
+ `${restAPIv1}/datasets/${datasetId}/navigation/${name
.split('/')
.map((s) => encodeURIComponent(s))
.join('/')}`,
@@ -383,13 +383,13 @@ export default {
// explore
// compilation templates
- compilationTemplates: `${restAPIv1}/compilation_templates`,
+ compilationTemplates: `${restAPIv1}/compilation-templates`,
compilationTemplate: (id: string) =>
- `${restAPIv1}/compilation_templates/${id}`,
- compilationTemplateGroups: `${restAPIv1}/compilation_template_groups`,
+ `${restAPIv1}/compilation-templates/${id}`,
+ compilationTemplateGroups: `${restAPIv1}/compilation-template-groups`,
compilationTemplateGroup: (id: string) =>
- `${restAPIv1}/compilation_template_groups/${id}`,
- wikiPresets: `${restAPIv1}/compilation_templates/wiki_presets`,
+ `${restAPIv1}/compilation-template-groups/${id}`,
+ wikiPresets: `${restAPIv1}/compilation-templates/wiki-presets`,
// mcp server
listMcpServer: `${restAPIv1}/mcp/servers`,