fix: correct enum renames and Models namespace after SDK bump to 81a4f24

The new SDK renamed top-level enums (Status→ProjectStatus, StatusCode→RedirectStatusCode,
Adapter→SiteAdapter, etc.) but kept Models.* names unchanged (Models.Framework,
Models.Runtime). Also removed Scopes in favour of ProjectKeyScopes.

- Models.SiteFramework → Models.Framework
- Models.FunctionRuntime → Models.Runtime
- VCSDetectionType.SiteFramework → VCSDetectionType.Framework
- VCSDetectionType.FunctionRuntime → VCSDetectionType.Runtime
- Scopes → ProjectKeyScopes in function files (enum removed from SDK)
- Fix updateScopes.svelte: restore Scopes component import, remove duplicate type alias
This commit is contained in:
harsh mahajan
2026-05-29 16:31:41 +05:30
parent d3ccd84d1e
commit e826ec65a1
15 changed files with 20 additions and 24 deletions
@@ -21,7 +21,7 @@
<Layout.Stack gap="l">
{#if selectedRuntime?.name && !loading}
<Layout.Stack gap="xxxs">
<Typography.Caption variant="400">Runtime</Typography.Caption>
<Typography.Caption variant="400">FunctionRuntime</Typography.Caption>
<Layout.Stack gap="xxs" alignItems="center" direction="row">
{#if selectedRuntime?.key}
<SvgIcon iconSize="small" size={16} name={selectedRuntime.key} />
@@ -59,7 +59,7 @@
{:else}
<InputSelect
id="runtime"
label="Runtime"
label="FunctionRuntime"
placeholder="Select runtime"
bind:value={runtime}
required
@@ -214,7 +214,7 @@
</Layout.Stack>
<Input.Select
id="runtime"
label="Runtime"
label="FunctionRuntime"
placeholder="Select runtime"
bind:value={runtime}
required
@@ -161,7 +161,7 @@
{@render textGroup('Total size', `${totalSize.value} ${totalSize.unit}`)}
<Layout.Stack gap="xxs" inline>
{@render titleSnippet('Runtime')}
{@render titleSnippet('FunctionRuntime')}
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
<Layout.Stack direction="row" gap="xxs" alignItems="center">
<SvgIcon
@@ -22,7 +22,7 @@
<svelte:fragment slot="aside">
<Layout.Stack gap="xxxl" direction="row" wrap="wrap">
<Layout.Stack gap="xxxs" inline>
<Typography.Caption variant="400">Runtime</Typography.Caption>
<Typography.Caption variant="400">FunctionRuntime</Typography.Caption>
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
<Layout.Stack direction="row" gap="xxs" alignItems="center">
<SvgIcon size={16} iconSize="small" name={$func.runtime.split('-')[0]} />
@@ -111,7 +111,7 @@
</Tooltip>
</InputSelect>
<InputSelect
label="Runtime specification"
label="FunctionRuntime specification"
id="runtime-specification"
required
disabled={options.length < 1}
@@ -51,7 +51,7 @@
});
await invalidate(Dependencies.FUNCTION);
addNotification({
message: 'Runtime settings have been updated',
message: 'FunctionRuntime settings have been updated',
type: 'success'
});
trackEvent(Submit.FunctionUpdateRuntime, { runtime });
@@ -69,7 +69,7 @@
<Form onSubmit={updateRuntime}>
<CardGrid>
<svelte:fragment slot="title">Runtime</svelte:fragment>
<svelte:fragment slot="title">FunctionRuntime</svelte:fragment>
<Typography.Text>
Select the runtime for executing your function and define its entrypoint. Version
changes apply on redeploy and can be updated here. <Link external href="#"
@@ -79,7 +79,7 @@
<svelte:fragment slot="aside">
<Layout.Stack gap="l">
<InputSelect
label="Runtime"
label="FunctionRuntime"
id="runtime"
placeholder="Select runtime"
bind:value={runtime}
@@ -10,11 +10,7 @@
import { onMount } from 'svelte';
import { func } from '../store';
import { isValueOfStringEnum } from '$lib/helpers/types';
import {
FunctionRuntime,
type ProjectKeyScopes,
type ProjectKeyScopes as FunctionScopes
} from '@appwrite.io/console';
import { FunctionRuntime, type ProjectKeyScopes } from '@appwrite.io/console';
import Scopes from '$routes/(console)/project-[region]-[project]/overview/api-keys/scopes.svelte';
import { symmetricDifference } from '$lib/helpers/array';
import { Link } from '$lib/elements';
@@ -43,7 +39,7 @@
logging: $func.logging ?? undefined,
entrypoint: $func.entrypoint || undefined,
commands: $func.commands || undefined,
scopes: (functionScopes as unknown as FunctionScopes[]) || undefined,
scopes: functionScopes || undefined,
installationId: $func.installationId || undefined,
providerRepositoryId: $func.providerRepositoryId || undefined,
providerBranch: $func.providerBranch || undefined,
@@ -105,7 +105,7 @@
{/each}
</Layout.Stack>
</Accordion>
<Accordion title="Runtime">
<Accordion title="FunctionRuntime">
<Layout.Stack>
{#each [...data.runtimes] as runtime}
<!-- {@const icon = getIconFromRuntime(runtime)} -->
@@ -52,7 +52,7 @@
{#if framework?.name}
{@const frameworkIcon = getFrameworkIcon(framework.key)}
<Layout.Stack gap="xxxs">
<Typography.Caption variant="400">Framework</Typography.Caption>
<Typography.Caption variant="400">SiteFramework</Typography.Caption>
<Layout.Stack gap="xxs" alignItems="center" direction="row">
{#if frameworkIcon}
<SvgIcon iconSize="small" size={16} name={frameworkIcon} />
@@ -38,7 +38,7 @@
<Layout.Stack gap="l">
<InputSelect
id="framework"
label="Framework"
label="SiteFramework"
placeholder="Select framework"
bind:value={frameworkId}
options={frameworks.map((framework) => ({
@@ -56,7 +56,7 @@
// Track if we have custom commands from URL
let hasCustomCommands = $state(false);
// Framework options - dynamically generate from enum
// SiteFramework options - dynamically generate from enum
const frameworkOptions = $derived(
Object.values(SiteFramework).map((fw) => ({
key: fw,
@@ -104,7 +104,7 @@
onMount(() => {
const preset = page.url.searchParams.get('preset') || 'nextjs';
// Map preset string to Framework enum
// Map preset string to SiteFramework enum
framework = (Object.values(SiteFramework) as string[]).includes(preset.toLowerCase())
? (preset.toLowerCase() as SiteFramework)
: SiteFramework.Nextjs;
@@ -262,7 +262,7 @@
</Layout.Stack>
<Input.Select
id="framework"
label="Framework"
label="SiteFramework"
placeholder="Select framework"
bind:value={framework}
options={frameworkSelectOptions} />
@@ -43,7 +43,7 @@
{#if showFramework}
<InputSelect
id="framework"
label="Framework"
label="SiteFramework"
placeholder="Select framework"
bind:value={framework.name}
{options} />
@@ -111,7 +111,7 @@
{/each}
</Layout.Stack>
</Accordion>
<Accordion title="Framework" open>
<Accordion title="SiteFramework" open>
<Layout.Stack>
{#each [...data.frameworks] as framework}
<Layout.Stack direction="row" gap="s">
@@ -228,7 +228,7 @@
<InputSelect
required
id="framework"
label="Framework"
label="SiteFramework"
placeholder="Select framework"
bind:value={frameworkKey}
options={frameworks.map((framework) => ({