diff --git a/services/platform/app/features/approvals/components/approvals-client.tsx b/services/platform/app/features/approvals/components/approvals-client.tsx index b7af8854f..903cf64eb 100644 --- a/services/platform/app/features/approvals/components/approvals-client.tsx +++ b/services/platform/app/features/approvals/components/approvals-client.tsx @@ -119,7 +119,7 @@ export function ApprovalsClient({ const pageSize = 10; const approvalsResult = useQuery( - api.approvals.queries.getApprovalsByOrganization, + api.approvals.queries.listApprovalsByOrganization, { organizationId, status: status === 'pending' ? 'pending' : undefined, diff --git a/services/platform/app/features/approvals/hooks/use-update-approval-status.ts b/services/platform/app/features/approvals/hooks/use-update-approval-status.ts index ed518d4dd..324a06074 100644 --- a/services/platform/app/features/approvals/hooks/use-update-approval-status.ts +++ b/services/platform/app/features/approvals/hooks/use-update-approval-status.ts @@ -1,7 +1,6 @@ import { useMutation } from 'convex/react'; import { api } from '@/convex/_generated/api'; -// Note: Uses preloaded query with complex filters - params not predictable export function useUpdateApprovalStatus() { - return useMutation(api.approvals.mutations.updateApprovalStatusPublic); + return useMutation(api.approvals.mutations.updateApprovalStatus); } diff --git a/services/platform/app/features/automations/components/automation-assistant.tsx b/services/platform/app/features/automations/components/automation-assistant.tsx index 0437df813..8d740a645 100644 --- a/services/platform/app/features/automations/components/automation-assistant.tsx +++ b/services/platform/app/features/automations/components/automation-assistant.tsx @@ -297,7 +297,7 @@ function AutomationAssistantContent({ // Load workflow to get threadId from metadata (use public API) const workflow = useQuery( - api.wf_definitions.queries.getWorkflowPublic, + api.wf_definitions.queries.getWorkflow, automationId ? { wfDefinitionId: automationId } : 'skip', ); diff --git a/services/platform/app/features/automations/components/automation-navigation.tsx b/services/platform/app/features/automations/components/automation-navigation.tsx index 7b17e58f1..5f08c62e8 100644 --- a/services/platform/app/features/automations/components/automation-navigation.tsx +++ b/services/platform/app/features/automations/components/automation-navigation.tsx @@ -61,7 +61,7 @@ export function AutomationNavigation({ // Fetch all versions of this automation const versions = useQuery( - api.wf_definitions.queries.listVersionsPublic, + api.wf_definitions.queries.listVersions, automation?.name && organizationId ? { organizationId: organizationId, diff --git a/services/platform/app/features/automations/components/automations-client.tsx b/services/platform/app/features/automations/components/automations-client.tsx index 9a1fe27cd..bf43dc03c 100644 --- a/services/platform/app/features/automations/components/automations-client.tsx +++ b/services/platform/app/features/automations/components/automations-client.tsx @@ -38,13 +38,12 @@ export function AutomationsClient({ organizationId, searchTerm: searchTerm || undefined, status: status && status.length > 0 ? status : undefined, - paginationOpts: { cursor: null, numItems: 1000 }, }), [organizationId, searchTerm, status], ); const automationsResult = useQuery( - api.wf_definitions.queries.getAutomations, + api.wf_definitions.queries.listAutomations, queryArgs, ); diff --git a/services/platform/app/features/automations/executions/executions-client.tsx b/services/platform/app/features/automations/executions/executions-client.tsx index 0e43ef370..9f7dd97d1 100644 --- a/services/platform/app/features/automations/executions/executions-client.tsx +++ b/services/platform/app/features/automations/executions/executions-client.tsx @@ -138,9 +138,9 @@ export function ExecutionsClient({ dateFrom: dateFrom || undefined, dateTo: dateTo || undefined, cursor: undefined, - numItems: 1000, + numItems: pageSize, }), - [amId, searchTerm, status, triggeredBy, dateFrom, dateTo], + [amId, searchTerm, status, triggeredBy, dateFrom, dateTo, pageSize], ); const executionsResult = useQuery( diff --git a/services/platform/app/features/automations/executions/use-executions-table-config.tsx b/services/platform/app/features/automations/executions/use-executions-table-config.tsx index ae79bb11f..6184c6d19 100644 --- a/services/platform/app/features/automations/executions/use-executions-table-config.tsx +++ b/services/platform/app/features/automations/executions/use-executions-table-config.tsx @@ -47,7 +47,7 @@ export function useExecutionsTableConfig() { columns, searchPlaceholder: tCommon('search.placeholder'), stickyLayout: true as const, - pageSize: 10, + pageSize: 30, defaultSort: 'startedAt' as const, defaultSortDesc: true, infiniteScroll: true as const, diff --git a/services/platform/app/features/automations/hooks/use-create-automation.ts b/services/platform/app/features/automations/hooks/use-create-automation.ts index b852d9a66..b2b8617d6 100644 --- a/services/platform/app/features/automations/hooks/use-create-automation.ts +++ b/services/platform/app/features/automations/hooks/use-create-automation.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Create operation - navigates to new automation page after creation export function useCreateAutomation() { - return useMutation(api.wf_definitions.mutations.createWorkflowWithStepsPublic); + return useMutation(api.wf_definitions.mutations.createWorkflowWithSteps); } diff --git a/services/platform/app/features/automations/hooks/use-create-draft-from-active.ts b/services/platform/app/features/automations/hooks/use-create-draft-from-active.ts index c4e149d5b..eaeb3e292 100644 --- a/services/platform/app/features/automations/hooks/use-create-draft-from-active.ts +++ b/services/platform/app/features/automations/hooks/use-create-draft-from-active.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Create operation - creates draft version from active workflow export function useCreateDraftFromActive() { - return useMutation(api.wf_definitions.mutations.createDraftFromActivePublic); + return useMutation(api.wf_definitions.mutations.createDraftFromActive); } diff --git a/services/platform/app/features/automations/hooks/use-create-step.ts b/services/platform/app/features/automations/hooks/use-create-step.ts index 85778c8e1..60d1ff832 100644 --- a/services/platform/app/features/automations/hooks/use-create-step.ts +++ b/services/platform/app/features/automations/hooks/use-create-step.ts @@ -1,10 +1,6 @@ -/** - * Hook for creating workflow step definitions - */ - import { useMutation } from 'convex/react'; import { api } from '@/convex/_generated/api'; export function useCreateStep() { - return useMutation(api.wf_step_defs.mutations.createStepPublic); + return useMutation(api.wf_step_defs.mutations.createStep); } diff --git a/services/platform/app/features/automations/hooks/use-delete-automation.ts b/services/platform/app/features/automations/hooks/use-delete-automation.ts index 29d906f1d..47fa754b3 100644 --- a/services/platform/app/features/automations/hooks/use-delete-automation.ts +++ b/services/platform/app/features/automations/hooks/use-delete-automation.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Optimistic updates not added - automations table uses local state for filtering export function useDeleteAutomation() { - return useMutation(api.wf_definitions.mutations.deleteWorkflowPublic); + return useMutation(api.wf_definitions.mutations.deleteWorkflow); } diff --git a/services/platform/app/features/automations/hooks/use-duplicate-automation.ts b/services/platform/app/features/automations/hooks/use-duplicate-automation.ts index 73974d183..1a886f6d0 100644 --- a/services/platform/app/features/automations/hooks/use-duplicate-automation.ts +++ b/services/platform/app/features/automations/hooks/use-duplicate-automation.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Create operation - clones workflow with new ID export function useDuplicateAutomation() { - return useMutation(api.wf_definitions.mutations.duplicateWorkflowPublic); + return useMutation(api.wf_definitions.mutations.duplicateWorkflow); } diff --git a/services/platform/app/features/automations/hooks/use-publish-automation-draft.ts b/services/platform/app/features/automations/hooks/use-publish-automation-draft.ts index ac41b85bd..f2868d995 100644 --- a/services/platform/app/features/automations/hooks/use-publish-automation-draft.ts +++ b/services/platform/app/features/automations/hooks/use-publish-automation-draft.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Complex state change - converts draft to active version export function usePublishAutomationDraft() { - return useMutation(api.wf_definitions.mutations.publishDraftPublic); + return useMutation(api.wf_definitions.mutations.publishDraft); } diff --git a/services/platform/app/features/automations/hooks/use-start-workflow.ts b/services/platform/app/features/automations/hooks/use-start-workflow.ts index eab4ea4cc..f73c515de 100644 --- a/services/platform/app/features/automations/hooks/use-start-workflow.ts +++ b/services/platform/app/features/automations/hooks/use-start-workflow.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Triggers workflow execution - creates execution record export function useStartWorkflow() { - return useMutation(api.workflow_engine.engine.startWorkflow); + return useMutation(api.workflow_engine.mutations.startWorkflow); } diff --git a/services/platform/app/features/automations/hooks/use-update-automation.ts b/services/platform/app/features/automations/hooks/use-update-automation.ts index e2dd618db..625cf56e6 100644 --- a/services/platform/app/features/automations/hooks/use-update-automation.ts +++ b/services/platform/app/features/automations/hooks/use-update-automation.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Updates workflow steps/config - complex nested structure export function useUpdateAutomation() { - return useMutation(api.wf_definitions.mutations.updateWorkflowPublic); + return useMutation(api.wf_definitions.mutations.updateWorkflow); } diff --git a/services/platform/app/features/automations/hooks/use-update-step.ts b/services/platform/app/features/automations/hooks/use-update-step.ts index 670669a60..02ea5d495 100644 --- a/services/platform/app/features/automations/hooks/use-update-step.ts +++ b/services/platform/app/features/automations/hooks/use-update-step.ts @@ -1,10 +1,6 @@ -/** - * Hook for updating workflow step definitions - */ - import { useMutation } from 'convex/react'; import { api } from '@/convex/_generated/api'; export function useUpdateStep() { - return useMutation(api.wf_step_defs.mutations.updateStepPublic); + return useMutation(api.wf_step_defs.mutations.updateStep); } diff --git a/services/platform/app/features/chat/components/human-input-request-card.tsx b/services/platform/app/features/chat/components/human-input-request-card.tsx index 905a07b05..3984fcaf9 100644 --- a/services/platform/app/features/chat/components/human-input-request-card.tsx +++ b/services/platform/app/features/chat/components/human-input-request-card.tsx @@ -44,7 +44,7 @@ function HumanInputRequestCardComponent({ const [selectedValues, setSelectedValues] = useState([]); const submitResponse = useMutation( - api.agent_tools.human_input.submit_human_input_response.submitHumanInputResponse, + api.agent_tools.human_input.mutations.submitHumanInputResponse, ); const isPending = status === 'pending'; diff --git a/services/platform/app/features/chat/components/integration-approval-card.tsx b/services/platform/app/features/chat/components/integration-approval-card.tsx index 9bd56ac36..793c240e4 100644 --- a/services/platform/app/features/chat/components/integration-approval-card.tsx +++ b/services/platform/app/features/chat/components/integration-approval-card.tsx @@ -53,7 +53,7 @@ function IntegrationApprovalCardComponent({ const [isRejecting, setIsRejecting] = useState(false); const [error, setError] = useState(null); - const updateApprovalStatus = useMutation(api.approvals.mutations.updateApprovalStatusPublic); + const updateApprovalStatus = useMutation(api.approvals.mutations.updateApprovalStatus); const executeApprovedOperation = useAction( api.approvals.actions.executeApprovedIntegrationOperation ); diff --git a/services/platform/app/features/chat/components/workflow-creation-approval-card.tsx b/services/platform/app/features/chat/components/workflow-creation-approval-card.tsx index c6728ad98..1f648658d 100644 --- a/services/platform/app/features/chat/components/workflow-creation-approval-card.tsx +++ b/services/platform/app/features/chat/components/workflow-creation-approval-card.tsx @@ -74,7 +74,7 @@ function WorkflowCreationApprovalCardComponent({ // No optimistic update: approval triggers external workflow creation action with // side effects that cannot be safely rolled back if the mutation fails. - const updateApprovalStatus = useMutation(api.approvals.mutations.updateApprovalStatusPublic); + const updateApprovalStatus = useMutation(api.approvals.mutations.updateApprovalStatus); const executeApprovedWorkflow = useAction( api.approvals.actions.executeApprovedWorkflowCreation ); diff --git a/services/platform/app/features/chat/hooks/use-generate-upload-url.ts b/services/platform/app/features/chat/hooks/use-generate-upload-url.ts index 271b91eb8..e7ada071d 100644 --- a/services/platform/app/features/chat/hooks/use-generate-upload-url.ts +++ b/services/platform/app/features/chat/hooks/use-generate-upload-url.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Utility - returns URL, doesn't affect any query export function useGenerateUploadUrl() { - return useMutation(api.file.mutations.generateUploadUrl); + return useMutation(api.files.mutations.generateUploadUrl); } diff --git a/services/platform/app/features/chat/hooks/use-human-input-requests.ts b/services/platform/app/features/chat/hooks/use-human-input-requests.ts index 1d1de9db2..2e902b4ea 100644 --- a/services/platform/app/features/chat/hooks/use-human-input-requests.ts +++ b/services/platform/app/features/chat/hooks/use-human-input-requests.ts @@ -48,7 +48,7 @@ export function useHumanInputRequests(threadId: string | undefined) { */ export function useSubmitHumanInputResponse() { const submitMutation = useMutation( - api.agent_tools.human_input.submit_human_input_response.submitHumanInputResponse, + api.agent_tools.human_input.mutations.submitHumanInputResponse, ); return { diff --git a/services/platform/app/features/conversations/actions/improve-message.ts b/services/platform/app/features/conversations/actions/improve-message.ts index 55ff31e42..6958190b2 100644 --- a/services/platform/app/features/conversations/actions/improve-message.ts +++ b/services/platform/app/features/conversations/actions/improve-message.ts @@ -8,7 +8,7 @@ export async function improveMessage( instruction?: string, ): Promise<{ improvedMessage: string; error?: string }> { try { - const result = await fetchAction(api.improve_message.improveMessage, { + const result = await fetchAction(api.improve_message.actions.improveMessage, { originalMessage, instruction, }); diff --git a/services/platform/app/features/conversations/hooks/use-generate-upload-url.ts b/services/platform/app/features/conversations/hooks/use-generate-upload-url.ts index 271b91eb8..e7ada071d 100644 --- a/services/platform/app/features/conversations/hooks/use-generate-upload-url.ts +++ b/services/platform/app/features/conversations/hooks/use-generate-upload-url.ts @@ -3,5 +3,5 @@ import { api } from '@/convex/_generated/api'; // Note: Utility - returns URL, doesn't affect any query export function useGenerateUploadUrl() { - return useMutation(api.file.mutations.generateUploadUrl); + return useMutation(api.files.mutations.generateUploadUrl); } diff --git a/services/platform/app/features/documents/components/document-preview-dialog.tsx b/services/platform/app/features/documents/components/document-preview-dialog.tsx index 69160e478..d9b07f97b 100644 --- a/services/platform/app/features/documents/components/document-preview-dialog.tsx +++ b/services/platform/app/features/documents/components/document-preview-dialog.tsx @@ -43,7 +43,7 @@ export function DocumentPreviewDialog({ // Use documentId if available, otherwise use storagePath const dataById = useQuery( - api.documents.queries.getDocumentByIdPublic, + api.documents.queries.getDocumentById, open && Boolean(documentId) ? { documentId: documentId as Id<'documents'>, diff --git a/services/platform/app/features/documents/components/document-team-tags-dialog.tsx b/services/platform/app/features/documents/components/document-team-tags-dialog.tsx index 2ab782eef..c65f32c5c 100644 --- a/services/platform/app/features/documents/components/document-team-tags-dialog.tsx +++ b/services/platform/app/features/documents/components/document-team-tags-dialog.tsx @@ -49,7 +49,7 @@ function DocumentTeamTagsDialogContent({ // Fetch only teams that the current user belongs to const teamsResult = useQuery( - api.member.getMyTeams, + api.members.queries.getMyTeams, organizationId ? { organizationId } : 'skip', ); const teams = teamsResult?.teams ?? null; diff --git a/services/platform/app/features/documents/components/document-upload-dialog.tsx b/services/platform/app/features/documents/components/document-upload-dialog.tsx index ab3909ada..b10dc12d0 100644 --- a/services/platform/app/features/documents/components/document-upload-dialog.tsx +++ b/services/platform/app/features/documents/components/document-upload-dialog.tsx @@ -36,7 +36,7 @@ export function DocumentUploadDialog({ // Fetch user's teams via Convex query const teamsResult = useQuery( - api.member.getMyTeams, + api.members.queries.getMyTeams, open ? { organizationId } : 'skip', ); const teams = teamsResult?.teams ?? null; diff --git a/services/platform/app/features/documents/components/documents-client.tsx b/services/platform/app/features/documents/components/documents-client.tsx index 0e1caef18..ebf04ef30 100644 --- a/services/platform/app/features/documents/components/documents-client.tsx +++ b/services/platform/app/features/documents/components/documents-client.tsx @@ -97,7 +97,7 @@ export function DocumentsClient({ ); const documentsResult = useQuery( - api.documents.queries.getDocumentsCursor, + api.documents.queries.listDocuments, queryArgs, ); diff --git a/services/platform/app/features/documents/components/onedrive-import-dialog.tsx b/services/platform/app/features/documents/components/onedrive-import-dialog.tsx index 91ed8240f..05ec3b984 100644 --- a/services/platform/app/features/documents/components/onedrive-import-dialog.tsx +++ b/services/platform/app/features/documents/components/onedrive-import-dialog.tsx @@ -453,7 +453,7 @@ export function OneDriveImportDialog({ // Fetch user's teams via Convex query (only in settings stage) const teamsResult = useConvexQuery( - api.member.getMyTeams, + api.members.queries.getMyTeams, stage === 'settings' ? { organizationId } : 'skip', ); const teams = teamsResult?.teams ?? null; diff --git a/services/platform/app/features/documents/components/rag-status-badge.tsx b/services/platform/app/features/documents/components/rag-status-badge.tsx index cb9a665a6..1c909b8e9 100644 --- a/services/platform/app/features/documents/components/rag-status-badge.tsx +++ b/services/platform/app/features/documents/components/rag-status-badge.tsx @@ -64,7 +64,8 @@ export function RagStatusBadge({ [t], ); - const handleRetry = async () => { + const handleRetry = async (e: React.MouseEvent) => { + e.stopPropagation(); if (!documentId) { toast({ title: t('rag.toast.documentIdRequired'), @@ -135,7 +136,10 @@ export function RagStatusBadge({ <>