diff --git a/package.json b/package.json index 54ab19d1d..345bed379 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@0.6.10", + "@appwrite.io/console": "npm:matej-appwrite-console@0.6.13", "@appwrite.io/pink": "0.25.0", "@appwrite.io/pink-icons": "0.25.0", "@popperjs/core": "^2.11.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd6f98cee..d89979a2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@appwrite.io/console': - specifier: npm:matej-appwrite-console@0.6.10 - version: matej-appwrite-console@0.6.10 + specifier: npm:matej-appwrite-console@0.6.13 + version: matej-appwrite-console@0.6.13 '@appwrite.io/pink': specifier: 0.25.0 version: 0.25.0 @@ -2164,8 +2164,8 @@ packages: makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} - matej-appwrite-console@0.6.10: - resolution: {integrity: sha512-gaeMHwp23uPcuBWe4/4nCNTyY81GAyyCsLFLwOom9Gl6m+VRwr7hgsz9wqoCfHfHA09nAAT3Vp9jFZoQ+WIeZQ==} + matej-appwrite-console@0.6.13: + resolution: {integrity: sha512-F15YP98n9Um809SN3wbyZun8ZFY/m5MEU2uWUUU+4ej+PI0af3YGhwnkYC1nmciKpDbILf8O4hQ1+ORXKho8hg==} mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} @@ -5602,7 +5602,7 @@ snapshots: dependencies: tmpl: 1.0.5 - matej-appwrite-console@0.6.10: {} + matej-appwrite-console@0.6.13: {} mdn-data@2.0.30: {} diff --git a/src/lib/stores/marketplace.ts b/src/lib/stores/marketplace.ts deleted file mode 100644 index 49566f268..000000000 --- a/src/lib/stores/marketplace.ts +++ /dev/null @@ -1,2329 +0,0 @@ -type TemplateRuntime = { - name: string; - versions: string[]; -}; - -const TemplateRuntimes = { - NODE: { name: 'node', versions: ['21.0', '20.0', '19.0', '18.0', '16.0', '14.5'] }, - PHP: { name: 'php', versions: ['8.3', '8.2', '8.1', '8.0'] }, - RUBY: { name: 'ruby', versions: ['3.3', '3.2', '3.1', '3.0'] }, - PYTHON: { name: 'python', versions: ['3.12', '3.11', '3.10', '3.9', '3.8'] }, - DART: { name: 'dart', versions: ['3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16', '2.16'] }, - BUN: { name: 'bun', versions: ['1.0'] }, - GO: { name: 'go', versions: ['1.22'] } -}; - -const getRuntimes = ( - runtime: TemplateRuntime, - commands: string, - entrypoint: string, - providerRootDirectory: string, - versionsDenyList: string[] = [] -) => { - return runtime.versions - .filter((version) => !versionsDenyList.includes(version)) - .map((version) => { - return { - name: `${runtime.name}-${version}`, - commands, - entrypoint, - providerRootDirectory - }; - }); -}; - -export const marketplace: MarketplaceTemplate[] = [ - { - 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.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Starter'], - runtimes: [ - ...getRuntimes(TemplateRuntimes.NODE, 'npm install', 'src/main.js', 'node/starter'), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/starter' - ), - ...getRuntimes(TemplateRuntimes.DART, 'dart pub get', 'lib/main.dart', 'dart/starter'), - ...getRuntimes( - TemplateRuntimes.PHP, - 'composer install', - 'src/index.php', - 'php/starter' - ), - ...getRuntimes(TemplateRuntimes.BUN, 'bun install', 'src/main.ts', 'bun/starter'), - ...getRuntimes(TemplateRuntimes.GO, '', 'main.go', 'go/starter'), - ...getRuntimes(TemplateRuntimes.RUBY, 'bundle install', 'lib/main.rb', 'ruby/starter') - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: false, - type: 'password' - } - ], - scopes: ['functions.read', 'functions.write', 'documents.write'] - }, - { - icon: 'icon-upstash', - id: 'query-upstash-vector', - name: 'Query Upstash Vector', - tagline: 'Vector database that stores text embeddings and context retrieval for LLMs', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/query-upstash-vector' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'UPSTASH_URL', - description: `The endpoint to connect to your Upstash Vector database. Learn more.`, - value: '', - placeholder: 'https://resolved-mallard-84564-eu1-vector.upstash.io', - required: true, - type: 'text' - }, - { - name: 'UPSTASH_TOKEN', - description: `Authentication token to access your Upstash Vector database. Learn more.`, - value: '', - placeholder: - 'oe4wNTbwHVLcDNa6oceZfhBEABsCNYh43ii6Xdq4bKBH7mq7qJkUmc4cs3ABbYyuVKWZTxVQjiNjYgydn2dkhABNes4NAuDpj7qxUAmZYqGJT78', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-redis', - id: 'query-redis-labs', - name: 'Query Redis Labs', - tagline: 'Key-value database with advanced caching capabilities.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/query-redis-labs' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'REDIS_HOST', - description: `The endpoint to connect to your Redis database. Learn more.`, - value: '', - placeholder: 'redis-13258.c35.eu-central-1-1.ec2.redns.redis-cloud.com', - required: true, - type: 'text' - }, - { - name: 'REDIS_PASSWORD', - description: `Authentication password to access your Redis database. Learn more.`, - value: '', - placeholder: 'efNNehiACfcZiwsTAjcK6xiwPyu6Dpdq', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-neo4j', - id: 'query-neo4j-auradb', - name: 'Query Neo4j AuraDB', - tagline: 'Graph database with focus on relations between data.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/query-neo4j-auradb' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'NEO4J_URI', - description: `The endpoint to connect to your Neo4j database. Learn more.`, - value: '', - placeholder: 'neo4j+s://4tg4mddo.databases.neo4j.io', - required: true, - type: 'text' - }, - { - name: 'NEO4J_USER', - description: `Authentication user to access your Neo4j database. Learn more.`, - value: '', - placeholder: 'neo4j', - required: true, - type: 'text' - }, - { - name: 'NEO4J_PASSWORD', - description: `Authentication password to access your Neo4j database. Learn more.`, - value: '', - placeholder: 'mCUc4PbVUQN-_NkTLJLisb6ccnwzQKKhrkF77YMctzx', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-mongodb', - id: 'query-mongo-atlas', - name: 'Query MongoDB Atlas', - tagline: - 'Realtime NoSQL document database with geospecial, graph, search, and vector suport.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/query-mongo-atlas' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'MONGO_URI', - description: `The endpoint to connect to your Mongo database. Learn more.`, - value: '', - placeholder: - 'mongodb+srv://appwrite:Yx42hafg7Q4fgkxe@cluster0.7mslfog.mongodb.net/?retryWrites=true&w=majority&appName=Appwrite', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-neon', - id: 'query-neon-postgres', - name: 'Query Neon Postgres', - tagline: - 'Reliable SQL database with replication, point-in-time recovery, and pgvector support.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/query-neon-postgres' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'PGHOST', - description: `The endpoint to connect to your Postgres database. Learn more.`, - value: '', - placeholder: 'ep-still-sea-a792sh84.eu-central-1.aws.neon.tech', - required: true, - type: 'text' - }, - { - name: 'PGDATABASE', - description: `Name of our Postgres database. Learn more.`, - value: '', - placeholder: 'main', - required: true, - type: 'text' - }, - { - name: 'PGUSER', - description: `Name of our Postgres user for authentication. Learn more.`, - value: '', - placeholder: 'main_owner', - required: true, - type: 'text' - }, - { - name: 'PGPASSWORD', - description: `Password of our Postgres user for authentication. Learn more.`, - value: '', - placeholder: 'iQCfaUaaWB3B', - required: true, - type: 'password' - }, - { - name: 'ENDPOINT_ID', - description: `Endpoint ID provided for your Postgres database. Learn more.`, - value: '', - placeholder: 'ep-still-sea-a792sh84', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-open-ai', - id: 'prompt-chatgpt', - name: 'Prompt ChatGPT', - tagline: 'Ask questions and let OpenAI GPT-3.5-turbo answer.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/prompt-chatgpt' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/prompt_chatgpt' - ), - ...getRuntimes( - TemplateRuntimes.PHP, - 'composer install', - 'src/index.php', - 'php/prompt-chatgpt' - ), - ...getRuntimes( - TemplateRuntimes.DART, - 'dart pub get', - 'lib/main.dart', - 'dart/prompt_chatgpt' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'OPENAI_API_KEY', - 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, - type: 'password' - }, - { - 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, - type: 'number' - } - ] - }, - { - icon: 'icon-discord', - id: 'discord-command-bot', - name: 'Discord Command Bot', - tagline: 'Simple command using Discord Interactions.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Messaging'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install && npm run setup', - 'src/main.js', - 'node/discord-command-bot' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt && python src/setup.py', - 'src/main.py', - 'python/discord_command_bot' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'DISCORD_PUBLIC_KEY', - description: `Public Key of your application in Discord Developer Portal. Learn more.`, - value: '', - placeholder: 'db9...980', - required: true, - type: 'password' - }, - { - name: 'DISCORD_APPLICATION_ID', - description: `ID of your application in Discord Developer Portal. Learn more.`, - value: '', - placeholder: '427...169', - required: true, - type: 'password' - }, - { - name: 'DISCORD_TOKEN', - description: `Bot token of your application in Discord Developer Portal. Learn more.`, - value: '', - placeholder: 'NDI...LUfg', - required: true, - type: 'password' - } - ] - }, - { - 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, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/analyze-with-perspectiveapi' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - 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, - type: 'password' - } - ] - }, - { - icon: 'icon-pangea', - id: 'censor-with-redact', - name: 'Censor with Redact', - tagline: - 'Censor sensitive information from a provided text string using Redact API by Pangea.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/censor-with-redact' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/censor_with_redact' - ), - ...getRuntimes( - TemplateRuntimes.DART, - 'dart pub get', - 'lib/main.dart', - 'dart/censor_with_redact' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'PANGEA_REDACT_TOKEN', - description: `Access token for the Pangea Redact API. Learn more.`, - value: '', - placeholder: 'pts_7p4...5wl4', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-document', - id: 'generate-pdf', - name: 'Generate PDF', - tagline: 'Document containing sample invoice in PDF format.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes(TemplateRuntimes.NODE, 'npm install', 'src/main.js', 'node/generate-pdf') - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [] - }, - { - icon: 'icon-github', - id: 'github-issue-bot', - name: 'GitHub issue bot', - tagline: - 'Automate the process of responding to newly opened issues in a GitHub repository.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Dev Tools'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/github-issue-bot' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - 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, - type: 'password' - }, - { - 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, - type: 'password' - } - ] - }, - { - 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, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/url-shortener' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_ENDPOINT', - description: `The API endpoint of the Appwrite. Learn more.`, - value: 'https://cloud.appwrite.io/v1', - placeholder: 'https://cloud.appwrite.io/v1', - required: false, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database to store the short URLs. Learn more.`, - value: 'urlShortener', - placeholder: 'urlShortener', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection to store the short URLs. Learn more.`, - value: 'urls', - placeholder: 'urls', - required: false, - type: 'text' - }, - { - name: 'SHORT_BASE_URL', - description: `The domain to use for the short URLs. You can use your functions subdomain or a custom domain.`, - value: '', - placeholder: 'https://shortdomain.io', - required: true, - type: 'url' - } - ] - }, - { - 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, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/sync-with-algolia' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/sync_with_algolia' - ), - ...getRuntimes( - TemplateRuntimes.PHP, - 'composer install', - 'src/index.php', - 'php/sync-with-algolia' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the Appwrite database that contains the collection to sync. Learn more.`, - placeholder: '64a55...7b912', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection in the Appwrite database to sync. Learn more.`, - placeholder: '7c3e8...2a9f1', - required: true, - type: 'text' - }, - { - name: 'ALGOLIA_APP_ID', - description: `The ID of the application in Algolia. Learn more.`, - placeholder: 'OFCNCOG2CU', - required: true, - type: 'text' - }, - { - name: 'ALGOLIA_ADMIN_API_KEY', - description: `The admin API Key for your Algolia service. Learn more.`, - placeholder: 'fd0aa...136a8', - required: true, - type: 'password' - }, - { - name: 'ALGOLIA_INDEX_ID', - description: `The ID of the index in Algolia where the documents are to be synced. Learn more.`, - placeholder: 'my_index', - required: true, - type: 'password' - }, - { - 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, - type: 'password' - }, - { - 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, - type: 'url' - } - ] - }, - { - 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, - usecases: ['Databases'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/sync-with-meilisearch' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/sync-with-meilisearch' - ), - ...getRuntimes( - TemplateRuntimes.PHP, - 'composer install', - 'src/index.php', - 'php/sync-with-meilisearch' - ), - ...getRuntimes( - TemplateRuntimes.BUN, - 'bun install', - 'src/main.ts', - 'bun/sync-with-meilisearch' - ), - ...getRuntimes( - TemplateRuntimes.RUBY, - 'bundle install', - 'lib/main.rb', - 'ruby/sync-with-meilisearch' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the Appwrite database that contains the collection to sync. Learn more.`, - placeholder: '64a55...7b912', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection in the Appwrite database to sync. Learn more.`, - placeholder: '7c3e8...2a9f1', - required: true, - type: 'text' - }, - { - name: 'MEILISEARCH_ENDPOINT', - description: `The host URL of the Meilisearch server. Learn more.`, - placeholder: 'http://127.0.0.1:7700', - required: true, - type: 'url' - }, - { - name: 'MEILISEARCH_ADMIN_API_KEY', - description: `The admin API key for Meilisearch. Learn more.`, - placeholder: 'masterKey1234', - required: true, - type: 'password' - }, - { - name: 'MEILISEARCH_SEARCH_API_KEY', - description: `API Key for Meilisearch search operations. Learn more.`, - placeholder: 'searchKey1234', - required: true, - type: 'password' - }, - { - name: 'MEILISEARCH_INDEX_NAME', - description: `Name of the Meilisearch index to which the documents will be synchronized. Learn more.`, - placeholder: 'appwrite_index', - required: true, - type: 'text' - }, - { - 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, - type: 'url' - } - ] - }, - { - icon: 'icon-vonage', - id: 'whatsapp-with-vonage', - name: 'WhatsApp with Vonage', - tagline: 'Simple bot to answer WhatsApp messages.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Messaging'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/whatsapp-with-vonage' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/whatsapp_with_vonage' - ), - ...getRuntimes( - TemplateRuntimes.PHP, - 'composer install', - 'src/index.php', - 'php/whatsapp-with-vonage' - ), - ...getRuntimes( - TemplateRuntimes.DART, - 'dart pub get', - 'lib/main.dart', - 'dart/whatsapp-with-vonage' - ), - ...getRuntimes( - TemplateRuntimes.RUBY, - 'bundle install', - 'lib/main.rb', - 'ruby/whatsapp-with-vonage' - ), - ...getRuntimes( - TemplateRuntimes.BUN, - 'bun install', - 'src/main.ts', - 'bun/whatsapp-with-vonage' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'VONAGE_API_KEY', - description: `API Key to use the Vonage API. Learn more.`, - value: '', - placeholder: '62...97', - required: true, - type: 'password' - }, - { - name: 'VONAGE_API_SECRET', - description: `Secret to use the Vonage API. Learn more.`, - placeholder: 'Zjc...5PH', - required: true, - type: 'password' - }, - { - name: 'VONAGE_API_SIGNATURE_SECRET', - description: `Secret to verify the JWT token sent by Vonage. Learn more.`, - placeholder: 'NXOi3...IBHDa', - required: true, - type: 'password' - }, - { - name: 'VONAGE_WHATSAPP_NUMBER', - description: `Vonage WhatsApp number to send messages from. Learn more.`, - placeholder: '+14000000102', - required: true, - type: 'phone' - } - ] - }, - { - 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, - usecases: ['Messaging'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/push-notification-with-fcm' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'FCM_PROJECT_ID', - description: `A unique identifier for your FCM project. Learn more.`, - value: '', - placeholder: 'mywebapp-f6e57', - required: true, - type: 'text' - }, - { - name: 'FCM_CLIENT_EMAIL', - description: `Your FCM service account email. Learn more.`, - placeholder: 'fcm-adminsdk-2f0de@test-f7q57.iam.gserviceaccount.com', - required: true, - type: 'email' - }, - { - name: 'FCM_PRIVATE_KEY', - description: `A unique private key used to authenticate with FCM. Learn more.`, - placeholder: '0b683...75675', - required: true, - type: 'password' - }, - { - name: 'FCM_DATABASE_URL', - description: `URL of your FCM database. Learn more.`, - placeholder: 'https://my-app-f298e.firebaseio.com', - required: true, - type: 'url' - } - ] - }, - { - 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, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/email-contact-form' - ), - ...getRuntimes( - TemplateRuntimes.PYTHON, - 'pip install -r requirements.txt', - 'src/main.py', - 'python/email_contact_form' - ), - ...getRuntimes( - TemplateRuntimes.PHP, - 'composer install', - 'src/index.php', - 'php/email-contact-form' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - 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, - type: 'text' - }, - { - name: 'SMTP_PORT', - description: `The port of your STMP server. Commnly used ports include 25, 465, and 587.`, - placeholder: '25', - required: true, - type: 'number' - }, - { - name: 'SMTP_USERNAME', - description: `The username for your SMTP server. This is commonly your email address.`, - placeholder: 'no-reply@mywebapp.org', - required: true, - type: 'text' - }, - { - name: 'SMTP_PASSWORD', - description: `The password for your SMTP server.`, - placeholder: '5up3r5tr0ngP4ssw0rd', - required: true, - type: 'password' - }, - { - name: 'SUBMIT_EMAIL', - description: `The email address to send form submissions to.`, - placeholder: 'me@mywebapp.org', - required: true, - type: 'email' - }, - { - 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, - type: 'text' - } - ] - }, - { - icon: 'icon-stripe', - id: 'subscriptions-with-stripe', - name: 'Subscriptions with Stripe', - tagline: 'Receive recurring card payments and grant subscribers extra permissions.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/subscriptions-with-stripe' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'STRIPE_SECRET_KEY', - description: `Secret for sending requests to the Stripe API. Learn more.`, - placeholder: 'sk_test_51J...', - required: true, - type: 'password' - }, - { - name: 'STRIPE_WEBHOOK_SECRET', - description: `Secret used to validate the Stripe Webhook signature. Learn more.`, - placeholder: 'whsec_...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-stripe', - id: 'payments-with-stripe', - name: 'Payments with Stripe', - tagline: 'Receive card payments and store paid orders.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/payments-with-stripe' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'STRIPE_SECRET_KEY', - description: `Secret for sending requests to the Stripe API. Learn more.`, - placeholder: 'sk_test_51J...', - required: true, - type: 'password' - }, - { - name: 'STRIPE_WEBHOOK_SECRET', - description: `Secret used to validate the Stripe Webhook signature. Learn more.`, - placeholder: 'whsec_...', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database to store paid orders. Learn more.`, - value: 'orders', - placeholder: 'orders', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection to store paid orders. Learn more.`, - value: 'orders', - placeholder: 'orders', - required: false, - type: 'text' - } - ] - }, - { - icon: 'icon-chat', - id: 'text-generation-with-huggingface', - name: 'Text generation', - tagline: 'Generate text using the Hugging Face inference API.', - permissions: ['any'], - events: [], - cron: '', - timeout: 30, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/text-generation-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-translate', - id: 'language-translation-with-huggingface', - name: 'Language translation', - tagline: 'Translate text using the Hugging Face inference API.', - permissions: ['any'], - events: [], - cron: '', - timeout: 30, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/language-translation-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-eye', - id: 'image-classification-with-huggingface', - name: 'Image classification', - tagline: 'Classify images using the Hugging Face inference API.', - permissions: ['any'], - events: ['buckets.*.files.*.create'], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install && npm run setup', - 'src/main.js', - 'node/image-classification-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the responses are stored. Learn more.`, - value: 'ai', - placeholder: 'ai', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the responses are stored. Learn more.`, - value: 'image_classification', - placeholder: 'image_classification', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where the images are stored. Learn more.`, - value: 'image_classification', - placeholder: 'image_classification', - required: false, - type: 'text' - }, - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-eye', - id: 'object-detection-with-huggingface', - name: 'Object detection', - tagline: 'Detect objects in images using the Hugging Face inference API.', - permissions: ['any'], - events: ['buckets.*.files.*.create'], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install && npm run setup', - 'src/main.js', - 'node/object-detection-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the responses are stored. Learn more.`, - value: 'ai', - placeholder: 'ai', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the responses are stored. Learn more.`, - value: 'object_detection', - placeholder: 'object_detection', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where the images are stored. Learn more.`, - value: 'object_detection', - placeholder: 'object_detection', - required: false, - type: 'text' - }, - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-text', - id: 'speech-recognition-with-huggingface', - name: 'Speech recognition', - tagline: 'Transcribe audio to text using the Hugging Face inference API.', - permissions: ['any'], - events: ['buckets.*.files.*.create'], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install && npm run setup', - 'src/main.js', - 'node/speech-recognition-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the responses are stored. Learn more.`, - value: 'ai', - placeholder: 'ai', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the responses are stored. Learn more.`, - value: 'speech_recognition', - placeholder: 'speech_recognition', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where audio is stored. Learn more.`, - value: 'speech_recognition', - placeholder: 'speech_recognition', - required: false, - type: 'text' - }, - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-chat', - id: 'text-to-speech-with-huggingface', - name: 'Text to speech', - tagline: 'Convert text to speech using the Hugging Face inference API.', - permissions: ['any'], - events: ['databases.*.collections.*.documents.*.create'], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install && npm run setup', - 'src/main.js', - 'node/text-to-speech-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the responses are stored. Learn more.`, - value: 'ai', - placeholder: 'ai', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the responses are stored. Learn more.`, - value: 'speech_recognition', - placeholder: 'speech_recognition', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where audio is stored. Learn more.`, - value: 'speech_recognition', - placeholder: 'speech_recognition', - required: false, - type: 'text' - }, - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-chip', - id: 'generate-with-replicate', - name: 'Generate with Replicate', - tagline: "Generate text, audio and images using Replicate's API.", - permissions: ['any'], - events: [], - cron: '', - timeout: 300, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/generate-with-replicate' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'REPLICATE_API_KEY', - description: `A unique key used to authenticate with the Replicate API. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-chip', - id: 'generate-with-together-ai', - name: 'Generate with Together AI', - tagline: "Generate text and images using Together AI's API.", - permissions: ['any'], - events: [], - cron: '', - timeout: 300, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/generate-with-together-ai' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'TOGETHER_API_KEY', - description: `A unique key used to authenticate with the Together AI API. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where audio is stored. Learn more.`, - placeholder: 'generated_speech', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-chip', - id: 'chat-with-perplexity-ai', - name: 'Chat with Perplexity AI', - tagline: 'Create a chatbot using the Perplexity AI API.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/chat-with-perplexity-ai' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'PERPLEXITY_API_KEY', - description: `A unique key used to authenticate with the Perplexity API. Learn more.`, - placeholder: `pplex-68...999`, - required: true, - type: 'password' - }, - { - name: 'PERPLEXITY_MAX_TOKENS', - description: `The maximum number of tokens to generate. Learn more.`, - placeholder: `512`, - required: false, - type: 'number' - } - ] - }, - { - icon: 'icon-chip', - id: 'generate-with-replicate', - name: 'Generate with Replicate', - tagline: "Generate text, audio and images using Replicate's API.", - permissions: ['any'], - events: [], - cron: '', - timeout: 300, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/generate-with-replicate' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'REPLICATE_API_KEY', - description: `A unique key used to authenticate with the Replicate API. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-document-search', - id: 'sync-with-pinecone', - name: 'Sync with Pinecone', - tagline: "Sync your Appwrite database with Pinecone's vector database.", - permissions: ['any'], - events: [], - cron: '', - timeout: 30, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/sync-with-pinecone' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'OPENAI_API_KEY', - 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, - type: 'password' - }, - { - name: 'PINECONE_API_KEY', - description: `A unique key used to authenticate with the Pinecone API. Learn more.`, - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - name: 'PINECONE_INDEX_NAME', - description: `The name of the index in Pinecone. Learn more.`, - placeholder: 'my-index', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the documents are stored. Learn more.`, - placeholder: 'my-database', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the documents are stored. Learn more.`, - placeholder: 'my-collection', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-chip', - id: 'rag-with-langchain', - name: 'RAG with LangChain', - tagline: 'Generate text using a LangChain RAG model', - permissions: ['any'], - events: [], - cron: '', - timeout: 30, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/rag-with-langchain' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'OPENAI_API_KEY', - 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, - type: 'password' - }, - { - name: 'PINECONE_API_KEY', - description: `A unique key used to authenticate with the Pinecone API. Learn more.`, - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - name: 'PINECONE_INDEX_NAME', - description: `The name of the index in Pinecone. Learn more.`, - placeholder: 'my-index', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the documents are stored. Learn more.`, - placeholder: 'my-database', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the documents are stored. Learn more.`, - placeholder: 'my-collection', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-chat', - id: 'speak-with-elevenlabs', - name: 'Speak with ElevenLabs', - tagline: 'Convert text to speech using the ElevenLabs API.', - permissions: ['any'], - cron: '', - events: [], - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/speak-with-elevenlabs' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'ELEVENLABS_API_KEY', - description: `A unique key used to authenticate with the ElevenLabs API. Learn more.`, - placeholder: 'd03xxxxxxxx26', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database where the responses are stored. Learn more.`, - placeholder: 'my-database', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection where the responses are stored. Learn more.`, - placeholder: 'my-collection', - required: true, - type: 'text' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where audio is stored. Learn more.`, - placeholder: 'generated_speech', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-chip', - id: 'speak-with-lmnt', - name: 'Speak with LMNT', - tagline: 'Convert text to speech using the LMNT API.', - permissions: ['any'], - cron: '', - events: [], - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/speak-with-lmnt' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'LMNT_API_KEY', - description: `A unique key used to authenticate with the LMNT API. Learn more.`, - placeholder: 'd03xxxxxxxx26', - required: true, - type: 'password' - }, - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where audio is stored. Learn more.`, - placeholder: 'generated_speech', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-chip', - id: 'chat-with-anyscale', - name: 'Chat with AnyScale', - tagline: 'Create a chatbot using the AnyScale API.', - permissions: ['any'], - cron: '', - events: [], - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/chat-with-anyscale' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'ANYSCALE_API_KEY', - description: `A unique key used to authenticate with the AnyScale API. Learn more.`, - placeholder: 'd03xxxxxxxx26', - required: true, - type: 'password' - }, - { - name: 'ANYSCALE_MAX_TOKENS', - description: `The maximum number of tokens that Anyscale responses should contain. Learn more.`, - placeholder: '', - required: false, - type: 'number' - } - ] - }, - { - icon: 'icon-music-note', - id: 'music-generation-with-huggingface', - name: 'Music generation', - tagline: 'Generate music from a text prompt using the Hugging Face inference API.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install && npm run setup', - 'src/main.js', - 'node/music-generation-with-huggingface' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_BUCKET_ID', - description: `The ID of the bucket where generated music is stored. Learn more.`, - value: 'generated_music', - placeholder: 'generated_music', - required: false, - type: 'text' - }, - { - name: 'HUGGINGFACE_ACCESS_TOKEN', - description: `Secret for sending requests to the Hugging Face API. Learn more.`, - placeholder: 'hf_MUvn...', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-chip', - id: 'generate-with-fal-ai', - name: 'Generate with fal.ai', - tagline: "Generate images using fal.ai's API.", - permissions: ['any'], - events: [], - cron: '', - timeout: 300, - usecases: ['AI'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/generate-with-fal-ai' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'FAL_API_KEY', - description: `A unique key used to authenticate with the fal.ai API. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - } - ] - }, - { - icon: 'icon-currency-dollar', - id: 'subscriptions-with-lemon-squeezy', - name: 'Subscriptions with Lemon Squeezy', - tagline: 'Receive recurring card payments and grant subscribers extra permissions.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/subscriptions-with-lemon-squeezy' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'LEMON_SQUEEZY_API_KEY', - description: `API key for sending requests to the Lemon Squeezy API. Learn more.`, - placeholder: 'eyJ0eXAiOiJ...', - required: true, - type: 'password' - }, - { - name: 'LEMON_SQUEEZY_WEBHOOK_SECRET', - description: `Secret used to validate the Lemon Squuezy Webhook signature. Learn more.`, - placeholder: 'abcd...', - required: true, - type: 'password' - }, - { - name: 'LEMON_SQUEEZY_STORE_ID', - description: `Store ID required to create a checkout using the Lemon Squeezy API. Learn more.`, - placeholder: '123456', - required: true, - type: 'text' - }, - { - name: 'LEMON_SQUEEZY_VARIANT_ID', - description: `Variant ID of a product required to create a checkout using the Lemon Squeezy API. Learn more.`, - placeholder: 'abcd...', - required: true, - type: 'text' - } - ] - }, - { - icon: 'icon-currency-dollar', - id: 'payments-with-lemon-squeezy', - name: 'Payments with Lemon Squeezy', - tagline: 'Receive card payments and store paid orders.', - permissions: ['any'], - events: [], - cron: '', - timeout: 15, - usecases: ['Utilities'], - runtimes: [ - ...getRuntimes( - TemplateRuntimes.NODE, - 'npm install', - 'src/main.js', - 'node/payments-with-lemon-squeezy' - ) - ], - instructions: `For documentation and instructions check out file.`, - vcsProvider: 'github', - providerRepositoryId: 'templates', - providerOwner: 'appwrite', - providerBranch: '0.1.*', - variables: [ - { - name: 'APPWRITE_API_KEY', - description: `The API Key to authenticate against Appwrite's Server APIs. Learn more.`, - value: '', - placeholder: 'd1efb...aec35', - required: true, - type: 'password' - }, - { - 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, - type: 'url' - }, - { - name: 'APPWRITE_DATABASE_ID', - description: `The ID of the database to store paid orders. Learn more.`, - value: 'orders', - placeholder: 'orders', - required: false, - type: 'text' - }, - { - name: 'APPWRITE_COLLECTION_ID', - description: `The ID of the collection to store paid orders. Learn more.`, - value: 'orders', - placeholder: 'orders', - required: false, - type: 'text' - }, - { - name: 'LEMON_SQUEEZY_API_KEY', - description: `API key for sending requests to the Lemon Squeezy API. Learn more.`, - placeholder: 'eyJ0eXAiOiJ...', - required: true, - type: 'password' - }, - { - name: 'LEMON_SQUEEZY_WEBHOOK_SECRET', - description: `Secret used to validate the Lemon Squuezy Webhook signature. Learn more.`, - placeholder: 'abcd...', - required: true, - type: 'password' - }, - { - name: 'LEMON_SQUEEZY_STORE_ID', - description: `Store ID required to create a checkout using the Lemon Squeezy API. Learn more.`, - placeholder: '123456', - required: true, - type: 'text' - }, - { - name: 'LEMON_SQUEEZY_VARIANT_ID', - description: `Variant ID of a product required to create a checkout using the Lemon Squeezy API. Learn more.`, - placeholder: 'abcd...', - required: true, - type: 'text' - } - ] - } -]; - -export type Runtime = { - name: string; - commands: string; - entrypoint: string; - providerRootDirectory: string; -}; - -export type Variable = { - name: string; - description: string; - value?: string; - placeholder: string; - required: boolean; - type: 'password' | 'text' | 'number' | 'email' | 'url' | 'phone'; -}; - -export type MarketplaceTemplate = { - icon: string; - id: string; - name: string; - tagline: string; - permissions: string[]; - events: string[]; - cron: string; - timeout: number; - usecases: string[]; - runtimes: Runtime[]; - instructions: string; - vcsProvider: string; - providerRepositoryId: string; - providerOwner: string; - providerBranch: string; - variables: Variable[]; - scopes?: string[]; -}; diff --git a/src/lib/stores/runtimes.ts b/src/lib/stores/runtimes.ts new file mode 100644 index 000000000..b5529f5a3 --- /dev/null +++ b/src/lib/stores/runtimes.ts @@ -0,0 +1,17 @@ +import { page } from '$app/stores'; +import type { Models } from '@appwrite.io/console'; +import { derived } from 'svelte/store'; + +export const runtimesList = derived( + page, + async ($page) => (await $page.data.runtimesList) as Models.RuntimeList +); + +export const baseRuntimesList = derived(runtimesList, async ($runtimesList) => { + const baseRuntimes = new Map(); + for (const runtime of (await $runtimesList).runtimes) { + const runtimeBase = runtime.name.split('-')[0]; + baseRuntimes.set(runtimeBase, runtime); + } + return { runtimes: [...baseRuntimes.values()] }; +}); diff --git a/src/lib/stores/templates.ts b/src/lib/stores/templates.ts new file mode 100644 index 000000000..0d64cadb2 --- /dev/null +++ b/src/lib/stores/templates.ts @@ -0,0 +1,20 @@ +import { page } from '$app/stores'; +import type { Models } from '@appwrite.io/console'; +import { derived } from 'svelte/store'; + +export const templatesList = derived( + page, + async ($page) => (await $page.data.templatesList) as Models.TemplateFunctionList +); + +export const featuredTemplatesList = derived(templatesList, async ($templatesList) => { + return { + templates: (await $templatesList).templates + .filter((template) => template.id !== 'starter') + .slice(0, 2) + }; +}); + +export const starterTemplate = derived(templatesList, async ($templatesList) => { + return (await $templatesList).templates.find((template) => template.id === 'starter'); +}); diff --git a/src/lib/wizards/functions/cover.svelte b/src/lib/wizards/functions/cover.svelte index 6177d4251..4ff94f32c 100644 --- a/src/lib/wizards/functions/cover.svelte +++ b/src/lib/wizards/functions/cover.svelte @@ -1,7 +1,10 @@