diff --git a/src/lib/wizards/functions/components/appwriteVariable.svelte b/src/lib/wizards/functions/components/appwriteVariable.svelte deleted file mode 100644 index d763753f3..000000000 --- a/src/lib/wizards/functions/components/appwriteVariable.svelte +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - This API key will allow you to interact with the Appwrite server APIs. Learn more. - - - - The APPWRITE_API_KEY will be automatically generated for - your project and applied to this function once it's created. - - - diff --git a/src/lib/wizards/functions/createTemplate.svelte b/src/lib/wizards/functions/createTemplate.svelte index b56d77852..48ceb5905 100644 --- a/src/lib/wizards/functions/createTemplate.svelte +++ b/src/lib/wizards/functions/createTemplate.svelte @@ -16,7 +16,6 @@ import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; import { base } from '$app/paths'; import { page } from '$app/stores'; - import { scopes } from '$lib/constants'; import { isValueOfStringEnum } from '$lib/helpers/types'; import TemplateConfiguration from './steps/templateConfiguration.svelte'; import TemplatePermissions from './steps/templatePermissions.svelte'; @@ -33,16 +32,6 @@ const runtimeDetail = $template.runtimes.find( (r) => r.name === $templateConfig.runtime ); - if ($templateConfig.appwriteApiKey) { - $templateConfig.variables['APPWRITE_API_KEY'] = $templateConfig.appwriteApiKey; - } else if ($templateConfig?.generateKey) { - const key = await sdk.forConsole.projects.createKey( - $page.params.project, - 'Generated for Template', - scopes.map((scope) => scope.scope) - ); - $templateConfig.variables['APPWRITE_API_KEY'] = key.secret; - } const response = await sdk.forProject.functions.create( $templateConfig.$id || ID.unique(), diff --git a/src/lib/wizards/functions/steps/templateVariables.svelte b/src/lib/wizards/functions/steps/templateVariables.svelte index d8e677344..0b9c9461d 100644 --- a/src/lib/wizards/functions/steps/templateVariables.svelte +++ b/src/lib/wizards/functions/steps/templateVariables.svelte @@ -12,7 +12,6 @@ InputNumber } from '$lib/elements/forms'; import { Card, Collapsible, CollapsibleItem } from '$lib/components'; - import AppwriteVariable from '../components/appwriteVariable.svelte'; import type { SvelteComponent } from 'svelte'; async function beforeSubmit() { @@ -20,10 +19,6 @@ if (!variable.required) { continue; } - if (variable.name === 'APPWRITE_API_KEY') { - if ($templateConfig.appwriteApiKey || $templateConfig.generateKey) continue; - else throw new Error(`Please set ${variable.name} variable or generate it.`); - } if (!$templateConfig.variables[variable.name]) { throw new Error(`Please set ${variable.name} variable.`); } @@ -72,25 +67,21 @@ {#each requiredVariables as variable} - {#if variable.name === 'APPWRITE_API_KEY'} - - {:else} - - - - {@html variable.description} - - - {/if} + + + + {@html variable.description} + + {/each} @@ -107,25 +98,21 @@ {#each optionalVariables as variable} - {#if variable.name === 'APPWRITE_API_KEY'} - - {:else} - - + + - - {@html variable.description} - - - {/if} + + {@html variable.description} + + {/each} diff --git a/src/lib/wizards/functions/store.ts b/src/lib/wizards/functions/store.ts index 94902c944..04e20702d 100644 --- a/src/lib/wizards/functions/store.ts +++ b/src/lib/wizards/functions/store.ts @@ -14,7 +14,6 @@ export const templateConfig = writable<{ repositoryName?: string; repositoryPrivate?: boolean; repositoryId: string; - appwriteApiKey?: string; generateKey?: boolean; execute?: boolean; scopes?: string[];
APPWRITE_API_KEY