diff --git a/package.json b/package.json index 15cb88fa7f..50b4029dce 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@ai-sdk/svelte": "^1.1.24", - "@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@9b32107", + "@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@7a147b9", "@appwrite.io/pink-icons": "0.25.0", "@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@865e2fc", "@appwrite.io/pink-legacy": "^1.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f7492f49f0..ce01083e0f 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.vc/-/@appwrite/@appwrite.io/console@9b32107 - version: https://pkg.vc/-/@appwrite/@appwrite.io/console@9b32107 + specifier: https://pkg.vc/-/@appwrite/@appwrite.io/console@7a147b9 + version: https://pkg.vc/-/@appwrite/@appwrite.io/console@7a147b9 '@appwrite.io/pink-icons': specifier: 0.25.0 version: 0.25.0 @@ -272,8 +272,8 @@ packages: '@analytics/type-utils@0.6.2': resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==} - '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@9b32107': - resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@9b32107} + '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@7a147b9': + resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@7a147b9} version: 1.10.0 '@appwrite.io/pink-icons-svelte@2.0.0-RC.1': @@ -3823,7 +3823,7 @@ snapshots: '@analytics/type-utils@0.6.2': {} - '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@9b32107': {} + '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@7a147b9': {} '@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)': dependencies: diff --git a/src/lib/commandCenter/searchers/organizations.ts b/src/lib/commandCenter/searchers/organizations.ts index c24f38799e..9df8003a17 100644 --- a/src/lib/commandCenter/searchers/organizations.ts +++ b/src/lib/commandCenter/searchers/organizations.ts @@ -1,16 +1,10 @@ +import { resolve } from '$app/paths'; import { goto } from '$app/navigation'; -import { base } from '$app/paths'; -import { sdk } from '$lib/stores/sdk'; import type { Searcher } from '../commands'; -import { isCloud } from '$lib/system'; -import { Platform, Query } from '@appwrite.io/console'; +import { getTeamOrOrganizationList } from '$lib/stores/organization'; export const orgSearcher = (async (query: string) => { - const { teams } = !isCloud - ? await sdk.forConsole.teams.list() - : await sdk.forConsole.billing.listOrganization([ - Query.equal('platform', Platform.Appwrite) - ]); + const { teams } = await getTeamOrOrganizationList(); return teams .filter((organization) => organization.name.toLowerCase().includes(query.toLowerCase())) @@ -18,7 +12,11 @@ export const orgSearcher = (async (query: string) => { return { label: organization.name, callback: () => { - goto(`${base}/organization-${organization.$id}`); + goto( + resolve('/(console)/organization-[organization]', { + organization: organization.$id + }) + ); }, group: 'organizations' } as const; diff --git a/src/lib/components/archiveProject.svelte b/src/lib/components/archiveProject.svelte index 8a9797ca09..a8b7362842 100644 --- a/src/lib/components/archiveProject.svelte +++ b/src/lib/components/archiveProject.svelte @@ -37,14 +37,12 @@ import { isSmallViewport } from '$lib/stores/viewport'; import { isCloud } from '$lib/system'; import { regions as regionsStore } from '$lib/stores/organization'; - import type { Organization } from '$lib/stores/organization'; - import type { Plan } from '$lib/sdk/billing'; // props interface Props { + currentPlan: Models.BillingPlan; + organization: Models.Organization; projectsToArchive: Models.Project[]; - organization: Organization; - currentPlan: Plan; } let { projectsToArchive, organization, currentPlan }: Props = $props(); diff --git a/src/lib/components/billing/alerts/limitReached.svelte b/src/lib/components/billing/alerts/limitReached.svelte index 4885db75e1..12605cded4 100644 --- a/src/lib/components/billing/alerts/limitReached.svelte +++ b/src/lib/components/billing/alerts/limitReached.svelte @@ -5,16 +5,21 @@ import { BillingPlan } from '$lib/constants'; import { Button } from '$lib/elements/forms'; import { HeaderAlert } from '$lib/layout'; - import { hideBillingHeaderRoutes, readOnly, tierToPlan, upgradeURL } from '$lib/stores/billing'; + import { + hideBillingHeaderRoutes, + readOnly, + billingIdToPlan, + upgradeURL + } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; {#if $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes(page.url.pathname)} + title={`${$organization.name} usage has reached the ${billingIdToPlan($organization.billingPlan).name} plan limit`}> - Usage for the {$organization.name} organization has reached the limits of the {tierToPlan( + Usage for the {$organization.name} organization has reached the limits of the {billingIdToPlan( $organization.billingPlan ).name} plan. Consider upgrading to increase your resource usage. diff --git a/src/lib/components/billing/alerts/paymentMandate.svelte b/src/lib/components/billing/alerts/paymentMandate.svelte index 08d9207d73..0126f2f9a0 100644 --- a/src/lib/components/billing/alerts/paymentMandate.svelte +++ b/src/lib/components/billing/alerts/paymentMandate.svelte @@ -8,10 +8,9 @@ import { confirmSetup } from '$lib/stores/stripe'; async function verifyPaymentMethod() { - const method = await sdk.forConsole.billing.setupPaymentMandate( - $organization.$id, - $paymentMissingMandate.$id - ); + const method = await sdk.forConsole.account.updatePaymentMethodMandateOptions({ + paymentMethodId: $paymentMissingMandate.$id + }); await confirmSetup(method.clientSecret, method.providerMethodId); } diff --git a/src/lib/components/billing/alerts/selectProjectCloud.svelte b/src/lib/components/billing/alerts/selectProjectCloud.svelte index 510334aa2e..192cf92db9 100644 --- a/src/lib/components/billing/alerts/selectProjectCloud.svelte +++ b/src/lib/components/billing/alerts/selectProjectCloud.svelte @@ -31,10 +31,10 @@ async function updateSelected() { try { - await sdk.forConsole.billing.updateSelectedProjects( - projects[0].teamId, - selectedProjects - ); + await sdk.forConsole.organizations.updateProjects({ + organizationId: projects[0].teamId, + projects: selectedProjects + }); showSelectProject = false; invalidate(Dependencies.ORGANIZATION); diff --git a/src/lib/components/billing/couponInput.svelte b/src/lib/components/billing/couponInput.svelte index 85e73411c0..fc33df37df 100644 --- a/src/lib/components/billing/couponInput.svelte +++ b/src/lib/components/billing/couponInput.svelte @@ -1,16 +1,16 @@ - + {#if children} + {@render children()} + {:else} Upgrade to add {service} - Upgrade to a {tierToPlan(BillingPlan.PRO).name} plan to add {service} to your organization + Upgrade to a {proPlanName} plan to add {service} to your organization