Date: Fri, 4 Aug 2023 08:00:06 +0200
Subject: [PATCH 044/198] Update icons, add Azure placeholder, WIP
templates&starter
---
package-lock.json | 26 +-
package.json | 6 +-
src/lib/stores/marketplace.ts | 647 ++++++++++++++++++
.../functions/components/repositories.svelte | 4 +
src/lib/wizards/functions/cover.svelte | 161 ++---
...teStarter.svelte => createTemplate.svelte} | 40 +-
.../steps/tempalteFunctionDetails.svelte | 33 +
.../steps/templateConfiguration.svelte | 141 ++++
src/lib/wizards/functions/store.ts | 10 +-
.../settings/gitConfigurationModal.svelte | 7 +-
.../settings/updateConfiguration.svelte | 12 +-
.../settings/GitDisconnectModal.svelte | 69 +-
.../settings/GitInstallationModal.svelte | 4 +
.../settings/updateInstallations.svelte | 4 +-
14 files changed, 1013 insertions(+), 151 deletions(-)
create mode 100644 src/lib/stores/marketplace.ts
rename src/lib/wizards/functions/{createStarter.svelte => createTemplate.svelte} (79%)
create mode 100644 src/lib/wizards/functions/steps/tempalteFunctionDetails.svelte
create mode 100644 src/lib/wizards/functions/steps/templateConfiguration.svelte
diff --git a/package-lock.json b/package-lock.json
index 83910bc2c4..38a74a44ef 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,9 +7,9 @@
"name": "@appwrite/console",
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "npm:matej-appwrite-console@7.1.113",
- "@appwrite.io/pink": "0.0.6-rc.15",
- "@appwrite.io/pink-icons": "0.0.6-rc.15",
+ "@appwrite.io/console": "npm:matej-appwrite-console@7.1.115",
+ "@appwrite.io/pink": "0.0.7-next.0",
+ "@appwrite.io/pink-icons": "0.0.7-next.0",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
"@sentry/tracing": "^7.44.2",
@@ -159,28 +159,28 @@
},
"node_modules/@appwrite.io/console": {
"name": "matej-appwrite-console",
- "version": "7.1.113",
- "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.113.tgz",
- "integrity": "sha512-DEkYOZY5iquEIGiZjHyL64zUlVadnWWcCfqWGDVH470tOss9/r7c9pk5v21Ey+ppYKdInkrzEftr+Xif+bPclg==",
+ "version": "7.1.115",
+ "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.115.tgz",
+ "integrity": "sha512-GwgZ8ujNyaMG6HsKVaAuaIZGFmGDrG46NkBjVz6OJJW5Z9z8fM7y4GBQ/LnsDmmYUnXtGArx8CPyvdUIAiExGA==",
"dependencies": {
"cross-fetch": "3.1.5",
"isomorphic-form-data": "2.0.0"
}
},
"node_modules/@appwrite.io/pink": {
- "version": "0.0.6-rc.15",
- "resolved": "https://registry.npmjs.org/@appwrite.io/pink/-/pink-0.0.6-rc.15.tgz",
- "integrity": "sha512-CLgN+2NLuypmcYEjAlB8sOQyvjloCTKvNHa/flIBOkZKIEH2YX5qWSM/O08GLUuMPWS4Y/+z1U4uIvGOATTiTg==",
+ "version": "0.0.7-next.0",
+ "resolved": "https://registry.npmjs.org/@appwrite.io/pink/-/pink-0.0.7-next.0.tgz",
+ "integrity": "sha512-4J3WEyoX7HPu4Ykc8anmluns6pnjEm/ncVCUDWm0RgmkwKDu3flL+vHIOf37HX4XiAotMQKSRP7+EFptgeoaow==",
"dependencies": {
- "@appwrite.io/pink-icons": "*",
+ "@appwrite.io/pink-icons": "0.0.7-next.0",
"normalize.css": "^8.0.1",
"the-new-css-reset": "^1.7.3"
}
},
"node_modules/@appwrite.io/pink-icons": {
- "version": "0.0.6-rc.15",
- "resolved": "https://registry.npmjs.org/@appwrite.io/pink-icons/-/pink-icons-0.0.6-rc.15.tgz",
- "integrity": "sha512-tMqRYh48RjoL6yJW9pMyUcul9oN4tlOU7XW1Xu7ArmtHuXXoKzNjgPVgksCegkZR/j2M4Lw2HaWf0TGLjCtKmA=="
+ "version": "0.0.7-next.0",
+ "resolved": "https://registry.npmjs.org/@appwrite.io/pink-icons/-/pink-icons-0.0.7-next.0.tgz",
+ "integrity": "sha512-y11hyQHCbdhLDegkOonZNBezZpGJa4Vlku7FE/KslYz4OXcA2j7P8fqdlPUq+7qq0qNjAQGprYVVzPdWUVOR5Q=="
},
"node_modules/@babel/code-frame": {
"version": "7.22.5",
diff --git a/package.json b/package.json
index 777f71f9a7..582d8f582b 100644
--- a/package.json
+++ b/package.json
@@ -19,9 +19,9 @@
},
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "npm:matej-appwrite-console@7.1.113",
- "@appwrite.io/pink": "0.0.6-rc.15",
- "@appwrite.io/pink-icons": "0.0.6-rc.15",
+ "@appwrite.io/console": "npm:matej-appwrite-console@7.1.115",
+ "@appwrite.io/pink": "0.0.7-next.0",
+ "@appwrite.io/pink-icons": "0.0.7-next.0",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
"@sentry/tracing": "^7.44.2",
diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts
new file mode 100644
index 0000000000..3ecd6f6103
--- /dev/null
+++ b/src/lib/stores/marketplace.ts
@@ -0,0 +1,647 @@
+export const marketplace = [
+ {
+ icon: 'icon-lightning-bolt',
+ id: 'starter',
+ name: 'Starter',
+ tagline: 'A simple function. Create something awesome! 🚀',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/starter'
+ },
+ {
+ name: 'php-8.0',
+ commands: 'composer install',
+ entrypoint: 'src/index.php',
+ providerRootDirectory: 'php/starter'
+ },
+ {
+ name: 'ruby-3.0',
+ commands: 'bundle install',
+ entrypoint: 'lib/main.rb',
+ providerRootDirectory: 'ruby/starter'
+ },
+ {
+ name: 'python-3.9',
+ commands: 'pip install -r requirements.txt',
+ entrypoint: 'src/main.py',
+ providerRootDirectory: 'python/starter'
+ },
+ {
+ name: 'dart-2.17',
+ commands: 'dart pub get',
+ entrypoint: 'lib/main.dart',
+ providerRootDirectory: 'dart/starter'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/starter) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: []
+ },
+ {
+ icon: 'icon-open-ai',
+ id: 'prompt-chatgpt',
+ name: 'Prompt ChatGPT',
+ tagline: 'Ask question, and let OpenAI GPT-3.5-turbo answer.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/prompt-chatgpt'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/prompt-chatgpt) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ 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 `,
+ value: '',
+ placeholder: 'sk-wzG...vcy',
+ required: true
+ },
+ {
+ 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 `,
+ value: '512',
+ placeholder: '512',
+ required: false
+ }
+ ]
+ },
+ {
+ icon: 'icon-perspective-api',
+ id: 'analyze-with-perspectiveapi',
+ name: 'Analyze with PerspectiveAPI',
+ tagline: 'Automate moderation by getting toxicity of messages.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/analyze-with-perspectiveapi'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/analyze-with-perspectiveapi) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'PERSPECTIVE_API_KEY',
+ 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
+ }
+ ]
+ },
+ {
+ icon: 'icon-pangea',
+ id: 'censor-with-redact',
+ name: 'Censor with Redact',
+ tagline:
+ 'Cesnor sensitive information from a provided text string using Redact API by Pangea.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/censor-with-redact'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/censor-with-redact) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'PANGEA_REDACT_TOKEN',
+ description: `Access token for the Pangea Redact API.
Learn More `,
+ value: '',
+ placeholder: 'pts_7p4...5wl4',
+ required: true
+ }
+ ]
+ },
+ {
+ icon: 'icon-document',
+ id: 'generate-pdf',
+ name: 'Generate PDF',
+ tagline: 'Document containing sample invoice in PDF format.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/generate-pdf'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/generate-pdf) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: []
+ },
+ {
+ icon: 'icon-discord',
+ id: 'discord-command-bot',
+ name: 'Discord Command Bot',
+ tagline: 'Simple command using Discord Interactions.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install && npm run setup',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/discord-command-bot'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/discord-command-bot) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'DISCORD_PUBLIC_KEY',
+ description: `Discord Public Key to verify request signature.
Learn More `,
+ value: '',
+ placeholder: 'd1efb...aec35',
+ required: true
+ }
+ ]
+ },
+ {
+ icon: 'icon-github',
+ id: 'github-issue-bot',
+ name: 'GitHub Issue Bot',
+ tagline:
+ 'Automate the process of responding to newly opened issues on a GitHub repository.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/github-issue-bot'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/github-issue-bot) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'GITHUB_TOKEN',
+ 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 `,
+ value: '',
+ placeholder: 'd1efb...aec35',
+ required: true
+ }
+ ]
+ },
+ {
+ icon: 'icon-bookmark',
+ id: 'url-shortener',
+ name: 'URL Shortener',
+ tagline: 'Generate URL with short ID and redirect to the original URL when visited.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/url-shortener'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/url-shortener) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'APPWRITE_API_KEY',
+ 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 `,
+ 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 `,
+ value: 'urlShortener',
+ placeholder: 'urlShortener',
+ required: false
+ },
+ {
+ name: 'APPWRITE_COLLECTION_ID',
+ description: `The ID of the collection to store the short URLs.
Learn More `,
+ value: 'urls',
+ placeholder: 'urls',
+ required: false
+ }
+ ]
+ },
+ {
+ icon: 'icon-algolia',
+ id: 'sync-with-algolia',
+ name: 'Sync with Algolia',
+ tagline: 'Intuitive search bar for any data in Appwrite Databases.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/sync-with-algolia'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/sync-with-algolia) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'APPWRITE_API_KEY',
+ 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 `,
+ placeholder: '64a55...7b912',
+ required: true
+ },
+ {
+ name: 'APPWRITE_COLLECTION_ID',
+ 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 `,
+ 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 `,
+ 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 `,
+ placeholder: 'bf2f5...df733',
+ required: true
+ },
+ {
+ name: 'APPWRITE_ENDPOINT',
+ description: `The URL endpoint of the Appwrite server.
Learn More `,
+ value: 'https://cloud.appwrite.io/v1',
+ placeholder: 'https://cloud.appwrite.io/v1',
+ required: false
+ }
+ ]
+ },
+ {
+ icon: 'icon-meilisearch',
+ id: 'sync-with-meilisearch',
+ name: 'Sync with Meilisearch',
+ tagline: 'Intuitive search bar for any data in Appwrite Databases.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/sync-with-meilisearch'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/sync-with-meilisearch) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'APPWRITE_API_KEY',
+ 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 `,
+ placeholder: '64a55...7b912',
+ required: true
+ },
+ {
+ name: 'APPWRITE_COLLECTION_ID',
+ 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 `,
+ placeholder: 'http://127.0.0.1:7700',
+ required: true
+ },
+ {
+ name: 'MEILISEARCH_ADMIN_API_KEY',
+ 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 `,
+ placeholder: 'searchKey1234',
+ required: true
+ },
+ {
+ name: 'MEILISEARCH_INDEX_NAME',
+ 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 `,
+ value: 'https://cloud.appwrite.io/v1',
+ placeholder: 'https://cloud.appwrite.io/v1',
+ required: false
+ }
+ ]
+ },
+ {
+ icon: 'icon-vonage',
+ id: 'whatsapp-with-vonage',
+ name: 'WhatsApp with Vonage',
+ tagline: 'Simple bot to answer WhatsApp messages.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/whatsapp-with-vonage'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/whatsapp-with-vonage) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'VONAGE_API_KEY',
+ 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 `,
+ placeholder: 'Zjc...5PH',
+ required: true
+ },
+ {
+ name: 'VONAGE_API_SIGNATURE_SECRET',
+ 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 `,
+ placeholder: '+14000000102',
+ required: true
+ }
+ ]
+ },
+ {
+ icon: 'icon-bell',
+ id: 'push-notification-with-fcm',
+ name: 'Push Notification with FCM',
+ tagline: 'Send push notifications to your users using Firebase Cloud Messaging (FCM).',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/push-notification-with-fcm'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/push-notification-with-fcm) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'FCM_PROJECT_ID',
+ 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 `,
+ 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 `,
+ placeholder: '0b683...75675',
+ required: true
+ },
+ {
+ name: 'FCM_DATABASE_URL',
+ description: `URL of your FCM database.
Learn More `,
+ placeholder: 'https://my-app-f298e.firebaseio.com',
+ required: true
+ }
+ ]
+ },
+ {
+ icon: 'icon-mail',
+ id: 'email-contact-form',
+ name: 'Email Contact Form',
+ tagline: 'Sends an email with the contents of a HTML form.',
+ permissions: ['any'],
+ events: [],
+ cron: '',
+ timeout: 15,
+ runtimes: [
+ {
+ name: 'node-18.0',
+ commands: 'npm install',
+ entrypoint: 'src/main.js',
+ providerRootDirectory: 'node/email-contact-form'
+ }
+ ],
+ instructions: `For documentation and instructions check out [README.md](https://github.com/appwrite/templates/tree/main/node/email-contact-form) file.`,
+ vcsProvider: 'github',
+ providerRepositoryId: 'templates',
+ providerOwner: 'appwrite',
+ providerBranch: 'main',
+ variables: [
+ {
+ name: 'SMTP_HOST',
+ description: `The address of your SMTP server. Many STMP providers will provide this information in their documentation. Some popular providers include: Mailgun, SendGrid, and Gmail.`,
+ value: '',
+ placeholder: 'smtp.mailgun.org',
+ required: true
+ },
+ {
+ name: 'SMTP_PORT',
+ description: `The port of your STMP server. Commnly used ports include 25, 465, and 587.`,
+ placeholder: '25',
+ required: true
+ },
+ {
+ name: 'SMTP_USERNAME',
+ description: `The username for your SMTP server. This is commonly your email address.`,
+ placeholder: 'no-reply@mywebapp.org',
+ required: true
+ },
+ {
+ name: 'SMTP_PASSWORD',
+ description: `The password for your SMTP server.`,
+ placeholder: '5up3r5tr0ngP4ssw0rd',
+ required: true
+ },
+ {
+ name: 'SUBMIT_EMAIL',
+ description: `The email address to send form submissions to.`,
+ placeholder: 'me@mywebapp.org',
+ required: true
+ },
+ {
+ name: 'ALLOWED_ORIGINS',
+ description: `An optional comma-separated list of allowed origins for CORS (defaults to *). This is an important security measure to prevent malicious users from abusing your function.`,
+ value: '',
+ placeholder: 'https://mywebapp.org,https://mywebapp.com',
+ required: false
+ }
+ ]
+ }
+];
+
+export type MarketplaceTemplate = (typeof marketplace)[number];
+
+/*
+Template:
+ {
+ "icon": "algolia",
+ "id": "sync-with-algolia",
+ "name": "Sync with Algolia",
+ "tagline": "Search your Appwrite Database with Algolia.",
+ "permissions": ["any"],
+ "events": [ "users.*.create" ],
+ "cron": "0 * * * *",
+ "timeout": 15,
+ "runtimes": [
+ {
+ "name": "node-18",
+ "entrypoint": "src/main.js",
+ "commands": "npm install"
+ }
+ ],
+ "instructions": "# Some markdown stuff",
+ "vcsProvider": "github",
+ "vcsRepositoryName": "templates-for-node",
+ "vcsOwnerName": "loks0n",
+ "vcsRootDirectory": "sync-with-algolia",
+ "variables": [
+ {
+ "name": "ALGOLIA_API_KEY",
+ "description": "Algolia read-write API key.",
+ "value": "",
+ "placeholder": "sk_1df...h9jef",
+ "required": true
+ }
+ ]
+ }
+*/
diff --git a/src/lib/wizards/functions/components/repositories.svelte b/src/lib/wizards/functions/components/repositories.svelte
index 12320aa96d..0637e336f0 100644
--- a/src/lib/wizards/functions/components/repositories.svelte
+++ b/src/lib/wizards/functions/components/repositories.svelte
@@ -191,5 +191,9 @@
BitBucket (coming soon)
+
+
+ Azure (coming soon)
+
{/if}
diff --git a/src/lib/wizards/functions/cover.svelte b/src/lib/wizards/functions/cover.svelte
index 866326c978..8113734fae 100644
--- a/src/lib/wizards/functions/cover.svelte
+++ b/src/lib/wizards/functions/cover.svelte
@@ -8,68 +8,44 @@
import type { Models } from '@appwrite.io/console';
import Repositories from './components/repositories.svelte';
import CreateManual from './createManual.svelte';
- import { repository } from './store';
+ import { repository, templateConfig, template as templateStore } from './store';
import CreateGit from './createGit.svelte';
+ import { marketplace, type MarketplaceTemplate } from '$lib/stores/marketplace';
+ import { sdk } from '$lib/stores/sdk';
+ import CreateTemplate from './createTemplate.svelte';
let hasInstallations;
let selectedRepository;
- const quickStarts: {
- name: string;
- icon: string;
- }[] = [
- {
- icon: 'dart',
- name: 'Dart'
- },
- {
- icon: 'node',
- name: 'Node.js'
- },
- {
- icon: 'php',
- name: 'PHP'
- },
- {
- icon: 'python',
- name: 'Python'
- },
- {
- icon: 'swift',
- name: 'Swift'
- },
- {
- icon: 'ruby',
- name: 'Ruby'
- }
- ];
-
- const templates: {
- name: string;
- description: string;
- icon: string;
- }[] = [
- {
- name: 'URL shortener',
- description: 'Shorten URLs using Bitly',
- icon: 'python'
- },
- {
- name: 'URL shortener',
- description: 'Shorten URLs using Bitly',
- icon: 'dart'
- },
- {
- name: 'URL shortener',
- description: 'Shorten URLs using Bitly',
- icon: 'node'
- }
- ];
+ const quickStart = marketplace.find((template) => template.id === 'starter');
+ const templates = marketplace
+ .filter((template) => template.id !== 'starter')
+ .filter((_template, index) => index < 3);
- function connect(event: CustomEvent