diff --git a/package.json b/package.json index 7438f6ce7..71e75ba6a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@ai-sdk/svelte": "^1.1.24", - "@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@56743f5", + "@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@4ca420f", "@appwrite.io/pink-icons": "0.25.0", "@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1", "@appwrite.io/pink-legacy": "^1.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 366c30233..9da094eea 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^1.1.24 version: 1.1.24(svelte@5.25.3)(zod@3.24.3) '@appwrite.io/console': - specifier: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@56743f5 - version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@56743f5 + specifier: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@4ca420f + version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@4ca420f '@appwrite.io/pink-icons': specifier: 0.25.0 version: 0.25.0 @@ -257,8 +257,8 @@ packages: '@analytics/type-utils@0.6.2': resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==} - '@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@56743f5': - resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@56743f5} + '@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@4ca420f': + resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@4ca420f} version: 1.9.0 '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@d521606fc63e0800b996f0fbb1a8d1f6907480ed': @@ -3636,7 +3636,7 @@ snapshots: '@analytics/type-utils@0.6.2': {} - '@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@56743f5': {} + '@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@4ca420f': {} '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@d521606fc63e0800b996f0fbb1a8d1f6907480ed(svelte@5.25.3)': dependencies: diff --git a/src/lib/commandCenter/panels/ai.svelte b/src/lib/commandCenter/panels/ai.svelte index 5f92593d2..b764cfd76 100644 --- a/src/lib/commandCenter/panels/ai.svelte +++ b/src/lib/commandCenter/panels/ai.svelte @@ -24,11 +24,10 @@ streamProtocol: 'text' }); - // TODO: change collections to tables after docs are updated! const examples = [ 'How to add platform in the console?', 'How can I manage users, permissions, and access control in Appwrite?', - 'How can I set up database collections and documents in Appwrite?', + 'How can I set up database tables and rows in Appwrite?', 'How do I configure and manage server-side functions in Appwrite?', 'How to add custom domain in the console?' ]; diff --git a/src/lib/commandCenter/searchers/tables.ts b/src/lib/commandCenter/searchers/tables.ts index 448b6f43f..1a8af1411 100644 --- a/src/lib/commandCenter/searchers/tables.ts +++ b/src/lib/commandCenter/searchers/tables.ts @@ -1,27 +1,25 @@ import { goto } from '$app/navigation'; -import { database } from '$routes/(console)/project-[region]-[project]/databases/database-[database]/store'; -import { get } from 'svelte/store'; import type { Searcher } from '../commands'; import { sdk } from '$lib/stores/sdk'; import { base } from '$app/paths'; import { page } from '$app/state'; export const tablesSearcher = (async (query: string) => { - const databaseId = get(database).$id; - const { collections } = await sdk + const databaseId = page.params.database; + const { tables } = await sdk .forProject(page.params.region, page.params.project) - .databases.listCollections(databaseId); + .tables.list(databaseId); - return collections - .filter((col) => col.name.toLowerCase().includes(query.toLowerCase())) + return tables + .filter((table) => table.name.toLowerCase().includes(query.toLowerCase())) .map( - (col) => + (table) => ({ group: 'tables', - label: col.name, + label: table.name, callback: () => { goto( - `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/table-${col.$id}` + `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/table-${table.$id}` ); } }) as const diff --git a/src/lib/components/columnSelector.svelte b/src/lib/components/columnSelector.svelte index 8deaa87a0..dfcc7e2d4 100644 --- a/src/lib/components/columnSelector.svelte +++ b/src/lib/components/columnSelector.svelte @@ -33,7 +33,7 @@ onMount(async () => { if (isCustomCollection) { - const prefs = preferences.getCustomCollectionColumns(page.params.table); + const prefs = preferences.getCustomTableColumns(page.params.table); columns.set( $columns.map((column) => { column.hide = prefs?.includes(column.id) ?? false; diff --git a/src/lib/components/csvImportBox.svelte b/src/lib/components/csvImportBox.svelte index 06a013aed..443463d00 100644 --- a/src/lib/components/csvImportBox.svelte +++ b/src/lib/components/csvImportBox.svelte @@ -13,7 +13,7 @@ type ImportItem = { status: string; - collection?: string; + table?: string; }; type ImportItemsMap = Map; @@ -22,15 +22,11 @@ * Keeps a track of the active and ongoing csv migrations. * * The structure is as follows - - * `{ migrationId: { status: status, collection: collection } }` + * `{ migrationId: { status: status, table: table } }` */ const importItems: Writable = writable(new Map()); - async function showCompletionNotification( - database: string, - collection: string, - payload: Payload - ) { + async function showCompletionNotification(database: string, table: string, payload: Payload) { const isSuccess = payload.status === 'completed'; const isError = !isSuccess && !!payload.errors; @@ -48,15 +44,15 @@ const type = isSuccess ? 'success' : 'error'; const message = isError ? errorMessage : 'CSV import finished successfully.'; - const url = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${database}/table-${collection}`; + const url = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${database}/table-${table}`; addNotification({ type, message, isHtml: true, buttons: - isSuccess && collection !== page.params.collection - ? [{ name: 'View documents', method: () => goto(url) }] + isSuccess && table !== page.params.table + ? [{ name: 'View rows', method: () => goto(url) }] : undefined }); @@ -70,19 +66,19 @@ const status = importData.status; const resourceId = importData.resourceId ?? ''; - const [databaseId, collectionId] = resourceId.split(':') ?? []; + const [databaseId, tableId] = resourceId.split(':') ?? []; const current = $importItems.get(importData.$id); - let collectionName = current?.collection ?? null; + let tableName = current?.table ?? null; - if (!collectionName && collectionId) { + if (!tableName && tableId) { try { - const collection = await sdk + const table = await sdk .forProject(page.params.region, page.params.project) - .databases.getCollection(databaseId, collectionId); - collectionName = collection.name; + .tables.get(databaseId, tableId); + tableName = table.name; } catch { - collectionName = null; + tableName = null; } } @@ -99,12 +95,12 @@ if (shouldSkip) return items; const next = new Map(items); - next.set(importData.$id, { status, collection: collectionName ?? undefined }); + next.set(importData.$id, { status, table: tableName ?? undefined }); return next; }); if (status === 'completed' || status === 'failed') { - await showCompletionNotification(databaseId, collectionId, importData); + await showCompletionNotification(databaseId, tableId, importData); } } @@ -172,7 +168,7 @@

- Importing documents ({$importItems.size}) + Importing rows ({$importItems.size})

+ ariaLabel="create buckets">Documentation - {#if isLoadingDocumentsCount} + {#if isLoadingRowsCount}
{/if} - {:else if collectionItems.length > 25} + {:else if tableItems.length > 25} {/if} {#if !$isSmallViewport}