chirag-appwrite-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish.yml +49 -0
- package/CHANGELOG.md +1 -0
- package/Formula/appwrite.rb +19 -0
- package/LICENSE.md +1 -0
- package/README.md +104 -0
- package/appwrite.json +164 -0
- package/docs/examples/account/create-anonymous-session.md +1 -0
- package/docs/examples/account/create-email-password-session.md +3 -0
- package/docs/examples/account/create-email-token.md +4 -0
- package/docs/examples/account/create-j-w-t.md +1 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/create-o-auth2session.md +5 -0
- package/docs/examples/account/create-o-auth2token.md +5 -0
- package/docs/examples/account/create-phone-token.md +3 -0
- package/docs/examples/account/create-phone-verification.md +1 -0
- package/docs/examples/account/create-push-target.md +4 -0
- package/docs/examples/account/create-recovery.md +3 -0
- package/docs/examples/account/create-session.md +3 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +5 -0
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/delete-mfa-authenticator.md +2 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +1 -0
- package/docs/examples/account/delete.md +1 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/get-prefs.md +1 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get.md +1 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-mfa-factors.md +1 -0
- package/docs/examples/account/list-sessions.md +1 -0
- package/docs/examples/account/update-email.md +3 -0
- package/docs/examples/account/update-m-f-a.md +2 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +3 -0
- package/docs/examples/account/update-mfa-authenticator.md +3 -0
- package/docs/examples/account/update-mfa-challenge.md +3 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +3 -0
- package/docs/examples/account/update-phone-session.md +3 -0
- package/docs/examples/account/update-phone-verification.md +3 -0
- package/docs/examples/account/update-phone.md +3 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-push-target.md +3 -0
- package/docs/examples/account/update-recovery.md +4 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-status.md +1 -0
- package/docs/examples/account/update-verification.md +3 -0
- package/docs/examples/avatars/get-browser.md +5 -0
- package/docs/examples/avatars/get-credit-card.md +5 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +5 -0
- package/docs/examples/avatars/get-image.md +4 -0
- package/docs/examples/avatars/get-initials.md +5 -0
- package/docs/examples/avatars/get-q-r.md +5 -0
- package/docs/examples/console/get-resource.md +3 -0
- package/docs/examples/console/variables.md +1 -0
- package/docs/examples/databases/create-boolean-attribute.md +7 -0
- package/docs/examples/databases/create-collection.md +7 -0
- package/docs/examples/databases/create-datetime-attribute.md +7 -0
- package/docs/examples/databases/create-document.md +6 -0
- package/docs/examples/databases/create-documents.md +4 -0
- package/docs/examples/databases/create-email-attribute.md +7 -0
- package/docs/examples/databases/create-enum-attribute.md +8 -0
- package/docs/examples/databases/create-float-attribute.md +9 -0
- package/docs/examples/databases/create-index.md +8 -0
- package/docs/examples/databases/create-integer-attribute.md +9 -0
- package/docs/examples/databases/create-ip-attribute.md +7 -0
- package/docs/examples/databases/create-relationship-attribute.md +9 -0
- package/docs/examples/databases/create-string-attribute.md +9 -0
- package/docs/examples/databases/create-url-attribute.md +7 -0
- package/docs/examples/databases/create.md +4 -0
- package/docs/examples/databases/decrement-document-attribute.md +7 -0
- package/docs/examples/databases/delete-attribute.md +4 -0
- package/docs/examples/databases/delete-collection.md +3 -0
- package/docs/examples/databases/delete-document.md +4 -0
- package/docs/examples/databases/delete-documents.md +4 -0
- package/docs/examples/databases/delete-index.md +4 -0
- package/docs/examples/databases/delete.md +2 -0
- package/docs/examples/databases/get-attribute.md +4 -0
- package/docs/examples/databases/get-collection-usage.md +4 -0
- package/docs/examples/databases/get-collection.md +3 -0
- package/docs/examples/databases/get-database-usage.md +3 -0
- package/docs/examples/databases/get-document.md +5 -0
- package/docs/examples/databases/get-index.md +4 -0
- package/docs/examples/databases/get-usage.md +2 -0
- package/docs/examples/databases/get.md +2 -0
- package/docs/examples/databases/increment-document-attribute.md +7 -0
- package/docs/examples/databases/list-attributes.md +4 -0
- package/docs/examples/databases/list-collection-logs.md +4 -0
- package/docs/examples/databases/list-collections.md +4 -0
- package/docs/examples/databases/list-document-logs.md +5 -0
- package/docs/examples/databases/list-documents.md +4 -0
- package/docs/examples/databases/list-indexes.md +4 -0
- package/docs/examples/databases/list-logs.md +3 -0
- package/docs/examples/databases/list.md +3 -0
- package/docs/examples/databases/update-boolean-attribute.md +7 -0
- package/docs/examples/databases/update-collection.md +7 -0
- package/docs/examples/databases/update-datetime-attribute.md +7 -0
- package/docs/examples/databases/update-document.md +6 -0
- package/docs/examples/databases/update-documents.md +5 -0
- package/docs/examples/databases/update-email-attribute.md +7 -0
- package/docs/examples/databases/update-enum-attribute.md +8 -0
- package/docs/examples/databases/update-float-attribute.md +9 -0
- package/docs/examples/databases/update-integer-attribute.md +9 -0
- package/docs/examples/databases/update-ip-attribute.md +7 -0
- package/docs/examples/databases/update-relationship-attribute.md +6 -0
- package/docs/examples/databases/update-string-attribute.md +8 -0
- package/docs/examples/databases/update-url-attribute.md +7 -0
- package/docs/examples/databases/update.md +4 -0
- package/docs/examples/databases/upsert-document.md +6 -0
- package/docs/examples/databases/upsert-documents.md +4 -0
- package/docs/examples/functions/create-deployment.md +6 -0
- package/docs/examples/functions/create-duplicate-deployment.md +4 -0
- package/docs/examples/functions/create-execution.md +8 -0
- package/docs/examples/functions/create-template-deployment.md +7 -0
- package/docs/examples/functions/create-variable.md +5 -0
- package/docs/examples/functions/create-vcs-deployment.md +5 -0
- package/docs/examples/functions/create.md +19 -0
- package/docs/examples/functions/delete-deployment.md +3 -0
- package/docs/examples/functions/delete-execution.md +3 -0
- package/docs/examples/functions/delete-variable.md +3 -0
- package/docs/examples/functions/delete.md +2 -0
- package/docs/examples/functions/get-deployment-download.md +4 -0
- package/docs/examples/functions/get-deployment.md +3 -0
- package/docs/examples/functions/get-execution.md +3 -0
- package/docs/examples/functions/get-template.md +2 -0
- package/docs/examples/functions/get-usage.md +3 -0
- package/docs/examples/functions/get-variable.md +3 -0
- package/docs/examples/functions/get.md +2 -0
- package/docs/examples/functions/list-deployments.md +4 -0
- package/docs/examples/functions/list-executions.md +3 -0
- package/docs/examples/functions/list-runtimes.md +1 -0
- package/docs/examples/functions/list-specifications.md +1 -0
- package/docs/examples/functions/list-templates.md +5 -0
- package/docs/examples/functions/list-usage.md +2 -0
- package/docs/examples/functions/list-variables.md +2 -0
- package/docs/examples/functions/list.md +3 -0
- package/docs/examples/functions/update-deployment-status.md +3 -0
- package/docs/examples/functions/update-function-deployment.md +3 -0
- package/docs/examples/functions/update-variable.md +6 -0
- package/docs/examples/functions/update.md +19 -0
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/health/get-antivirus.md +1 -0
- package/docs/examples/health/get-cache.md +1 -0
- package/docs/examples/health/get-certificate.md +2 -0
- package/docs/examples/health/get-d-b.md +1 -0
- package/docs/examples/health/get-failed-jobs.md +3 -0
- package/docs/examples/health/get-pub-sub.md +1 -0
- package/docs/examples/health/get-queue-builds.md +2 -0
- package/docs/examples/health/get-queue-certificates.md +2 -0
- package/docs/examples/health/get-queue-databases.md +3 -0
- package/docs/examples/health/get-queue-deletes.md +2 -0
- package/docs/examples/health/get-queue-functions.md +2 -0
- package/docs/examples/health/get-queue-logs.md +2 -0
- package/docs/examples/health/get-queue-mails.md +2 -0
- package/docs/examples/health/get-queue-messaging.md +2 -0
- package/docs/examples/health/get-queue-migrations.md +2 -0
- package/docs/examples/health/get-queue-stats-resources.md +2 -0
- package/docs/examples/health/get-queue-usage.md +2 -0
- package/docs/examples/health/get-queue-webhooks.md +2 -0
- package/docs/examples/health/get-storage-local.md +1 -0
- package/docs/examples/health/get-storage.md +1 -0
- package/docs/examples/health/get-time.md +1 -0
- package/docs/examples/health/get.md +1 -0
- package/docs/examples/locale/get.md +1 -0
- package/docs/examples/locale/list-codes.md +1 -0
- package/docs/examples/locale/list-continents.md +1 -0
- package/docs/examples/locale/list-countries-e-u.md +1 -0
- package/docs/examples/locale/list-countries-phones.md +1 -0
- package/docs/examples/locale/list-countries.md +1 -0
- package/docs/examples/locale/list-currencies.md +1 -0
- package/docs/examples/locale/list-languages.md +1 -0
- package/docs/examples/messaging/create-apns-provider.md +9 -0
- package/docs/examples/messaging/create-email.md +13 -0
- package/docs/examples/messaging/create-fcm-provider.md +5 -0
- package/docs/examples/messaging/create-mailgun-provider.md +11 -0
- package/docs/examples/messaging/create-msg91provider.md +7 -0
- package/docs/examples/messaging/create-push.md +20 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
- package/docs/examples/messaging/create-sms.md +8 -0
- package/docs/examples/messaging/create-smtp-provider.md +15 -0
- package/docs/examples/messaging/create-subscriber.md +4 -0
- package/docs/examples/messaging/create-telesign-provider.md +7 -0
- package/docs/examples/messaging/create-textmagic-provider.md +7 -0
- package/docs/examples/messaging/create-topic.md +4 -0
- package/docs/examples/messaging/create-twilio-provider.md +7 -0
- package/docs/examples/messaging/create-vonage-provider.md +7 -0
- package/docs/examples/messaging/delete-provider.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +3 -0
- package/docs/examples/messaging/delete-topic.md +2 -0
- package/docs/examples/messaging/delete.md +2 -0
- package/docs/examples/messaging/get-message.md +2 -0
- package/docs/examples/messaging/get-provider.md +2 -0
- package/docs/examples/messaging/get-subscriber.md +3 -0
- package/docs/examples/messaging/get-topic.md +2 -0
- package/docs/examples/messaging/list-message-logs.md +3 -0
- package/docs/examples/messaging/list-messages.md +3 -0
- package/docs/examples/messaging/list-provider-logs.md +3 -0
- package/docs/examples/messaging/list-providers.md +3 -0
- package/docs/examples/messaging/list-subscriber-logs.md +3 -0
- package/docs/examples/messaging/list-subscribers.md +4 -0
- package/docs/examples/messaging/list-targets.md +3 -0
- package/docs/examples/messaging/list-topic-logs.md +3 -0
- package/docs/examples/messaging/list-topics.md +3 -0
- package/docs/examples/messaging/update-apns-provider.md +9 -0
- package/docs/examples/messaging/update-email.md +13 -0
- package/docs/examples/messaging/update-fcm-provider.md +5 -0
- package/docs/examples/messaging/update-mailgun-provider.md +11 -0
- package/docs/examples/messaging/update-msg91provider.md +7 -0
- package/docs/examples/messaging/update-push.md +20 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
- package/docs/examples/messaging/update-sms.md +8 -0
- package/docs/examples/messaging/update-smtp-provider.md +15 -0
- package/docs/examples/messaging/update-telesign-provider.md +7 -0
- package/docs/examples/messaging/update-textmagic-provider.md +7 -0
- package/docs/examples/messaging/update-topic.md +4 -0
- package/docs/examples/messaging/update-twilio-provider.md +7 -0
- package/docs/examples/messaging/update-vonage-provider.md +7 -0
- package/docs/examples/migrations/create-appwrite-migration.md +5 -0
- package/docs/examples/migrations/create-csv-migration.md +4 -0
- package/docs/examples/migrations/create-firebase-migration.md +3 -0
- package/docs/examples/migrations/create-n-host-migration.md +9 -0
- package/docs/examples/migrations/create-supabase-migration.md +8 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +5 -0
- package/docs/examples/migrations/get-firebase-report.md +3 -0
- package/docs/examples/migrations/get-n-host-report.md +9 -0
- package/docs/examples/migrations/get-supabase-report.md +8 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list.md +3 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/project/create-variable.md +4 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +4 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +1 -0
- package/docs/examples/project/update-variable.md +5 -0
- package/docs/examples/projects/create-dev-key.md +4 -0
- package/docs/examples/projects/create-j-w-t.md +4 -0
- package/docs/examples/projects/create-key.md +5 -0
- package/docs/examples/projects/create-platform.md +7 -0
- package/docs/examples/projects/create-smtp-test.md +11 -0
- package/docs/examples/projects/create-webhook.md +9 -0
- package/docs/examples/projects/create.md +14 -0
- package/docs/examples/projects/delete-dev-key.md +3 -0
- package/docs/examples/projects/delete-email-template.md +4 -0
- package/docs/examples/projects/delete-key.md +3 -0
- package/docs/examples/projects/delete-platform.md +3 -0
- package/docs/examples/projects/delete-sms-template.md +4 -0
- package/docs/examples/projects/delete-webhook.md +3 -0
- package/docs/examples/projects/delete.md +2 -0
- package/docs/examples/projects/get-dev-key.md +3 -0
- package/docs/examples/projects/get-email-template.md +4 -0
- package/docs/examples/projects/get-key.md +3 -0
- package/docs/examples/projects/get-platform.md +3 -0
- package/docs/examples/projects/get-sms-template.md +4 -0
- package/docs/examples/projects/get-webhook.md +3 -0
- package/docs/examples/projects/get.md +2 -0
- package/docs/examples/projects/list-dev-keys.md +3 -0
- package/docs/examples/projects/list-keys.md +2 -0
- package/docs/examples/projects/list-platforms.md +2 -0
- package/docs/examples/projects/list-webhooks.md +2 -0
- package/docs/examples/projects/list.md +3 -0
- package/docs/examples/projects/update-api-status-all.md +3 -0
- package/docs/examples/projects/update-api-status.md +4 -0
- package/docs/examples/projects/update-auth-duration.md +3 -0
- package/docs/examples/projects/update-auth-limit.md +3 -0
- package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
- package/docs/examples/projects/update-auth-password-history.md +3 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +3 -0
- package/docs/examples/projects/update-auth-status.md +4 -0
- package/docs/examples/projects/update-dev-key.md +5 -0
- package/docs/examples/projects/update-email-template.md +9 -0
- package/docs/examples/projects/update-key.md +6 -0
- package/docs/examples/projects/update-memberships-privacy.md +5 -0
- package/docs/examples/projects/update-mock-numbers.md +3 -0
- package/docs/examples/projects/update-o-auth2.md +6 -0
- package/docs/examples/projects/update-personal-data-check.md +3 -0
- package/docs/examples/projects/update-platform.md +7 -0
- package/docs/examples/projects/update-service-status-all.md +3 -0
- package/docs/examples/projects/update-service-status.md +4 -0
- package/docs/examples/projects/update-session-alerts.md +3 -0
- package/docs/examples/projects/update-sms-template.md +5 -0
- package/docs/examples/projects/update-smtp.md +11 -0
- package/docs/examples/projects/update-team.md +3 -0
- package/docs/examples/projects/update-webhook-signature.md +3 -0
- package/docs/examples/projects/update-webhook.md +10 -0
- package/docs/examples/projects/update.md +12 -0
- package/docs/examples/proxy/create-a-p-i-rule.md +2 -0
- package/docs/examples/proxy/create-function-rule.md +4 -0
- package/docs/examples/proxy/create-redirect-rule.md +6 -0
- package/docs/examples/proxy/create-site-rule.md +4 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +3 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/sites/create-deployment.md +7 -0
- package/docs/examples/sites/create-duplicate-deployment.md +3 -0
- package/docs/examples/sites/create-template-deployment.md +7 -0
- package/docs/examples/sites/create-variable.md +5 -0
- package/docs/examples/sites/create-vcs-deployment.md +5 -0
- package/docs/examples/sites/create.md +19 -0
- package/docs/examples/sites/delete-deployment.md +3 -0
- package/docs/examples/sites/delete-log.md +3 -0
- package/docs/examples/sites/delete-variable.md +3 -0
- package/docs/examples/sites/delete.md +2 -0
- package/docs/examples/sites/get-deployment-download.md +4 -0
- package/docs/examples/sites/get-deployment.md +3 -0
- package/docs/examples/sites/get-log.md +3 -0
- package/docs/examples/sites/get-template.md +2 -0
- package/docs/examples/sites/get-usage.md +3 -0
- package/docs/examples/sites/get-variable.md +3 -0
- package/docs/examples/sites/get.md +2 -0
- package/docs/examples/sites/list-deployments.md +4 -0
- package/docs/examples/sites/list-frameworks.md +1 -0
- package/docs/examples/sites/list-logs.md +3 -0
- package/docs/examples/sites/list-specifications.md +1 -0
- package/docs/examples/sites/list-templates.md +5 -0
- package/docs/examples/sites/list-usage.md +2 -0
- package/docs/examples/sites/list-variables.md +2 -0
- package/docs/examples/sites/list.md +3 -0
- package/docs/examples/sites/update-deployment-status.md +3 -0
- package/docs/examples/sites/update-site-deployment.md +3 -0
- package/docs/examples/sites/update-variable.md +6 -0
- package/docs/examples/sites/update.md +19 -0
- package/docs/examples/storage/create-bucket.md +11 -0
- package/docs/examples/storage/create-file.md +5 -0
- package/docs/examples/storage/delete-bucket.md +2 -0
- package/docs/examples/storage/delete-file.md +3 -0
- package/docs/examples/storage/get-bucket-usage.md +3 -0
- package/docs/examples/storage/get-bucket.md +2 -0
- package/docs/examples/storage/get-file-download.md +4 -0
- package/docs/examples/storage/get-file-preview.md +15 -0
- package/docs/examples/storage/get-file-view.md +4 -0
- package/docs/examples/storage/get-file.md +3 -0
- package/docs/examples/storage/get-usage.md +2 -0
- package/docs/examples/storage/list-buckets.md +3 -0
- package/docs/examples/storage/list-files.md +4 -0
- package/docs/examples/storage/update-bucket.md +11 -0
- package/docs/examples/storage/update-file.md +5 -0
- package/docs/examples/teams/create-membership.md +8 -0
- package/docs/examples/teams/create.md +4 -0
- package/docs/examples/teams/delete-membership.md +3 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +3 -0
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list-logs.md +3 -0
- package/docs/examples/teams/list-memberships.md +4 -0
- package/docs/examples/teams/list.md +3 -0
- package/docs/examples/teams/update-membership-status.md +5 -0
- package/docs/examples/teams/update-membership.md +4 -0
- package/docs/examples/teams/update-name.md +3 -0
- package/docs/examples/teams/update-prefs.md +3 -0
- package/docs/examples/tokens/create-file-token.md +4 -0
- package/docs/examples/tokens/delete.md +2 -0
- package/docs/examples/tokens/get.md +2 -0
- package/docs/examples/tokens/list.md +4 -0
- package/docs/examples/tokens/update.md +3 -0
- package/docs/examples/users/create-argon2user.md +5 -0
- package/docs/examples/users/create-bcrypt-user.md +5 -0
- package/docs/examples/users/create-j-w-t.md +4 -0
- package/docs/examples/users/create-m-d5user.md +5 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/create-p-h-pass-user.md +5 -0
- package/docs/examples/users/create-s-h-a-user.md +6 -0
- package/docs/examples/users/create-scrypt-modified-user.md +8 -0
- package/docs/examples/users/create-scrypt-user.md +10 -0
- package/docs/examples/users/create-session.md +2 -0
- package/docs/examples/users/create-target.md +7 -0
- package/docs/examples/users/create-token.md +4 -0
- package/docs/examples/users/create.md +6 -0
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/delete-mfa-authenticator.md +3 -0
- package/docs/examples/users/delete-session.md +3 -0
- package/docs/examples/users/delete-sessions.md +2 -0
- package/docs/examples/users/delete-target.md +3 -0
- package/docs/examples/users/delete.md +2 -0
- package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/get-prefs.md +2 -0
- package/docs/examples/users/get-target.md +3 -0
- package/docs/examples/users/get-usage.md +2 -0
- package/docs/examples/users/get.md +2 -0
- package/docs/examples/users/list-identities.md +3 -0
- package/docs/examples/users/list-logs.md +3 -0
- package/docs/examples/users/list-memberships.md +4 -0
- package/docs/examples/users/list-mfa-factors.md +2 -0
- package/docs/examples/users/list-sessions.md +2 -0
- package/docs/examples/users/list-targets.md +3 -0
- package/docs/examples/users/list.md +3 -0
- package/docs/examples/users/update-email-verification.md +3 -0
- package/docs/examples/users/update-email.md +3 -0
- package/docs/examples/users/update-labels.md +3 -0
- package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/update-mfa.md +3 -0
- package/docs/examples/users/update-name.md +3 -0
- package/docs/examples/users/update-password.md +3 -0
- package/docs/examples/users/update-phone-verification.md +3 -0
- package/docs/examples/users/update-phone.md +3 -0
- package/docs/examples/users/update-prefs.md +3 -0
- package/docs/examples/users/update-status.md +3 -0
- package/docs/examples/users/update-target.md +6 -0
- package/docs/examples/vcs/create-repository-detection.md +5 -0
- package/docs/examples/vcs/create-repository.md +4 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository-contents.md +5 -0
- package/docs/examples/vcs/get-repository.md +3 -0
- package/docs/examples/vcs/list-installations.md +3 -0
- package/docs/examples/vcs/list-repositories.md +4 -0
- package/docs/examples/vcs/list-repository-branches.md +3 -0
- package/docs/examples/vcs/update-external-deployments.md +4 -0
- package/functions/Starter function/.prettierrc.json +6 -0
- package/functions/Starter function/README.md +48 -0
- package/functions/Starter function/package-lock.json +60 -0
- package/functions/Starter function/package.json +16 -0
- package/functions/Starter function/src/main.js +35 -0
- package/generate/appwrite.d.ts +18 -0
- package/index.js +109 -0
- package/install.ps1 +98 -0
- package/install.sh +157 -0
- package/lib/client.js +259 -0
- package/lib/commands/account.js +2074 -0
- package/lib/commands/avatars.js +491 -0
- package/lib/commands/console.js +129 -0
- package/lib/commands/databases.js +2972 -0
- package/lib/commands/functions.js +1737 -0
- package/lib/commands/generic.js +328 -0
- package/lib/commands/graphql.js +128 -0
- package/lib/commands/health.js +891 -0
- package/lib/commands/init.js +566 -0
- package/lib/commands/locale.js +324 -0
- package/lib/commands/messaging.js +2970 -0
- package/lib/commands/migrations.js +751 -0
- package/lib/commands/organizations.js +48 -0
- package/lib/commands/project.js +308 -0
- package/lib/commands/projects.js +2615 -0
- package/lib/commands/proxy.js +406 -0
- package/lib/commands/pull.js +474 -0
- package/lib/commands/push.js +2117 -0
- package/lib/commands/run.js +330 -0
- package/lib/commands/sites.js +1663 -0
- package/lib/commands/storage.js +990 -0
- package/lib/commands/teams.js +682 -0
- package/lib/commands/tokens.js +261 -0
- package/lib/commands/types.js +156 -0
- package/lib/commands/users.js +2035 -0
- package/lib/commands/vcs.js +484 -0
- package/lib/config.js +705 -0
- package/lib/emulation/docker.js +264 -0
- package/lib/emulation/utils.js +186 -0
- package/lib/exception.js +9 -0
- package/lib/id.js +30 -0
- package/lib/paginate.js +52 -0
- package/lib/parser.js +246 -0
- package/lib/questions.js +1006 -0
- package/lib/sdks.js +60 -0
- package/lib/spinner.js +104 -0
- package/lib/type-generation/attribute.js +16 -0
- package/lib/type-generation/languages/dart.js +196 -0
- package/lib/type-generation/languages/java.js +130 -0
- package/lib/type-generation/languages/javascript.js +102 -0
- package/lib/type-generation/languages/kotlin.js +84 -0
- package/lib/type-generation/languages/language.js +125 -0
- package/lib/type-generation/languages/php.js +109 -0
- package/lib/type-generation/languages/swift.js +169 -0
- package/lib/type-generation/languages/typescript.js +102 -0
- package/lib/utils.js +289 -0
- package/lib/validations.js +17 -0
- package/package.json +50 -0
- package/scoop/appwrite.json +30 -0
- package/sites/JavaScript starter/.env.example +3 -0
- package/sites/JavaScript starter/LICENSE +21 -0
- package/sites/JavaScript starter/images/appwrite.svg +8 -0
- package/sites/JavaScript starter/images/javascript.svg +5 -0
- package/sites/JavaScript starter/index.html +250 -0
- package/sites/JavaScript starter/lib/appwrite.js +10 -0
- package/sites/JavaScript starter/package-lock.json +1431 -0
- package/sites/JavaScript starter/package.json +21 -0
- package/sites/JavaScript starter/readme.md +26 -0
- package/sites/JavaScript starter/src/javascript.svg +1 -0
- package/sites/JavaScript starter/style/app.css +20 -0
- package/sites/JavaScript starter/vite.config.js +7 -0
package/lib/utils.js
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const net = require("net");
|
|
4
|
+
const childProcess = require('child_process');
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
const { localConfig, globalConfig } = require("./config");
|
|
7
|
+
|
|
8
|
+
function getAllFiles(folder) {
|
|
9
|
+
const files = [];
|
|
10
|
+
for (const pathDir of fs.readdirSync(folder)) {
|
|
11
|
+
const pathAbsolute = path.join(folder, pathDir);
|
|
12
|
+
let stats;
|
|
13
|
+
try {
|
|
14
|
+
stats = fs.statSync(pathAbsolute);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (stats.isDirectory()) {
|
|
19
|
+
files.push(...getAllFiles(pathAbsolute));
|
|
20
|
+
} else {
|
|
21
|
+
files.push(pathAbsolute);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return files;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function isPortTaken(port) {
|
|
28
|
+
const taken = await new Promise((res, rej) => {
|
|
29
|
+
const tester = net.createServer()
|
|
30
|
+
.once('error', function (err) {
|
|
31
|
+
if (err.code != 'EADDRINUSE') return rej(err)
|
|
32
|
+
res(true)
|
|
33
|
+
})
|
|
34
|
+
.once('listening', function() {
|
|
35
|
+
tester.once('close', function() { res(false) })
|
|
36
|
+
.close()
|
|
37
|
+
})
|
|
38
|
+
.listen(port);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return taken;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function systemHasCommand(command) {
|
|
45
|
+
const isUsingWindows = process.platform == 'win32'
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
if(isUsingWindows) {
|
|
49
|
+
childProcess.execSync('where ' + command, { stdio: 'pipe' })
|
|
50
|
+
} else {
|
|
51
|
+
childProcess.execSync(`[[ $(${command} --version) ]] || { exit 1; } && echo "OK"`, { stdio: 'pipe', shell: '/bin/bash' });
|
|
52
|
+
}
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.log(error);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const checkDeployConditions = (localConfig) => {
|
|
62
|
+
if (Object.keys(localConfig.data).length === 0) {
|
|
63
|
+
throw new Error("No appwrite.json file found in the current directory. Please run this command again in the folder containing your appwrite.json file, or run 'appwrite init project' to link current directory to an Appwrite project.");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function showConsoleLink(serviceName, action, ...ids) {
|
|
68
|
+
const projectId = localConfig.getProject().projectId;
|
|
69
|
+
|
|
70
|
+
const url = new URL(globalConfig.getEndpoint().replace('/v1', '/console'));
|
|
71
|
+
url.pathname += `/project-${projectId}`;
|
|
72
|
+
action = action.toLowerCase();
|
|
73
|
+
|
|
74
|
+
switch (serviceName) {
|
|
75
|
+
case "account":
|
|
76
|
+
url.pathname = url.pathname.replace(`/project-${projectId}`, '');
|
|
77
|
+
url.pathname += getAccountPath(action);
|
|
78
|
+
break;
|
|
79
|
+
case "databases":
|
|
80
|
+
url.pathname += getDatabasePath(action, ids);
|
|
81
|
+
break;
|
|
82
|
+
case "functions":
|
|
83
|
+
url.pathname += getFunctionsPath(action, ids);
|
|
84
|
+
break;
|
|
85
|
+
case "messaging":
|
|
86
|
+
url.pathname += getMessagingPath(action, ids);
|
|
87
|
+
break;
|
|
88
|
+
case "projects":
|
|
89
|
+
url.pathname = url.pathname.replace(`/project-${projectId}`, '');
|
|
90
|
+
url.pathname += getProjectsPath(action, ids);
|
|
91
|
+
break;
|
|
92
|
+
case "storage":
|
|
93
|
+
url.pathname += getBucketsPath(action, ids);
|
|
94
|
+
break;
|
|
95
|
+
case "teams":
|
|
96
|
+
url.pathname += getTeamsPath(action, ids);
|
|
97
|
+
break;
|
|
98
|
+
case "organizations":
|
|
99
|
+
url.pathname += getOrganizationsPath(action, ids);
|
|
100
|
+
break;
|
|
101
|
+
case "users":
|
|
102
|
+
url.pathname += getUsersPath(action, ids);
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
console.log(`${chalk.green.bold("✓ Success:")} ${chalk.green(url)}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function getAccountPath(action) {
|
|
112
|
+
let path = '/account';
|
|
113
|
+
|
|
114
|
+
if (action === 'listsessions') {
|
|
115
|
+
path += '/sessions';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return path;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function getDatabasePath(action, ids) {
|
|
122
|
+
let path = '/databases';
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
if (['get', 'listcollections', 'getcollection', 'listattributes', 'listdocuments', 'getdocument', 'listindexes', 'getdatabaseusage'].includes(action)) {
|
|
126
|
+
path += `/database-${ids[0]}`;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (action === 'getdatabaseusage') {
|
|
130
|
+
path += `/usage`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (['getcollection', 'listattributes', 'listdocuments', 'getdocument', 'listindexes'].includes(action)) {
|
|
134
|
+
path += `/collection-${ids[1]}`;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (action === 'listattributes') {
|
|
138
|
+
path += '/attributes';
|
|
139
|
+
}
|
|
140
|
+
if (action === 'listindexes') {
|
|
141
|
+
path += '/indexes';
|
|
142
|
+
}
|
|
143
|
+
if (action === 'getdocument') {
|
|
144
|
+
path += `/document-${ids[2]}`;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
return path;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function getFunctionsPath(action, ids) {
|
|
152
|
+
let path = '/functions';
|
|
153
|
+
|
|
154
|
+
if (action !== 'list') {
|
|
155
|
+
path += `/function-${ids[0]}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (action === 'getdeployment') {
|
|
159
|
+
path += `/deployment-${ids[1]}`
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (action === 'getexecution' || action === 'listexecution') {
|
|
163
|
+
path += `/executions`
|
|
164
|
+
}
|
|
165
|
+
if (action === 'getfunctionusage') {
|
|
166
|
+
path += `/usage`
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return path;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function getMessagingPath(action, ids) {
|
|
173
|
+
let path = '/messaging';
|
|
174
|
+
|
|
175
|
+
if (['getmessage', 'listmessagelogs'].includes(action)) {
|
|
176
|
+
path += `/message-${ids[0]}`;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (['listproviders', 'getprovider'].includes(action)) {
|
|
180
|
+
path += `/providers`;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (action === 'getprovider') {
|
|
184
|
+
path += `/provider-${ids[0]}`;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (['listtopics', 'gettopic'].includes(action)) {
|
|
188
|
+
path += `/topics`;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (action === 'gettopic') {
|
|
192
|
+
path += `/topic-${ids[0]}`;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return path;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function getProjectsPath(action, ids) {
|
|
199
|
+
let path = '';
|
|
200
|
+
|
|
201
|
+
if (action !== 'list') {
|
|
202
|
+
path += `/project-${ids[0]}`;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (['listkeys', 'getkey'].includes(action)) {
|
|
206
|
+
path += '/overview/keys'
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (['listplatforms', 'getplatform'].includes(action)) {
|
|
210
|
+
path += '/overview/platforms'
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (['listwebhooks', 'getwebhook'].includes(action)) {
|
|
214
|
+
path += '/settings/webhooks'
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (['getplatform', 'getkey', 'getwebhook'].includes(action)) {
|
|
218
|
+
path += `/${ids[1]}`;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return path;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function getBucketsPath(action, ids) {
|
|
225
|
+
let path = '/storage';
|
|
226
|
+
|
|
227
|
+
if (action !== 'listbuckets') {
|
|
228
|
+
path += `/bucket-${ids[0]}`;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (action === 'getbucketusage') {
|
|
232
|
+
path += `/usage`
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (action === 'getfile') {
|
|
236
|
+
path += `/file-${ids[1]}`
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return path;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function getTeamsPath(action, ids) {
|
|
243
|
+
let path = '/auth/teams';
|
|
244
|
+
|
|
245
|
+
if (action !== 'list') {
|
|
246
|
+
path += `/team-${ids[0]}`;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return path;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function getOrganizationsPath(action, ids) {
|
|
253
|
+
let path = `/organization-${ids[0]}`;
|
|
254
|
+
|
|
255
|
+
if (action === 'list') {
|
|
256
|
+
path = '/account/organizations';
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return path;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function getUsersPath(action, ids) {
|
|
263
|
+
let path = '/auth';
|
|
264
|
+
|
|
265
|
+
if (action !== 'list') {
|
|
266
|
+
path += `/user-${ids[0]}`;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (action === 'listsessions') {
|
|
270
|
+
path += 'sessions';
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return path;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function isCloud() {
|
|
277
|
+
const endpoint = globalConfig.getEndpoint() || "https://cloud.appwrite.io/v1";
|
|
278
|
+
const hostname = new URL(endpoint).hostname;
|
|
279
|
+
return hostname.endsWith('appwrite.io');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
module.exports = {
|
|
283
|
+
getAllFiles,
|
|
284
|
+
isPortTaken,
|
|
285
|
+
systemHasCommand,
|
|
286
|
+
checkDeployConditions,
|
|
287
|
+
showConsoleLink,
|
|
288
|
+
isCloud
|
|
289
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const validateRequired = (resource, value) => {
|
|
2
|
+
if (Array.isArray(value)) {
|
|
3
|
+
if (value.length <= 0) {
|
|
4
|
+
return `Please select at least one ${resource}`;
|
|
5
|
+
}
|
|
6
|
+
} else {
|
|
7
|
+
if (value === undefined || value === null || value === 0 || (typeof value === "string" && value.trim() === '')) {
|
|
8
|
+
return `${resource} is required`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
validateRequired
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chirag-appwrite-cli",
|
|
3
|
+
"homepage": "https://appwrite.io/support",
|
|
4
|
+
"description": "Repo short description goes here",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"license": "BSD-3-Clause",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"bin": {
|
|
9
|
+
"appwrite": "index.js"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": ""
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
17
|
+
"linux-x64": "pkg -t node18-linux-x64 -o build/appwrite-cli-linux-x64 package.json",
|
|
18
|
+
"linux-arm64": "pkg -t node18-linux-arm64 -o build/appwrite-cli-linux-arm64 package.json",
|
|
19
|
+
"mac-x64": "pkg -t node18-macos-x64 -o build/appwrite-cli-darwin-x64 package.json",
|
|
20
|
+
"mac-arm64": "pkg -t node18-macos-arm64 -o build/appwrite-cli-darwin-arm64 package.json",
|
|
21
|
+
"windows-x64": "pkg -t node18-win-x64 -o build/appwrite-cli-win-x64.exe package.json",
|
|
22
|
+
"windows-arm64": "pkg -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe package.json"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"undici": "^5.28.2",
|
|
26
|
+
"ejs": "^3.1.9",
|
|
27
|
+
"chalk": "4.1.2",
|
|
28
|
+
"cli-progress": "^3.12.0",
|
|
29
|
+
"cli-table3": "^0.6.2",
|
|
30
|
+
"commander": "^9.2.0",
|
|
31
|
+
"form-data": "^4.0.0",
|
|
32
|
+
"json-bigint": "^1.0.0",
|
|
33
|
+
"inquirer": "^8.2.4",
|
|
34
|
+
"inquirer-search-list": "^1.2.6",
|
|
35
|
+
"tar": "^6.1.11",
|
|
36
|
+
"ignore": "^5.2.0",
|
|
37
|
+
"chokidar": "^3.6.0",
|
|
38
|
+
"tail": "^2.2.6",
|
|
39
|
+
"dotenv": "^16.4.5"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"pkg": "5.8.1"
|
|
43
|
+
},
|
|
44
|
+
"pkg": {
|
|
45
|
+
"scripts": [
|
|
46
|
+
"index.js",
|
|
47
|
+
"lib/**/*.js"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
|
|
5
|
+
"homepage": "https://github.com/appwrite/sdk-for-cli",
|
|
6
|
+
"license": "BSD-3-Clause",
|
|
7
|
+
"architecture": {
|
|
8
|
+
"64bit": {
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/0.16.0/appwrite-cli-win-x64.exe",
|
|
10
|
+
"bin": [
|
|
11
|
+
[
|
|
12
|
+
"appwrite-cli-win-x64.exe",
|
|
13
|
+
"appwrite"
|
|
14
|
+
]
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"arm64": {
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/0.16.0/appwrite-cli-win-arm64.exe",
|
|
19
|
+
"bin": [
|
|
20
|
+
[
|
|
21
|
+
"appwrite-cli-win-arm64.exe",
|
|
22
|
+
"appwrite"
|
|
23
|
+
]
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"checkver": {
|
|
28
|
+
"github": "https://github.com/appwrite/sdk-for-cli"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Appwrite
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
d="M24.4429 16.4322V21.9096H10.7519C6.76318 21.9096 3.28044 19.7067 1.4171 16.4322C1.14622 15.9561 0.909137 15.4567 0.710264 14.9383C0.319864 13.9225 0.0744552 12.8325 0 11.6952V10.2143C0.0161646 9.96089 0.0416361 9.70942 0.0749451 9.46095C0.143032 8.95105 0.245898 8.45211 0.381093 7.96711C1.66006 3.36909 5.81877 0 10.7519 0C15.6851 0 19.8433 3.36909 21.1223 7.96711H15.2682C14.3072 6.4683 12.6437 5.4774 10.7519 5.4774C8.86017 5.4774 7.19668 6.4683 6.23562 7.96711C5.9427 8.42274 5.71542 8.92516 5.56651 9.46095C5.43425 9.93599 5.36371 10.4369 5.36371 10.9548C5.36371 12.5248 6.01324 13.94 7.05463 14.9383C8.01961 15.865 9.32061 16.4322 10.7519 16.4322H24.4429Z"
|
|
4
|
+
fill="#FD366E" />
|
|
5
|
+
<path
|
|
6
|
+
d="M24.4429 9.46094V14.9383H14.4492C15.4906 13.94 16.1401 12.5248 16.1401 10.9548C16.1401 10.4369 16.0696 9.93598 15.9373 9.46094H24.4429Z"
|
|
7
|
+
fill="#FD366E" />
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 630">
|
|
3
|
+
<rect width="630" height="630" fill="#f7df1e"/>
|
|
4
|
+
<path d="m423.2 492.19c12.69 20.72 29.2 35.95 58.4 35.95 24.53 0 40.2-12.26 40.2-29.2 0-20.3-16.1-27.49-43.1-39.3l-14.8-6.35c-42.72-18.2-71.1-41-71.1-89.2 0-44.4 33.83-78.2 86.7-78.2 37.64 0 64.7 13.1 84.2 47.4l-46.1 29.6c-10.15-18.2-21.1-25.37-38.1-25.37-17.34 0-28.33 11-28.33 25.37 0 17.76 11 24.95 36.4 35.95l14.8 6.34c50.3 21.57 78.7 43.56 78.7 93 0 53.3-41.87 82.5-98.1 82.5-54.98 0-90.5-26.2-107.88-60.54zm-209.13 5.13c9.3 16.5 17.76 30.45 38.1 30.45 19.45 0 31.72-7.61 31.72-37.2v-201.3h59.2v202.1c0 61.3-35.94 89.2-88.4 89.2-47.4 0-74.85-24.53-88.81-54.075z"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/images/appwrite.svg" />
|
|
7
|
+
<title>Appwrite + Javascript </title>
|
|
8
|
+
<link rel="stylesheet" href="./style/app.css">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin />
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css2?family=Fira+Code&family=Inter:opsz,wght@14..32,100..900&family=Poppins:wght@300;400&display=swap"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link rel="icon" type="image/svg+xml" href="/appwrite.svg" />
|
|
16
|
+
</head>
|
|
17
|
+
<body class="bg-[#FAFAFB] font-[Inter] text-sm text-[#56565C]">
|
|
18
|
+
<main class="checker-background flex flex-col items-center p-5" id="main">
|
|
19
|
+
<div class="mt-25 flex w-full max-w-[40em] items-center justify-center lg:mt-34">
|
|
20
|
+
<div class="rounded-[25%] border border-[#19191C0A] bg-[#F9F9FA] p-3 shadow-[0px_9.36px_9.36px_0px_hsla(0,0%,0%,0.04)]">
|
|
21
|
+
<div class="rounded-[25%] border border-[#FAFAFB] bg-white p-5 shadow-[0px_2px_12px_0px_hsla(0,0%,0%,0.03)] lg:p-9">
|
|
22
|
+
<img alt="Javascript logo" src="./images/javascript.svg" class="h-14 w-14" width="56" height="56">
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="flex w-38 items-center transition-opacity duration-2500 opacity-0" id="success-icon">
|
|
26
|
+
<div class="to-[rgba(253, 54, 110, 0.15)] h-[1px] flex-1 bg-gradient-to-l from-[#f02e65]"></div>
|
|
27
|
+
<div class="icon-check flex h-5 w-5 items-center justify-center rounded-full border border-[#FD366E52] bg-[#FD366E14] text-[#FD366E]"></div>
|
|
28
|
+
<div class="to-[rgba(253, 54, 110, 0.15)] h-[1px] flex-1 bg-gradient-to-r from-[#f02e65]"></div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="rounded-[25%] border border-[#19191C0A] bg-[#F9F9FA] p-3 shadow-[0px_9.36px_9.36px_0px_hsla(0,0%,0%,0.04)]">
|
|
31
|
+
<div class="rounded-[25%] border border-[#FAFAFB] bg-white p-5 shadow-[0px_2px_12px_0px_hsla(0,0%,0%,0.03)] lg:p-9">
|
|
32
|
+
<img alt="Appwrite logo" src="./images/appwrite.svg" class="h-14 w-14" width="56" height="56">
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<section class="mt-12 flex h-52 flex-col items-center" id="status-section">
|
|
38
|
+
<div class="flex flex-row gap-4" id="loading-spinner" style="display: none;">
|
|
39
|
+
<div role="status">
|
|
40
|
+
<svg aria-hidden="true" class="h-5 w-5 animate-spin fill-[#FD366E] text-gray-200 dark:text-gray-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
|
|
42
|
+
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
|
|
43
|
+
</svg>
|
|
44
|
+
<span class="sr-only">Loading...</span>
|
|
45
|
+
</div>
|
|
46
|
+
<span>Waiting for connection...</span>
|
|
47
|
+
</div>
|
|
48
|
+
<h1 class="font-[Poppins] text-2xl font-light text-[#2D2D31]" id="status-message">Check connection</h1>
|
|
49
|
+
<p class="mt-2 mb-8" id="status-description">Send a ping to verify the connection</p>
|
|
50
|
+
<button class="cursor-pointer rounded-md bg-[#FD366E] px-2.5 py-1.5" id="ping-button">
|
|
51
|
+
<span class="text-white">Send a ping</span>
|
|
52
|
+
</button>
|
|
53
|
+
</section>
|
|
54
|
+
|
|
55
|
+
<div class="grid grid-rows-3 gap-7 lg:grid-cols-3 lg:grid-rows-none">
|
|
56
|
+
<div class="flex h-full w-72 flex-col gap-2 rounded-md border border-[#EDEDF0] bg-white p-4">
|
|
57
|
+
<h2 class="text-xl font-light text-[#2D2D31]">Edit your app</h2>
|
|
58
|
+
<p>Edit <code class="rounded-sm bg-[#EDEDF0] p-1">app/page.js</code> to get started with building your app.</p>
|
|
59
|
+
</div>
|
|
60
|
+
<a href="https://cloud.appwrite.io" target="_blank" rel="noopener noreferrer">
|
|
61
|
+
<div class="flex h-full w-72 flex-col gap-2 rounded-md border border-[#EDEDF0] bg-white p-4">
|
|
62
|
+
<div class="flex flex-row items-center justify-between">
|
|
63
|
+
<h2 class="text-xl font-light text-[#2D2D31]">Go to console</h2>
|
|
64
|
+
<span class="icon-arrow-right text-[#D8D8DB]"></span>
|
|
65
|
+
</div>
|
|
66
|
+
<p>Navigate to the console to control and oversee the Appwrite services.</p>
|
|
67
|
+
</div>
|
|
68
|
+
</a>
|
|
69
|
+
<a href="https://appwrite.io/docs" target="_blank" rel="noopener noreferrer">
|
|
70
|
+
<div class="flex h-full w-72 flex-col gap-2 rounded-md border border-[#EDEDF0] bg-white p-4">
|
|
71
|
+
<div class="flex flex-row items-center justify-between">
|
|
72
|
+
<h2 class="text-xl font-light text-[#2D2D31]">Explore docs</h2>
|
|
73
|
+
<span class="icon-arrow-right text-[#D8D8DB]"></span>
|
|
74
|
+
</div>
|
|
75
|
+
<p>Discover the full power of Appwrite by diving into our documentation.</p>
|
|
76
|
+
</div>
|
|
77
|
+
</a>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<aside class="fixed bottom-0 flex w-full cursor-pointer border-t border-[#EDEDF0] bg-white">
|
|
81
|
+
<details id="logs-details" class="w-full">
|
|
82
|
+
<summary class="flex w-full flex-row justify-between p-4 marker:content-none">
|
|
83
|
+
<div class="flex gap-2">
|
|
84
|
+
<span class="font-semibold">Logs</span>
|
|
85
|
+
<div class="flex items-center rounded-md bg-[#E6E6E6] px-2" id="log-count" style="display: none;">
|
|
86
|
+
<span class="font-semibold" id="log-count-value"></span>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="icon">
|
|
90
|
+
<span class="icon-cheveron-down" aria-hidden="true"></span>
|
|
91
|
+
</div>
|
|
92
|
+
</summary>
|
|
93
|
+
<div class="flex w-full flex-col lg:flex-row">
|
|
94
|
+
<div class="flex flex-col border-r border-[#EDEDF0]">
|
|
95
|
+
<div class="border-y border-[#EDEDF0] bg-[#FAFAFB] px-4 py-2 text-[#97979B]">Project</div>
|
|
96
|
+
<div class="grid grid-cols-2 gap-4 p-4">
|
|
97
|
+
<div class="flex flex-col">
|
|
98
|
+
<span class="text-[#97979B]">Endpoint</span>
|
|
99
|
+
<span class="truncate" id="project-endpoint"></span>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="flex flex-col">
|
|
102
|
+
<span class="text-[#97979B]">Project-ID</span>
|
|
103
|
+
<span class="truncate" id="project-id"></span>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="flex flex-col">
|
|
106
|
+
<span class="text-[#97979B]">Project name</span>
|
|
107
|
+
<span class="truncate" id="project-name"></span>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="flex-grow">
|
|
112
|
+
<table class="w-full">
|
|
113
|
+
<thead>
|
|
114
|
+
<tr class="border-y border-[#EDEDF0] bg-[#FAFAFB] text-[#97979B]">
|
|
115
|
+
<td class="w-52 py-2 pl-4">Date</td>
|
|
116
|
+
<td>Status</td>
|
|
117
|
+
<td>Method</td>
|
|
118
|
+
<td class="hidden lg:table-cell">Path</td>
|
|
119
|
+
<td class="hidden lg:table-cell">Response</td>
|
|
120
|
+
</tr>
|
|
121
|
+
</thead>
|
|
122
|
+
<tbody id="log-table">
|
|
123
|
+
<tr>
|
|
124
|
+
<td class="py-2 pl-4 font-[Fira_Code]">There are no logs to show</td>
|
|
125
|
+
</tr>
|
|
126
|
+
</tbody>
|
|
127
|
+
</table>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</details>
|
|
131
|
+
</aside>
|
|
132
|
+
</main>
|
|
133
|
+
|
|
134
|
+
<script type="module">
|
|
135
|
+
import { client } from "./lib/appwrite.js";
|
|
136
|
+
import { AppwriteException } from "appwrite";
|
|
137
|
+
import "@appwrite.io/pink-icons";
|
|
138
|
+
|
|
139
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
140
|
+
let logs = [];
|
|
141
|
+
let status = "idle";
|
|
142
|
+
let showLogs = false;
|
|
143
|
+
|
|
144
|
+
const detailsRef = document.getElementById("logs-details");
|
|
145
|
+
const main = document.getElementById("main");
|
|
146
|
+
const statusMessage = document.getElementById("status-message");
|
|
147
|
+
const statusDescription = document.getElementById("status-description");
|
|
148
|
+
const pingButton = document.getElementById("ping-button");
|
|
149
|
+
const loadingSpinner = document.getElementById("loading-spinner");
|
|
150
|
+
const successIcon = document.getElementById("success-icon");
|
|
151
|
+
const logCount = document.getElementById("log-count");
|
|
152
|
+
const logCountValue = document.getElementById("log-count-value");
|
|
153
|
+
const logTable = document.getElementById("log-table");
|
|
154
|
+
|
|
155
|
+
const updateHeight = () => {
|
|
156
|
+
if (detailsRef) {
|
|
157
|
+
const height = detailsRef.clientHeight;
|
|
158
|
+
main.style.marginBottom = `${height}px`;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
window.addEventListener("resize", updateHeight);
|
|
163
|
+
|
|
164
|
+
detailsRef.addEventListener("toggle", updateHeight);
|
|
165
|
+
|
|
166
|
+
async function sendPing() {
|
|
167
|
+
if (status === "loading") return;
|
|
168
|
+
status = "loading";
|
|
169
|
+
statusMessage.textContent = "";
|
|
170
|
+
statusDescription.textContent = "";
|
|
171
|
+
pingButton.style.display = "none";
|
|
172
|
+
loadingSpinner.style.display = "flex";
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
const result = await client.ping();
|
|
176
|
+
const log = {
|
|
177
|
+
date: new Date(),
|
|
178
|
+
method: "GET",
|
|
179
|
+
path: "/v1/ping",
|
|
180
|
+
status: 200,
|
|
181
|
+
response: JSON.stringify(result),
|
|
182
|
+
};
|
|
183
|
+
logs.unshift(log);
|
|
184
|
+
status = "success";
|
|
185
|
+
statusMessage.textContent = "Congratulations!";
|
|
186
|
+
statusDescription.textContent = "You connected your app successfully.";
|
|
187
|
+
|
|
188
|
+
updateLogs();
|
|
189
|
+
} catch (err) {
|
|
190
|
+
const log = {
|
|
191
|
+
date: new Date(),
|
|
192
|
+
method: "GET",
|
|
193
|
+
path: "/v1/ping",
|
|
194
|
+
status: err instanceof AppwriteException ? err.code : 500,
|
|
195
|
+
response: err instanceof AppwriteException ? err.message : "Something went wrong",
|
|
196
|
+
};
|
|
197
|
+
logs.unshift(log);
|
|
198
|
+
status = "error";
|
|
199
|
+
statusMessage.textContent = "Check connection";
|
|
200
|
+
statusDescription.textContent = "Send a ping to verify the connection";
|
|
201
|
+
updateLogs();
|
|
202
|
+
}
|
|
203
|
+
pingButton.style.display = "block";
|
|
204
|
+
loadingSpinner.style.display = "none";
|
|
205
|
+
successIcon.style.opacity = status === "success" ? "100" : "0";
|
|
206
|
+
showLogs = true;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const updateLogs = () => {
|
|
210
|
+
logTable.innerHTML = "";
|
|
211
|
+
if (logs.length > 0) {
|
|
212
|
+
logCount.style.display = "flex";
|
|
213
|
+
logCountValue.textContent = logs.length;
|
|
214
|
+
logs.forEach((log) => {
|
|
215
|
+
const row = document.createElement("tr");
|
|
216
|
+
row.innerHTML = `
|
|
217
|
+
<td class="py-2 pl-4 font-[Fira_Code]">${log.date.toLocaleString("en-US", {
|
|
218
|
+
month: "short",
|
|
219
|
+
day: "numeric",
|
|
220
|
+
hour: "2-digit",
|
|
221
|
+
minute: "2-digit",
|
|
222
|
+
})}</td>
|
|
223
|
+
<td>
|
|
224
|
+
<div class="w-fit rounded-sm ${log.status > 400 ? "bg-[#FF453A3D] text-[#B31212]" : "bg-[#10B9813D] text-[#0A714F]"} px-1">
|
|
225
|
+
${log.status}
|
|
226
|
+
</div>
|
|
227
|
+
</td>
|
|
228
|
+
<td>${log.method}</td>
|
|
229
|
+
<td class="hidden lg:table-cell">${log.path}</td>
|
|
230
|
+
<td class="hidden font-[Fira_Code] lg:table-cell">${log.response}</td>
|
|
231
|
+
`;
|
|
232
|
+
logTable.appendChild(row);
|
|
233
|
+
});
|
|
234
|
+
} else {
|
|
235
|
+
logCount.style.display = "none";
|
|
236
|
+
const row = document.createElement("tr");
|
|
237
|
+
row.innerHTML = `<td class="py-2 pl-4 font-[Fira_Code]">There are no logs to show</td>`;
|
|
238
|
+
logTable.appendChild(row);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
pingButton.addEventListener("click", sendPing);
|
|
243
|
+
document.getElementById('project-endpoint').textContent = import.meta.env.VITE_APPWRITE_ENDPOINT;
|
|
244
|
+
document.getElementById('project-id').textContent = import.meta.env.VITE_APPWRITE_PROJECT_ID;
|
|
245
|
+
document.getElementById('project-name').textContent = import.meta.env.VITE_APPWRITE_PROJECT_NAME;
|
|
246
|
+
updateHeight();
|
|
247
|
+
});
|
|
248
|
+
</script>
|
|
249
|
+
</body>
|
|
250
|
+
</html>
|