Downgrade Appwrite SDK to v18 to match Appwrite Server 1.8.1 and fix Query.equal type errors
This commit is contained in:
parent
89265cdbef
commit
b637a2e445
Binary file not shown.
16
package-lock.json
generated
16
package-lock.json
generated
@ -23,7 +23,7 @@
|
|||||||
"@tiptap/starter-kit": "^3.21.0",
|
"@tiptap/starter-kit": "^3.21.0",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/video.js": "^7.3.58",
|
"@types/video.js": "^7.3.58",
|
||||||
"appwrite": "^21.0.0",
|
"appwrite": "^18.0.0",
|
||||||
"axios": "^1.18.0",
|
"axios": "^1.18.0",
|
||||||
"cheerio": "^1.2.0",
|
"cheerio": "^1.2.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
@ -34,7 +34,7 @@
|
|||||||
"livekit-server-sdk": "^2.16.0",
|
"livekit-server-sdk": "^2.16.0",
|
||||||
"lucide-react": "^0.577.0",
|
"lucide-react": "^0.577.0",
|
||||||
"next": "^16.2.6",
|
"next": "^16.2.6",
|
||||||
"node-appwrite": "^21.0.0",
|
"node-appwrite": "^18.0.0",
|
||||||
"react": "19.2.3",
|
"react": "19.2.3",
|
||||||
"react-dom": "19.2.3",
|
"react-dom": "19.2.3",
|
||||||
"string-similarity": "^4.0.4",
|
"string-similarity": "^4.0.4",
|
||||||
@ -3235,9 +3235,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/appwrite": {
|
"node_modules/appwrite": {
|
||||||
"version": "21.5.0",
|
"version": "18.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-21.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-18.0.0.tgz",
|
||||||
"integrity": "sha512-643bMRZVYXMluXvSXbdaLAi9qqTJLWbVGguKH4vH6IdKHur6gGIirhCOqAEt33pV4TOFJ55VBu8c/+Ft1ke2SA==",
|
"integrity": "sha512-19qs1dj6s/6MbC1Ds6PuwR7qA5p2zGs4fPVIgSItP3kiBnm5+ScA4FNkBbwrT99Kq+mcfG3LA1GRJDOkPMUkxQ==",
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause"
|
||||||
},
|
},
|
||||||
"node_modules/argparse": {
|
"node_modules/argparse": {
|
||||||
@ -6976,9 +6976,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-appwrite": {
|
"node_modules/node-appwrite": {
|
||||||
"version": "21.1.0",
|
"version": "18.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-21.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-18.0.0.tgz",
|
||||||
"integrity": "sha512-HRK5BzN19vgvaH/EeNsigK24t4ngJ1AoiltK5JtahxP6uyMRztzkD8cXP+z9jj/xOjz7ySfQ9YypNyhNr6zVkA==",
|
"integrity": "sha512-2S0T17H2Gm5ZcdInCmHk8Pc8P6mKW8cDCoSBNF3PYGxbKjT51V/HY/2n6IPRqk2HrHPySmx3JIMN+V6QBprqAw==",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-fetch-native-with-agent": "1.7.2"
|
"node-fetch-native-with-agent": "1.7.2"
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
"@tiptap/starter-kit": "^3.21.0",
|
"@tiptap/starter-kit": "^3.21.0",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/video.js": "^7.3.58",
|
"@types/video.js": "^7.3.58",
|
||||||
"appwrite": "^21.0.0",
|
"appwrite": "^18.0.0",
|
||||||
"axios": "^1.18.0",
|
"axios": "^1.18.0",
|
||||||
"cheerio": "^1.2.0",
|
"cheerio": "^1.2.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"livekit-server-sdk": "^2.16.0",
|
"livekit-server-sdk": "^2.16.0",
|
||||||
"lucide-react": "^0.577.0",
|
"lucide-react": "^0.577.0",
|
||||||
"next": "^16.2.6",
|
"next": "^16.2.6",
|
||||||
"node-appwrite": "^21.0.0",
|
"node-appwrite": "^18.0.0",
|
||||||
"react": "19.2.3",
|
"react": "19.2.3",
|
||||||
"react-dom": "19.2.3",
|
"react-dom": "19.2.3",
|
||||||
"string-similarity": "^4.0.4",
|
"string-similarity": "^4.0.4",
|
||||||
|
|||||||
@ -94,7 +94,7 @@ export default async function EntityPage({
|
|||||||
const ids = Array.from(new Set(
|
const ids = Array.from(new Set(
|
||||||
response.documents
|
response.documents
|
||||||
.map(d => typeof d[field.name] === 'object' && d[field.name] !== null ? d[field.name].$id : d[field.name])
|
.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) {
|
if (ids.length === 0) {
|
||||||
|
|||||||
@ -72,10 +72,10 @@ async function fetchHomeData(page: number = 1, isAdmin: boolean = false, adminMo
|
|||||||
totalPages = Math.ceil(postsRes.total / postsCount);
|
totalPages = Math.ceil(postsRes.total / postsCount);
|
||||||
|
|
||||||
// 3. Resolve Media
|
// 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) {
|
if (mediaIds.length > 0) {
|
||||||
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
|
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]));
|
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({
|
posts = posts.map(p => JSON.parse(JSON.stringify({
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export async function GlobalTopBanner() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Resolver media
|
// 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) {
|
if (mediaIds.length > 0) {
|
||||||
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
|
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
|
||||||
Query.equal('$id', mediaIds)
|
Query.equal('$id', mediaIds)
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export default async function NewsTicker() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Resolve Media
|
// 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();
|
const mediaMap = new Map();
|
||||||
if (mediaIds.length > 0) {
|
if (mediaIds.length > 0) {
|
||||||
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
|
const mediaRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'media', [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user