From e57444fc5026ed440adf928a08327bb6571aba65 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Tue, 23 Dec 2025 12:48:31 +0530 Subject: [PATCH 01/13] fix: tooltip content truncated in billing ui table --- src/lib/components/progressbar/ProgressBar.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/progressbar/ProgressBar.svelte b/src/lib/components/progressbar/ProgressBar.svelte index a4cebc8ee..5d1b6e9cf 100644 --- a/src/lib/components/progressbar/ProgressBar.svelte +++ b/src/lib/components/progressbar/ProgressBar.svelte @@ -22,7 +22,7 @@
{#each $$props.data as item} - +
Date: Tue, 23 Dec 2025 12:53:27 +0530 Subject: [PATCH 02/13] Update ProgressBar.svelte --- src/lib/components/progressbar/ProgressBar.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/progressbar/ProgressBar.svelte b/src/lib/components/progressbar/ProgressBar.svelte index 5d1b6e9cf..4591e706e 100644 --- a/src/lib/components/progressbar/ProgressBar.svelte +++ b/src/lib/components/progressbar/ProgressBar.svelte @@ -22,7 +22,7 @@
{#each $$props.data as item} - +
Date: Tue, 23 Dec 2025 13:52:24 +0530 Subject: [PATCH 03/13] fix: add `organizationId`. --- src/lib/sdk/billing.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/sdk/billing.ts b/src/lib/sdk/billing.ts index f728ca5e8..11b5ba519 100644 --- a/src/lib/sdk/billing.ts +++ b/src/lib/sdk/billing.ts @@ -1424,10 +1424,10 @@ export class Billing { ); } - async listRegions(teamId: string): Promise { + async listRegions(organizationId: string): Promise { const path = `/console/regions`; const params = { - teamId + organizationId }; const uri = new URL(this.client.config.endpoint + path); return await this.client.call( From 66dafc601f49ae473cd9e3c3a1dbc7ea8d6635a6 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 23 Dec 2025 16:19:59 +0530 Subject: [PATCH 04/13] update: use `billingPlanId`. --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/lib/components/backupDatabaseAlert.svelte | 2 +- src/lib/components/backupRestoreBox.svelte | 2 +- .../components/billing/alerts/limitReached.svelte | 6 +++--- .../billing/alerts/missingPaymentMethod.svelte | 2 +- .../billing/alerts/newDevUpgradePro.svelte | 2 +- src/lib/components/billing/planExcess.svelte | 4 ++-- src/lib/components/billing/planSelection.svelte | 4 ++-- src/lib/components/billing/selectPlan.svelte | 2 +- src/lib/components/billing/usageRates.svelte | 8 ++++---- src/lib/components/bottomModalAlert.svelte | 2 +- src/lib/components/breadcrumbs.svelte | 2 +- src/lib/components/emptyCardImageCloud.svelte | 2 +- src/lib/components/feedback/feedback.svelte | 2 +- src/lib/components/roles/upgrade.svelte | 2 +- src/lib/components/support.svelte | 4 ++-- src/lib/layout/containerButton.svelte | 4 ++-- src/lib/layout/containerHeader.svelte | 14 +++++++------- src/lib/layout/createProject.svelte | 2 +- src/lib/stores/billing.ts | 10 +++++----- src/lib/stores/organization.ts | 3 ++- src/routes/(console)/+layout.svelte | 4 ++-- .../(console)/account/organizations/+page.svelte | 10 +++++----- src/routes/(console)/apply-credit/+page.svelte | 10 +++++----- src/routes/(console)/create-organization/+page.ts | 2 +- .../organization-[organization]/+page.svelte | 2 +- .../billing/+page.svelte | 8 +++++--- .../organization-[organization]/billing/+page.ts | 4 ++-- .../billing/availableCredit.svelte | 4 ++-- .../billing/budgetAlert.svelte | 4 ++-- .../billing/budgetCap.svelte | 2 +- .../billing/deleteOrgPayment.svelte | 4 ++-- .../billing/paymentMethods.svelte | 2 +- .../billing/planSummary.svelte | 2 +- .../billing/planSummaryOld.svelte | 9 +++++---- .../budgetLimitAlert.svelte | 2 +- .../change-plan/+page.svelte | 10 +++++----- .../change-plan/+page.ts | 2 +- .../organization-[organization]/header.svelte | 10 +++++----- .../members/+page.svelte | 6 +++--- .../usage/[[invoice]]/+page.svelte | 10 +++++----- .../usage/[[invoice]]/totalMembers.svelte | 8 ++++---- .../project-[region]-[project]/+layout.ts | 6 +++--- .../functions/+page.svelte | 6 +++++- .../create-function/(components)/details.svelte | 2 +- .../settings/updateResourceLimits.svelte | 2 +- .../functions/templates/+page.svelte | 2 +- .../templates/template-[template]/+page.svelte | 3 ++- .../settings/migrations/exportModal.svelte | 2 +- .../settings/smtp/+page.svelte | 4 ++-- .../settings/usage/[[invoice]]/+page.svelte | 10 +++++----- .../project-[region]-[project]/sites/+page.svelte | 2 +- .../settings/updateResourceLimits.svelte | 2 +- .../settings/updateMaxFileSize.svelte | 2 +- src/routes/(console)/supportWizard.svelte | 2 +- src/routes/(console)/wizard/feedback/step1.svelte | 2 +- 57 files changed, 131 insertions(+), 122 deletions(-) diff --git a/package.json b/package.json index 15cb88fa7..d1861c08f 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@8d430f8", "@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 f7492f49f..372b725b1 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@8d430f8 + version: https://pkg.vc/-/@appwrite/@appwrite.io/console@8d430f8 '@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@8d430f8': + resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@8d430f8} 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@8d430f8': {} '@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)': dependencies: diff --git a/src/lib/components/backupDatabaseAlert.svelte b/src/lib/components/backupDatabaseAlert.svelte index 1c2ceed16..932a14e22 100644 --- a/src/lib/components/backupDatabaseAlert.svelte +++ b/src/lib/components/backupDatabaseAlert.svelte @@ -18,7 +18,7 @@ {#if $showPolicyAlert && isCloud && $organization?.$id && page.url.pathname.match(/\/databases\/database-[^/]+$/)} - {@const isFreePlan = $organization?.billingPlan === BillingPlan.FREE} + {@const isFreePlan = $organization?.billingPlanId === BillingPlan.FREE} {@const subtitle = isFreePlan ? 'Upgrade your plan to ensure your data stays safe and backed up' diff --git a/src/lib/components/backupRestoreBox.svelte b/src/lib/components/backupRestoreBox.svelte index f1de9d3ba..f4d6c5fff 100644 --- a/src/lib/components/backupRestoreBox.svelte +++ b/src/lib/components/backupRestoreBox.svelte @@ -125,7 +125,7 @@ onMount(() => { // fast path: don't subscribe if org is on a free plan or is self-hosted. - if (isSelfHosted || (isCloud && $organization?.billingPlan === BillingPlan.FREE)) return; + if (isSelfHosted || (isCloud && $organization?.billingPlanId === BillingPlan.FREE)) return; return realtime.forProject(page.params.region, 'console', (response) => { if (!response.channels.includes(`projects.${getProjectId()}`)) return; diff --git a/src/lib/components/billing/alerts/limitReached.svelte b/src/lib/components/billing/alerts/limitReached.svelte index 4885db75e..e99e38575 100644 --- a/src/lib/components/billing/alerts/limitReached.svelte +++ b/src/lib/components/billing/alerts/limitReached.svelte @@ -9,13 +9,13 @@ import { organization } from '$lib/stores/organization'; -{#if $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes(page.url.pathname)} +{#if $organization?.$id && $organization?.billingPlanId === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes(page.url.pathname)} + title={`${$organization.name} usage has reached the ${tierToPlan($organization.billingPlanId).name} plan limit`}> Usage for the {$organization.name} organization has reached the limits of the {tierToPlan( - $organization.billingPlan + $organization.billingPlanId ).name} plan. Consider upgrading to increase your resource usage. diff --git a/src/lib/components/billing/alerts/missingPaymentMethod.svelte b/src/lib/components/billing/alerts/missingPaymentMethod.svelte index 96c29c5d7..ac0b25be4 100644 --- a/src/lib/components/billing/alerts/missingPaymentMethod.svelte +++ b/src/lib/components/billing/alerts/missingPaymentMethod.svelte @@ -8,7 +8,7 @@ import { orgMissingPaymentMethod } from '$routes/(console)/store'; -{#if ($orgMissingPaymentMethod.billingPlan === BillingPlan.PRO || $orgMissingPaymentMethod.billingPlan === BillingPlan.SCALE) && !$orgMissingPaymentMethod.paymentMethodId && !$orgMissingPaymentMethod.backupPaymentMethodId && !hideBillingHeaderRoutes.includes(page.url.pathname)} +{#if ($orgMissingPaymentMethod.billingPlanId === BillingPlan.PRO || $orgMissingPaymentMethod.billingPlanId === BillingPlan.SCALE) && !$orgMissingPaymentMethod.paymentMethodId && !$orgMissingPaymentMethod.backupPaymentMethodId && !hideBillingHeaderRoutes.includes(page.url.pathname)} diff --git a/src/lib/components/billing/alerts/newDevUpgradePro.svelte b/src/lib/components/billing/alerts/newDevUpgradePro.svelte index 733736f02..f6542b1ee 100644 --- a/src/lib/components/billing/alerts/newDevUpgradePro.svelte +++ b/src/lib/components/billing/alerts/newDevUpgradePro.svelte @@ -23,7 +23,7 @@ } -{#if show && $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && !page.url.pathname.includes(base + '/account')} +{#if show && $organization?.$id && $organization?.billingPlanId === BillingPlan.FREE && !page.url.pathname.includes(base + '/account')} - You will retain access to {tierToPlan($organization.billingPlan).name} plan features until your - billing period ends. After that, + You will retain access to {tierToPlan($organization.billingPlanId).name} plan features until + your billing period ends. After that, {#if excess?.members > 0} all team members except the owner will be removed, {:else} diff --git a/src/lib/components/billing/planSelection.svelte b/src/lib/components/billing/planSelection.svelte index 6499a47c0..be0754887 100644 --- a/src/lib/components/billing/planSelection.svelte +++ b/src/lib/components/billing/planSelection.svelte @@ -35,7 +35,7 @@ value={plan.$id} title={plan.name}> - {#if $organization?.billingPlan === plan.$id && !isNewOrg} + {#if $organization?.billingPlanId === plan.$id && !isNewOrg} {/if} @@ -61,7 +61,7 @@ value={$currentPlan.$id} title={$currentPlan.name}> - {#if $organization?.billingPlan === $currentPlan.$id && !isNewOrg} + {#if $organization?.billingPlanId === $currentPlan.$id && !isNewOrg} {/if} diff --git a/src/lib/components/billing/selectPlan.svelte b/src/lib/components/billing/selectPlan.svelte index 2b9d9498f..50de90d7c 100644 --- a/src/lib/components/billing/selectPlan.svelte +++ b/src/lib/components/billing/selectPlan.svelte @@ -31,7 +31,7 @@ class:u-opacity-50={disabled}>

{plan.name} - {#if $organization?.billingPlan === plan.$id && !isNewOrg} + {#if $organization?.billingPlanId === plan.$id && !isNewOrg} Current plan {/if}

diff --git a/src/lib/components/billing/usageRates.svelte b/src/lib/components/billing/usageRates.svelte index 49ab414e9..50a20e1a1 100644 --- a/src/lib/components/billing/usageRates.svelte +++ b/src/lib/components/billing/usageRates.svelte @@ -11,13 +11,13 @@ export let show = false; export let org: Organization; - $: plan = $plansInfo?.get(org.billingPlan); + $: plan = $plansInfo?.get(org.billingPlanId); $: nextDate = org?.name ? new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1).toString() : org?.billingNextInvoiceDate; - $: isFree = org.billingPlan === BillingPlan.FREE; + $: isFree = org.billingPlanId === BillingPlan.FREE; // equal or above means unlimited! const getCorrectSeatsCountValue = (count: number): string | number => { @@ -37,12 +37,12 @@ Usage on the {$plansInfo?.get(BillingPlan.FREE).name} plan is limited for the following resources. Next billing period: {toLocaleDate(nextDate)}. - {:else if org.billingPlan === BillingPlan.PRO} + {:else if org.billingPlanId === BillingPlan.PRO} Usage on the Pro plan will be charged at the end of each billing period at the following rates. Next billing period: {toLocaleDate(nextDate)}. - {:else if org.billingPlan === BillingPlan.SCALE} + {:else if org.billingPlanId === BillingPlan.SCALE} Usage on the Scale plan will be charged at the end of each billing period at the following rates. Next billing period: {toLocaleDate(nextDate)}. diff --git a/src/lib/components/bottomModalAlert.svelte b/src/lib/components/bottomModalAlert.svelte index 623a510c1..982a24273 100644 --- a/src/lib/components/bottomModalAlert.svelte +++ b/src/lib/components/bottomModalAlert.svelte @@ -172,7 +172,7 @@ function showUpgrade() { const plan = currentModalAlert.plan; - const organizationPlan = $organization?.billingPlan; + const organizationPlan = $organization?.billingPlanId; switch (plan) { case 'free': return false; diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index 7f1a59c47..4ed7a539a 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -254,7 +254,7 @@ let badgeType: 'success' | undefined; $: badgeType = - $organization && $organization.billingPlan !== BillingPlan.FREE ? 'success' : undefined; + $organization && $organization.billingPlanId !== BillingPlan.FREE ? 'success' : undefined; diff --git a/src/lib/components/emptyCardImageCloud.svelte b/src/lib/components/emptyCardImageCloud.svelte index 0f4c23450..f06d74369 100644 --- a/src/lib/components/emptyCardImageCloud.svelte +++ b/src/lib/components/emptyCardImageCloud.svelte @@ -24,7 +24,7 @@ - + diff --git a/src/lib/components/feedback/feedback.svelte b/src/lib/components/feedback/feedback.svelte index ed500aa15..1b151c5d9 100644 --- a/src/lib/components/feedback/feedback.svelte +++ b/src/lib/components/feedback/feedback.svelte @@ -25,7 +25,7 @@ page.url.href, $user.name, $user.email, - $organization?.billingPlan, + $organization?.billingPlanId, $feedbackData.value, $organization?.$id, $project?.$id, diff --git a/src/lib/components/roles/upgrade.svelte b/src/lib/components/roles/upgrade.svelte index b3f15e85b..c551f4cc1 100644 --- a/src/lib/components/roles/upgrade.svelte +++ b/src/lib/components/roles/upgrade.svelte @@ -11,7 +11,7 @@ {#if isCloud} - {#if $organization?.billingPlan !== BillingPlan.FREE} + {#if $organization?.billingPlanId !== BillingPlan.FREE} Roles Owner, Developer, Editor, Analyst and Billing. diff --git a/src/lib/components/support.svelte b/src/lib/components/support.svelte index d05d2639c..b7b3827ed 100644 --- a/src/lib/components/support.svelte +++ b/src/lib/components/support.svelte @@ -20,12 +20,12 @@ $: hasPremiumSupport = $currentPlan?.premiumSupport ?? allOrgsHavePremiumSupport ?? false; $: allOrgsHavePremiumSupport = $organizationList.teams.every( - (team) => $plansInfo.get((team as Organization).billingPlan)?.premiumSupport + (team) => $plansInfo.get((team as Organization).billingPlanId)?.premiumSupport ); // there can only be one free organization $: freeOrganization = $organizationList.teams.find( - (team) => !$plansInfo.get((team as Organization).billingPlan)?.premiumSupport + (team) => !$plansInfo.get((team as Organization).billingPlanId)?.premiumSupport ); $: upgradeURL = `${base}/organization-${freeOrganization?.$id}/change-plan`; diff --git a/src/lib/layout/containerButton.svelte b/src/lib/layout/containerButton.svelte index 53cfc35bf..e76cbf859 100644 --- a/src/lib/layout/containerButton.svelte +++ b/src/lib/layout/containerButton.svelte @@ -7,10 +7,10 @@ export let title: string; export let tooltipContent = - $organization?.billingPlan === BillingPlan.FREE + $organization?.billingPlanId === BillingPlan.FREE ? `Upgrade to add more ${title.toLocaleLowerCase()}` : `You've reached the ${title.toLocaleLowerCase()} limit for the ${ - tierToPlan($organization?.billingPlan)?.name + tierToPlan($organization?.billingPlanId)?.name } plan`; export let disabled: boolean; export let buttonText: string; diff --git a/src/lib/layout/containerHeader.svelte b/src/lib/layout/containerHeader.svelte index 84fe96607..893c055ed 100644 --- a/src/lib/layout/containerHeader.svelte +++ b/src/lib/layout/containerHeader.svelte @@ -64,13 +64,13 @@ }; const dispatch = createEventDispatcher(); - $: tier = tierToPlan($organization?.billingPlan)?.name; + $: tier = tierToPlan($organization?.billingPlanId)?.name; // these can be organization level limitations as well. // we need to migrate this sometime later, but soon! $: hasProjectLimitation = - checkForProjectLimitation(serviceId) && $organization?.billingPlan === BillingPlan.FREE; + checkForProjectLimitation(serviceId) && $organization?.billingPlanId === BillingPlan.FREE; $: hasUsageFees = hasProjectLimitation - ? checkForUsageFees($organization?.billingPlan, serviceId) + ? checkForUsageFees($organization?.billingPlanId, serviceId) : false; $: isLimited = limit !== 0 && limit < Infinity; $: overflowingServices = limitedServices.filter((service) => service.value > 0); @@ -99,7 +99,7 @@ {#if services.length} - {#if $organization?.billingPlan !== BillingPlan.FREE && hasUsageFees} + {#if $organization?.billingPlanId !== BillingPlan.FREE && hasUsageFees} You've reached the {services} limit for the {tier} plan. @@ -135,7 +135,7 @@ on:click={() => (showDropdown = !showDropdown)}> - {:else if $organization?.billingPlan !== BillingPlan.SCALE} + {:else if $organization?.billingPlanId !== BillingPlan.SCALE} You are limited to {limit} {title.toLocaleLowerCase()} per project on the {tier} plan. - {#if $organization?.billingPlan === BillingPlan.FREE} You are limited to {limit} {title.toLocaleLowerCase()} per organization on the {tier} plan. - {#if $organization?.billingPlan === BillingPlan.FREE} + {#if $organization?.billingPlanId === BillingPlan.FREE} Upgrade for additional {title.toLocaleLowerCase()}. {/if} diff --git a/src/lib/layout/createProject.svelte b/src/lib/layout/createProject.svelte index c24e9234a..027dcc55d 100644 --- a/src/lib/layout/createProject.svelte +++ b/src/lib/layout/createProject.svelte @@ -35,7 +35,7 @@ } = $props(); let showCustomId = $state(false); - let isProPlan = $derived((billingPlan ?? $organization?.billingPlan) === BillingPlan.PRO); + let isProPlan = $derived((billingPlan ?? $organization?.billingPlanId) === BillingPlan.PRO); let projectsLimited = $derived( $currentPlan?.projects > 0 && projects && projects >= $currentPlan?.projects ); diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index 695ef874c..a03604ed8 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -264,7 +264,7 @@ export function checkForUsageFees(plan: Tier, id: PlanServices) { export function checkForProjectLimitation(id: PlanServices) { // Members are no longer limited on Pro and Scale plans (unlimited seats) if (id === 'members') { - const currentTier = get(organization)?.billingPlan; + const currentTier = get(organization)?.billingPlanId; if (currentTier === BillingPlan.PRO || currentTier === BillingPlan.SCALE) { return false; // No project limitation for members on Pro/Scale plans } @@ -321,7 +321,7 @@ export function calculateEnterpriseTrial(org: Organization) { } export function calculateTrialDay(org: Organization) { - if (org?.billingPlan === BillingPlan.FREE) return false; + if (org?.billingPlanId === BillingPlan.FREE) return false; const endDate = new Date(org?.billingStartDate); const today = new Date(); @@ -373,7 +373,7 @@ export async function checkForUsageLimit(org: Organization) { readOnly.set(false); return; } - if (org?.billingPlan !== BillingPlan.FREE) { + if (org?.billingPlanId !== BillingPlan.FREE) { const { budgetLimit } = org?.billingLimits ?? {}; if (budgetLimit && budgetLimit >= 100) { @@ -453,7 +453,7 @@ export async function checkForUsageLimit(org: Organization) { } export async function checkPaymentAuthorizationRequired(org: Organization) { - if (org.billingPlan === BillingPlan.FREE) return; + if (org.billingPlanId === BillingPlan.FREE) return; const invoices = await sdk.forConsole.billing.listInvoices(org.$id, [ Query.equal('status', 'requires_authentication') @@ -574,7 +574,7 @@ export async function checkForMissingPaymentMethod() { // Display upgrade banner for new users after 1 week for 30 days export async function checkForNewDevUpgradePro(org: Organization) { // browser or plan check. - if (!browser || org?.billingPlan !== BillingPlan.FREE) return; + if (!browser || org?.billingPlanId !== BillingPlan.FREE) return; // already dismissed by user! if (localStorage.getItem('newDevUpgradePro')) return; diff --git a/src/lib/stores/organization.ts b/src/lib/stores/organization.ts index 7393c6ed6..dc39db267 100644 --- a/src/lib/stores/organization.ts +++ b/src/lib/stores/organization.ts @@ -15,7 +15,8 @@ export type OrganizationError = { export type Organization = Models.Team> & { billingBudget: number; - billingPlan: Tier; + billingPlanId: Tier; + billingPlan: Plan; budgetAlerts: number[]; paymentMethodId: string; backupPaymentMethodId: string; diff --git a/src/routes/(console)/+layout.svelte b/src/routes/(console)/+layout.svelte index 109bdabb3..f17355b46 100644 --- a/src/routes/(console)/+layout.svelte +++ b/src/routes/(console)/+layout.svelte @@ -305,12 +305,12 @@ checkForMarkedForDeletion(org); await checkForNewDevUpgradePro(org); - if (org?.billingPlan !== BillingPlan.FREE) { + if (org?.billingPlanId !== BillingPlan.FREE) { await paymentExpired(org); await checkPaymentAuthorizationRequired(org); await checkForMandate(org); - if ($plansInfo.get(org.billingPlan)?.trialDays) { + if ($plansInfo.get(org.billingPlanId)?.trialDays) { calculateTrialDay(org); } } diff --git a/src/routes/(console)/account/organizations/+page.svelte b/src/routes/(console)/account/organizations/+page.svelte index 2d1668043..a54aacacb 100644 --- a/src/routes/(console)/account/organizations/+page.svelte +++ b/src/routes/(console)/account/organizations/+page.svelte @@ -60,15 +60,15 @@ function isOrganizationOnTrial(organization: Organization): boolean { if (!organization?.billingTrialStartDate) return false; if ($daysLeftInTrial <= 0) return false; - if (organization.billingPlan === BillingPlan.FREE) return false; + if (organization.billingPlanId === BillingPlan.FREE) return false; - return !!$plansInfo.get(organization.billingPlan)?.trialDays; + return !!$plansInfo.get(organization.billingPlanId)?.trialDays; } function isNonPayingOrganization(organization: Organization): boolean { return ( - organization?.billingPlan === BillingPlan.FREE || - organization?.billingPlan === BillingPlan.GITHUB_EDUCATION + organization?.billingPlanId === BillingPlan.FREE || + organization?.billingPlanId === BillingPlan.GITHUB_EDUCATION ); } @@ -114,7 +114,7 @@ {@const avatarList = getMemberships(organization.$id)} {@const payingOrg = isPayingOrganization(organization)} {@const planName = isCloudOrg(organization) - ? getPlanName(organization.billingPlan) + ? getPlanName(organization.billingPlanId) : null} diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index db9dbc038..5fedbf007 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -143,7 +143,7 @@ } // Upgrade existing org - else if (selectedOrg?.billingPlan !== billingPlan && isUpgrade()) { + else if (selectedOrg?.billingPlanId !== billingPlan && isUpgrade()) { org = await sdk.forConsole.billing.updatePlan( selectedOrg.$id, billingPlan, @@ -283,7 +283,7 @@ placeholder="Select organization" id="organization" /> {/if} - {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} + {#if selectedOrgId && (selectedOrg?.billingPlanId !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} {#if selectedOrgId === newOrgId} - {#if (selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)) || (!data?.couponData?.code && selectedOrgId)} + {#if (selectedOrgId && (selectedOrg?.billingPlanId !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)) || (!data?.couponData?.code && selectedOrgId)}
- {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} + {#if selectedOrgId && (selectedOrg?.billingPlanId !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} - {#if selectedOrg?.$id && selectedOrg?.billingPlan === billingPlan} + {#if selectedOrg?.$id && selectedOrg?.billingPlanId === billingPlan}
{ ]); let plan = getPlanFromUrl(url); const hasFreeOrganizations = organizations.teams?.some( - (org) => (org as Organization)?.billingPlan === BillingPlan.FREE + (org) => (org as Organization)?.billingPlanId === BillingPlan.FREE ); if (plan === BillingPlan.FREE && hasFreeOrganizations) { diff --git a/src/routes/(console)/organization-[organization]/+page.svelte b/src/routes/(console)/organization-[organization]/+page.svelte index 4794d8659..e5bfe3758 100644 --- a/src/routes/(console)/organization-[organization]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/+page.svelte @@ -213,7 +213,7 @@ {/if} - {#if isCloud && data.organization.billingPlan === BillingPlan.FREE && projectsToArchive.length === 0 && !freePlanAlertDismissed} + {#if isCloud && data.organization.billingPlanId === BillingPlan.FREE && projectsToArchive.length === 0 && !freePlanAlertDismissed} Your Free plan includes up to 2 projects and limited resources. Upgrade to unlock diff --git a/src/routes/(console)/organization-[organization]/billing/+page.svelte b/src/routes/(console)/organization-[organization]/billing/+page.svelte index 99729b8e9..72c615aab 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.svelte +++ b/src/routes/(console)/organization-[organization]/billing/+page.svelte @@ -125,9 +125,11 @@ {/if} {#if organization?.billingPlanDowngrade} - Your organization has changed to {tierToPlan(organization?.billingPlanDowngrade).name} plan. - You will continue to have access to {tierToPlan(organization?.billingPlan).name} plan features - until your billing period ends on {toLocaleDate(organization.billingNextInvoiceDate)}. + Your organization has changed to {tierToPlan(organization?.billingPlanDowngrade).name} + plan. You will continue to have access to {tierToPlan(organization?.billingPlanId).name} + plan features until your billing period ends on {toLocaleDate( + organization.billingNextInvoiceDate + )}. {/if} {#if $useNewPricingModal} diff --git a/src/routes/(console)/organization-[organization]/billing/+page.ts b/src/routes/(console)/organization-[organization]/billing/+page.ts index 576765bf5..b5286afec 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.ts +++ b/src/routes/(console)/organization-[organization]/billing/+page.ts @@ -63,8 +63,8 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => { const areCreditsSupported = isCloud ? (currentPlan?.supportsCredits ?? - (organization.billingPlan !== BillingPlan.FREE && - organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION)) + (organization.billingPlanId !== BillingPlan.FREE && + organization?.billingPlanId !== BillingPlan.GITHUB_EDUCATION)) : false; const [paymentMethods, addressList, billingAddress, availableCredit, billingPlanDowngrade] = diff --git a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte index 52bc76859..b859c869f 100644 --- a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte +++ b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte @@ -81,7 +81,7 @@ } - + {!areCreditsSupported ? 'Credits' : 'Available credit'} @@ -171,7 +171,7 @@ {/if} - {#if $organization?.billingPlan === BillingPlan.FREE} + {#if $organization?.billingPlanId === BillingPlan.FREE}
- {organization?.billingPlan === BillingPlan.FREE + {organization?.billingPlanId === BillingPlan.FREE ? 'Upgrade to add more members' : `You've reached the members limit for the ${ - tierToPlan(organization?.billingPlan)?.name + tierToPlan(organization?.billingPlanId)?.name } plan`}
diff --git a/src/routes/(console)/organization-[organization]/members/+page.svelte b/src/routes/(console)/organization-[organization]/members/+page.svelte index 05c350080..6bd5f64dd 100644 --- a/src/routes/(console)/organization-[organization]/members/+page.svelte +++ b/src/routes/(console)/organization-[organization]/members/+page.svelte @@ -46,7 +46,7 @@ // Calculate if button should be disabled and tooltip should show $: memberCount = data.organizationMembers?.total ?? 0; - $: isFreeWithMembers = $organization?.billingPlan === BillingPlan.FREE && memberCount >= 1; + $: isFreeWithMembers = $organization?.billingPlanId === BillingPlan.FREE && memberCount >= 1; $: isButtonDisabled = isCloud ? isFreeWithMembers : false; const resend = async (member: Models.Membership) => { @@ -89,10 +89,10 @@
- {$organization?.billingPlan === BillingPlan.FREE + {$organization?.billingPlanId === BillingPlan.FREE ? 'Upgrade to add more members' : `You've reached the members limit for the ${ - tierToPlan($organization?.billingPlan)?.name + tierToPlan($organization?.billingPlanId)?.name } plan`}
diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte index a9422df60..00abd5a8f 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -29,7 +29,7 @@ const tier = data?.plan ? (data.plan.$id as Tier) - : (data?.currentInvoice?.plan ?? $organization?.billingPlan); + : (data?.currentInvoice?.plan ?? $organization?.billingPlanId); const plan = data?.plan ?? undefined; @@ -61,7 +61,7 @@
Usage - {#if $organization?.billingPlan === BillingPlan.FREE} + {#if $organization?.billingPlanId === BillingPlan.FREE} {/if}
- {#if $organization.billingPlan === BillingPlan.SCALE} + {#if $organization.billingPlanId === BillingPlan.SCALE}

On the Scale plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. @@ -89,7 +89,7 @@ {/if}

- {:else if $organization.billingPlan === BillingPlan.PRO} + {:else if $organization.billingPlanId === BillingPlan.PRO}

On the Pro plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. @@ -104,7 +104,7 @@ {/if}

- {:else if $organization.billingPlan === BillingPlan.FREE} + {:else if $organization.billingPlanId === BillingPlan.FREE}

If you exceed the limits of the Free plan, services for your organization's projects may be disrupted. diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte index 15176735f..2b52ef1c3 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte @@ -14,14 +14,14 @@ export let members: Models.MembershipList; $: total = members?.total ?? 0; - $: plan = $plansInfo?.get($organization?.billingPlan); + $: plan = $plansInfo?.get($organization?.billingPlanId); Members The number of members in your organization. - {#if $organization.billingPlan !== BillingPlan.FREE} + {#if $organization.billingPlanId !== BillingPlan.FREE}

@@ -38,8 +38,8 @@ You can add unlimited organization members on the {tierToPlan( - $organization.billingPlan - ).name} plan {$organization.billingPlan === BillingPlan.PRO + $organization.billingPlanId + ).name} plan {$organization.billingPlanId === BillingPlan.PRO ? `for ${formatCurrency(plan.addons.seats.price)} each per billing period.` : '.'} diff --git a/src/routes/(console)/project-[region]-[project]/+layout.ts b/src/routes/(console)/project-[region]-[project]/+layout.ts index e45017ad8..9509afa60 100644 --- a/src/routes/(console)/project-[region]-[project]/+layout.ts +++ b/src/routes/(console)/project-[region]-[project]/+layout.ts @@ -26,7 +26,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { ); // organization can be null if not in the filtered list! - const includedInBasePlans = plansInfo.has(organization?.billingPlan); + const includedInBasePlans = plansInfo.has(organization?.billingPlanId); const [org, regionalConsoleVariables, rolesResult] = await Promise.all([ !organization @@ -54,7 +54,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { // fetch if not available in `plansInfo`. // out of promise.all because we filter orgs based on platform now! const organizationPlan = includedInBasePlans - ? plansInfo.get(organization?.billingPlan) + ? plansInfo.get(organization?.billingPlanId) : isCloud ? await sdk.forConsole.billing.getOrganizationPlan(organization?.$id) : null; @@ -80,7 +80,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { if (!includedInBasePlans) { // save the custom plan to `plansInfo` cache. - plansInfo.set(organization.billingPlan, organizationPlan); + plansInfo.set(organization.billingPlanId, organizationPlan); } return { diff --git a/src/routes/(console)/project-[region]-[project]/functions/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/+page.svelte index 0bc701817..412b6902b 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/+page.svelte @@ -68,7 +68,11 @@ keys: ['c'], disabled: $wizard.show || - isServiceLimited('functions', $organization?.billingPlan, data.functions?.total) || + isServiceLimited( + 'functions', + $organization?.billingPlanId, + data.functions?.total + ) || !$canWriteFunctions, icon: IconPlus, group: 'functions' diff --git a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte index 9b29e6da1..093f6518f 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte @@ -78,7 +78,7 @@ disabled={specificationOptions.length < 1} options={specificationOptions} bind:value={specification} /> - {#if $organization?.billingPlan === BillingPlan.FREE} + {#if $organization?.billingPlanId === BillingPlan.FREE} Upgrade to Pro or Scale to adjust your CPU and RAM beyond the default. diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte index 30dcd26ff..670c307bd 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte @@ -89,7 +89,7 @@ disabled={options.length < 1} bind:value={specification} {options} /> - {#if isCloud && $organization.billingPlan === BillingPlan.FREE} + {#if isCloud && $organization.billingPlanId === BillingPlan.FREE} Upgrade to Pro or Scale to adjust your CPU and RAM beyond the default. diff --git a/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte index de53032da..353d893cb 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte @@ -81,7 +81,7 @@ $: buttonDisabled = isServiceLimited( 'functions', - $organization?.billingPlan, + $organization?.billingPlanId, $functionsList?.total ?? 0 ); diff --git a/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte index 4f5ca68a1..337e6861c 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte @@ -26,7 +26,8 @@ import { IconExternalLink } from '@appwrite.io/pink-icons-svelte'; $: buttonDisabled = - isCloud && isServiceLimited('functions', $organization?.billingPlan, $functionsList?.total); + isCloud && + isServiceLimited('functions', $organization?.billingPlanId, $functionsList?.total); diff --git a/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte b/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte index 24e9db804..64dc9cb1e 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte @@ -65,7 +65,7 @@ page.url.href, $user.name, $user.email, - $organization?.billingPlan, + $organization?.billingPlanId, $feedbackData.value, $organization?.$id, $project?.$id, diff --git a/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte b/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte index 322525df3..c3edebe68 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte @@ -123,7 +123,7 @@ here - {#if $organization.billingPlan === BillingPlan.FREE} + {#if $organization.billingPlanId === BillingPlan.FREE} @@ -198,7 +198,7 @@ diff --git a/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte b/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte index 76d4d5e1e..80e111be6 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte @@ -44,7 +44,7 @@ } ]; - const tier = data?.currentInvoice?.plan ?? $organization?.billingPlan; + const tier = data?.currentInvoice?.plan ?? $organization?.billingPlanId; const plan = tierToPlan(tier).name; @@ -52,28 +52,28 @@
Usage - {#if $organization?.billingPlan === BillingPlan.FREE} + {#if $organization?.billingPlanId === BillingPlan.FREE} {/if}
- {#if $organization.billingPlan === BillingPlan.SCALE} + {#if $organization.billingPlanId === BillingPlan.SCALE}

On the Scale plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. ($showUsageRatesModal = true)} >Learn more about plan usage limits.

- {:else if $organization.billingPlan === BillingPlan.PRO} + {:else if $organization.billingPlanId === BillingPlan.PRO}

On the Pro plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. ($showUsageRatesModal = true)} >Learn more about plan usage limits.

- {:else if $organization.billingPlan === BillingPlan.FREE} + {:else if $organization.billingPlanId === BillingPlan.FREE}

If you exceed the limits of the {plan} plan, services for your projects may be disrupted. - {#if isCloud && $organization.billingPlan === BillingPlan.FREE} + {#if isCloud && $organization.billingPlanId === BillingPlan.FREE} Upgrade to Pro or Scale to adjust your CPU and RAM beyond the default. diff --git a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte index f0b24c060..44e1f3381 100644 --- a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte +++ b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte @@ -46,7 +46,7 @@ {#if isCloud} {@const size = humanFileSize(sizeToBytes(service, 'MB', 1000))} - {#if $organization?.billingPlan === BillingPlan.FREE} + {#if $organization?.billingPlanId === BillingPlan.FREE} The {currentPlan.name} plan has a maximum upload file size limit of {Math.floor( parseInt(size.value) diff --git a/src/routes/(console)/supportWizard.svelte b/src/routes/(console)/supportWizard.svelte index eabf8a26b..9269d2944 100644 --- a/src/routes/(console)/supportWizard.svelte +++ b/src/routes/(console)/supportWizard.svelte @@ -134,7 +134,7 @@ { id: '48492', value: $organization?.$id ?? '' }, { id: '48491', value: $supportData?.project ?? '' }, { id: '56023', value: $supportData?.severity ?? '' }, - { id: '56024', value: $organization?.billingPlan ?? '' } + { id: '56024', value: $organization?.billingPlanId ?? '' } ] }) }); diff --git a/src/routes/(console)/wizard/feedback/step1.svelte b/src/routes/(console)/wizard/feedback/step1.svelte index 4d2cac840..dc66f1a76 100644 --- a/src/routes/(console)/wizard/feedback/step1.svelte +++ b/src/routes/(console)/wizard/feedback/step1.svelte @@ -22,7 +22,7 @@ page.url.href, $user.name, $user.email, - $organization?.billingPlan, + $organization?.billingPlanId, $feedbackData.value, $organization?.$id, $project?.$id, From 6cac26f157c11bd15018c426ce67325324e30a6d Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 23 Dec 2025 17:57:11 +0530 Subject: [PATCH 05/13] revert: keep using `billingPlan`. --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/lib/components/backupDatabaseAlert.svelte | 2 +- src/lib/components/backupRestoreBox.svelte | 2 +- .../components/billing/alerts/limitReached.svelte | 6 +++--- .../billing/alerts/missingPaymentMethod.svelte | 2 +- .../billing/alerts/newDevUpgradePro.svelte | 2 +- src/lib/components/billing/planExcess.svelte | 2 +- src/lib/components/billing/planSelection.svelte | 4 ++-- src/lib/components/billing/selectPlan.svelte | 2 +- src/lib/components/billing/usageRates.svelte | 8 ++++---- src/lib/components/bottomModalAlert.svelte | 2 +- src/lib/components/breadcrumbs.svelte | 2 +- src/lib/components/emptyCardImageCloud.svelte | 2 +- src/lib/components/feedback/feedback.svelte | 2 +- src/lib/components/roles/upgrade.svelte | 2 +- src/lib/components/support.svelte | 4 ++-- src/lib/layout/containerButton.svelte | 4 ++-- src/lib/layout/containerHeader.svelte | 14 +++++++------- src/lib/layout/createProject.svelte | 2 +- src/lib/stores/billing.ts | 11 ++++++----- src/lib/stores/organization.ts | 4 ++-- src/routes/(console)/+layout.svelte | 4 ++-- .../(console)/account/organizations/+page.svelte | 12 ++++++------ src/routes/(console)/apply-credit/+page.svelte | 12 ++++++------ src/routes/(console)/create-organization/+page.ts | 2 +- .../organization-[organization]/+page.svelte | 2 +- .../billing/+page.svelte | 2 +- .../organization-[organization]/billing/+page.ts | 4 ++-- .../billing/availableCredit.svelte | 4 ++-- .../billing/budgetAlert.svelte | 4 ++-- .../billing/budgetCap.svelte | 2 +- .../billing/deleteOrgPayment.svelte | 4 ++-- .../billing/paymentMethods.svelte | 2 +- .../billing/planSummary.svelte | 2 +- .../billing/planSummaryOld.svelte | 8 ++++---- .../budgetLimitAlert.svelte | 2 +- .../change-plan/+page.svelte | 10 +++++----- .../change-plan/+page.ts | 2 +- .../organization-[organization]/header.svelte | 10 +++++----- .../members/+page.svelte | 6 +++--- .../usage/[[invoice]]/+page.svelte | 10 +++++----- .../usage/[[invoice]]/totalMembers.svelte | 8 ++++---- .../project-[region]-[project]/+layout.ts | 6 +++--- .../functions/+page.svelte | 2 +- .../create-function/(components)/details.svelte | 2 +- .../settings/updateResourceLimits.svelte | 2 +- .../functions/templates/+page.svelte | 2 +- .../templates/template-[template]/+page.svelte | 2 +- .../settings/migrations/exportModal.svelte | 2 +- .../settings/smtp/+page.svelte | 4 ++-- .../settings/usage/[[invoice]]/+page.svelte | 10 +++++----- .../project-[region]-[project]/sites/+page.svelte | 2 +- .../settings/updateResourceLimits.svelte | 2 +- .../settings/updateMaxFileSize.svelte | 2 +- src/routes/(console)/supportWizard.svelte | 2 +- src/routes/(console)/wizard/feedback/step1.svelte | 2 +- 57 files changed, 123 insertions(+), 122 deletions(-) diff --git a/package.json b/package.json index d1861c08f..b16cdf836 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@8d430f8", + "@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3", "@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 372b725b1..985b51df2 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@8d430f8 - version: https://pkg.vc/-/@appwrite/@appwrite.io/console@8d430f8 + specifier: https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3 + version: https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3 '@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@8d430f8': - resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@8d430f8} + '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3': + resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3} 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@8d430f8': {} + '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3': {} '@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)': dependencies: diff --git a/src/lib/components/backupDatabaseAlert.svelte b/src/lib/components/backupDatabaseAlert.svelte index 932a14e22..1c2ceed16 100644 --- a/src/lib/components/backupDatabaseAlert.svelte +++ b/src/lib/components/backupDatabaseAlert.svelte @@ -18,7 +18,7 @@ {#if $showPolicyAlert && isCloud && $organization?.$id && page.url.pathname.match(/\/databases\/database-[^/]+$/)} - {@const isFreePlan = $organization?.billingPlanId === BillingPlan.FREE} + {@const isFreePlan = $organization?.billingPlan === BillingPlan.FREE} {@const subtitle = isFreePlan ? 'Upgrade your plan to ensure your data stays safe and backed up' diff --git a/src/lib/components/backupRestoreBox.svelte b/src/lib/components/backupRestoreBox.svelte index f4d6c5fff..f1de9d3ba 100644 --- a/src/lib/components/backupRestoreBox.svelte +++ b/src/lib/components/backupRestoreBox.svelte @@ -125,7 +125,7 @@ onMount(() => { // fast path: don't subscribe if org is on a free plan or is self-hosted. - if (isSelfHosted || (isCloud && $organization?.billingPlanId === BillingPlan.FREE)) return; + if (isSelfHosted || (isCloud && $organization?.billingPlan === BillingPlan.FREE)) return; return realtime.forProject(page.params.region, 'console', (response) => { if (!response.channels.includes(`projects.${getProjectId()}`)) return; diff --git a/src/lib/components/billing/alerts/limitReached.svelte b/src/lib/components/billing/alerts/limitReached.svelte index e99e38575..4885db75e 100644 --- a/src/lib/components/billing/alerts/limitReached.svelte +++ b/src/lib/components/billing/alerts/limitReached.svelte @@ -9,13 +9,13 @@ import { organization } from '$lib/stores/organization'; -{#if $organization?.$id && $organization?.billingPlanId === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes(page.url.pathname)} +{#if $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes(page.url.pathname)} + title={`${$organization.name} usage has reached the ${tierToPlan($organization.billingPlan).name} plan limit`}> Usage for the {$organization.name} organization has reached the limits of the {tierToPlan( - $organization.billingPlanId + $organization.billingPlan ).name} plan. Consider upgrading to increase your resource usage. diff --git a/src/lib/components/billing/alerts/missingPaymentMethod.svelte b/src/lib/components/billing/alerts/missingPaymentMethod.svelte index ac0b25be4..96c29c5d7 100644 --- a/src/lib/components/billing/alerts/missingPaymentMethod.svelte +++ b/src/lib/components/billing/alerts/missingPaymentMethod.svelte @@ -8,7 +8,7 @@ import { orgMissingPaymentMethod } from '$routes/(console)/store'; -{#if ($orgMissingPaymentMethod.billingPlanId === BillingPlan.PRO || $orgMissingPaymentMethod.billingPlanId === BillingPlan.SCALE) && !$orgMissingPaymentMethod.paymentMethodId && !$orgMissingPaymentMethod.backupPaymentMethodId && !hideBillingHeaderRoutes.includes(page.url.pathname)} +{#if ($orgMissingPaymentMethod.billingPlan === BillingPlan.PRO || $orgMissingPaymentMethod.billingPlan === BillingPlan.SCALE) && !$orgMissingPaymentMethod.paymentMethodId && !$orgMissingPaymentMethod.backupPaymentMethodId && !hideBillingHeaderRoutes.includes(page.url.pathname)} diff --git a/src/lib/components/billing/alerts/newDevUpgradePro.svelte b/src/lib/components/billing/alerts/newDevUpgradePro.svelte index f6542b1ee..733736f02 100644 --- a/src/lib/components/billing/alerts/newDevUpgradePro.svelte +++ b/src/lib/components/billing/alerts/newDevUpgradePro.svelte @@ -23,7 +23,7 @@ } -{#if show && $organization?.$id && $organization?.billingPlanId === BillingPlan.FREE && !page.url.pathname.includes(base + '/account')} +{#if show && $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && !page.url.pathname.includes(base + '/account')} - You will retain access to {tierToPlan($organization.billingPlanId).name} plan features until + You will retain access to {tierToPlan($organization.billingPlan).name} plan features until your billing period ends. After that, {#if excess?.members > 0} all team members except the owner will be removed, diff --git a/src/lib/components/billing/planSelection.svelte b/src/lib/components/billing/planSelection.svelte index be0754887..6499a47c0 100644 --- a/src/lib/components/billing/planSelection.svelte +++ b/src/lib/components/billing/planSelection.svelte @@ -35,7 +35,7 @@ value={plan.$id} title={plan.name}> - {#if $organization?.billingPlanId === plan.$id && !isNewOrg} + {#if $organization?.billingPlan === plan.$id && !isNewOrg} {/if} @@ -61,7 +61,7 @@ value={$currentPlan.$id} title={$currentPlan.name}> - {#if $organization?.billingPlanId === $currentPlan.$id && !isNewOrg} + {#if $organization?.billingPlan === $currentPlan.$id && !isNewOrg} {/if} diff --git a/src/lib/components/billing/selectPlan.svelte b/src/lib/components/billing/selectPlan.svelte index 50de90d7c..2b9d9498f 100644 --- a/src/lib/components/billing/selectPlan.svelte +++ b/src/lib/components/billing/selectPlan.svelte @@ -31,7 +31,7 @@ class:u-opacity-50={disabled}>

{plan.name} - {#if $organization?.billingPlanId === plan.$id && !isNewOrg} + {#if $organization?.billingPlan === plan.$id && !isNewOrg} Current plan {/if}

diff --git a/src/lib/components/billing/usageRates.svelte b/src/lib/components/billing/usageRates.svelte index 50a20e1a1..49ab414e9 100644 --- a/src/lib/components/billing/usageRates.svelte +++ b/src/lib/components/billing/usageRates.svelte @@ -11,13 +11,13 @@ export let show = false; export let org: Organization; - $: plan = $plansInfo?.get(org.billingPlanId); + $: plan = $plansInfo?.get(org.billingPlan); $: nextDate = org?.name ? new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1).toString() : org?.billingNextInvoiceDate; - $: isFree = org.billingPlanId === BillingPlan.FREE; + $: isFree = org.billingPlan === BillingPlan.FREE; // equal or above means unlimited! const getCorrectSeatsCountValue = (count: number): string | number => { @@ -37,12 +37,12 @@ Usage on the {$plansInfo?.get(BillingPlan.FREE).name} plan is limited for the following resources. Next billing period: {toLocaleDate(nextDate)}. - {:else if org.billingPlanId === BillingPlan.PRO} + {:else if org.billingPlan === BillingPlan.PRO} Usage on the Pro plan will be charged at the end of each billing period at the following rates. Next billing period: {toLocaleDate(nextDate)}. - {:else if org.billingPlanId === BillingPlan.SCALE} + {:else if org.billingPlan === BillingPlan.SCALE} Usage on the Scale plan will be charged at the end of each billing period at the following rates. Next billing period: {toLocaleDate(nextDate)}. diff --git a/src/lib/components/bottomModalAlert.svelte b/src/lib/components/bottomModalAlert.svelte index 982a24273..623a510c1 100644 --- a/src/lib/components/bottomModalAlert.svelte +++ b/src/lib/components/bottomModalAlert.svelte @@ -172,7 +172,7 @@ function showUpgrade() { const plan = currentModalAlert.plan; - const organizationPlan = $organization?.billingPlanId; + const organizationPlan = $organization?.billingPlan; switch (plan) { case 'free': return false; diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index 4ed7a539a..7f1a59c47 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -254,7 +254,7 @@ let badgeType: 'success' | undefined; $: badgeType = - $organization && $organization.billingPlanId !== BillingPlan.FREE ? 'success' : undefined; + $organization && $organization.billingPlan !== BillingPlan.FREE ? 'success' : undefined; diff --git a/src/lib/components/emptyCardImageCloud.svelte b/src/lib/components/emptyCardImageCloud.svelte index f06d74369..0f4c23450 100644 --- a/src/lib/components/emptyCardImageCloud.svelte +++ b/src/lib/components/emptyCardImageCloud.svelte @@ -24,7 +24,7 @@ - + diff --git a/src/lib/components/feedback/feedback.svelte b/src/lib/components/feedback/feedback.svelte index 1b151c5d9..ed500aa15 100644 --- a/src/lib/components/feedback/feedback.svelte +++ b/src/lib/components/feedback/feedback.svelte @@ -25,7 +25,7 @@ page.url.href, $user.name, $user.email, - $organization?.billingPlanId, + $organization?.billingPlan, $feedbackData.value, $organization?.$id, $project?.$id, diff --git a/src/lib/components/roles/upgrade.svelte b/src/lib/components/roles/upgrade.svelte index c551f4cc1..b3f15e85b 100644 --- a/src/lib/components/roles/upgrade.svelte +++ b/src/lib/components/roles/upgrade.svelte @@ -11,7 +11,7 @@ {#if isCloud} - {#if $organization?.billingPlanId !== BillingPlan.FREE} + {#if $organization?.billingPlan !== BillingPlan.FREE} Roles Owner, Developer, Editor, Analyst and Billing. diff --git a/src/lib/components/support.svelte b/src/lib/components/support.svelte index b7b3827ed..d05d2639c 100644 --- a/src/lib/components/support.svelte +++ b/src/lib/components/support.svelte @@ -20,12 +20,12 @@ $: hasPremiumSupport = $currentPlan?.premiumSupport ?? allOrgsHavePremiumSupport ?? false; $: allOrgsHavePremiumSupport = $organizationList.teams.every( - (team) => $plansInfo.get((team as Organization).billingPlanId)?.premiumSupport + (team) => $plansInfo.get((team as Organization).billingPlan)?.premiumSupport ); // there can only be one free organization $: freeOrganization = $organizationList.teams.find( - (team) => !$plansInfo.get((team as Organization).billingPlanId)?.premiumSupport + (team) => !$plansInfo.get((team as Organization).billingPlan)?.premiumSupport ); $: upgradeURL = `${base}/organization-${freeOrganization?.$id}/change-plan`; diff --git a/src/lib/layout/containerButton.svelte b/src/lib/layout/containerButton.svelte index e76cbf859..53cfc35bf 100644 --- a/src/lib/layout/containerButton.svelte +++ b/src/lib/layout/containerButton.svelte @@ -7,10 +7,10 @@ export let title: string; export let tooltipContent = - $organization?.billingPlanId === BillingPlan.FREE + $organization?.billingPlan === BillingPlan.FREE ? `Upgrade to add more ${title.toLocaleLowerCase()}` : `You've reached the ${title.toLocaleLowerCase()} limit for the ${ - tierToPlan($organization?.billingPlanId)?.name + tierToPlan($organization?.billingPlan)?.name } plan`; export let disabled: boolean; export let buttonText: string; diff --git a/src/lib/layout/containerHeader.svelte b/src/lib/layout/containerHeader.svelte index 893c055ed..84fe96607 100644 --- a/src/lib/layout/containerHeader.svelte +++ b/src/lib/layout/containerHeader.svelte @@ -64,13 +64,13 @@ }; const dispatch = createEventDispatcher(); - $: tier = tierToPlan($organization?.billingPlanId)?.name; + $: tier = tierToPlan($organization?.billingPlan)?.name; // these can be organization level limitations as well. // we need to migrate this sometime later, but soon! $: hasProjectLimitation = - checkForProjectLimitation(serviceId) && $organization?.billingPlanId === BillingPlan.FREE; + checkForProjectLimitation(serviceId) && $organization?.billingPlan === BillingPlan.FREE; $: hasUsageFees = hasProjectLimitation - ? checkForUsageFees($organization?.billingPlanId, serviceId) + ? checkForUsageFees($organization?.billingPlan, serviceId) : false; $: isLimited = limit !== 0 && limit < Infinity; $: overflowingServices = limitedServices.filter((service) => service.value > 0); @@ -99,7 +99,7 @@ {#if services.length} - {#if $organization?.billingPlanId !== BillingPlan.FREE && hasUsageFees} + {#if $organization?.billingPlan !== BillingPlan.FREE && hasUsageFees} You've reached the {services} limit for the {tier} plan. @@ -135,7 +135,7 @@ on:click={() => (showDropdown = !showDropdown)}> - {:else if $organization?.billingPlanId !== BillingPlan.SCALE} + {:else if $organization?.billingPlan !== BillingPlan.SCALE} You are limited to {limit} {title.toLocaleLowerCase()} per project on the {tier} plan. - {#if $organization?.billingPlanId === BillingPlan.FREE} You are limited to {limit} {title.toLocaleLowerCase()} per organization on the {tier} plan. - {#if $organization?.billingPlanId === BillingPlan.FREE} + {#if $organization?.billingPlan === BillingPlan.FREE} Upgrade for additional {title.toLocaleLowerCase()}. {/if} diff --git a/src/lib/layout/createProject.svelte b/src/lib/layout/createProject.svelte index 027dcc55d..c24e9234a 100644 --- a/src/lib/layout/createProject.svelte +++ b/src/lib/layout/createProject.svelte @@ -35,7 +35,7 @@ } = $props(); let showCustomId = $state(false); - let isProPlan = $derived((billingPlan ?? $organization?.billingPlanId) === BillingPlan.PRO); + let isProPlan = $derived((billingPlan ?? $organization?.billingPlan) === BillingPlan.PRO); let projectsLimited = $derived( $currentPlan?.projects > 0 && projects && projects >= $currentPlan?.projects ); diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index a03604ed8..26b1ffb2e 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -264,7 +264,7 @@ export function checkForUsageFees(plan: Tier, id: PlanServices) { export function checkForProjectLimitation(id: PlanServices) { // Members are no longer limited on Pro and Scale plans (unlimited seats) if (id === 'members') { - const currentTier = get(organization)?.billingPlanId; + const currentTier = get(organization)?.billingPlan; if (currentTier === BillingPlan.PRO || currentTier === BillingPlan.SCALE) { return false; // No project limitation for members on Pro/Scale plans } @@ -321,7 +321,7 @@ export function calculateEnterpriseTrial(org: Organization) { } export function calculateTrialDay(org: Organization) { - if (org?.billingPlanId === BillingPlan.FREE) return false; + if (org?.billingPlan === BillingPlan.FREE) return false; const endDate = new Date(org?.billingStartDate); const today = new Date(); @@ -373,7 +373,7 @@ export async function checkForUsageLimit(org: Organization) { readOnly.set(false); return; } - if (org?.billingPlanId !== BillingPlan.FREE) { + if (org?.billingPlan !== BillingPlan.FREE) { const { budgetLimit } = org?.billingLimits ?? {}; if (budgetLimit && budgetLimit >= 100) { @@ -453,7 +453,7 @@ export async function checkForUsageLimit(org: Organization) { } export async function checkPaymentAuthorizationRequired(org: Organization) { - if (org.billingPlanId === BillingPlan.FREE) return; + if (org.billingPlan === BillingPlan.FREE) return; const invoices = await sdk.forConsole.billing.listInvoices(org.$id, [ Query.equal('status', 'requires_authentication') @@ -560,6 +560,7 @@ export async function checkForMissingPaymentMethod() { Query.isNull('backupPaymentMethodId'), Query.equal('platform', Platform.Appwrite) ]); + if (orgs?.total) { orgMissingPaymentMethod.set(orgs.teams[0]); headerAlert.add({ @@ -574,7 +575,7 @@ export async function checkForMissingPaymentMethod() { // Display upgrade banner for new users after 1 week for 30 days export async function checkForNewDevUpgradePro(org: Organization) { // browser or plan check. - if (!browser || org?.billingPlanId !== BillingPlan.FREE) return; + if (!browser || org?.billingPlan !== BillingPlan.FREE) return; // already dismissed by user! if (localStorage.getItem('newDevUpgradePro')) return; diff --git a/src/lib/stores/organization.ts b/src/lib/stores/organization.ts index dc39db267..3a413c36b 100644 --- a/src/lib/stores/organization.ts +++ b/src/lib/stores/organization.ts @@ -15,8 +15,8 @@ export type OrganizationError = { export type Organization = Models.Team> & { billingBudget: number; - billingPlanId: Tier; - billingPlan: Plan; + billingPlan: Tier; + billingPlanDetails: Plan; /* unused for now! */ budgetAlerts: number[]; paymentMethodId: string; backupPaymentMethodId: string; diff --git a/src/routes/(console)/+layout.svelte b/src/routes/(console)/+layout.svelte index f17355b46..109bdabb3 100644 --- a/src/routes/(console)/+layout.svelte +++ b/src/routes/(console)/+layout.svelte @@ -305,12 +305,12 @@ checkForMarkedForDeletion(org); await checkForNewDevUpgradePro(org); - if (org?.billingPlanId !== BillingPlan.FREE) { + if (org?.billingPlan !== BillingPlan.FREE) { await paymentExpired(org); await checkPaymentAuthorizationRequired(org); await checkForMandate(org); - if ($plansInfo.get(org.billingPlanId)?.trialDays) { + if ($plansInfo.get(org.billingPlan)?.trialDays) { calculateTrialDay(org); } } diff --git a/src/routes/(console)/account/organizations/+page.svelte b/src/routes/(console)/account/organizations/+page.svelte index a54aacacb..b369b1894 100644 --- a/src/routes/(console)/account/organizations/+page.svelte +++ b/src/routes/(console)/account/organizations/+page.svelte @@ -42,7 +42,7 @@ // For known plans, use tierToPlan const tierData = tierToPlan(billingPlan as Tier); - // If it's not a custom plan or we got a non-custom result, return the name + // If it's not a custom plan, or we got a non-custom result, return the name if (tierData.name !== 'Custom') { return tierData.name; } @@ -60,15 +60,15 @@ function isOrganizationOnTrial(organization: Organization): boolean { if (!organization?.billingTrialStartDate) return false; if ($daysLeftInTrial <= 0) return false; - if (organization.billingPlanId === BillingPlan.FREE) return false; + if (organization.billingPlan === BillingPlan.FREE) return false; - return !!$plansInfo.get(organization.billingPlanId)?.trialDays; + return !!$plansInfo.get(organization.billingPlan)?.trialDays; } function isNonPayingOrganization(organization: Organization): boolean { return ( - organization?.billingPlanId === BillingPlan.FREE || - organization?.billingPlanId === BillingPlan.GITHUB_EDUCATION + organization?.billingPlan === BillingPlan.FREE || + organization?.billingPlan === BillingPlan.GITHUB_EDUCATION ); } @@ -114,7 +114,7 @@ {@const avatarList = getMemberships(organization.$id)} {@const payingOrg = isPayingOrganization(organization)} {@const planName = isCloudOrg(organization) - ? getPlanName(organization.billingPlanId) + ? getPlanName(organization.billingPlan) : null} diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 5fedbf007..20778b418 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -143,7 +143,7 @@ } // Upgrade existing org - else if (selectedOrg?.billingPlanId !== billingPlan && isUpgrade()) { + else if (selectedOrg?.billingPlan !== billingPlan && isUpgrade()) { org = await sdk.forConsole.billing.updatePlan( selectedOrg.$id, billingPlan, @@ -229,7 +229,7 @@ campaign?.plan && $plansInfo.get(campaign.plan) ? $plansInfo.get(campaign.plan) : null; const newPlan = $plansInfo.get(billingPlan); - // if campaign has a plan and it's higher than the selected new plan + // if campaign has a plan, and it's higher than the selected new plan if (campaignPlan?.order > newPlan?.order) { return campaignPlan.$id as Tier; } @@ -283,7 +283,7 @@ placeholder="Select organization" id="organization" /> {/if} - {#if selectedOrgId && (selectedOrg?.billingPlanId !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} + {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} {#if selectedOrgId === newOrgId} - {#if (selectedOrgId && (selectedOrg?.billingPlanId !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)) || (!data?.couponData?.code && selectedOrgId)} + {#if (selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)) || (!data?.couponData?.code && selectedOrgId)}
- {#if selectedOrgId && (selectedOrg?.billingPlanId !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} + {#if selectedOrgId && (selectedOrg?.billingPlan !== BillingPlan.PRO || !selectedOrg?.paymentMethodId)} - {#if selectedOrg?.$id && selectedOrg?.billingPlanId === billingPlan} + {#if selectedOrg?.$id && selectedOrg?.billingPlan === billingPlan}
{ ]); let plan = getPlanFromUrl(url); const hasFreeOrganizations = organizations.teams?.some( - (org) => (org as Organization)?.billingPlanId === BillingPlan.FREE + (org) => (org as Organization)?.billingPlan === BillingPlan.FREE ); if (plan === BillingPlan.FREE && hasFreeOrganizations) { diff --git a/src/routes/(console)/organization-[organization]/+page.svelte b/src/routes/(console)/organization-[organization]/+page.svelte index e5bfe3758..4794d8659 100644 --- a/src/routes/(console)/organization-[organization]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/+page.svelte @@ -213,7 +213,7 @@ {/if} - {#if isCloud && data.organization.billingPlanId === BillingPlan.FREE && projectsToArchive.length === 0 && !freePlanAlertDismissed} + {#if isCloud && data.organization.billingPlan === BillingPlan.FREE && projectsToArchive.length === 0 && !freePlanAlertDismissed} Your Free plan includes up to 2 projects and limited resources. Upgrade to unlock diff --git a/src/routes/(console)/organization-[organization]/billing/+page.svelte b/src/routes/(console)/organization-[organization]/billing/+page.svelte index 72c615aab..15e6785a9 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.svelte +++ b/src/routes/(console)/organization-[organization]/billing/+page.svelte @@ -126,7 +126,7 @@ {#if organization?.billingPlanDowngrade} Your organization has changed to {tierToPlan(organization?.billingPlanDowngrade).name} - plan. You will continue to have access to {tierToPlan(organization?.billingPlanId).name} + plan. You will continue to have access to {tierToPlan(organization?.billingPlan).name} plan features until your billing period ends on {toLocaleDate( organization.billingNextInvoiceDate )}. diff --git a/src/routes/(console)/organization-[organization]/billing/+page.ts b/src/routes/(console)/organization-[organization]/billing/+page.ts index b5286afec..576765bf5 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.ts +++ b/src/routes/(console)/organization-[organization]/billing/+page.ts @@ -63,8 +63,8 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => { const areCreditsSupported = isCloud ? (currentPlan?.supportsCredits ?? - (organization.billingPlanId !== BillingPlan.FREE && - organization?.billingPlanId !== BillingPlan.GITHUB_EDUCATION)) + (organization.billingPlan !== BillingPlan.FREE && + organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION)) : false; const [paymentMethods, addressList, billingAddress, availableCredit, billingPlanDowngrade] = diff --git a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte index b859c869f..52bc76859 100644 --- a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte +++ b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte @@ -81,7 +81,7 @@ } - + {!areCreditsSupported ? 'Credits' : 'Available credit'} @@ -171,7 +171,7 @@ {/if} - {#if $organization?.billingPlanId === BillingPlan.FREE} + {#if $organization?.billingPlan === BillingPlan.FREE}
- {organization?.billingPlanId === BillingPlan.FREE + {organization?.billingPlan === BillingPlan.FREE ? 'Upgrade to add more members' : `You've reached the members limit for the ${ - tierToPlan(organization?.billingPlanId)?.name + tierToPlan(organization?.billingPlan)?.name } plan`}
diff --git a/src/routes/(console)/organization-[organization]/members/+page.svelte b/src/routes/(console)/organization-[organization]/members/+page.svelte index 6bd5f64dd..05c350080 100644 --- a/src/routes/(console)/organization-[organization]/members/+page.svelte +++ b/src/routes/(console)/organization-[organization]/members/+page.svelte @@ -46,7 +46,7 @@ // Calculate if button should be disabled and tooltip should show $: memberCount = data.organizationMembers?.total ?? 0; - $: isFreeWithMembers = $organization?.billingPlanId === BillingPlan.FREE && memberCount >= 1; + $: isFreeWithMembers = $organization?.billingPlan === BillingPlan.FREE && memberCount >= 1; $: isButtonDisabled = isCloud ? isFreeWithMembers : false; const resend = async (member: Models.Membership) => { @@ -89,10 +89,10 @@
- {$organization?.billingPlanId === BillingPlan.FREE + {$organization?.billingPlan === BillingPlan.FREE ? 'Upgrade to add more members' : `You've reached the members limit for the ${ - tierToPlan($organization?.billingPlanId)?.name + tierToPlan($organization?.billingPlan)?.name } plan`}
diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte index 00abd5a8f..a9422df60 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -29,7 +29,7 @@ const tier = data?.plan ? (data.plan.$id as Tier) - : (data?.currentInvoice?.plan ?? $organization?.billingPlanId); + : (data?.currentInvoice?.plan ?? $organization?.billingPlan); const plan = data?.plan ?? undefined; @@ -61,7 +61,7 @@
Usage - {#if $organization?.billingPlanId === BillingPlan.FREE} + {#if $organization?.billingPlan === BillingPlan.FREE} {/if}
- {#if $organization.billingPlanId === BillingPlan.SCALE} + {#if $organization.billingPlan === BillingPlan.SCALE}

On the Scale plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. @@ -89,7 +89,7 @@ {/if}

- {:else if $organization.billingPlanId === BillingPlan.PRO} + {:else if $organization.billingPlan === BillingPlan.PRO}

On the Pro plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. @@ -104,7 +104,7 @@ {/if}

- {:else if $organization.billingPlanId === BillingPlan.FREE} + {:else if $organization.billingPlan === BillingPlan.FREE}

If you exceed the limits of the Free plan, services for your organization's projects may be disrupted. diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte index 2b52ef1c3..15176735f 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte @@ -14,14 +14,14 @@ export let members: Models.MembershipList; $: total = members?.total ?? 0; - $: plan = $plansInfo?.get($organization?.billingPlanId); + $: plan = $plansInfo?.get($organization?.billingPlan); Members The number of members in your organization. - {#if $organization.billingPlanId !== BillingPlan.FREE} + {#if $organization.billingPlan !== BillingPlan.FREE}

@@ -38,8 +38,8 @@ You can add unlimited organization members on the {tierToPlan( - $organization.billingPlanId - ).name} plan {$organization.billingPlanId === BillingPlan.PRO + $organization.billingPlan + ).name} plan {$organization.billingPlan === BillingPlan.PRO ? `for ${formatCurrency(plan.addons.seats.price)} each per billing period.` : '.'} diff --git a/src/routes/(console)/project-[region]-[project]/+layout.ts b/src/routes/(console)/project-[region]-[project]/+layout.ts index 9509afa60..e45017ad8 100644 --- a/src/routes/(console)/project-[region]-[project]/+layout.ts +++ b/src/routes/(console)/project-[region]-[project]/+layout.ts @@ -26,7 +26,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { ); // organization can be null if not in the filtered list! - const includedInBasePlans = plansInfo.has(organization?.billingPlanId); + const includedInBasePlans = plansInfo.has(organization?.billingPlan); const [org, regionalConsoleVariables, rolesResult] = await Promise.all([ !organization @@ -54,7 +54,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { // fetch if not available in `plansInfo`. // out of promise.all because we filter orgs based on platform now! const organizationPlan = includedInBasePlans - ? plansInfo.get(organization?.billingPlanId) + ? plansInfo.get(organization?.billingPlan) : isCloud ? await sdk.forConsole.billing.getOrganizationPlan(organization?.$id) : null; @@ -80,7 +80,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { if (!includedInBasePlans) { // save the custom plan to `plansInfo` cache. - plansInfo.set(organization.billingPlanId, organizationPlan); + plansInfo.set(organization.billingPlan, organizationPlan); } return { diff --git a/src/routes/(console)/project-[region]-[project]/functions/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/+page.svelte index 412b6902b..6ffe38400 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/+page.svelte @@ -70,7 +70,7 @@ $wizard.show || isServiceLimited( 'functions', - $organization?.billingPlanId, + $organization?.billingPlan, data.functions?.total ) || !$canWriteFunctions, diff --git a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte index 093f6518f..9b29e6da1 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte @@ -78,7 +78,7 @@ disabled={specificationOptions.length < 1} options={specificationOptions} bind:value={specification} /> - {#if $organization?.billingPlanId === BillingPlan.FREE} + {#if $organization?.billingPlan === BillingPlan.FREE} Upgrade to Pro or Scale to adjust your CPU and RAM beyond the default. diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte index 670c307bd..30dcd26ff 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte @@ -89,7 +89,7 @@ disabled={options.length < 1} bind:value={specification} {options} /> - {#if isCloud && $organization.billingPlanId === BillingPlan.FREE} + {#if isCloud && $organization.billingPlan === BillingPlan.FREE} Upgrade to Pro or Scale to adjust your CPU and RAM beyond the default. diff --git a/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte index 353d893cb..de53032da 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/templates/+page.svelte @@ -81,7 +81,7 @@ $: buttonDisabled = isServiceLimited( 'functions', - $organization?.billingPlanId, + $organization?.billingPlan, $functionsList?.total ?? 0 ); diff --git a/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte index 337e6861c..f76cf4bb8 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte @@ -27,7 +27,7 @@ $: buttonDisabled = isCloud && - isServiceLimited('functions', $organization?.billingPlanId, $functionsList?.total); + isServiceLimited('functions', $organization?.billingPlan, $functionsList?.total); diff --git a/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte b/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte index 64dc9cb1e..24e9db804 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/migrations/exportModal.svelte @@ -65,7 +65,7 @@ page.url.href, $user.name, $user.email, - $organization?.billingPlanId, + $organization?.billingPlan, $feedbackData.value, $organization?.$id, $project?.$id, diff --git a/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte b/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte index c3edebe68..322525df3 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/smtp/+page.svelte @@ -123,7 +123,7 @@ here - {#if $organization.billingPlanId === BillingPlan.FREE} + {#if $organization.billingPlan === BillingPlan.FREE} @@ -198,7 +198,7 @@ diff --git a/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte b/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte index 80e111be6..76d4d5e1e 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte @@ -44,7 +44,7 @@ } ]; - const tier = data?.currentInvoice?.plan ?? $organization?.billingPlanId; + const tier = data?.currentInvoice?.plan ?? $organization?.billingPlan; const plan = tierToPlan(tier).name; @@ -52,28 +52,28 @@
Usage - {#if $organization?.billingPlanId === BillingPlan.FREE} + {#if $organization?.billingPlan === BillingPlan.FREE} {/if}
- {#if $organization.billingPlanId === BillingPlan.SCALE} + {#if $organization.billingPlan === BillingPlan.SCALE}

On the Scale plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. ($showUsageRatesModal = true)} >Learn more about plan usage limits.

- {:else if $organization.billingPlanId === BillingPlan.PRO} + {:else if $organization.billingPlan === BillingPlan.PRO}

On the Pro plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. ($showUsageRatesModal = true)} >Learn more about plan usage limits.

- {:else if $organization.billingPlanId === BillingPlan.FREE} + {:else if $organization.billingPlan === BillingPlan.FREE}

If you exceed the limits of the {plan} plan, services for your projects may be disrupted. - {#if isCloud && $organization.billingPlanId === BillingPlan.FREE} + {#if isCloud && $organization.billingPlan === BillingPlan.FREE} Upgrade to Pro or Scale to adjust your CPU and RAM beyond the default. diff --git a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte index 44e1f3381..f0b24c060 100644 --- a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte +++ b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte @@ -46,7 +46,7 @@ {#if isCloud} {@const size = humanFileSize(sizeToBytes(service, 'MB', 1000))} - {#if $organization?.billingPlanId === BillingPlan.FREE} + {#if $organization?.billingPlan === BillingPlan.FREE} The {currentPlan.name} plan has a maximum upload file size limit of {Math.floor( parseInt(size.value) diff --git a/src/routes/(console)/supportWizard.svelte b/src/routes/(console)/supportWizard.svelte index 9269d2944..eabf8a26b 100644 --- a/src/routes/(console)/supportWizard.svelte +++ b/src/routes/(console)/supportWizard.svelte @@ -134,7 +134,7 @@ { id: '48492', value: $organization?.$id ?? '' }, { id: '48491', value: $supportData?.project ?? '' }, { id: '56023', value: $supportData?.severity ?? '' }, - { id: '56024', value: $organization?.billingPlanId ?? '' } + { id: '56024', value: $organization?.billingPlan ?? '' } ] }) }); diff --git a/src/routes/(console)/wizard/feedback/step1.svelte b/src/routes/(console)/wizard/feedback/step1.svelte index dc66f1a76..4d2cac840 100644 --- a/src/routes/(console)/wizard/feedback/step1.svelte +++ b/src/routes/(console)/wizard/feedback/step1.svelte @@ -22,7 +22,7 @@ page.url.href, $user.name, $user.email, - $organization?.billingPlanId, + $organization?.billingPlan, $feedbackData.value, $organization?.$id, $project?.$id, From 37352574579bdb9f2d7bab4620724fef4f98ec55 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 23 Dec 2025 17:59:09 +0530 Subject: [PATCH 06/13] lint. --- src/lib/components/billing/planExcess.svelte | 4 ++-- src/lib/stores/organization.ts | 2 +- .../billing/planSummaryOld.svelte | 3 +-- .../project-[region]-[project]/functions/+page.svelte | 6 +----- .../functions/templates/template-[template]/+page.svelte | 3 +-- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/lib/components/billing/planExcess.svelte b/src/lib/components/billing/planExcess.svelte index dedd265fc..7bdf28e3f 100644 --- a/src/lib/components/billing/planExcess.svelte +++ b/src/lib/components/billing/planExcess.svelte @@ -47,8 +47,8 @@ title={` Your organization will switch to ${tierToPlan(BillingPlan.FREE).name} plan on ${toLocaleDate( $organization.billingNextInvoiceDate )}`}> - You will retain access to {tierToPlan($organization.billingPlan).name} plan features until - your billing period ends. After that, + You will retain access to {tierToPlan($organization.billingPlan).name} plan features until your + billing period ends. After that, {#if excess?.members > 0} all team members except the owner will be removed, {:else} diff --git a/src/lib/stores/organization.ts b/src/lib/stores/organization.ts index 3a413c36b..851b2bfb6 100644 --- a/src/lib/stores/organization.ts +++ b/src/lib/stores/organization.ts @@ -16,7 +16,7 @@ export type OrganizationError = { export type Organization = Models.Team> & { billingBudget: number; billingPlan: Tier; - billingPlanDetails: Plan; /* unused for now! */ + billingPlanDetails: Plan /* unused for now! */; budgetAlerts: number[]; paymentMethodId: string; backupPaymentMethodId: string; diff --git a/src/routes/(console)/organization-[organization]/billing/planSummaryOld.svelte b/src/routes/(console)/organization-[organization]/billing/planSummaryOld.svelte index f593b54d6..083aff444 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummaryOld.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummaryOld.svelte @@ -51,8 +51,7 @@ {currentPlan.name} plan - {isTrial || - $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION + {isTrial || $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION ? formatCurrency(0) : currentPlan ? formatCurrency(currentPlan?.price) diff --git a/src/routes/(console)/project-[region]-[project]/functions/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/+page.svelte index 6ffe38400..0bc701817 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/+page.svelte @@ -68,11 +68,7 @@ keys: ['c'], disabled: $wizard.show || - isServiceLimited( - 'functions', - $organization?.billingPlan, - data.functions?.total - ) || + isServiceLimited('functions', $organization?.billingPlan, data.functions?.total) || !$canWriteFunctions, icon: IconPlus, group: 'functions' diff --git a/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte index f76cf4bb8..4f5ca68a1 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/templates/template-[template]/+page.svelte @@ -26,8 +26,7 @@ import { IconExternalLink } from '@appwrite.io/pink-icons-svelte'; $: buttonDisabled = - isCloud && - isServiceLimited('functions', $organization?.billingPlan, $functionsList?.total); + isCloud && isServiceLimited('functions', $organization?.billingPlan, $functionsList?.total); From 4f4855a6e57bf6ce5980fd5655b5a14c8778e6f1 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 23 Dec 2025 18:03:31 +0530 Subject: [PATCH 07/13] revert: unnecessary changes. --- src/lib/stores/billing.ts | 1 - src/routes/(console)/account/organizations/+page.svelte | 2 +- src/routes/(console)/apply-credit/+page.svelte | 2 +- .../organization-[organization]/billing/+page.svelte | 8 +++----- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index 26b1ffb2e..695ef874c 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -560,7 +560,6 @@ export async function checkForMissingPaymentMethod() { Query.isNull('backupPaymentMethodId'), Query.equal('platform', Platform.Appwrite) ]); - if (orgs?.total) { orgMissingPaymentMethod.set(orgs.teams[0]); headerAlert.add({ diff --git a/src/routes/(console)/account/organizations/+page.svelte b/src/routes/(console)/account/organizations/+page.svelte index b369b1894..2d1668043 100644 --- a/src/routes/(console)/account/organizations/+page.svelte +++ b/src/routes/(console)/account/organizations/+page.svelte @@ -42,7 +42,7 @@ // For known plans, use tierToPlan const tierData = tierToPlan(billingPlan as Tier); - // If it's not a custom plan, or we got a non-custom result, return the name + // If it's not a custom plan or we got a non-custom result, return the name if (tierData.name !== 'Custom') { return tierData.name; } diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 20778b418..db9dbc038 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -229,7 +229,7 @@ campaign?.plan && $plansInfo.get(campaign.plan) ? $plansInfo.get(campaign.plan) : null; const newPlan = $plansInfo.get(billingPlan); - // if campaign has a plan, and it's higher than the selected new plan + // if campaign has a plan and it's higher than the selected new plan if (campaignPlan?.order > newPlan?.order) { return campaignPlan.$id as Tier; } diff --git a/src/routes/(console)/organization-[organization]/billing/+page.svelte b/src/routes/(console)/organization-[organization]/billing/+page.svelte index 15e6785a9..99729b8e9 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.svelte +++ b/src/routes/(console)/organization-[organization]/billing/+page.svelte @@ -125,11 +125,9 @@ {/if} {#if organization?.billingPlanDowngrade} - Your organization has changed to {tierToPlan(organization?.billingPlanDowngrade).name} - plan. You will continue to have access to {tierToPlan(organization?.billingPlan).name} - plan features until your billing period ends on {toLocaleDate( - organization.billingNextInvoiceDate - )}. + Your organization has changed to {tierToPlan(organization?.billingPlanDowngrade).name} plan. + You will continue to have access to {tierToPlan(organization?.billingPlan).name} plan features + until your billing period ends on {toLocaleDate(organization.billingNextInvoiceDate)}. {/if} {#if $useNewPricingModal} From 4af5e8334f38f225585dac66eee6f3612906bafc Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 24 Dec 2025 12:50:09 +0530 Subject: [PATCH 08/13] fix: empty string key causing crashes, plus the key accessor was wrong. --- .../overview/onboard.svelte | 63 ++++++++++--------- .../overview/platforms/+page.svelte | 13 ++-- .../overview/platforms/wizard/store.ts | 2 - 3 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte b/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte index 78757226d..40ddb34b9 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte @@ -28,48 +28,53 @@ import PlatformFlutterImgSourceDark from './assets/platform-flutter-dark.svg'; import PlatformSdkImgSource from './assets/platform-sdk.jpg'; import PlatformSdkImgSourceDark from './assets/platform-sdk-dark.png'; - import { base } from '$app/paths'; + import { resolve } from '$app/paths'; import { isSmallViewport } from '$lib/stores/viewport'; import type { Models } from '@appwrite.io/console'; import { getPlatformInfo } from '$lib/helpers/platform'; import { Click, trackEvent } from '$lib/actions/analytics'; import { goto } from '$app/navigation'; import { page } from '$app/state'; + import { onMount } from 'svelte'; - export let pingCount = 0; - export let platforms: Models.Platform[] = []; + let { + pingCount = 0, + platforms = [] + }: { + pingCount: number; + platforms: Array; + } = $props(); + + let platformMap = $state(new Map()); + + const projectRoute = $derived.by(() => { + return resolve('/(console)/project-[region]-[project]', { + region: page.params.region, + project: page.params.project + }); + }); + + onMount(() => { + platforms.forEach((platform) => { + const platformInfo = getPlatformInfo(platform.type); + platformMap.set(platformInfo.name, platform); + }); + }); function createKey() { - trackEvent(Click.KeyCreateClick, { - source: 'onboarding' - }); - goto( - `${base}/project-${page.params.region}-${page.params.project}/overview/api-keys/create`, - { - replaceState: true - } - ); + trackEvent(Click.KeyCreateClick, { source: 'onboarding' }); + + goto(`${projectRoute}/overview/api-keys/create`, { replaceState: true }); } function openPlatformWizard(type: number, platform?: Models.Platform) { if (platform) { - continuePlatform(type, platform.name, platform.key, platform.type); + continuePlatform(type, platform.name, platform.type); } else { trackEvent(Click.PlatformCreateClick, { source: 'onboarding' }); addPlatform(type); } } - - let platformMap = new Map(); - - $: { - let updatedMap = new Map(); - platforms.forEach((platform) => { - const platformInfo = getPlatformInfo(platform.type); - updatedMap.set(platformInfo.name, platform); - }); - platformMap = updatedMap; - }

@@ -410,9 +415,7 @@ { trackEvent(Click.OnboardingSetupDatabaseClick); - goto( - `${base}/project-${page.params.region}-${page.params.project}/databases` - ); + goto(`${projectRoute}/databases`); }} padding="s" > { trackEvent( Click.OnboardingAuthEmailPasswordClick @@ -517,7 +520,7 @@ { trackEvent( Click.OnboardingAuthOauth2Click @@ -525,7 +528,7 @@ }}>OAuth 2 { trackEvent( Click.OnboardingAuthAllMethodsClick diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/+page.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/+page.svelte index c86b1b50d..22d0bce77 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/+page.svelte @@ -27,25 +27,20 @@ }); } - export async function continuePlatform( - platform: Platform, - name: string, - key: string, - type: PlatformType - ) { + export async function continuePlatform(platform: Platform, name: string, type: PlatformType) { createPlatform.set({ name: name, - key: key, type: type }); + trackEvent(Click.PlatformCreateClick, { platform: platforms[platform], state: 'continue' }); + wizard.start(platforms[platform], null, 1, { isConnectPlatform: true, - platform: type, - key: key + platform: type }); } diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/wizard/store.ts b/src/routes/(console)/project-[region]-[project]/overview/platforms/wizard/store.ts index e15dcfbf2..24f28def6 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/wizard/store.ts +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/wizard/store.ts @@ -6,7 +6,6 @@ function createPlatformStore() { $id: null, name: null, hostname: null, - key: null, store: null, type: null }); @@ -20,7 +19,6 @@ function createPlatformStore() { $id: null, name: null, hostname: null, - key: null, store: null, type: null }); From 72ddec4493835dfbdd3d79100368f9e4b3b93f9c Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 24 Dec 2025 12:59:55 +0530 Subject: [PATCH 09/13] use: derived. --- .../overview/onboard.svelte | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte b/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte index 40ddb34b9..0ab32228f 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte @@ -45,7 +45,15 @@ platforms: Array; } = $props(); - let platformMap = $state(new Map()); + const platformMap = $derived.by(() => { + const map = new Map(); + platforms.forEach((platform) => { + const platformInfo = getPlatformInfo(platform.type); + map.set(platformInfo.name, platform); + }); + + return map; + }); const projectRoute = $derived.by(() => { return resolve('/(console)/project-[region]-[project]', { @@ -54,13 +62,6 @@ }); }); - onMount(() => { - platforms.forEach((platform) => { - const platformInfo = getPlatformInfo(platform.type); - platformMap.set(platformInfo.name, platform); - }); - }); - function createKey() { trackEvent(Click.KeyCreateClick, { source: 'onboarding' }); From c2c9a40791e9d01b6ffc04360b3edda2035a2760 Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 24 Dec 2025 13:03:52 +0530 Subject: [PATCH 10/13] remove: onmount. --- .../(console)/project-[region]-[project]/overview/onboard.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte b/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte index 0ab32228f..8650aa498 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/onboard.svelte @@ -35,7 +35,6 @@ import { Click, trackEvent } from '$lib/actions/analytics'; import { goto } from '$app/navigation'; import { page } from '$app/state'; - import { onMount } from 'svelte'; let { pingCount = 0, From 5d0fe2823ef3f49c4271bc4ff012f881320c5664 Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 24 Dec 2025 15:43:39 +0530 Subject: [PATCH 11/13] update: as per sdk. --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/lib/stores/organization.ts | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index b16cdf836..a2e1778fe 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@cced6e3", + "@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f", "@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 985b51df2..9a968c01e 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@cced6e3 - version: https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3 + specifier: https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f + version: https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f '@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@cced6e3': - resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@cced6e3} + '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f': + resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f} 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@cced6e3': {} + '@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f': {} '@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)': dependencies: diff --git a/src/lib/stores/organization.ts b/src/lib/stores/organization.ts index 851b2bfb6..b3b874cab 100644 --- a/src/lib/stores/organization.ts +++ b/src/lib/stores/organization.ts @@ -16,6 +16,7 @@ export type OrganizationError = { export type Organization = Models.Team> & { billingBudget: number; billingPlan: Tier; + billingPlanId: Tier /* unused for now! */; billingPlanDetails: Plan /* unused for now! */; budgetAlerts: number[]; paymentMethodId: string; From e446f7ff82581ad4553b9a5e13be149ece220ad2 Mon Sep 17 00:00:00 2001 From: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> Date: Wed, 24 Dec 2025 17:33:49 -0800 Subject: [PATCH 12/13] feat: add attachment support to support wizard (#2624) --- src/routes/(console)/supportWizard.svelte | 78 +++++++++++++++++------ 1 file changed, 60 insertions(+), 18 deletions(-) diff --git a/src/routes/(console)/supportWizard.svelte b/src/routes/(console)/supportWizard.svelte index eabf8a26b..7fe3fc710 100644 --- a/src/routes/(console)/supportWizard.svelte +++ b/src/routes/(console)/supportWizard.svelte @@ -1,6 +1,15 @@