From 3b15c1e8064451fad82c0f4f4eb3725c23ba6a13 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 10 Aug 2023 13:09:19 +0200 Subject: [PATCH 01/18] fix: alert is not dismissible --- .../console/project-[project]/auth/templates/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/auth/templates/+page.svelte b/src/routes/console/project-[project]/auth/templates/+page.svelte index 61a5de7ef..d8ec5ea71 100644 --- a/src/routes/console/project-[project]/auth/templates/+page.svelte +++ b/src/routes/console/project-[project]/auth/templates/+page.svelte @@ -85,7 +85,7 @@
Date: Wed, 16 Aug 2023 17:17:28 +0200 Subject: [PATCH 02/18] fix: code review --- src/lib/layout/logs.svelte | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/lib/layout/logs.svelte b/src/lib/layout/logs.svelte index e7d5e3781..2f1607cf8 100644 --- a/src/lib/layout/logs.svelte +++ b/src/lib/layout/logs.svelte @@ -10,7 +10,6 @@ TableCellHead, TableCellText, TableHeader, - TableList, TableRow } from '$lib/elements/table'; import { beforeNavigate } from '$app/navigation'; @@ -27,21 +26,18 @@ } beforeNavigate((n) => { - if ($log.show) { - if (n.type === 'popstate') { - n.cancel(); - } - $log.show = false; + if (!$log.show) return; + if (n.type === 'popstate') { + n.cancel(); } + $log.show = false; }); $: execution = $log.data; $: func = $log.func; - $: if (execution) { - if (execution.errors) { - selectedResponse = 'errors'; - } + $: if (execution?.errors) { + selectedResponse = 'errors'; } @@ -85,20 +81,13 @@ {calculateTime(execution.duration)} - +
  • Created at:
  • -
    {execution.status} From f5c8ad72ef026435d7c22aa4815c9495d1cfeb6f Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:28:00 +0200 Subject: [PATCH 03/18] fix: code review --- src/lib/layout/shell.svelte | 13 ++-- src/lib/wizards/functions/createManual.svelte | 65 +++++++++++-------- .../project-[project]/functions/+layout.ts | 2 +- .../functions/function-[function]/+layout.ts | 4 +- .../function-[function]/+page.svelte | 2 +- .../function-[function]/redeployModal.svelte | 2 +- 6 files changed, 48 insertions(+), 40 deletions(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index c3cc62ae0..132f458e8 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -30,13 +30,12 @@ * Cancel navigation when wizard is open and triggered by popstate */ beforeNavigate((n) => { - if ($wizard.show || $wizard.cover) { - if (n.type === 'popstate') { - n.cancel(); - } - if (n.type !== 'leave') { - wizard.hide(); - } + if (!$wizard.show || !$wizard.cover) return; + if (n.type === 'popstate') { + n.cancel(); + } + if (n.type !== 'leave') { + wizard.hide(); } }); diff --git a/src/lib/wizards/functions/createManual.svelte b/src/lib/wizards/functions/createManual.svelte index c9a5276d8..7d6af860d 100644 --- a/src/lib/wizards/functions/createManual.svelte +++ b/src/lib/wizards/functions/createManual.svelte @@ -21,34 +21,43 @@ import ExecuteAccess from './steps/executeAccess.svelte'; async function create() { - const response = await sdk.forProject.functions.create( - $createFunction.$id || ID.unique(), - $createFunction.name, - $createFunction.runtime, - $createFunction.entrypoint, - $createFunction.execute || undefined, - undefined, - undefined, - undefined, - undefined, - undefined, - $createFunction.commands || undefined - ); - await sdk.forProject.functions.createDeployment( - response.$id, - $createFunctionDeployment[0], - true - ); - goto(`${base}/console/project-${$page.params.project}/functions/function-${response.$id}`); - addNotification({ - message: `${$createFunction.name} has been created`, - type: 'success' - }); - trackEvent(Submit.FunctionCreate, { - customId: !!$createFunction.$id - }); - resetState(); - wizard.hide(); + try { + const response = await sdk.forProject.functions.create( + $createFunction.$id || ID.unique(), + $createFunction.name, + $createFunction.runtime, + $createFunction.entrypoint, + $createFunction.execute || undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + $createFunction.commands || undefined + ); + await sdk.forProject.functions.createDeployment( + response.$id, + $createFunctionDeployment[0], + true + ); + goto( + `${base}/console/project-${$page.params.project}/functions/function-${response.$id}` + ); + addNotification({ + message: `${$createFunction.name} has been created`, + type: 'success' + }); + trackEvent(Submit.FunctionCreate, { + customId: !!$createFunction.$id + }); + resetState(); + wizard.hide(); + } catch (error) { + addNotification({ + message: error.message, + type: 'error' + }); + } } function resetState() { diff --git a/src/routes/console/project-[project]/functions/+layout.ts b/src/routes/console/project-[project]/functions/+layout.ts index eb22ec923..7fb46f02c 100644 --- a/src/routes/console/project-[project]/functions/+layout.ts +++ b/src/routes/console/project-[project]/functions/+layout.ts @@ -11,6 +11,6 @@ export const load: LayoutLoad = async ({ depends }) => { return { header: Header, breadcrumbs: Breadcrumbs, - installations: await sdk.forProject.vcs.listInstallations([Query.limit(100)]) + installations: sdk.forProject.vcs.listInstallations([Query.limit(100)]) }; }; diff --git a/src/routes/console/project-[project]/functions/function-[function]/+layout.ts b/src/routes/console/project-[project]/functions/function-[function]/+layout.ts index a02943cf4..b5792bfda 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+layout.ts +++ b/src/routes/console/project-[project]/functions/function-[function]/+layout.ts @@ -13,8 +13,8 @@ export const load: LayoutLoad = async ({ params, depends }) => { return { header: Header, breadcrumbs: Breadcrumbs, - function: await sdk.forProject.functions.get(params.function), - domain: await sdk.forProject.proxy.listRules([ + function: sdk.forProject.functions.get(params.function), + domain: sdk.forProject.proxy.listRules([ Query.equal('resourceType', 'function'), Query.equal('resourceId', params.function), Query.limit(1) 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 f99fcec63..0e6e0c743 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -116,7 +116,7 @@
    {data.domain.rules[0].domain} diff --git a/src/routes/console/project-[project]/functions/function-[function]/redeployModal.svelte b/src/routes/console/project-[project]/functions/function-[function]/redeployModal.svelte index 7c785d58d..4716fe0f2 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/redeployModal.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/redeployModal.svelte @@ -21,7 +21,7 @@ ); addNotification({ type: 'success', - message: `${$func.name} has been redeployed.` + message: `Redeploying ${$func.name}` }); trackEvent(Submit.FunctionRedeploy); From f38d5fabaa18c005864c0b57245a75a85ce6b50e Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:55:39 +0200 Subject: [PATCH 04/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 774ff4de1..841712fd2 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -2,7 +2,7 @@ export const marketplace = [ { icon: 'icon-lightning-bolt', id: 'starter', - name: 'Starter', + name: 'Starter function', tagline: 'A simple function. Create something awesome! 🚀', permissions: ['any'], events: [], From b39cb4353aff66ee5932cab7f7c7f8f93c113271 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:56:01 +0200 Subject: [PATCH 05/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 841712fd2..17ac0e7cb 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -265,7 +265,7 @@ export const marketplace = [ { icon: 'icon-bookmark', id: 'url-shortener', - name: 'URL Shortener', + name: 'URL shortener', tagline: 'Generate URL with short ID and redirect to the original URL when visited.', permissions: ['any'], events: [], From e6c1b468027f97c6d54ee9da63ca6678c24584f1 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:56:13 +0200 Subject: [PATCH 06/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 17ac0e7cb..6d3b2b035 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -224,7 +224,7 @@ export const marketplace = [ { icon: 'icon-github', id: 'github-issue-bot', - name: 'GitHub Issue Bot', + name: 'GitHub issue bot', tagline: 'Automate the process of responding to newly opened issues on a GitHub repository.', permissions: ['any'], From fa1d130bb7d5d56bd3e7babe24f6d585cda8142a Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:56:22 +0200 Subject: [PATCH 07/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 6d3b2b035..a605e98d3 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -191,7 +191,7 @@ export const marketplace = [ { icon: 'icon-discord', id: 'discord-command-bot', - name: 'Discord Command Bot', + name: 'Discord command bot', tagline: 'Simple command using Discord Interactions.', permissions: ['any'], events: [], From f242f7103e125f912f47395b1788df5d213cc1fb Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:56:32 +0200 Subject: [PATCH 08/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index a605e98d3..7882791f0 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -567,7 +567,7 @@ export const marketplace = [ { icon: 'icon-mail', id: 'email-contact-form', - name: 'Email Contact Form', + name: 'Email contact form', tagline: 'Sends an email with the contents of a HTML form.', permissions: ['any'], events: [], From ec095668c2e08373fd1aa08a453bf2bf3b4afe7e Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:57:37 +0200 Subject: [PATCH 09/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 7882791f0..452c7bb8e 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -3,7 +3,7 @@ export const marketplace = [ icon: 'icon-lightning-bolt', id: 'starter', name: 'Starter function', - tagline: 'A simple function. Create something awesome! 🚀', + tagline: 'A simple function to get started. Edit this function to explore endless possibilities with Appwrite Functions. 🚀', permissions: ['any'], events: [], cron: '', From 15b228a58503db9711659ecca00b695eee4b17ef Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:57:51 +0200 Subject: [PATCH 10/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 452c7bb8e..52373b733 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -60,7 +60,7 @@ export const marketplace = [ icon: 'icon-open-ai', id: 'prompt-chatgpt', name: 'Prompt ChatGPT', - tagline: 'Ask question, and let OpenAI GPT-3.5-turbo answer.', + tagline: 'Ask questions and let OpenAI GPT-3.5-turbo answer.', permissions: ['any'], events: [], cron: '', From 8b356b80e588cc7e3051a5e1031bfaad4cfabff3 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 17:58:07 +0200 Subject: [PATCH 11/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 52373b733..3699961ba 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -82,7 +82,7 @@ export const marketplace = [ variables: [ { name: 'OPENAI_API_KEY', - description: `A unique key used to authenticate with the OpenAI API. Please note that this is a paid service and you will be charged for each request made to the API. Learn More`, + description: `A unique key used to authenticate with the OpenAI API. This is a paid service and you will be charged for each request made to the API. Learn more.`, value: '', placeholder: 'sk-wzG...vcy', required: true From a8a7e2baa4dcb55f7bc52e417188c213278cf9d8 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 18:00:37 +0200 Subject: [PATCH 12/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 3699961ba..ed4f07950 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -89,7 +89,7 @@ export const marketplace = [ }, { name: 'OPENAI_MAX_TOKENS', - description: `The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens. Learn More`, + description: `The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens. Learn more.`, value: '512', placeholder: '512', required: false From 102aedcac1aff8b63f29b8591b345d6dff2ecbcf Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 18:02:15 +0200 Subject: [PATCH 13/18] fix: copy --- src/lib/stores/marketplace.ts | 69 ++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index ed4f07950..8d6d32993 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -3,7 +3,8 @@ export const marketplace = [ icon: 'icon-lightning-bolt', id: 'starter', name: 'Starter function', - tagline: 'A simple function to get started. Edit this function to explore endless possibilities with Appwrite Functions. 🚀', + tagline: + 'A simple function to get started. Edit this function to explore endless possibilities with Appwrite Functions. 🚀', permissions: ['any'], events: [], cron: '', @@ -49,7 +50,7 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn More`, + description: `The API Key to talk to Appwrite backend APIs. Learn more`, value: '', placeholder: 'd1efb...aec35', required: false @@ -122,7 +123,7 @@ export const marketplace = [ variables: [ { name: 'PERSPECTIVE_API_KEY', - description: `Google Perspective API key. It authenticates your function, allowing it to interact with the API. Learn More`, + description: `Google Perspective API key. It authenticates your function, allowing it to interact with the API. Learn more`, value: '', placeholder: 'AIzaS...fk-fuM', required: true @@ -156,7 +157,7 @@ export const marketplace = [ variables: [ { name: 'PANGEA_REDACT_TOKEN', - description: `Access token for the Pangea Redact API. Learn More`, + description: `Access token for the Pangea Redact API. Learn more`, value: '', placeholder: 'pts_7p4...5wl4', required: true @@ -214,7 +215,7 @@ export const marketplace = [ variables: [ { name: 'DISCORD_PUBLIC_KEY', - description: `Discord Public Key to verify request signature. Learn More`, + description: `Discord Public Key to verify request signature. Learn more`, value: '', placeholder: 'd1efb...aec35', required: true @@ -248,14 +249,14 @@ export const marketplace = [ variables: [ { name: 'GITHUB_TOKEN', - description: `A personal access token from GitHub with the necessary permissions to post comments on issues. Learn More`, + description: `A personal access token from GitHub with the necessary permissions to post comments on issues. Learn more`, value: '', placeholder: 'ghp_1...', required: true }, { name: 'GITHUB_WEBHOOK_SECRET', - description: `The secret used to verify that the webhook request comes from GitHub. Learn More`, + description: `The secret used to verify that the webhook request comes from GitHub. Learn more`, value: '', placeholder: 'd1efb...aec35', required: true @@ -288,28 +289,28 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn More`, + description: `The API Key to talk to Appwrite backend APIs. Learn more`, value: '', placeholder: 'd1efb...aec35', required: true }, { name: 'APPWRITE_ENDPOINT', - description: `The URL endpoint of the Appwrite server. Learn More`, + description: `The URL endpoint of the Appwrite server. Learn more`, value: 'https://cloud.appwrite.io/v1', placeholder: 'https://cloud.appwrite.io/v1', required: false }, { name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database to store the short URLs. Learn More`, + description: `The ID of the database to store the short URLs. Learn more`, value: 'urlShortener', placeholder: 'urlShortener', required: false }, { name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection to store the short URLs. Learn More`, + description: `The ID of the collection to store the short URLs. Learn more`, value: 'urls', placeholder: 'urls', required: false @@ -342,44 +343,44 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn More`, + description: `The API Key to talk to Appwrite backend APIs. Learn more`, value: '', placeholder: 'd1efb...aec35', required: true }, { name: 'APPWRITE_DATABASE_ID', - description: `The ID of the Appwrite database that contains the collection to sync. Learn More`, + description: `The ID of the Appwrite database that contains the collection to sync. Learn more`, placeholder: '64a55...7b912', required: true }, { name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection in the Appwrite database to sync. Learn More`, + description: `The ID of the collection in the Appwrite database to sync. Learn more`, placeholder: '7c3e8...2a9f1', required: true }, { name: 'ALGOLIA_ADMIN_API_KEY', - description: `The admin API Key for your Algolia service. Learn More`, + description: `The admin API Key for your Algolia service. Learn more`, placeholder: 'fd0aa...136a8', required: true }, { name: 'ALGOLIA_INDEX_ID', - description: `The ID of the index in Algolia where the documents are to be synced. Learn More`, + description: `The ID of the index in Algolia where the documents are to be synced. Learn more`, placeholder: 'appwrite_index', required: true }, { name: 'ALGOLIA_SEARCH_API_KEY', - description: `The search API Key for your Algolia service. This key is used for searching the synced index. Learn More`, + description: `The search API Key for your Algolia service. This key is used for searching the synced index. Learn more`, placeholder: 'bf2f5...df733', required: true }, { name: 'APPWRITE_ENDPOINT', - description: `The URL endpoint of the Appwrite server. Learn More`, + description: `The URL endpoint of the Appwrite server. Learn more`, value: 'https://cloud.appwrite.io/v1', placeholder: 'https://cloud.appwrite.io/v1', required: false @@ -412,50 +413,50 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn More`, + description: `The API Key to talk to Appwrite backend APIs. Learn more`, value: '', placeholder: 'd1efb...aec35', required: true }, { name: 'APPWRITE_DATABASE_ID', - description: `The ID of the Appwrite database that contains the collection to sync. Learn More`, + description: `The ID of the Appwrite database that contains the collection to sync. Learn more`, placeholder: '64a55...7b912', required: true }, { name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection in the Appwrite database to sync. Learn More`, + description: `The ID of the collection in the Appwrite database to sync. Learn more`, placeholder: '7c3e8...2a9f1', required: true }, { name: 'MEILISEARCH_ENDPOINT', - description: `The host URL of the Meilisearch server. Learn More`, + description: `The host URL of the Meilisearch server. Learn more`, placeholder: 'http://127.0.0.1:7700', required: true }, { name: 'MEILISEARCH_ADMIN_API_KEY', - description: `The admin API key for Meilisearch. Learn More`, + description: `The admin API key for Meilisearch. Learn more`, placeholder: 'masterKey1234', required: true }, { name: 'MEILISEARCH_SEARCH_API_KEY', - description: `API Key for Meilisearch search operations. Learn More`, + description: `API Key for Meilisearch search operations. Learn more`, placeholder: 'searchKey1234', required: true }, { name: 'MEILISEARCH_INDEX_NAME', - description: `Name of the Meilisearch index to which the documents will be synchronized. Learn More`, + description: `Name of the Meilisearch index to which the documents will be synchronized. Learn more`, placeholder: 'appwrite_index', required: true }, { name: 'APPWRITE_ENDPOINT', - description: `The URL endpoint of the Appwrite server. Learn More`, + description: `The URL endpoint of the Appwrite server. Learn more`, value: 'https://cloud.appwrite.io/v1', placeholder: 'https://cloud.appwrite.io/v1', required: false @@ -488,26 +489,26 @@ export const marketplace = [ variables: [ { name: 'VONAGE_API_KEY', - description: `API Key to use the Vonage API. Learn More`, + description: `API Key to use the Vonage API. Learn more`, value: '', placeholder: '62...97', required: true }, { name: 'VONAGE_API_SECRET', - description: `Secret to use the Vonage API. Learn More`, + description: `Secret to use the Vonage API. Learn more`, placeholder: 'Zjc...5PH', required: true }, { name: 'VONAGE_API_SIGNATURE_SECRET', - description: `Secret to verify the JWT token sent by Vonage. Learn More`, + description: `Secret to verify the JWT token sent by Vonage. Learn more`, placeholder: 'NXOi3...IBHDa', required: true }, { name: 'VONAGE_WHATSAPP_NUMBER', - description: `Vonage WhatsApp number to send messages from. Learn More`, + description: `Vonage WhatsApp number to send messages from. Learn more`, placeholder: '+14000000102', required: true } @@ -539,26 +540,26 @@ export const marketplace = [ variables: [ { name: 'FCM_PROJECT_ID', - description: `A unique identifier for your FCM project. Learn More`, + description: `A unique identifier for your FCM project. Learn more`, value: '', placeholder: 'mywebapp-f6e57', required: true }, { name: 'FCM_CLIENT_EMAIL', - description: `Your FCM service account email. Learn More`, + description: `Your FCM service account email. Learn more`, placeholder: 'fcm-adminsdk-2f0de@test-f7q57.iam.gserviceaccount.com', required: true }, { name: 'FCM_PRIVATE_KEY', - description: `A unique private key used to authenticate with FCM. Learn More`, + description: `A unique private key used to authenticate with FCM. Learn more`, placeholder: '0b683...75675', required: true }, { name: 'FCM_DATABASE_URL', - description: `URL of your FCM database. Learn More`, + description: `URL of your FCM database. Learn more`, placeholder: 'https://my-app-f298e.firebaseio.com', required: true } From 972b45e69ac84ef85a6f77673b3101c52ba4955c Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 18:03:54 +0200 Subject: [PATCH 14/18] fix: copy --- src/lib/stores/marketplace.ts | 66 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 8d6d32993..0f9d06bda 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -50,7 +50,7 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn more`, + description: `The API Key to talk to Appwrite backend APIs. Learn more.`, value: '', placeholder: 'd1efb...aec35', required: false @@ -123,7 +123,7 @@ export const marketplace = [ variables: [ { name: 'PERSPECTIVE_API_KEY', - description: `Google Perspective API key. It authenticates your function, allowing it to interact with the API. Learn more`, + description: `Google Perspective API key. It authenticates your function, allowing it to interact with the API. Learn more.`, value: '', placeholder: 'AIzaS...fk-fuM', required: true @@ -157,7 +157,7 @@ export const marketplace = [ variables: [ { name: 'PANGEA_REDACT_TOKEN', - description: `Access token for the Pangea Redact API. Learn more`, + description: `Access token for the Pangea Redact API. Learn more.`, value: '', placeholder: 'pts_7p4...5wl4', required: true @@ -215,7 +215,7 @@ export const marketplace = [ variables: [ { name: 'DISCORD_PUBLIC_KEY', - description: `Discord Public Key to verify request signature. Learn more`, + description: `Discord Public Key to verify request signature. Learn more.`, value: '', placeholder: 'd1efb...aec35', required: true @@ -249,14 +249,14 @@ export const marketplace = [ variables: [ { name: 'GITHUB_TOKEN', - description: `A personal access token from GitHub with the necessary permissions to post comments on issues. Learn more`, + description: `A personal access token from GitHub with the necessary permissions to post comments on issues. Learn more.`, value: '', placeholder: 'ghp_1...', required: true }, { name: 'GITHUB_WEBHOOK_SECRET', - description: `The secret used to verify that the webhook request comes from GitHub. Learn more`, + description: `The secret used to verify that the webhook request comes from GitHub. Learn more.`, value: '', placeholder: 'd1efb...aec35', required: true @@ -289,28 +289,28 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn more`, + description: `The API Key to talk to Appwrite backend APIs. Learn more.`, value: '', placeholder: 'd1efb...aec35', required: true }, { name: 'APPWRITE_ENDPOINT', - description: `The URL endpoint of the Appwrite server. Learn more`, + description: `The URL endpoint of the Appwrite server. Learn more.`, value: 'https://cloud.appwrite.io/v1', placeholder: 'https://cloud.appwrite.io/v1', required: false }, { name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database to store the short URLs. Learn more`, + description: `The ID of the database to store the short URLs. Learn more.`, value: 'urlShortener', placeholder: 'urlShortener', required: false }, { name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection to store the short URLs. Learn more`, + description: `The ID of the collection to store the short URLs. Learn more.`, value: 'urls', placeholder: 'urls', required: false @@ -343,44 +343,44 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn more`, + description: `The API Key to talk to Appwrite backend APIs. Learn more.`, value: '', placeholder: 'd1efb...aec35', required: true }, { name: 'APPWRITE_DATABASE_ID', - description: `The ID of the Appwrite database that contains the collection to sync. Learn more`, + description: `The ID of the Appwrite database that contains the collection to sync. Learn more.`, placeholder: '64a55...7b912', required: true }, { name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection in the Appwrite database to sync. Learn more`, + description: `The ID of the collection in the Appwrite database to sync. Learn more.`, placeholder: '7c3e8...2a9f1', required: true }, { name: 'ALGOLIA_ADMIN_API_KEY', - description: `The admin API Key for your Algolia service. Learn more`, + description: `The admin API Key for your Algolia service. Learn more.`, placeholder: 'fd0aa...136a8', required: true }, { name: 'ALGOLIA_INDEX_ID', - description: `The ID of the index in Algolia where the documents are to be synced. Learn more`, + description: `The ID of the index in Algolia where the documents are to be synced. Learn more.`, placeholder: 'appwrite_index', required: true }, { name: 'ALGOLIA_SEARCH_API_KEY', - description: `The search API Key for your Algolia service. This key is used for searching the synced index. Learn more`, + description: `The search API Key for your Algolia service. This key is used for searching the synced index. Learn more.`, placeholder: 'bf2f5...df733', required: true }, { name: 'APPWRITE_ENDPOINT', - description: `The URL endpoint of the Appwrite server. Learn more`, + description: `The URL endpoint of the Appwrite server. Learn more.`, value: 'https://cloud.appwrite.io/v1', placeholder: 'https://cloud.appwrite.io/v1', required: false @@ -413,50 +413,50 @@ export const marketplace = [ variables: [ { name: 'APPWRITE_API_KEY', - description: `The API Key to talk to Appwrite backend APIs. Learn more`, + description: `The API Key to talk to Appwrite backend APIs. Learn more.`, value: '', placeholder: 'd1efb...aec35', required: true }, { name: 'APPWRITE_DATABASE_ID', - description: `The ID of the Appwrite database that contains the collection to sync. Learn more`, + description: `The ID of the Appwrite database that contains the collection to sync. Learn more.`, placeholder: '64a55...7b912', required: true }, { name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection in the Appwrite database to sync. Learn more`, + description: `The ID of the collection in the Appwrite database to sync. Learn more.`, placeholder: '7c3e8...2a9f1', required: true }, { name: 'MEILISEARCH_ENDPOINT', - description: `The host URL of the Meilisearch server. Learn more`, + description: `The host URL of the Meilisearch server. Learn more.`, placeholder: 'http://127.0.0.1:7700', required: true }, { name: 'MEILISEARCH_ADMIN_API_KEY', - description: `The admin API key for Meilisearch. Learn more`, + description: `The admin API key for Meilisearch. Learn more.`, placeholder: 'masterKey1234', required: true }, { name: 'MEILISEARCH_SEARCH_API_KEY', - description: `API Key for Meilisearch search operations. Learn more`, + description: `API Key for Meilisearch search operations. Learn more.`, placeholder: 'searchKey1234', required: true }, { name: 'MEILISEARCH_INDEX_NAME', - description: `Name of the Meilisearch index to which the documents will be synchronized. Learn more`, + description: `Name of the Meilisearch index to which the documents will be synchronized. Learn more.`, placeholder: 'appwrite_index', required: true }, { name: 'APPWRITE_ENDPOINT', - description: `The URL endpoint of the Appwrite server. Learn more`, + description: `The URL endpoint of the Appwrite server. Learn more.`, value: 'https://cloud.appwrite.io/v1', placeholder: 'https://cloud.appwrite.io/v1', required: false @@ -489,26 +489,26 @@ export const marketplace = [ variables: [ { name: 'VONAGE_API_KEY', - description: `API Key to use the Vonage API. Learn more`, + description: `API Key to use the Vonage API. Learn more.`, value: '', placeholder: '62...97', required: true }, { name: 'VONAGE_API_SECRET', - description: `Secret to use the Vonage API. Learn more`, + description: `Secret to use the Vonage API. Learn more.`, placeholder: 'Zjc...5PH', required: true }, { name: 'VONAGE_API_SIGNATURE_SECRET', - description: `Secret to verify the JWT token sent by Vonage. Learn more`, + description: `Secret to verify the JWT token sent by Vonage. Learn more.`, placeholder: 'NXOi3...IBHDa', required: true }, { name: 'VONAGE_WHATSAPP_NUMBER', - description: `Vonage WhatsApp number to send messages from. Learn more`, + description: `Vonage WhatsApp number to send messages from. Learn more.`, placeholder: '+14000000102', required: true } @@ -540,26 +540,26 @@ export const marketplace = [ variables: [ { name: 'FCM_PROJECT_ID', - description: `A unique identifier for your FCM project. Learn more`, + description: `A unique identifier for your FCM project. Learn more.`, value: '', placeholder: 'mywebapp-f6e57', required: true }, { name: 'FCM_CLIENT_EMAIL', - description: `Your FCM service account email. Learn more`, + description: `Your FCM service account email. Learn more.`, placeholder: 'fcm-adminsdk-2f0de@test-f7q57.iam.gserviceaccount.com', required: true }, { name: 'FCM_PRIVATE_KEY', - description: `A unique private key used to authenticate with FCM. Learn more`, + description: `A unique private key used to authenticate with FCM. Learn more.`, placeholder: '0b683...75675', required: true }, { name: 'FCM_DATABASE_URL', - description: `URL of your FCM database. Learn more`, + description: `URL of your FCM database. Learn more.`, placeholder: 'https://my-app-f298e.firebaseio.com', required: true } From e6f7cd64409a1175ea5e52b54373105c8f1b18fa Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 18:04:31 +0200 Subject: [PATCH 15/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index 0f9d06bda..f5a15e9b8 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -135,7 +135,7 @@ export const marketplace = [ id: 'censor-with-redact', name: 'Censor with Redact', tagline: - 'Cesnor sensitive information from a provided text string using Redact API by Pangea.', + 'Censor sensitive information from a provided text string using Redact API by Pangea.', permissions: ['any'], events: [], cron: '', From ceeafa87653183bf8eebb9869591cd96db5f1a4a Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 18:08:40 +0200 Subject: [PATCH 16/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index f5a15e9b8..b8d814b15 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -227,7 +227,7 @@ export const marketplace = [ id: 'github-issue-bot', name: 'GitHub issue bot', tagline: - 'Automate the process of responding to newly opened issues on a GitHub repository.', + 'Automate the process of responding to newly opened issues in a GitHub repository.', permissions: ['any'], events: [], cron: '', From 12abde796c211dc797a40997dad14e9354be8df3 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 16 Aug 2023 18:09:46 +0200 Subject: [PATCH 17/18] Update src/lib/stores/marketplace.ts Co-authored-by: Vincent (Wen Yu) Ge --- src/lib/stores/marketplace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts index b8d814b15..7636674e3 100644 --- a/src/lib/stores/marketplace.ts +++ b/src/lib/stores/marketplace.ts @@ -517,7 +517,7 @@ export const marketplace = [ { icon: 'icon-bell', id: 'push-notification-with-fcm', - name: 'Push Notification with FCM', + name: 'Push notification with FCM', tagline: 'Send push notifications to your users using Firebase Cloud Messaging (FCM).', permissions: ['any'], events: [], From 3ffdd56683969f4ac337dabb6c107532a0636801 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 17 Aug 2023 10:53:00 +0200 Subject: [PATCH 18/18] fix: template variables --- package-lock.json | 2 +- package.json | 4 +- .../wizards/functions/createTemplate.svelte | 23 ++++ .../steps/templateConfiguration.svelte | 6 - .../functions/steps/templateVariables.svelte | 123 +++++------------- src/lib/wizards/functions/store.ts | 1 + 6 files changed, 59 insertions(+), 100 deletions(-) diff --git a/package-lock.json b/package-lock.json index a968c3872..8c3a99105 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@analytics/google-tag-manager": "^0.5.3", "@appwrite.io/console": "npm:matej-appwrite-console@7.1.125", "@appwrite.io/pink": "0.0.7-next.1", - "@appwrite.io/pink-icons": "0.0.7-next.1", + "@appwrite.io/pink-icons": "^0.0.7-next.1", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", "@sentry/tracing": "^7.44.2", diff --git a/package.json b/package.json index dc9714c77..af7df857e 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,10 @@ }, "dependencies": { "@analytics/google-analytics": "^1.0.5", + "@analytics/google-tag-manager": "^0.5.3", "@appwrite.io/console": "npm:matej-appwrite-console@7.1.125", "@appwrite.io/pink": "0.0.7-next.1", - "@appwrite.io/pink-icons": "0.0.7-next.1", - "@analytics/google-tag-manager": "^0.5.3", + "@appwrite.io/pink-icons": "^0.0.7-next.1", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", "@sentry/tracing": "^7.44.2", diff --git a/src/lib/wizards/functions/createTemplate.svelte b/src/lib/wizards/functions/createTemplate.svelte index 5d9fe8a18..992d4ddd6 100644 --- a/src/lib/wizards/functions/createTemplate.svelte +++ b/src/lib/wizards/functions/createTemplate.svelte @@ -53,6 +53,29 @@ wizard.hide(); } + // async function generateApiKey() { + // try { + // const key = await sdk.forConsole.projects.createKey( + // $page.params.project, + // 'Generated for Template', + // scopes.map((scope) => scope.scope) + // ); + // $templateConfig.variables['APPWRITE_API_KEY'] = key.secret; + + // addNotification({ + // type: 'success', + // message: 'Key generated successfully.' + // }); + // } catch (error) { + // addNotification({ + // type: 'error', + // message: error.message + // }); + // } finally { + // generatingApiKey = false; + // } + // } + function resetState() { wizard.hide(); templateConfig.set(null); diff --git a/src/lib/wizards/functions/steps/templateConfiguration.svelte b/src/lib/wizards/functions/steps/templateConfiguration.svelte index 0bd54ed76..56b8efb37 100644 --- a/src/lib/wizards/functions/steps/templateConfiguration.svelte +++ b/src/lib/wizards/functions/steps/templateConfiguration.svelte @@ -12,12 +12,6 @@ if (!$templateConfig.runtime) { throw new Error('Please select a runtime.'); } - - for (const variable of $template.variables) { - if (!variable.required) { - continue; - } - } } async function loadRuntimes() { diff --git a/src/lib/wizards/functions/steps/templateVariables.svelte b/src/lib/wizards/functions/steps/templateVariables.svelte index 52a5a05da..da61d5045 100644 --- a/src/lib/wizards/functions/steps/templateVariables.svelte +++ b/src/lib/wizards/functions/steps/templateVariables.svelte @@ -1,52 +1,10 @@