From 24f6921ed2ac588a5ebfc7de4ce5f70e95ce0769 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 11 Feb 2024 20:22:17 +0530 Subject: [PATCH 001/113] feat: initial commit --- src/lib/actions/analytics.ts | 1 + src/lib/sdk/auth.ts | 35 ++++ src/lib/stores/sdk.ts | 2 + .../auth/security/+page.svelte | 2 + .../auth/security/updateMockNumbers.svelte | 166 ++++++++++++++++++ src/routes/console/project-[project]/store.ts | 4 +- 6 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 src/lib/sdk/auth.ts create mode 100644 src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 181592ef0..0d9b8bccd 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -183,6 +183,7 @@ export enum Submit { AuthPasswordHistoryUpdate = 'submit_auth_password_history_limit_update', AuthPasswordDictionaryUpdate = 'submit_auth_password_dictionary_update', AuthPersonalDataCheckUpdate = 'submit_auth_personal_data_check_update', + AuthMockNumbersUpdate = 'submit_auth_mock_numbers_update', SessionsLengthUpdate = 'submit_sessions_length_update', SessionsLimitUpdate = 'submit_sessions_limit_update', SessionDelete = 'submit_session_delete', diff --git a/src/lib/sdk/auth.ts b/src/lib/sdk/auth.ts new file mode 100644 index 000000000..4a77a485c --- /dev/null +++ b/src/lib/sdk/auth.ts @@ -0,0 +1,35 @@ +import type { Client, Models } from '@appwrite.io/console'; + +export type MockNumber = { + phone: string; + otp: string; +}; + +export type Project = Models.Project & { + authMockNumbers: MockNumber[]; +}; + +export class Auth { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + async updateMockNumbers(projectId: string, numbers: MockNumber[]): Promise { + const path = `/projects/${projectId}/auth/mock-numbers`; + const params = { + projectId, + numbers: numbers + }; + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'patch', + uri, + { + 'content-type': 'application/json' + }, + params + ); + } +} diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index caacafee7..aff27ae5a 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -21,6 +21,7 @@ import { Vcs } from '@appwrite.io/console'; import { Billing } from '../sdk/billing'; +import { Auth } from '$lib/sdk/auth'; const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`; @@ -65,6 +66,7 @@ export const sdk = { health: new Health(clientConsole), locale: new Locale(clientConsole), projects: new Projects(clientConsole), + auth: new Auth(clientConsole), teams: new Teams(clientConsole), users: new Users(clientConsole), migrations: new Migrations(clientConsole), diff --git a/src/routes/console/project-[project]/auth/security/+page.svelte b/src/routes/console/project-[project]/auth/security/+page.svelte index f69b91395..0e3ac4f68 100644 --- a/src/routes/console/project-[project]/auth/security/+page.svelte +++ b/src/routes/console/project-[project]/auth/security/+page.svelte @@ -1,5 +1,6 @@ + + + Mock Phone Numbers +

+ Create upto 10 mock phone numbers and verification codes for testing. These numbers + can be used to simulate the phone number verification without sending an SMS. +

+ + + + Use Mock phone numbers with caution + Please use fictious phone numbers and verification codes to avoid affecting real user accounts. + + + +
    + + + +
+
+ + {#if $numbers.length > 0} + + + Phone Number + Verification Code + + + + {#each $numbers as number, i} + + + + {number.phone} + + + + + + {number.otp} + + + + +
+ +
+
+
+ {/each} +
+
+ {/if} +
+ + + + +
diff --git a/src/routes/console/project-[project]/store.ts b/src/routes/console/project-[project]/store.ts index 6af331f1c..18d6eee6d 100644 --- a/src/routes/console/project-[project]/store.ts +++ b/src/routes/console/project-[project]/store.ts @@ -1,11 +1,11 @@ import { page } from '$app/stores'; -import type { Models } from '@appwrite.io/console'; +import type { Project } from '$lib/sdk/auth'; import type { BarSeriesOption } from 'echarts/charts'; import { derived, writable } from 'svelte/store'; export const project = derived( page, - ($page) => $page.data.project as Models.Project & { region?: string } + ($page) => $page.data.project as Project & { region?: string } ); export const onboarding = derived( project, From cd28d85d489f1b3da1afb1d63dd83e0a047fbe5a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 11 Feb 2024 20:30:43 +0530 Subject: [PATCH 002/113] chore: linter --- .../auth/security/updateMockNumbers.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index 327cf030d..fd86cfebe 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -30,7 +30,7 @@ let otp: string = null; onMount(async () => { - console.log($numbers) + console.log($numbers); }); async function updateMockNumbers() { @@ -92,8 +92,8 @@ Mock Phone Numbers

- Create upto 10 mock phone numbers and verification codes for testing. These numbers - can be used to simulate the phone number verification without sending an SMS. + Create upto 10 mock phone numbers and verification codes for testing. These numbers can be + used to simulate the phone number verification without sending an SMS.

From 3841d2f1048573eac5c824d70aad431a7f37d253 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 11 Jun 2024 19:57:30 +0900 Subject: [PATCH 003/113] Add runtime memory and CPU Controls --- .../settings/updateRuntime.svelte | 79 ++++++++++++++++++- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte index a4a2f806c..df81a5147 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte @@ -16,11 +16,61 @@ const functionId = $page.params.function; let runtime: string = null; + let memory: number = null; + let cpus: number = null; let options = []; + let cpuOptions = [ + { + value: 1, + label: '1 CPU Core' + }, + { + value: 2, + label: '2 CPU Cores' + }, + { + value: 4, + label: '4 CPU Cores' + }, + { + value: 8, + label: '8 CPU Cores' + } + ]; + + let memoryOptions = [ + { + value: 512, + label: '512 MB' + }, + { + value: 1024, + label: '1 GB' + }, + { + value: 2048, + label: '2 GB' + }, + { + value: 4096, + label: '4 GB' + }, + { + value: 8192, + label: '8 GB' + }, + { + value: 16384, + label: '16 GB' + } + ]; + onMount(async () => { runtime ??= $func.runtime; + memory ??= $func.memory; + cpus ??= $func.cpus; let runtimes = await $runtimesList; options = runtimes.runtimes.map((runtime) => ({ @@ -50,11 +100,13 @@ $func.providerRepositoryId || undefined, $func.providerBranch || undefined, $func.providerSilentMode || undefined, - $func.providerRootDirectory || undefined + $func.providerRootDirectory || undefined, + memory, + cpus ); await invalidate(Dependencies.FUNCTION); addNotification({ - message: 'Runtime has been updated', + message: 'Runtime settings have been updated', type: 'success' }); trackEvent(Submit.FunctionUpdateName); @@ -66,6 +118,11 @@ trackError(error, Submit.FunctionUpdateName); } } + + $: isUpdateButtonEnabled = + runtime !== $func?.runtime || + cpus !== $func?.cpus || + memory !== $func?.memory;
@@ -82,11 +139,27 @@ {options} required hideRequired /> + + - + From c85195fc64b07e5634dd2872a5e7e7fe390bba9a Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 12 Jun 2024 14:19:31 +0900 Subject: [PATCH 004/113] Make specs dynamic using new specs API --- .../project-[project]/functions/+layout.ts | 8 ++- .../settings/updateRuntime.svelte | 72 ++++++------------- .../project-[project]/functions/store.ts | 5 ++ 3 files changed, 32 insertions(+), 53 deletions(-) diff --git a/src/routes/console/project-[project]/functions/+layout.ts b/src/routes/console/project-[project]/functions/+layout.ts index 68ecb719d..9f696c75f 100644 --- a/src/routes/console/project-[project]/functions/+layout.ts +++ b/src/routes/console/project-[project]/functions/+layout.ts @@ -8,15 +8,17 @@ import type { LayoutLoad } from './$types'; export const load: LayoutLoad = async ({ depends }) => { depends(Dependencies.FUNCTION_INSTALLATIONS); - const [runtimesList, installations] = await Promise.all([ + const [runtimesList, installations, specs] = await Promise.all([ sdk.forProject.functions.listRuntimes(), - sdk.forProject.vcs.listInstallations([Query.limit(100)]) + sdk.forProject.vcs.listInstallations([Query.limit(100)]), + sdk.forProject.functions.getSpecs() ]); return { header: Header, breadcrumbs: Breadcrumbs, runtimesList, - installations + installations, + specs }; }; diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte index df81a5147..6ec9f1def 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte @@ -10,7 +10,7 @@ import { onMount } from 'svelte'; import { func } from '../store'; import InputSelect from '$lib/elements/forms/inputSelect.svelte'; - import { runtimesList } from '../../store'; + import { runtimesList, specs } from '../../store'; import { isValueOfStringEnum } from '$lib/helpers/types'; import { Runtime } from '@appwrite.io/console'; @@ -20,52 +20,8 @@ let cpus: number = null; let options = []; - - let cpuOptions = [ - { - value: 1, - label: '1 CPU Core' - }, - { - value: 2, - label: '2 CPU Cores' - }, - { - value: 4, - label: '4 CPU Cores' - }, - { - value: 8, - label: '8 CPU Cores' - } - ]; - - let memoryOptions = [ - { - value: 512, - label: '512 MB' - }, - { - value: 1024, - label: '1 GB' - }, - { - value: 2048, - label: '2 GB' - }, - { - value: 4096, - label: '4 GB' - }, - { - value: 8192, - label: '8 GB' - }, - { - value: 16384, - label: '16 GB' - } - ]; + let cpuOptions = []; + let memoryOptions = []; onMount(async () => { runtime ??= $func.runtime; @@ -73,10 +29,28 @@ cpus ??= $func.cpus; let runtimes = await $runtimesList; + let specs = await $specs; options = runtimes.runtimes.map((runtime) => ({ label: `${runtime.name} - ${runtime.version}`, value: runtime.$id })); + + memoryOptions = specs.memory.map((memory) => + memory > 1024 + ? { + label: `${memory / 1024} GB`, + value: memory + } + : { + label: `${memory} MB`, + value: memory + } + ); + + cpuOptions = specs.cpus.map((cpu) => ({ + label: cpu === 1 ? `${cpu} CPU Cores` : `${cpu} CPU Core`, + value: cpu + })); }); async function updateRuntime() { @@ -120,9 +94,7 @@ } $: isUpdateButtonEnabled = - runtime !== $func?.runtime || - cpus !== $func?.cpus || - memory !== $func?.memory; + runtime !== $func?.runtime || cpus !== $func?.cpus || memory !== $func?.memory;
diff --git a/src/routes/console/project-[project]/functions/store.ts b/src/routes/console/project-[project]/functions/store.ts index 3acf62136..7606e2404 100644 --- a/src/routes/console/project-[project]/functions/store.ts +++ b/src/routes/console/project-[project]/functions/store.ts @@ -7,6 +7,11 @@ export const runtimesList = derived( async ($page) => (await $page.data.runtimesList) as Models.RuntimeList ); +export const specs = derived( + page, + async ($page) => (await $page.data.specs) as Models.Specs +); + export const baseRuntimesList = derived(runtimesList, async ($runtimesList) => { const baseRuntimes = new Map(); for (const runtime of (await $runtimesList).runtimes) { From cd2b2570ce8f3cac966cea9396a12531413035ab Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 13 Jun 2024 15:23:43 +0200 Subject: [PATCH 005/113] refactor: filter application logic --- src/lib/components/filters/content.svelte | 125 ++++------------------ src/lib/components/filters/filters.svelte | 33 +++++- src/lib/components/filters/store.ts | 97 +++++++++++++++++ 3 files changed, 145 insertions(+), 110 deletions(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index cb56ca1e5..d4de55a86 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -8,94 +8,21 @@ FormList, InputSelectCheckbox } from '$lib/elements/forms'; - import { Query } from '@appwrite.io/console'; import { createEventDispatcher, onMount } from 'svelte'; - import { tags, type Operator, queries, type TagValue } from './store'; + import { tags, queries, type TagValue, operators, addFilter } from './store'; import type { Column } from '$lib/helpers/types'; import type { Writable } from 'svelte/store'; import { tooltip } from '$lib/actions/tooltip'; + // We cast to any to not cause type errors in the input components + /* eslint @typescript-eslint/no-explicit-any: 'off' */ + export let value: any = null; export let columns: Writable; export let columnId: string | null = null; - - const dispatch = createEventDispatcher<{ - clear: void; - apply: { applied: number }; - }>(); + export let arrayValues: string[] = []; + export let operatorKey: string | null = null; $: column = $columns.find((c) => c.id === columnId) as Column; - let arrayValues: string[] = []; - - dispatch('apply', { applied: $tags.length }); - - const operators: Record = { - 'starts with': { - toQuery: Query.startsWith, - toTag: (attribute, input) => `**${attribute}** starts with **${input}**`, - types: ['string'] - }, - 'ends with': { - toQuery: Query.endsWith, - toTag: (attribute, input) => `**${attribute}** ends with **${input}**`, - types: ['string'] - }, - 'greater than': { - toQuery: (attr, input) => Query.greaterThan(attr, Number(input)), - toTag: (attribute, input) => `**${attribute}** greater than **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - 'greater than or equal': { - toQuery: (attr, input) => Query.greaterThanEqual(attr, Number(input)), - toTag: (attribute, input) => `**${attribute}** greater than or equal to **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - 'less than': { - toQuery: Query.lessThan, - toTag: (attribute, input) => `**${attribute}** less than **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - 'less than or equal': { - toQuery: Query.lessThanEqual, - toTag: (attribute, input) => `**${attribute}** less than or equal to **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - equal: { - toQuery: Query.equal, - toTag: (attribute, input) => `**${attribute}** equal to **${input}**`, - types: ['string', 'integer', 'double', 'boolean'] - }, - 'not equal': { - toQuery: Query.notEqual, - toTag: (attribute, input) => `**${attribute}** not equal to **${input}**`, - types: ['string', 'integer', 'double', 'boolean'] - }, - 'is not null': { - toQuery: Query.isNotNull, - toTag: (attribute) => `**${attribute}** is not null`, - types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], - hideInput: true - }, - 'is null': { - toQuery: Query.isNull, - toTag: (attribute) => `**${attribute}** is null`, - types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], - hideInput: true - }, - contains: { - toQuery: Query.contains, - toTag: (attribute, input) => { - if (Array.isArray(input) && input.length > 2) { - return { - value: input, - tag: `**${attribute}** contains **${formatArray(input)}** ` - }; - } else { - return `**${attribute}** contains **${input}**`; - } - }, - types: ['string', 'integer', 'double', 'boolean', 'datetime', 'enum'] - } - }; $: operatorsForColumn = Object.entries(operators) .filter(([, v]) => v.types.includes(column?.type)) @@ -104,48 +31,30 @@ value: k })); - let operatorKey: string | null = null; $: operator = operatorKey ? operators[operatorKey] : null; $: { columnId; operatorKey = null; } - // We cast to any to not cause type errors in the input components - /* eslint @typescript-eslint/no-explicit-any: 'off' */ - let value: any = null; + $: isDisabled = !operator; onMount(() => { value = column?.array ? [] : null; }); - // This Map is keyed by tags, and has a query as the value - function addFilter() { - if (!column || !operator) return; - if (column.array) { - queries.addFilter({ column, operator, value: arrayValues }); - columnId = null; - arrayValues = []; - } else { - queries.addFilter({ column, operator, value: value ?? '' }); - columnId = null; - value = null; - } + function addFilterAndReset() { + addFilter($columns, columnId, operatorKey, value, arrayValues); + columnId = null; + operatorKey = null; + value = null; + arrayValues = []; } function tagFormat(node: HTMLElement) { node.innerHTML = node.innerHTML.replace(/\*\*(.*?)\*\*/g, '$1'); } - function formatArray(array: string[]) { - if (!array?.length) return; - if (array.length > 2) { - return `${array[0]} or ${array.length - 1} others`; - } else { - return array.join(' or '); - } - } - function isTypeTagValue(obj: any): obj is TagValue { if (typeof obj === 'string') return false; return ( @@ -157,11 +66,15 @@ ); } - $: isDisabled = !operator; + const dispatch = createEventDispatcher<{ + clear: void; + apply: { applied: number }; + }>(); + dispatch('apply', { applied: $tags.length });
- +
    ; @@ -15,7 +15,12 @@ const parsedQueries = queryParamToMap(query); queries.set(parsedQueries); + /* eslint @typescript-eslint/no-explicit-any: 'off' */ + let value: any = null; let selectedColumn: string | null = null; + let operatorKey: string | null = null; + let arrayValues: string[] = []; + // We need to separate them so we don't trigger Drop's handlers let showFiltersDesktop = false; let showFiltersMobile = false; @@ -33,9 +38,22 @@ queries.clearAll(); } + function apply() { + if (selectedColumn && operatorKey && value) { + addFilter($columns, selectedColumn, operatorKey, value, arrayValues); + selectedColumn = null; + value = null; + operatorKey = null; + arrayValues = []; + } + queries.apply(); + } + $: if (!showFiltersDesktop && !showFiltersMobile) { selectedColumn = null; } + + $: isButtonDisabled = $queriesAreDirty ? false : !selectedColumn || !operatorKey || !value;
    @@ -54,13 +72,16 @@

    Apply filter rules to refine the table view

    (applied = e.detail.applied)} on:clear={() => (applied = 0)} />
    - +
    @@ -85,12 +106,16 @@ size="big"> (applied = e.detail.applied)} on:clear={() => (applied = 0)} /> - + +
diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index 64fe6e2ad..8675eb78c 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -4,6 +4,7 @@ import { derived, get, writable } from 'svelte/store'; import { page } from '$app/stores'; import deepEqual from 'deep-equal'; import type { Column, ColumnType } from '$lib/helpers/types'; +import { Query } from '@appwrite.io/console'; export type TagValue = { tag: string; @@ -84,3 +85,99 @@ export const hasPageQueries = derived(page, ($page) => { }); export const tags = derived(queries, ($queries) => Array.from($queries.keys())); + +export function addFilter( + columns: Column[], + columnId: string, + operatorKey: string, + value: any, // We cast to any to not cause type errors in the input components + arrayValues: string[] = [] +) { + const operator = operatorKey ? operators[operatorKey] : null; + const column = columns.find((c) => c.id === columnId) as Column; + + if (!column || !operator) return; + if (column.array) { + queries.addFilter({ column, operator, value: arrayValues }); + } else { + queries.addFilter({ column, operator, value: value ?? '' }); + } +} + +export const operators: Record = { + 'starts with': { + toQuery: Query.startsWith, + toTag: (attribute, input) => `**${attribute}** starts with **${input}**`, + types: ['string'] + }, + 'ends with': { + toQuery: Query.endsWith, + toTag: (attribute, input) => `**${attribute}** ends with **${input}**`, + types: ['string'] + }, + 'greater than': { + toQuery: (attr, input) => Query.greaterThan(attr, Number(input)), + toTag: (attribute, input) => `**${attribute}** greater than **${input}**`, + types: ['integer', 'double', 'datetime'] + }, + 'greater than or equal': { + toQuery: (attr, input) => Query.greaterThanEqual(attr, Number(input)), + toTag: (attribute, input) => `**${attribute}** greater than or equal to **${input}**`, + types: ['integer', 'double', 'datetime'] + }, + 'less than': { + toQuery: Query.lessThan, + toTag: (attribute, input) => `**${attribute}** less than **${input}**`, + types: ['integer', 'double', 'datetime'] + }, + 'less than or equal': { + toQuery: Query.lessThanEqual, + toTag: (attribute, input) => `**${attribute}** less than or equal to **${input}**`, + types: ['integer', 'double', 'datetime'] + }, + equal: { + toQuery: Query.equal, + toTag: (attribute, input) => `**${attribute}** equal to **${input}**`, + types: ['string', 'integer', 'double', 'boolean'] + }, + 'not equal': { + toQuery: Query.notEqual, + toTag: (attribute, input) => `**${attribute}** not equal to **${input}**`, + types: ['string', 'integer', 'double', 'boolean'] + }, + 'is not null': { + toQuery: Query.isNotNull, + toTag: (attribute) => `**${attribute}** is not null`, + types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], + hideInput: true + }, + 'is null': { + toQuery: Query.isNull, + toTag: (attribute) => `**${attribute}** is null`, + types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], + hideInput: true + }, + contains: { + toQuery: Query.contains, + toTag: (attribute, input) => { + if (Array.isArray(input) && input.length > 2) { + return { + value: input, + tag: `**${attribute}** contains **${formatArray(input)}** ` + }; + } else { + return `**${attribute}** contains **${input}**`; + } + }, + types: ['string', 'integer', 'double', 'boolean', 'datetime', 'enum'] + } +}; + +function formatArray(array: string[]) { + if (!array?.length) return; + if (array.length > 2) { + return `${array[0]} or ${array.length - 1} others`; + } else { + return array.join(' or '); + } +} From 7019113f57e33d99a2345635a131cf24ed7a2d19 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 16 Jun 2024 22:41:43 +0000 Subject: [PATCH 006/113] chore: sync and updates --- .../auth/security/updateMockNumbers.svelte | 172 ++++++++---------- 1 file changed, 73 insertions(+), 99 deletions(-) diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index fd86cfebe..f82c73e92 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -1,17 +1,8 @@ + + + Execute function - Appwrite + + + + (showExitModal = true)}> + Execute function + + + + + {#if func?.version !== 'v3'} + + + Customizable execution data now available for functions v3.0 + + Update your function version to make use of new features including customizable + HTTP data in your executions. + + + + + + {:else} + + + + +
+

+ Headers + (optional) + +

+ + + {#if headers} + {#each headers as [name, value], index} + + + + + + + + {/each} + {/if} + + +
+ + + {/if} +
+ + test +
+ + + + + +
From 739673cbce825a6bd3ef0fcf26582512422c5aea Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 18 Jun 2024 14:55:39 +0200 Subject: [PATCH 009/113] feat: input date and time compatible with formItemPart --- src/lib/elements/forms/inputDate.svelte | 9 ++++++--- src/lib/elements/forms/inputTime.svelte | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/elements/forms/inputDate.svelte b/src/lib/elements/forms/inputDate.svelte index 95cd6813c..a108130fc 100644 --- a/src/lib/elements/forms/inputDate.svelte +++ b/src/lib/elements/forms/inputDate.svelte @@ -1,6 +1,6 @@ - + @@ -93,4 +96,4 @@ {#if error} {error} {/if} - + diff --git a/src/lib/elements/forms/inputTime.svelte b/src/lib/elements/forms/inputTime.svelte index 2e0caf60b..42cad1017 100644 --- a/src/lib/elements/forms/inputTime.svelte +++ b/src/lib/elements/forms/inputTime.svelte @@ -1,6 +1,6 @@ - + @@ -68,4 +71,4 @@ {#if error} {error} {/if} - + From ee8a815cd7baa1e518909fb8b7e538a02aafb42c Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 18 Jun 2024 14:55:53 +0200 Subject: [PATCH 010/113] feat: executions new wizard --- src/lib/layout/wizardSecondaryContent.svelte | 4 +- .../executions/+page.svelte | 2 +- .../executions/execute-function/+page.svelte | 163 ++++++++++++++++-- .../executions/execute-function/+page.ts | 18 ++ 4 files changed, 170 insertions(+), 17 deletions(-) create mode 100644 src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.ts diff --git a/src/lib/layout/wizardSecondaryContent.svelte b/src/lib/layout/wizardSecondaryContent.svelte index 6b69d488a..908995692 100644 --- a/src/lib/layout/wizardSecondaryContent.svelte +++ b/src/lib/layout/wizardSecondaryContent.svelte @@ -4,8 +4,6 @@
-
- -
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 6de32a50f..4806d3f8d 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -19,7 +19,7 @@ import { log } from '$lib/stores/logs'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { func, execute, showFunctionExecute } from '../store'; + import { func, execute } from '../store'; import type { Models } from '@appwrite.io/console'; import { organization } from '$lib/stores/organization'; import { getServiceLimit, showUsageRatesModal } from '$lib/stores/billing'; diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte index 67463cd8b..08524b5d8 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte @@ -3,20 +3,27 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; + import { timer } from '$lib/actions/timer'; import { tooltip } from '$lib/actions/tooltip'; - import { Alert } from '$lib/components'; + import { Alert, Card } from '$lib/components'; import { Dependencies } from '$lib/constants'; + import { Pill } from '$lib/elements'; import { Button, Form, FormItem, FormItemPart, FormList, + Helper, + InputDate, InputSelect, InputText, - InputTextarea + InputTextarea, + InputTime } from '$lib/elements/forms'; + import { humanFileSize } from '$lib/helpers/sizeConvertion'; + import { calculateTime } from '$lib/helpers/timeConversion'; import { WizardSecondaryContainer, WizardSecondaryContent, @@ -25,8 +32,19 @@ } from '$lib/layout'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; - import { ExecutionMethod } from '@appwrite.io/console'; + import { ExecutionMethod, type Models } from '@appwrite.io/console'; import { writable } from 'svelte/store'; + import DeploymentSource from '../../deploymentSource.svelte'; + import DeploymentDomains from '../../deploymentDomains.svelte'; + import { proxyRuleList } from '../../store'; + import DeploymentCreatedBy from '../../deploymentCreatedBy.svelte'; + import { + isSameDay, + toLocaleDate, + toLocaleDateISO, + toLocaleDateTime, + toLocaleTimeISO + } from '$lib/helpers/date'; let previousPage: string = `${base}/console`; let showExitModal = false; @@ -35,15 +53,10 @@ previousPage = from?.url?.pathname || previousPage; }); - let formComponent: Form; - let isSubmitting = writable(false); + export let data; - let path = '/'; - let method = ExecutionMethod.GET; - let body = ''; - let headers: [string, string][] = [['', '']]; - - const func = $page.data.function; + const func = data.function as Models.Function; + const deployment = data.activeDeployment as Models.Deployment; const keyList = [ { label: 'Authorization', value: 'Authorization' }, @@ -67,6 +80,14 @@ { label: 'OPTIONS', value: ExecutionMethod.OPTIONS } ]; + let formComponent: Form; + let isSubmitting = writable(false); + + let path = '/'; + let method = ExecutionMethod.GET; + let body = ''; + let headers: [string, string][] = [['', '']]; + async function handleSubmit() { try { const headersObject = {}; @@ -81,7 +102,8 @@ true, path, method, - headersObject + headersObject, + isScheduled ? dateTime : null ); if (!$page.url?.toString()?.includes('/executions')) { await goto( @@ -103,6 +125,16 @@ }); } } + let isScheduled: boolean = null; + let now = new Date(); + let minDate: string; + let date: string = toLocaleDateISO(now.getTime()); + let time: string = toLocaleTimeISO(now.getTime()); + $: minDate = toLocaleDateISO(now.getTime()); + $: minTime = isSameDay(new Date(date), new Date(minDate)) + ? toLocaleTimeISO(now.getTime()) + : '00:00'; + $: dateTime = new Date(`${date}T${time}`); @@ -231,10 +263,115 @@ placeholder={`Hello, World!`} id="body" bind:value={body} /> + +
  • + + {#if isScheduled} + + + + + {/if} + + {isScheduled + ? `Your function will be executed on ${toLocaleDateTime(dateTime?.toString())}` + : 'Your function will be executed immediately'} + +
  • {/if} - test + + +
    +

    Deployment ID

    + + {func.deployment} + +
    +
      +
    • +

      Status

      +

      + + active + + +

      +
    • +
    • +

      Build time

      +

      + {#if ['processing', 'building'].includes(deployment.status)} + + {:else} + {calculateTime(deployment.buildTime)} + {/if} +

      +
    • +
    • +

      Size

      +

      + {humanFileSize(deployment.size).value + + humanFileSize(deployment.size).unit} +

      +
    • +
    +
    +

    Source

    + + + +
    +
    +

    Domains

    + + + +
    +
    +

    Updated

    + + + +
    +
    +
    diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.ts b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.ts new file mode 100644 index 000000000..1d11c6734 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.ts @@ -0,0 +1,18 @@ +import { sdk } from '$lib/stores/sdk'; +import { Dependencies } from '$lib/constants'; +import type { PageLoad } from './$types'; + +export const load: PageLoad = async ({ params, depends, parent }) => { + const data = await parent(); + depends(Dependencies.DEPLOYMENTS); + + return { + func: data.function, + activeDeployment: data.function.deployment + ? await sdk.forProject.functions.getDeployment( + params.function, + data.function.deployment + ) + : null + }; +}; From 6d96d688598562cffefb78f3dc12801365de2b5d Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 18 Jun 2024 18:48:48 +0200 Subject: [PATCH 011/113] feat: replace routes --- src/lib/layout/containerButton.svelte | 4 +++- src/lib/layout/containerHeader.svelte | 4 +++- .../functions/function-[function]/+page.svelte | 8 +++----- .../functions/function-[function]/execute.svelte | 1 + .../function-[function]/executions/+page.svelte | 16 +++++++--------- .../settings/executeFunction.svelte | 11 ++++++----- .../functions/function-[function]/store.ts | 4 ++-- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/lib/layout/containerButton.svelte b/src/lib/layout/containerButton.svelte index 97fb3efd7..facdf58c5 100644 --- a/src/lib/layout/containerButton.svelte +++ b/src/lib/layout/containerButton.svelte @@ -15,6 +15,7 @@ export let disabled: boolean; export let buttonText: string; export let buttonMethod: () => void | Promise; + export let buttonHref: string = null; export let buttonEvent: string = buttonText?.toLocaleLowerCase(); export let icon = 'plus'; export let showIcon = true; @@ -31,7 +32,8 @@ secondary={buttonType === 'secondary'} on:click={buttonMethod} event={buttonEvent} - {disabled}> + {disabled} + href={buttonHref}> {#if showIcon}
    From 4c3432774f16acd2d22ec494bcf57bfd87da0a22 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 20 Jun 2024 18:32:08 +0530 Subject: [PATCH 013/113] chore: fix reactivity --- src/lib/elements/forms/inputPhone.svelte | 3 +- .../auth/security/updateMockNumbers.svelte | 71 +++++++------------ 2 files changed, 27 insertions(+), 47 deletions(-) diff --git a/src/lib/elements/forms/inputPhone.svelte b/src/lib/elements/forms/inputPhone.svelte index 52b5e1153..095e06d65 100644 --- a/src/lib/elements/forms/inputPhone.svelte +++ b/src/lib/elements/forms/inputPhone.svelte @@ -90,7 +90,8 @@ autocomplete={autocomplete ? 'on' : 'off'} bind:value bind:this={element} - on:invalid={handleInvalid} /> + on:invalid={handleInvalid} + on:input /> {#if error} {error} diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index 5401f4d79..ead494c1c 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -1,9 +1,8 @@ @@ -105,13 +80,17 @@ placeholder="Enter Phone Number" label="Phone Number" showLabel={index === 0 ? true : false} + on:input={onInputChanged} required /> {/if} - - {:else} - { - addPhoneNumber({ - phone: '', - otp: '' - }); - }}>Create a mock phone number - {/if} - + {:else} + { + addPhoneNumber({ + phone: '', + otp: '' + }); + }}>Create a mock phone number + {/if} + - - - - + + + + + From 06dcab01659b8e7548302b78093ed596395cc60b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 20 Jun 2024 19:58:19 +0530 Subject: [PATCH 017/113] chore: update conditions --- .../auth/security/updateMockNumbers.svelte | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index f6a33dc53..9fba534bd 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -11,21 +11,12 @@ import { Dependencies } from '$lib/constants'; import { writable } from 'svelte/store'; import Empty from '$lib/components/empty.svelte'; - import { onMount } from 'svelte'; let numbers = writable($project.authMockNumbers); let initialNumbers = []; let projectId: string = $project.$id; let submitDisabled = true; - // onMount(() => { - // initialNumbers = $project.authMockNumbers.map((num) => ({ ...num })); - // }); - - const onInputChanged = () => { - // submitDisabled = JSON.stringify($numbers) === JSON.stringify(initialNumbers); - }; - $: initialNumbers = $project.authMockNumbers.map((num) => ({ ...num })); $: submitDisabled = JSON.stringify($numbers) === JSON.stringify(initialNumbers); @@ -85,7 +76,6 @@ placeholder="Enter Phone Number" label="Phone Number" showLabel={index === 0 ? true : false} - on:input={onInputChanged} maxlength={16} required /> From c474e6a2842d578d173fb234ffcd0f13f97b3fcc Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 20 Jun 2024 20:33:55 +0530 Subject: [PATCH 018/113] Apply suggestions from code review Co-authored-by: Torsten Dittmann --- .../project-[project]/auth/security/updateMockNumbers.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index 9fba534bd..ea63a5301 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -12,7 +12,7 @@ import { writable } from 'svelte/store'; import Empty from '$lib/components/empty.svelte'; - let numbers = writable($project.authMockNumbers); + const numbers = writable($project.authMockNumbers); let initialNumbers = []; let projectId: string = $project.$id; let submitDisabled = true; @@ -38,7 +38,7 @@ } } - const addPhoneNumber = (number?: MockNumber) => { + function addPhoneNumber(number?: MockNumber) { numbers.update((n) => [ ...n, { From b9e64b7b497e28962259a4a5dda4e66e1d2ca1b4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 20 Jun 2024 20:36:24 +0530 Subject: [PATCH 019/113] fix: review comments --- .../project-[project]/auth/security/updateMockNumbers.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index ea63a5301..a9c2463d7 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -48,7 +48,7 @@ ]); }; - const deletePhoneNumber = (index: number) => { + function deletePhoneNumber(index: number) { numbers.update((n) => { n.splice(index, 1); return n; From 760b664c49293225c89ec99cd7ace36fe5ad9cfa Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 20 Jun 2024 20:40:22 +0530 Subject: [PATCH 020/113] fix: review comments --- .../auth/security/updateMockNumbers.svelte | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index a9c2463d7..b5e7adfea 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -38,12 +38,12 @@ } } - function addPhoneNumber(number?: MockNumber) { + function addPhoneNumber(number: MockNumber) { numbers.update((n) => [ ...n, { - phone: number?.phone, - otp: number?.otp + phone: number.phone, + otp: number.otp } ]); }; @@ -104,7 +104,10 @@ + + + +
    +
    +
    + +
    +
    + +
    +
    + +
    {#if !$func.logging}
    @@ -97,62 +124,8 @@
    {/if} - {#if data.executions.total} - - - Execution ID - Status - Created - Trigger - Method - Path - Duration - - - {#each data.executions.executions as execution} - showLogs(execution)}> - - {execution.$id} - - - {@const status = execution.status} -
    - - {#if status === 'scheduled'} - -
    -
    - - {timeFromNow(execution.$createdAt)} - - - - {execution.trigger} - - - - {execution.requestMethod} - - - {execution.requestPath} - - - {calculateTime(execution.duration)} - -
    - {/each} -
    -
    + {#if data?.executions?.total} + { depends(Dependencies.EXECUTIONS); const page = getPage(url); const limit = getLimit(url, route, PAGE_LIMIT); const offset = pageToOffset(page, limit); + const query = getQuery(url); + + const parsedQueries = queryParamToMap(query || '[]'); + queries.set(parsedQueries); return { offset, limit, + query, executions: await sdk.forProject.functions.listExecutions(params.function, [ Query.limit(limit), Query.offset(offset), - Query.orderDesc('') + Query.orderDesc(''), + ...parsedQueries.values() ]) }; }; diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte new file mode 100644 index 000000000..37c21d3c8 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte @@ -0,0 +1,104 @@ + + + + + {#each columns as column} + {#if column.show} + {column.title} + {/if} + {/each} + + + {#each data.executions.executions as execution (execution.$id)} + showLogs(execution)}> + {#each columns as column} + {#if column.show} + {#if column.id === '$id'} + {#key column.id} + + {execution.$id} + + {/key} + {:else if column.id === 'status'} + + {@const status = execution.status} +
    + + {#if status === 'scheduled'} + +
    +
    + {:else if column.id === '$createdAt'} + + {timeFromNow(execution.$createdAt)} + + {:else if column.id === 'trigger'} + + + {execution.trigger} + + + {:else if column.id === 'requestMethod'} + + {execution.requestMethod} + + {:else if column.id === 'requestPath'} + + {execution.requestPath} + + {:else if column.id === 'duration'} + + {calculateTime(execution.duration)} + + {/if} + {/if} + {/each} +
    + {/each} +
    +
    From e9ed38016d55a05622ced24264f37df0422e6d9c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 21 Jun 2024 13:07:42 +0000 Subject: [PATCH 026/113] chore: remove imput --- src/lib/elements/forms/inputPhone.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/elements/forms/inputPhone.svelte b/src/lib/elements/forms/inputPhone.svelte index 095e06d65..52b5e1153 100644 --- a/src/lib/elements/forms/inputPhone.svelte +++ b/src/lib/elements/forms/inputPhone.svelte @@ -90,8 +90,7 @@ autocomplete={autocomplete ? 'on' : 'off'} bind:value bind:this={element} - on:invalid={handleInvalid} - on:input /> + on:invalid={handleInvalid} /> {#if error} {error} From 94dcccc27c85d5a29bbd05de213f03fba82eecef Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 21 Jun 2024 16:16:34 +0200 Subject: [PATCH 027/113] refactor: operators are now writable --- src/lib/components/filters/content.svelte | 4 ++-- src/lib/components/filters/store.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index d4de55a86..6c4a00bcb 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -24,14 +24,14 @@ $: column = $columns.find((c) => c.id === columnId) as Column; - $: operatorsForColumn = Object.entries(operators) + $: operatorsForColumn = Object.entries($operators) .filter(([, v]) => v.types.includes(column?.type)) .map(([k]) => ({ label: k, value: k })); - $: operator = operatorKey ? operators[operatorKey] : null; + $: operator = operatorKey ? $operators[operatorKey] : null; $: { columnId; operatorKey = null; diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index f919a9402..1f7777aba 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -1,6 +1,6 @@ import { goto } from '$app/navigation'; -import { derived, get, writable } from 'svelte/store'; +import { derived, get, writable, type Writable } from 'svelte/store'; import { page } from '$app/stores'; import deepEqual from 'deep-equal'; import type { Column, ColumnType } from '$lib/helpers/types'; @@ -105,7 +105,7 @@ export function addFilter( } } -export const operators: Record = { +export const operators: Writable> = writable({ 'starts with': { toQuery: Query.startsWith, toTag: (attribute, input) => `**${attribute}** starts with **${input}**`, @@ -172,7 +172,7 @@ export const operators: Record = { }, types: ['string', 'integer', 'double', 'boolean', 'datetime', 'enum'] } -}; +}); function formatArray(array: string[]) { if (!array?.length) return; From 013ca8e3b0621a6112c9edfe46c44942f694bf19 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 21 Jun 2024 16:17:02 +0200 Subject: [PATCH 028/113] empty commit From 678cba892c8fb8d3f259bbbe3b442f5b5d5cf1a7 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 24 Jun 2024 12:12:48 +0900 Subject: [PATCH 029/113] Continue work on specs --- .../function-[function]/settings/updateRuntime.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte index 6ec9f1def..c5f756b9a 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte @@ -29,13 +29,13 @@ cpus ??= $func.cpus; let runtimes = await $runtimesList; - let specs = await $specs; + let allowedSpecs = await $specs; options = runtimes.runtimes.map((runtime) => ({ label: `${runtime.name} - ${runtime.version}`, value: runtime.$id - })); + })); - memoryOptions = specs.memory.map((memory) => + memoryOptions = allowedSpecs.memory.map((memory) => memory > 1024 ? { label: `${memory / 1024} GB`, @@ -47,7 +47,7 @@ } ); - cpuOptions = specs.cpus.map((cpu) => ({ + cpuOptions = allowedSpecs.cpus.map((cpu) => ({ label: cpu === 1 ? `${cpu} CPU Cores` : `${cpu} CPU Core`, value: cpu })); From 3fddb400178deb192778a912bd3c1dbf6e11dc44 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 14:48:12 +0200 Subject: [PATCH 030/113] feat: small design fixes --- src/lib/components/filters/content.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index d4de55a86..6bd854c4c 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -144,9 +144,9 @@ {/if} {/if} - From e74876018d1c432ac62473dd1ff4c6f64d815808 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 15:24:23 +0200 Subject: [PATCH 031/113] fix: droplist element not being full witdh --- src/lib/components/dropList.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/dropList.svelte b/src/lib/components/dropList.svelte index 0c802cffd..effecd4a6 100644 --- a/src/lib/components/dropList.svelte +++ b/src/lib/components/dropList.svelte @@ -36,10 +36,10 @@ }`}> {#if $$slots.list}
    + class="drop-section" + style={noMaxWidthList ? 'max-inline-size: 100%' : ''}>
    From b5648d6c72c4cefe5ee38581c2d2ec9c77c3633c Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 16:05:45 +0200 Subject: [PATCH 032/113] feat: add elements to array --- package.json | 2 +- src/lib/components/filters/store.ts | 2 +- .../executions/+page.svelte | 69 +++++++++++++++++-- .../executions/table.svelte | 4 ++ 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 42ec216dd..c49a3eae4 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "^0.6.2", + "@appwrite.io/console": "npm:khushboo-console@0.0.3", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index 1f7777aba..ce4895420 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -96,7 +96,7 @@ export function addFilter( ) { const operator = operatorKey ? operators[operatorKey] : null; const column = columns.find((c) => c.id === columnId) as Column; - + console.log(column, operator); if (!column || !operator) return; if (column.array) { queries.addFilter({ column, operator, value: arrayValues }); diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 0d04ac273..4f341efb2 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -24,12 +24,69 @@ const columns = writable([ { id: '$id', title: 'Execution ID', type: 'string', show: true, width: 150 }, - { id: 'status', title: 'Status', type: 'string', show: true, width: 110 }, - { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 140 }, - { id: 'trigger', title: 'Trigger', type: 'string', show: true, filter: false, width: 90 }, - { id: 'requestMethod', title: 'Method', type: 'string', show: true, width: 70 }, - { id: 'requestPath', title: 'Path', type: 'string', show: true, width: 90 }, - { id: 'duration', title: 'Duration', type: 'string', show: true, width: 80 } + { + id: 'status', + title: 'Status', + type: 'string', + show: true, + width: 110, + array: true, + format: 'enum', + elements: ['completed', 'scheduled', 'waiting', 'processing', 'cancelled', 'failed'] + }, + { + id: '$createdAt', + title: 'Created', + type: 'datetime', + show: true, + width: 140, + format: 'datetime' + }, + { + id: 'trigger', + title: 'Trigger', + type: 'string', + show: true, + width: 90, + array: true, + format: 'enum', + elements: ['http', 'scheduled', 'event'] + }, + { + id: 'requestMethod', + title: 'Method', + type: 'string', + show: true, + width: 70, + array: true, + format: 'enum', + elements: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'] + }, + { + id: 'responseStatusCode', + title: 'Status code', + type: 'string', + show: true, + width: 100, + array: true, + format: 'integer' + }, + { + id: 'requestPath', + title: 'Path', + type: 'string', + show: true, + width: 90, + format: 'string' + }, + { + id: 'duration', + title: 'Duration', + type: 'string', + show: true, + width: 80, + format: 'integer' + } ]); onMount(() => { diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte index 37c21d3c8..89cead33b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte @@ -87,6 +87,10 @@ {execution.requestMethod} + {:else if column.id === 'responseStatusCode'} + + {execution.responseStatusCode} + {:else if column.id === 'requestPath'} {execution.requestPath} From de2968b9e33d3ffee22244b4fb470a809f72928b Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 16:06:17 +0200 Subject: [PATCH 033/113] feat: update campaign name --- src/lib/stores/campaigns.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts index 4beca1954..786f31e07 100644 --- a/src/lib/stores/campaigns.ts +++ b/src/lib/stores/campaigns.ts @@ -47,7 +47,7 @@ campaigns description: 'Get $VALUE in Cloud credits when you upgrade or create an organization with a Pro plan.' }) - .set('Startups', { + .set('StartupsProgram', { template: 'review', title: 'Welcome to the Appwrite Startups program.', description: From 8ad01b38dcbc10ead7f37396619ad772151d0a76 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 16:59:57 +0200 Subject: [PATCH 034/113] fix: operators is now a store not a const --- src/lib/components/filters/store.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index ce4895420..01de6d7f0 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -94,9 +94,8 @@ export function addFilter( value: any, // We cast to any to not cause type errors in the input components arrayValues: string[] = [] ) { - const operator = operatorKey ? operators[operatorKey] : null; + const operator = operatorKey ? get(operators)[operatorKey] : null; const column = columns.find((c) => c.id === columnId) as Column; - console.log(column, operator); if (!column || !operator) return; if (column.array) { queries.addFilter({ column, operator, value: arrayValues }); From 963217220296db917a7cf2035486adbefabdf27a Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 18:07:21 +0200 Subject: [PATCH 035/113] feat: refactor operators --- src/lib/components/filters/store.ts | 317 ++++++++++++++++++++++------ 1 file changed, 250 insertions(+), 67 deletions(-) diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index 01de6d7f0..944d702f6 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -104,74 +104,212 @@ export function addFilter( } } -export const operators: Writable> = writable({ - 'starts with': { - toQuery: Query.startsWith, - toTag: (attribute, input) => `**${attribute}** starts with **${input}**`, - types: ['string'] - }, - 'ends with': { - toQuery: Query.endsWith, - toTag: (attribute, input) => `**${attribute}** ends with **${input}**`, - types: ['string'] - }, - 'greater than': { - toQuery: (attr, input) => Query.greaterThan(attr, Number(input)), - toTag: (attribute, input) => `**${attribute}** greater than **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - 'greater than or equal': { - toQuery: (attr, input) => Query.greaterThanEqual(attr, Number(input)), - toTag: (attribute, input) => `**${attribute}** greater than or equal to **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - 'less than': { - toQuery: Query.lessThan, - toTag: (attribute, input) => `**${attribute}** less than **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - 'less than or equal': { - toQuery: Query.lessThanEqual, - toTag: (attribute, input) => `**${attribute}** less than or equal to **${input}**`, - types: ['integer', 'double', 'datetime'] - }, - equal: { - toQuery: Query.equal, - toTag: (attribute, input) => `**${attribute}** equal to **${input}**`, - types: ['string', 'integer', 'double', 'boolean'] - }, - 'not equal': { - toQuery: Query.notEqual, - toTag: (attribute, input) => `**${attribute}** not equal to **${input}**`, - types: ['string', 'integer', 'double', 'boolean'] - }, - 'is not null': { - toQuery: Query.isNotNull, - toTag: (attribute) => `**${attribute}** is not null`, - types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], - hideInput: true - }, - 'is null': { - toQuery: Query.isNull, - toTag: (attribute) => `**${attribute}** is null`, - types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], - hideInput: true - }, - contains: { - toQuery: Query.contains, - toTag: (attribute, input) => { - if (Array.isArray(input) && input.length > 2) { - return { - value: input, - tag: `**${attribute}** contains **${formatArray(input)}** ` - }; - } else { - return `**${attribute}** contains **${input}**`; - } - }, - types: ['string', 'integer', 'double', 'boolean', 'datetime', 'enum'] +// const defaultOperators: Record = { +// 'starts with': { +// toQuery: Query.startsWith, +// toTag: (attribute, input) => `**${attribute}** starts with **${input}**`, +// types: ['string'] +// }, +// 'ends with': { +// toQuery: Query.endsWith, +// toTag: (attribute, input) => `**${attribute}** ends with **${input}**`, +// types: ['string'] +// }, +// 'greater than': { +// toQuery: (attr, input) => Query.greaterThan(attr, Number(input)), +// toTag: (attribute, input) => `**${attribute}** greater than **${input}**`, +// types: ['integer', 'double', 'datetime'] +// }, +// 'greater than or equal': { +// toQuery: (attr, input) => Query.greaterThanEqual(attr, Number(input)), +// toTag: (attribute, input) => `**${attribute}** greater than or equal to **${input}**`, +// types: ['integer', 'double', 'datetime'] +// }, +// 'less than': { +// toQuery: Query.lessThan, +// toTag: (attribute, input) => `**${attribute}** less than **${input}**`, +// types: ['integer', 'double', 'datetime'] +// }, +// 'less than or equal': { +// toQuery: Query.lessThanEqual, +// toTag: (attribute, input) => `**${attribute}** less than or equal to **${input}**`, +// types: ['integer', 'double', 'datetime'] +// }, +// equal: { +// toQuery: Query.equal, +// toTag: (attribute, input) => `**${attribute}** equal to **${input}**`, +// types: ['string', 'integer', 'double', 'boolean'] +// }, +// 'not equal': { +// toQuery: Query.notEqual, +// toTag: (attribute, input) => `**${attribute}** not equal to **${input}**`, +// types: ['string', 'integer', 'double', 'boolean'] +// }, +// 'is not null': { +// toQuery: Query.isNotNull, +// toTag: (attribute) => `**${attribute}** is not null`, +// types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], +// hideInput: true +// }, +// 'is null': { +// toQuery: Query.isNull, +// toTag: (attribute) => `**${attribute}** is null`, +// types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], +// hideInput: true +// }, +// contains: { +// toQuery: Query.contains, +// toTag: (attribute, input) => { +// if (Array.isArray(input) && input.length > 2) { +// return { +// value: input, +// tag: `**${attribute}** contains **${formatArray(input)}** ` +// }; +// } else { +// return `**${attribute}** contains **${input}**`; +// } +// }, +// types: ['string', 'integer', 'double', 'boolean', 'datetime', 'enum'] +// } +// }; + +enum ValidOperators { + startsWith = 'starts with', + endsWith = 'ends with', + greaterThan = 'greater than', + greaterThanOrEqual = 'greater than or equal', + lessThan = 'less than', + lessThanOrEqual = 'less than or equal', + equal = 'equal', + notEqual = 'not equal', + isNotNull = 'is not null', + isNull = 'is null', + contains = 'contains' +} + +enum ValidTypes { + string = 'string', + integer = 'integer', + double = 'double', + boolean = 'boolean', + datetime = 'datetime', + relationship = 'relationship', + enum = 'enum' +} + +const operatorsMap = new Map< + ValidOperators, + { + name: ValidOperators; + query: (attr: string, input: string | number | string[]) => string; + types: ColumnType[]; + hideInput?: boolean; } -}); +>([ + [ + ValidOperators.startsWith, + { name: ValidOperators.startsWith, query: Query.startsWith, types: [ValidTypes.string] } + ], + [ + ValidOperators.endsWith, + { name: ValidOperators.endsWith, query: Query.endsWith, types: [ValidTypes.string] } + ], + [ + ValidOperators.greaterThan, + { + name: ValidOperators.greaterThan, + query: Query.greaterThan, + types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + } + ], + [ + ValidOperators.greaterThanOrEqual, + { + name: ValidOperators.greaterThanOrEqual, + query: Query.greaterThanEqual, + types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + } + ], + [ + ValidOperators.lessThan, + { + name: ValidOperators.lessThan, + query: Query.lessThan, + types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + } + ], + [ + ValidOperators.lessThanOrEqual, + { + name: ValidOperators.lessThanOrEqual, + query: Query.lessThanEqual, + types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + } + ], + [ + ValidOperators.equal, + { + name: ValidOperators.equal, + query: Query.equal, + types: [ValidTypes.string, ValidTypes.integer, ValidTypes.double, ValidTypes.boolean] + } + ], + [ + ValidOperators.notEqual, + { + name: ValidOperators.notEqual, + query: Query.notEqual, + types: [ValidTypes.string, ValidTypes.integer, ValidTypes.double, ValidTypes.boolean] + } + ], + [ + ValidOperators.isNotNull, + { + name: ValidOperators.isNotNull, + query: Query.isNotNull, + types: [ + ValidTypes.string, + ValidTypes.integer, + ValidTypes.double, + ValidTypes.boolean, + ValidTypes.datetime, + ValidTypes.relationship + ], + hideInput: true + } + ], + [ + ValidOperators.isNull, + { + name: ValidOperators.isNull, + query: Query.isNull, + types: [ + ValidTypes.string, + ValidTypes.integer, + ValidTypes.double, + ValidTypes.boolean, + ValidTypes.datetime, + ValidTypes.relationship + ], + hideInput: true + } + ], + [ + ValidOperators.contains, + { + name: ValidOperators.contains, + query: Query.contains, + types: [ + ValidTypes.string, + ValidTypes.integer, + ValidTypes.double, + ValidTypes.boolean, + ValidTypes.datetime, + ValidTypes.enum + ] + } + ] +]); function formatArray(array: string[]) { if (!array?.length) return; @@ -181,3 +319,48 @@ function formatArray(array: string[]) { return array.join(' or '); } } + +function createOperatorStore() { + const generateDefaultOperators = () => { + const operators: Record = {}; + operatorsMap.forEach((value, key) => { + operators[key] = { + toQuery: value.query, + toTag: (attribute, input = null) => { + if (input === null) { + return `**${attribute}** ${value.name}`; + } else if (Array.isArray(input) && input.length > 2) { + return { + value: input, + tag: `**${attribute}** ${value.name} **${formatArray(input)}** ` + }; + } else { + return `**${attribute}** ${value.name} **${input}**`; + } + }, + types: value.types, + hideInput: value.hideInput + }; + }); + return operators; + }; + + const { subscribe, set, update } = writable>({ + ...generateDefaultOperators() + }); + + return { + subscribe, + set, + update, + setOperatorType: (operator: ValidOperators, type: ColumnType[]) => { + if (!operatorsMap.has(operator)) return; + update((operators) => { + operators[operator].types = type; + return operators; + }); + } + }; +} + +export const operators = createOperatorStore(); From 7c0bdac7f5035e140ae23c1f1ae913fbde8c9b69 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 25 Jun 2024 16:38:01 +0200 Subject: [PATCH 036/113] refactor: operators store --- src/lib/components/filters/store.ts | 259 ++++++------------ .../executions/+page.svelte | 4 +- 2 files changed, 92 insertions(+), 171 deletions(-) diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index 944d702f6..bf15ba091 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -1,6 +1,6 @@ import { goto } from '$app/navigation'; -import { derived, get, writable, type Writable } from 'svelte/store'; +import { derived, get, writable } from 'svelte/store'; import { page } from '$app/stores'; import deepEqual from 'deep-equal'; import type { Column, ColumnType } from '$lib/helpers/types'; @@ -104,208 +104,123 @@ export function addFilter( } } -// const defaultOperators: Record = { -// 'starts with': { -// toQuery: Query.startsWith, -// toTag: (attribute, input) => `**${attribute}** starts with **${input}**`, -// types: ['string'] -// }, -// 'ends with': { -// toQuery: Query.endsWith, -// toTag: (attribute, input) => `**${attribute}** ends with **${input}**`, -// types: ['string'] -// }, -// 'greater than': { -// toQuery: (attr, input) => Query.greaterThan(attr, Number(input)), -// toTag: (attribute, input) => `**${attribute}** greater than **${input}**`, -// types: ['integer', 'double', 'datetime'] -// }, -// 'greater than or equal': { -// toQuery: (attr, input) => Query.greaterThanEqual(attr, Number(input)), -// toTag: (attribute, input) => `**${attribute}** greater than or equal to **${input}**`, -// types: ['integer', 'double', 'datetime'] -// }, -// 'less than': { -// toQuery: Query.lessThan, -// toTag: (attribute, input) => `**${attribute}** less than **${input}**`, -// types: ['integer', 'double', 'datetime'] -// }, -// 'less than or equal': { -// toQuery: Query.lessThanEqual, -// toTag: (attribute, input) => `**${attribute}** less than or equal to **${input}**`, -// types: ['integer', 'double', 'datetime'] -// }, -// equal: { -// toQuery: Query.equal, -// toTag: (attribute, input) => `**${attribute}** equal to **${input}**`, -// types: ['string', 'integer', 'double', 'boolean'] -// }, -// 'not equal': { -// toQuery: Query.notEqual, -// toTag: (attribute, input) => `**${attribute}** not equal to **${input}**`, -// types: ['string', 'integer', 'double', 'boolean'] -// }, -// 'is not null': { -// toQuery: Query.isNotNull, -// toTag: (attribute) => `**${attribute}** is not null`, -// types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], -// hideInput: true -// }, -// 'is null': { -// toQuery: Query.isNull, -// toTag: (attribute) => `**${attribute}** is null`, -// types: ['string', 'integer', 'double', 'boolean', 'datetime', 'relationship'], -// hideInput: true -// }, -// contains: { -// toQuery: Query.contains, -// toTag: (attribute, input) => { -// if (Array.isArray(input) && input.length > 2) { -// return { -// value: input, -// tag: `**${attribute}** contains **${formatArray(input)}** ` -// }; -// } else { -// return `**${attribute}** contains **${input}**`; -// } -// }, -// types: ['string', 'integer', 'double', 'boolean', 'datetime', 'enum'] -// } -// }; - -enum ValidOperators { - startsWith = 'starts with', - endsWith = 'ends with', - greaterThan = 'greater than', - greaterThanOrEqual = 'greater than or equal', - lessThan = 'less than', - lessThanOrEqual = 'less than or equal', - equal = 'equal', - notEqual = 'not equal', - isNotNull = 'is not null', - isNull = 'is null', - contains = 'contains' +export enum ValidOperators { + StartsWith = 'starts with', + EndsWith = 'ends with', + GreaterThan = 'greater than', + GreaterThanOrEqual = 'greater than or equal', + LessThan = 'less than', + LessThanOrEqual = 'less than or equal', + Equal = 'equal', + NotEqual = 'not equal', + IsNotNull = 'is not null', + IsNull = 'is null', + Contains = 'contains' } -enum ValidTypes { - string = 'string', - integer = 'integer', - double = 'double', - boolean = 'boolean', - datetime = 'datetime', - relationship = 'relationship', - enum = 'enum' +export enum ValidTypes { + String = 'string', + Integer = 'integer', + Double = 'double', + Boolean = 'boolean', + Datetime = 'datetime', + Relationship = 'relationship', + Enum = 'enum' } -const operatorsMap = new Map< +const operatorsDefault = new Map< ValidOperators, { - name: ValidOperators; query: (attr: string, input: string | number | string[]) => string; types: ColumnType[]; hideInput?: boolean; } >([ + [ValidOperators.StartsWith, { query: Query.startsWith, types: [ValidTypes.String] }], + [ValidOperators.EndsWith, { query: Query.endsWith, types: [ValidTypes.String] }], [ - ValidOperators.startsWith, - { name: ValidOperators.startsWith, query: Query.startsWith, types: [ValidTypes.string] } - ], - [ - ValidOperators.endsWith, - { name: ValidOperators.endsWith, query: Query.endsWith, types: [ValidTypes.string] } - ], - [ - ValidOperators.greaterThan, + ValidOperators.GreaterThan, { - name: ValidOperators.greaterThan, query: Query.greaterThan, - types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + types: [ValidTypes.Integer, ValidTypes.Double, ValidTypes.Datetime] } ], [ - ValidOperators.greaterThanOrEqual, + ValidOperators.GreaterThanOrEqual, { - name: ValidOperators.greaterThanOrEqual, query: Query.greaterThanEqual, - types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + types: [ValidTypes.Integer, ValidTypes.Double, ValidTypes.Datetime] } ], [ - ValidOperators.lessThan, + ValidOperators.LessThan, { - name: ValidOperators.lessThan, query: Query.lessThan, - types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + types: [ValidTypes.Integer, ValidTypes.Double, ValidTypes.Datetime] } ], [ - ValidOperators.lessThanOrEqual, + ValidOperators.LessThanOrEqual, { - name: ValidOperators.lessThanOrEqual, query: Query.lessThanEqual, - types: [ValidTypes.integer, ValidTypes.double, ValidTypes.datetime] + types: [ValidTypes.Integer, ValidTypes.Double, ValidTypes.Datetime] } ], [ - ValidOperators.equal, + ValidOperators.Equal, { - name: ValidOperators.equal, query: Query.equal, - types: [ValidTypes.string, ValidTypes.integer, ValidTypes.double, ValidTypes.boolean] + types: [ValidTypes.String, ValidTypes.Integer, ValidTypes.Double, ValidTypes.Boolean] } ], [ - ValidOperators.notEqual, + ValidOperators.NotEqual, { - name: ValidOperators.notEqual, query: Query.notEqual, - types: [ValidTypes.string, ValidTypes.integer, ValidTypes.double, ValidTypes.boolean] + types: [ValidTypes.String, ValidTypes.Integer, ValidTypes.Double, ValidTypes.Boolean] } ], [ - ValidOperators.isNotNull, + ValidOperators.IsNotNull, { - name: ValidOperators.isNotNull, query: Query.isNotNull, types: [ - ValidTypes.string, - ValidTypes.integer, - ValidTypes.double, - ValidTypes.boolean, - ValidTypes.datetime, - ValidTypes.relationship + ValidTypes.String, + ValidTypes.Integer, + ValidTypes.Double, + ValidTypes.Boolean, + ValidTypes.Datetime, + ValidTypes.Relationship ], hideInput: true } ], [ - ValidOperators.isNull, + ValidOperators.IsNull, { - name: ValidOperators.isNull, query: Query.isNull, types: [ - ValidTypes.string, - ValidTypes.integer, - ValidTypes.double, - ValidTypes.boolean, - ValidTypes.datetime, - ValidTypes.relationship + ValidTypes.String, + ValidTypes.Integer, + ValidTypes.Double, + ValidTypes.Boolean, + ValidTypes.Datetime, + ValidTypes.Relationship ], hideInput: true } ], [ - ValidOperators.contains, + ValidOperators.Contains, { - name: ValidOperators.contains, query: Query.contains, types: [ - ValidTypes.string, - ValidTypes.integer, - ValidTypes.double, - ValidTypes.boolean, - ValidTypes.datetime, - ValidTypes.enum + ValidTypes.String, + ValidTypes.Integer, + ValidTypes.Double, + ValidTypes.Boolean, + ValidTypes.Datetime, + ValidTypes.Enum ] } ] @@ -320,31 +235,31 @@ function formatArray(array: string[]) { } } -function createOperatorStore() { - const generateDefaultOperators = () => { - const operators: Record = {}; - operatorsMap.forEach((value, key) => { - operators[key] = { - toQuery: value.query, - toTag: (attribute, input = null) => { - if (input === null) { - return `**${attribute}** ${value.name}`; - } else if (Array.isArray(input) && input.length > 2) { - return { - value: input, - tag: `**${attribute}** ${value.name} **${formatArray(input)}** ` - }; - } else { - return `**${attribute}** ${value.name} **${input}**`; - } - }, - types: value.types, - hideInput: value.hideInput - }; - }); - return operators; - }; +function generateDefaultOperators() { + const operators: Record = {}; + operatorsDefault.forEach((operator, operatorName) => { + operators[operatorName] = { + toQuery: operator.query, + toTag: (attribute, input = null) => { + if (input === null) { + return `**${attribute}** ${operatorName}`; + } else if (Array.isArray(input) && input.length > 2) { + return { + value: input, + tag: `**${attribute}** ${operatorName} **${formatArray(input)}** ` + }; + } else { + return `**${attribute}** ${operatorName} **${input}**`; + } + }, + types: operator.types, + hideInput: operator.hideInput + }; + }); + return operators; +} +function createOperatorStore() { const { subscribe, set, update } = writable>({ ...generateDefaultOperators() }); @@ -353,10 +268,16 @@ function createOperatorStore() { subscribe, set, update, - setOperatorType: (operator: ValidOperators, type: ColumnType[]) => { - if (!operatorsMap.has(operator)) return; + reset: () => { + update(() => { + return { ...generateDefaultOperators() }; + }); + }, + setActiveOperators: (activeOperators: ValidOperators[]) => { update((operators) => { - operators[operator].types = type; + operatorsDefault.forEach((value, key) => { + operators[key].types = activeOperators.includes(key) ? value.types : []; + }); return operators; }); } diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 4f341efb2..2b0794b8c 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -22,6 +22,8 @@ export let data; + const logs = getServiceLimit('logs'); + const columns = writable([ { id: '$id', title: 'Execution ID', type: 'string', show: true, width: 150 }, { @@ -96,8 +98,6 @@ } }); }); - - const logs = getServiceLimit('logs'); From afce6892910ec9edea039b40bfd88a231a66ef6e Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 25 Jun 2024 16:39:10 +0200 Subject: [PATCH 037/113] refactor: operators doesn't need to be a store --- src/lib/components/filters/content.svelte | 4 ++-- src/lib/components/filters/store.ts | 29 ++--------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index e29c7698b..6bd854c4c 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -24,14 +24,14 @@ $: column = $columns.find((c) => c.id === columnId) as Column; - $: operatorsForColumn = Object.entries($operators) + $: operatorsForColumn = Object.entries(operators) .filter(([, v]) => v.types.includes(column?.type)) .map(([k]) => ({ label: k, value: k })); - $: operator = operatorKey ? $operators[operatorKey] : null; + $: operator = operatorKey ? operators[operatorKey] : null; $: { columnId; operatorKey = null; diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index bf15ba091..af66910f1 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -94,7 +94,7 @@ export function addFilter( value: any, // We cast to any to not cause type errors in the input components arrayValues: string[] = [] ) { - const operator = operatorKey ? get(operators)[operatorKey] : null; + const operator = operatorKey ? operators[operatorKey] : null; const column = columns.find((c) => c.id === columnId) as Column; if (!column || !operator) return; if (column.array) { @@ -259,29 +259,4 @@ function generateDefaultOperators() { return operators; } -function createOperatorStore() { - const { subscribe, set, update } = writable>({ - ...generateDefaultOperators() - }); - - return { - subscribe, - set, - update, - reset: () => { - update(() => { - return { ...generateDefaultOperators() }; - }); - }, - setActiveOperators: (activeOperators: ValidOperators[]) => { - update((operators) => { - operatorsDefault.forEach((value, key) => { - operators[key].types = activeOperators.includes(key) ? value.types : []; - }); - return operators; - }); - } - }; -} - -export const operators = createOperatorStore(); +export const operators = generateDefaultOperators(); From 049f3a358788a4ff6d663b3e7bde758320f7c748 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 25 Jun 2024 16:52:34 +0200 Subject: [PATCH 038/113] feat: add datetime filter --- src/lib/components/filters/content.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index 6bd854c4c..b954e1514 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -6,7 +6,8 @@ InputText, InputTags, FormList, - InputSelectCheckbox + InputSelectCheckbox, + InputDateTime } from '$lib/elements/forms'; import { createEventDispatcher, onMount } from 'svelte'; import { tags, queries, type TagValue, operators, addFilter } from './store'; @@ -138,6 +139,8 @@ { label: 'False', value: false } ].filter(Boolean)} bind:value /> + {:else if column.type === 'datetime'} + {:else} {/if} From 45cb5971cfe4dfe6213700f8a29ee51c268b78a6 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 25 Jun 2024 16:52:51 +0200 Subject: [PATCH 039/113] fix: use colum title in the tag, not id --- src/lib/components/filters/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index af66910f1..eb20d01e2 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -39,7 +39,7 @@ function initQueries(initialValue = new Map()) { function addFilter({ column, operator, value }: AddFilterArgs) { queries.update((map) => { - map.set(operator.toTag(column.id, value), operator.toQuery(column.id, value)); + map.set(operator.toTag(column.title, value), operator.toQuery(column.id, value)); return map; }); } From ca30a2ddeee7c77940e85a17b7a90e8487248c25 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 26 Jun 2024 16:33:39 +0200 Subject: [PATCH 040/113] feat: create tagList component, fix logic for enums and arrays --- src/lib/components/filters/content.svelte | 48 ++--------------- src/lib/components/filters/filters.svelte | 6 ++- src/lib/components/filters/index.ts | 1 + src/lib/components/filters/store.ts | 16 +++++- src/lib/components/filters/tagList.svelte | 51 +++++++++++++++++++ .../executions/+page.svelte | 5 +- 6 files changed, 76 insertions(+), 51 deletions(-) create mode 100644 src/lib/components/filters/tagList.svelte diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index b954e1514..6bba3b686 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -10,10 +10,10 @@ InputDateTime } from '$lib/elements/forms'; import { createEventDispatcher, onMount } from 'svelte'; - import { tags, queries, type TagValue, operators, addFilter } from './store'; + import { tags, operators, addFilter } from './store'; import type { Column } from '$lib/helpers/types'; import type { Writable } from 'svelte/store'; - import { tooltip } from '$lib/actions/tooltip'; + import { TagList } from '.'; // We cast to any to not cause type errors in the input components /* eslint @typescript-eslint/no-explicit-any: 'off' */ @@ -52,21 +52,6 @@ arrayValues = []; } - function tagFormat(node: HTMLElement) { - node.innerHTML = node.innerHTML.replace(/\*\*(.*?)\*\*/g, '$1'); - } - - function isTypeTagValue(obj: any): obj is TagValue { - if (typeof obj === 'string') return false; - return ( - obj && - typeof obj.tag === 'string' && - (typeof obj.value === 'string' || - typeof obj.value === 'number' || - Array.isArray(obj.value)) - ); - } - const dispatch = createEventDispatcher<{ clear: void; apply: { applied: number }; @@ -154,34 +139,7 @@
      - {#each $tags as tag (tag)} - {#if isTypeTagValue(tag)} - - {:else} - - {/if} - {/each} +
    diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 45e121eb7..f56584fe0 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -39,7 +39,7 @@ } function apply() { - if (selectedColumn && operatorKey && value) { + if (selectedColumn && operatorKey && (value || arrayValues.length)) { addFilter($columns, selectedColumn, operatorKey, value, arrayValues); selectedColumn = null; value = null; @@ -53,7 +53,9 @@ selectedColumn = null; } - $: isButtonDisabled = $queriesAreDirty ? false : !selectedColumn || !operatorKey || !value; + $: isButtonDisabled = $queriesAreDirty + ? false + : !selectedColumn || !operatorKey || (!value && !arrayValues.length);
    diff --git a/src/lib/components/filters/index.ts b/src/lib/components/filters/index.ts index 223e43ebf..7d3b7f3d2 100644 --- a/src/lib/components/filters/index.ts +++ b/src/lib/components/filters/index.ts @@ -1,2 +1,3 @@ export { default as Filters } from './filters.svelte'; +export { default as TagList } from './tagList.svelte'; export { hasPageQueries, queryParamToMap, queries } from '$lib/components/filters/store'; diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index eb20d01e2..a3a94bd31 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -170,14 +170,26 @@ const operatorsDefault = new Map< ValidOperators.Equal, { query: Query.equal, - types: [ValidTypes.String, ValidTypes.Integer, ValidTypes.Double, ValidTypes.Boolean] + types: [ + ValidTypes.String, + ValidTypes.Integer, + ValidTypes.Double, + ValidTypes.Boolean, + ValidTypes.Enum + ] } ], [ ValidOperators.NotEqual, { query: Query.notEqual, - types: [ValidTypes.String, ValidTypes.Integer, ValidTypes.Double, ValidTypes.Boolean] + types: [ + ValidTypes.String, + ValidTypes.Integer, + ValidTypes.Double, + ValidTypes.Boolean, + ValidTypes.Enum + ] } ], [ diff --git a/src/lib/components/filters/tagList.svelte b/src/lib/components/filters/tagList.svelte new file mode 100644 index 000000000..6b69efa4c --- /dev/null +++ b/src/lib/components/filters/tagList.svelte @@ -0,0 +1,51 @@ + + +{#each $tags as tag (tag)} + {#if isTypeTagValue(tag)} + + {:else} + + {/if} +{/each} diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 2b0794b8c..963022919 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -14,7 +14,7 @@ import Create from '../create.svelte'; import { abbreviateNumber } from '$lib/helpers/numbers'; import { base } from '$app/paths'; - import { Filters } from '$lib/components/filters'; + import { Filters, TagList } from '$lib/components/filters'; import { writable } from 'svelte/store'; import type { Column } from '$lib/helpers/types'; import { View } from '$lib/helpers/load'; @@ -29,7 +29,7 @@ { id: 'status', title: 'Status', - type: 'string', + type: 'enum', show: true, width: 110, array: true, @@ -101,6 +101,7 @@ +

    The {tier} plan has limits

    From fd0ec10125a117aa9a86884742cf646dcd492793 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 26 Jun 2024 17:19:13 +0200 Subject: [PATCH 041/113] feat: design review fixes and some logic --- .../billing/estimatedTotalBox.svelte | 1 + src/lib/elements/forms/inputText.svelte | 2 +- src/lib/layout/unauthenticated.svelte | 28 +++++++++++-------- src/lib/stores/campaigns.ts | 3 ++ src/routes/console/apply-credit/+page.svelte | 25 ++++++++++------- 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/lib/components/billing/estimatedTotalBox.svelte b/src/lib/components/billing/estimatedTotalBox.svelte index 52ac4faba..c600dadad 100644 --- a/src/lib/components/billing/estimatedTotalBox.svelte +++ b/src/lib/components/billing/estimatedTotalBox.svelte @@ -35,6 +35,7 @@ class="card u-margin-block-start-32 u-flex u-flex-vertical u-gap-8" style:--p-card-padding="1.5rem" style:--p-card-border-radius="var(--border-radius-small)"> +

    {currentPlan.name} plan

    {formatCurrency(currentPlan.price)}

    diff --git a/src/lib/elements/forms/inputText.svelte b/src/lib/elements/forms/inputText.svelte index ac354e3f2..0da7f7b38 100644 --- a/src/lib/elements/forms/inputText.svelte +++ b/src/lib/elements/forms/inputText.svelte @@ -108,7 +108,7 @@
    - import { Avatar, Card, Heading } from '$lib/components'; + import { Avatar, AvatarInitials, Card, Heading } from '$lib/components'; import AppwriteLogoDark from '$lib/images/appwrite-logo-dark.svg'; import AppwriteLogoLight from '$lib/images/appwrite-logo-light.svg'; import LoginDark from '$lib/images/login/login-dark-mode.png'; @@ -112,13 +112,13 @@
    {:else if variation === 'review'}
    -
    -
    + class="u-flex u-flex-vertical u-main-center u-cross-center u-height-100-percent u-width-full-line auth-container"> +
    +
    {generateTitle()} @@ -135,16 +135,22 @@
    -
    + +

    {generateDesc()}

    +
    -

    +

    {currentReview.review}

    - + {#if currentReview?.img} + + {:else} + + {/if}

    {currentReview.name}

    {currentReview.desc}

    diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts index 786f31e07..7f4cf86e6 100644 --- a/src/lib/stores/campaigns.ts +++ b/src/lib/stores/campaigns.ts @@ -54,6 +54,9 @@ campaigns "We're excited to have you on board. Add your credit code to your Appwrite Pro account to join.", onlyNewOrgs: true, data: { + cta: 'Get everything out of Cloud with Pro', + claimed: 'Your credits will be valid for 12 months.', + unclaimed: 'Apply your code to join the Startups program.', reviews: [ { name: 'David Foster', diff --git a/src/routes/console/apply-credit/+page.svelte b/src/routes/console/apply-credit/+page.svelte index 6a30262da..e5cec5f21 100644 --- a/src/routes/console/apply-credit/+page.svelte +++ b/src/routes/console/apply-credit/+page.svelte @@ -254,15 +254,7 @@ - {#if campaign?.template === 'review'} -
    -

    - {campaign.description} -

    -
    - {:else if campaign?.template === 'card'} + {#if campaign?.template === 'card'}
    @@ -303,7 +295,20 @@ billingPlan={BillingPlan.PRO} {collaborators} bind:couponData - bind:billingBudget /> + bind:billingBudget> + {#if campaign?.template === 'review' && (campaign?.data?.cta || campaign?.data?.claimed || campaign?.data?.unclaimed)} +
    +

    {campaign?.data?.cta}

    +

    + {#if couponData?.code && couponData?.status === 'active' && campaign?.data?.claimed} + {campaign?.data?.claimed} + {:else if campaign?.data?.unclaimed} + {campaign?.data?.unclaimed} + {/if} +

    +
    + {/if} + {/if} From 678722faeac0f5964144af0cba1c525d0638365c Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 26 Jun 2024 17:29:40 +0200 Subject: [PATCH 042/113] feat: js mastery campaign --- src/lib/layout/unauthenticated.svelte | 2 +- src/lib/stores/campaigns.ts | 20 ++++++++++++++++++ .../reviewers/js_mastery_reviewer_1.png | Bin 0 -> 15591 bytes 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 static/images/campaigns/JSMastery/reviewers/js_mastery_reviewer_1.png diff --git a/src/lib/layout/unauthenticated.svelte b/src/lib/layout/unauthenticated.svelte index 7fa31fdc4..4a323cbd4 100644 --- a/src/lib/layout/unauthenticated.svelte +++ b/src/lib/layout/unauthenticated.svelte @@ -145,7 +145,7 @@
    {#if currentReview?.img} {:else} diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts index 7f4cf86e6..aa1b74e36 100644 --- a/src/lib/stores/campaigns.ts +++ b/src/lib/stores/campaigns.ts @@ -65,4 +65,24 @@ campaigns } ] } + }) + .set('JSMastery', { + template: 'review', + title: 'Claim your JavaScript Mastery $50 credits.', + description: + 'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan', + onlyNewOrgs: true, + data: { + cta: 'Get everything out of Cloud with Pro', + claimed: 'Your credits will be valid for 12 months.', + unclaimed: 'Apply your code to join the Startups program.', + reviews: [ + { + name: 'Marius Bloki', + desc: 'CTO // mySHOEFITTER', + img: 'js_mastery_reviewer_1.png', + review: 'Appwrite has been a tremendous asset in implementing our IT infrastructure. Not only is the software an absolute game-changer, but the team is always there when you need them.' + } + ] + } }); diff --git a/static/images/campaigns/JSMastery/reviewers/js_mastery_reviewer_1.png b/static/images/campaigns/JSMastery/reviewers/js_mastery_reviewer_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ce5189b590fdc423a75c3ef782ed0171f50153bf GIT binary patch literal 15591 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91$e;rN1ONa40RR91$N&HU0GnGql>h)dQAtEWRCodHo%xd-$Ccl+&OT;( zaFGN=kRU-)q)t-TN}@v6?n+*V!;07+tgwG@gv0-sf8TI~fA9|qudlVWwk&FQMeEv? zDC(djlAw41#4$77U8g_amsQ<80}KHyr!h4^B^o(dRaseCFTeHP%a<=RgF35S>GITt zp$n@l2+P{JqNMELtE{cO{w+>QQbER@oSe3;*uggI)4C+`o;pVDz(ae?C-EV$& z?Uf(xzW%FtzT=8KuBy~kQCWsX5m8(mI*%cMNC-IUfpuH}wXA1eX3m8{7*}CZ1j#In z=jnJpoJ^j0`pmPRaF1Vf!z~vMU68mMR^-ai&GPvmh~hXDwBS#`Cd-4e;yOT6(VPi% zAdtDb4C^ciayPx}U;3VGZB)A9jeQ6#`Jg!LS& zA>1yco>{c z@+~M_T?bWNmqitGHE{D__(vg_Xb<(q%|-TA9OJCV;e;cD3|OoxE5t_tuO z2z*ssb6c>KdBRiZQAMf;*6~18Q%m>_?TJd1)nOULbr_UM6~QUW-7?xZwOb9Y1j*>5 z&zSLd)h)_i@K5Af91O7@^1% zbx_nO+Ne`i?a~P{ud35>G`Sil+r!bLpZw(D#jm;1*`iF#V3?*ctV*Cr3zT-4&aMmN z+9gv?g>K-AD8KG5zqS28{&V@}@9OLCP2xIA1DEf*Y{vz$3r3Q!1Z1Chl?N90isva1 z*FCU|6vr+CSa~ka6Cr}i8i^Ls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@GA z-Iu@W-u&&fD2BV+v4kMHy7&FXOiC`!?A71*aWA;v9&OB69VPVP_)ws=F`+nF^DVk- z*4BO&6K^9V;BFPhvnZX8Pex}i#9#cHOE$`QM0?AtK^9R|drAq%ZgA$r*Z*bw)aTxF zno7tvM1lV2CF${@?1NlW zP*otUSZoIghOUhw#P|#b&N6l-W65|`vG0t0VTvlRs(cp2ug4qpGoL>5r~h1TGQj{n z978C8h*=#-O&^3)Ec0$0pS?JGF{D$t``ce^CBW{6n@ur+MWanAWm7gO>>B;9_c=$_y?9QB%X}t_(z`}8l@x!uYoJWclTavP2a$FZK+jj5&;mZH~FZCP0 z9$tNSBc?wHj>%$>4OprQOiIZ|Hu5}8a$wiom8GP#YzJudyi^R#c-Zly^MhAoK#`dl zoCc)fi1`uV8YbCXGNh}Q74>#e$CFdZqZdZs_;YvaVHl4K)0%cqWl+$#;8d$2#JFIw z5spF#%@~8ckqD-hr?pGU<*L8D%g<(AIg__l@>nm zoC-eXA+-dSRj!Y^PXRap+79r7n`qy@0u2Y=Q^UQmaZYi!8kfV#l`@>B8yB8`!M*s$ zZg^6II$`358z5p1Yr{*KcwXm4T@3F)3McI2^=v93tQXsZww(4*(_W8<`t00?leY z`0}Cd7g2^24I6ZG5yVLQ66@Nz?p}Ls_Ug~BzW&Q7+X?fGuELFJmfutW$+_>IzWB;d=3zKy73{tXt1{|}F^PM4fkVTJ$z002ovPDHLkV1mBh B$ejQH literal 0 HcmV?d00001 From d4dbcf73a1ce55e965344e63a136c33155bbcfac Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 26 Jun 2024 17:30:07 +0200 Subject: [PATCH 043/113] feat: reviewer image route --- src/lib/layout/unauthenticated.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/unauthenticated.svelte b/src/lib/layout/unauthenticated.svelte index 7fa31fdc4..4a323cbd4 100644 --- a/src/lib/layout/unauthenticated.svelte +++ b/src/lib/layout/unauthenticated.svelte @@ -145,7 +145,7 @@
    {#if currentReview?.img} {:else} From e9e10a36b1c2055601008f5e0dfb8e2303f115b1 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 26 Jun 2024 17:32:59 +0200 Subject: [PATCH 044/113] fix: remove credits value on hover --- src/lib/components/billing/creditsApplied.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/components/billing/creditsApplied.svelte b/src/lib/components/billing/creditsApplied.svelte index 6cf231e57..1010f0f5e 100644 --- a/src/lib/components/billing/creditsApplied.svelte +++ b/src/lib/components/billing/creditsApplied.svelte @@ -42,9 +42,7 @@ {/if}
    {#if couponData.credits >= 100} -

    - Credits applied -

    +

    Credits applied

    {:else} -{formatCurrency(couponData.credits)} {/if} From 100066c6abee4e629da3b5fdf8044ccfae7d5e8d Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 27 Jun 2024 10:47:37 +0200 Subject: [PATCH 045/113] fix: estimation box alignment and margin --- .../billing/estimatedTotalBox.svelte | 2 +- src/lib/layout/wizardSecondaryContent.svelte | 4 +- src/lib/stores/campaigns.ts | 2 +- src/routes/console/apply-credit/+page.svelte | 40 ++++++++++--------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lib/components/billing/estimatedTotalBox.svelte b/src/lib/components/billing/estimatedTotalBox.svelte index c600dadad..3ff31041c 100644 --- a/src/lib/components/billing/estimatedTotalBox.svelte +++ b/src/lib/components/billing/estimatedTotalBox.svelte @@ -32,7 +32,7 @@
    diff --git a/src/lib/layout/wizardSecondaryContent.svelte b/src/lib/layout/wizardSecondaryContent.svelte index 6b69d488a..908995692 100644 --- a/src/lib/layout/wizardSecondaryContent.svelte +++ b/src/lib/layout/wizardSecondaryContent.svelte @@ -4,8 +4,6 @@
    -
    - -
    +
    diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts index 7f4cf86e6..cec429146 100644 --- a/src/lib/stores/campaigns.ts +++ b/src/lib/stores/campaigns.ts @@ -49,7 +49,7 @@ campaigns }) .set('StartupsProgram', { template: 'review', - title: 'Welcome to the Appwrite Startups program.', + title: 'Welcome to the Appwrite Startups program', description: "We're excited to have you on board. Add your credit code to your Appwrite Pro account to join.", onlyNewOrgs: true, diff --git a/src/routes/console/apply-credit/+page.svelte b/src/routes/console/apply-credit/+page.svelte index e5cec5f21..d1dd1ce47 100644 --- a/src/routes/console/apply-credit/+page.svelte +++ b/src/routes/console/apply-credit/+page.svelte @@ -290,25 +290,27 @@ {/if}
    {:else if selectedOrgId} - - {#if campaign?.template === 'review' && (campaign?.data?.cta || campaign?.data?.claimed || campaign?.data?.unclaimed)} -
    -

    {campaign?.data?.cta}

    -

    - {#if couponData?.code && couponData?.status === 'active' && campaign?.data?.claimed} - {campaign?.data?.claimed} - {:else if campaign?.data?.unclaimed} - {campaign?.data?.unclaimed} - {/if} -

    -
    - {/if} -
    +
    + + {#if campaign?.template === 'review' && (campaign?.data?.cta || campaign?.data?.claimed || campaign?.data?.unclaimed)} +
    +

    {campaign?.data?.cta}

    +

    + {#if couponData?.code && couponData?.status === 'active' && campaign?.data?.claimed} + {campaign?.data?.claimed} + {:else if campaign?.data?.unclaimed} + {campaign?.data?.unclaimed} + {/if} +

    +
    + {/if} +
    +
    {/if} From 0e72ef72531c0c1a519282c0d79a24199e960aca Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:28:16 +0100 Subject: [PATCH 046/113] feat: cancel & delete executions --- src/lib/actions/analytics.ts | 2 + .../executions/+page.svelte | 86 +++++++++++++++++-- .../executions/cancel.svelte | 47 ++++++++++ .../executions/delete.svelte | 47 ++++++++++ 4 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 src/routes/console/project-[project]/functions/function-[function]/executions/cancel.svelte create mode 100644 src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 744a4e351..446536878 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -233,6 +233,8 @@ export enum Submit { DeploymentDelete = 'submit_deployment_delete', DeploymentUpdate = 'submit_deployment_update', ExecutionCreate = 'submit_execution_create', + ExecutionDelete = 'submit_execution_delete', + ExecutionCancel = 'submit_execution_cancel', VariableCreate = 'submit_variable_create', VariableDelete = 'submit_variable_delete', VariableUpdate = 'submit_variable_update', diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index c9eae98f7..c669a7d9a 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -1,6 +1,15 @@ + + +

    Are you sure you want to cancel this execution?

    + + + + +
    diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte new file mode 100644 index 000000000..f9bde2f5f --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte @@ -0,0 +1,47 @@ + + + +

    Are you sure you want to delete this execution?

    + + + + +
    From 9a4bfe892a54e5cc5ad3ec850b23a56d2758895b Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:32:06 +0100 Subject: [PATCH 047/113] chore: unused imports --- .../functions/function-[function]/executions/+page.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index c669a7d9a..44dc48105 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -1,11 +1,9 @@ - - -

    Are you sure you want to cancel this execution?

    - - - - -
    diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte index f9bde2f5f..bf99d4745 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte @@ -14,7 +14,7 @@ async function handleSubmit() { try { // TODO: update SDK to use the new function - // await sdk.forProject.functions.deleteExecution(selectedExecution.$id); + /// await sdk.forProject.functions.deleteExecution(selectedExecution.$id); await invalidate(Dependencies.FUNCTION); showDelete = false; addNotification({ From b49b03de8083876690460929a58347b43c7b6093 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:27:40 +0100 Subject: [PATCH 050/113] chore: arman review --- .../function-[function]/executions/+page.svelte | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index b75f84d3a..e76b6f9bf 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -166,14 +166,15 @@ bind:show={showDropdown[index]} placement="bottom-start" noArrow> - + Date: Thu, 27 Jun 2024 14:36:23 +0200 Subject: [PATCH 051/113] feat: new layout --- src/lib/components/filters/content.svelte | 36 +++++++++++++---- src/lib/components/filters/filters.svelte | 39 +++++++++++++------ src/lib/components/filters/store.ts | 24 +++++++----- .../executions/+page.svelte | 34 ++++++++++++++-- 4 files changed, 100 insertions(+), 33 deletions(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index 6bba3b686..b43bddd85 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -22,6 +22,7 @@ export let columnId: string | null = null; export let arrayValues: string[] = []; export let operatorKey: string | null = null; + export let singleCondition = false; $: column = $columns.find((c) => c.id === columnId) as Column; @@ -42,6 +43,12 @@ onMount(() => { value = column?.array ? [] : null; + if (column?.type === 'datetime') { + const today = new Date(); + console.log(today.toISOString()); + value = today.toISOString(); + console.log(value); + } }); function addFilterAndReset() { @@ -57,6 +64,13 @@ apply: { applied: number }; }>(); dispatch('apply', { applied: $tags.length }); + + // $: if (column?.type === 'datetime' && !value) { + // const today = new Date(); + // console.log(today.toISOString()); + // value = today.toISOString(); + // console.log('value', value); + // }
    @@ -125,22 +139,28 @@ ].filter(Boolean)} bind:value /> {:else if column.type === 'datetime'} - + {#key value} + + {/key} {:else} {/if} {/if} {/if} - + {#if !singleCondition} + + {/if} -
      - -
    + {#if !singleCondition} +
      + +
    + {/if}
    diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts index 322e7cbfd..12d811432 100644 --- a/src/lib/stores/campaigns.ts +++ b/src/lib/stores/campaigns.ts @@ -6,6 +6,7 @@ export type CampaignData = { template: 'card' | 'review'; data?: Record; onlyNewOrgs?: boolean; + footer?: boolean; }; export const campaigns: Map = new Map(); @@ -86,4 +87,22 @@ campaigns } ] } + }) + .set('FusionVC', { + template: 'review', + title: 'Welcome to Appwrite!', + description: + 'Upgrade to Appwrite Pro and add the credits to enjoy the full capabilities of Cloud. Provided to you by Fusion VC.', + onlyNewOrgs: true, + footer: true, + data: { + reviews: [ + { + name: 'David Foster', + img: '1.jpeg', + desc: 'Managing director', + review: 'We really loved working with Appwrite for launching our bootstrapped "Open Mind" App. It was saving us a lot of money in comparison to Firebase since the amount of users grew quite fast and we needed a quick switch.' + } + ] + } }); diff --git a/static/images/campaigns/FusionVC/footer/dark.png b/static/images/campaigns/FusionVC/footer/dark.png new file mode 100644 index 0000000000000000000000000000000000000000..6fe0f03b05e841efebd2b9cb5a02593a667dc905 GIT binary patch literal 6832 zcmV;h8c*ekP)tQEL2tHK}7f9h~ZE>I{aZAN3#mP zRS?+_09>dc8kP135$)IA9a$a-1eS6fH&azvf*awyhU3`oUaxm8ns5=4S`;w_ASZ^93%))fLG)yCf-kD9@Yr zLjJpS#e|Um1^hmNXI`lg)~ozmf_fjv+kznc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1HSZAOeCqQMM$toCDC~Btw)E20++}V4*C1GZS(GqI-Z1F1;?#Q z#0 z%e{l8f}ug#wmp+Y)b9^01c$l|=UY)U+zDzke%FJ09SWhGTrVdktBuOCbUb`}-@pw2 zKJt4ZfN#Q5MlP5x5Z@2-S;H$Bo+xdrZVt#Yw>QNz;rN3rM-MZb4F{^K;Ve}PgVb$Q zP)%6UCc)J3r6lo(z!7{P{DCBgy#b;!^Sq(t(A^4l9?JF)pWE9z?M5R-I@0oHe1GIf z8^uP^k#K{+jj|MkLUBh1Tz5f4r?3>#%2MBhg3$dc?)}VQ5b1*x%UA`w6w1b#cs>Sa zB4>vdx7_KhN(*c!nMYA#6smF(?OBIleK<6@Px_ak!kdk(iu#j`80rdk0hEn18I9r( z6xu?dsxM^|n3K_bkLN1`0(nbybxjLorwK3-kU;(gt6-Nw**FsjU=B0`UJqGAe{U)p0=p0000I{L-{ literal 0 HcmV?d00001 diff --git a/static/images/campaigns/FusionVC/footer/light.png b/static/images/campaigns/FusionVC/footer/light.png new file mode 100644 index 0000000000000000000000000000000000000000..a21263326ddd0aa554999296e959d8c6618ad137 GIT binary patch literal 6824 zcmV;Z8dv3sP))giL1U&b{aT{<9=^hC7*=WI{r}`F&jO+;h)8 z_uO;-=f9qF!dMC^q>#cygTPK9Dk>_@@p`oxlEka)>gqmbDf~x4WTyzFr4`qzs!$_I z(wmIQ@0OL7eS)R%9|ehx9fZQd!YTRr`PQ7A99b0Q$B`Byplm@9KFY{Qcbt9p+0)b0 z)7{g_MF$-|8=W1bCV$O&xG=F&Thu_ z5mez7Tn^yai~O58SN;kS*i2bi3a1rDO-%XumG-Gqc^T*0bs(b83j)jG0M0!q{s?}) zqiNn-WZ71tY3d_L`y}pd9~kJn83eWrzwZLwOhfu4oHJ0Q3PN+>{FJKlH=CMj-eW18 z78o%x6&Dwq1;Mmf6vfrJTmqtzz*#!+`>g=C5ge*I(AL=4=nXwHbLLE|#gdiX+`OWL zv9+46tZYfL%wbGhDhT3LAjR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GW-0wYO@^Dd zI!bICE(bEsL8!5$-qyLp7i} z)D(@T!sNZ&hl?C4Z@-PN>#tG{ll!_IG`}3nCSlQ0O0THkzjHNK4-X8hkkB%yp6{1t T5EgF}Juiu*v&wxf1Y`dO-UX#8 literal 0 HcmV?d00001 From 5c6b1e9f3da3a888a651f9703e2d8ab13b25be27 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 28 Jun 2024 17:23:14 +0200 Subject: [PATCH 064/113] fix: string --- .../functions/function-[function]/+page.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index 36cf95b06..74c577ee4 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -49,10 +49,11 @@ width: 110, array: true, format: 'enum', - elements: ['active', 'ready', 'processing', 'building', 'cancelled', 'failed'] + elements: ['ready', 'processing', 'building', 'cancelled', 'failed'] + // processing", "building", "waiting", "ready","failed }, { - id: 'source', + id: 'type', title: 'Source', type: 'string', show: true, From 829289086a736834d74f1f39c37cd8ef99c23be7 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 28 Jun 2024 17:43:50 +0200 Subject: [PATCH 065/113] fix: jsmastery copy --- src/lib/layout/unauthenticated.svelte | 2 +- src/lib/stores/campaigns.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib/layout/unauthenticated.svelte b/src/lib/layout/unauthenticated.svelte index f28da9d6a..b7e250b54 100644 --- a/src/lib/layout/unauthenticated.svelte +++ b/src/lib/layout/unauthenticated.svelte @@ -158,7 +158,7 @@ - {#if selectedCampaign.footer} + {#if selectedCampaign?.footer}
    - +
    {:else if data?.query}
    diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 1adbd4754..c548a8ad0 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -164,7 +164,7 @@
    - + From 0123f18e90711c1916a567d7dc1f4859f7e56425 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 13:32:47 +0200 Subject: [PATCH 089/113] chore: bump sdk, fix mock numbers --- package-lock.json | 8 ++++---- package.json | 2 +- src/lib/elements/forms/inputPhone.svelte | 2 ++ .../auth/security/updateMockNumbers.svelte | 11 +++++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec829eefd..303408b06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "@appwrite/console", "dependencies": { - "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.4", + "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.5", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", @@ -150,9 +150,9 @@ }, "node_modules/@appwrite.io/console": { "name": "matej-appwrite-console-16x", - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/matej-appwrite-console-16x/-/matej-appwrite-console-16x-0.6.4.tgz", - "integrity": "sha512-hovc+6HFyC20lUmlD0R5kAsDMBLXXJWEES2mUAaKG56aQ1wOwQRhVOIUGmvX/1EasiUOq5dH/5uzrU+fl5C+Dw==" + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/matej-appwrite-console-16x/-/matej-appwrite-console-16x-0.6.5.tgz", + "integrity": "sha512-VjRVSqN9U9uhNHfN7E1iKoFCtV6tj/aCd4mwMQoS8WR4mQat6iJ171W597zvlQyZaHBlVf+KHrg9jY6EHsDp5A==" }, "node_modules/@appwrite.io/pink": { "version": "0.23.0", diff --git a/package.json b/package.json index cf05a91e8..77589f9a6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.4", + "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.5", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", diff --git a/src/lib/elements/forms/inputPhone.svelte b/src/lib/elements/forms/inputPhone.svelte index 52b5e1153..a14e87fda 100644 --- a/src/lib/elements/forms/inputPhone.svelte +++ b/src/lib/elements/forms/inputPhone.svelte @@ -13,6 +13,7 @@ export let readonly = false; export let autofocus = false; export let autocomplete = false; + export let minlength: number = null; export let maxlength: number = null; export let popover: typeof SvelteComponent = null; export let popoverProps: Record = {}; @@ -83,6 +84,7 @@ {placeholder} {disabled} {required} + {minlength} {maxlength} {pattern} {readonly} diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index bb7aa97da..134c7f49a 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -11,17 +11,17 @@ import Empty from '$lib/components/empty.svelte'; import type { Models } from '@appwrite.io/console'; - let numbers: Models.MockNumber[] = $project?.authMockNumbers?.numbers ?? []; + // @ts-expect-error wrong SDK type + let numbers: Models.MockNumber[] = $project?.authMockNumbers ?? []; let initialNumbers = []; let projectId: string = $project.$id; - $: initialNumbers = $project?.authMockNumbers?.numbers?.map((num) => ({ ...num })) ?? []; + // @ts-expect-error wrong SDK type + $: initialNumbers = $project?.authMockNumbers?.map((num) => ({ ...num })) ?? []; $: submitDisabled = JSON.stringify(numbers) === JSON.stringify(initialNumbers); async function updateMockNumbers() { try { - // TODO: fix once SDK is updated - //@ts-expect-error numbers is the wrong type in the SDK await sdk.forConsole.projects.updateMockNumbers(projectId, numbers); await invalidate(Dependencies.PROJECT); addNotification({ @@ -50,6 +50,8 @@ numbers.splice(index, 1); numbers = numbers; } + + $: console.log(numbers, initialNumbers);
    @@ -72,6 +74,7 @@ placeholder="Enter Phone Number" label="Phone Number" showLabel={index === 0 ? true : false} + minlength={8} maxlength={16} required /> Date: Wed, 3 Jul 2024 13:37:29 +0200 Subject: [PATCH 090/113] chore: bump sdk, fix types --- package-lock.json | 8 ++++---- package.json | 2 +- src/lib/actions/analytics.ts | 2 +- .../auth/security/updateMockNumbers.svelte | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 303408b06..2de8854a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "@appwrite/console", "dependencies": { - "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.5", + "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.6", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", @@ -150,9 +150,9 @@ }, "node_modules/@appwrite.io/console": { "name": "matej-appwrite-console-16x", - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/matej-appwrite-console-16x/-/matej-appwrite-console-16x-0.6.5.tgz", - "integrity": "sha512-VjRVSqN9U9uhNHfN7E1iKoFCtV6tj/aCd4mwMQoS8WR4mQat6iJ171W597zvlQyZaHBlVf+KHrg9jY6EHsDp5A==" + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/matej-appwrite-console-16x/-/matej-appwrite-console-16x-0.6.6.tgz", + "integrity": "sha512-QkHHFqFgfMftRcr5L1fz6784+MLEvL3tKNNpBU5W5mzdfFiAwRoBUigrCSmCIfK2IeiAtZBfGrcf/4k83YbnWA==" }, "node_modules/@appwrite.io/pink": { "version": "0.23.0", diff --git a/package.json b/package.json index 77589f9a6..709b9258e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.5", + "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.6", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 5f4c5e18b..156fca4fc 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -227,7 +227,7 @@ export enum Submit { FunctionUpdateLogging = 'submit_function_update_logging', FunctionUpdateTimeout = 'submit_function_update_timeout', FunctionUpdateEvents = 'submit_function_update_events', - FunctionUpdateScopes = 'submit_function_update_scopes', + FunctionUpdateScopes = 'submit_function_key_update_scopes', FunctionConnectRepo = 'submit_function_connect_repo', FunctionDisconnectRepo = 'submit_function_disconnect_repo', FunctionRedeploy = 'submit_function_redeploy', diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index 134c7f49a..353783dbc 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -11,12 +11,10 @@ import Empty from '$lib/components/empty.svelte'; import type { Models } from '@appwrite.io/console'; - // @ts-expect-error wrong SDK type let numbers: Models.MockNumber[] = $project?.authMockNumbers ?? []; let initialNumbers = []; let projectId: string = $project.$id; - // @ts-expect-error wrong SDK type $: initialNumbers = $project?.authMockNumbers?.map((num) => ({ ...num })) ?? []; $: submitDisabled = JSON.stringify(numbers) === JSON.stringify(initialNumbers); From 742d13ced505cc17c3bfee0f2fdac043cb6eeba7 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 13:49:55 +0200 Subject: [PATCH 091/113] fix: deployment total --- .../functions/function-[function]/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index a53afac58..c81c2650a 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -89,8 +89,8 @@ - {#if data?.activeDeployment} - {@const activeDeployment = data.activeDeployment} + {#if data?.deploymentList?.total} + {@const activeDeployment = data?.activeDeployment}
    Active
    From 6d625f5576daf41a1991cf5f1abe9b64d71232a8 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 13:52:04 +0200 Subject: [PATCH 092/113] fix: reset values on dropdown close --- src/lib/components/filters/filters.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 8d16ef03a..5c4b193f6 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -52,6 +52,9 @@ $: if (!showFiltersDesktop && !showFiltersMobile) { selectedColumn = null; + value = null; + operatorKey = null; + arrayValues = []; } $: isButtonDisabled = $queriesAreDirty From 279582264bb211448e0d0fc1faa98df9fa2ed71e Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 13:54:05 +0200 Subject: [PATCH 093/113] fix: manual deployment commands input --- .../functions/function-[function]/createManual.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte b/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte index 9e3d33160..deedf8dee 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte @@ -1,5 +1,12 @@ -
    +
    (isOverflowing = v)}>
    {/if} -
    +
    All deployments -
    +
    From bc4a6ef742015fa5b9f8d6fd13855dd72eba7390 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 15:33:56 +0200 Subject: [PATCH 096/113] feat: stack vercally filter inputs on mobile --- src/lib/components/filters/content.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index c0477e6ee..9fde006b6 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -66,7 +66,7 @@
    -
      +
        Date: Wed, 3 Jul 2024 15:39:32 +0200 Subject: [PATCH 097/113] fix: linter --- src/lib/components/filters/tagList.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/components/filters/tagList.svelte b/src/lib/components/filters/tagList.svelte index 6b69efa4c..d7db2de39 100644 --- a/src/lib/components/filters/tagList.svelte +++ b/src/lib/components/filters/tagList.svelte @@ -7,6 +7,7 @@ node.innerHTML = node.innerHTML.replace(/\*\*(.*?)\*\*/g, '$1'); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any function isTypeTagValue(obj: any): obj is TagValue { if (typeof obj === 'string') return false; return ( From 696f08f6a057553c92bb0526b3c805f56189696c Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 15:40:20 +0200 Subject: [PATCH 098/113] fix: linter --- src/lib/components/filters/tagList.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/components/filters/tagList.svelte b/src/lib/components/filters/tagList.svelte index d7db2de39..f5bbf94f8 100644 --- a/src/lib/components/filters/tagList.svelte +++ b/src/lib/components/filters/tagList.svelte @@ -7,6 +7,7 @@ node.innerHTML = node.innerHTML.replace(/\*\*(.*?)\*\*/g, '$1'); } + // We cast to any to not cause type errors in the input components // eslint-disable-next-line @typescript-eslint/no-explicit-any function isTypeTagValue(obj: any): obj is TagValue { if (typeof obj === 'string') return false; From 4b0ce15a6eb7f68625747622efb8a4f4f788d7c3 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 15:42:37 +0200 Subject: [PATCH 099/113] fix: deployments display logic --- .../function-[function]/+page.svelte | 156 +++++++++--------- 1 file changed, 77 insertions(+), 79 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index 78a55ff07..26acb9637 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -89,89 +89,87 @@ - {#if data?.deploymentList?.total} +
        + Active +
        + {#if data?.activeDeployment && !$func.live && showAlert} + (showAlert = false)}> + Some configuration options are not live yet. Redeploy your function to apply latest + changes. + + {/if} + {#if data?.activeDeployment} {@const activeDeployment = data?.activeDeployment} -
        - Active -
        - {#if activeDeployment && !$func.live && showAlert} - (showAlert = false)}> - Some configuration options are not live yet. Redeploy your function to apply latest - changes. - - {/if} - {#if activeDeployment} - - -
        - - - -
        -
        -
        - {:else if $deploymentList.total} - - - - -
        -

        - Add a new deployment, or activate an existing one to see your function in - action.
        Learn more about deployments in our - documentation. -

        -
        -
        - {:else} - -
        - - Create your first deployment to get started. - -

        - Learn more about deployments in our Documentation. -

        -
        -
        + + +
        - + href={`/console/project-${$page.params.project}/functions/function-${$page.params.function}/deployment-${activeDeployment.$id}`}> + Build logs + + +
        - - {/if} +
        +
        + {:else if $deploymentList.total} + + + + +
        +

        + Add a new deployment, or activate an existing one to see your function in + action.
        Learn more about deployments in our + documentation. +

        +
        +
        + {:else} + +
        + Create your first deployment to get started. +

        + Learn more about deployments in our Documentation. +

        +
        +
        + + +
        +
        + {/if} + {#if data?.deploymentList?.total}
        All deployments
        From f0079a9778e41e9bfd06962e8b5747b1d060dc52 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 15:42:52 +0200 Subject: [PATCH 100/113] feat: maintain scroll position after filters --- src/lib/components/filters/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index 65e18b369..3f2e4360e 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -66,7 +66,7 @@ function initQueries(initialValue = new Map()) { function apply() { const queryParam = mapToQueryParams(get(queries)); const currentLocation = window.location.pathname; - goto(`${currentLocation}?query=${queryParam}`); + goto(`${currentLocation}?query=${queryParam}`, { noScroll: true }); } return { From 92de8daba2029cadd831960a51e52ca84b341fbc Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 15:57:24 +0200 Subject: [PATCH 101/113] fix linter? --- src/lib/components/filters/tagList.svelte | 2 +- .../functions/function-[function]/+page.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/filters/tagList.svelte b/src/lib/components/filters/tagList.svelte index f5bbf94f8..61192b938 100644 --- a/src/lib/components/filters/tagList.svelte +++ b/src/lib/components/filters/tagList.svelte @@ -8,7 +8,7 @@ } // We cast to any to not cause type errors in the input components - // eslint-disable-next-line @typescript-eslint/no-explicit-any + /* eslint @typescript-eslint/no-explicit-any: 'off' */ function isTypeTagValue(obj: any): obj is TagValue { if (typeof obj === 'string') return false; return ( diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index 26acb9637..84fa00555 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -104,7 +104,7 @@ {/if} {#if data?.activeDeployment} - {@const activeDeployment = data?.activeDeployment} + {@const activeDeployment = data.activeDeployment}
        From e3d6acdd23edc343961b6281ba64de4ac4f1b28f Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 17:05:36 +0200 Subject: [PATCH 102/113] fix: create execution --- .../executions/execute-function/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte index 743aa924d..13c53ade3 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte @@ -101,7 +101,7 @@ path, method, headersObject, - isScheduled ? dateTime.toString() : undefined + isScheduled ? dateTime.toISOString() : undefined ); await goto( `${base}/console/project-${$page.params.project}/functions/function-${func.$id}/executions` From ef58c90b4a79042752aa7de2169c2c95d2fe0eb3 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 17:43:02 +0200 Subject: [PATCH 103/113] fix: deployments view --- .../function-[function]/+page.svelte | 188 ++++++++---------- 1 file changed, 85 insertions(+), 103 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index 84fa00555..de49e904b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -89,68 +89,7 @@ -
        - Active -
        - {#if data?.activeDeployment && !$func.live && showAlert} - (showAlert = false)}> - Some configuration options are not live yet. Redeploy your function to apply latest - changes. - - {/if} - {#if data?.activeDeployment} - {@const activeDeployment = data.activeDeployment} - - -
        - - - -
        -
        -
        - {:else if $deploymentList.total} - - - - -
        -

        - Add a new deployment, or activate an existing one to see your function in - action.
        Learn more about deployments in our - documentation. -

        -
        -
        - {:else} + {#if !data?.deploymentList?.total && !data?.query}
        Create your first deployment to get started. @@ -164,12 +103,93 @@ href="https://appwrite.io/docs/products/functions/deployment" text event="empty_documentation" - ariaLabel={`create {target}`}>Documentation + ariaLabel={`create deployment`}>Documentation
        - {/if} - {#if data?.deploymentList?.total} + {:else} + {@const activeDeployment = data.activeDeployment} + +
        + Active +
        + {#if data?.activeDeployment && !$func.live && showAlert} + (showAlert = false)}> + Some configuration options are not live yet. Redeploy your function to apply latest + changes. + + {/if} + {#if activeDeployment} + + +
        + + + +
        +
        +
        + {:else if !$deploymentList.total && !data?.query} + +
        + Create your first deployment to get started. +

        + Learn more about deployments in our Documentation. +

        +
        +
        + + +
        +
        + {:else} + + + + +
        +

        + Add a new deployment, or activate an existing one to see your function in + action.
        Learn more about deployments in our + documentation. +

        +
        +
        + {/if}
        All deployments
        @@ -243,45 +263,7 @@
        - {:else} - -
        - - You have no deployments. Create one to see it here. - -

        - Learn more about deployments in our Documentation. -

        -
        -
        - - -
        -
        {/if} - {:else} - -
        - Create your first deployment to get started. -

        - Learn more about deployments in our Documentation. -

        -
        -
        - - -
        -
        {/if} Date: Wed, 3 Jul 2024 18:11:08 +0200 Subject: [PATCH 104/113] fix: filters logic --- src/lib/components/filters/content.svelte | 5 ++++- src/lib/components/filters/filters.svelte | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index 9fde006b6..72634ab94 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -10,7 +10,7 @@ InputDateTime } from '$lib/elements/forms'; import { createEventDispatcher, onMount } from 'svelte'; - import { tags, operators, addFilter } from './store'; + import { tags, operators, addFilter, queries } from './store'; import type { Column } from '$lib/helpers/types'; import type { Writable } from 'svelte/store'; import { TagList } from '.'; @@ -55,6 +55,9 @@ operatorKey = null; value = null; arrayValues = []; + if (singleCondition) { + queries.apply(); + } } const dispatch = createEventDispatcher<{ diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 5c4b193f6..1960a6ea9 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -50,6 +50,18 @@ queries.apply(); } + function afterApply( + e: CustomEvent<{ + applied: number; + }> + ) { + applied = e.detail.applied; + if (singleCondition) { + showFiltersDesktop = false; + showFiltersMobile = false; + } + } + $: if (!showFiltersDesktop && !showFiltersMobile) { selectedColumn = null; value = null; @@ -92,7 +104,7 @@ bind:arrayValues {columns} {singleCondition} - on:apply={(e) => (applied = e.detail.applied)} + on:apply={afterApply} on:clear={() => (applied = 0)} />
        @@ -136,7 +148,7 @@ bind:value bind:arrayValues {singleCondition} - on:apply={(e) => (applied = e.detail.applied)} + on:apply={afterApply} on:clear={() => (applied = 0)} /> {#if singleCondition} From a6d2749031b169fadc9c5734e67577ca5204b71f Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 18:21:58 +0200 Subject: [PATCH 105/113] feat: fix isNull and isNotNull --- src/lib/components/filters/filters.svelte | 27 ++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 1960a6ea9..4eba0cbca 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -5,7 +5,14 @@ import type { Column } from '$lib/helpers/types'; import type { Writable } from 'svelte/store'; import Content from './content.svelte'; - import { addFilter, queries, queriesAreDirty, queryParamToMap, tags } from './store'; + import { + addFilter, + queries, + queriesAreDirty, + queryParamToMap, + tags, + ValidOperators + } from './store'; export let query = '[]'; export let columns: Writable; @@ -40,7 +47,14 @@ } function apply() { - if (selectedColumn && operatorKey && (value || arrayValues.length)) { + if ( + selectedColumn && + operatorKey && + (operatorKey === ValidOperators.IsNotNull || + operatorKey === ValidOperators.IsNull || + value || + arrayValues.length) + ) { addFilter($columns, selectedColumn, operatorKey, value, arrayValues); selectedColumn = null; value = null; @@ -71,7 +85,12 @@ $: isButtonDisabled = $queriesAreDirty ? false - : !selectedColumn || !operatorKey || (!value && !arrayValues.length); + : !selectedColumn || + !operatorKey || + (!value && + !arrayValues.length && + operatorKey !== ValidOperators.IsNotNull && + operatorKey !== ValidOperators.IsNull); function toggleDropdown() { showFiltersDesktop = !showFiltersDesktop; @@ -79,6 +98,8 @@ function toggleMobileModal() { showFiltersMobile = !showFiltersMobile; } + + $: console.log(selectedColumn, operatorKey, value, arrayValues);
        From f2192dddbd7c2626c5e6456591b10c2d00f68e6b Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 3 Jul 2024 18:31:15 +0200 Subject: [PATCH 106/113] fix: cancel deployment button logic --- .../functions/function-[function]/table.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/table.svelte index d2070a8e0..3791a8d5d 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/table.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/table.svelte @@ -139,7 +139,7 @@ href={`/console/project-${$page.params.project}/functions/function-${$page.params.function}/deployment-${deployment.$id}`}> Logs - {#if deployment.status === 'processing'} + {#if deployment.status === 'processing' || deployment.status === 'building'} Date: Wed, 3 Jul 2024 18:46:28 +0200 Subject: [PATCH 107/113] fix: button are not trully disabled when links --- src/lib/elements/forms/button.svelte | 1 + .../functions/function-[function]/executions/+page.svelte | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elements/forms/button.svelte b/src/lib/elements/forms/button.svelte index 0803c7650..badf8a209 100644 --- a/src/lib/elements/forms/button.svelte +++ b/src/lib/elements/forms/button.svelte @@ -68,6 +68,7 @@ target={external ? '_blank' : ''} rel={external ? 'noopener noreferrer' : ''} class={resolvedClasses} + style="pointer-events: {internalDisabled ? 'none' : 'auto'};" aria-label={ariaLabel} use:multiAction={actions}> diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index c548a8ad0..5a7b0a74d 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -167,7 +167,8 @@ @@ -190,7 +191,8 @@
        From 0d0cfe12936059e430bb87064c830e213d46a720 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 4 Jul 2024 12:10:07 +0900 Subject: [PATCH 108/113] Finish Implementing Specs API --- src/lib/sdk/functionsSpec.ts | 272 ++++++++++++++++++ src/lib/stores/sdk.ts | 2 + .../project-[project]/functions/+layout.ts | 2 +- .../settings/updateRuntime.svelte | 8 +- .../functions/function-[function]/store.ts | 3 +- .../project-[project]/functions/store.ts | 3 +- 6 files changed, 283 insertions(+), 7 deletions(-) create mode 100644 src/lib/sdk/functionsSpec.ts diff --git a/src/lib/sdk/functionsSpec.ts b/src/lib/sdk/functionsSpec.ts new file mode 100644 index 000000000..2cc5d9ff6 --- /dev/null +++ b/src/lib/sdk/functionsSpec.ts @@ -0,0 +1,272 @@ +import { AppwriteException, Runtime, type Client, type Payload } from '@appwrite.io/console'; + +export type Specs = { + cpus: number[]; + memory: number[]; +} + +/** + * Variable + */ +type Variable = { + /** + * Variable ID. + */ + $id: string; + /** + * Variable creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Variable creation date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Variable key. + */ + key: string; + /** + * Variable value. + */ + value: string; + /** + * Service to which the variable belongs. Possible values are "project", "function" + */ + resourceType: string; + /** + * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. + */ + resourceId: string; +}; + +export type Function = { + /** + * Function ID. + */ + $id: string; + /** + * Function creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Function update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Execution permissions. + */ + execute: string[]; + /** + * Function name. + */ + name: string; + /** + * Function enabled. + */ + enabled: boolean; + /** + * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. + */ + live: boolean; + /** + * Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + */ + logging: boolean; + /** + * Function execution runtime. + */ + runtime: string; + /** + * Function's active deployment ID. + */ + deployment: string; + /** + * Function variables. + */ + vars: Variable[]; + /** + * Function trigger events. + */ + events: string[]; + /** + * Function execution schedult in CRON format. + */ + schedule: string; + /** + * Function execution timeout in seconds. + */ + timeout: number; + /** + * The entrypoint file used to execute the deployment. + */ + entrypoint: string; + /** + * The build command used to build the deployment. + */ + commands: string; + /** + * Version of Open Runtimes used for the function. + */ + version: string; + /** + * Function VCS (Version Control System) installation id. + */ + installationId: string; + /** + * VCS (Version Control System) Repository ID + */ + providerRepositoryId: string; + /** + * VCS (Version Control System) branch name + */ + providerBranch: string; + /** + * Path to function in VCS (Version Control System) repository + */ + providerRootDirectory: string; + /** + * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests + */ + providerSilentMode: boolean; + /** + * CPU limit + */ + cpus: number; + /** + * Memory limit + */ + memory: number; +} + +export class SpecsFunctions { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + async getSpecs(): Promise { + const path = '/functions/specs'; + + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'GET', + uri, + { + 'content-type': 'application/json' + } + ); + } + + /** + * Update function + * + * Update function by its unique ID. + * + * @param {string} functionId + * @param {string} name + * @param {Runtime} runtime + * @param {string[]} execute + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @param {boolean} enabled + * @param {boolean} logging + * @param {string} entrypoint + * @param {string} commands + * @param {string} installationId + * @param {string} providerRepositoryId + * @param {string} providerBranch + * @param {boolean} providerSilentMode + * @param {string} providerRootDirectory + * @param {number} cpus + * @param {number} memory + * @throws {AppwriteException} + * @returns {Promise} + */ + async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, cpus?: number, memory?: number): Promise { + if (typeof functionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + + if (typeof runtime !== 'undefined') { + payload['runtime'] = runtime; + } + + if (typeof execute !== 'undefined') { + payload['execute'] = execute; + } + + if (typeof events !== 'undefined') { + payload['events'] = events; + } + + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + + if (typeof timeout !== 'undefined') { + payload['timeout'] = timeout; + } + + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + if (typeof logging !== 'undefined') { + payload['logging'] = logging; + } + + if (typeof entrypoint !== 'undefined') { + payload['entrypoint'] = entrypoint; + } + + if (typeof commands !== 'undefined') { + payload['commands'] = commands; + } + + if (typeof installationId !== 'undefined') { + payload['installationId'] = installationId; + } + + if (typeof providerRepositoryId !== 'undefined') { + payload['providerRepositoryId'] = providerRepositoryId; + } + + if (typeof providerBranch !== 'undefined') { + payload['providerBranch'] = providerBranch; + } + + if (typeof providerSilentMode !== 'undefined') { + payload['providerSilentMode'] = providerSilentMode; + } + + if (typeof providerRootDirectory !== 'undefined') { + payload['providerRootDirectory'] = providerRootDirectory; + } + + if (typeof cpus !== 'undefined') { + payload['cpus'] = cpus; + } + + if (typeof memory !== 'undefined') { + payload['memory'] = memory; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('put', uri, { + 'content-type': 'application/json', + }, payload); + } +} \ No newline at end of file diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index 8dacdc079..ec3ca5328 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -23,6 +23,7 @@ import { } from '@appwrite.io/console'; import { Billing } from '../sdk/billing'; import { Sources } from '$lib/sdk/sources'; +import { SpecsFunctions } from '$lib/sdk/functionsSpec'; const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`; @@ -38,6 +39,7 @@ const sdkForProject = { avatars: new Avatars(clientProject), databases: new Databases(clientProject), functions: new Functions(clientProject), + specsFunctions: new SpecsFunctions(clientProject), health: new Health(clientProject), locale: new Locale(clientProject), messaging: new Messaging(clientProject), diff --git a/src/routes/console/project-[project]/functions/+layout.ts b/src/routes/console/project-[project]/functions/+layout.ts index 9f696c75f..5be87b9cf 100644 --- a/src/routes/console/project-[project]/functions/+layout.ts +++ b/src/routes/console/project-[project]/functions/+layout.ts @@ -11,7 +11,7 @@ export const load: LayoutLoad = async ({ depends }) => { const [runtimesList, installations, specs] = await Promise.all([ sdk.forProject.functions.listRuntimes(), sdk.forProject.vcs.listInstallations([Query.limit(100)]), - sdk.forProject.functions.getSpecs() + sdk.forProject.specsFunctions.getSpecs() ]); return { diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte index c5f756b9a..9f9f34d05 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte @@ -58,7 +58,7 @@ if (!isValueOfStringEnum(Runtime, runtime)) { throw new Error(`Invalid runtime: ${runtime}`); } - await sdk.forProject.functions.update( + await sdk.forProject.specsFunctions.update( functionId, $func.name, runtime, @@ -75,8 +75,8 @@ $func.providerBranch || undefined, $func.providerSilentMode || undefined, $func.providerRootDirectory || undefined, - memory, - cpus + cpus, + memory ); await invalidate(Dependencies.FUNCTION); addNotification({ @@ -94,7 +94,7 @@ } $: isUpdateButtonEnabled = - runtime !== $func?.runtime || cpus !== $func?.cpus || memory !== $func?.memory; + runtime !== $func?.runtime || memory !== $func?.memory || cpus !== $func?.cpus; diff --git a/src/routes/console/project-[project]/functions/function-[function]/store.ts b/src/routes/console/project-[project]/functions/function-[function]/store.ts index 0bc01a1d4..d27030d2f 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/store.ts +++ b/src/routes/console/project-[project]/functions/function-[function]/store.ts @@ -1,8 +1,9 @@ import { page } from '$app/stores'; import { derived, writable, type Writable } from 'svelte/store'; import type { Models } from '@appwrite.io/console'; +import type { Function } from '$lib/sdk/functionsSpec'; -export const func = derived(page, ($page) => $page.data.function as Models.Function); +export const func = derived(page, ($page) => $page.data.function as Function); export const deploymentList = derived( page, ($page) => $page.data.deploymentList as Models.DeploymentList diff --git a/src/routes/console/project-[project]/functions/store.ts b/src/routes/console/project-[project]/functions/store.ts index 7606e2404..fcef48ffd 100644 --- a/src/routes/console/project-[project]/functions/store.ts +++ b/src/routes/console/project-[project]/functions/store.ts @@ -1,6 +1,7 @@ import { page } from '$app/stores'; import { derived } from 'svelte/store'; import type { Models } from '@appwrite.io/console'; +import type { Specs } from '$lib/sdk/functionsSpec'; export const runtimesList = derived( page, @@ -9,7 +10,7 @@ export const runtimesList = derived( export const specs = derived( page, - async ($page) => (await $page.data.specs) as Models.Specs + async ($page) => (await $page.data.specs) as Specs ); export const baseRuntimesList = derived(runtimesList, async ($runtimesList) => { From b324bb7b96fd470a017bf333dc25cfafc4853456 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 4 Jul 2024 12:25:40 +0900 Subject: [PATCH 109/113] Run Linter --- src/lib/sdk/functionsSpec.ts | 210 ++++++++++-------- .../settings/updateRuntime.svelte | 2 +- .../project-[project]/functions/store.ts | 5 +- 3 files changed, 117 insertions(+), 100 deletions(-) diff --git a/src/lib/sdk/functionsSpec.ts b/src/lib/sdk/functionsSpec.ts index 2cc5d9ff6..d0325a89a 100644 --- a/src/lib/sdk/functionsSpec.ts +++ b/src/lib/sdk/functionsSpec.ts @@ -3,7 +3,7 @@ import { AppwriteException, Runtime, type Client, type Payload } from '@appwrite export type Specs = { cpus: number[]; memory: number[]; -} +}; /** * Variable @@ -136,7 +136,7 @@ export type Function = { * Memory limit */ memory: number; -} +}; export class SpecsFunctions { client: Client; @@ -149,13 +149,9 @@ export class SpecsFunctions { const path = '/functions/specs'; const uri = new URL(this.client.config.endpoint + path); - return await this.client.call( - 'GET', - uri, - { - 'content-type': 'application/json' - } - ); + return await this.client.call('GET', uri, { + 'content-type': 'application/json' + }); } /** @@ -183,90 +179,114 @@ export class SpecsFunctions { * @param {number} memory * @throws {AppwriteException} * @returns {Promise} - */ - async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, cpus?: number, memory?: number): Promise { - if (typeof functionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "functionId"'); - } - - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); - const payload: Payload = {}; - - if (typeof name !== 'undefined') { - payload['name'] = name; - } - - if (typeof runtime !== 'undefined') { - payload['runtime'] = runtime; - } - - if (typeof execute !== 'undefined') { - payload['execute'] = execute; - } - - if (typeof events !== 'undefined') { - payload['events'] = events; - } - - if (typeof schedule !== 'undefined') { - payload['schedule'] = schedule; - } - - if (typeof timeout !== 'undefined') { - payload['timeout'] = timeout; - } - - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - - if (typeof logging !== 'undefined') { - payload['logging'] = logging; - } - - if (typeof entrypoint !== 'undefined') { - payload['entrypoint'] = entrypoint; - } - - if (typeof commands !== 'undefined') { - payload['commands'] = commands; - } - - if (typeof installationId !== 'undefined') { - payload['installationId'] = installationId; - } - - if (typeof providerRepositoryId !== 'undefined') { - payload['providerRepositoryId'] = providerRepositoryId; - } - - if (typeof providerBranch !== 'undefined') { - payload['providerBranch'] = providerBranch; - } - - if (typeof providerSilentMode !== 'undefined') { - payload['providerSilentMode'] = providerSilentMode; - } - - if (typeof providerRootDirectory !== 'undefined') { - payload['providerRootDirectory'] = providerRootDirectory; - } - - if (typeof cpus !== 'undefined') { - payload['cpus'] = cpus; - } - - if (typeof memory !== 'undefined') { - payload['memory'] = memory; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { - 'content-type': 'application/json', - }, payload); + */ + async update( + functionId: string, + name: string, + runtime?: Runtime, + execute?: string[], + events?: string[], + schedule?: string, + timeout?: number, + enabled?: boolean, + logging?: boolean, + entrypoint?: string, + commands?: string, + installationId?: string, + providerRepositoryId?: string, + providerBranch?: string, + providerSilentMode?: boolean, + providerRootDirectory?: string, + cpus?: number, + memory?: number + ): Promise { + if (typeof functionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "functionId"'); } -} \ No newline at end of file + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + + if (typeof runtime !== 'undefined') { + payload['runtime'] = runtime; + } + + if (typeof execute !== 'undefined') { + payload['execute'] = execute; + } + + if (typeof events !== 'undefined') { + payload['events'] = events; + } + + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + + if (typeof timeout !== 'undefined') { + payload['timeout'] = timeout; + } + + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + if (typeof logging !== 'undefined') { + payload['logging'] = logging; + } + + if (typeof entrypoint !== 'undefined') { + payload['entrypoint'] = entrypoint; + } + + if (typeof commands !== 'undefined') { + payload['commands'] = commands; + } + + if (typeof installationId !== 'undefined') { + payload['installationId'] = installationId; + } + + if (typeof providerRepositoryId !== 'undefined') { + payload['providerRepositoryId'] = providerRepositoryId; + } + + if (typeof providerBranch !== 'undefined') { + payload['providerBranch'] = providerBranch; + } + + if (typeof providerSilentMode !== 'undefined') { + payload['providerSilentMode'] = providerSilentMode; + } + + if (typeof providerRootDirectory !== 'undefined') { + payload['providerRootDirectory'] = providerRootDirectory; + } + + if (typeof cpus !== 'undefined') { + payload['cpus'] = cpus; + } + + if (typeof memory !== 'undefined') { + payload['memory'] = memory; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call( + 'put', + uri, + { + 'content-type': 'application/json' + }, + payload + ); + } +} diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte index 9f9f34d05..714493913 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte @@ -33,7 +33,7 @@ options = runtimes.runtimes.map((runtime) => ({ label: `${runtime.name} - ${runtime.version}`, value: runtime.$id - })); + })); memoryOptions = allowedSpecs.memory.map((memory) => memory > 1024 diff --git a/src/routes/console/project-[project]/functions/store.ts b/src/routes/console/project-[project]/functions/store.ts index fcef48ffd..396c5d584 100644 --- a/src/routes/console/project-[project]/functions/store.ts +++ b/src/routes/console/project-[project]/functions/store.ts @@ -8,10 +8,7 @@ export const runtimesList = derived( async ($page) => (await $page.data.runtimesList) as Models.RuntimeList ); -export const specs = derived( - page, - async ($page) => (await $page.data.specs) as Specs -); +export const specs = derived(page, async ($page) => (await $page.data.specs) as Specs); export const baseRuntimesList = derived(runtimesList, async ($runtimesList) => { const baseRuntimes = new Map(); From 51d8bb851f14262aeae76166af9e7e21d9787ff0 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 4 Jul 2024 12:31:21 +0900 Subject: [PATCH 110/113] Satiate linter --- src/lib/sdk/functionsSpec.ts | 4 ++-- .../project-[project]/functions/function-[function]/store.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/sdk/functionsSpec.ts b/src/lib/sdk/functionsSpec.ts index d0325a89a..a50679099 100644 --- a/src/lib/sdk/functionsSpec.ts +++ b/src/lib/sdk/functionsSpec.ts @@ -39,7 +39,7 @@ type Variable = { resourceId: string; }; -export type Function = { +export type Func = { /** * Function ID. */ @@ -199,7 +199,7 @@ export class SpecsFunctions { providerRootDirectory?: string, cpus?: number, memory?: number - ): Promise { + ): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } diff --git a/src/routes/console/project-[project]/functions/function-[function]/store.ts b/src/routes/console/project-[project]/functions/function-[function]/store.ts index d27030d2f..ffe78b451 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/store.ts +++ b/src/routes/console/project-[project]/functions/function-[function]/store.ts @@ -1,9 +1,9 @@ import { page } from '$app/stores'; import { derived, writable, type Writable } from 'svelte/store'; import type { Models } from '@appwrite.io/console'; -import type { Function } from '$lib/sdk/functionsSpec'; +import type { Func } from '$lib/sdk/functionsSpec'; -export const func = derived(page, ($page) => $page.data.function as Function); +export const func = derived(page, ($page) => $page.data.function as Func); export const deploymentList = derived( page, ($page) => $page.data.deploymentList as Models.DeploymentList From 6be79f74446137a68b9551c2408a1fff0f2a4a41 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 4 Jul 2024 11:23:09 +0200 Subject: [PATCH 111/113] feat: time input custom step --- src/lib/elements/forms/inputTime.svelte | 3 ++- .../executions/execute-function/+page.svelte | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/elements/forms/inputTime.svelte b/src/lib/elements/forms/inputTime.svelte index 42cad1017..e32df0a07 100644 --- a/src/lib/elements/forms/inputTime.svelte +++ b/src/lib/elements/forms/inputTime.svelte @@ -16,6 +16,7 @@ export let autocomplete = false; export let fullWidth = false; export let isMultiple = false; + export let step: number | 'any' = 60; let element: HTMLInputElement; let error: string; @@ -56,7 +57,7 @@ {required} {min} {max} - step="60" + {step} autocomplete={autocomplete ? 'on' : 'off'} type="time" class="input-text" diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte index 13c53ade3..51f6e5b4b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte @@ -289,6 +289,7 @@ required={true} min={minTime} bind:value={time} + step={1} isMultiple fullWidth /> From f992cdbbaf562c344cb3f31007d3d1e1aeb24b3a Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 4 Jul 2024 15:07:09 +0200 Subject: [PATCH 112/113] feat: download deployment --- src/lib/components/filters/filters.svelte | 2 -- src/lib/sdk/functions.ts | 26 +++++++++++++++++++ src/lib/stores/sdk.ts | 4 ++- .../auth/security/updateMockNumbers.svelte | 2 -- .../function-[function]/table.svelte | 17 ++++++++++++ 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 src/lib/sdk/functions.ts diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 4eba0cbca..cae6f2878 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -98,8 +98,6 @@ function toggleMobileModal() { showFiltersMobile = !showFiltersMobile; } - - $: console.log(selectedColumn, operatorKey, value, arrayValues);
        diff --git a/src/lib/sdk/functions.ts b/src/lib/sdk/functions.ts new file mode 100644 index 000000000..df494e54e --- /dev/null +++ b/src/lib/sdk/functions.ts @@ -0,0 +1,26 @@ +import type { Client } from '@appwrite.io/console'; + +export class Func { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + async downloadDeployment(functionId: string, deploymentId: string): Promise { + const path = `/functions/${functionId}/deployments/${deploymentId}/download`; + const params = { + functionId, + deploymentId + }; + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'GET', + uri, + { + 'content-type': 'application/json' + }, + params + ); + } +} diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index 8dacdc079..a3e31c050 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -23,6 +23,7 @@ import { } from '@appwrite.io/console'; import { Billing } from '../sdk/billing'; import { Sources } from '$lib/sdk/sources'; +import { Func } from '$lib/sdk/functions'; const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`; @@ -74,7 +75,8 @@ export const sdk = { console: new Console(clientConsole), assistant: new Assistant(clientConsole), billing: new Billing(clientConsole), - sources: new Sources(clientConsole) + sources: new Sources(clientConsole), + func: new Func(clientConsole) }, get forProject() { const projectId = getProjectId(); diff --git a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte index 353783dbc..faf065fc1 100644 --- a/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/console/project-[project]/auth/security/updateMockNumbers.svelte @@ -48,8 +48,6 @@ numbers.splice(index, 1); numbers = numbers; } - - $: console.log(numbers, initialNumbers); diff --git a/src/routes/console/project-[project]/functions/function-[function]/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/table.svelte index 3791a8d5d..a0e0a9b16 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/table.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/table.svelte @@ -26,6 +26,7 @@ import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import Cancel from './cancel.svelte'; + import { sdk } from '$lib/stores/sdk'; export let columns: Column[]; export let data: PageData; @@ -41,6 +42,13 @@ function handleActivate() { invalidate(Dependencies.DEPLOYMENTS); } + + async function getDownload(deploymentId: string) { + return ( + (await sdk.forConsole.func.downloadDeployment($func.$id, deploymentId)).toString() + + '&mode=admin' + ); + } @@ -139,6 +147,15 @@ href={`/console/project-${$page.params.project}/functions/function-${$page.params.function}/deployment-${deployment.$id}`}> Logs + {#if deployment.status === 'ready'} + {#await getDownload(deployment.$id)} + Download + {:then href} + + Download + + {/await} + {/if} {#if deployment.status === 'processing' || deployment.status === 'building'} Date: Mon, 8 Jul 2024 10:22:34 +0200 Subject: [PATCH 113/113] feat: download button --- package-lock.json | 8 +++--- package.json | 2 +- src/lib/sdk/functions.ts | 26 ------------------- src/lib/stores/sdk.ts | 4 +-- .../deployment-[deployment]/+page.svelte | 13 ++++++++++ .../function-[function]/table.svelte | 17 ++++++------ 6 files changed, 27 insertions(+), 43 deletions(-) delete mode 100644 src/lib/sdk/functions.ts diff --git a/package-lock.json b/package-lock.json index 2de8854a7..8dec65e39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "@appwrite/console", "dependencies": { - "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.6", + "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.7", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", @@ -150,9 +150,9 @@ }, "node_modules/@appwrite.io/console": { "name": "matej-appwrite-console-16x", - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/matej-appwrite-console-16x/-/matej-appwrite-console-16x-0.6.6.tgz", - "integrity": "sha512-QkHHFqFgfMftRcr5L1fz6784+MLEvL3tKNNpBU5W5mzdfFiAwRoBUigrCSmCIfK2IeiAtZBfGrcf/4k83YbnWA==" + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/matej-appwrite-console-16x/-/matej-appwrite-console-16x-0.6.7.tgz", + "integrity": "sha512-orhonLVjV0vzJE/OrI49DRJ75EAkEa+8QzWy30h1N04jNyAcEGFfx4OKmhWg4uG5XRrmWrrDj9nobHKCiBaDCg==" }, "node_modules/@appwrite.io/pink": { "version": "0.23.0", diff --git a/package.json b/package.json index 709b9258e..7fb2d9f0c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.6", + "@appwrite.io/console": "npm:matej-appwrite-console-16x@0.6.7", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", diff --git a/src/lib/sdk/functions.ts b/src/lib/sdk/functions.ts deleted file mode 100644 index df494e54e..000000000 --- a/src/lib/sdk/functions.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { Client } from '@appwrite.io/console'; - -export class Func { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - async downloadDeployment(functionId: string, deploymentId: string): Promise { - const path = `/functions/${functionId}/deployments/${deploymentId}/download`; - const params = { - functionId, - deploymentId - }; - const uri = new URL(this.client.config.endpoint + path); - return await this.client.call( - 'GET', - uri, - { - 'content-type': 'application/json' - }, - params - ); - } -} diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index a3e31c050..8dacdc079 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -23,7 +23,6 @@ import { } from '@appwrite.io/console'; import { Billing } from '../sdk/billing'; import { Sources } from '$lib/sdk/sources'; -import { Func } from '$lib/sdk/functions'; const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`; @@ -75,8 +74,7 @@ export const sdk = { console: new Console(clientConsole), assistant: new Assistant(clientConsole), billing: new Billing(clientConsole), - sources: new Sources(clientConsole), - func: new Func(clientConsole) + sources: new Sources(clientConsole) }, get forProject() { const projectId = getProjectId(); diff --git a/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte index 4e38f0fbf..50cf9d442 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte @@ -29,6 +29,13 @@ invalidate(Dependencies.DEPLOYMENTS); } + function getDownload(deploymentId: string) { + return ( + sdk.forProject.functions.getDeploymentDownload($func.$id, deploymentId).toString() + + '&mode=admin' + ); + } + onMount(() => { logs = $deployment.buildLogs; if ($deployment.status === 'ready') { @@ -61,6 +68,12 @@ showCancel = true; }}>Cancel {/if} + + {#if $deployment.status === 'ready'} + + {/if}