diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateScopes.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateScopes.svelte index 23a4bfb0c..bbcd111dd 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateScopes.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateScopes.svelte @@ -10,16 +10,20 @@ import { onMount } from 'svelte'; import { func } from '../store'; import { isValueOfStringEnum } from '$lib/helpers/types'; - import { Runtime, type Scopes as ScopesType } from '@appwrite.io/console'; + import { + Runtime, + type ProjectKeyScopes, + type Scopes as FunctionScopes + } 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'; const functionId = page.params.function; - let functionScopes: ScopesType[] = null; + let functionScopes: ProjectKeyScopes[] = null; onMount(async () => { - functionScopes ??= $func.scopes as ScopesType[]; + functionScopes ??= $func.scopes as ProjectKeyScopes[]; }); async function updateScopes() { @@ -39,7 +43,7 @@ logging: $func.logging || undefined, entrypoint: $func.entrypoint || undefined, commands: $func.commands || undefined, - scopes: functionScopes || undefined, + scopes: (functionScopes as unknown as FunctionScopes[]) || undefined, installationId: $func.installationId || undefined, providerRepositoryId: $func.providerRepositoryId || undefined, providerBranch: $func.providerBranch || undefined, diff --git a/src/routes/(console)/project-[region]-[project]/overview/api-keys/scopes.svelte b/src/routes/(console)/project-[region]-[project]/overview/api-keys/scopes.svelte index ce62abded..2ffa59eb1 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/api-keys/scopes.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/api-keys/scopes.svelte @@ -46,11 +46,9 @@ Selector, Typography } from '@appwrite.io/pink-svelte'; - import type { ProjectKeyScopes, Scopes } from '@appwrite.io/console'; + import type { ProjectKeyScopes } from '@appwrite.io/console'; - type ScopeValue = ProjectKeyScopes | Scopes; - - let { scopes = $bindable([]) }: { scopes: ScopeValue[] } = $props(); + let { scopes = $bindable([]) }: { scopes: ProjectKeyScopes[] } = $props(); let allScopesList: ScopeDefinition[] = $state([]); let mounted = $state(false); @@ -194,10 +192,10 @@ }); } - function generateSyncedScopes(activeScopesObj: Record): Scopes[] { + function generateSyncedScopes(activeScopesObj: Record): ProjectKeyScopes[] { return Object.entries(activeScopesObj) .filter(([scope, isActive]) => isActive && scopeCatalog.has(scope)) - .map(([scope]) => scope as Scopes); + .map(([scope]) => scope as ProjectKeyScopes); }