Merge branch 'main' into jzh

This commit is contained in:
JzoNg 2026-05-05 19:55:21 +08:00
commit f00f8e020f
381 changed files with 59211 additions and 3800 deletions

View File

@ -113,7 +113,7 @@ jobs:
find . -name "*.py.bak" -type f -delete
- name: Setup web environment
if: github.event_name != 'merge_group' && steps.web-changes.outputs.any_changed == 'true'
if: github.event_name != 'merge_group'
uses: ./.github/actions/setup-web
- name: ESLint autofix

View File

@ -158,7 +158,7 @@ jobs:
- name: Run Claude Code for Translation Sync
if: steps.context.outputs.CHANGED_FILES != ''
uses: anthropics/claude-code-action@ef50f123a3a9be95b60040d042717517407c7256 # v1.0.110
uses: anthropics/claude-code-action@fefa07e9c665b7320f08c3b525980457f22f58aa # v1.0.111
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored
View File

@ -219,6 +219,9 @@ node_modules
# plugin migrate
plugins.jsonl
# generated API OpenAPI specs
packages/contracts/openapi/
# mise
mise.toml

View File

@ -41,7 +41,8 @@ def guess_file_info_from_response(response: httpx.Response):
# Try to extract filename from URL
parsed_url = urllib.parse.urlparse(url)
url_path = parsed_url.path
filename = os.path.basename(url_path)
# Decode percent-encoded characters in the path segment
filename = urllib.parse.unquote(os.path.basename(url_path))
# If filename couldn't be extracted, use Content-Disposition header
if not filename:

View File

@ -60,7 +60,8 @@ _file_access_controller = DatabaseFileAccessController()
LISTENING_RETRY_IN = 2000
DEFAULT_REF_TEMPLATE_SWAGGER_2_0 = "#/definitions/{model}"
RESTORE_SOURCE_WORKFLOW_MUST_BE_PUBLISHED_MESSAGE = "source workflow must be published"
MAX_WORKFLOW_ONLINE_USERS_QUERY_IDS = 50
MAX_WORKFLOW_ONLINE_USERS_REQUEST_IDS = 1000
WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE = 50
# Register models for flask_restx to avoid dict type issues in Swagger
# Register in dependency order: base models first, then dependent models
@ -158,8 +159,13 @@ class WorkflowFeaturesPayload(BaseModel):
features: dict[str, Any] = Field(..., description="Workflow feature configuration")
class WorkflowOnlineUsersQuery(BaseModel):
app_ids: str = Field(..., description="Comma-separated app IDs")
class WorkflowOnlineUsersPayload(BaseModel):
app_ids: list[str] = Field(default_factory=list, description="App IDs")
@field_validator("app_ids")
@classmethod
def normalize_app_ids(cls, app_ids: list[str]) -> list[str]:
return list(dict.fromkeys(app_id.strip() for app_id in app_ids if app_id.strip()))
class DraftWorkflowTriggerRunPayload(BaseModel):
@ -186,7 +192,7 @@ reg(ConvertToWorkflowPayload)
reg(WorkflowListQuery)
reg(WorkflowUpdatePayload)
reg(WorkflowFeaturesPayload)
reg(WorkflowOnlineUsersQuery)
reg(WorkflowOnlineUsersPayload)
reg(DraftWorkflowTriggerRunPayload)
reg(DraftWorkflowTriggerRunAllPayload)
@ -1384,19 +1390,19 @@ class DraftWorkflowTriggerRunAllApi(Resource):
@console_ns.route("/apps/workflows/online-users")
class WorkflowOnlineUsersApi(Resource):
@console_ns.expect(console_ns.models[WorkflowOnlineUsersQuery.__name__])
@console_ns.expect(console_ns.models[WorkflowOnlineUsersPayload.__name__])
@console_ns.doc("get_workflow_online_users")
@console_ns.doc(description="Get workflow online users")
@setup_required
@login_required
@account_initialization_required
@marshal_with(online_user_list_fields)
def get(self):
args = WorkflowOnlineUsersQuery.model_validate(request.args.to_dict(flat=True)) # type: ignore
def post(self):
args = WorkflowOnlineUsersPayload.model_validate(console_ns.payload or {})
app_ids = list(dict.fromkeys(app_id.strip() for app_id in args.app_ids.split(",") if app_id.strip()))
if len(app_ids) > MAX_WORKFLOW_ONLINE_USERS_QUERY_IDS:
raise BadRequest(f"Maximum {MAX_WORKFLOW_ONLINE_USERS_QUERY_IDS} app_ids are allowed per request.")
app_ids = args.app_ids
if len(app_ids) > MAX_WORKFLOW_ONLINE_USERS_REQUEST_IDS:
raise BadRequest(f"Maximum {MAX_WORKFLOW_ONLINE_USERS_REQUEST_IDS} app_ids are allowed per request.")
if not app_ids:
return {"data": []}
@ -1404,13 +1410,24 @@ class WorkflowOnlineUsersApi(Resource):
_, current_tenant_id = current_account_with_tenant()
workflow_service = WorkflowService()
accessible_app_ids = workflow_service.get_accessible_app_ids(app_ids, current_tenant_id)
ordered_accessible_app_ids = [app_id for app_id in app_ids if app_id in accessible_app_ids]
users_json_by_app_id: dict[str, Any] = {}
for start_index in range(0, len(ordered_accessible_app_ids), WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE):
app_id_batch = ordered_accessible_app_ids[
start_index : start_index + WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE
]
pipe = redis_client.pipeline(transaction=False)
for app_id in app_id_batch:
pipe.hgetall(f"{WORKFLOW_ONLINE_USERS_PREFIX}{app_id}")
users_json_batch = pipe.execute()
for app_id, users_json in zip(app_id_batch, users_json_batch):
users_json_by_app_id[app_id] = users_json
results = []
for app_id in app_ids:
if app_id not in accessible_app_ids:
continue
users_json = redis_client.hgetall(f"{WORKFLOW_ONLINE_USERS_PREFIX}{app_id}")
for app_id in ordered_accessible_app_ids:
users_json = users_json_by_app_id.get(app_id, {})
users = []
for _, user_info_json in users_json.items():

View File

@ -8,6 +8,7 @@ from flask import request
from flask_restx import Resource
from pydantic import BaseModel, Field, field_validator, model_validator
from sqlalchemy import select
from werkzeug.exceptions import NotFound
from configs import dify_config
from constants.languages import supported_language
@ -45,6 +46,8 @@ from libs.helper import EmailStr, extract_remote_ip, timezone
from libs.login import current_account_with_tenant, login_required
from models import AccountIntegrate, InvitationCode
from models.account import AccountStatus, InvitationCodeStatus
from models.enums import CreatorUserRole
from models.model import UploadFile
from services.account_service import AccountService
from services.billing_service import BillingService
from services.errors.account import CurrentPasswordIncorrectError as ServiceCurrentPasswordIncorrectError
@ -322,9 +325,24 @@ class AccountAvatarApi(Resource):
@login_required
@account_initialization_required
def get(self):
current_user, current_tenant_id = current_account_with_tenant()
args = AccountAvatarQuery.model_validate(request.args.to_dict(flat=True)) # type: ignore
avatar = args.avatar
avatar_url = file_helpers.get_signed_file_url(args.avatar)
if avatar.startswith(("http://", "https://")):
return {"avatar_url": avatar}
upload_file = db.session.scalar(select(UploadFile).where(UploadFile.id == avatar).limit(1))
if upload_file is None:
raise NotFound("Avatar file not found")
if upload_file.tenant_id != current_tenant_id:
raise NotFound("Avatar file not found")
if upload_file.created_by_role != CreatorUserRole.ACCOUNT or upload_file.created_by != current_user.id:
raise NotFound("Avatar file not found")
avatar_url = file_helpers.get_signed_file_url(upload_file_id=upload_file.id)
return {"avatar_url": avatar_url}
@console_ns.expect(console_ns.models[AccountAvatarPayload.__name__])

View File

@ -217,10 +217,11 @@ class RetrievalService:
"""Deduplicate documents in O(n) while preserving first-seen order.
Rules:
- For provider == "dify" and metadata["doc_id"] exists: keep the doc with the highest
metadata["score"] among duplicates; if a later duplicate has no score, ignore it.
- For non-dify documents (or dify without doc_id): deduplicate by content key
(provider, page_content), keeping the first occurrence.
- If metadata["doc_id"] exists (any provider): deduplicate by (provider, doc_id) key;
keep the doc with the highest metadata["score"] among duplicates. If a later duplicate
has no score, ignore it.
- If metadata["doc_id"] is absent: deduplicate by content key (provider, page_content),
keeping the first occurrence.
"""
if not documents:
return documents
@ -231,11 +232,10 @@ class RetrievalService:
order: list[tuple] = []
for doc in documents:
is_dify = doc.provider == "dify"
doc_id = (doc.metadata or {}).get("doc_id") if is_dify else None
doc_id = (doc.metadata or {}).get("doc_id")
if is_dify and doc_id:
key = ("dify", doc_id)
if doc_id:
key = (doc.provider or "dify", doc_id)
if key not in chosen:
chosen[key] = doc
order.append(key)

View File

@ -144,8 +144,20 @@ class Vector:
def get_vector_factory(vector_type: str) -> type[AbstractVectorFactory]:
return get_vector_factory_class(vector_type)
@staticmethod
def _filter_empty_text_documents(documents: list[Document]) -> list[Document]:
filtered_documents = [document for document in documents if document.page_content.strip()]
skipped_count = len(documents) - len(filtered_documents)
if skipped_count:
logger.warning("skip %d empty documents before vector embedding", skipped_count)
return filtered_documents
def create(self, texts: list | None = None, **kwargs):
if texts:
texts = self._filter_empty_text_documents(texts)
if not texts:
return
start = time.time()
logger.info("start embedding %s texts %s", len(texts), start)
batch_size = 1000
@ -203,8 +215,14 @@ class Vector:
logger.info("Embedding %s files took %s s", len(file_documents), time.time() - start)
def add_texts(self, documents: list[Document], **kwargs):
documents = self._filter_empty_text_documents(documents)
if not documents:
return
if kwargs.get("duplicate_check", False):
documents = self._filter_duplicate_texts(documents)
if not documents:
return
embeddings = self._embeddings.embed_documents([document.page_content for document in documents])
self._vector_processor.create(texts=documents, embeddings=embeddings, **kwargs)

View File

@ -365,7 +365,8 @@ class DifyNodeFactory(NodeFactory):
(including pydantic ValidationError, which subclasses ValueError),
if node type is unknown, or if no implementation exists for the resolved version
"""
typed_node_config = NodeConfigDictAdapter.validate_python(adapt_node_config_for_graph(node_config))
adapted_node_config = adapt_node_config_for_graph(node_config)
typed_node_config = NodeConfigDictAdapter.validate_python(adapted_node_config)
node_id = typed_node_config["id"]
node_data = typed_node_config["data"]
node_class = self._resolve_node_class(node_type=node_data.type, node_version=str(node_data.version))
@ -373,6 +374,11 @@ class DifyNodeFactory(NodeFactory):
# Re-validate using the resolved node class so workflow-local node schemas
# stay explicit and constructors receive the concrete typed payload.
resolved_node_data = self._validate_resolved_node_data(node_class, node_data)
config_for_node_init: BaseNodeData | dict[str, Any]
if isinstance(resolved_node_data, BaseNodeData):
config_for_node_init = resolved_node_data.model_dump(mode="python", by_alias=True)
else:
config_for_node_init = resolved_node_data
node_type = node_data.type
node_init_kwargs_factories: Mapping[NodeType, Callable[[], dict[str, object]]] = {
BuiltinNodeTypes.CODE: lambda: {
@ -442,7 +448,7 @@ class DifyNodeFactory(NodeFactory):
node_init_kwargs = node_init_kwargs_factories.get(node_type, lambda: {})()
return node_class(
node_id=node_id,
config=resolved_node_data,
config=config_for_node_init,
graph_init_params=self.graph_init_params,
graph_runtime_state=self.graph_runtime_state,
**node_init_kwargs,
@ -474,10 +480,7 @@ class DifyNodeFactory(NodeFactory):
include_retriever_attachment_loader: bool,
include_jinja2_template_renderer: bool,
) -> dict[str, object]:
validated_node_data = cast(
LLMCompatibleNodeData,
self._validate_resolved_node_data(node_class=node_class, node_data=node_data),
)
validated_node_data = cast(LLMCompatibleNodeData, node_data)
model_instance = self._build_model_instance_for_llm_node(validated_node_data)
node_init_kwargs: dict[str, object] = {
"credentials_provider": self._llm_credentials_provider,

View File

@ -19,8 +19,13 @@ from werkzeug.http import parse_options_header
from core.helper import ssrf_proxy
def extract_filename(url_path: str, content_disposition: str | None) -> str | None:
"""Extract a safe filename from Content-Disposition or the request URL path."""
def extract_filename(url_or_path: str, content_disposition: str | None) -> str | None:
"""Extract a safe filename from Content-Disposition or the request URL path.
Handles full URLs, paths with query strings, hash fragments, and percent-encoded segments.
Query strings and hash fragments are stripped from the URL before extracting the basename.
Percent-encoded characters in the path are decoded safely.
"""
filename: str | None = None
if content_disposition:
filename_star_match = re.search(r"filename\*=([^;]+)", content_disposition)
@ -47,8 +52,13 @@ def extract_filename(url_path: str, content_disposition: str | None) -> str | No
filename = urllib.parse.unquote(raw)
if not filename:
candidate = os.path.basename(url_path)
filename = urllib.parse.unquote(candidate) if candidate else None
# Parse the URL to extract just the path, stripping query strings and fragments
# This handles both full URLs and bare paths
parsed = urllib.parse.urlparse(url_or_path)
path = parsed.path
candidate = os.path.basename(path)
# Decode percent-encoded characters, with safe fallback for malformed input
filename = urllib.parse.unquote(candidate, errors="replace") if candidate else None
if filename:
filename = os.path.basename(filename)

View File

@ -6,7 +6,7 @@ requires-python = "~=3.12.0"
dependencies = [
# Legacy: mature and widely deployed
"bleach>=6.3.0",
"boto3>=1.42.96",
"boto3>=1.43.3",
"celery>=5.6.3",
"croniter>=6.2.2",
"flask>=3.1.3,<4.0.0",
@ -14,7 +14,7 @@ dependencies = [
"gevent>=26.4.0",
"gevent-websocket>=0.10.1",
"gmpy2>=2.3.0",
"google-api-python-client>=2.194.0",
"google-api-python-client>=2.195.0",
"gunicorn>=25.3.0",
"psycogreen>=1.0.2",
"psycopg2-binary>=2.9.12",
@ -31,7 +31,7 @@ dependencies = [
"flask-migrate>=4.1.0,<5.0.0",
"flask-orjson>=2.0.0,<3.0.0",
"flask-restx>=1.3.2,<2.0.0",
"google-cloud-aiplatform>=1.148.1,<2.0.0",
"google-cloud-aiplatform>=1.149.0,<2.0.0",
"httpx[socks]>=0.28.1,<1.0.0",
"opentelemetry-distro>=0.62b1,<1.0.0",
"opentelemetry-instrumentation-celery>=0.62b0,<1.0.0",
@ -127,7 +127,7 @@ dev = [
"testcontainers>=4.14.2",
"types-aiofiles>=25.1.0",
"types-beautifulsoup4>=4.12.0",
"types-cachetools>=6.2.0",
"types-cachetools>=7.0.0.20260503",
"types-colorama>=0.4.15",
"types-defusedxml>=0.7.0",
"types-deprecated>=1.3.1",
@ -135,7 +135,7 @@ dev = [
"types-flask-cors>=6.0.0",
"types-flask-migrate>=4.1.0",
"types-gevent>=26.4.0",
"types-greenlet>=3.4.0",
"types-greenlet>=3.5.0.20260428",
"types-html5lib>=1.1.11",
"types-markdown>=3.10.2",
"types-oauthlib>=3.3.0",
@ -143,7 +143,7 @@ dev = [
"types-olefile>=0.47.0",
"types-openpyxl>=3.1.5",
"types-pexpect>=4.9.0",
"types-protobuf>=7.34.1",
"types-protobuf>=7.34.1.20260503",
"types-psutil>=7.2.2",
"types-psycopg2>=2.9.21.20260422",
"types-pygments>=2.20.0",
@ -158,11 +158,11 @@ dev = [
"types-tensorflow>=2.18.0.20260408",
"types-tqdm>=4.67.3.20260408",
"types-ujson>=5.10.0",
"boto3-stubs>=1.42.96",
"boto3-stubs>=1.43.2",
"types-jmespath>=1.1.0.20260408",
"hypothesis>=6.152.3",
"hypothesis>=6.152.4",
"types_pyOpenSSL>=24.1.0",
"types_cffi>=2.0.0.20260408",
"types_cffi>=2.0.0.20260429",
"types_setuptools>=82.0.0.20260408",
"pandas-stubs>=3.0.0",
"scipy-stubs>=1.17.1.4",
@ -184,7 +184,7 @@ dev = [
############################################################
storage = [
"azure-storage-blob>=12.28.0",
"bce-python-sdk>=0.9.70",
"bce-python-sdk>=0.9.71",
"cos-python-sdk-v5>=1.9.42",
"esdk-obs-python>=3.22.2",
"google-cloud-storage>=3.10.1",

View File

@ -3,6 +3,7 @@ from typing import Any, Literal
from pydantic import BaseModel, field_validator
from core.rag.entities import Rule
from core.rag.entities.metadata_entities import MetadataFilteringCondition
from core.rag.index_processor.constant.index_type import IndexStructureType
from core.rag.retrieval.retrieval_methods import RetrievalMethod
@ -83,6 +84,7 @@ class RetrievalModel(BaseModel):
score_threshold_enabled: bool
score_threshold: float | None = None
weights: WeightModel | None = None
metadata_filtering_conditions: MetadataFilteringCondition | None = None
class MetaDataConfig(BaseModel):

View File

@ -1,4 +1,5 @@
import unittest
from __future__ import annotations
from datetime import UTC, datetime
from unittest.mock import patch
from uuid import uuid4
@ -16,7 +17,7 @@ from models.enums import CreatorUserRole
@pytest.mark.usefixtures("flask_req_ctx_with_containers")
class TestStorageKeyLoader(unittest.TestCase):
class TestStorageKeyLoader:
"""
Integration tests for StorageKeyLoader class.
@ -24,110 +25,82 @@ class TestStorageKeyLoader(unittest.TestCase):
with different transfer methods: LOCAL_FILE, REMOTE_URL, and TOOL_FILE.
"""
def setUp(self):
"""Set up test data before each test method."""
self.session = db.session()
self.tenant_id = str(uuid4())
self.user_id = str(uuid4())
self.conversation_id = str(uuid4())
# Create test data that will be cleaned up after each test
self.test_upload_files = []
self.test_tool_files = []
# Create StorageKeyLoader instance
self.loader = StorageKeyLoader(
self.session,
self.tenant_id,
access_controller=DatabaseFileAccessController(),
)
def tearDown(self):
"""Clean up test data after each test method."""
self.session.rollback()
# ------------------------------------------------------------------
# Per-test helpers (use db_session_with_containers as parameter)
# ------------------------------------------------------------------
@staticmethod
def _create_upload_file(
self, file_id: str | None = None, storage_key: str | None = None, tenant_id: str | None = None
session: Session,
tenant_id: str,
user_id: str,
*,
file_id: str | None = None,
storage_key: str | None = None,
override_tenant_id: str | None = None,
) -> UploadFile:
"""Helper method to create an UploadFile record for testing."""
if file_id is None:
file_id = str(uuid4())
if storage_key is None:
storage_key = f"test_storage_key_{uuid4()}"
if tenant_id is None:
tenant_id = self.tenant_id
"""Create and flush an UploadFile record for testing."""
upload_file = UploadFile(
tenant_id=tenant_id,
tenant_id=override_tenant_id if override_tenant_id is not None else tenant_id,
storage_type=StorageType.LOCAL,
key=storage_key,
key=storage_key or f"test_storage_key_{uuid4()}",
name="test_file.txt",
size=1024,
extension=".txt",
mime_type="text/plain",
created_by_role=CreatorUserRole.ACCOUNT,
created_by=self.user_id,
created_by=user_id,
created_at=datetime.now(UTC),
used=False,
)
upload_file.id = file_id
self.session.add(upload_file)
self.session.flush()
self.test_upload_files.append(upload_file)
upload_file.id = file_id or str(uuid4())
session.add(upload_file)
session.flush()
return upload_file
@staticmethod
def _create_tool_file(
self, file_id: str | None = None, file_key: str | None = None, tenant_id: str | None = None
session: Session,
tenant_id: str,
user_id: str,
conversation_id: str,
*,
file_id: str | None = None,
file_key: str | None = None,
override_tenant_id: str | None = None,
) -> ToolFile:
"""Helper method to create a ToolFile record for testing."""
if file_id is None:
file_id = str(uuid4())
if file_key is None:
file_key = f"test_file_key_{uuid4()}"
if tenant_id is None:
tenant_id = self.tenant_id
"""Create and flush a ToolFile record for testing."""
tool_file = ToolFile(
user_id=self.user_id,
tenant_id=tenant_id,
conversation_id=self.conversation_id,
file_key=file_key,
user_id=user_id,
tenant_id=override_tenant_id if override_tenant_id is not None else tenant_id,
conversation_id=conversation_id,
file_key=file_key or f"test_file_key_{uuid4()}",
mimetype="text/plain",
original_url="http://example.com/file.txt",
name="test_tool_file.txt",
size=2048,
)
tool_file.id = file_id
self.session.add(tool_file)
self.session.flush()
self.test_tool_files.append(tool_file)
tool_file.id = file_id or str(uuid4())
session.add(tool_file)
session.flush()
return tool_file
def _create_file(self, related_id: str, transfer_method: FileTransferMethod, tenant_id: str | None = None) -> File:
"""Helper method to create a File object for testing."""
if tenant_id is None:
tenant_id = self.tenant_id
# Set related_id for LOCAL_FILE and TOOL_FILE transfer methods
file_related_id = None
remote_url = None
if transfer_method in (FileTransferMethod.LOCAL_FILE, FileTransferMethod.TOOL_FILE):
file_related_id = related_id
elif transfer_method == FileTransferMethod.REMOTE_URL:
remote_url = "https://example.com/test_file.txt"
file_related_id = related_id
@staticmethod
def _create_file(
tenant_id: str,
related_id: str,
transfer_method: FileTransferMethod,
*,
override_tenant_id: str | None = None,
) -> File:
"""Build a File value-object for testing."""
remote_url = "https://example.com/test_file.txt" if transfer_method == FileTransferMethod.REMOTE_URL else None
return File(
file_id=str(uuid4()), # Generate new UUID for File.id
tenant_id=tenant_id,
file_id=str(uuid4()),
tenant_id=override_tenant_id if override_tenant_id is not None else tenant_id,
file_type=FileType.DOCUMENT,
transfer_method=transfer_method,
related_id=file_related_id,
related_id=related_id,
remote_url=remote_url,
filename="test_file.txt",
extension=".txt",
@ -136,240 +109,280 @@ class TestStorageKeyLoader(unittest.TestCase):
storage_key="initial_key",
)
def test_load_storage_keys_local_file(self):
# ------------------------------------------------------------------
# Tests
# ------------------------------------------------------------------
def test_load_storage_keys_local_file(self, db_session_with_containers: Session):
"""Test loading storage keys for LOCAL_FILE transfer method."""
# Create test data
upload_file = self._create_upload_file()
file = self._create_file(related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
tenant_id = str(uuid4())
user_id = str(uuid4())
# Load storage keys
self.loader.load_storage_keys([file])
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([file])
# Verify storage key was loaded correctly
assert file._storage_key == upload_file.key
def test_load_storage_keys_remote_url(self):
def test_load_storage_keys_remote_url(self, db_session_with_containers: Session):
"""Test loading storage keys for REMOTE_URL transfer method."""
# Create test data
upload_file = self._create_upload_file()
file = self._create_file(related_id=upload_file.id, transfer_method=FileTransferMethod.REMOTE_URL)
tenant_id = str(uuid4())
user_id = str(uuid4())
# Load storage keys
self.loader.load_storage_keys([file])
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.REMOTE_URL)
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([file])
# Verify storage key was loaded correctly
assert file._storage_key == upload_file.key
def test_load_storage_keys_tool_file(self):
def test_load_storage_keys_tool_file(self, db_session_with_containers: Session):
"""Test loading storage keys for TOOL_FILE transfer method."""
# Create test data
tool_file = self._create_tool_file()
file = self._create_file(related_id=tool_file.id, transfer_method=FileTransferMethod.TOOL_FILE)
tenant_id = str(uuid4())
user_id = str(uuid4())
conversation_id = str(uuid4())
# Load storage keys
self.loader.load_storage_keys([file])
tool_file = self._create_tool_file(db_session_with_containers, tenant_id, user_id, conversation_id)
file = self._create_file(tenant_id, related_id=tool_file.id, transfer_method=FileTransferMethod.TOOL_FILE)
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([file])
# Verify storage key was loaded correctly
assert file._storage_key == tool_file.file_key
def test_load_storage_keys_mixed_methods(self):
def test_load_storage_keys_mixed_methods(self, db_session_with_containers: Session):
"""Test batch loading with mixed transfer methods."""
# Create test data for different transfer methods
upload_file1 = self._create_upload_file()
upload_file2 = self._create_upload_file()
tool_file = self._create_tool_file()
tenant_id = str(uuid4())
user_id = str(uuid4())
conversation_id = str(uuid4())
file1 = self._create_file(related_id=upload_file1.id, transfer_method=FileTransferMethod.LOCAL_FILE)
file2 = self._create_file(related_id=upload_file2.id, transfer_method=FileTransferMethod.REMOTE_URL)
file3 = self._create_file(related_id=tool_file.id, transfer_method=FileTransferMethod.TOOL_FILE)
upload_file1 = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
upload_file2 = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
tool_file = self._create_tool_file(db_session_with_containers, tenant_id, user_id, conversation_id)
files = [file1, file2, file3]
file1 = self._create_file(tenant_id, related_id=upload_file1.id, transfer_method=FileTransferMethod.LOCAL_FILE)
file2 = self._create_file(tenant_id, related_id=upload_file2.id, transfer_method=FileTransferMethod.REMOTE_URL)
file3 = self._create_file(tenant_id, related_id=tool_file.id, transfer_method=FileTransferMethod.TOOL_FILE)
# Load storage keys
self.loader.load_storage_keys(files)
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([file1, file2, file3])
# Verify all storage keys were loaded correctly
assert file1._storage_key == upload_file1.key
assert file2._storage_key == upload_file2.key
assert file3._storage_key == tool_file.file_key
def test_load_storage_keys_empty_list(self):
"""Test with empty file list."""
# Should not raise any exceptions
self.loader.load_storage_keys([])
def test_load_storage_keys_empty_list(self, db_session_with_containers: Session):
"""Test with empty file list — should not raise."""
tenant_id = str(uuid4())
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([])
def test_load_storage_keys_ignores_legacy_file_tenant_id(self):
def test_load_storage_keys_ignores_legacy_file_tenant_id(self, db_session_with_containers: Session):
"""Legacy file tenant_id should not override the loader tenant scope."""
upload_file = self._create_upload_file()
tenant_id = str(uuid4())
user_id = str(uuid4())
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file = self._create_file(
related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE, tenant_id=str(uuid4())
tenant_id,
related_id=upload_file.id,
transfer_method=FileTransferMethod.LOCAL_FILE,
override_tenant_id=str(uuid4()),
)
self.loader.load_storage_keys([file])
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([file])
assert file._storage_key == upload_file.key
def test_load_storage_keys_missing_file_id(self):
"""Test with None file.related_id."""
# Create a file with valid parameters first, then manually set related_id to None
file = self._create_file(related_id=str(uuid4()), transfer_method=FileTransferMethod.LOCAL_FILE)
def test_load_storage_keys_missing_file_id(self, db_session_with_containers: Session):
"""Test with None file.related_id — should raise ValueError."""
tenant_id = str(uuid4())
user_id = str(uuid4())
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
file.related_id = None
# Should raise ValueError for None file related_id
with pytest.raises(ValueError) as context:
self.loader.load_storage_keys([file])
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
with pytest.raises(ValueError, match="file id should not be None."):
loader.load_storage_keys([file])
assert str(context.value) == "file id should not be None."
def test_load_storage_keys_nonexistent_upload_file_records(self, db_session_with_containers: Session):
"""Test with missing UploadFile database records — should raise ValueError."""
tenant_id = str(uuid4())
file = self._create_file(tenant_id, related_id=str(uuid4()), transfer_method=FileTransferMethod.LOCAL_FILE)
def test_load_storage_keys_nonexistent_upload_file_records(self):
"""Test with missing UploadFile database records."""
# Create file with non-existent upload file id
non_existent_id = str(uuid4())
file = self._create_file(related_id=non_existent_id, transfer_method=FileTransferMethod.LOCAL_FILE)
# Should raise ValueError for missing record
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
with pytest.raises(ValueError):
self.loader.load_storage_keys([file])
loader.load_storage_keys([file])
def test_load_storage_keys_nonexistent_tool_file_records(self):
"""Test with missing ToolFile database records."""
# Create file with non-existent tool file id
non_existent_id = str(uuid4())
file = self._create_file(related_id=non_existent_id, transfer_method=FileTransferMethod.TOOL_FILE)
def test_load_storage_keys_nonexistent_tool_file_records(self, db_session_with_containers: Session):
"""Test with missing ToolFile database records — should raise ValueError."""
tenant_id = str(uuid4())
file = self._create_file(tenant_id, related_id=str(uuid4()), transfer_method=FileTransferMethod.TOOL_FILE)
# Should raise ValueError for missing record
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
with pytest.raises(ValueError):
self.loader.load_storage_keys([file])
loader.load_storage_keys([file])
def test_load_storage_keys_invalid_uuid(self):
"""Test with invalid UUID format."""
# Create a file with valid parameters first, then manually set invalid related_id
file = self._create_file(related_id=str(uuid4()), transfer_method=FileTransferMethod.LOCAL_FILE)
def test_load_storage_keys_invalid_uuid(self, db_session_with_containers: Session):
"""Test with invalid UUID format — should raise ValueError."""
tenant_id = str(uuid4())
user_id = str(uuid4())
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
file.related_id = "invalid-uuid-format"
# Should raise ValueError for invalid UUID
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
with pytest.raises(ValueError):
self.loader.load_storage_keys([file])
loader.load_storage_keys([file])
def test_load_storage_keys_batch_efficiency(self):
"""Test batched operations use efficient queries."""
# Create multiple files of different types
upload_files = [self._create_upload_file() for _ in range(3)]
tool_files = [self._create_tool_file() for _ in range(2)]
def test_load_storage_keys_batch_efficiency(self, db_session_with_containers: Session):
"""Batched operations should issue exactly 2 queries for mixed file types."""
tenant_id = str(uuid4())
user_id = str(uuid4())
conversation_id = str(uuid4())
files = []
files.extend(
[self._create_file(related_id=uf.id, transfer_method=FileTransferMethod.LOCAL_FILE) for uf in upload_files]
upload_files = [self._create_upload_file(db_session_with_containers, tenant_id, user_id) for _ in range(3)]
tool_files = [
self._create_tool_file(db_session_with_containers, tenant_id, user_id, conversation_id) for _ in range(2)
]
files = [
self._create_file(tenant_id, related_id=uf.id, transfer_method=FileTransferMethod.LOCAL_FILE)
for uf in upload_files
] + [
self._create_file(tenant_id, related_id=tf.id, transfer_method=FileTransferMethod.TOOL_FILE)
for tf in tool_files
]
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
files.extend(
[self._create_file(related_id=tf.id, transfer_method=FileTransferMethod.TOOL_FILE) for tf in tool_files]
)
# Mock the session to count queries
with patch.object(self.session, "scalars", wraps=self.session.scalars) as mock_scalars:
self.loader.load_storage_keys(files)
# Should make exactly 2 queries (one for upload_files, one for tool_files)
with patch.object(
db_session_with_containers, "scalars", wraps=db_session_with_containers.scalars
) as mock_scalars:
loader.load_storage_keys(files)
# Exactly 2 DB round-trips: one for UploadFile, one for ToolFile
assert mock_scalars.call_count == 2
# Verify all storage keys were loaded correctly
for i, file in enumerate(files[:3]):
assert file._storage_key == upload_files[i].key
for i, file in enumerate(files[3:]):
assert file._storage_key == tool_files[i].file_key
def test_load_storage_keys_tenant_isolation(self):
"""Test that tenant isolation works correctly."""
# Create files for different tenants
def test_load_storage_keys_tenant_isolation(self, db_session_with_containers: Session):
"""Loader should not surface records belonging to a different tenant."""
tenant_id = str(uuid4())
other_tenant_id = str(uuid4())
user_id = str(uuid4())
# Create upload file for current tenant
upload_file_current = self._create_upload_file()
upload_file_current = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file_current = self._create_file(
related_id=upload_file_current.id, transfer_method=FileTransferMethod.LOCAL_FILE
tenant_id, related_id=upload_file_current.id, transfer_method=FileTransferMethod.LOCAL_FILE
)
# Create upload file for other tenant (but don't add to cleanup list)
upload_file_other = UploadFile(
tenant_id=other_tenant_id,
storage_type=StorageType.LOCAL,
key="other_tenant_key",
name="other_file.txt",
size=1024,
extension=".txt",
mime_type="text/plain",
created_by_role=CreatorUserRole.ACCOUNT,
created_by=self.user_id,
created_at=datetime.now(UTC),
used=False,
upload_file_other = self._create_upload_file(
db_session_with_containers,
tenant_id,
user_id,
override_tenant_id=other_tenant_id,
)
upload_file_other.id = str(uuid4())
self.session.add(upload_file_other)
self.session.flush()
# Create file for other tenant but try to load with current tenant's loader
file_other = self._create_file(
related_id=upload_file_other.id, transfer_method=FileTransferMethod.LOCAL_FILE, tenant_id=other_tenant_id
tenant_id,
related_id=upload_file_other.id,
transfer_method=FileTransferMethod.LOCAL_FILE,
override_tenant_id=other_tenant_id,
)
# Should raise ValueError due to tenant mismatch
with pytest.raises(ValueError) as context:
self.loader.load_storage_keys([file_other])
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
assert "Upload file not found for id:" in str(context.value)
with pytest.raises(ValueError, match="Upload file not found for id:"):
loader.load_storage_keys([file_other])
# Current tenant's file should still work
self.loader.load_storage_keys([file_current])
# Current-tenant file still resolves correctly
loader.load_storage_keys([file_current])
assert file_current._storage_key == upload_file_current.key
def test_load_storage_keys_mixed_tenant_batch(self):
"""Test batch with mixed tenant files (should fail on first mismatch)."""
# Create files for current tenant
upload_file_current = self._create_upload_file()
def test_load_storage_keys_mixed_tenant_batch(self, db_session_with_containers: Session):
"""A batch containing a foreign-tenant file should fail on the mismatch."""
tenant_id = str(uuid4())
user_id = str(uuid4())
upload_file_current = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file_current = self._create_file(
related_id=upload_file_current.id, transfer_method=FileTransferMethod.LOCAL_FILE
tenant_id, related_id=upload_file_current.id, transfer_method=FileTransferMethod.LOCAL_FILE
)
# Create file for different tenant
other_tenant_id = str(uuid4())
file_other = self._create_file(
related_id=str(uuid4()), transfer_method=FileTransferMethod.LOCAL_FILE, tenant_id=other_tenant_id
tenant_id,
related_id=str(uuid4()),
transfer_method=FileTransferMethod.LOCAL_FILE,
override_tenant_id=str(uuid4()),
)
# Should raise ValueError on tenant mismatch
with pytest.raises(ValueError) as context:
self.loader.load_storage_keys([file_current, file_other])
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
with pytest.raises(ValueError, match="Upload file not found for id:"):
loader.load_storage_keys([file_current, file_other])
assert "Upload file not found for id:" in str(context.value)
def test_load_storage_keys_duplicate_file_ids(self, db_session_with_containers: Session):
"""Duplicate file IDs in the batch should be handled gracefully."""
tenant_id = str(uuid4())
user_id = str(uuid4())
def test_load_storage_keys_duplicate_file_ids(self):
"""Test handling of duplicate file IDs in the batch."""
# Create upload file
upload_file = self._create_upload_file()
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file1 = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
file2 = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
# Create two File objects with same related_id
file1 = self._create_file(related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
file2 = self._create_file(related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
loader = StorageKeyLoader(
db_session_with_containers, tenant_id, access_controller=DatabaseFileAccessController()
)
loader.load_storage_keys([file1, file2])
# Should handle duplicates gracefully
self.loader.load_storage_keys([file1, file2])
# Both files should have the same storage key
assert file1._storage_key == upload_file.key
assert file2._storage_key == upload_file.key
def test_load_storage_keys_session_isolation(self):
"""Test that the loader uses the provided session correctly."""
# Create test data
upload_file = self._create_upload_file()
file = self._create_file(related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
def test_load_storage_keys_session_isolation(self, db_session_with_containers: Session):
"""A loader backed by an uncommitted session should not see data from another session."""
tenant_id = str(uuid4())
user_id = str(uuid4())
# Create loader with different session (same underlying connection)
upload_file = self._create_upload_file(db_session_with_containers, tenant_id, user_id)
file = self._create_file(tenant_id, related_id=upload_file.id, transfer_method=FileTransferMethod.LOCAL_FILE)
# A loader with a fresh, separate session cannot see uncommitted rows from db_session_with_containers
with Session(bind=db.engine) as other_session:
other_loader = StorageKeyLoader(
other_session,
self.tenant_id,
tenant_id,
access_controller=DatabaseFileAccessController(),
)
with pytest.raises(ValueError):

View File

@ -363,7 +363,8 @@ def test_workflow_online_users_filters_inaccessible_workflow(app, monkeypatch: p
)
monkeypatch.setattr(workflow_module.file_helpers, "get_signed_file_url", sign_avatar)
workflow_module.redis_client.hgetall.side_effect = lambda key: (
redis_pipeline = Mock()
redis_pipeline.execute.return_value = [
{
b"sid-1": json.dumps(
{
@ -374,16 +375,16 @@ def test_workflow_online_users_filters_inaccessible_workflow(app, monkeypatch: p
}
)
}
if key == f"{workflow_module.WORKFLOW_ONLINE_USERS_PREFIX}{app_id_1}"
else {}
)
]
workflow_module.redis_client.pipeline.return_value = redis_pipeline
api = workflow_module.WorkflowOnlineUsersApi()
handler = _unwrap(api.get)
handler = _unwrap(api.post)
with app.test_request_context(
f"/apps/workflows/online-users?app_ids={app_id_1},{app_id_2}",
method="GET",
"/apps/workflows/online-users",
method="POST",
json={"app_ids": [app_id_1, app_id_2]},
):
response = handler(api)
@ -402,12 +403,43 @@ def test_workflow_online_users_filters_inaccessible_workflow(app, monkeypatch: p
}
]
}
workflow_module.redis_client.hgetall.assert_called_once_with(
f"{workflow_module.WORKFLOW_ONLINE_USERS_PREFIX}{app_id_1}"
)
workflow_module.redis_client.pipeline.assert_called_once_with(transaction=False)
redis_pipeline.hgetall.assert_called_once_with(f"{workflow_module.WORKFLOW_ONLINE_USERS_PREFIX}{app_id_1}")
redis_pipeline.execute.assert_called_once_with()
sign_avatar.assert_called_once_with("avatar-file-id")
def test_workflow_online_users_batches_redis_reads(app, monkeypatch: pytest.MonkeyPatch) -> None:
app_ids = [f"wf-{index}" for index in range(workflow_module.WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE + 1)]
monkeypatch.setattr(workflow_module, "current_account_with_tenant", lambda: (SimpleNamespace(), "tenant-1"))
monkeypatch.setattr(
workflow_module,
"WorkflowService",
lambda: SimpleNamespace(get_accessible_app_ids=lambda app_ids, tenant_id: set(app_ids)),
)
first_pipeline = Mock()
first_pipeline.execute.return_value = [{} for _ in range(workflow_module.WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE)]
second_pipeline = Mock()
second_pipeline.execute.return_value = [{}]
workflow_module.redis_client.pipeline.side_effect = [first_pipeline, second_pipeline]
api = workflow_module.WorkflowOnlineUsersApi()
handler = _unwrap(api.post)
with app.test_request_context(
"/apps/workflows/online-users",
method="POST",
json={"app_ids": app_ids},
):
response = handler(api)
assert len(response["data"]) == len(app_ids)
assert workflow_module.redis_client.pipeline.call_count == 2
assert first_pipeline.hgetall.call_count == workflow_module.WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE
assert second_pipeline.hgetall.call_count == 1
def test_workflow_online_users_rejects_excessive_workflow_ids(app, monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(workflow_module, "current_account_with_tenant", lambda: (SimpleNamespace(), "tenant-1"))
accessible_app_ids = Mock(return_value=set())
@ -417,14 +449,15 @@ def test_workflow_online_users_rejects_excessive_workflow_ids(app, monkeypatch:
lambda: SimpleNamespace(get_accessible_app_ids=accessible_app_ids),
)
excessive_ids = ",".join(f"wf-{index}" for index in range(workflow_module.MAX_WORKFLOW_ONLINE_USERS_QUERY_IDS + 1))
excessive_ids = [f"wf-{index}" for index in range(workflow_module.MAX_WORKFLOW_ONLINE_USERS_REQUEST_IDS + 1)]
api = workflow_module.WorkflowOnlineUsersApi()
handler = _unwrap(api.get)
handler = _unwrap(api.post)
with app.test_request_context(
f"/apps/workflows/online-users?app_ids={excessive_ids}",
method="GET",
"/apps/workflows/online-users",
method="POST",
json={"app_ids": excessive_ids},
):
with pytest.raises(HTTPException) as exc:
handler(api)

View File

@ -1,6 +1,7 @@
from unittest.mock import MagicMock, PropertyMock, patch
import pytest
from werkzeug.exceptions import NotFound
from controllers.console import console_ns
from controllers.console.auth.error import (
@ -29,6 +30,7 @@ from controllers.console.workspace.error import (
CurrentPasswordIncorrectError,
InvalidAccountDeletionCodeError,
)
from models.enums import CreatorUserRole
from services.errors.account import CurrentPasswordIncorrectError as ServicePwdError
@ -135,6 +137,131 @@ class TestAccountUpdateApis:
assert result["id"] == "u1"
class TestAccountAvatarApiGet:
"""GET /account/avatar must not sign arbitrary upload_file IDs (IDOR)."""
def test_get_avatar_signed_url_when_upload_owned_by_current_account(self, app):
api = AccountAvatarApi()
method = unwrap(api.get)
user = MagicMock()
user.id = "acc-owner"
tenant_id = "tenant-1"
file_id = "550e8400-e29b-41d4-a716-446655440000"
upload_file = MagicMock()
upload_file.id = file_id
upload_file.tenant_id = tenant_id
upload_file.created_by = user.id
upload_file.created_by_role = CreatorUserRole.ACCOUNT
with (
app.test_request_context(f"/account/avatar?avatar={file_id}"),
patch(
"controllers.console.workspace.account.current_account_with_tenant",
return_value=(user, tenant_id),
),
patch("controllers.console.workspace.account.db.session.scalar", return_value=upload_file),
patch(
"controllers.console.workspace.account.file_helpers.get_signed_file_url",
return_value="https://signed/example",
) as sign_mock,
):
result = method(api)
assert result == {"avatar_url": "https://signed/example"}
sign_mock.assert_called_once_with(upload_file_id=file_id)
def test_get_avatar_not_found_when_upload_created_by_other_account_same_tenant(self, app):
api = AccountAvatarApi()
method = unwrap(api.get)
user = MagicMock()
user.id = "acc-a"
tenant_id = "tenant-1"
file_id = "550e8400-e29b-41d4-a716-446655440001"
upload_file = MagicMock()
upload_file.id = file_id
upload_file.tenant_id = tenant_id
upload_file.created_by = "acc-b"
upload_file.created_by_role = CreatorUserRole.ACCOUNT
with (
app.test_request_context(f"/account/avatar?avatar={file_id}"),
patch(
"controllers.console.workspace.account.current_account_with_tenant",
return_value=(user, tenant_id),
),
patch("controllers.console.workspace.account.db.session.scalar", return_value=upload_file),
patch(
"controllers.console.workspace.account.file_helpers.get_signed_file_url",
return_value="https://signed/leak",
) as sign_mock,
):
with pytest.raises(NotFound):
method(api)
sign_mock.assert_not_called()
def test_get_avatar_not_found_when_upload_belongs_to_other_tenant(self, app):
api = AccountAvatarApi()
method = unwrap(api.get)
user = MagicMock()
user.id = "acc-owner"
tenant_id = "tenant-1"
file_id = "550e8400-e29b-41d4-a716-446655440002"
upload_file = MagicMock()
upload_file.id = file_id
upload_file.tenant_id = "tenant-other"
upload_file.created_by = user.id
upload_file.created_by_role = CreatorUserRole.ACCOUNT
with (
app.test_request_context(f"/account/avatar?avatar={file_id}"),
patch(
"controllers.console.workspace.account.current_account_with_tenant",
return_value=(user, tenant_id),
),
patch("controllers.console.workspace.account.db.session.scalar", return_value=upload_file),
patch(
"controllers.console.workspace.account.file_helpers.get_signed_file_url",
return_value="https://signed/leak",
) as sign_mock,
):
with pytest.raises(NotFound):
method(api)
sign_mock.assert_not_called()
def test_get_avatar_https_pass_through_without_signing(self, app):
api = AccountAvatarApi()
method = unwrap(api.get)
user = MagicMock()
user.id = "acc-owner"
tenant_id = "tenant-1"
external = "https://cdn.example/avatar.png"
with (
app.test_request_context(f"/account/avatar?avatar={external}"),
patch(
"controllers.console.workspace.account.current_account_with_tenant",
return_value=(user, tenant_id),
),
patch(
"controllers.console.workspace.account.file_helpers.get_signed_file_url",
return_value="https://signed/should-not-use",
) as sign_mock,
):
result = method(api)
assert result == {"avatar_url": external}
sign_mock.assert_not_called()
class TestAccountPasswordApi:
def test_password_success(self, app):
api = AccountPasswordApi()

View File

@ -171,6 +171,62 @@ class TestHitTestingApiPost:
assert passed_retrieval_model["search_method"] == "semantic_search"
assert passed_retrieval_model["top_k"] == 10
@patch("controllers.service_api.dataset.hit_testing.service_api_ns")
@patch("controllers.console.datasets.hit_testing_base.marshal")
@patch("controllers.console.datasets.hit_testing_base.HitTestingService")
@patch("controllers.console.datasets.hit_testing_base.DatasetService")
@patch("controllers.console.datasets.hit_testing_base.current_user", new_callable=lambda: Mock(spec=Account))
def test_post_preserves_retrieval_model_metadata_filtering_conditions(
self,
mock_current_user,
mock_dataset_svc,
mock_hit_svc,
mock_marshal,
mock_ns,
app,
):
"""Service API retrieval payload should not drop metadata filters."""
dataset_id = str(uuid.uuid4())
tenant_id = str(uuid.uuid4())
mock_dataset = Mock()
mock_dataset.id = dataset_id
mock_dataset_svc.get_dataset.return_value = mock_dataset
mock_dataset_svc.check_dataset_permission.return_value = None
mock_hit_svc.retrieve.return_value = {"query": "filtered query", "records": []}
mock_hit_svc.hit_testing_args_check.return_value = None
mock_marshal.return_value = []
metadata_filtering_conditions = {
"logical_operator": "and",
"conditions": [
{
"name": "category",
"comparison_operator": "is",
"value": "finance",
}
],
}
mock_ns.payload = {
"query": "filtered query",
"retrieval_model": {
"search_method": "semantic_search",
"reranking_enable": False,
"score_threshold_enabled": False,
"top_k": 4,
"metadata_filtering_conditions": metadata_filtering_conditions,
},
}
with app.test_request_context():
api = HitTestingApi()
HitTestingApi.post.__wrapped__(api, tenant_id, dataset_id)
passed_retrieval_model = mock_hit_svc.retrieve.call_args.kwargs.get("retrieval_model")
assert passed_retrieval_model is not None
assert passed_retrieval_model["metadata_filtering_conditions"] == metadata_filtering_conditions
@patch("controllers.service_api.dataset.hit_testing.service_api_ns")
@patch("controllers.console.datasets.hit_testing_base.marshal")
@patch("controllers.console.datasets.hit_testing_base.HitTestingService")

View File

@ -316,6 +316,33 @@ def test_create_batches_texts_and_skips_empty_input(vector_factory_module):
vector._vector_processor.create.assert_not_called()
def test_create_skips_empty_text_documents_before_embedding(vector_factory_module):
vector = vector_factory_module.Vector.__new__(vector_factory_module.Vector)
vector._embeddings = MagicMock()
vector._embeddings.embed_documents.return_value = [[0.1], [0.2]]
vector._vector_processor = MagicMock()
docs = [
Document(page_content="foo", metadata={"doc_id": "id-1"}),
Document(page_content="", metadata={"doc_id": "id-empty"}),
Document(page_content=" \n", metadata={"doc_id": "id-blank"}),
Document(page_content="bar", metadata={"doc_id": "id-2"}),
]
vector.create(texts=docs, request_id="r-1")
vector._embeddings.embed_documents.assert_called_once_with(["foo", "bar"])
vector._vector_processor.create.assert_called_once_with(
texts=[docs[0], docs[3]], embeddings=[[0.1], [0.2]], request_id="r-1"
)
vector._embeddings.embed_documents.reset_mock()
vector._vector_processor.create.reset_mock()
vector.create(texts=[docs[1], docs[2]])
vector._embeddings.embed_documents.assert_not_called()
vector._vector_processor.create.assert_not_called()
def test_create_multimodal_filters_missing_uploads(vector_factory_module, monkeypatch):
class _Field:
def in_(self, value):
@ -396,6 +423,48 @@ def test_add_texts_with_optional_duplicate_check(vector_factory_module):
vector._vector_processor.create.assert_called_once()
def test_add_texts_skips_empty_text_documents(vector_factory_module):
vector = vector_factory_module.Vector.__new__(vector_factory_module.Vector)
vector._embeddings = MagicMock()
vector._embeddings.embed_documents.return_value = [[0.1]]
vector._vector_processor = MagicMock()
docs = [
Document(page_content="keep", metadata={"doc_id": "id-1"}),
Document(page_content="", metadata={"doc_id": "id-empty"}),
]
vector.add_texts(docs, source="api")
vector._embeddings.embed_documents.assert_called_once_with(["keep"])
vector._vector_processor.create.assert_called_once_with(texts=[docs[0]], embeddings=[[0.1]], source="api")
vector._embeddings.embed_documents.reset_mock()
vector._vector_processor.create.reset_mock()
vector.add_texts([docs[1]])
vector._embeddings.embed_documents.assert_not_called()
vector._vector_processor.create.assert_not_called()
def test_add_texts_filters_empty_documents_before_duplicate_check(vector_factory_module):
vector = vector_factory_module.Vector.__new__(vector_factory_module.Vector)
vector._embeddings = MagicMock()
vector._embeddings.embed_documents.return_value = [[0.1]]
vector._vector_processor = MagicMock()
vector._filter_duplicate_texts = MagicMock(return_value=[])
docs = [
Document(page_content="keep", metadata={"doc_id": "id-1"}),
Document(page_content=" ", metadata={"doc_id": "id-empty"}),
]
vector.add_texts(docs, duplicate_check=True)
vector._filter_duplicate_texts.assert_called_once_with([docs[0]])
vector._embeddings.embed_documents.assert_not_called()
vector._vector_processor.create.assert_not_called()
def test_vector_delegation_methods(vector_factory_module):
vector = vector_factory_module.Vector.__new__(vector_factory_module.Vector)
vector._embeddings = MagicMock()

View File

@ -1106,11 +1106,11 @@ class TestRetrievalService:
def test_deduplicate_documents_non_dify_provider(self):
"""
Test deduplication with non-dify provider documents.
Test deduplication with non-dify provider documents that have no doc_id.
Verifies:
- External provider documents use content-based deduplication
- Different providers are handled correctly
- External provider documents without doc_id use content-based deduplication
- Identical content from the same provider is collapsed to one result
"""
# Arrange
doc1 = Document(
@ -1131,7 +1131,96 @@ class TestRetrievalService:
# Assert
# External documents without doc_id should use content-based dedup
assert len(result) >= 1
assert len(result) == 1
def test_deduplicate_documents_non_dify_provider_with_doc_id_different_sources(self):
"""
Regression test for issue #35707.
Two chunks from different source documents share identical text content but carry
different doc_ids. Before the fix, non-dify providers were forced into content-based
deduplication and the second chunk was silently dropped. After the fix, doc_id is used
as the dedup key for any provider that exposes it, so both chunks must be retained.
Verifies:
- Non-dify provider documents with different doc_ids are NOT deduplicated even when
their page_content is identical.
"""
# Arrange — same content, different doc_ids, non-dify provider (e.g. Weaviate / Qdrant)
doc_a = Document(
page_content="Shared identical content",
metadata={"doc_id": "doc-from-file-a", "score": 0.85},
provider="weaviate",
)
doc_b = Document(
page_content="Shared identical content",
metadata={"doc_id": "doc-from-file-b", "score": 0.82},
provider="weaviate",
)
# Act
result = RetrievalService._deduplicate_documents([doc_a, doc_b])
# Assert — both documents must be kept; losing either silently drops a source citation
assert len(result) == 2
doc_ids = {doc.metadata["doc_id"] for doc in result}
assert doc_ids == {"doc-from-file-a", "doc-from-file-b"}
def test_deduplicate_documents_non_dify_provider_with_same_doc_id(self):
"""
Test that non-dify provider documents sharing the same doc_id are deduplicated by
doc_id key (not by content), and the higher-scored duplicate is retained.
Verifies:
- doc_id-based deduplication now applies to any provider, not only "dify"
- The document with the highest score wins when doc_ids collide
"""
# Arrange
doc_low = Document(
page_content="Content A",
metadata={"doc_id": "chunk-1", "score": 0.5},
provider="qdrant",
)
doc_high = Document(
page_content="Content A",
metadata={"doc_id": "chunk-1", "score": 0.9},
provider="qdrant",
)
# Act
result = RetrievalService._deduplicate_documents([doc_low, doc_high])
# Assert
assert len(result) == 1
assert result[0].metadata["score"] == 0.9
def test_deduplicate_documents_dify_provider_without_doc_id_falls_back_to_content(self):
"""
Test that a dify provider document without doc_id still falls back to content-based
deduplication (no regression from original behaviour).
Verifies:
- Absence of doc_id triggers content-based dedup regardless of provider
- First occurrence is kept when content is identical
"""
# Arrange — dify docs with no doc_id, same content
doc1 = Document(
page_content="Same content",
metadata={"score": 0.8},
provider="dify",
)
doc2 = Document(
page_content="Same content",
metadata={"score": 0.9},
provider="dify",
)
# Act
result = RetrievalService._deduplicate_documents([doc1, doc2])
# Assert — collapsed to one; first-seen wins (no score comparison in content branch)
assert len(result) == 1
assert result[0].metadata["score"] == 0.8
# ==================== Metadata Filtering Tests ====================

View File

@ -5,6 +5,7 @@ from graphon.graph_events import (
NodeRunStreamChunkEvent,
)
from .test_mock_config import MockConfigBuilder
from .test_table_runner import TableTestRunner
@ -44,3 +45,51 @@ def test_tool_in_chatflow():
assert stream_chunk_events[0].chunk == "hello, dify!", (
f"Expected chunk to be 'hello, dify!', but got {stream_chunk_events[0].chunk}"
)
def test_answer_can_render_llm_structured_output_in_chatflow():
runner = TableTestRunner()
fixture_data = runner.workflow_runner.load_fixture("basic_chatflow")
nodes = fixture_data["workflow"]["graph"]["nodes"]
answer_node = next(node for node in nodes if node["id"] == "answer")
answer_node["data"]["answer"] = "{{#llm.structured_output#}}"
mock_config = (
MockConfigBuilder()
.with_node_output(
"llm",
{
"text": "plain text",
"structured_output": {"type": "greeting"},
"usage": {
"prompt_tokens": 10,
"completion_tokens": 5,
"total_tokens": 15,
},
"finish_reason": "stop",
},
)
.build()
)
graph, graph_runtime_state = runner.workflow_runner.create_graph_from_fixture(
fixture_data=fixture_data,
query="hello",
use_mock_factory=True,
mock_config=mock_config,
)
engine = GraphEngine(
workflow_id="test_workflow",
graph=graph,
graph_runtime_state=graph_runtime_state,
command_channel=InMemoryChannel(),
config=GraphEngineConfig(),
)
events = list(engine.run())
success_events = [e for e in events if isinstance(e, GraphRunSucceededEvent)]
assert success_events, "Workflow should complete successfully"
assert success_events[-1].outputs["answer"] == '{\n "type": "greeting"\n}'

View File

@ -86,3 +86,80 @@ def test_execute_answer():
assert result.status == WorkflowNodeExecutionStatus.SUCCEEDED
assert result.outputs["answer"] == "Today's weather is sunny\nYou are a helpful AI.\n{{img}}\nFin."
def test_execute_answer_renders_structured_output_object_as_json() -> None:
init_params = build_test_graph_init_params(
workflow_id="1",
graph_config={"nodes": [], "edges": []},
tenant_id="1",
app_id="1",
user_id="1",
user_from=UserFrom.ACCOUNT,
invoke_from=InvokeFrom.DEBUGGER,
call_depth=0,
)
variable_pool = VariablePool(
system_variables=build_system_variables(user_id="aaa", files=[]),
user_inputs={},
environment_variables=[],
conversation_variables=[],
)
variable_pool.add(["1777539038857", "structured_output"], {"type": "greeting"})
graph_runtime_state = GraphRuntimeState(variable_pool=variable_pool, start_at=time.perf_counter())
node = AnswerNode(
node_id=str(uuid.uuid4()),
graph_init_params=init_params,
graph_runtime_state=graph_runtime_state,
config=AnswerNodeData(
title="123",
type="answer",
answer="{{#1777539038857.structured_output#}}",
),
)
result = node._run()
assert result.status == WorkflowNodeExecutionStatus.SUCCEEDED
assert result.outputs["answer"] == '{\n "type": "greeting"\n}'
def test_execute_answer_falls_back_to_plain_selector_text_when_structured_output_missing() -> None:
init_params = build_test_graph_init_params(
workflow_id="1",
graph_config={"nodes": [], "edges": []},
tenant_id="1",
app_id="1",
user_id="1",
user_from=UserFrom.ACCOUNT,
invoke_from=InvokeFrom.DEBUGGER,
call_depth=0,
)
variable_pool = VariablePool(
system_variables=build_system_variables(user_id="aaa", files=[]),
user_inputs={},
environment_variables=[],
conversation_variables=[],
)
graph_runtime_state = GraphRuntimeState(variable_pool=variable_pool, start_at=time.perf_counter())
node = AnswerNode(
node_id=str(uuid.uuid4()),
graph_init_params=init_params,
graph_runtime_state=graph_runtime_state,
config=AnswerNodeData(
title="123",
type="answer",
answer="{{#1777539038857.structured_output#}}",
),
)
result = node._run()
assert result.status == WorkflowNodeExecutionStatus.SUCCEEDED
assert result.outputs["answer"] == "1777539038857.structured_output"

View File

@ -10,14 +10,20 @@ from core.workflow.nodes.knowledge_index import KNOWLEDGE_INDEX_NODE_TYPE
from graphon.entities.base_node_data import BaseNodeData
from graphon.enums import BuiltinNodeTypes, NodeType
from graphon.nodes.code.entities import CodeLanguage
from graphon.nodes.llm.entities import LLMNodeData
from graphon.variables.segments import StringSegment
def _assert_typed_node_config(config, *, node_id: str, node_type: NodeType, version: str = "1") -> None:
_ = node_id
assert isinstance(config, BaseNodeData)
assert config.type == node_type
assert config.version == version
if isinstance(config, BaseNodeData):
assert config.type == node_type
assert config.version == version
return
assert isinstance(config, dict)
assert config["type"] == node_type
assert config["version"] == version
def _node_constructor(*, return_value):
@ -546,6 +552,84 @@ class TestDifyNodeFactoryCreateNode:
assert kwargs["unstructured_api_config"] is sentinel.unstructured_api_config
assert kwargs["http_client"] is sentinel.http_client
def test_build_llm_compatible_node_init_kwargs_preserves_structured_output_switch(self, factory):
node_data = LLMNodeData.model_validate(
{
"type": BuiltinNodeTypes.LLM,
"title": "LLM",
"model": {"provider": "provider", "name": "model", "mode": "chat", "completion_params": {}},
"prompt_template": [{"role": "system", "text": "x"}],
"context": {"enabled": False, "variable_selector": []},
"vision": {"enabled": False},
"structured_output_enabled": True,
"structured_output": {
"schema": {
"type": "object",
"properties": {"type": {"type": "string"}},
"required": ["type"],
}
},
}
)
wrapped_model_instance = sentinel.wrapped_model_instance
memory = sentinel.memory
factory._build_model_instance_for_llm_node = MagicMock(return_value=sentinel.model_instance)
factory._build_memory_for_llm_node = MagicMock(return_value=memory)
with patch.object(node_factory, "DifyPreparedLLM", return_value=wrapped_model_instance) as prepared_llm:
kwargs = factory._build_llm_compatible_node_init_kwargs(
node_class=sentinel.node_class,
node_data=node_data,
wrap_model_instance=True,
include_http_client=True,
include_llm_file_saver=True,
include_prompt_message_serializer=True,
include_retriever_attachment_loader=True,
include_jinja2_template_renderer=True,
)
assert node_data.structured_output_switch_on is True
assert node_data.structured_output_enabled is True
factory._build_model_instance_for_llm_node.assert_called_once_with(node_data)
factory._build_memory_for_llm_node.assert_called_once_with(
node_data=node_data,
model_instance=sentinel.model_instance,
)
prepared_llm.assert_called_once_with(sentinel.model_instance)
assert kwargs["model_instance"] is wrapped_model_instance
def test_create_node_passes_alias_preserving_llm_config_to_constructor(self, monkeypatch, factory):
created_node = object()
constructor = _node_constructor(return_value=created_node)
monkeypatch.setattr(factory, "_resolve_node_class", MagicMock(return_value=constructor))
monkeypatch.setattr(factory, "_build_llm_compatible_node_init_kwargs", MagicMock(return_value={}))
node_config = {
"id": "llm-node-id",
"data": {
"type": BuiltinNodeTypes.LLM,
"title": "LLM",
"model": {"provider": "provider", "name": "model", "mode": "chat", "completion_params": {}},
"prompt_template": [{"role": "system", "text": "x"}],
"context": {"enabled": False, "variable_selector": []},
"vision": {"enabled": False},
"structured_output_enabled": True,
"structured_output": {
"schema": {
"type": "object",
"properties": {"type": {"type": "string"}},
"required": ["type"],
}
},
},
}
factory.create_node(node_config)
config = constructor.call_args.kwargs["config"]
assert isinstance(config, dict)
assert config["structured_output_enabled"] is True
assert "structured_output_switch_on" not in config
@pytest.mark.parametrize(
("node_type", "constructor_name", "expected_extra_kwargs"),
[

View File

@ -230,3 +230,64 @@ class TestExtractFilename:
"http://example.com/", 'attachment; filename="file%20with%20quotes%20%26%20encoding.txt"'
)
assert result == "file with quotes & encoding.txt"
def test_url_with_query_string(self):
"""Test that query strings are stripped from URL basename."""
result = extract_filename("http://example.com/path/file.txt?signature=abc123&expires=12345", None)
assert result == "file.txt"
def test_url_with_hash_fragment(self):
"""Test that hash fragments are stripped from URL basename."""
result = extract_filename("http://example.com/path/file.txt#section", None)
assert result == "file.txt"
def test_url_with_query_and_fragment(self):
"""Test that both query strings and hash fragments are stripped."""
result = extract_filename("http://example.com/path/file.txt?token=xyz#section", None)
assert result == "file.txt"
def test_signed_url_preserves_filename(self):
"""Test that signed URL parameters don't affect filename extraction."""
result = extract_filename(
"http://storage.example.com/bucket/documents/report.pdf?AWSAccessKeyId=xxx&Signature=yyy&Expires=12345",
None,
)
assert result == "report.pdf"
def test_percent_encoded_filename_with_query_string(self):
"""Test percent-encoded filename with query string is decoded correctly."""
result = extract_filename("http://example.com/path/my%20file.txt?download=true", None)
assert result == "my file.txt"
def test_percent_encoded_filename_with_fragment(self):
"""Test percent-encoded filename with fragment is decoded correctly."""
result = extract_filename("http://example.com/path/my%20file.txt#page=1", None)
assert result == "my file.txt"
def test_complex_percent_encoding_with_query(self):
"""Test complex percent-encoded filename with query parameters."""
result = extract_filename("http://example.com/docs/%E4%B8%AD%E6%96%87%E6%96%87%E4%BB%B6.pdf?v=1", None)
assert result == "中文文件.pdf"
def test_url_with_special_chars_in_query(self):
"""Test that special characters in query string don't affect filename."""
result = extract_filename("http://example.com/file.bin?name=test&path=/some/path", None)
assert result == "file.bin"
def test_malformed_percent_encoding_safe_fallback(self):
"""Test that malformed percent-encoding is handled safely."""
result = extract_filename("http://example.com/path/file%20name%GG.txt?x=1", None)
# %GG is invalid, should be replaced with replacement character
assert "file" in result
assert ".txt" in result
def test_empty_path_with_query_returns_none(self):
"""Test that empty path with query string returns None."""
result = extract_filename("http://example.com/?query=value", None)
assert result is None
def test_path_only_with_query_string(self):
"""Test bare path (not full URL) with query string."""
result = extract_filename("/path/to/file.txt?extra=params", None)
assert result == "file.txt"

98
api/uv.lock generated
View File

@ -481,7 +481,7 @@ wheels = [
[[package]]
name = "bce-python-sdk"
version = "0.9.70"
version = "0.9.71"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "crc32c" },
@ -489,9 +489,9 @@ dependencies = [
{ name = "pycryptodome" },
{ name = "six" },
]
sdist = { url = "https://files.pythonhosted.org/packages/f7/a9/7c21a9073eb9ad7e8cacf6f8a0e47c0d01ad7bf8fd8e0dc42164b117d60b/bce_python_sdk-0.9.70.tar.gz", hash = "sha256:3b37fd7448278dd33f745a6a23198a2cc2490fded9cb8d59b72500784853df4e", size = 299967, upload-time = "2026-04-14T12:02:42.034Z" }
sdist = { url = "https://files.pythonhosted.org/packages/5a/74/72058f098b9e7184376f2b3d4c1d233ca7fdc52d0f527078f3ce4d9828b9/bce_python_sdk-0.9.71.tar.gz", hash = "sha256:7a917edaee39082694776e25a9e6556ec8072400a3be649f28eb13f9c7a0b5b5", size = 301508, upload-time = "2026-04-28T06:23:21.061Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/3c/2d/70fc866ff98d1f6bd75b0a4235694129b3c519b014254d7bcfc02ffe1bee/bce_python_sdk-0.9.70-py3-none-any.whl", hash = "sha256:fd1f31113e4a8dca314f040662b7caf07ec11cf896c5da232627a9a2c9d2e3a1", size = 415660, upload-time = "2026-04-14T12:02:40.034Z" },
{ url = "https://files.pythonhosted.org/packages/2d/2d/821ae8878dc36b77e56bb7e5dbf9a8e73209c11d38c0ba6b38b5778668ae/bce_python_sdk-0.9.71-py3-none-any.whl", hash = "sha256:9f64a99267616456bac487983d92cc778720bf4f102c8931e8e38aea3cb63268", size = 417000, upload-time = "2026-04-28T06:23:19.078Z" },
]
[[package]]
@ -604,29 +604,29 @@ wheels = [
[[package]]
name = "boto3"
version = "1.42.96"
version = "1.43.3"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore" },
{ name = "jmespath" },
{ name = "s3transfer" },
]
sdist = { url = "https://files.pythonhosted.org/packages/a6/2d/69fb3acd50bab83fb295c167d33c4b653faeb5fb0f42bfca4d9b69d6fb68/boto3-1.42.96.tar.gz", hash = "sha256:b38a9e4a3fbbee9017252576f1379780d0a5814768676c08df2f539d31fcdd68", size = 113203, upload-time = "2026-04-24T19:47:18.677Z" }
sdist = { url = "https://files.pythonhosted.org/packages/f2/50/ea184e159c4ac64fef816a72094fb8656eb071361a39ed22c0e3b15a35b4/boto3-1.43.3.tar.gz", hash = "sha256:7c7777862ffc898f05efa566032bbabfe226dbb810e35ec11125817f128bc5c5", size = 113111, upload-time = "2026-05-04T19:34:09.731Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2b/9d/b3f617d011c42eb804d993103b8fa9acdce153e181a3042f58bfe33d7cb4/boto3-1.42.96-py3-none-any.whl", hash = "sha256:2f4566da2c209a98bdbfc874d813ef231c84ad24e4f815e9bc91de5f63351a24", size = 140557, upload-time = "2026-04-24T19:47:15.824Z" },
{ url = "https://files.pythonhosted.org/packages/c8/ad/8a6946a329f0127322108e537dc1c0d9f8eea4f1d1231702c073d2e85f46/boto3-1.43.3-py3-none-any.whl", hash = "sha256:fb9fe51849ef2a78198d582756fc06f14f7de27f73e0fa90275d6aa4171eb4d0", size = 140501, upload-time = "2026-05-04T19:34:07.991Z" },
]
[[package]]
name = "boto3-stubs"
version = "1.42.96"
version = "1.43.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore-stubs" },
{ name = "types-s3transfer" },
]
sdist = { url = "https://files.pythonhosted.org/packages/77/86/65f45f84621cccc2471871088bab8fe515b4346ba9e48d9001484ec440d6/boto3_stubs-1.42.96.tar.gz", hash = "sha256:1e7819c34d1eae8e5e3cfaf9d144fdcad65aad184b380488871de1d0b2851879", size = 102691, upload-time = "2026-04-24T20:25:13.984Z" }
sdist = { url = "https://files.pythonhosted.org/packages/8a/7f/399bcdeaa60a89aafe5292c8364c313177d22b886dffc1bd7b56fe817900/boto3_stubs-1.43.2.tar.gz", hash = "sha256:0d46636f3e761a92070114b39a76b154c5da6c5794c890e1440a7f191bf1ff2e", size = 102658, upload-time = "2026-05-01T20:31:36.963Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a7/51/bdac1ff9fd4321091183776c5adffce5fc7b4d0fec7e38af9064e24a2497/boto3_stubs-1.42.96-py3-none-any.whl", hash = "sha256:2c112e257f40006147a53f6f62075804689154271973b2807f5656feaa804216", size = 70668, upload-time = "2026-04-24T20:25:09.736Z" },
{ url = "https://files.pythonhosted.org/packages/da/df/17647562444b2047ca325eaaf2fea738571822b7b4efdaa6bacf0fd4fff9/boto3_stubs-1.43.2-py3-none-any.whl", hash = "sha256:941f2907236223a1209704eaf708d3cdf1ecc8695618c558f9fb9e23e90c513b", size = 70653, upload-time = "2026-05-01T20:31:30.057Z" },
]
[package.optional-dependencies]
@ -636,16 +636,16 @@ bedrock-runtime = [
[[package]]
name = "botocore"
version = "1.42.96"
version = "1.43.3"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "jmespath" },
{ name = "python-dateutil" },
{ name = "urllib3" },
]
sdist = { url = "https://files.pythonhosted.org/packages/61/77/2c333622a1d47cf5bf73cdcab0cb6c92addafbef2ec05f81b9f75687d9e5/botocore-1.42.96.tar.gz", hash = "sha256:75b3b841ffacaa944f645196655a21ca777591dd8911e732bfb6614545af0250", size = 15263344, upload-time = "2026-04-24T19:47:05.283Z" }
sdist = { url = "https://files.pythonhosted.org/packages/74/ac/cd55f886e17b6b952dbc95b792d3645a73d58586a1400ababe54406073bd/botocore-1.43.3.tar.gz", hash = "sha256:eac6da0fffccf87888ebf4d89f0b2378218a707efa748cd955b838995e944695", size = 15308705, upload-time = "2026-05-04T19:33:56.28Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/45/56/152c3a859ca1b9d77ed16deac3cf81682013677c68cf5715698781fc81bd/botocore-1.42.96-py3-none-any.whl", hash = "sha256:db2c3e2006628be6fde81a24124a6563c363d6982fb92728837cf174bad9d98a", size = 14945920, upload-time = "2026-04-24T19:47:00.323Z" },
{ url = "https://files.pythonhosted.org/packages/be/99/1d9e296edf244f47e0508032f20999f8fd40704dd3c5b601fed099424eb6/botocore-1.43.3-py3-none-any.whl", hash = "sha256:ec0769eb0f7c5034856bb406a92698dbc02a3d4be0f78a384747106b161d8ea3", size = 14989027, upload-time = "2026-05-04T19:33:50.81Z" },
]
[[package]]
@ -1578,7 +1578,7 @@ requires-dist = [
{ name = "aliyun-log-python-sdk", specifier = ">=0.9.44,<1.0.0" },
{ name = "azure-identity", specifier = ">=1.25.3,<2.0.0" },
{ name = "bleach", specifier = ">=6.3.0" },
{ name = "boto3", specifier = ">=1.42.96" },
{ name = "boto3", specifier = ">=1.43.3" },
{ name = "celery", specifier = ">=5.6.3" },
{ name = "croniter", specifier = ">=6.2.2" },
{ name = "fastopenapi", extras = ["flask"], specifier = "~=0.7.0" },
@ -1592,8 +1592,8 @@ requires-dist = [
{ name = "gevent", specifier = ">=26.4.0" },
{ name = "gevent-websocket", specifier = ">=0.10.1" },
{ name = "gmpy2", specifier = ">=2.3.0" },
{ name = "google-api-python-client", specifier = ">=2.194.0" },
{ name = "google-cloud-aiplatform", specifier = ">=1.148.1,<2.0.0" },
{ name = "google-api-python-client", specifier = ">=2.195.0" },
{ name = "google-cloud-aiplatform", specifier = ">=1.149.0,<2.0.0" },
{ name = "graphon", specifier = "~=0.2.2" },
{ name = "gunicorn", specifier = ">=25.3.0" },
{ name = "httpx", extras = ["socks"], specifier = ">=0.28.1,<1.0.0" },
@ -1619,12 +1619,12 @@ requires-dist = [
[package.metadata.requires-dev]
dev = [
{ name = "basedpyright", specifier = ">=1.39.3" },
{ name = "boto3-stubs", specifier = ">=1.42.96" },
{ name = "boto3-stubs", specifier = ">=1.43.2" },
{ name = "celery-types", specifier = ">=0.23.0" },
{ name = "coverage", specifier = ">=7.13.4" },
{ name = "dotenv-linter", specifier = ">=0.7.0" },
{ name = "faker", specifier = ">=40.15.0" },
{ name = "hypothesis", specifier = ">=6.152.3" },
{ name = "hypothesis", specifier = ">=6.152.4" },
{ name = "import-linter", specifier = ">=2.3" },
{ name = "lxml-stubs", specifier = ">=0.5.1" },
{ name = "mypy", specifier = ">=1.20.2" },
@ -1642,8 +1642,8 @@ dev = [
{ name = "testcontainers", specifier = ">=4.14.2" },
{ name = "types-aiofiles", specifier = ">=25.1.0" },
{ name = "types-beautifulsoup4", specifier = ">=4.12.0" },
{ name = "types-cachetools", specifier = ">=6.2.0" },
{ name = "types-cffi", specifier = ">=2.0.0.20260408" },
{ name = "types-cachetools", specifier = ">=7.0.0.20260503" },
{ name = "types-cffi", specifier = ">=2.0.0.20260429" },
{ name = "types-colorama", specifier = ">=0.4.15" },
{ name = "types-defusedxml", specifier = ">=0.7.0" },
{ name = "types-deprecated", specifier = ">=1.3.1" },
@ -1651,7 +1651,7 @@ dev = [
{ name = "types-flask-cors", specifier = ">=6.0.0" },
{ name = "types-flask-migrate", specifier = ">=4.1.0" },
{ name = "types-gevent", specifier = ">=26.4.0" },
{ name = "types-greenlet", specifier = ">=3.4.0" },
{ name = "types-greenlet", specifier = ">=3.5.0.20260428" },
{ name = "types-html5lib", specifier = ">=1.1.11" },
{ name = "types-jmespath", specifier = ">=1.1.0.20260408" },
{ name = "types-markdown", specifier = ">=3.10.2" },
@ -1660,7 +1660,7 @@ dev = [
{ name = "types-olefile", specifier = ">=0.47.0" },
{ name = "types-openpyxl", specifier = ">=3.1.5" },
{ name = "types-pexpect", specifier = ">=4.9.0" },
{ name = "types-protobuf", specifier = ">=7.34.1" },
{ name = "types-protobuf", specifier = ">=7.34.1.20260503" },
{ name = "types-psutil", specifier = ">=7.2.2" },
{ name = "types-psycopg2", specifier = ">=2.9.21.20260422" },
{ name = "types-pygments", specifier = ">=2.20.0" },
@ -1683,7 +1683,7 @@ dev = [
]
storage = [
{ name = "azure-storage-blob", specifier = ">=12.28.0" },
{ name = "bce-python-sdk", specifier = ">=0.9.70" },
{ name = "bce-python-sdk", specifier = ">=0.9.71" },
{ name = "cos-python-sdk-v5", specifier = ">=1.9.42" },
{ name = "esdk-obs-python", specifier = ">=3.22.2" },
{ name = "google-cloud-storage", specifier = ">=3.10.1" },
@ -2719,7 +2719,7 @@ grpc = [
[[package]]
name = "google-api-python-client"
version = "2.194.0"
version = "2.195.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "google-api-core" },
@ -2728,9 +2728,9 @@ dependencies = [
{ name = "httplib2" },
{ name = "uritemplate" },
]
sdist = { url = "https://files.pythonhosted.org/packages/60/ab/e83af0eb043e4ccc49571ca7a6a49984e9d00f4e9e6e6f1238d60bc84dce/google_api_python_client-2.194.0.tar.gz", hash = "sha256:db92647bd1a90f40b79c9618461553c2b20b6a43ce7395fa6de07132dc14f023", size = 14443469, upload-time = "2026-04-08T23:07:35.757Z" }
sdist = { url = "https://files.pythonhosted.org/packages/69/07/08d759b9cb10f48af14b25262dd0d6685ca8cda6c1f9e8a8109f57457205/google_api_python_client-2.195.0.tar.gz", hash = "sha256:c72cf2661c3addf01c880ce60541e83e1df354644b874f7f9d8d5ed2070446ae", size = 14584819, upload-time = "2026-04-30T21:51:50.638Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b0/34/5a624e49f179aa5b0cb87b2ce8093960299030ff40423bfbde09360eb908/google_api_python_client-2.194.0-py3-none-any.whl", hash = "sha256:61eaaac3b8fc8fdf11c08af87abc3d1342d1b37319cc1b57405f86ef7697e717", size = 15016514, upload-time = "2026-04-08T23:07:33.093Z" },
{ url = "https://files.pythonhosted.org/packages/21/b9/2c71095e31fff57668fec7c07ac897df065f15521d070e63229e13689590/google_api_python_client-2.195.0-py3-none-any.whl", hash = "sha256:753e62057f23049a89534bea0162b60fe391b85fb86d80bcdf884d05ec91c5bf", size = 15162418, upload-time = "2026-04-30T21:51:47.444Z" },
]
[[package]]
@ -2766,7 +2766,7 @@ wheels = [
[[package]]
name = "google-cloud-aiplatform"
version = "1.148.1"
version = "1.149.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "docstring-parser" },
@ -2782,9 +2782,9 @@ dependencies = [
{ name = "pydantic" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/c9/f3/b2a9417014c93858a2e3266134f931eefd972c2d410b25d7b8782fc6f143/google_cloud_aiplatform-1.148.1.tar.gz", hash = "sha256:75d605fba34e68714bd08e1e482755d0a6e3ae972805f809d088e686c30879e7", size = 10278758, upload-time = "2026-04-17T23:45:26.738Z" }
sdist = { url = "https://files.pythonhosted.org/packages/42/2c/fba4adc56f74c0ee0fbd91a39d414ca2c3588dd8b71f9be8a507015ca886/google_cloud_aiplatform-1.149.0.tar.gz", hash = "sha256:a4d73485bf1d727a9e1bbbd13d08d7031490686bbf7d125eb905c1a6c1559a35", size = 10451466, upload-time = "2026-04-27T23:11:54.513Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/56/5b/e3515d7bbba602c2b0f6a0da5431785e897252443682e4735d0e6873dc8f/google_cloud_aiplatform-1.148.1-py2.py3-none-any.whl", hash = "sha256:035101e2d8e65c6a706cc3930b2452de7ddcbde50dd130320fcea0d8b03b0c5a", size = 8434481, upload-time = "2026-04-17T23:45:22.919Z" },
{ url = "https://files.pythonhosted.org/packages/bf/a0/27719ba23967ef62e52a1d54e013e0fc174bdab8dd84fb300bab9bf0d4a3/google_cloud_aiplatform-1.149.0-py2.py3-none-any.whl", hash = "sha256:e6b5299fa5d303e971cb29a19f03fdbb7b1e3b9d2faa3a788ca933341fba2f2e", size = 8570410, upload-time = "2026-04-27T23:11:50.495Z" },
]
[[package]]
@ -3319,14 +3319,14 @@ wheels = [
[[package]]
name = "hypothesis"
version = "6.152.3"
version = "6.152.4"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "sortedcontainers" },
]
sdist = { url = "https://files.pythonhosted.org/packages/70/90/fc0b263b6f2622e5f8d2aa93f2e95ba79718a5faa7d2a74bfab10d6b0905/hypothesis-6.152.3.tar.gz", hash = "sha256:c4e5300d3755b6c8a270a28fe5abff40153e927328e89d2bb0229c1384618998", size = 466478, upload-time = "2026-04-26T17:31:07.657Z" }
sdist = { url = "https://files.pythonhosted.org/packages/fa/c7/3147bd903d6b18324a016d43a259cf5b4bb4545e1ead6773dc8a0374e70a/hypothesis-6.152.4.tar.gz", hash = "sha256:31c8f9ce619716f543e2710b489b1633c833586641d9e6c94cee03f109a5afc4", size = 466444, upload-time = "2026-04-27T20:18:37.594Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/90/38/15475b91a4c12721d2be3349e9d6cf8649c76ed9bc1287e2de7c8d06c261/hypothesis-6.152.3-py3-none-any.whl", hash = "sha256:4b47f00916c858ed49cf870a2f08b04e5fff5afae0bb78f3b4a6d9c74fd6c7bc", size = 532154, upload-time = "2026-04-26T17:31:04.42Z" },
{ url = "https://files.pythonhosted.org/packages/19/89/0f50dd0d92e8a7dffc24f69ab910ff81db89b2f082ba42682bd57695e4d2/hypothesis-6.152.4-py3-none-any.whl", hash = "sha256:e730fd93c7578182efadc7f90b3c5437ee4d55edf738930eb5043c81ac1d97e8", size = 532145, upload-time = "2026-04-27T20:18:35.043Z" },
]
[[package]]
@ -3969,11 +3969,11 @@ wheels = [
[[package]]
name = "mypy-boto3-bedrock-runtime"
version = "1.42.42"
version = "1.43.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/46/bb/65dc1b2c5796a6ab5f60bdb57343bd6c3ecb82251c580eca415c8548333e/mypy_boto3_bedrock_runtime-1.42.42.tar.gz", hash = "sha256:3a4088218478b6fbbc26055c03c95bee4fc04624a801090b3cce3037e8275c8d", size = 29840, upload-time = "2026-02-04T20:53:05.999Z" }
sdist = { url = "https://files.pythonhosted.org/packages/21/f2/61519c0162307b1e4d47f63ed8b25390874640934f3d2d25c5d6c5078dd8/mypy_boto3_bedrock_runtime-1.43.0.tar.gz", hash = "sha256:19fc3167de6e66dd7a0ab293adc55c93e2fd67be35e8ab4fc3a7523a380752ce", size = 29903, upload-time = "2026-04-29T22:57:57.561Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/00/43/7ea062f2228f47b5779dcfa14dab48d6e29f979b35d1a5102b0ba80b9c1b/mypy_boto3_bedrock_runtime-1.42.42-py3-none-any.whl", hash = "sha256:b2d16eae22607d0685f90796b3a0afc78c0b09d45872e00eafd634a31dd9358f", size = 36077, upload-time = "2026-02-04T20:53:01.768Z" },
{ url = "https://files.pythonhosted.org/packages/40/4d/7e4c4d55af23b2b1304d6814db8c406beab7977056963200230417c1a2db/mypy_boto3_bedrock_runtime-1.43.0-py3-none-any.whl", hash = "sha256:a125296f992093d58bdcd95176002680fa81ca8a8b8bdf02afad7e5f2d8966aa", size = 36172, upload-time = "2026-04-29T22:57:54.777Z" },
]
[[package]]
@ -5914,14 +5914,14 @@ wheels = [
[[package]]
name = "s3transfer"
version = "0.16.0"
version = "0.17.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore" },
]
sdist = { url = "https://files.pythonhosted.org/packages/05/04/74127fc843314818edfa81b5540e26dd537353b123a4edc563109d8f17dd/s3transfer-0.16.0.tar.gz", hash = "sha256:8e990f13268025792229cd52fa10cb7163744bf56e719e0b9cb925ab79abf920", size = 153827, upload-time = "2025-12-01T02:30:59.114Z" }
sdist = { url = "https://files.pythonhosted.org/packages/9b/ec/7c692cde9125b77e84b307354d4fb705f98b8ccad59a036d5957ca75bfc3/s3transfer-0.17.0.tar.gz", hash = "sha256:9edeb6d1c3c2f89d6050348548834ad8289610d886e5bf7b7207728bd43ce33a", size = 155337, upload-time = "2026-04-29T22:07:36.33Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/fc/51/727abb13f44c1fcf6d145979e1535a35794db0f6e450a0cb46aa24732fe2/s3transfer-0.16.0-py3-none-any.whl", hash = "sha256:18e25d66fed509e3868dc1572b3f427ff947dd2c56f844a5bf09481ad3f3b2fe", size = 86830, upload-time = "2025-12-01T02:30:57.729Z" },
{ url = "https://files.pythonhosted.org/packages/87/72/c6c32d2b657fa3dad1de340254e14390b1e334ce38268b7ad51abda3c8c2/s3transfer-0.17.0-py3-none-any.whl", hash = "sha256:ce3801712acf4ad3e89fb9990df97b4972e93f4b3b0004d214be5bce12814c20", size = 86811, upload-time = "2026-04-29T22:07:34.966Z" },
]
[[package]]
@ -6585,23 +6585,23 @@ wheels = [
[[package]]
name = "types-cachetools"
version = "6.2.0.20260408"
version = "7.0.0.20260503"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/ec/61/475b0e8f4a92e5e33affcc6f4e6344c6dee540824021d22f695ea170da63/types_cachetools-6.2.0.20260408.tar.gz", hash = "sha256:0d8ae2dd5ba0b4cfe6a55c34396dd0415f1be07d0033d84781cdc4ed9c2ebc6b", size = 9854, upload-time = "2026-04-08T04:31:49.665Z" }
sdist = { url = "https://files.pythonhosted.org/packages/ec/57/5d3b8b3e66b002911ec1274e87f904eeee1d843c8713d95476c25c29cf31/types_cachetools-7.0.0.20260503.tar.gz", hash = "sha256:dfa4dcdf453f397dfc6d69fc0a57423ac1f248393f70aa56b5d05fac2df7a96c", size = 10033, upload-time = "2026-05-03T05:19:54.128Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/bb/7d/579f50f4f004ee93c7d1baa95339591cac1fe02f4e3fb8fc0f900ee4a80f/types_cachetools-6.2.0.20260408-py3-none-any.whl", hash = "sha256:470e0b274737feae74beed3d764885bf4664002ecc393fba3778846b13ce92cb", size = 9350, upload-time = "2026-04-08T04:31:48.826Z" },
{ url = "https://files.pythonhosted.org/packages/3d/a8/84562723d9a3572e0851d82bdea6bed5a7dc033c6bd648f492c76b8c4ac8/types_cachetools-7.0.0.20260503-py3-none-any.whl", hash = "sha256:011b4fe0e85ef05c4a2471a4fda40254a78746b501cc1727359233872bb3a4e9", size = 9493, upload-time = "2026-05-03T05:19:53.124Z" },
]
[[package]]
name = "types-cffi"
version = "2.0.0.20260408"
version = "2.0.0.20260429"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "types-setuptools" },
]
sdist = { url = "https://files.pythonhosted.org/packages/64/67/eb4ef3408fdc0b4e5af38b30c0e6ad4663b41bdae9fb85a9f09a8db61a99/types_cffi-2.0.0.20260408.tar.gz", hash = "sha256:aa8b9c456ab715c079fc655929811f21f331bfb940f4a821987c581bf4e36230", size = 17541, upload-time = "2026-04-08T04:36:03.918Z" }
sdist = { url = "https://files.pythonhosted.org/packages/0c/7d/56b9be8b0f9dfbffb7c73e248aacf178693ff3c6cf765b77c43a1e886e04/types_cffi-2.0.0.20260429.tar.gz", hash = "sha256:afe7d9777a2921139623af0b94647637a5bd0b938b77ec125e5e5e068a1727bd", size = 17562, upload-time = "2026-04-29T05:16:43.29Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c3/a3/7fbd93ededcc7c77e9e5948b9794161733ebdbf618a27965b1bea0e728a4/types_cffi-2.0.0.20260408-py3-none-any.whl", hash = "sha256:68bd296742b4ff7c0afe3547f50bd0acc55416ecf322ffefd2b7344ef6388a42", size = 20101, upload-time = "2026-04-08T04:36:02.995Z" },
{ url = "https://files.pythonhosted.org/packages/b8/2c/79fa47a70d534f63a54b6d22e28cc842f8c6d9ebec93048355b0020bc7a9/types_cffi-2.0.0.20260429-py3-none-any.whl", hash = "sha256:6a4237bfdbd50e4d0726929070d8b9983bde541726a5a6fe0e8e24e78c1b3826", size = 20103, upload-time = "2026-04-29T05:16:42.155Z" },
]
[[package]]
@ -6680,11 +6680,11 @@ wheels = [
[[package]]
name = "types-greenlet"
version = "3.4.0.20260409"
version = "3.5.0.20260428"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/27/a6/668751bc864efe820e1eb12c2a77f9e62537f433cc002e483ad01badb04b/types_greenlet-3.4.0.20260409.tar.gz", hash = "sha256:81d2cf628934a16856bb9e54136def8de5356e934f0ad5d5474f219a0c5cb205", size = 8976, upload-time = "2026-04-09T04:22:31.693Z" }
sdist = { url = "https://files.pythonhosted.org/packages/79/50/d255c0e068679d7b9441d9408424ddf9e1f35620548e121003b3660af526/types_greenlet-3.5.0.20260428.tar.gz", hash = "sha256:6c188f5e9c5775d50bd00780a3eb1fb3cde17c396cf9703e3d417936e9e7a082", size = 9003, upload-time = "2026-04-28T05:19:43.062Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/4f/3f/c8a4d8782f78fccb4b5fe91c5eae2efce6648072754bc7096b1e3b5407ad/types_greenlet-3.4.0.20260409-py3-none-any.whl", hash = "sha256:cbceadb4594eccd95b57b3f7fa8a9b851488f5e6c05026f4a3db9aac02ec8333", size = 8812, upload-time = "2026-04-09T04:22:30.734Z" },
{ url = "https://files.pythonhosted.org/packages/30/e5/5ff280f02392ced53cb5e866b660b492b4245b1395a61e57d2a6dc02977b/types_greenlet-3.5.0.20260428-py3-none-any.whl", hash = "sha256:7b0f23ce84ee93474d4aa8058920f0578181e11431be92ce9a4ad4123de2c41b", size = 8809, upload-time = "2026-04-28T05:19:41.976Z" },
]
[[package]]
@ -6764,11 +6764,11 @@ wheels = [
[[package]]
name = "types-protobuf"
version = "7.34.1.20260408"
version = "7.34.1.20260503"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/5b/b1/4521e68c2cc17703d80eb42796751345376dd4c706f84007ef5e7c707774/types_protobuf-7.34.1.20260408.tar.gz", hash = "sha256:e2c0a0430e08c75b52671a6f0035abfdcc791aad12af16274282de1b721758ab", size = 68835, upload-time = "2026-04-08T04:26:43.613Z" }
sdist = { url = "https://files.pythonhosted.org/packages/a0/31/87969cb3e62287bde7598b78b3c098d2873d54f5fb5a7cfbcaa73b8c965e/types_protobuf-7.34.1.20260503.tar.gz", hash = "sha256:effbc819aa17e02448dde99f089c6794662d66f4b2797e922f185ffe0b24e766", size = 68830, upload-time = "2026-05-03T05:19:50.739Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ef/b5/0bc9874d89c58fb0ce851e150055ce732d254dbb10b06becbc7635d0d635/types_protobuf-7.34.1.20260408-py3-none-any.whl", hash = "sha256:ebbcd4e27b145aef6a59bc0cb6c013b3528151c1ba5e7f7337aeee355d276a5e", size = 86012, upload-time = "2026-04-08T04:26:42.566Z" },
{ url = "https://files.pythonhosted.org/packages/f9/67/a33fb18090a927794a5ee4b1a30730b528ace0dad6b18932540d21258184/types_protobuf-7.34.1.20260503-py3-none-any.whl", hash = "sha256:75fd66121d56785c91828b8bf7b511f39ba847f11e682573e41847f01e9cd1de", size = 86019, upload-time = "2026-05-03T05:19:49.486Z" },
]
[[package]]

View File

@ -197,21 +197,11 @@
"count": 4
}
},
"web/app/components/app-sidebar/basic.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app-sidebar/index.tsx": {
"ts/no-explicit-any": {
"count": 1
}
},
"web/app/components/app-sidebar/toggle-button.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/annotation/add-annotation-modal/edit-item/index.tsx": {
"erasable-syntax-only/enums": {
"count": 1
@ -351,16 +341,6 @@
"count": 1
}
},
"web/app/components/app/configuration/config-vision/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/configuration/config-vision/param-config-content.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/configuration/config/agent/agent-setting/index.tsx": {
"react/set-state-in-effect": {
"count": 1
@ -445,21 +425,6 @@
"count": 2
}
},
"web/app/components/app/configuration/config/config-audio.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/configuration/config/config-document.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/configuration/dataset-config/context-var/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/configuration/dataset-config/index.tsx": {
"ts/no-explicit-any": {
"count": 1
@ -470,11 +435,6 @@
"count": 1
}
},
"web/app/components/app/configuration/dataset-config/params-config/config-content.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/app/configuration/dataset-config/params-config/index.tsx": {
"no-restricted-imports": {
"count": 1
@ -1726,11 +1686,6 @@
"count": 1
}
},
"web/app/components/base/param-item/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/base/prompt-editor/index.stories.tsx": {
"no-console": {
"count": 1
@ -2014,11 +1969,6 @@
"count": 4
}
},
"web/app/components/billing/plan-upgrade-modal/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/billing/plan/assets/index.tsx": {
"no-barrel-files/no-barrel-files": {
"count": 4
@ -2047,11 +1997,6 @@
"count": 1
}
},
"web/app/components/billing/priority-label/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/billing/type.ts": {
"erasable-syntax-only/enums": {
"count": 4
@ -2077,11 +2022,6 @@
"count": 3
}
},
"web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/image-input.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/common/image-uploader/store.tsx": {
"react-refresh/only-export-components": {
"count": 3
@ -2092,11 +2032,6 @@
"count": 1
}
},
"web/app/components/datasets/common/retrieval-param-config/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/dsl-confirm-modal.tsx": {
"no-restricted-imports": {
"count": 1
@ -2115,11 +2050,6 @@
"count": 1
}
},
"web/app/components/datasets/create-from-pipeline/list/template-card/details/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/create-from-pipeline/list/template-card/details/types.ts": {
"erasable-syntax-only/enums": {
"count": 1
@ -2130,11 +2060,6 @@
"count": 1
}
},
"web/app/components/datasets/create/embedding-process/indexing-progress-item.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx": {
"no-restricted-imports": {
"count": 1
@ -2165,16 +2090,6 @@
"count": 5
}
},
"web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx": {
"no-restricted-imports": {
"count": 2
}
},
"web/app/components/datasets/create/step-two/components/inputs.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/create/step-two/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
"count": 6
@ -2209,16 +2124,6 @@
"count": 1
}
},
"web/app/components/datasets/create/website/base/checkbox-with-label.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/create/website/base/field.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/create/website/firecrawl/index.tsx": {
"no-console": {
"count": 1
@ -2327,11 +2232,6 @@
"count": 4
}
},
"web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/checkbox-with-label.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/index.tsx": {
"ts/no-explicit-any": {
"count": 1
@ -2477,11 +2377,6 @@
"count": 3
}
},
"web/app/components/datasets/documents/status-item/index.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/external-knowledge-base/create/ExternalApiSelect.tsx": {
"react/set-state-in-effect": {
"count": 1
@ -2565,11 +2460,6 @@
"count": 1
}
},
"web/app/components/datasets/metadata/metadata-document/info-group.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/datasets/metadata/types.ts": {
"erasable-syntax-only/enums": {
"count": 2
@ -2590,11 +2480,6 @@
"count": 1
}
},
"web/app/components/datasets/settings/summary-index-setting.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/develop/code.tsx": {
"ts/no-empty-object-type": {
"count": 1
@ -2778,9 +2663,6 @@
}
},
"web/app/components/header/account-setting/key-validator/declarations.ts": {
"erasable-syntax-only/enums": {
"count": 1
},
"ts/no-explicit-any": {
"count": 1
}
@ -3344,11 +3226,6 @@
"count": 1
}
},
"web/app/components/rag-pipeline/components/panel/input-field/label-right-content/global-inputs.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/index.tsx": {
"ts/no-explicit-any": {
"count": 1
@ -3764,11 +3641,6 @@
"count": 1
}
},
"web/app/components/workflow/header/version-history-button.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/hooks-store/index.ts": {
"no-barrel-files/no-barrel-files": {
"count": 2
@ -3791,7 +3663,7 @@
},
"web/app/components/workflow/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
"count": 27
"count": 26
}
},
"web/app/components/workflow/hooks/use-checklist.ts": {
@ -3940,11 +3812,6 @@
"count": 1
}
},
"web/app/components/workflow/nodes/_base/components/field.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx": {
"ts/no-explicit-any": {
"count": 1
@ -3988,11 +3855,6 @@
"count": 1
}
},
"web/app/components/workflow/nodes/_base/components/option-card.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/_base/components/prompt/editor.tsx": {
"ts/no-explicit-any": {
"count": 4
@ -4054,9 +3916,6 @@
}
},
"web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react/set-state-in-effect": {
"count": 3
},
@ -4331,37 +4190,6 @@
"count": 5
}
},
"web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/human-input/components/delivery-method/test-email-sender.tsx": {
"no-restricted-imports": {
"count": 1
},
"ts/no-explicit-any": {
"count": 2
},
"ts/no-non-null-asserted-optional-chain": {
"count": 1
}
},
"web/app/components/workflow/nodes/human-input/components/delivery-method/upgrade-modal.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/human-input/components/form-content-preview.tsx": {
"react/unsupported-syntax": {
"count": 1
@ -4386,11 +4214,6 @@
"count": 2
}
},
"web/app/components/workflow/nodes/human-input/panel.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/nodes/human-input/types.ts": {
"erasable-syntax-only/enums": {
"count": 2
@ -4547,14 +4370,6 @@
"count": 1
}
},
"web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx": {
"no-restricted-imports": {
"count": 1
},
"ts/no-explicit-any": {
"count": 3
}
},
"web/app/components/workflow/nodes/llm/components/config-prompt.tsx": {
"react/unsupported-syntax": {
"count": 1
@ -4989,11 +4804,6 @@
"count": 1
}
},
"web/app/components/workflow/operator/tip-popup.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"web/app/components/workflow/operator/zoom-in-out.tsx": {
"erasable-syntax-only/enums": {
"count": 1
@ -5333,11 +5143,6 @@
"count": 5
}
},
"web/app/components/workflow/workflow-history-store.tsx": {
"react-refresh/only-export-components": {
"count": 2
}
},
"web/app/components/workflow/workflow-preview/components/nodes/base.tsx": {
"no-restricted-imports": {
"count": 1
@ -5438,21 +5243,6 @@
"count": 3
}
},
"web/context/modal-context-provider.tsx": {
"ts/no-explicit-any": {
"count": 3
}
},
"web/context/modal-context.test.tsx": {
"ts/no-explicit-any": {
"count": 5
}
},
"web/context/modal-context.ts": {
"ts/no-explicit-any": {
"count": 2
}
},
"web/context/provider-context-provider.tsx": {
"ts/no-explicit-any": {
"count": 1

View File

@ -0,0 +1,378 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetAccountAvatarQuery,
zGetAccountAvatarResponse,
zGetAccountDeleteVerifyResponse,
zGetAccountEducationAutocompleteQuery,
zGetAccountEducationAutocompleteResponse,
zGetAccountEducationResponse,
zGetAccountEducationVerifyResponse,
zGetAccountIntegratesResponse,
zGetAccountProfileResponse,
zPostAccountAvatarBody,
zPostAccountAvatarResponse,
zPostAccountChangeEmailBody,
zPostAccountChangeEmailCheckEmailUniqueBody,
zPostAccountChangeEmailCheckEmailUniqueResponse,
zPostAccountChangeEmailResetBody,
zPostAccountChangeEmailResetResponse,
zPostAccountChangeEmailResponse,
zPostAccountChangeEmailValidityBody,
zPostAccountChangeEmailValidityResponse,
zPostAccountDeleteBody,
zPostAccountDeleteFeedbackBody,
zPostAccountDeleteFeedbackResponse,
zPostAccountDeleteResponse,
zPostAccountEducationBody,
zPostAccountEducationResponse,
zPostAccountInitBody,
zPostAccountInitResponse,
zPostAccountInterfaceLanguageBody,
zPostAccountInterfaceLanguageResponse,
zPostAccountInterfaceThemeBody,
zPostAccountInterfaceThemeResponse,
zPostAccountNameBody,
zPostAccountNameResponse,
zPostAccountPasswordBody,
zPostAccountPasswordResponse,
zPostAccountTimezoneBody,
zPostAccountTimezoneResponse,
} from './zod.gen'
/**
* Get account avatar url
*/
export const get = oc
.route({
description: 'Get account avatar url',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountAvatar',
path: '/account/avatar',
tags: ['console'],
})
.input(z.object({ query: zGetAccountAvatarQuery }))
.output(zGetAccountAvatarResponse)
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountAvatar',
path: '/account/avatar',
tags: ['console'],
})
.input(z.object({ body: zPostAccountAvatarBody }))
.output(zPostAccountAvatarResponse)
export const avatar = {
get,
post,
}
export const post2 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountChangeEmailCheckEmailUnique',
path: '/account/change-email/check-email-unique',
tags: ['console'],
})
.input(z.object({ body: zPostAccountChangeEmailCheckEmailUniqueBody }))
.output(zPostAccountChangeEmailCheckEmailUniqueResponse)
export const checkEmailUnique = {
post: post2,
}
export const post3 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountChangeEmailReset',
path: '/account/change-email/reset',
tags: ['console'],
})
.input(z.object({ body: zPostAccountChangeEmailResetBody }))
.output(zPostAccountChangeEmailResetResponse)
export const reset = {
post: post3,
}
export const post4 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountChangeEmailValidity',
path: '/account/change-email/validity',
tags: ['console'],
})
.input(z.object({ body: zPostAccountChangeEmailValidityBody }))
.output(zPostAccountChangeEmailValidityResponse)
export const validity = {
post: post4,
}
export const post5 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountChangeEmail',
path: '/account/change-email',
tags: ['console'],
})
.input(z.object({ body: zPostAccountChangeEmailBody }))
.output(zPostAccountChangeEmailResponse)
export const changeEmail = {
post: post5,
checkEmailUnique,
reset,
validity,
}
export const post6 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountDeleteFeedback',
path: '/account/delete/feedback',
tags: ['console'],
})
.input(z.object({ body: zPostAccountDeleteFeedbackBody }))
.output(zPostAccountDeleteFeedbackResponse)
export const feedback = {
post: post6,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountDeleteVerify',
path: '/account/delete/verify',
tags: ['console'],
})
.output(zGetAccountDeleteVerifyResponse)
export const verify = {
get: get2,
}
export const post7 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountDelete',
path: '/account/delete',
tags: ['console'],
})
.input(z.object({ body: zPostAccountDeleteBody }))
.output(zPostAccountDeleteResponse)
export const delete_ = {
post: post7,
feedback,
verify,
}
export const get3 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountEducationAutocomplete',
path: '/account/education/autocomplete',
tags: ['console'],
})
.input(z.object({ query: zGetAccountEducationAutocompleteQuery }))
.output(zGetAccountEducationAutocompleteResponse)
export const autocomplete = {
get: get3,
}
export const get4 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountEducationVerify',
path: '/account/education/verify',
tags: ['console'],
})
.output(zGetAccountEducationVerifyResponse)
export const verify2 = {
get: get4,
}
export const get5 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountEducation',
path: '/account/education',
tags: ['console'],
})
.output(zGetAccountEducationResponse)
export const post8 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountEducation',
path: '/account/education',
tags: ['console'],
})
.input(z.object({ body: zPostAccountEducationBody }))
.output(zPostAccountEducationResponse)
export const education = {
get: get5,
post: post8,
autocomplete,
verify: verify2,
}
export const post9 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountInit',
path: '/account/init',
tags: ['console'],
})
.input(z.object({ body: zPostAccountInitBody }))
.output(zPostAccountInitResponse)
export const init = {
post: post9,
}
export const get6 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountIntegrates',
path: '/account/integrates',
tags: ['console'],
})
.output(zGetAccountIntegratesResponse)
export const integrates = {
get: get6,
}
export const post10 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountInterfaceLanguage',
path: '/account/interface-language',
tags: ['console'],
})
.input(z.object({ body: zPostAccountInterfaceLanguageBody }))
.output(zPostAccountInterfaceLanguageResponse)
export const interfaceLanguage = {
post: post10,
}
export const post11 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountInterfaceTheme',
path: '/account/interface-theme',
tags: ['console'],
})
.input(z.object({ body: zPostAccountInterfaceThemeBody }))
.output(zPostAccountInterfaceThemeResponse)
export const interfaceTheme = {
post: post11,
}
export const post12 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountName',
path: '/account/name',
tags: ['console'],
})
.input(z.object({ body: zPostAccountNameBody }))
.output(zPostAccountNameResponse)
export const name = {
post: post12,
}
export const post13 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountPassword',
path: '/account/password',
tags: ['console'],
})
.input(z.object({ body: zPostAccountPasswordBody }))
.output(zPostAccountPasswordResponse)
export const password = {
post: post13,
}
export const get7 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAccountProfile',
path: '/account/profile',
tags: ['console'],
})
.output(zGetAccountProfileResponse)
export const profile = {
get: get7,
}
export const post14 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAccountTimezone',
path: '/account/timezone',
tags: ['console'],
})
.input(z.object({ body: zPostAccountTimezoneBody }))
.output(zPostAccountTimezoneResponse)
export const timezone = {
post: post14,
}
export const account = {
avatar,
changeEmail,
delete: delete_,
education,
init,
integrates,
interfaceLanguage,
interfaceTheme,
name,
password,
profile,
timezone,
}
export const contract = {
account,
}

View File

@ -0,0 +1,429 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type AccountAvatarPayload = {
avatar: string
}
export type Account = {
avatar?: string | null
created_at?: number | null
email: string
id: string
interface_language?: string | null
interface_theme?: string | null
is_password_set: boolean
last_login_at?: number | null
last_login_ip?: string | null
name: string
timezone?: string | null
}
export type ChangeEmailSendPayload = {
email: string
language?: string | null
phase?: string | null
token?: string | null
}
export type CheckEmailUniquePayload = {
email: string
}
export type ChangeEmailResetPayload = {
new_email: string
token: string
}
export type ChangeEmailValidityPayload = {
code: string
email: string
token: string
}
export type AccountDeletePayload = {
code: string
token: string
}
export type AccountDeletionFeedbackPayload = {
email: string
feedback: string
}
export type EducationStatusResponse = {
allow_refresh?: boolean | null
expire_at?: number | null
is_student?: boolean | null
result?: boolean | null
}
export type EducationActivatePayload = {
institution: string
role: string
token: string
}
export type EducationAutocompleteResponse = {
curr_page?: number | null
data?: Array<string>
has_next?: boolean | null
}
export type EducationVerifyResponse = {
token?: string | null
}
export type AccountInitPayload = {
interface_language: string
invitation_code?: string | null
timezone: string
}
export type AccountIntegrateListResponse = {
data: Array<AccountIntegrateResponse>
}
export type AccountInterfaceLanguagePayload = {
interface_language: string
}
export type AccountInterfaceThemePayload = {
interface_theme: 'light' | 'dark'
}
export type AccountNamePayload = {
name: string
}
export type AccountPasswordPayload = {
new_password: string
password?: string | null
repeat_new_password: string
}
export type AccountTimezonePayload = {
timezone: string
}
export type AccountIntegrateResponse = {
created_at?: number | null
is_bound: boolean
link?: string | null
provider: string
}
export type GetAccountAvatarData = {
body?: never
path?: never
query: {
avatar: string
}
url: '/account/avatar'
}
export type GetAccountAvatarResponses = {
200: {
[key: string]: unknown
}
}
export type GetAccountAvatarResponse = GetAccountAvatarResponses[keyof GetAccountAvatarResponses]
export type PostAccountAvatarData = {
body: AccountAvatarPayload
path?: never
query?: never
url: '/account/avatar'
}
export type PostAccountAvatarResponses = {
200: Account
}
export type PostAccountAvatarResponse = PostAccountAvatarResponses[keyof PostAccountAvatarResponses]
export type PostAccountChangeEmailData = {
body: ChangeEmailSendPayload
path?: never
query?: never
url: '/account/change-email'
}
export type PostAccountChangeEmailResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountChangeEmailResponse
= PostAccountChangeEmailResponses[keyof PostAccountChangeEmailResponses]
export type PostAccountChangeEmailCheckEmailUniqueData = {
body: CheckEmailUniquePayload
path?: never
query?: never
url: '/account/change-email/check-email-unique'
}
export type PostAccountChangeEmailCheckEmailUniqueResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountChangeEmailCheckEmailUniqueResponse
= PostAccountChangeEmailCheckEmailUniqueResponses[keyof PostAccountChangeEmailCheckEmailUniqueResponses]
export type PostAccountChangeEmailResetData = {
body: ChangeEmailResetPayload
path?: never
query?: never
url: '/account/change-email/reset'
}
export type PostAccountChangeEmailResetResponses = {
200: Account
}
export type PostAccountChangeEmailResetResponse
= PostAccountChangeEmailResetResponses[keyof PostAccountChangeEmailResetResponses]
export type PostAccountChangeEmailValidityData = {
body: ChangeEmailValidityPayload
path?: never
query?: never
url: '/account/change-email/validity'
}
export type PostAccountChangeEmailValidityResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountChangeEmailValidityResponse
= PostAccountChangeEmailValidityResponses[keyof PostAccountChangeEmailValidityResponses]
export type PostAccountDeleteData = {
body: AccountDeletePayload
path?: never
query?: never
url: '/account/delete'
}
export type PostAccountDeleteResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountDeleteResponse = PostAccountDeleteResponses[keyof PostAccountDeleteResponses]
export type PostAccountDeleteFeedbackData = {
body: AccountDeletionFeedbackPayload
path?: never
query?: never
url: '/account/delete/feedback'
}
export type PostAccountDeleteFeedbackResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountDeleteFeedbackResponse
= PostAccountDeleteFeedbackResponses[keyof PostAccountDeleteFeedbackResponses]
export type GetAccountDeleteVerifyData = {
body?: never
path?: never
query?: never
url: '/account/delete/verify'
}
export type GetAccountDeleteVerifyResponses = {
200: {
[key: string]: unknown
}
}
export type GetAccountDeleteVerifyResponse
= GetAccountDeleteVerifyResponses[keyof GetAccountDeleteVerifyResponses]
export type GetAccountEducationData = {
body?: never
path?: never
query?: never
url: '/account/education'
}
export type GetAccountEducationResponses = {
200: EducationStatusResponse
}
export type GetAccountEducationResponse
= GetAccountEducationResponses[keyof GetAccountEducationResponses]
export type PostAccountEducationData = {
body: EducationActivatePayload
path?: never
query?: never
url: '/account/education'
}
export type PostAccountEducationResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountEducationResponse
= PostAccountEducationResponses[keyof PostAccountEducationResponses]
export type GetAccountEducationAutocompleteData = {
body?: never
path?: never
query: {
keywords: string
limit?: number
page?: number
}
url: '/account/education/autocomplete'
}
export type GetAccountEducationAutocompleteResponses = {
200: EducationAutocompleteResponse
}
export type GetAccountEducationAutocompleteResponse
= GetAccountEducationAutocompleteResponses[keyof GetAccountEducationAutocompleteResponses]
export type GetAccountEducationVerifyData = {
body?: never
path?: never
query?: never
url: '/account/education/verify'
}
export type GetAccountEducationVerifyResponses = {
200: EducationVerifyResponse
}
export type GetAccountEducationVerifyResponse
= GetAccountEducationVerifyResponses[keyof GetAccountEducationVerifyResponses]
export type PostAccountInitData = {
body: AccountInitPayload
path?: never
query?: never
url: '/account/init'
}
export type PostAccountInitResponses = {
200: {
[key: string]: unknown
}
}
export type PostAccountInitResponse = PostAccountInitResponses[keyof PostAccountInitResponses]
export type GetAccountIntegratesData = {
body?: never
path?: never
query?: never
url: '/account/integrates'
}
export type GetAccountIntegratesResponses = {
200: AccountIntegrateListResponse
}
export type GetAccountIntegratesResponse
= GetAccountIntegratesResponses[keyof GetAccountIntegratesResponses]
export type PostAccountInterfaceLanguageData = {
body: AccountInterfaceLanguagePayload
path?: never
query?: never
url: '/account/interface-language'
}
export type PostAccountInterfaceLanguageResponses = {
200: Account
}
export type PostAccountInterfaceLanguageResponse
= PostAccountInterfaceLanguageResponses[keyof PostAccountInterfaceLanguageResponses]
export type PostAccountInterfaceThemeData = {
body: AccountInterfaceThemePayload
path?: never
query?: never
url: '/account/interface-theme'
}
export type PostAccountInterfaceThemeResponses = {
200: Account
}
export type PostAccountInterfaceThemeResponse
= PostAccountInterfaceThemeResponses[keyof PostAccountInterfaceThemeResponses]
export type PostAccountNameData = {
body: AccountNamePayload
path?: never
query?: never
url: '/account/name'
}
export type PostAccountNameResponses = {
200: Account
}
export type PostAccountNameResponse = PostAccountNameResponses[keyof PostAccountNameResponses]
export type PostAccountPasswordData = {
body: AccountPasswordPayload
path?: never
query?: never
url: '/account/password'
}
export type PostAccountPasswordResponses = {
200: Account
}
export type PostAccountPasswordResponse
= PostAccountPasswordResponses[keyof PostAccountPasswordResponses]
export type GetAccountProfileData = {
body?: never
path?: never
query?: never
url: '/account/profile'
}
export type GetAccountProfileResponses = {
200: Account
}
export type GetAccountProfileResponse = GetAccountProfileResponses[keyof GetAccountProfileResponses]
export type PostAccountTimezoneData = {
body: AccountTimezonePayload
path?: never
query?: never
url: '/account/timezone'
}
export type PostAccountTimezoneResponses = {
200: Account
}
export type PostAccountTimezoneResponse
= PostAccountTimezoneResponses[keyof PostAccountTimezoneResponses]

View File

@ -0,0 +1,318 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* AccountAvatarPayload
*/
export const zAccountAvatarPayload = z.object({
avatar: z.string(),
})
/**
* Account
*/
export const zAccount = z.object({
avatar: z.string().nullish(),
created_at: z.int().nullish(),
email: z.string(),
id: z.string(),
interface_language: z.string().nullish(),
interface_theme: z.string().nullish(),
is_password_set: z.boolean(),
last_login_at: z.int().nullish(),
last_login_ip: z.string().nullish(),
name: z.string(),
timezone: z.string().nullish(),
})
/**
* ChangeEmailSendPayload
*/
export const zChangeEmailSendPayload = z.object({
email: z.string(),
language: z.string().nullish(),
phase: z.string().nullish(),
token: z.string().nullish(),
})
/**
* CheckEmailUniquePayload
*/
export const zCheckEmailUniquePayload = z.object({
email: z.string(),
})
/**
* ChangeEmailResetPayload
*/
export const zChangeEmailResetPayload = z.object({
new_email: z.string(),
token: z.string(),
})
/**
* ChangeEmailValidityPayload
*/
export const zChangeEmailValidityPayload = z.object({
code: z.string(),
email: z.string(),
token: z.string(),
})
/**
* AccountDeletePayload
*/
export const zAccountDeletePayload = z.object({
code: z.string(),
token: z.string(),
})
/**
* AccountDeletionFeedbackPayload
*/
export const zAccountDeletionFeedbackPayload = z.object({
email: z.string(),
feedback: z.string(),
})
/**
* EducationStatusResponse
*/
export const zEducationStatusResponse = z.object({
allow_refresh: z.boolean().nullish(),
expire_at: z.int().nullish(),
is_student: z.boolean().nullish(),
result: z.boolean().nullish(),
})
/**
* EducationActivatePayload
*/
export const zEducationActivatePayload = z.object({
institution: z.string(),
role: z.string(),
token: z.string(),
})
/**
* EducationAutocompleteResponse
*/
export const zEducationAutocompleteResponse = z.object({
curr_page: z.int().nullish(),
data: z.array(z.string()).optional(),
has_next: z.boolean().nullish(),
})
/**
* EducationVerifyResponse
*/
export const zEducationVerifyResponse = z.object({
token: z.string().nullish(),
})
/**
* AccountInitPayload
*/
export const zAccountInitPayload = z.object({
interface_language: z.string(),
invitation_code: z.string().nullish(),
timezone: z.string(),
})
/**
* AccountInterfaceLanguagePayload
*/
export const zAccountInterfaceLanguagePayload = z.object({
interface_language: z.string(),
})
/**
* AccountInterfaceThemePayload
*/
export const zAccountInterfaceThemePayload = z.object({
interface_theme: z.enum(['light', 'dark']),
})
/**
* AccountNamePayload
*/
export const zAccountNamePayload = z.object({
name: z.string().min(3).max(30),
})
/**
* AccountPasswordPayload
*/
export const zAccountPasswordPayload = z.object({
new_password: z.string(),
password: z.string().nullish(),
repeat_new_password: z.string(),
})
/**
* AccountTimezonePayload
*/
export const zAccountTimezonePayload = z.object({
timezone: z.string(),
})
/**
* AccountIntegrateResponse
*/
export const zAccountIntegrateResponse = z.object({
created_at: z.int().nullish(),
is_bound: z.boolean(),
link: z.string().nullish(),
provider: z.string(),
})
/**
* AccountIntegrateListResponse
*/
export const zAccountIntegrateListResponse = z.object({
data: z.array(zAccountIntegrateResponse),
})
export const zGetAccountAvatarQuery = z.object({
avatar: z.string(),
})
/**
* Success
*/
export const zGetAccountAvatarResponse = z.record(z.string(), z.unknown())
export const zPostAccountAvatarBody = zAccountAvatarPayload
/**
* Success
*/
export const zPostAccountAvatarResponse = zAccount
export const zPostAccountChangeEmailBody = zChangeEmailSendPayload
/**
* Success
*/
export const zPostAccountChangeEmailResponse = z.record(z.string(), z.unknown())
export const zPostAccountChangeEmailCheckEmailUniqueBody = zCheckEmailUniquePayload
/**
* Success
*/
export const zPostAccountChangeEmailCheckEmailUniqueResponse = z.record(z.string(), z.unknown())
export const zPostAccountChangeEmailResetBody = zChangeEmailResetPayload
/**
* Success
*/
export const zPostAccountChangeEmailResetResponse = zAccount
export const zPostAccountChangeEmailValidityBody = zChangeEmailValidityPayload
/**
* Success
*/
export const zPostAccountChangeEmailValidityResponse = z.record(z.string(), z.unknown())
export const zPostAccountDeleteBody = zAccountDeletePayload
/**
* Success
*/
export const zPostAccountDeleteResponse = z.record(z.string(), z.unknown())
export const zPostAccountDeleteFeedbackBody = zAccountDeletionFeedbackPayload
/**
* Success
*/
export const zPostAccountDeleteFeedbackResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetAccountDeleteVerifyResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetAccountEducationResponse = zEducationStatusResponse
export const zPostAccountEducationBody = zEducationActivatePayload
/**
* Success
*/
export const zPostAccountEducationResponse = z.record(z.string(), z.unknown())
export const zGetAccountEducationAutocompleteQuery = z.object({
keywords: z.string(),
limit: z.int().optional().default(20),
page: z.int().optional().default(0),
})
/**
* Success
*/
export const zGetAccountEducationAutocompleteResponse = zEducationAutocompleteResponse
/**
* Success
*/
export const zGetAccountEducationVerifyResponse = zEducationVerifyResponse
export const zPostAccountInitBody = zAccountInitPayload
/**
* Success
*/
export const zPostAccountInitResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetAccountIntegratesResponse = zAccountIntegrateListResponse
export const zPostAccountInterfaceLanguageBody = zAccountInterfaceLanguagePayload
/**
* Success
*/
export const zPostAccountInterfaceLanguageResponse = zAccount
export const zPostAccountInterfaceThemeBody = zAccountInterfaceThemePayload
/**
* Success
*/
export const zPostAccountInterfaceThemeResponse = zAccount
export const zPostAccountNameBody = zAccountNamePayload
/**
* Success
*/
export const zPostAccountNameResponse = zAccount
export const zPostAccountPasswordBody = zAccountPasswordPayload
/**
* Success
*/
export const zPostAccountPasswordResponse = zAccount
/**
* Success
*/
export const zGetAccountProfileResponse = zAccount
export const zPostAccountTimezoneBody = zAccountTimezonePayload
/**
* Success
*/
export const zPostAccountTimezoneResponse = zAccount

View File

@ -0,0 +1,54 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetActivateCheckQuery,
zGetActivateCheckResponse,
zPostActivateBody,
zPostActivateResponse,
} from './zod.gen'
/**
* Check if activation token is valid
*/
export const get = oc
.route({
description: 'Check if activation token is valid',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getActivateCheck',
path: '/activate/check',
tags: ['console'],
})
.input(z.object({ query: zGetActivateCheckQuery }))
.output(zGetActivateCheckResponse)
export const check = {
get,
}
/**
* Activate account with invitation token
*/
export const post = oc
.route({
description: 'Activate account with invitation token',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postActivate',
path: '/activate',
tags: ['console'],
})
.input(z.object({ body: zPostActivateBody }))
.output(zPostActivateResponse)
export const activate = {
post,
check,
}
export const contract = {
activate,
}

View File

@ -0,0 +1,63 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type ActivatePayload = {
email?: string | null
interface_language: string
name: string
timezone: string
token: string
workspace_id?: string | null
}
export type ActivationResponse = {
result: string
}
export type ActivationCheckResponse = {
data?: {
[key: string]: unknown
} | null
is_valid: boolean
}
export type PostActivateData = {
body: ActivatePayload
path?: never
query?: never
url: '/activate'
}
export type PostActivateErrors = {
400: {
[key: string]: unknown
}
}
export type PostActivateError = PostActivateErrors[keyof PostActivateErrors]
export type PostActivateResponses = {
200: ActivationResponse
}
export type PostActivateResponse = PostActivateResponses[keyof PostActivateResponses]
export type GetActivateCheckData = {
body?: never
path?: never
query: {
email?: string | null
token: string
workspace_id?: string | null
}
url: '/activate/check'
}
export type GetActivateCheckResponses = {
200: ActivationCheckResponse
}
export type GetActivateCheckResponse = GetActivateCheckResponses[keyof GetActivateCheckResponses]

View File

@ -0,0 +1,48 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* ActivatePayload
*/
export const zActivatePayload = z.object({
email: z.string().nullish(),
interface_language: z.string(),
name: z.string().max(30),
timezone: z.string(),
token: z.string(),
workspace_id: z.string().nullish(),
})
/**
* ActivationResponse
*/
export const zActivationResponse = z.object({
result: z.string(),
})
/**
* ActivationCheckResponse
*/
export const zActivationCheckResponse = z.object({
data: z.record(z.string(), z.unknown()).nullish(),
is_valid: z.boolean(),
})
export const zPostActivateBody = zActivatePayload
/**
* Account activated successfully
*/
export const zPostActivateResponse = zActivationResponse
export const zGetActivateCheckQuery = z.object({
email: z.string().nullish(),
token: z.string(),
workspace_id: z.string().nullish(),
})
/**
* Success
*/
export const zGetActivateCheckResponse = zActivationCheckResponse

View File

@ -0,0 +1,153 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zDeleteAdminDeleteExploreBannerByBannerIdPath,
zDeleteAdminDeleteExploreBannerByBannerIdResponse,
zDeleteAdminInsertExploreAppsByAppIdPath,
zDeleteAdminInsertExploreAppsByAppIdResponse,
zPostAdminBatchAddNotificationAccountsResponse,
zPostAdminInsertExploreAppsBody,
zPostAdminInsertExploreAppsResponse,
zPostAdminInsertExploreBannerBody,
zPostAdminInsertExploreBannerResponse,
zPostAdminUpsertNotificationBody,
zPostAdminUpsertNotificationResponse,
} from './zod.gen'
/**
* Register target accounts for a notification by email address. JSON body: {"notification_id": "...", "user_email": ["a@example.com", ...]}. File upload: multipart/form-data with a 'file' field (CSV or TXT, one email per line) plus a 'notification_id' field. Emails that do not match any account are silently skipped.
*/
export const post = oc
.route({
description:
'Register target accounts for a notification by email address. JSON body: {"notification_id": "...", "user_email": ["a@example.com", ...]}. File upload: multipart/form-data with a \'file\' field (CSV or TXT, one email per line) plus a \'notification_id\' field. Emails that do not match any account are silently skipped.',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAdminBatchAddNotificationAccounts',
path: '/admin/batch_add_notification_accounts',
tags: ['console'],
})
.output(zPostAdminBatchAddNotificationAccountsResponse)
export const batchAddNotificationAccounts = {
post,
}
/**
* Delete an explore banner
*/
export const delete_ = oc
.route({
description: 'Delete an explore banner',
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteAdminDeleteExploreBannerByBannerId',
path: '/admin/delete-explore-banner/{banner_id}',
successStatus: 204,
tags: ['console'],
})
.input(z.object({ params: zDeleteAdminDeleteExploreBannerByBannerIdPath }))
.output(zDeleteAdminDeleteExploreBannerByBannerIdResponse)
export const byBannerId = {
delete: delete_,
}
export const deleteExploreBanner = {
byBannerId,
}
/**
* Remove an app from the explore list
*/
export const delete2 = oc
.route({
description: 'Remove an app from the explore list',
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteAdminInsertExploreAppsByAppId',
path: '/admin/insert-explore-apps/{app_id}',
successStatus: 204,
tags: ['console'],
})
.input(z.object({ params: zDeleteAdminInsertExploreAppsByAppIdPath }))
.output(zDeleteAdminInsertExploreAppsByAppIdResponse)
export const byAppId = {
delete: delete2,
}
/**
* Insert or update an app in the explore list
*/
export const post2 = oc
.route({
description: 'Insert or update an app in the explore list',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAdminInsertExploreApps',
path: '/admin/insert-explore-apps',
tags: ['console'],
})
.input(z.object({ body: zPostAdminInsertExploreAppsBody }))
.output(zPostAdminInsertExploreAppsResponse)
export const insertExploreApps = {
post: post2,
byAppId,
}
/**
* Insert an explore banner
*/
export const post3 = oc
.route({
description: 'Insert an explore banner',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAdminInsertExploreBanner',
path: '/admin/insert-explore-banner',
successStatus: 201,
tags: ['console'],
})
.input(z.object({ body: zPostAdminInsertExploreBannerBody }))
.output(zPostAdminInsertExploreBannerResponse)
export const insertExploreBanner = {
post: post3,
}
/**
* Create or update an in-product notification. Supply notification_id to update an existing one; omit it to create a new one. Pass at least one language variant in contents (zh / en / jp).
*/
export const post4 = oc
.route({
description:
'Create or update an in-product notification. Supply notification_id to update an existing one; omit it to create a new one. Pass at least one language variant in contents (zh / en / jp).',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAdminUpsertNotification',
path: '/admin/upsert_notification',
tags: ['console'],
})
.input(z.object({ body: zPostAdminUpsertNotificationBody }))
.output(zPostAdminUpsertNotificationResponse)
export const upsertNotification = {
post: post4,
}
export const admin = {
batchAddNotificationAccounts,
deleteExploreBanner,
insertExploreApps,
insertExploreBanner,
upsertNotification,
}
export const contract = {
admin,
}

View File

@ -0,0 +1,157 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type InsertExploreAppPayload = {
app_id: string
can_trial?: boolean
category: string
copyright?: string | null
custom_disclaimer?: string | null
desc?: string | null
language: string
position: number
privacy_policy?: string | null
trial_limit?: number
}
export type InsertExploreBannerPayload = {
'category': string
'description': string
'img-src': string
'language'?: string
'link': string
'sort': number
'title': string
}
export type UpsertNotificationPayload = {
contents: Array<LangContentPayload>
end_time?: string | null
frequency?: string
notification_id?: string | null
start_time?: string | null
status?: string
}
export type LangContentPayload = {
body: string
lang: string
subtitle?: string | null
title: string
title_pic_url?: string | null
}
export type PostAdminBatchAddNotificationAccountsData = {
body?: never
path?: never
query?: never
url: '/admin/batch_add_notification_accounts'
}
export type PostAdminBatchAddNotificationAccountsResponses = {
200: {
[key: string]: unknown
}
}
export type PostAdminBatchAddNotificationAccountsResponse
= PostAdminBatchAddNotificationAccountsResponses[keyof PostAdminBatchAddNotificationAccountsResponses]
export type DeleteAdminDeleteExploreBannerByBannerIdData = {
body?: never
path: {
banner_id: string
}
query?: never
url: '/admin/delete-explore-banner/{banner_id}'
}
export type DeleteAdminDeleteExploreBannerByBannerIdResponses = {
204: {
[key: string]: unknown
}
}
export type DeleteAdminDeleteExploreBannerByBannerIdResponse
= DeleteAdminDeleteExploreBannerByBannerIdResponses[keyof DeleteAdminDeleteExploreBannerByBannerIdResponses]
export type PostAdminInsertExploreAppsData = {
body: InsertExploreAppPayload
path?: never
query?: never
url: '/admin/insert-explore-apps'
}
export type PostAdminInsertExploreAppsErrors = {
404: {
[key: string]: unknown
}
}
export type PostAdminInsertExploreAppsError
= PostAdminInsertExploreAppsErrors[keyof PostAdminInsertExploreAppsErrors]
export type PostAdminInsertExploreAppsResponses = {
200: {
[key: string]: unknown
}
201: {
[key: string]: unknown
}
}
export type PostAdminInsertExploreAppsResponse
= PostAdminInsertExploreAppsResponses[keyof PostAdminInsertExploreAppsResponses]
export type DeleteAdminInsertExploreAppsByAppIdData = {
body?: never
path: {
app_id: string
}
query?: never
url: '/admin/insert-explore-apps/{app_id}'
}
export type DeleteAdminInsertExploreAppsByAppIdResponses = {
204: {
[key: string]: unknown
}
}
export type DeleteAdminInsertExploreAppsByAppIdResponse
= DeleteAdminInsertExploreAppsByAppIdResponses[keyof DeleteAdminInsertExploreAppsByAppIdResponses]
export type PostAdminInsertExploreBannerData = {
body: InsertExploreBannerPayload
path?: never
query?: never
url: '/admin/insert-explore-banner'
}
export type PostAdminInsertExploreBannerResponses = {
201: {
[key: string]: unknown
}
}
export type PostAdminInsertExploreBannerResponse
= PostAdminInsertExploreBannerResponses[keyof PostAdminInsertExploreBannerResponses]
export type PostAdminUpsertNotificationData = {
body: UpsertNotificationPayload
path?: never
query?: never
url: '/admin/upsert_notification'
}
export type PostAdminUpsertNotificationResponses = {
200: {
[key: string]: unknown
}
}
export type PostAdminUpsertNotificationResponse
= PostAdminUpsertNotificationResponses[keyof PostAdminUpsertNotificationResponses]

View File

@ -0,0 +1,99 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* InsertExploreAppPayload
*/
export const zInsertExploreAppPayload = z.object({
app_id: z.string(),
can_trial: z.boolean().optional().default(false),
category: z.string(),
copyright: z.string().nullish(),
custom_disclaimer: z.string().nullish(),
desc: z.string().nullish(),
language: z.string(),
position: z.int(),
privacy_policy: z.string().nullish(),
trial_limit: z.int().optional().default(0),
})
/**
* InsertExploreBannerPayload
*/
export const zInsertExploreBannerPayload = z.object({
'category': z.string(),
'description': z.string(),
'img-src': z.string(),
'language': z.string().optional().default('en-US'),
'link': z.string(),
'sort': z.int(),
'title': z.string(),
})
/**
* LangContentPayload
*/
export const zLangContentPayload = z.object({
body: z.string(),
lang: z.string(),
subtitle: z.string().nullish(),
title: z.string(),
title_pic_url: z.string().nullish(),
})
/**
* UpsertNotificationPayload
*/
export const zUpsertNotificationPayload = z.object({
contents: z.array(zLangContentPayload).min(1),
end_time: z.string().nullish(),
frequency: z.string().optional().default('once'),
notification_id: z.string().nullish(),
start_time: z.string().nullish(),
status: z.string().optional().default('active'),
})
/**
* Accounts added successfully
*/
export const zPostAdminBatchAddNotificationAccountsResponse = z.record(z.string(), z.unknown())
export const zDeleteAdminDeleteExploreBannerByBannerIdPath = z.object({
banner_id: z.string(),
})
/**
* Banner deleted successfully
*/
export const zDeleteAdminDeleteExploreBannerByBannerIdResponse = z.record(z.string(), z.unknown())
export const zPostAdminInsertExploreAppsBody = zInsertExploreAppPayload
export const zPostAdminInsertExploreAppsResponse = z.union([
z.record(z.string(), z.unknown()),
z.record(z.string(), z.unknown()),
])
export const zDeleteAdminInsertExploreAppsByAppIdPath = z.object({
app_id: z.string(),
})
/**
* App removed successfully
*/
export const zDeleteAdminInsertExploreAppsByAppIdResponse = z.record(z.string(), z.unknown())
export const zPostAdminInsertExploreBannerBody = zInsertExploreBannerPayload
/**
* Banner inserted successfully
*/
export const zPostAdminInsertExploreBannerResponse = z.record(z.string(), z.unknown())
export const zPostAdminUpsertNotificationBody = zUpsertNotificationPayload
/**
* Notification upserted successfully
*/
export const zPostAdminUpsertNotificationResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,25 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import { zGetAllWorkspacesQuery, zGetAllWorkspacesResponse } from './zod.gen'
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAllWorkspaces',
path: '/all-workspaces',
tags: ['console'],
})
.input(z.object({ query: zGetAllWorkspacesQuery.optional() }))
.output(zGetAllWorkspacesResponse)
export const allWorkspaces = {
get,
}
export const contract = {
allWorkspaces,
}

View File

@ -0,0 +1,23 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type GetAllWorkspacesData = {
body?: never
path?: never
query?: {
limit?: number
page?: number
}
url: '/all-workspaces'
}
export type GetAllWorkspacesResponses = {
200: {
[key: string]: unknown
}
}
export type GetAllWorkspacesResponse = GetAllWorkspacesResponses[keyof GetAllWorkspacesResponses]

View File

@ -0,0 +1,13 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
export const zGetAllWorkspacesQuery = z.object({
limit: z.int().gte(1).lte(100).optional().default(20),
page: z.int().gte(1).lte(99999).optional().default(1),
})
/**
* Success
*/
export const zGetAllWorkspacesResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,109 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zDeleteApiBasedExtensionByIdPath,
zDeleteApiBasedExtensionByIdResponse,
zGetApiBasedExtensionByIdPath,
zGetApiBasedExtensionByIdResponse,
zGetApiBasedExtensionResponse,
zPostApiBasedExtensionBody,
zPostApiBasedExtensionByIdBody,
zPostApiBasedExtensionByIdPath,
zPostApiBasedExtensionByIdResponse,
zPostApiBasedExtensionResponse,
} from './zod.gen'
/**
* Delete API-based extension
*/
export const delete_ = oc
.route({
description: 'Delete API-based extension',
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteApiBasedExtensionById',
path: '/api-based-extension/{id}',
successStatus: 204,
tags: ['console'],
})
.input(z.object({ params: zDeleteApiBasedExtensionByIdPath }))
.output(zDeleteApiBasedExtensionByIdResponse)
/**
* Get API-based extension by ID
*/
export const get = oc
.route({
description: 'Get API-based extension by ID',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getApiBasedExtensionById',
path: '/api-based-extension/{id}',
tags: ['console'],
})
.input(z.object({ params: zGetApiBasedExtensionByIdPath }))
.output(zGetApiBasedExtensionByIdResponse)
/**
* Update API-based extension
*/
export const post = oc
.route({
description: 'Update API-based extension',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postApiBasedExtensionById',
path: '/api-based-extension/{id}',
tags: ['console'],
})
.input(z.object({ body: zPostApiBasedExtensionByIdBody, params: zPostApiBasedExtensionByIdPath }))
.output(zPostApiBasedExtensionByIdResponse)
export const byId = {
delete: delete_,
get,
post,
}
/**
* Get all API-based extensions for current tenant
*/
export const get2 = oc
.route({
description: 'Get all API-based extensions for current tenant',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getApiBasedExtension',
path: '/api-based-extension',
tags: ['console'],
})
.output(zGetApiBasedExtensionResponse)
/**
* Create a new API-based extension
*/
export const post2 = oc
.route({
description: 'Create a new API-based extension',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postApiBasedExtension',
path: '/api-based-extension',
successStatus: 201,
tags: ['console'],
})
.input(z.object({ body: zPostApiBasedExtensionBody }))
.output(zPostApiBasedExtensionResponse)
export const apiBasedExtension = {
get: get2,
post: post2,
byId,
}
export const contract = {
apiBasedExtension,
}

View File

@ -0,0 +1,99 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type ApiBasedExtensionListResponse = Array<ApiBasedExtensionResponse>
export type ApiBasedExtensionPayload = {
api_endpoint: string
api_key: string
name: string
}
export type ApiBasedExtensionResponse = {
api_endpoint: string
api_key: string
created_at?: number | null
id: string
name: string
}
export type GetApiBasedExtensionData = {
body?: never
path?: never
query?: never
url: '/api-based-extension'
}
export type GetApiBasedExtensionResponses = {
200: ApiBasedExtensionListResponse
}
export type GetApiBasedExtensionResponse
= GetApiBasedExtensionResponses[keyof GetApiBasedExtensionResponses]
export type PostApiBasedExtensionData = {
body: ApiBasedExtensionPayload
path?: never
query?: never
url: '/api-based-extension'
}
export type PostApiBasedExtensionResponses = {
201: ApiBasedExtensionResponse
}
export type PostApiBasedExtensionResponse
= PostApiBasedExtensionResponses[keyof PostApiBasedExtensionResponses]
export type DeleteApiBasedExtensionByIdData = {
body?: never
path: {
id: string
}
query?: never
url: '/api-based-extension/{id}'
}
export type DeleteApiBasedExtensionByIdResponses = {
204: {
[key: string]: unknown
}
}
export type DeleteApiBasedExtensionByIdResponse
= DeleteApiBasedExtensionByIdResponses[keyof DeleteApiBasedExtensionByIdResponses]
export type GetApiBasedExtensionByIdData = {
body?: never
path: {
id: string
}
query?: never
url: '/api-based-extension/{id}'
}
export type GetApiBasedExtensionByIdResponses = {
200: ApiBasedExtensionResponse
}
export type GetApiBasedExtensionByIdResponse
= GetApiBasedExtensionByIdResponses[keyof GetApiBasedExtensionByIdResponses]
export type PostApiBasedExtensionByIdData = {
body: ApiBasedExtensionPayload
path: {
id: string
}
query?: never
url: '/api-based-extension/{id}'
}
export type PostApiBasedExtensionByIdResponses = {
200: ApiBasedExtensionResponse
}
export type PostApiBasedExtensionByIdResponse
= PostApiBasedExtensionByIdResponses[keyof PostApiBasedExtensionByIdResponses]

View File

@ -0,0 +1,66 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* APIBasedExtensionPayload
*/
export const zApiBasedExtensionPayload = z.object({
api_endpoint: z.string(),
api_key: z.string(),
name: z.string(),
})
/**
* APIBasedExtensionResponse
*/
export const zApiBasedExtensionResponse = z.object({
api_endpoint: z.string(),
api_key: z.string(),
created_at: z.int().nullish(),
id: z.string(),
name: z.string(),
})
export const zApiBasedExtensionListResponse = z.array(zApiBasedExtensionResponse)
/**
* Success
*/
export const zGetApiBasedExtensionResponse = zApiBasedExtensionListResponse
export const zPostApiBasedExtensionBody = zApiBasedExtensionPayload
/**
* Extension created successfully
*/
export const zPostApiBasedExtensionResponse = zApiBasedExtensionResponse
export const zDeleteApiBasedExtensionByIdPath = z.object({
id: z.string(),
})
/**
* Extension deleted successfully
*/
export const zDeleteApiBasedExtensionByIdResponse = z.record(z.string(), z.unknown())
export const zGetApiBasedExtensionByIdPath = z.object({
id: z.string(),
})
/**
* Success
*/
export const zGetApiBasedExtensionByIdResponse = zApiBasedExtensionResponse
export const zPostApiBasedExtensionByIdBody = zApiBasedExtensionPayload
export const zPostApiBasedExtensionByIdPath = z.object({
id: z.string(),
})
/**
* Extension updated successfully
*/
export const zPostApiBasedExtensionByIdResponse = zApiBasedExtensionResponse

View File

@ -0,0 +1,66 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zDeleteApiKeyAuthDataSourceByBindingIdPath,
zDeleteApiKeyAuthDataSourceByBindingIdResponse,
zGetApiKeyAuthDataSourceResponse,
zPostApiKeyAuthDataSourceBindingBody,
zPostApiKeyAuthDataSourceBindingResponse,
} from './zod.gen'
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postApiKeyAuthDataSourceBinding',
path: '/api-key-auth/data-source/binding',
tags: ['console'],
})
.input(z.object({ body: zPostApiKeyAuthDataSourceBindingBody }))
.output(zPostApiKeyAuthDataSourceBindingResponse)
export const binding = {
post,
}
export const delete_ = oc
.route({
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteApiKeyAuthDataSourceByBindingId',
path: '/api-key-auth/data-source/{binding_id}',
tags: ['console'],
})
.input(z.object({ params: zDeleteApiKeyAuthDataSourceByBindingIdPath }))
.output(zDeleteApiKeyAuthDataSourceByBindingIdResponse)
export const byBindingId = {
delete: delete_,
}
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getApiKeyAuthDataSource',
path: '/api-key-auth/data-source',
tags: ['console'],
})
.output(zGetApiKeyAuthDataSourceResponse)
export const dataSource = {
get,
binding,
byBindingId,
}
export const apiKeyAuth = {
dataSource,
}
export const contract = {
apiKeyAuth,
}

View File

@ -0,0 +1,63 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type ApiKeyAuthBindingPayload = {
category: string
credentials: {
[key: string]: unknown
}
provider: string
}
export type GetApiKeyAuthDataSourceData = {
body?: never
path?: never
query?: never
url: '/api-key-auth/data-source'
}
export type GetApiKeyAuthDataSourceResponses = {
200: {
[key: string]: unknown
}
}
export type GetApiKeyAuthDataSourceResponse
= GetApiKeyAuthDataSourceResponses[keyof GetApiKeyAuthDataSourceResponses]
export type PostApiKeyAuthDataSourceBindingData = {
body: ApiKeyAuthBindingPayload
path?: never
query?: never
url: '/api-key-auth/data-source/binding'
}
export type PostApiKeyAuthDataSourceBindingResponses = {
200: {
[key: string]: unknown
}
}
export type PostApiKeyAuthDataSourceBindingResponse
= PostApiKeyAuthDataSourceBindingResponses[keyof PostApiKeyAuthDataSourceBindingResponses]
export type DeleteApiKeyAuthDataSourceByBindingIdData = {
body?: never
path: {
binding_id: string
}
query?: never
url: '/api-key-auth/data-source/{binding_id}'
}
export type DeleteApiKeyAuthDataSourceByBindingIdResponses = {
200: {
[key: string]: unknown
}
}
export type DeleteApiKeyAuthDataSourceByBindingIdResponse
= DeleteApiKeyAuthDataSourceByBindingIdResponses[keyof DeleteApiKeyAuthDataSourceByBindingIdResponses]

View File

@ -0,0 +1,33 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* ApiKeyAuthBindingPayload
*/
export const zApiKeyAuthBindingPayload = z.object({
category: z.string(),
credentials: z.record(z.string(), z.unknown()),
provider: z.string(),
})
/**
* Success
*/
export const zGetApiKeyAuthDataSourceResponse = z.record(z.string(), z.unknown())
export const zPostApiKeyAuthDataSourceBindingBody = zApiKeyAuthBindingPayload
/**
* Success
*/
export const zPostApiKeyAuthDataSourceBindingResponse = z.record(z.string(), z.unknown())
export const zDeleteApiKeyAuthDataSourceByBindingIdPath = z.object({
binding_id: z.string(),
})
/**
* Success
*/
export const zDeleteApiKeyAuthDataSourceByBindingIdResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,33 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import { zGetAppPromptTemplatesQuery, zGetAppPromptTemplatesResponse } from './zod.gen'
/**
* Get advanced prompt templates based on app mode and model configuration
*/
export const get = oc
.route({
description: 'Get advanced prompt templates based on app mode and model configuration',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAppPromptTemplates',
path: '/app/prompt-templates',
tags: ['console'],
})
.input(z.object({ query: zGetAppPromptTemplatesQuery }))
.output(zGetAppPromptTemplatesResponse)
export const promptTemplates = {
get,
}
export const app = {
promptTemplates,
}
export const contract = {
app,
}

View File

@ -0,0 +1,35 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type GetAppPromptTemplatesData = {
body?: never
path?: never
query: {
app_mode: string
has_context?: string
model_mode: string
model_name: string
}
url: '/app/prompt-templates'
}
export type GetAppPromptTemplatesErrors = {
400: {
[key: string]: unknown
}
}
export type GetAppPromptTemplatesError
= GetAppPromptTemplatesErrors[keyof GetAppPromptTemplatesErrors]
export type GetAppPromptTemplatesResponses = {
200: Array<{
[key: string]: unknown
}>
}
export type GetAppPromptTemplatesResponse
= GetAppPromptTemplatesResponses[keyof GetAppPromptTemplatesResponses]

View File

@ -0,0 +1,15 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
export const zGetAppPromptTemplatesQuery = z.object({
app_mode: z.string(),
has_context: z.string().optional().default('true'),
model_mode: z.string(),
model_name: z.string(),
})
/**
* Prompt templates retrieved successfully
*/
export const zGetAppPromptTemplatesResponse = z.array(z.record(z.string(), z.unknown()))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,226 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zDeleteAuthPluginDatasourceByProviderIdCustomClientPath,
zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse,
zGetAuthPluginDatasourceByProviderIdPath,
zGetAuthPluginDatasourceByProviderIdResponse,
zGetAuthPluginDatasourceDefaultListResponse,
zGetAuthPluginDatasourceListResponse,
zPostAuthPluginDatasourceByProviderIdBody,
zPostAuthPluginDatasourceByProviderIdCustomClientBody,
zPostAuthPluginDatasourceByProviderIdCustomClientPath,
zPostAuthPluginDatasourceByProviderIdCustomClientResponse,
zPostAuthPluginDatasourceByProviderIdDefaultBody,
zPostAuthPluginDatasourceByProviderIdDefaultPath,
zPostAuthPluginDatasourceByProviderIdDefaultResponse,
zPostAuthPluginDatasourceByProviderIdDeleteBody,
zPostAuthPluginDatasourceByProviderIdDeletePath,
zPostAuthPluginDatasourceByProviderIdDeleteResponse,
zPostAuthPluginDatasourceByProviderIdPath,
zPostAuthPluginDatasourceByProviderIdResponse,
zPostAuthPluginDatasourceByProviderIdUpdateBody,
zPostAuthPluginDatasourceByProviderIdUpdateNameBody,
zPostAuthPluginDatasourceByProviderIdUpdateNamePath,
zPostAuthPluginDatasourceByProviderIdUpdateNameResponse,
zPostAuthPluginDatasourceByProviderIdUpdatePath,
zPostAuthPluginDatasourceByProviderIdUpdateResponse,
} from './zod.gen'
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAuthPluginDatasourceDefaultList',
path: '/auth/plugin/datasource/default-list',
tags: ['console'],
})
.output(zGetAuthPluginDatasourceDefaultListResponse)
export const defaultList = {
get,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAuthPluginDatasourceList',
path: '/auth/plugin/datasource/list',
tags: ['console'],
})
.output(zGetAuthPluginDatasourceListResponse)
export const list = {
get: get2,
}
export const delete_ = oc
.route({
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteAuthPluginDatasourceByProviderIdCustomClient',
path: '/auth/plugin/datasource/{provider_id}/custom-client',
tags: ['console'],
})
.input(z.object({ params: zDeleteAuthPluginDatasourceByProviderIdCustomClientPath }))
.output(zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse)
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAuthPluginDatasourceByProviderIdCustomClient',
path: '/auth/plugin/datasource/{provider_id}/custom-client',
tags: ['console'],
})
.input(
z.object({
body: zPostAuthPluginDatasourceByProviderIdCustomClientBody,
params: zPostAuthPluginDatasourceByProviderIdCustomClientPath,
}),
)
.output(zPostAuthPluginDatasourceByProviderIdCustomClientResponse)
export const customClient = {
delete: delete_,
post,
}
export const post2 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAuthPluginDatasourceByProviderIdDefault',
path: '/auth/plugin/datasource/{provider_id}/default',
tags: ['console'],
})
.input(
z.object({
body: zPostAuthPluginDatasourceByProviderIdDefaultBody,
params: zPostAuthPluginDatasourceByProviderIdDefaultPath,
}),
)
.output(zPostAuthPluginDatasourceByProviderIdDefaultResponse)
export const default_ = {
post: post2,
}
export const post3 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAuthPluginDatasourceByProviderIdDelete',
path: '/auth/plugin/datasource/{provider_id}/delete',
tags: ['console'],
})
.input(
z.object({
body: zPostAuthPluginDatasourceByProviderIdDeleteBody,
params: zPostAuthPluginDatasourceByProviderIdDeletePath,
}),
)
.output(zPostAuthPluginDatasourceByProviderIdDeleteResponse)
export const delete2 = {
post: post3,
}
export const post4 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAuthPluginDatasourceByProviderIdUpdate',
path: '/auth/plugin/datasource/{provider_id}/update',
tags: ['console'],
})
.input(
z.object({
body: zPostAuthPluginDatasourceByProviderIdUpdateBody,
params: zPostAuthPluginDatasourceByProviderIdUpdatePath,
}),
)
.output(zPostAuthPluginDatasourceByProviderIdUpdateResponse)
export const update = {
post: post4,
}
export const post5 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAuthPluginDatasourceByProviderIdUpdateName',
path: '/auth/plugin/datasource/{provider_id}/update-name',
tags: ['console'],
})
.input(
z.object({
body: zPostAuthPluginDatasourceByProviderIdUpdateNameBody,
params: zPostAuthPluginDatasourceByProviderIdUpdateNamePath,
}),
)
.output(zPostAuthPluginDatasourceByProviderIdUpdateNameResponse)
export const updateName = {
post: post5,
}
export const get3 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getAuthPluginDatasourceByProviderId',
path: '/auth/plugin/datasource/{provider_id}',
tags: ['console'],
})
.input(z.object({ params: zGetAuthPluginDatasourceByProviderIdPath }))
.output(zGetAuthPluginDatasourceByProviderIdResponse)
export const post6 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postAuthPluginDatasourceByProviderId',
path: '/auth/plugin/datasource/{provider_id}',
tags: ['console'],
})
.input(
z.object({
body: zPostAuthPluginDatasourceByProviderIdBody,
params: zPostAuthPluginDatasourceByProviderIdPath,
}),
)
.output(zPostAuthPluginDatasourceByProviderIdResponse)
export const byProviderId = {
get: get3,
post: post6,
customClient,
default: default_,
delete: delete2,
update,
updateName,
}
export const datasource = {
defaultList,
list,
byProviderId,
}
export const plugin = {
datasource,
}
export const auth = {
plugin,
}
export const contract = {
auth,
}

View File

@ -0,0 +1,216 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type DatasourceCredentialPayload = {
credentials: {
[key: string]: unknown
}
name?: string | null
}
export type DatasourceCustomClientPayload = {
client_params?: {
[key: string]: unknown
} | null
enable_oauth_custom_client?: boolean | null
}
export type DatasourceDefaultPayload = {
id: string
}
export type DatasourceCredentialDeletePayload = {
credential_id: string
}
export type DatasourceCredentialUpdatePayload = {
credential_id: string
credentials?: {
[key: string]: unknown
} | null
name?: string | null
}
export type DatasourceUpdateNamePayload = {
credential_id: string
name: string
}
export type GetAuthPluginDatasourceDefaultListData = {
body?: never
path?: never
query?: never
url: '/auth/plugin/datasource/default-list'
}
export type GetAuthPluginDatasourceDefaultListResponses = {
200: {
[key: string]: unknown
}
}
export type GetAuthPluginDatasourceDefaultListResponse
= GetAuthPluginDatasourceDefaultListResponses[keyof GetAuthPluginDatasourceDefaultListResponses]
export type GetAuthPluginDatasourceListData = {
body?: never
path?: never
query?: never
url: '/auth/plugin/datasource/list'
}
export type GetAuthPluginDatasourceListResponses = {
200: {
[key: string]: unknown
}
}
export type GetAuthPluginDatasourceListResponse
= GetAuthPluginDatasourceListResponses[keyof GetAuthPluginDatasourceListResponses]
export type GetAuthPluginDatasourceByProviderIdData = {
body?: never
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}'
}
export type GetAuthPluginDatasourceByProviderIdResponses = {
200: {
[key: string]: unknown
}
}
export type GetAuthPluginDatasourceByProviderIdResponse
= GetAuthPluginDatasourceByProviderIdResponses[keyof GetAuthPluginDatasourceByProviderIdResponses]
export type PostAuthPluginDatasourceByProviderIdData = {
body: DatasourceCredentialPayload
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}'
}
export type PostAuthPluginDatasourceByProviderIdResponses = {
200: {
[key: string]: unknown
}
}
export type PostAuthPluginDatasourceByProviderIdResponse
= PostAuthPluginDatasourceByProviderIdResponses[keyof PostAuthPluginDatasourceByProviderIdResponses]
export type DeleteAuthPluginDatasourceByProviderIdCustomClientData = {
body?: never
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}/custom-client'
}
export type DeleteAuthPluginDatasourceByProviderIdCustomClientResponses = {
200: {
[key: string]: unknown
}
}
export type DeleteAuthPluginDatasourceByProviderIdCustomClientResponse
= DeleteAuthPluginDatasourceByProviderIdCustomClientResponses[keyof DeleteAuthPluginDatasourceByProviderIdCustomClientResponses]
export type PostAuthPluginDatasourceByProviderIdCustomClientData = {
body: DatasourceCustomClientPayload
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}/custom-client'
}
export type PostAuthPluginDatasourceByProviderIdCustomClientResponses = {
200: {
[key: string]: unknown
}
}
export type PostAuthPluginDatasourceByProviderIdCustomClientResponse
= PostAuthPluginDatasourceByProviderIdCustomClientResponses[keyof PostAuthPluginDatasourceByProviderIdCustomClientResponses]
export type PostAuthPluginDatasourceByProviderIdDefaultData = {
body: DatasourceDefaultPayload
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}/default'
}
export type PostAuthPluginDatasourceByProviderIdDefaultResponses = {
200: {
[key: string]: unknown
}
}
export type PostAuthPluginDatasourceByProviderIdDefaultResponse
= PostAuthPluginDatasourceByProviderIdDefaultResponses[keyof PostAuthPluginDatasourceByProviderIdDefaultResponses]
export type PostAuthPluginDatasourceByProviderIdDeleteData = {
body: DatasourceCredentialDeletePayload
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}/delete'
}
export type PostAuthPluginDatasourceByProviderIdDeleteResponses = {
200: {
[key: string]: unknown
}
}
export type PostAuthPluginDatasourceByProviderIdDeleteResponse
= PostAuthPluginDatasourceByProviderIdDeleteResponses[keyof PostAuthPluginDatasourceByProviderIdDeleteResponses]
export type PostAuthPluginDatasourceByProviderIdUpdateData = {
body: DatasourceCredentialUpdatePayload
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}/update'
}
export type PostAuthPluginDatasourceByProviderIdUpdateResponses = {
200: {
[key: string]: unknown
}
}
export type PostAuthPluginDatasourceByProviderIdUpdateResponse
= PostAuthPluginDatasourceByProviderIdUpdateResponses[keyof PostAuthPluginDatasourceByProviderIdUpdateResponses]
export type PostAuthPluginDatasourceByProviderIdUpdateNameData = {
body: DatasourceUpdateNamePayload
path: {
provider_id: string
}
query?: never
url: '/auth/plugin/datasource/{provider_id}/update-name'
}
export type PostAuthPluginDatasourceByProviderIdUpdateNameResponses = {
200: {
[key: string]: unknown
}
}
export type PostAuthPluginDatasourceByProviderIdUpdateNameResponse
= PostAuthPluginDatasourceByProviderIdUpdateNameResponses[keyof PostAuthPluginDatasourceByProviderIdUpdateNameResponses]

View File

@ -0,0 +1,156 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* DatasourceCredentialPayload
*/
export const zDatasourceCredentialPayload = z.object({
credentials: z.record(z.string(), z.unknown()),
name: z.string().max(100).nullish(),
})
/**
* DatasourceCustomClientPayload
*/
export const zDatasourceCustomClientPayload = z.object({
client_params: z.record(z.string(), z.unknown()).nullish(),
enable_oauth_custom_client: z.boolean().nullish(),
})
/**
* DatasourceDefaultPayload
*/
export const zDatasourceDefaultPayload = z.object({
id: z.string(),
})
/**
* DatasourceCredentialDeletePayload
*/
export const zDatasourceCredentialDeletePayload = z.object({
credential_id: z.string(),
})
/**
* DatasourceCredentialUpdatePayload
*/
export const zDatasourceCredentialUpdatePayload = z.object({
credential_id: z.string(),
credentials: z.record(z.string(), z.unknown()).nullish(),
name: z.string().max(100).nullish(),
})
/**
* DatasourceUpdateNamePayload
*/
export const zDatasourceUpdateNamePayload = z.object({
credential_id: z.string(),
name: z.string().max(100),
})
/**
* Success
*/
export const zGetAuthPluginDatasourceDefaultListResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetAuthPluginDatasourceListResponse = z.record(z.string(), z.unknown())
export const zGetAuthPluginDatasourceByProviderIdPath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zGetAuthPluginDatasourceByProviderIdResponse = z.record(z.string(), z.unknown())
export const zPostAuthPluginDatasourceByProviderIdBody = zDatasourceCredentialPayload
export const zPostAuthPluginDatasourceByProviderIdPath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zPostAuthPluginDatasourceByProviderIdResponse = z.record(z.string(), z.unknown())
export const zDeleteAuthPluginDatasourceByProviderIdCustomClientPath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostAuthPluginDatasourceByProviderIdCustomClientBody = zDatasourceCustomClientPayload
export const zPostAuthPluginDatasourceByProviderIdCustomClientPath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zPostAuthPluginDatasourceByProviderIdCustomClientResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostAuthPluginDatasourceByProviderIdDefaultBody = zDatasourceDefaultPayload
export const zPostAuthPluginDatasourceByProviderIdDefaultPath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zPostAuthPluginDatasourceByProviderIdDefaultResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostAuthPluginDatasourceByProviderIdDeleteBody = zDatasourceCredentialDeletePayload
export const zPostAuthPluginDatasourceByProviderIdDeletePath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zPostAuthPluginDatasourceByProviderIdDeleteResponse = z.record(z.string(), z.unknown())
export const zPostAuthPluginDatasourceByProviderIdUpdateBody = zDatasourceCredentialUpdatePayload
export const zPostAuthPluginDatasourceByProviderIdUpdatePath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zPostAuthPluginDatasourceByProviderIdUpdateResponse = z.record(z.string(), z.unknown())
export const zPostAuthPluginDatasourceByProviderIdUpdateNameBody = zDatasourceUpdateNamePayload
export const zPostAuthPluginDatasourceByProviderIdUpdateNamePath = z.object({
provider_id: z.string(),
})
/**
* Success
*/
export const zPostAuthPluginDatasourceByProviderIdUpdateNameResponse = z.record(
z.string(),
z.unknown(),
)

View File

@ -0,0 +1,82 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetBillingInvoicesResponse,
zGetBillingSubscriptionResponse,
zPutBillingPartnersByPartnerKeyTenantsBody,
zPutBillingPartnersByPartnerKeyTenantsPath,
zPutBillingPartnersByPartnerKeyTenantsResponse,
} from './zod.gen'
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getBillingInvoices',
path: '/billing/invoices',
tags: ['console'],
})
.output(zGetBillingInvoicesResponse)
export const invoices = {
get,
}
/**
* Sync partner tenants bindings
*/
export const put = oc
.route({
description: 'Sync partner tenants bindings',
inputStructure: 'detailed',
method: 'PUT',
operationId: 'putBillingPartnersByPartnerKeyTenants',
path: '/billing/partners/{partner_key}/tenants',
tags: ['console'],
})
.input(
z.object({
body: zPutBillingPartnersByPartnerKeyTenantsBody,
params: zPutBillingPartnersByPartnerKeyTenantsPath,
}),
)
.output(zPutBillingPartnersByPartnerKeyTenantsResponse)
export const tenants = {
put,
}
export const byPartnerKey = {
tenants,
}
export const partners = {
byPartnerKey,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getBillingSubscription',
path: '/billing/subscription',
tags: ['console'],
})
.output(zGetBillingSubscriptionResponse)
export const subscription = {
get: get2,
}
export const billing = {
invoices,
partners,
subscription,
}
export const contract = {
billing,
}

View File

@ -0,0 +1,68 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type PartnerTenantsPayload = {
click_id: string
}
export type GetBillingInvoicesData = {
body?: never
path?: never
query?: never
url: '/billing/invoices'
}
export type GetBillingInvoicesResponses = {
200: {
[key: string]: unknown
}
}
export type GetBillingInvoicesResponse
= GetBillingInvoicesResponses[keyof GetBillingInvoicesResponses]
export type PutBillingPartnersByPartnerKeyTenantsData = {
body: PartnerTenantsPayload
path: {
partner_key: string
}
query?: never
url: '/billing/partners/{partner_key}/tenants'
}
export type PutBillingPartnersByPartnerKeyTenantsErrors = {
400: {
[key: string]: unknown
}
}
export type PutBillingPartnersByPartnerKeyTenantsError
= PutBillingPartnersByPartnerKeyTenantsErrors[keyof PutBillingPartnersByPartnerKeyTenantsErrors]
export type PutBillingPartnersByPartnerKeyTenantsResponses = {
200: {
[key: string]: unknown
}
}
export type PutBillingPartnersByPartnerKeyTenantsResponse
= PutBillingPartnersByPartnerKeyTenantsResponses[keyof PutBillingPartnersByPartnerKeyTenantsResponses]
export type GetBillingSubscriptionData = {
body?: never
path?: never
query?: never
url: '/billing/subscription'
}
export type GetBillingSubscriptionResponses = {
200: {
[key: string]: unknown
}
}
export type GetBillingSubscriptionResponse
= GetBillingSubscriptionResponses[keyof GetBillingSubscriptionResponses]

View File

@ -0,0 +1,31 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* PartnerTenantsPayload
*/
export const zPartnerTenantsPayload = z.object({
click_id: z.string(),
})
/**
* Success
*/
export const zGetBillingInvoicesResponse = z.record(z.string(), z.unknown())
export const zPutBillingPartnersByPartnerKeyTenantsBody = zPartnerTenantsPayload
export const zPutBillingPartnersByPartnerKeyTenantsPath = z.object({
partner_key: z.string(),
})
/**
* Tenants synced to partner successfully
*/
export const zPutBillingPartnersByPartnerKeyTenantsResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetBillingSubscriptionResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,29 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import { zGetCodeBasedExtensionQuery, zGetCodeBasedExtensionResponse } from './zod.gen'
/**
* Get code-based extension data by module name
*/
export const get = oc
.route({
description: 'Get code-based extension data by module name',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getCodeBasedExtension',
path: '/code-based-extension',
tags: ['console'],
})
.input(z.object({ query: zGetCodeBasedExtensionQuery.optional() }))
.output(zGetCodeBasedExtensionResponse)
export const codeBasedExtension = {
get,
}
export const contract = {
codeBasedExtension,
}

View File

@ -0,0 +1,26 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type CodeBasedExtensionResponse = {
data: unknown
module: string
}
export type GetCodeBasedExtensionData = {
body?: never
path?: never
query?: {
module?: string
}
url: '/code-based-extension'
}
export type GetCodeBasedExtensionResponses = {
200: CodeBasedExtensionResponse
}
export type GetCodeBasedExtensionResponse
= GetCodeBasedExtensionResponses[keyof GetCodeBasedExtensionResponses]

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* CodeBasedExtensionResponse
*/
export const zCodeBasedExtensionResponse = z.object({
data: z.unknown(),
module: z.string(),
})
export const zGetCodeBasedExtensionQuery = z.object({
module: z.string().optional(),
})
/**
* Success
*/
export const zGetCodeBasedExtensionResponse = zCodeBasedExtensionResponse

View File

@ -0,0 +1,33 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import { zGetComplianceDownloadQuery, zGetComplianceDownloadResponse } from './zod.gen'
/**
* Get compliance document download link
*/
export const get = oc
.route({
description: 'Get compliance document download link',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getComplianceDownload',
path: '/compliance/download',
tags: ['console'],
})
.input(z.object({ query: zGetComplianceDownloadQuery }))
.output(zGetComplianceDownloadResponse)
export const download = {
get,
}
export const compliance = {
download,
}
export const contract = {
compliance,
}

View File

@ -0,0 +1,23 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type GetComplianceDownloadData = {
body?: never
path?: never
query: {
doc_name: string
}
url: '/compliance/download'
}
export type GetComplianceDownloadResponses = {
200: {
[key: string]: unknown
}
}
export type GetComplianceDownloadResponse
= GetComplianceDownloadResponses[keyof GetComplianceDownloadResponses]

View File

@ -0,0 +1,12 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
export const zGetComplianceDownloadQuery = z.object({
doc_name: z.string(),
})
/**
* Success
*/
export const zGetComplianceDownloadResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,78 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetDataSourceIntegratesByBindingIdByActionPath,
zGetDataSourceIntegratesByBindingIdByActionResponse,
zGetDataSourceIntegratesResponse,
zPatchDataSourceIntegratesByBindingIdByActionPath,
zPatchDataSourceIntegratesByBindingIdByActionResponse,
zPatchDataSourceIntegratesResponse,
} from './zod.gen'
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getDataSourceIntegratesByBindingIdByAction',
path: '/data-source/integrates/{binding_id}/{action}',
tags: ['console'],
})
.input(z.object({ params: zGetDataSourceIntegratesByBindingIdByActionPath }))
.output(zGetDataSourceIntegratesByBindingIdByActionResponse)
export const patch = oc
.route({
inputStructure: 'detailed',
method: 'PATCH',
operationId: 'patchDataSourceIntegratesByBindingIdByAction',
path: '/data-source/integrates/{binding_id}/{action}',
tags: ['console'],
})
.input(z.object({ params: zPatchDataSourceIntegratesByBindingIdByActionPath }))
.output(zPatchDataSourceIntegratesByBindingIdByActionResponse)
export const byAction = {
get,
patch,
}
export const byBindingId = {
byAction,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getDataSourceIntegrates',
path: '/data-source/integrates',
tags: ['console'],
})
.output(zGetDataSourceIntegratesResponse)
export const patch2 = oc
.route({
inputStructure: 'detailed',
method: 'PATCH',
operationId: 'patchDataSourceIntegrates',
path: '/data-source/integrates',
tags: ['console'],
})
.output(zPatchDataSourceIntegratesResponse)
export const integrates = {
get: get2,
patch: patch2,
byBindingId,
}
export const dataSource = {
integrates,
}
export const contract = {
dataSource,
}

View File

@ -0,0 +1,75 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type GetDataSourceIntegratesData = {
body?: never
path?: never
query?: never
url: '/data-source/integrates'
}
export type GetDataSourceIntegratesResponses = {
200: {
[key: string]: unknown
}
}
export type GetDataSourceIntegratesResponse
= GetDataSourceIntegratesResponses[keyof GetDataSourceIntegratesResponses]
export type PatchDataSourceIntegratesData = {
body?: never
path?: never
query?: never
url: '/data-source/integrates'
}
export type PatchDataSourceIntegratesResponses = {
200: {
[key: string]: unknown
}
}
export type PatchDataSourceIntegratesResponse
= PatchDataSourceIntegratesResponses[keyof PatchDataSourceIntegratesResponses]
export type GetDataSourceIntegratesByBindingIdByActionData = {
body?: never
path: {
binding_id: string
action: string
}
query?: never
url: '/data-source/integrates/{binding_id}/{action}'
}
export type GetDataSourceIntegratesByBindingIdByActionResponses = {
200: {
[key: string]: unknown
}
}
export type GetDataSourceIntegratesByBindingIdByActionResponse
= GetDataSourceIntegratesByBindingIdByActionResponses[keyof GetDataSourceIntegratesByBindingIdByActionResponses]
export type PatchDataSourceIntegratesByBindingIdByActionData = {
body?: never
path: {
binding_id: string
action: string
}
query?: never
url: '/data-source/integrates/{binding_id}/{action}'
}
export type PatchDataSourceIntegratesByBindingIdByActionResponses = {
200: {
[key: string]: unknown
}
}
export type PatchDataSourceIntegratesByBindingIdByActionResponse
= PatchDataSourceIntegratesByBindingIdByActionResponses[keyof PatchDataSourceIntegratesByBindingIdByActionResponses]

View File

@ -0,0 +1,36 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* Success
*/
export const zGetDataSourceIntegratesResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zPatchDataSourceIntegratesResponse = z.record(z.string(), z.unknown())
export const zGetDataSourceIntegratesByBindingIdByActionPath = z.object({
binding_id: z.string(),
action: z.string(),
})
/**
* Success
*/
export const zGetDataSourceIntegratesByBindingIdByActionResponse = z.record(z.string(), z.unknown())
export const zPatchDataSourceIntegratesByBindingIdByActionPath = z.object({
binding_id: z.string(),
action: z.string(),
})
/**
* Success
*/
export const zPatchDataSourceIntegratesByBindingIdByActionResponse = z.record(
z.string(),
z.unknown(),
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zPostEmailCodeLoginBody,
zPostEmailCodeLoginResponse,
zPostEmailCodeLoginValidityBody,
zPostEmailCodeLoginValidityResponse,
} from './zod.gen'
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postEmailCodeLoginValidity',
path: '/email-code-login/validity',
tags: ['console'],
})
.input(z.object({ body: zPostEmailCodeLoginValidityBody }))
.output(zPostEmailCodeLoginValidityResponse)
export const validity = {
post,
}
export const post2 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postEmailCodeLogin',
path: '/email-code-login',
tags: ['console'],
})
.input(z.object({ body: zPostEmailCodeLoginBody }))
.output(zPostEmailCodeLoginResponse)
export const emailCodeLogin = {
post: post2,
validity,
}
export const contract = {
emailCodeLogin,
}

View File

@ -0,0 +1,49 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type EmailPayload = {
email: string
language?: string | null
}
export type EmailCodeLoginPayload = {
code: string
email: string
language?: string | null
token: string
}
export type PostEmailCodeLoginData = {
body: EmailPayload
path?: never
query?: never
url: '/email-code-login'
}
export type PostEmailCodeLoginResponses = {
200: {
[key: string]: unknown
}
}
export type PostEmailCodeLoginResponse
= PostEmailCodeLoginResponses[keyof PostEmailCodeLoginResponses]
export type PostEmailCodeLoginValidityData = {
body: EmailCodeLoginPayload
path?: never
query?: never
url: '/email-code-login/validity'
}
export type PostEmailCodeLoginValidityResponses = {
200: {
[key: string]: unknown
}
}
export type PostEmailCodeLoginValidityResponse
= PostEmailCodeLoginValidityResponses[keyof PostEmailCodeLoginValidityResponses]

View File

@ -0,0 +1,35 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* EmailPayload
*/
export const zEmailPayload = z.object({
email: z.string(),
language: z.string().nullish(),
})
/**
* EmailCodeLoginPayload
*/
export const zEmailCodeLoginPayload = z.object({
code: z.string(),
email: z.string(),
language: z.string().nullish(),
token: z.string(),
})
export const zPostEmailCodeLoginBody = zEmailPayload
/**
* Success
*/
export const zPostEmailCodeLoginResponse = z.record(z.string(), z.unknown())
export const zPostEmailCodeLoginValidityBody = zEmailCodeLoginPayload
/**
* Success
*/
export const zPostEmailCodeLoginValidityResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,57 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import {
zPostEmailRegisterResponse,
zPostEmailRegisterSendEmailResponse,
zPostEmailRegisterValidityResponse,
} from './zod.gen'
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postEmailRegisterSendEmail',
path: '/email-register/send-email',
tags: ['console'],
})
.output(zPostEmailRegisterSendEmailResponse)
export const sendEmail = {
post,
}
export const post2 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postEmailRegisterValidity',
path: '/email-register/validity',
tags: ['console'],
})
.output(zPostEmailRegisterValidityResponse)
export const validity = {
post: post2,
}
export const post3 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postEmailRegister',
path: '/email-register',
tags: ['console'],
})
.output(zPostEmailRegisterResponse)
export const emailRegister = {
post: post3,
sendEmail,
validity,
}
export const contract = {
emailRegister,
}

View File

@ -0,0 +1,52 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type PostEmailRegisterData = {
body?: never
path?: never
query?: never
url: '/email-register'
}
export type PostEmailRegisterResponses = {
200: {
[key: string]: unknown
}
}
export type PostEmailRegisterResponse = PostEmailRegisterResponses[keyof PostEmailRegisterResponses]
export type PostEmailRegisterSendEmailData = {
body?: never
path?: never
query?: never
url: '/email-register/send-email'
}
export type PostEmailRegisterSendEmailResponses = {
200: {
[key: string]: unknown
}
}
export type PostEmailRegisterSendEmailResponse
= PostEmailRegisterSendEmailResponses[keyof PostEmailRegisterSendEmailResponses]
export type PostEmailRegisterValidityData = {
body?: never
path?: never
query?: never
url: '/email-register/validity'
}
export type PostEmailRegisterValidityResponses = {
200: {
[key: string]: unknown
}
}
export type PostEmailRegisterValidityResponse
= PostEmailRegisterValidityResponses[keyof PostEmailRegisterValidityResponses]

View File

@ -0,0 +1,18 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* Success
*/
export const zPostEmailRegisterResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zPostEmailRegisterSendEmailResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zPostEmailRegisterValidityResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,70 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetExploreAppsByAppIdPath,
zGetExploreAppsByAppIdResponse,
zGetExploreAppsQuery,
zGetExploreAppsResponse,
zGetExploreBannersResponse,
} from './zod.gen'
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getExploreAppsByAppId',
path: '/explore/apps/{app_id}',
tags: ['console'],
})
.input(z.object({ params: zGetExploreAppsByAppIdPath }))
.output(zGetExploreAppsByAppIdResponse)
export const byAppId = {
get,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getExploreApps',
path: '/explore/apps',
tags: ['console'],
})
.input(z.object({ query: zGetExploreAppsQuery.optional() }))
.output(zGetExploreAppsResponse)
export const apps = {
get: get2,
byAppId,
}
/**
* Get banner list
*/
export const get3 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getExploreBanners',
path: '/explore/banners',
summary: 'Get banner list',
tags: ['default'],
})
.output(zGetExploreBannersResponse)
export const banners = {
get: get3,
}
export const explore = {
apps,
banners,
}
export const contract = {
explore,
}

View File

@ -0,0 +1,80 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type RecommendedAppListResponse = {
categories: Array<string>
recommended_apps: Array<RecommendedAppResponse>
}
export type RecommendedAppResponse = {
app?: RecommendedAppInfoResponse
app_id: string
can_trial?: boolean | null
category?: string | null
copyright?: string | null
custom_disclaimer?: string | null
description?: string | null
is_listed?: boolean | null
position?: number | null
privacy_policy?: string | null
}
export type RecommendedAppInfoResponse = {
icon?: string | null
icon_background?: string | null
icon_type?: string | null
id: string
mode?: string | null
name?: string | null
}
export type GetExploreAppsData = {
body?: never
path?: never
query?: {
language?: string | null
}
url: '/explore/apps'
}
export type GetExploreAppsResponses = {
200: RecommendedAppListResponse
}
export type GetExploreAppsResponse = GetExploreAppsResponses[keyof GetExploreAppsResponses]
export type GetExploreAppsByAppIdData = {
body?: never
path: {
app_id: string
}
query?: never
url: '/explore/apps/{app_id}'
}
export type GetExploreAppsByAppIdResponses = {
200: {
[key: string]: unknown
}
}
export type GetExploreAppsByAppIdResponse
= GetExploreAppsByAppIdResponses[keyof GetExploreAppsByAppIdResponses]
export type GetExploreBannersData = {
body?: never
path?: never
query?: never
url: '/explore/banners'
}
export type GetExploreBannersResponses = {
200: {
[key: string]: unknown
}
}
export type GetExploreBannersResponse = GetExploreBannersResponses[keyof GetExploreBannersResponses]

View File

@ -0,0 +1,62 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* RecommendedAppInfoResponse
*/
export const zRecommendedAppInfoResponse = z.object({
icon: z.string().nullish(),
icon_background: z.string().nullish(),
icon_type: z.string().nullish(),
id: z.string(),
mode: z.string().nullish(),
name: z.string().nullish(),
})
/**
* RecommendedAppResponse
*/
export const zRecommendedAppResponse = z.object({
app: zRecommendedAppInfoResponse.optional(),
app_id: z.string(),
can_trial: z.boolean().nullish(),
category: z.string().nullish(),
copyright: z.string().nullish(),
custom_disclaimer: z.string().nullish(),
description: z.string().nullish(),
is_listed: z.boolean().nullish(),
position: z.int().nullish(),
privacy_policy: z.string().nullish(),
})
/**
* RecommendedAppListResponse
*/
export const zRecommendedAppListResponse = z.object({
categories: z.array(z.string()),
recommended_apps: z.array(zRecommendedAppResponse),
})
export const zGetExploreAppsQuery = z.object({
language: z.string().nullish(),
})
/**
* Success
*/
export const zGetExploreAppsResponse = zRecommendedAppListResponse
export const zGetExploreAppsByAppIdPath = z.object({
app_id: z.string(),
})
/**
* Success
*/
export const zGetExploreAppsByAppIdResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetExploreBannersResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,30 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import { zGetFeaturesResponse } from './zod.gen'
/**
* Get feature configuration for current tenant
*
* Get feature configuration for current tenant
*/
export const get = oc
.route({
description: 'Get feature configuration for current tenant',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getFeatures',
path: '/features',
summary: 'Get feature configuration for current tenant',
tags: ['console'],
})
.output(zGetFeaturesResponse)
export const features = {
get,
}
export const contract = {
features,
}

View File

@ -0,0 +1,22 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type FeatureResponse = {
[key: string]: unknown
}
export type GetFeaturesData = {
body?: never
path?: never
query?: never
url: '/features'
}
export type GetFeaturesResponses = {
200: FeatureResponse
}
export type GetFeaturesResponse = GetFeaturesResponses[keyof GetFeaturesResponses]

View File

@ -0,0 +1,10 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
export const zFeatureResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetFeaturesResponse = zFeatureResponse

View File

@ -0,0 +1,81 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetFilesByFileIdPreviewPath,
zGetFilesByFileIdPreviewResponse,
zGetFilesSupportTypeResponse,
zGetFilesUploadResponse,
zPostFilesUploadResponse,
} from './zod.gen'
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getFilesSupportType',
path: '/files/support-type',
tags: ['console'],
})
.output(zGetFilesSupportTypeResponse)
export const supportType = {
get,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getFilesUpload',
path: '/files/upload',
tags: ['console'],
})
.output(zGetFilesUploadResponse)
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postFilesUpload',
path: '/files/upload',
successStatus: 201,
tags: ['console'],
})
.output(zPostFilesUploadResponse)
export const upload = {
get: get2,
post,
}
export const get3 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getFilesByFileIdPreview',
path: '/files/{file_id}/preview',
tags: ['console'],
})
.input(z.object({ params: zGetFilesByFileIdPreviewPath }))
.output(zGetFilesByFileIdPreviewResponse)
export const preview = {
get: get3,
}
export const byFileId = {
preview,
}
export const files = {
supportType,
upload,
byFileId,
}
export const contract = {
files,
}

View File

@ -0,0 +1,95 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type UploadConfig = {
attachment_image_file_size_limit?: number | null
audio_file_size_limit: number
batch_count_limit: number
file_size_limit: number
file_upload_limit?: number | null
image_file_batch_limit: number
image_file_size_limit: number
single_chunk_attachment_limit: number
video_file_size_limit: number
workflow_file_upload_limit: number
}
export type FileResponse = {
conversation_id?: string | null
created_at?: number | null
created_by?: string | null
extension?: string | null
file_key?: string | null
id: string
mime_type?: string | null
name: string
original_url?: string | null
preview_url?: string | null
size: number
source_url?: string | null
tenant_id?: string | null
user_id?: string | null
}
export type GetFilesSupportTypeData = {
body?: never
path?: never
query?: never
url: '/files/support-type'
}
export type GetFilesSupportTypeResponses = {
200: {
[key: string]: unknown
}
}
export type GetFilesSupportTypeResponse
= GetFilesSupportTypeResponses[keyof GetFilesSupportTypeResponses]
export type GetFilesUploadData = {
body?: never
path?: never
query?: never
url: '/files/upload'
}
export type GetFilesUploadResponses = {
200: UploadConfig
}
export type GetFilesUploadResponse = GetFilesUploadResponses[keyof GetFilesUploadResponses]
export type PostFilesUploadData = {
body?: never
path?: never
query?: never
url: '/files/upload'
}
export type PostFilesUploadResponses = {
201: FileResponse
}
export type PostFilesUploadResponse = PostFilesUploadResponses[keyof PostFilesUploadResponses]
export type GetFilesByFileIdPreviewData = {
body?: never
path: {
file_id: string
}
query?: never
url: '/files/{file_id}/preview'
}
export type GetFilesByFileIdPreviewResponses = {
200: {
[key: string]: unknown
}
}
export type GetFilesByFileIdPreviewResponse
= GetFilesByFileIdPreviewResponses[keyof GetFilesByFileIdPreviewResponses]

View File

@ -0,0 +1,63 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* UploadConfig
*/
export const zUploadConfig = z.object({
attachment_image_file_size_limit: z.int().nullish(),
audio_file_size_limit: z.int(),
batch_count_limit: z.int(),
file_size_limit: z.int(),
file_upload_limit: z.int().nullish(),
image_file_batch_limit: z.int(),
image_file_size_limit: z.int(),
single_chunk_attachment_limit: z.int(),
video_file_size_limit: z.int(),
workflow_file_upload_limit: z.int(),
})
/**
* FileResponse
*/
export const zFileResponse = z.object({
conversation_id: z.string().nullish(),
created_at: z.int().nullish(),
created_by: z.string().nullish(),
extension: z.string().nullish(),
file_key: z.string().nullish(),
id: z.string(),
mime_type: z.string().nullish(),
name: z.string(),
original_url: z.string().nullish(),
preview_url: z.string().nullish(),
size: z.int(),
source_url: z.string().nullish(),
tenant_id: z.string().nullish(),
user_id: z.string().nullish(),
})
/**
* Success
*/
export const zGetFilesSupportTypeResponse = z.record(z.string(), z.unknown())
/**
* Success
*/
export const zGetFilesUploadResponse = zUploadConfig
/**
* File uploaded successfully
*/
export const zPostFilesUploadResponse = zFileResponse
export const zGetFilesByFileIdPreviewPath = z.object({
file_id: z.string(),
})
/**
* Success
*/
export const zGetFilesByFileIdPreviewResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,76 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zPostForgotPasswordBody,
zPostForgotPasswordResetsBody,
zPostForgotPasswordResetsResponse,
zPostForgotPasswordResponse,
zPostForgotPasswordValidityBody,
zPostForgotPasswordValidityResponse,
} from './zod.gen'
/**
* Reset password with verification token
*/
export const post = oc
.route({
description: 'Reset password with verification token',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postForgotPasswordResets',
path: '/forgot-password/resets',
tags: ['console'],
})
.input(z.object({ body: zPostForgotPasswordResetsBody }))
.output(zPostForgotPasswordResetsResponse)
export const resets = {
post,
}
/**
* Verify password reset code
*/
export const post2 = oc
.route({
description: 'Verify password reset code',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postForgotPasswordValidity',
path: '/forgot-password/validity',
tags: ['console'],
})
.input(z.object({ body: zPostForgotPasswordValidityBody }))
.output(zPostForgotPasswordValidityResponse)
export const validity = {
post: post2,
}
/**
* Send password reset email
*/
export const post3 = oc
.route({
description: 'Send password reset email',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postForgotPassword',
path: '/forgot-password',
tags: ['console'],
})
.input(z.object({ body: zPostForgotPasswordBody }))
.output(zPostForgotPasswordResponse)
export const forgotPassword = {
post: post3,
resets,
validity,
}
export const contract = {
forgotPassword,
}

View File

@ -0,0 +1,106 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type ForgotPasswordSendPayload = {
email: string
language?: string | null
}
export type ForgotPasswordEmailResponse = {
code?: string | null
data?: string | null
result: string
}
export type ForgotPasswordResetPayload = {
new_password: string
password_confirm: string
token: string
}
export type ForgotPasswordResetResponse = {
result: string
}
export type ForgotPasswordCheckPayload = {
code: string
email: string
token: string
}
export type ForgotPasswordCheckResponse = {
email: string
is_valid: boolean
token: string
}
export type PostForgotPasswordData = {
body: ForgotPasswordSendPayload
path?: never
query?: never
url: '/forgot-password'
}
export type PostForgotPasswordErrors = {
400: {
[key: string]: unknown
}
}
export type PostForgotPasswordError = PostForgotPasswordErrors[keyof PostForgotPasswordErrors]
export type PostForgotPasswordResponses = {
200: ForgotPasswordEmailResponse
}
export type PostForgotPasswordResponse
= PostForgotPasswordResponses[keyof PostForgotPasswordResponses]
export type PostForgotPasswordResetsData = {
body: ForgotPasswordResetPayload
path?: never
query?: never
url: '/forgot-password/resets'
}
export type PostForgotPasswordResetsErrors = {
400: {
[key: string]: unknown
}
}
export type PostForgotPasswordResetsError
= PostForgotPasswordResetsErrors[keyof PostForgotPasswordResetsErrors]
export type PostForgotPasswordResetsResponses = {
200: ForgotPasswordResetResponse
}
export type PostForgotPasswordResetsResponse
= PostForgotPasswordResetsResponses[keyof PostForgotPasswordResetsResponses]
export type PostForgotPasswordValidityData = {
body: ForgotPasswordCheckPayload
path?: never
query?: never
url: '/forgot-password/validity'
}
export type PostForgotPasswordValidityErrors = {
400: {
[key: string]: unknown
}
}
export type PostForgotPasswordValidityError
= PostForgotPasswordValidityErrors[keyof PostForgotPasswordValidityErrors]
export type PostForgotPasswordValidityResponses = {
200: ForgotPasswordCheckResponse
}
export type PostForgotPasswordValidityResponse
= PostForgotPasswordValidityResponses[keyof PostForgotPasswordValidityResponses]

View File

@ -0,0 +1,75 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* ForgotPasswordSendPayload
*/
export const zForgotPasswordSendPayload = z.object({
email: z.string(),
language: z.string().nullish(),
})
/**
* ForgotPasswordEmailResponse
*/
export const zForgotPasswordEmailResponse = z.object({
code: z.string().nullish(),
data: z.string().nullish(),
result: z.string(),
})
/**
* ForgotPasswordResetPayload
*/
export const zForgotPasswordResetPayload = z.object({
new_password: z.string(),
password_confirm: z.string(),
token: z.string().min(1),
})
/**
* ForgotPasswordResetResponse
*/
export const zForgotPasswordResetResponse = z.object({
result: z.string(),
})
/**
* ForgotPasswordCheckPayload
*/
export const zForgotPasswordCheckPayload = z.object({
code: z.string(),
email: z.string(),
token: z.string().min(1),
})
/**
* ForgotPasswordCheckResponse
*/
export const zForgotPasswordCheckResponse = z.object({
email: z.string(),
is_valid: z.boolean(),
token: z.string(),
})
export const zPostForgotPasswordBody = zForgotPasswordSendPayload
/**
* Email sent successfully
*/
export const zPostForgotPasswordResponse = zForgotPasswordEmailResponse
export const zPostForgotPasswordResetsBody = zForgotPasswordResetPayload
/**
* Password reset successfully
*/
export const zPostForgotPasswordResetsResponse = zForgotPasswordResetResponse
export const zPostForgotPasswordValidityBody = zForgotPasswordCheckPayload
/**
* Code verified successfully
*/
export const zPostForgotPasswordValidityResponse = zForgotPasswordCheckResponse

View File

@ -0,0 +1,73 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetFormHumanInputByFormTokenPath,
zGetFormHumanInputByFormTokenResponse,
zPostFormHumanInputByFormTokenPath,
zPostFormHumanInputByFormTokenResponse,
} from './zod.gen'
/**
* Get human input form definition by form token
*
* GET /console/api/form/human_input/<form_token>
*/
export const get = oc
.route({
description: 'GET /console/api/form/human_input/<form_token>',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getFormHumanInputByFormToken',
path: '/form/human_input/{form_token}',
summary: 'Get human input form definition by form token',
tags: ['console'],
})
.input(z.object({ params: zGetFormHumanInputByFormTokenPath }))
.output(zGetFormHumanInputByFormTokenResponse)
/**
* Submit human input form by form token
*
* POST /console/api/form/human_input/<form_token>
*
* Request body:
* {
* "inputs": {
* "content": "User input content"
* },
* "action": "Approve"
* }
*/
export const post = oc
.route({
description:
'POST /console/api/form/human_input/<form_token>\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postFormHumanInputByFormToken',
path: '/form/human_input/{form_token}',
summary: 'Submit human input form by form token',
tags: ['console'],
})
.input(z.object({ params: zPostFormHumanInputByFormTokenPath }))
.output(zPostFormHumanInputByFormTokenResponse)
export const byFormToken = {
get,
post,
}
export const humanInput = {
byFormToken,
}
export const form = {
humanInput,
}
export const contract = {
form,
}

View File

@ -0,0 +1,41 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type GetFormHumanInputByFormTokenData = {
body?: never
path: {
form_token: string
}
query?: never
url: '/form/human_input/{form_token}'
}
export type GetFormHumanInputByFormTokenResponses = {
200: {
[key: string]: unknown
}
}
export type GetFormHumanInputByFormTokenResponse
= GetFormHumanInputByFormTokenResponses[keyof GetFormHumanInputByFormTokenResponses]
export type PostFormHumanInputByFormTokenData = {
body?: never
path: {
form_token: string
}
query?: never
url: '/form/human_input/{form_token}'
}
export type PostFormHumanInputByFormTokenResponses = {
200: {
[key: string]: unknown
}
}
export type PostFormHumanInputByFormTokenResponse
= PostFormHumanInputByFormTokenResponses[keyof PostFormHumanInputByFormTokenResponses]

View File

@ -0,0 +1,21 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
export const zGetFormHumanInputByFormTokenPath = z.object({
form_token: z.string(),
})
/**
* Success
*/
export const zGetFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown())
export const zPostFormHumanInputByFormTokenPath = z.object({
form_token: z.string(),
})
/**
* Success
*/
export const zPostFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,23 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import { zPostInfoResponse } from './zod.gen'
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInfo',
path: '/info',
tags: ['console'],
})
.output(zPostInfoResponse)
export const info = {
post,
}
export const contract = {
info,
}

View File

@ -0,0 +1,35 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type TenantInfoResponse = {
created_at?: number | null
custom_config?: {
[key: string]: unknown
} | null
id: string
in_trial?: boolean | null
name?: string | null
next_credit_reset_date?: number | null
plan?: string | null
role?: string | null
status?: string | null
trial_credits?: number | null
trial_credits_used?: number | null
trial_end_reason?: string | null
}
export type PostInfoData = {
body?: never
path?: never
query?: never
url: '/info'
}
export type PostInfoResponses = {
200: TenantInfoResponse
}
export type PostInfoResponse = PostInfoResponses[keyof PostInfoResponses]

View File

@ -0,0 +1,26 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* TenantInfoResponse
*/
export const zTenantInfoResponse = z.object({
created_at: z.int().nullish(),
custom_config: z.record(z.string(), z.unknown()).nullish(),
id: z.string(),
in_trial: z.boolean().nullish(),
name: z.string().nullish(),
next_credit_reset_date: z.int().nullish(),
plan: z.string().nullish(),
role: z.string().nullish(),
status: z.string().nullish(),
trial_credits: z.int().nullish(),
trial_credits_used: z.int().nullish(),
trial_end_reason: z.string().nullish(),
})
/**
* Success
*/
export const zPostInfoResponse = zTenantInfoResponse

View File

@ -0,0 +1,572 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath,
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse,
zDeleteInstalledAppsByInstalledAppIdPath,
zDeleteInstalledAppsByInstalledAppIdResponse,
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath,
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse,
zGetInstalledAppsByInstalledAppIdConversationsPath,
zGetInstalledAppsByInstalledAppIdConversationsQuery,
zGetInstalledAppsByInstalledAppIdConversationsResponse,
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath,
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery,
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse,
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath,
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse,
zGetInstalledAppsByInstalledAppIdMessagesPath,
zGetInstalledAppsByInstalledAppIdMessagesQuery,
zGetInstalledAppsByInstalledAppIdMessagesResponse,
zGetInstalledAppsByInstalledAppIdMetaPath,
zGetInstalledAppsByInstalledAppIdMetaResponse,
zGetInstalledAppsByInstalledAppIdParametersPath,
zGetInstalledAppsByInstalledAppIdParametersResponse,
zGetInstalledAppsByInstalledAppIdSavedMessagesPath,
zGetInstalledAppsByInstalledAppIdSavedMessagesQuery,
zGetInstalledAppsByInstalledAppIdSavedMessagesResponse,
zGetInstalledAppsResponse,
zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath,
zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse,
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath,
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse,
zPatchInstalledAppsByInstalledAppIdPath,
zPatchInstalledAppsByInstalledAppIdResponse,
zPostInstalledAppsByInstalledAppIdAudioToTextPath,
zPostInstalledAppsByInstalledAppIdAudioToTextResponse,
zPostInstalledAppsByInstalledAppIdChatMessagesBody,
zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath,
zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse,
zPostInstalledAppsByInstalledAppIdChatMessagesPath,
zPostInstalledAppsByInstalledAppIdChatMessagesResponse,
zPostInstalledAppsByInstalledAppIdCompletionMessagesBody,
zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath,
zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse,
zPostInstalledAppsByInstalledAppIdCompletionMessagesPath,
zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse,
zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody,
zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath,
zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse,
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody,
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath,
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse,
zPostInstalledAppsByInstalledAppIdSavedMessagesBody,
zPostInstalledAppsByInstalledAppIdSavedMessagesPath,
zPostInstalledAppsByInstalledAppIdSavedMessagesResponse,
zPostInstalledAppsByInstalledAppIdTextToAudioBody,
zPostInstalledAppsByInstalledAppIdTextToAudioPath,
zPostInstalledAppsByInstalledAppIdTextToAudioResponse,
zPostInstalledAppsByInstalledAppIdWorkflowsRunBody,
zPostInstalledAppsByInstalledAppIdWorkflowsRunPath,
zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse,
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath,
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse,
zPostInstalledAppsResponse,
} from './zod.gen'
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdAudioToText',
path: '/installed-apps/{installed_app_id}/audio-to-text',
tags: ['console'],
})
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdAudioToTextPath }))
.output(zPostInstalledAppsByInstalledAppIdAudioToTextResponse)
export const audioToText = {
post,
}
export const post2 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdChatMessagesByTaskIdStop',
path: '/installed-apps/{installed_app_id}/chat-messages/{task_id}/stop',
tags: ['console'],
})
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath }))
.output(zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse)
export const stop = {
post: post2,
}
export const byTaskId = {
stop,
}
export const post3 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdChatMessages',
path: '/installed-apps/{installed_app_id}/chat-messages',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdChatMessagesBody,
params: zPostInstalledAppsByInstalledAppIdChatMessagesPath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdChatMessagesResponse)
export const chatMessages = {
post: post3,
byTaskId,
}
export const post4 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStop',
path: '/installed-apps/{installed_app_id}/completion-messages/{task_id}/stop',
tags: ['console'],
})
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath }))
.output(zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse)
export const stop2 = {
post: post4,
}
export const byTaskId2 = {
stop: stop2,
}
export const post5 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdCompletionMessages',
path: '/installed-apps/{installed_app_id}/completion-messages',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdCompletionMessagesBody,
params: zPostInstalledAppsByInstalledAppIdCompletionMessagesPath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse)
export const completionMessages = {
post: post5,
byTaskId: byTaskId2,
}
export const post6 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdConversationsByCIdName',
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/name',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody,
params: zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse)
export const name = {
post: post6,
}
export const patch = oc
.route({
inputStructure: 'detailed',
method: 'PATCH',
operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdPin',
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/pin',
tags: ['console'],
})
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath }))
.output(zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse)
export const pin = {
patch,
}
export const patch2 = oc
.route({
inputStructure: 'detailed',
method: 'PATCH',
operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdUnpin',
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/unpin',
tags: ['console'],
})
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath }))
.output(zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse)
export const unpin = {
patch: patch2,
}
export const delete_ = oc
.route({
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteInstalledAppsByInstalledAppIdConversationsByCId',
path: '/installed-apps/{installed_app_id}/conversations/{c_id}',
tags: ['console'],
})
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath }))
.output(zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse)
export const byCId = {
delete: delete_,
name,
pin,
unpin,
}
export const get = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdConversations',
path: '/installed-apps/{installed_app_id}/conversations',
tags: ['console'],
})
.input(
z.object({
params: zGetInstalledAppsByInstalledAppIdConversationsPath,
query: zGetInstalledAppsByInstalledAppIdConversationsQuery.optional(),
}),
)
.output(zGetInstalledAppsByInstalledAppIdConversationsResponse)
export const conversations = {
get,
byCId,
}
export const post7 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacks',
path: '/installed-apps/{installed_app_id}/messages/{message_id}/feedbacks',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody,
params: zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse)
export const feedbacks = {
post: post7,
}
export const get2 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThis',
path: '/installed-apps/{installed_app_id}/messages/{message_id}/more-like-this',
tags: ['console'],
})
.input(
z.object({
params: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath,
query: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery,
}),
)
.output(zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse)
export const moreLikeThis = {
get: get2,
}
export const get3 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestions',
path: '/installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions',
tags: ['console'],
})
.input(
z.object({
params: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath,
}),
)
.output(zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse)
export const suggestedQuestions = {
get: get3,
}
export const byMessageId = {
feedbacks,
moreLikeThis,
suggestedQuestions,
}
export const get4 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdMessages',
path: '/installed-apps/{installed_app_id}/messages',
tags: ['console'],
})
.input(
z.object({
params: zGetInstalledAppsByInstalledAppIdMessagesPath,
query: zGetInstalledAppsByInstalledAppIdMessagesQuery,
}),
)
.output(zGetInstalledAppsByInstalledAppIdMessagesResponse)
export const messages = {
get: get4,
byMessageId,
}
/**
* Get app meta
*/
export const get5 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdMeta',
path: '/installed-apps/{installed_app_id}/meta',
summary: 'Get app meta',
tags: ['console'],
})
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdMetaPath }))
.output(zGetInstalledAppsByInstalledAppIdMetaResponse)
export const meta = {
get: get5,
}
/**
* Retrieve app parameters
*/
export const get6 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdParameters',
path: '/installed-apps/{installed_app_id}/parameters',
summary: 'Retrieve app parameters',
tags: ['console'],
})
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdParametersPath }))
.output(zGetInstalledAppsByInstalledAppIdParametersResponse)
export const parameters = {
get: get6,
}
export const delete2 = oc
.route({
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteInstalledAppsByInstalledAppIdSavedMessagesByMessageId',
path: '/installed-apps/{installed_app_id}/saved-messages/{message_id}',
tags: ['console'],
})
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath }))
.output(zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse)
export const byMessageId2 = {
delete: delete2,
}
export const get7 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledAppsByInstalledAppIdSavedMessages',
path: '/installed-apps/{installed_app_id}/saved-messages',
tags: ['console'],
})
.input(
z.object({
params: zGetInstalledAppsByInstalledAppIdSavedMessagesPath,
query: zGetInstalledAppsByInstalledAppIdSavedMessagesQuery.optional(),
}),
)
.output(zGetInstalledAppsByInstalledAppIdSavedMessagesResponse)
export const post8 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdSavedMessages',
path: '/installed-apps/{installed_app_id}/saved-messages',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdSavedMessagesBody,
params: zPostInstalledAppsByInstalledAppIdSavedMessagesPath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdSavedMessagesResponse)
export const savedMessages = {
get: get7,
post: post8,
byMessageId: byMessageId2,
}
export const post9 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdTextToAudio',
path: '/installed-apps/{installed_app_id}/text-to-audio',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdTextToAudioBody,
params: zPostInstalledAppsByInstalledAppIdTextToAudioPath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdTextToAudioResponse)
export const textToAudio = {
post: post9,
}
/**
* Run workflow
*/
export const post10 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdWorkflowsRun',
path: '/installed-apps/{installed_app_id}/workflows/run',
summary: 'Run workflow',
tags: ['console'],
})
.input(
z.object({
body: zPostInstalledAppsByInstalledAppIdWorkflowsRunBody,
params: zPostInstalledAppsByInstalledAppIdWorkflowsRunPath,
}),
)
.output(zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse)
export const run = {
post: post10,
}
/**
* Stop workflow task
*/
export const post11 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStop',
path: '/installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop',
summary: 'Stop workflow task',
tags: ['console'],
})
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath }))
.output(zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse)
export const stop3 = {
post: post11,
}
export const byTaskId3 = {
stop: stop3,
}
export const tasks = {
byTaskId: byTaskId3,
}
export const workflows = {
run,
tasks,
}
export const delete3 = oc
.route({
inputStructure: 'detailed',
method: 'DELETE',
operationId: 'deleteInstalledAppsByInstalledAppId',
path: '/installed-apps/{installed_app_id}',
tags: ['console'],
})
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdPath }))
.output(zDeleteInstalledAppsByInstalledAppIdResponse)
export const patch3 = oc
.route({
inputStructure: 'detailed',
method: 'PATCH',
operationId: 'patchInstalledAppsByInstalledAppId',
path: '/installed-apps/{installed_app_id}',
tags: ['console'],
})
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdPath }))
.output(zPatchInstalledAppsByInstalledAppIdResponse)
export const byInstalledAppId = {
delete: delete3,
patch: patch3,
audioToText,
chatMessages,
completionMessages,
conversations,
messages,
meta,
parameters,
savedMessages,
textToAudio,
workflows,
}
export const get8 = oc
.route({
inputStructure: 'detailed',
method: 'GET',
operationId: 'getInstalledApps',
path: '/installed-apps',
tags: ['console'],
})
.output(zGetInstalledAppsResponse)
export const post12 = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstalledApps',
path: '/installed-apps',
tags: ['console'],
})
.output(zPostInstalledAppsResponse)
export const installedApps = {
get: get8,
post: post12,
byInstalledAppId,
}
export const contract = {
installedApps,
}

View File

@ -0,0 +1,571 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type InstalledAppListResponse = {
installed_apps: Array<InstalledAppResponse>
}
export type ChatMessagePayload = {
conversation_id?: string | null
files?: Array<unknown> | null
inputs: {
[key: string]: unknown
}
model_config: {
[key: string]: unknown
}
parent_message_id?: string | null
query: string
response_mode?: 'blocking' | 'streaming'
retriever_from?: string
}
export type CompletionMessageExplorePayload = {
files?: Array<{
[key: string]: unknown
}> | null
inputs: {
[key: string]: unknown
}
query?: string
response_mode?: 'blocking' | 'streaming' | null
retriever_from?: string
}
export type ConversationRenamePayload = {
auto_generate?: boolean
name?: string | null
}
export type MessageFeedbackPayload = {
content?: string | null
message_id: string
rating?: 'like' | 'dislike' | null
}
export type SavedMessageCreatePayload = {
message_id: string
}
export type TextToAudioPayload = {
message_id?: string | null
streaming?: boolean | null
text?: string | null
voice?: string | null
}
export type WorkflowRunPayload = {
files?: Array<{
[key: string]: unknown
}> | null
inputs: {
[key: string]: unknown
}
}
export type InstalledAppResponse = {
app: InstalledAppInfoResponse
app_owner_tenant_id: string
editable: boolean
id: string
is_pinned: boolean
last_used_at?: number | null
uninstallable: boolean
}
export type InstalledAppInfoResponse = {
icon?: string | null
icon_background?: string | null
icon_type?: string | null
id: string
mode?: string | null
name?: string | null
use_icon_as_answer_icon?: boolean | null
}
export type GetInstalledAppsData = {
body?: never
path?: never
query?: never
url: '/installed-apps'
}
export type GetInstalledAppsResponses = {
200: InstalledAppListResponse
}
export type GetInstalledAppsResponse = GetInstalledAppsResponses[keyof GetInstalledAppsResponses]
export type PostInstalledAppsData = {
body?: never
path?: never
query?: never
url: '/installed-apps'
}
export type PostInstalledAppsResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsResponse = PostInstalledAppsResponses[keyof PostInstalledAppsResponses]
export type DeleteInstalledAppsByInstalledAppIdData = {
body?: never
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}'
}
export type DeleteInstalledAppsByInstalledAppIdResponses = {
200: {
[key: string]: unknown
}
}
export type DeleteInstalledAppsByInstalledAppIdResponse
= DeleteInstalledAppsByInstalledAppIdResponses[keyof DeleteInstalledAppsByInstalledAppIdResponses]
export type PatchInstalledAppsByInstalledAppIdData = {
body?: never
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}'
}
export type PatchInstalledAppsByInstalledAppIdResponses = {
200: {
[key: string]: unknown
}
}
export type PatchInstalledAppsByInstalledAppIdResponse
= PatchInstalledAppsByInstalledAppIdResponses[keyof PatchInstalledAppsByInstalledAppIdResponses]
export type PostInstalledAppsByInstalledAppIdAudioToTextData = {
body?: never
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/audio-to-text'
}
export type PostInstalledAppsByInstalledAppIdAudioToTextResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdAudioToTextResponse
= PostInstalledAppsByInstalledAppIdAudioToTextResponses[keyof PostInstalledAppsByInstalledAppIdAudioToTextResponses]
export type PostInstalledAppsByInstalledAppIdChatMessagesData = {
body: ChatMessagePayload
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/chat-messages'
}
export type PostInstalledAppsByInstalledAppIdChatMessagesResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdChatMessagesResponse
= PostInstalledAppsByInstalledAppIdChatMessagesResponses[keyof PostInstalledAppsByInstalledAppIdChatMessagesResponses]
export type PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopData = {
body?: never
path: {
installed_app_id: string
task_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/chat-messages/{task_id}/stop'
}
export type PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse
= PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponses[keyof PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponses]
export type PostInstalledAppsByInstalledAppIdCompletionMessagesData = {
body: CompletionMessageExplorePayload
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/completion-messages'
}
export type PostInstalledAppsByInstalledAppIdCompletionMessagesResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdCompletionMessagesResponse
= PostInstalledAppsByInstalledAppIdCompletionMessagesResponses[keyof PostInstalledAppsByInstalledAppIdCompletionMessagesResponses]
export type PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopData = {
body?: never
path: {
installed_app_id: string
task_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/completion-messages/{task_id}/stop'
}
export type PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse
= PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponses[keyof PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponses]
export type GetInstalledAppsByInstalledAppIdConversationsData = {
body?: never
path: {
installed_app_id: string
}
query?: {
last_id?: string | null
limit?: number
pinned?: boolean | null
}
url: '/installed-apps/{installed_app_id}/conversations'
}
export type GetInstalledAppsByInstalledAppIdConversationsResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdConversationsResponse
= GetInstalledAppsByInstalledAppIdConversationsResponses[keyof GetInstalledAppsByInstalledAppIdConversationsResponses]
export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdData = {
body?: never
path: {
installed_app_id: string
c_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/conversations/{c_id}'
}
export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponses = {
200: {
[key: string]: unknown
}
}
export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse
= DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponses[keyof DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponses]
export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameData = {
body: ConversationRenamePayload
path: {
installed_app_id: string
c_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/conversations/{c_id}/name'
}
export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse
= PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses[keyof PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses]
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinData = {
body?: never
path: {
installed_app_id: string
c_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/conversations/{c_id}/pin'
}
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponses = {
200: {
[key: string]: unknown
}
}
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse
= PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponses[keyof PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponses]
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinData = {
body?: never
path: {
installed_app_id: string
c_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/conversations/{c_id}/unpin'
}
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponses = {
200: {
[key: string]: unknown
}
}
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse
= PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponses[keyof PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponses]
export type GetInstalledAppsByInstalledAppIdMessagesData = {
body?: never
path: {
installed_app_id: string
}
query: {
conversation_id: string
first_id?: string | null
limit?: number
}
url: '/installed-apps/{installed_app_id}/messages'
}
export type GetInstalledAppsByInstalledAppIdMessagesResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdMessagesResponse
= GetInstalledAppsByInstalledAppIdMessagesResponses[keyof GetInstalledAppsByInstalledAppIdMessagesResponses]
export type PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksData = {
body: MessageFeedbackPayload
path: {
installed_app_id: string
message_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/messages/{message_id}/feedbacks'
}
export type PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse
= PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponses[keyof PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponses]
export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisData = {
body?: never
path: {
installed_app_id: string
message_id: string
}
query: {
response_mode: 'blocking' | 'streaming'
}
url: '/installed-apps/{installed_app_id}/messages/{message_id}/more-like-this'
}
export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse
= GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses[keyof GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses]
export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsData = {
body?: never
path: {
installed_app_id: string
message_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions'
}
export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse
= GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponses[keyof GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponses]
export type GetInstalledAppsByInstalledAppIdMetaData = {
body?: never
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/meta'
}
export type GetInstalledAppsByInstalledAppIdMetaResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdMetaResponse
= GetInstalledAppsByInstalledAppIdMetaResponses[keyof GetInstalledAppsByInstalledAppIdMetaResponses]
export type GetInstalledAppsByInstalledAppIdParametersData = {
body?: never
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/parameters'
}
export type GetInstalledAppsByInstalledAppIdParametersResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdParametersResponse
= GetInstalledAppsByInstalledAppIdParametersResponses[keyof GetInstalledAppsByInstalledAppIdParametersResponses]
export type GetInstalledAppsByInstalledAppIdSavedMessagesData = {
body?: never
path: {
installed_app_id: string
}
query?: {
last_id?: string | null
limit?: number
}
url: '/installed-apps/{installed_app_id}/saved-messages'
}
export type GetInstalledAppsByInstalledAppIdSavedMessagesResponses = {
200: {
[key: string]: unknown
}
}
export type GetInstalledAppsByInstalledAppIdSavedMessagesResponse
= GetInstalledAppsByInstalledAppIdSavedMessagesResponses[keyof GetInstalledAppsByInstalledAppIdSavedMessagesResponses]
export type PostInstalledAppsByInstalledAppIdSavedMessagesData = {
body: SavedMessageCreatePayload
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/saved-messages'
}
export type PostInstalledAppsByInstalledAppIdSavedMessagesResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdSavedMessagesResponse
= PostInstalledAppsByInstalledAppIdSavedMessagesResponses[keyof PostInstalledAppsByInstalledAppIdSavedMessagesResponses]
export type DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdData = {
body?: never
path: {
installed_app_id: string
message_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/saved-messages/{message_id}'
}
export type DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponses = {
200: {
[key: string]: unknown
}
}
export type DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse
= DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponses[keyof DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponses]
export type PostInstalledAppsByInstalledAppIdTextToAudioData = {
body: TextToAudioPayload
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/text-to-audio'
}
export type PostInstalledAppsByInstalledAppIdTextToAudioResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdTextToAudioResponse
= PostInstalledAppsByInstalledAppIdTextToAudioResponses[keyof PostInstalledAppsByInstalledAppIdTextToAudioResponses]
export type PostInstalledAppsByInstalledAppIdWorkflowsRunData = {
body: WorkflowRunPayload
path: {
installed_app_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/workflows/run'
}
export type PostInstalledAppsByInstalledAppIdWorkflowsRunResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdWorkflowsRunResponse
= PostInstalledAppsByInstalledAppIdWorkflowsRunResponses[keyof PostInstalledAppsByInstalledAppIdWorkflowsRunResponses]
export type PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopData = {
body?: never
path: {
installed_app_id: string
task_id: string
}
query?: never
url: '/installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop'
}
export type PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse
= PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponses[keyof PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponses]

View File

@ -0,0 +1,433 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* ChatMessagePayload
*/
export const zChatMessagePayload = z.object({
conversation_id: z.string().nullish(),
files: z.array(z.unknown()).nullish(),
inputs: z.record(z.string(), z.unknown()),
model_config: z.record(z.string(), z.unknown()),
parent_message_id: z.string().nullish(),
query: z.string(),
response_mode: z.enum(['blocking', 'streaming']).optional().default('blocking'),
retriever_from: z.string().optional().default('dev'),
})
/**
* CompletionMessageExplorePayload
*/
export const zCompletionMessageExplorePayload = z.object({
files: z.array(z.record(z.string(), z.unknown())).nullish(),
inputs: z.record(z.string(), z.unknown()),
query: z.string().optional().default(''),
response_mode: z.enum(['blocking', 'streaming']).nullish(),
retriever_from: z.string().optional().default('explore_app'),
})
/**
* ConversationRenamePayload
*/
export const zConversationRenamePayload = z.object({
auto_generate: z.boolean().optional().default(false),
name: z.string().nullish(),
})
/**
* MessageFeedbackPayload
*/
export const zMessageFeedbackPayload = z.object({
content: z.string().nullish(),
message_id: z.string(),
rating: z.enum(['like', 'dislike']).nullish(),
})
/**
* SavedMessageCreatePayload
*/
export const zSavedMessageCreatePayload = z.object({
message_id: z.string(),
})
/**
* TextToAudioPayload
*/
export const zTextToAudioPayload = z.object({
message_id: z.string().nullish(),
streaming: z.boolean().nullish(),
text: z.string().nullish(),
voice: z.string().nullish(),
})
/**
* WorkflowRunPayload
*/
export const zWorkflowRunPayload = z.object({
files: z.array(z.record(z.string(), z.unknown())).nullish(),
inputs: z.record(z.string(), z.unknown()),
})
/**
* InstalledAppInfoResponse
*/
export const zInstalledAppInfoResponse = z.object({
icon: z.string().nullish(),
icon_background: z.string().nullish(),
icon_type: z.string().nullish(),
id: z.string(),
mode: z.string().nullish(),
name: z.string().nullish(),
use_icon_as_answer_icon: z.boolean().nullish(),
})
/**
* InstalledAppResponse
*/
export const zInstalledAppResponse = z.object({
app: zInstalledAppInfoResponse,
app_owner_tenant_id: z.string(),
editable: z.boolean(),
id: z.string(),
is_pinned: z.boolean(),
last_used_at: z.int().nullish(),
uninstallable: z.boolean(),
})
/**
* InstalledAppListResponse
*/
export const zInstalledAppListResponse = z.object({
installed_apps: z.array(zInstalledAppResponse),
})
/**
* Success
*/
export const zGetInstalledAppsResponse = zInstalledAppListResponse
/**
* Success
*/
export const zPostInstalledAppsResponse = z.record(z.string(), z.unknown())
export const zDeleteInstalledAppsByInstalledAppIdPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zDeleteInstalledAppsByInstalledAppIdResponse = z.record(z.string(), z.unknown())
export const zPatchInstalledAppsByInstalledAppIdPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPatchInstalledAppsByInstalledAppIdResponse = z.record(z.string(), z.unknown())
export const zPostInstalledAppsByInstalledAppIdAudioToTextPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdAudioToTextResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdChatMessagesBody = zChatMessagePayload
export const zPostInstalledAppsByInstalledAppIdChatMessagesPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdChatMessagesResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath = z.object({
installed_app_id: z.string(),
task_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesBody
= zCompletionMessageExplorePayload
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath = z.object({
installed_app_id: z.string(),
task_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse = z.record(
z.string(),
z.unknown(),
)
export const zGetInstalledAppsByInstalledAppIdConversationsPath = z.object({
installed_app_id: z.string(),
})
export const zGetInstalledAppsByInstalledAppIdConversationsQuery = z.object({
last_id: z.string().nullish(),
limit: z.int().gte(1).lte(100).optional().default(20),
pinned: z.boolean().nullish(),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdConversationsResponse = z.record(
z.string(),
z.unknown(),
)
export const zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath = z.object({
installed_app_id: z.string(),
c_id: z.string(),
})
/**
* Success
*/
export const zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody
= zConversationRenamePayload
export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath = z.object({
installed_app_id: z.string(),
c_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse = z.record(
z.string(),
z.unknown(),
)
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath = z.object({
installed_app_id: z.string(),
c_id: z.string(),
})
/**
* Success
*/
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse = z.record(
z.string(),
z.unknown(),
)
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath = z.object({
installed_app_id: z.string(),
c_id: z.string(),
})
/**
* Success
*/
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse = z.record(
z.string(),
z.unknown(),
)
export const zGetInstalledAppsByInstalledAppIdMessagesPath = z.object({
installed_app_id: z.string(),
})
export const zGetInstalledAppsByInstalledAppIdMessagesQuery = z.object({
conversation_id: z.string(),
first_id: z.string().nullish(),
limit: z.int().gte(1).lte(100).optional().default(20),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdMessagesResponse = z.record(z.string(), z.unknown())
export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody
= zMessageFeedbackPayload
export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath = z.object({
installed_app_id: z.string(),
message_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse = z.record(
z.string(),
z.unknown(),
)
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath = z.object({
installed_app_id: z.string(),
message_id: z.string(),
})
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery = z.object({
response_mode: z.enum(['blocking', 'streaming']),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse = z.record(
z.string(),
z.unknown(),
)
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath = z.object({
installed_app_id: z.string(),
message_id: z.string(),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse
= z.record(z.string(), z.unknown())
export const zGetInstalledAppsByInstalledAppIdMetaPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdMetaResponse = z.record(z.string(), z.unknown())
export const zGetInstalledAppsByInstalledAppIdParametersPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdParametersResponse = z.record(z.string(), z.unknown())
export const zGetInstalledAppsByInstalledAppIdSavedMessagesPath = z.object({
installed_app_id: z.string(),
})
export const zGetInstalledAppsByInstalledAppIdSavedMessagesQuery = z.object({
last_id: z.string().nullish(),
limit: z.int().gte(1).lte(100).optional().default(20),
})
/**
* Success
*/
export const zGetInstalledAppsByInstalledAppIdSavedMessagesResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdSavedMessagesBody = zSavedMessageCreatePayload
export const zPostInstalledAppsByInstalledAppIdSavedMessagesPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdSavedMessagesResponse = z.record(
z.string(),
z.unknown(),
)
export const zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath = z.object({
installed_app_id: z.string(),
message_id: z.string(),
})
/**
* Success
*/
export const zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdTextToAudioBody = zTextToAudioPayload
export const zPostInstalledAppsByInstalledAppIdTextToAudioPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdTextToAudioResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdWorkflowsRunBody = zWorkflowRunPayload
export const zPostInstalledAppsByInstalledAppIdWorkflowsRunPath = z.object({
installed_app_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse = z.record(
z.string(),
z.unknown(),
)
export const zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath = z.object({
installed_app_id: z.string(),
task_id: z.string(),
})
/**
* Success
*/
export const zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse = z.record(
z.string(),
z.unknown(),
)

View File

@ -0,0 +1,54 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zPostInstructionGenerateBody,
zPostInstructionGenerateResponse,
zPostInstructionGenerateTemplateBody,
zPostInstructionGenerateTemplateResponse,
} from './zod.gen'
/**
* Get instruction generation template
*/
export const post = oc
.route({
description: 'Get instruction generation template',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstructionGenerateTemplate',
path: '/instruction-generate/template',
tags: ['console'],
})
.input(z.object({ body: zPostInstructionGenerateTemplateBody }))
.output(zPostInstructionGenerateTemplateResponse)
export const template = {
post,
}
/**
* Generate instruction for workflow nodes or general use
*/
export const post2 = oc
.route({
description: 'Generate instruction for workflow nodes or general use',
inputStructure: 'detailed',
method: 'POST',
operationId: 'postInstructionGenerate',
path: '/instruction-generate',
tags: ['console'],
})
.input(z.object({ body: zPostInstructionGenerateBody }))
.output(zPostInstructionGenerateResponse)
export const instructionGenerate = {
post: post2,
template,
}
export const contract = {
instructionGenerate,
}

View File

@ -0,0 +1,101 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type InstructionGeneratePayload = {
current?: string
flow_id: string
ideal_output?: string
instruction: string
language?: string
model_config: ModelConfig
node_id?: string
}
export type InstructionTemplatePayload = {
type: string
}
export type ModelConfig = {
agent_mode_dict?: JsonValue
annotation_reply_dict?: JsonValue
chat_prompt_config_dict?: JsonValue
completion_prompt_config_dict?: JsonValue
created_at?: number | null
created_by?: string | null
dataset_configs_dict?: JsonValue
dataset_query_variable?: string | null
external_data_tools_list?: JsonValue
file_upload_dict?: JsonValue
model_dict?: JsonValue
more_like_this_dict?: JsonValue
opening_statement?: string | null
pre_prompt?: string | null
prompt_type?: string | null
retriever_resource_dict?: JsonValue
sensitive_word_avoidance_dict?: JsonValue
speech_to_text_dict?: JsonValue
suggested_questions_after_answer_dict?: JsonValue
suggested_questions_list?: JsonValue
text_to_speech_dict?: JsonValue
updated_at?: number | null
updated_by?: string | null
user_input_form_list?: JsonValue
}
export type JsonValue = unknown
export type PostInstructionGenerateData = {
body: InstructionGeneratePayload
path?: never
query?: never
url: '/instruction-generate'
}
export type PostInstructionGenerateErrors = {
400: {
[key: string]: unknown
}
402: {
[key: string]: unknown
}
}
export type PostInstructionGenerateError
= PostInstructionGenerateErrors[keyof PostInstructionGenerateErrors]
export type PostInstructionGenerateResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstructionGenerateResponse
= PostInstructionGenerateResponses[keyof PostInstructionGenerateResponses]
export type PostInstructionGenerateTemplateData = {
body: InstructionTemplatePayload
path?: never
query?: never
url: '/instruction-generate/template'
}
export type PostInstructionGenerateTemplateErrors = {
400: {
[key: string]: unknown
}
}
export type PostInstructionGenerateTemplateError
= PostInstructionGenerateTemplateErrors[keyof PostInstructionGenerateTemplateErrors]
export type PostInstructionGenerateTemplateResponses = {
200: {
[key: string]: unknown
}
}
export type PostInstructionGenerateTemplateResponse
= PostInstructionGenerateTemplateResponses[keyof PostInstructionGenerateTemplateResponses]

View File

@ -0,0 +1,69 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* InstructionTemplatePayload
*/
export const zInstructionTemplatePayload = z.object({
type: z.string(),
})
export const zJsonValue = z.unknown()
/**
* ModelConfig
*/
export const zModelConfig = z.object({
agent_mode_dict: zJsonValue.optional(),
annotation_reply_dict: zJsonValue.optional(),
chat_prompt_config_dict: zJsonValue.optional(),
completion_prompt_config_dict: zJsonValue.optional(),
created_at: z.int().nullish(),
created_by: z.string().nullish(),
dataset_configs_dict: zJsonValue.optional(),
dataset_query_variable: z.string().nullish(),
external_data_tools_list: zJsonValue.optional(),
file_upload_dict: zJsonValue.optional(),
model_dict: zJsonValue.optional(),
more_like_this_dict: zJsonValue.optional(),
opening_statement: z.string().nullish(),
pre_prompt: z.string().nullish(),
prompt_type: z.string().nullish(),
retriever_resource_dict: zJsonValue.optional(),
sensitive_word_avoidance_dict: zJsonValue.optional(),
speech_to_text_dict: zJsonValue.optional(),
suggested_questions_after_answer_dict: zJsonValue.optional(),
suggested_questions_list: zJsonValue.optional(),
text_to_speech_dict: zJsonValue.optional(),
updated_at: z.int().nullish(),
updated_by: z.string().nullish(),
user_input_form_list: zJsonValue.optional(),
})
/**
* InstructionGeneratePayload
*/
export const zInstructionGeneratePayload = z.object({
current: z.string().optional().default(''),
flow_id: z.string(),
ideal_output: z.string().optional().default(''),
instruction: z.string(),
language: z.string().optional().default('javascript'),
model_config: zModelConfig,
node_id: z.string().optional().default(''),
})
export const zPostInstructionGenerateBody = zInstructionGeneratePayload
/**
* Instruction generated successfully
*/
export const zPostInstructionGenerateResponse = z.record(z.string(), z.unknown())
export const zPostInstructionGenerateTemplateBody = zInstructionTemplatePayload
/**
* Template retrieved successfully
*/
export const zPostInstructionGenerateTemplateResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,29 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import { zPostLoginBody, zPostLoginResponse } from './zod.gen'
/**
* Authenticate user and login
*/
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postLogin',
path: '/login',
summary: 'Authenticate user and login',
tags: ['console'],
})
.input(z.object({ body: zPostLoginBody }))
.output(zPostLoginResponse)
export const login = {
post,
}
export const contract = {
login,
}

View File

@ -0,0 +1,27 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type LoginPayload = {
email: string
invite_token?: string | null
password: string
remember_me?: boolean
}
export type PostLoginData = {
body: LoginPayload
path?: never
query?: never
url: '/login'
}
export type PostLoginResponses = {
200: {
[key: string]: unknown
}
}
export type PostLoginResponse = PostLoginResponses[keyof PostLoginResponses]

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* LoginPayload
*/
export const zLoginPayload = z.object({
email: z.string(),
invite_token: z.string().nullish(),
password: z.string(),
remember_me: z.boolean().optional().default(false),
})
export const zPostLoginBody = zLoginPayload
/**
* Success
*/
export const zPostLoginResponse = z.record(z.string(), z.unknown())

View File

@ -0,0 +1,23 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import { zPostLogoutResponse } from './zod.gen'
export const post = oc
.route({
inputStructure: 'detailed',
method: 'POST',
operationId: 'postLogout',
path: '/logout',
tags: ['console'],
})
.output(zPostLogoutResponse)
export const logout = {
post,
}
export const contract = {
logout,
}

Some files were not shown because too many files have changed in this diff Show More