fix: 3 schema bugs + add comprehensive testing documentation
Bug Fixes: - auth.ts: Remove non-existent ap.updatedAt column - subscriptions.ts: Add LIMIT 25 to prevent 136KB+ responses - collections.ts: Remove documentStructure from list (use get for full) Documentation: - TESTING-GUIDE.md: Complete 164-tool reference with test status - CONTINUE.md: Updated with verification status and MCP loading issue - CHANGELOG.md: Document fixes and Round 1-2 test results Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ interface AuthenticationProvider {
|
||||
enabled: boolean;
|
||||
teamId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
teamName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,6 @@ const getAuthConfig: BaseTool<Record<string, never>> = {
|
||||
ap.enabled,
|
||||
ap."teamId",
|
||||
ap."createdAt",
|
||||
ap."updatedAt",
|
||||
t.name as "teamName"
|
||||
FROM authentication_providers ap
|
||||
LEFT JOIN teams t ON ap."teamId" = t.id
|
||||
|
||||
@@ -36,6 +36,7 @@ export const collectionsTools: BaseTool<any>[] = [
|
||||
const { offset = 0, limit = 25, teamId } = args;
|
||||
validatePagination(offset, limit);
|
||||
|
||||
// Note: documentStructure excluded from list (too large) - use get_collection for full details
|
||||
let query = `
|
||||
SELECT
|
||||
c.id,
|
||||
@@ -47,7 +48,6 @@ export const collectionsTools: BaseTool<any>[] = [
|
||||
c.index,
|
||||
c.permission,
|
||||
c."maintainerApprovalRequired",
|
||||
c."documentStructure",
|
||||
c.sharing,
|
||||
c.sort,
|
||||
c."teamId",
|
||||
|
||||
@@ -164,12 +164,21 @@ const getSubscriptionSettings: BaseTool<{ user_id: string }> = {
|
||||
handler: async (args, pgClient): Promise<ToolResponse> => {
|
||||
if (!isValidUUID(args.user_id)) throw new Error('Invalid user_id');
|
||||
|
||||
// Get total count
|
||||
const countResult = await pgClient.query(
|
||||
`SELECT COUNT(*) as count FROM subscriptions WHERE "userId" = $1`,
|
||||
[args.user_id]
|
||||
);
|
||||
const totalSubscriptions = parseInt(countResult.rows[0].count, 10);
|
||||
|
||||
// Get recent subscriptions (limited to 25)
|
||||
const subscriptions = await pgClient.query(`
|
||||
SELECT s.id, s."documentId", s.event, d.title as "documentTitle"
|
||||
SELECT s.id, s."documentId", s.event, d.title as "documentTitle", s."createdAt"
|
||||
FROM subscriptions s
|
||||
LEFT JOIN documents d ON s."documentId" = d.id
|
||||
WHERE s."userId" = $1
|
||||
ORDER BY s."createdAt" DESC
|
||||
LIMIT 25
|
||||
`, [args.user_id]);
|
||||
|
||||
const userSettings = await pgClient.query(
|
||||
@@ -179,8 +188,10 @@ const getSubscriptionSettings: BaseTool<{ user_id: string }> = {
|
||||
|
||||
return {
|
||||
content: [{ type: 'text', text: JSON.stringify({
|
||||
subscriptions: subscriptions.rows,
|
||||
totalSubscriptions: subscriptions.rows.length,
|
||||
totalSubscriptions,
|
||||
recentSubscriptions: subscriptions.rows,
|
||||
showingCount: subscriptions.rows.length,
|
||||
note: totalSubscriptions > 25 ? 'Use outline_list_subscriptions for full list with pagination' : undefined,
|
||||
userSettings: userSettings.rows[0]?.notificationSettings || {},
|
||||
}, null, 2) }],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user