Downgrade Appwrite SDK to v18 to match Appwrite Server 1.8.1 and fix Query.equal type errors

This commit is contained in:
Carlos (Almeira) 2026-07-09 19:10:40 -05:00
parent 89265cdbef
commit b637a2e445
7 changed files with 15 additions and 15 deletions

Binary file not shown.

16
package-lock.json generated
View File

@ -23,7 +23,7 @@
"@tiptap/starter-kit": "^3.21.0",
"@types/dompurify": "^3.0.5",
"@types/video.js": "^7.3.58",
"appwrite": "^21.0.0",
"appwrite": "^18.0.0",
"axios": "^1.18.0",
"cheerio": "^1.2.0",
"clsx": "^2.1.1",
@ -34,7 +34,7 @@
"livekit-server-sdk": "^2.16.0",
"lucide-react": "^0.577.0",
"next": "^16.2.6",
"node-appwrite": "^21.0.0",
"node-appwrite": "^18.0.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"string-similarity": "^4.0.4",
@ -3235,9 +3235,9 @@
}
},
"node_modules/appwrite": {
"version": "21.5.0",
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-21.5.0.tgz",
"integrity": "sha512-643bMRZVYXMluXvSXbdaLAi9qqTJLWbVGguKH4vH6IdKHur6gGIirhCOqAEt33pV4TOFJ55VBu8c/+Ft1ke2SA==",
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-18.0.0.tgz",
"integrity": "sha512-19qs1dj6s/6MbC1Ds6PuwR7qA5p2zGs4fPVIgSItP3kiBnm5+ScA4FNkBbwrT99Kq+mcfG3LA1GRJDOkPMUkxQ==",
"license": "BSD-3-Clause"
},
"node_modules/argparse": {
@ -6976,9 +6976,9 @@
}
},
"node_modules/node-appwrite": {
"version": "21.1.0",
"resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-21.1.0.tgz",
"integrity": "sha512-HRK5BzN19vgvaH/EeNsigK24t4ngJ1AoiltK5JtahxP6uyMRztzkD8cXP+z9jj/xOjz7ySfQ9YypNyhNr6zVkA==",
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-18.0.0.tgz",
"integrity": "sha512-2S0T17H2Gm5ZcdInCmHk8Pc8P6mKW8cDCoSBNF3PYGxbKjT51V/HY/2n6IPRqk2HrHPySmx3JIMN+V6QBprqAw==",
"license": "BSD-3-Clause",
"dependencies": {
"node-fetch-native-with-agent": "1.7.2"

View File

@ -25,7 +25,7 @@
"@tiptap/starter-kit": "^3.21.0",
"@types/dompurify": "^3.0.5",
"@types/video.js": "^7.3.58",
"appwrite": "^21.0.0",
"appwrite": "^18.0.0",
"axios": "^1.18.0",
"cheerio": "^1.2.0",
"clsx": "^2.1.1",
@ -36,7 +36,7 @@
"livekit-server-sdk": "^2.16.0",
"lucide-react": "^0.577.0",
"next": "^16.2.6",
"node-appwrite": "^21.0.0",
"node-appwrite": "^18.0.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"string-similarity": "^4.0.4",

View File

@ -94,7 +94,7 @@ export default async function EntityPage({
const ids = Array.from(new Set(
response.documents
.map(d => typeof d[field.name] === 'object' && d[field.name] !== null ? d[field.name].$id : d[field.name])
.filter(id => typeof id === 'string' && id.length > 0)
.filter(id => typeof id === 'string' && id.length > 0) as string[]
));
if (ids.length === 0) {

View File

@ -72,10 +72,10 @@ async function fetchHomeData(page: number = 1, isAdmin: boolean = false, adminMo
totalPages = Math.ceil(postsRes.total / postsCount);
// 3. Resolve Media
const mediaIds = posts.map(p => p.imagen_destacada_id).filter(id => id && typeof id === 'string');
const mediaIds = posts.map(p => p.imagen_destacada_id).filter(id => id && typeof id === 'string') as string[];
if (mediaIds.length > 0) {
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
Query.equal('$id', mediaIds)
Query.equal('$id', mediaIds as string[])
]);
const mediaMap = new Map<string, MediaItem>(mediaRes.documents.map(m => [m.$id, m as unknown as MediaItem]));
posts = posts.map(p => JSON.parse(JSON.stringify({

View File

@ -46,7 +46,7 @@ export async function GlobalTopBanner() {
});
// Resolver media
const mediaIds = banners.map(p => p.imagen_destacada_id).filter(id => id && typeof id === 'string');
const mediaIds = banners.map(p => p.imagen_destacada_id).filter(id => id && typeof id === 'string') as string[];
if (mediaIds.length > 0) {
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
Query.equal('$id', mediaIds)

View File

@ -42,7 +42,7 @@ export default async function NewsTicker() {
]);
// Resolve Media
const mediaIds = postsRes.documents.map((p: any) => p.imagen_destacada_id).filter((id: any) => id && typeof id === 'string');
const mediaIds = postsRes.documents.map((p: any) => p.imagen_destacada_id).filter((id: any) => id && typeof id === 'string') as string[];
const mediaMap = new Map();
if (mediaIds.length > 0) {
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [