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
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
const Tail = require('tail').Tail;
|
|
2
|
+
const { parse: parseDotenv } = require('dotenv');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const ignore = require("ignore");
|
|
5
|
+
const tar = require("tar");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const chokidar = require('chokidar');
|
|
8
|
+
const inquirer = require("inquirer");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const { Command } = require("commander");
|
|
11
|
+
const { localConfig, globalConfig } = require("../config");
|
|
12
|
+
const { paginate } = require('../paginate');
|
|
13
|
+
const { functionsListVariables } = require('./functions');
|
|
14
|
+
const { questionsRunFunctions } = require("../questions");
|
|
15
|
+
const { actionRunner, success, log, warn, error, hint, commandDescriptions, drawTable } = require("../parser");
|
|
16
|
+
const { systemHasCommand, isPortTaken, getAllFiles } = require('../utils');
|
|
17
|
+
const { runtimeNames, systemTools, JwtManager, Queue } = require('../emulation/utils');
|
|
18
|
+
const { dockerStop, dockerCleanup, dockerStart, dockerBuild, dockerPull } = require('../emulation/docker');
|
|
19
|
+
|
|
20
|
+
const runFunction = async ({ port, functionId, withVariables, reload, userId } = {}) => {
|
|
21
|
+
// Selection
|
|
22
|
+
if(!functionId) {
|
|
23
|
+
const answers = await inquirer.prompt(questionsRunFunctions[0]);
|
|
24
|
+
functionId = answers.function;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const functions = localConfig.getFunctions();
|
|
28
|
+
const func = functions.find((f) => f.$id === functionId);
|
|
29
|
+
if (!func) {
|
|
30
|
+
throw new Error("Function '" + functionId + "' not found.")
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const runtimeName = func.runtime.split("-").slice(0, -1).join("-");
|
|
34
|
+
const tool = systemTools[runtimeName];
|
|
35
|
+
|
|
36
|
+
// Configuration: Port
|
|
37
|
+
if(port) {
|
|
38
|
+
port = +port;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if(isNaN(port)) {
|
|
42
|
+
port = null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if(port) {
|
|
46
|
+
const taken = await isPortTaken(port);
|
|
47
|
+
|
|
48
|
+
if(taken) {
|
|
49
|
+
error(`Port ${port} is already in use by another process.`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if(!port) {
|
|
55
|
+
let portFound = false;
|
|
56
|
+
port = 3000;
|
|
57
|
+
while(port < 3100) {
|
|
58
|
+
const taken = await isPortTaken(port);
|
|
59
|
+
if(!taken) {
|
|
60
|
+
portFound = true;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
port++;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if(!portFound) {
|
|
68
|
+
error("Could not find an available port. Please select a port with 'appwrite run --port YOUR_PORT' command.");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Configuration: Engine
|
|
74
|
+
if(!systemHasCommand('docker')) {
|
|
75
|
+
return error("Docker Engine is required for local development. Please install Docker using: https://docs.docker.com/engine/install/");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Settings
|
|
79
|
+
const settings = {
|
|
80
|
+
runtime: func.runtime,
|
|
81
|
+
entrypoint: func.entrypoint,
|
|
82
|
+
path: func.path,
|
|
83
|
+
commands: func.commands,
|
|
84
|
+
scopes: func.scopes ?? []
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
drawTable([settings]);
|
|
88
|
+
log("If you wish to change your local settings, update the appwrite.json file and rerun the 'appwrite run' command.");
|
|
89
|
+
hint("Permissions, events, CRON and timeouts dont apply when running locally.");
|
|
90
|
+
|
|
91
|
+
await dockerCleanup(func.$id);
|
|
92
|
+
|
|
93
|
+
process.on('SIGINT', async () => {
|
|
94
|
+
log('Cleaning up ...');
|
|
95
|
+
await dockerCleanup(func.$id);
|
|
96
|
+
success("Local function successfully stopped.");
|
|
97
|
+
process.exit();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const logsPath = path.join(localConfig.getDirname(), func.path, '.appwrite/logs.txt');
|
|
101
|
+
const errorsPath = path.join(localConfig.getDirname(), func.path, '.appwrite/errors.txt');
|
|
102
|
+
|
|
103
|
+
if(!fs.existsSync(path.dirname(logsPath))) {
|
|
104
|
+
fs.mkdirSync(path.dirname(logsPath), { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!fs.existsSync(logsPath)) {
|
|
108
|
+
fs.writeFileSync(logsPath, '');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!fs.existsSync(errorsPath)) {
|
|
112
|
+
fs.writeFileSync(errorsPath, '');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const userVariables = {};
|
|
116
|
+
const allVariables = {};
|
|
117
|
+
|
|
118
|
+
if(withVariables) {
|
|
119
|
+
try {
|
|
120
|
+
const { variables: remoteVariables } = await paginate(functionsListVariables, {
|
|
121
|
+
functionId: func['$id'],
|
|
122
|
+
parseOutput: false
|
|
123
|
+
}, 100, 'variables');
|
|
124
|
+
|
|
125
|
+
remoteVariables.forEach((v) => {
|
|
126
|
+
allVariables[v.key] = v.value;
|
|
127
|
+
userVariables[v.key] = v.value;
|
|
128
|
+
});
|
|
129
|
+
} catch(err) {
|
|
130
|
+
warn("Remote variables not fetched. Production environment variables will not be available. Reason: " + err.message);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const functionPath = path.join(localConfig.getDirname(), func.path);
|
|
135
|
+
const envPath = path.join(functionPath, '.env');
|
|
136
|
+
if(fs.existsSync(envPath)) {
|
|
137
|
+
const env = parseDotenv(fs.readFileSync(envPath).toString() ?? '');
|
|
138
|
+
|
|
139
|
+
Object.keys(env).forEach((key) => {
|
|
140
|
+
allVariables[key] = env[key];
|
|
141
|
+
userVariables[key] = env[key];
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
allVariables['APPWRITE_FUNCTION_API_ENDPOINT'] = globalConfig.getFrom('endpoint');
|
|
146
|
+
allVariables['APPWRITE_FUNCTION_ID'] = func.$id;
|
|
147
|
+
allVariables['APPWRITE_FUNCTION_NAME'] = func.name;
|
|
148
|
+
allVariables['APPWRITE_FUNCTION_DEPLOYMENT'] = ''; // TODO: Implement when relevant
|
|
149
|
+
allVariables['APPWRITE_FUNCTION_PROJECT_ID'] = localConfig.getProject().projectId;
|
|
150
|
+
allVariables['APPWRITE_FUNCTION_RUNTIME_NAME'] = runtimeNames[runtimeName] ?? '';
|
|
151
|
+
allVariables['APPWRITE_FUNCTION_RUNTIME_VERSION'] = func.runtime;
|
|
152
|
+
|
|
153
|
+
try {
|
|
154
|
+
await JwtManager.setup(userId, func.scopes ?? []);
|
|
155
|
+
} catch(err) {
|
|
156
|
+
warn("Dynamic API key not generated. Header x-appwrite-key will not be set. Reason: " + err.message);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const headers = {};
|
|
160
|
+
headers['x-appwrite-key'] = JwtManager.functionJwt ?? '';
|
|
161
|
+
headers['x-appwrite-trigger'] = 'http';
|
|
162
|
+
headers['x-appwrite-event'] = '';
|
|
163
|
+
headers['x-appwrite-user-id'] = userId ?? '';
|
|
164
|
+
headers['x-appwrite-user-jwt'] = JwtManager.userJwt ?? '';
|
|
165
|
+
allVariables['OPEN_RUNTIMES_HEADERS'] = JSON.stringify(headers);
|
|
166
|
+
|
|
167
|
+
if(Object.keys(userVariables).length > 0) {
|
|
168
|
+
drawTable(Object.keys(userVariables).map((key) => ({
|
|
169
|
+
key,
|
|
170
|
+
value: userVariables[key].split("").filter((_, i) => i < 16).map(() => "*").join("")
|
|
171
|
+
})));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
await dockerPull(func);
|
|
175
|
+
|
|
176
|
+
new Tail(logsPath).on("line", function(data) {
|
|
177
|
+
process.stdout.write(chalk.white(`${data}\n`));
|
|
178
|
+
});
|
|
179
|
+
new Tail(errorsPath).on("line", function(data) {
|
|
180
|
+
process.stdout.write(chalk.white(`${data}\n`));
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
if(reload) {
|
|
184
|
+
const ignorer = ignore();
|
|
185
|
+
ignorer.add('.appwrite');
|
|
186
|
+
ignorer.add('code.tar.gz');
|
|
187
|
+
|
|
188
|
+
if (func.ignore) {
|
|
189
|
+
ignorer.add(func.ignore);
|
|
190
|
+
} else if (fs.existsSync(path.join(functionPath, '.gitignore'))) {
|
|
191
|
+
ignorer.add(fs.readFileSync(path.join(functionPath, '.gitignore')).toString());
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
chokidar.watch('.', {
|
|
195
|
+
cwd: path.join(localConfig.getDirname(), func.path),
|
|
196
|
+
ignoreInitial: true,
|
|
197
|
+
ignored: (xpath) => {
|
|
198
|
+
const relativePath = path.relative(functionPath, xpath);
|
|
199
|
+
|
|
200
|
+
if(!relativePath) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
return ignorer.ignores(relativePath);
|
|
204
|
+
}
|
|
205
|
+
}).on('all', async (_event, filePath) => {
|
|
206
|
+
Queue.push(filePath);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
Queue.events.on('reload', async ({ files }) => {
|
|
211
|
+
Queue.lock();
|
|
212
|
+
|
|
213
|
+
try {
|
|
214
|
+
await dockerStop(func.$id);
|
|
215
|
+
|
|
216
|
+
const dependencyFile = files.find((filePath) => tool.dependencyFiles.includes(filePath));
|
|
217
|
+
if(tool.isCompiled || dependencyFile) {
|
|
218
|
+
log(`Rebuilding the function due to file changes ...`);
|
|
219
|
+
await dockerBuild(func, allVariables);
|
|
220
|
+
|
|
221
|
+
if(!Queue.isEmpty()) {
|
|
222
|
+
Queue.unlock();
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
await dockerStart(func, allVariables, port);
|
|
227
|
+
} else {
|
|
228
|
+
log('Hot-swapping function.. Files with change are ' + files.join(', '));
|
|
229
|
+
|
|
230
|
+
const hotSwapPath = path.join(functionPath, '.appwrite/hot-swap');
|
|
231
|
+
const buildPath = path.join(functionPath, '.appwrite/build.tar.gz');
|
|
232
|
+
|
|
233
|
+
// Prepare temp folder
|
|
234
|
+
if (!fs.existsSync(hotSwapPath)) {
|
|
235
|
+
fs.mkdirSync(hotSwapPath, { recursive: true });
|
|
236
|
+
} else {
|
|
237
|
+
fs.rmSync(hotSwapPath, { recursive: true, force: true });
|
|
238
|
+
fs.mkdirSync(hotSwapPath, { recursive: true });
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
await tar
|
|
242
|
+
.extract({
|
|
243
|
+
keep: true,
|
|
244
|
+
gzip: true,
|
|
245
|
+
sync: true,
|
|
246
|
+
cwd: hotSwapPath,
|
|
247
|
+
file: buildPath
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const ignorer = ignore();
|
|
251
|
+
ignorer.add('.appwrite');
|
|
252
|
+
if (func.ignore) {
|
|
253
|
+
ignorer.add(func.ignore);
|
|
254
|
+
} else if (fs.existsSync(path.join(functionPath, '.gitignore'))) {
|
|
255
|
+
ignorer.add(fs.readFileSync(path.join(functionPath, '.gitignore')).toString());
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const filesToCopy = getAllFiles(functionPath).map((file) => path.relative(functionPath, file)).filter((file) => !ignorer.ignores(file));
|
|
259
|
+
for(const f of filesToCopy) {
|
|
260
|
+
const filePath = path.join(hotSwapPath, f);
|
|
261
|
+
if (fs.existsSync(filePath)) {
|
|
262
|
+
fs.rmSync(filePath, { force: true });
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const fileDir = path.dirname(filePath);
|
|
266
|
+
if (!fs.existsSync(fileDir)) {
|
|
267
|
+
fs.mkdirSync(fileDir, { recursive: true });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const sourcePath = path.join(functionPath, f);
|
|
271
|
+
fs.copyFileSync(sourcePath, filePath);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
await tar
|
|
275
|
+
.create({
|
|
276
|
+
gzip: true,
|
|
277
|
+
sync: true,
|
|
278
|
+
cwd: hotSwapPath,
|
|
279
|
+
file: buildPath
|
|
280
|
+
}, ['.']);
|
|
281
|
+
|
|
282
|
+
await dockerStart(func, allVariables, port);
|
|
283
|
+
}
|
|
284
|
+
} catch(err) {
|
|
285
|
+
console.error(err);
|
|
286
|
+
} finally {
|
|
287
|
+
Queue.unlock();
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
Queue.lock();
|
|
292
|
+
|
|
293
|
+
log('Building function using Docker ...');
|
|
294
|
+
await dockerBuild(func, allVariables);
|
|
295
|
+
|
|
296
|
+
if(!Queue.isEmpty()) {
|
|
297
|
+
Queue.unlock();
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
log('Starting function using Docker ...');
|
|
302
|
+
hint('Function automatically restarts when you edit your code.');
|
|
303
|
+
await dockerStart(func, allVariables, port);
|
|
304
|
+
|
|
305
|
+
Queue.unlock();
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const run = new Command("run")
|
|
309
|
+
.description(commandDescriptions['run'])
|
|
310
|
+
.configureHelp({
|
|
311
|
+
helpWidth: process.stdout.columns || 80
|
|
312
|
+
})
|
|
313
|
+
.action(actionRunner(async (_options, command) => {
|
|
314
|
+
command.help();
|
|
315
|
+
}));
|
|
316
|
+
|
|
317
|
+
run
|
|
318
|
+
.command("function")
|
|
319
|
+
.alias("functions")
|
|
320
|
+
.description("Run functions in the current directory.")
|
|
321
|
+
.option(`--function-id <function-id>`, `ID of function to run`)
|
|
322
|
+
.option(`--port <port>`, `Local port`)
|
|
323
|
+
.option(`--user-id <user-id>`, `ID of user to impersonate`)
|
|
324
|
+
.option(`--with-variables`, `Run with function variables from function settings`)
|
|
325
|
+
.option(`--no-reload`, `Prevent live reloading of server when changes are made to function files`)
|
|
326
|
+
.action(actionRunner(runFunction));
|
|
327
|
+
|
|
328
|
+
module.exports = {
|
|
329
|
+
run
|
|
330
|
+
}
|