Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@83fd10c",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@f151724",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bfe7ce3",
"@appwrite.io/pink-legacy": "^1.0.3",
Expand All @@ -41,7 +41,7 @@
"flatted": "^3.4.2",
"ignore": "^6.0.2",
"nanoid": "^5.1.7",
"nanotar": "^0.1.1",
"nanotar": "^0.3.0",
"pretty-bytes": "^6.1.1",
"remarkable": "^2.0.1",
"svelte-confetti": "^1.4.0",
Expand Down Expand Up @@ -91,8 +91,11 @@
"overrides": {
"vite": "npm:rolldown-vite@latest",
"minimatch": "10.2.3",
"brace-expansion": ">=5.0.5",
"immutable": "^5.1.5",
"flatted": "^3.4.2",
"picomatch": "^2.3.2"
"yaml": "^1.10.3",
"picomatch": "^2.3.2",
"cookie": "^0.7.0"
}
}
40 changes: 40 additions & 0 deletions src/lib/components/billing/alerts/realtimePricing.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<script lang="ts">
import { base } from '$app/paths';
import { browser } from '$app/environment';
import { HeaderAlert } from '$lib/layout';
import { organization, currentPlan } from '$lib/stores/organization';
import { Button } from '$lib/elements/forms';

const DISMISS_KEY = 'realtimePricingDismissed';

let dismissed = browser && localStorage.getItem(DISMISS_KEY) === 'true';

function handleDismiss() {
dismissed = true;
if (browser) {
localStorage.setItem(DISMISS_KEY, 'true');
}
}

$: href = $currentPlan?.usagePerProject
? `${base}/organization-${$organization.$id}/billing`
: `${base}/organization-${$organization.$id}/usage`;
</script>

{#if $organization?.$id && !dismissed}
<HeaderAlert
type="info"
title="Realtime pricing enforcement starting April 22nd"
dismissible
on:dismiss={handleDismiss}>
<svelte:fragment>
Starting April 22nd, realtime usage (connections, messages, and bandwidth) will be
charged based on your plan's rates. Review your usage to avoid unexpected charges.
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button {href} text fullWidthMobile>
<span class="text">View usage</span>
</Button>
</svelte:fragment>
</HeaderAlert>
{/if}
15 changes: 13 additions & 2 deletions src/lib/components/billing/usageRates.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
{/each}
{#each Object.entries(org.billingPlanDetails.usage) as [key, usage]}
{@const limit = getPlanLimit(key)}
{@const show = limit !== false}
{#if show}
{#if limit !== false}
<Table.Row.Base {root}>
<Table.Cell column="resource" {root}>{usage.name}</Table.Cell>
<Table.Cell column="limit" {root}>
Expand All @@ -82,6 +81,18 @@
</Table.Cell>
{/if}
</Table.Row.Base>
{:else if usage.price > 0}
<Table.Row.Base {root}>
<Table.Cell column="resource" {root}>{usage.name}</Table.Cell>
<Table.Cell column="limit" {root}>Pay-as-you-go</Table.Cell>
{#if !isFree}
<Table.Cell column="rate" {root}>
{formatCurrency(usage.price)}/{abbreviateNumber(
usage.value
)}{usage.unit}
</Table.Cell>
{/if}
</Table.Row.Base>
{/if}
{/each}
</Table.Root>
Expand Down
9 changes: 7 additions & 2 deletions src/lib/components/git/repositories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,13 @@

$repositories.repositories =
product === 'functions'
? (result as unknown as Models.ProviderRepositoryRuntimeList)
.runtimeProviderRepositories
? (
result as unknown as {
runtimeProviderRepositories: (Models.ProviderRepository & {
runtime: string;
})[];
}
).runtimeProviderRepositories
: (result as unknown as Models.ProviderRepositoryFrameworkList)
.frameworkProviderRepositories; //TODO: remove forced cast after backend fixes
$repositories.total = result.total;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/git/selectRootModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { iconPath } from '$lib/stores/app';
import { sdk } from '$lib/stores/sdk';
import { installation, repository } from '$lib/stores/vcs';
import { VCSDetectionType, type Models } from '@appwrite.io/console';
import { VCSDetectionType } from '@appwrite.io/console';
import DirectoryPicker from '$lib/components/git/DirectoryPicker.svelte';
import { writable } from 'svelte/store';

Expand Down Expand Up @@ -113,7 +113,7 @@
const iconName =
product === 'sites'
? detection.framework
: (detection as unknown as Models.DetectionRuntime).runtime;
: (detection as unknown as { runtime: string }).runtime;
const resolved = resolveIconUrl(iconName);
iconCache.set(path, resolved);
return resolved;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/stores/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export type PlanServices =
| 'platforms'
| 'realtime'
| 'realtimeAddon'
| 'realtimeMessages'
| 'storage'
| 'storageAddon'
| 'teams'
Expand Down Expand Up @@ -274,6 +275,7 @@ export function checkForUsageFees(plan: string, id: PlanServices) {
case 'users':
case 'executions':
case 'realtime':
case 'realtimeMessages':
return true;

default:
Expand Down
10 changes: 10 additions & 0 deletions src/routes/(console)/organization-[organization]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Breadcrumbs from './breadcrumbs.svelte';
import Header from './header.svelte';
import { headerAlert } from '$lib/stores/headerAlert';
import ProjectsAtRisk from '$lib/components/billing/alerts/projectsAtRisk.svelte';
import RealtimePricing from '$lib/components/billing/alerts/realtimePricing.svelte';
import { get } from 'svelte/store';
import { preferences } from '$lib/stores/preferences';
import { defaultRoles, defaultScopes } from '$lib/constants';
Expand Down Expand Up @@ -64,6 +65,15 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
loadAvailableRegions(params.organization)
]);

if (isCloud && new Date() < new Date('2026-04-22')) {
headerAlert.add({
show: true,
component: RealtimePricing,
id: 'realtimePricing',
importance: 1
});
}

return {
header: Header,
breadcrumbs: Breadcrumbs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,27 @@
getResource(resources, 'GBHours'),
currentPlan?.GBHours
),
createResourceRow(
'realtime',
'Realtime connections',
getResource(resources, 'realtime'),
currentPlan?.realtime
),
createResourceRow(
'realtime-messages',
'Realtime messages',
getResource(resources, 'realtimeMessages'),
currentPlan?.realtimeMessages
),
createRow({
id: 'realtime-bandwidth',
label: 'Realtime bandwidth',
resource: getResource(resources, 'realtimeBandwidth'),
usageFormatter: ({ value }) =>
humanFileSize(value).value + humanFileSize(value).unit,
priceFormatter: ({ amount }) => formatCurrency(amount),
includeProgress: false
}),
createRow({
id: 'sms',
label: 'Phone OTP',
Expand Down
Loading
Loading