appwrite-cli 8.2.2 → 9.0.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/CHANGELOG.md +12 -0
- package/README.md +5 -5
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-email-password-session.md +3 -3
- package/docs/examples/account/create-email-token.md +3 -4
- package/docs/examples/account/create-jwt.md +1 -0
- package/docs/examples/account/create-magic-url-token.md +3 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -2
- package/docs/examples/account/create-mfa-challenge.md +2 -2
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/create-o-auth-2-session.md +2 -0
- package/docs/examples/account/create-o-auth-2-token.md +2 -0
- package/docs/examples/account/create-phone-token.md +3 -3
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-push-target.md +3 -4
- package/docs/examples/account/create-recovery.md +3 -3
- package/docs/examples/account/create-session.md +3 -3
- package/docs/examples/account/create-verification.md +2 -2
- package/docs/examples/account/create.md +3 -4
- package/docs/examples/account/delete-identity.md +2 -2
- package/docs/examples/account/delete-mfa-authenticator.md +2 -2
- package/docs/examples/account/delete-push-target.md +2 -2
- package/docs/examples/account/delete-session.md +2 -2
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +2 -2
- package/docs/examples/account/list-identities.md +1 -2
- package/docs/examples/account/list-logs.md +1 -2
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-email.md +3 -3
- package/docs/examples/account/update-magic-url-session.md +3 -0
- package/docs/examples/account/update-mfa-authenticator.md +3 -3
- package/docs/examples/account/update-mfa-challenge.md +3 -3
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/update-mfa.md +2 -0
- package/docs/examples/account/update-name.md +2 -2
- package/docs/examples/account/update-password.md +2 -3
- package/docs/examples/account/update-phone-session.md +3 -3
- package/docs/examples/account/update-phone-verification.md +3 -3
- package/docs/examples/account/update-phone.md +3 -3
- package/docs/examples/account/update-prefs.md +2 -2
- package/docs/examples/account/update-push-target.md +3 -3
- package/docs/examples/account/update-recovery.md +4 -4
- package/docs/examples/account/update-session.md +2 -2
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +3 -3
- package/docs/examples/avatars/get-browser.md +2 -5
- package/docs/examples/avatars/get-credit-card.md +2 -5
- package/docs/examples/avatars/get-favicon.md +2 -2
- package/docs/examples/avatars/get-flag.md +2 -5
- package/docs/examples/avatars/get-image.md +2 -4
- package/docs/examples/avatars/get-initials.md +1 -5
- package/docs/examples/avatars/get-qr.md +2 -0
- package/docs/examples/console/get-resource.md +3 -3
- package/docs/examples/databases/create-boolean-attribute.md +5 -7
- package/docs/examples/databases/create-collection.md +4 -7
- package/docs/examples/databases/create-datetime-attribute.md +5 -7
- package/docs/examples/databases/create-document.md +5 -6
- package/docs/examples/databases/create-documents.md +4 -4
- package/docs/examples/databases/create-email-attribute.md +5 -7
- package/docs/examples/databases/create-enum-attribute.md +6 -8
- package/docs/examples/databases/create-float-attribute.md +5 -9
- package/docs/examples/databases/create-index.md +6 -8
- package/docs/examples/databases/create-integer-attribute.md +5 -9
- package/docs/examples/databases/create-ip-attribute.md +5 -7
- package/docs/examples/databases/create-relationship-attribute.md +5 -9
- package/docs/examples/databases/create-string-attribute.md +6 -9
- package/docs/examples/databases/create-url-attribute.md +5 -7
- package/docs/examples/databases/create.md +2 -3
- package/docs/examples/databases/decrement-document-attribute.md +5 -0
- package/docs/examples/databases/delete-attribute.md +4 -4
- package/docs/examples/databases/delete-collection.md +3 -3
- package/docs/examples/databases/delete-document.md +4 -4
- package/docs/examples/databases/delete-documents.md +3 -4
- package/docs/examples/databases/delete-index.md +4 -4
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +4 -4
- package/docs/examples/databases/get-collection-usage.md +3 -4
- package/docs/examples/databases/get-collection.md +3 -3
- package/docs/examples/databases/get-document.md +4 -5
- package/docs/examples/databases/get-index.md +4 -4
- package/docs/examples/databases/get-usage.md +2 -2
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/increment-document-attribute.md +5 -0
- package/docs/examples/databases/list-attributes.md +3 -4
- package/docs/examples/databases/list-collection-logs.md +3 -4
- package/docs/examples/databases/list-collections.md +2 -4
- package/docs/examples/databases/list-document-logs.md +4 -5
- package/docs/examples/databases/list-documents.md +3 -4
- package/docs/examples/databases/list-indexes.md +3 -4
- package/docs/examples/databases/list-logs.md +2 -3
- package/docs/examples/databases/list-usage.md +1 -0
- package/docs/examples/databases/list.md +1 -3
- package/docs/examples/databases/update-boolean-attribute.md +6 -7
- package/docs/examples/databases/update-collection.md +4 -7
- package/docs/examples/databases/update-datetime-attribute.md +6 -7
- package/docs/examples/databases/update-document.md +4 -6
- package/docs/examples/databases/update-documents.md +3 -5
- package/docs/examples/databases/update-email-attribute.md +6 -7
- package/docs/examples/databases/update-enum-attribute.md +7 -8
- package/docs/examples/databases/update-float-attribute.md +6 -9
- package/docs/examples/databases/update-integer-attribute.md +6 -9
- package/docs/examples/databases/update-ip-attribute.md +6 -7
- package/docs/examples/databases/update-relationship-attribute.md +4 -6
- package/docs/examples/databases/update-string-attribute.md +6 -8
- package/docs/examples/databases/update-url-attribute.md +6 -7
- package/docs/examples/databases/update.md +2 -3
- package/docs/examples/databases/upsert-document.md +5 -6
- package/docs/examples/databases/upsert-documents.md +4 -4
- package/docs/examples/functions/create-deployment.md +4 -6
- package/docs/examples/functions/create-duplicate-deployment.md +3 -4
- package/docs/examples/functions/create-execution.md +2 -8
- package/docs/examples/functions/create-template-deployment.md +6 -7
- package/docs/examples/functions/create-variable.md +4 -5
- package/docs/examples/functions/create-vcs-deployment.md +4 -5
- package/docs/examples/functions/create.md +3 -18
- package/docs/examples/functions/delete-deployment.md +3 -3
- package/docs/examples/functions/delete-execution.md +3 -3
- package/docs/examples/functions/delete-variable.md +3 -3
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/get-deployment-download.md +3 -4
- package/docs/examples/functions/get-deployment.md +3 -3
- package/docs/examples/functions/get-execution.md +3 -3
- package/docs/examples/functions/get-template.md +2 -2
- package/docs/examples/functions/get-usage.md +2 -3
- package/docs/examples/functions/get-variable.md +3 -3
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +2 -4
- package/docs/examples/functions/list-executions.md +2 -3
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-specifications.md +1 -1
- package/docs/examples/functions/list-templates.md +1 -5
- package/docs/examples/functions/list-usage.md +1 -2
- package/docs/examples/functions/list-variables.md +2 -2
- package/docs/examples/functions/list.md +1 -3
- package/docs/examples/functions/update-deployment-status.md +3 -3
- package/docs/examples/functions/update-function-deployment.md +3 -3
- package/docs/examples/functions/update-variable.md +4 -6
- package/docs/examples/functions/update.md +2 -18
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-certificate.md +1 -2
- package/docs/examples/health/get-db.md +1 -0
- package/docs/examples/health/get-failed-jobs.md +2 -3
- package/docs/examples/health/get-pub-sub.md +1 -1
- package/docs/examples/health/get-queue-builds.md +1 -2
- package/docs/examples/health/get-queue-certificates.md +1 -2
- package/docs/examples/health/get-queue-databases.md +1 -3
- package/docs/examples/health/get-queue-deletes.md +1 -2
- package/docs/examples/health/get-queue-functions.md +1 -2
- package/docs/examples/health/get-queue-logs.md +1 -2
- package/docs/examples/health/get-queue-mails.md +1 -2
- package/docs/examples/health/get-queue-messaging.md +1 -2
- package/docs/examples/health/get-queue-migrations.md +1 -2
- package/docs/examples/health/get-queue-stats-resources.md +1 -2
- package/docs/examples/health/get-queue-usage.md +1 -2
- package/docs/examples/health/get-queue-webhooks.md +1 -2
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-storage.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/locale/list-codes.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-eu.md +1 -0
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/messaging/create-apns-provider.md +3 -9
- package/docs/examples/messaging/create-email.md +4 -13
- package/docs/examples/messaging/create-fcm-provider.md +3 -5
- package/docs/examples/messaging/create-mailgun-provider.md +3 -11
- package/docs/examples/messaging/create-msg-91-provider.md +3 -0
- package/docs/examples/messaging/create-push.md +2 -20
- package/docs/examples/messaging/create-sendgrid-provider.md +3 -9
- package/docs/examples/messaging/create-sms.md +3 -8
- package/docs/examples/messaging/create-smtp-provider.md +4 -15
- package/docs/examples/messaging/create-subscriber.md +4 -4
- package/docs/examples/messaging/create-telesign-provider.md +3 -7
- package/docs/examples/messaging/create-textmagic-provider.md +3 -7
- package/docs/examples/messaging/create-topic.md +3 -4
- package/docs/examples/messaging/create-twilio-provider.md +3 -7
- package/docs/examples/messaging/create-vonage-provider.md +3 -7
- package/docs/examples/messaging/delete-provider.md +2 -2
- package/docs/examples/messaging/delete-subscriber.md +3 -3
- package/docs/examples/messaging/delete-topic.md +2 -2
- package/docs/examples/messaging/delete.md +1 -1
- package/docs/examples/messaging/get-message.md +2 -2
- package/docs/examples/messaging/get-provider.md +2 -2
- package/docs/examples/messaging/get-subscriber.md +3 -3
- package/docs/examples/messaging/get-topic.md +2 -2
- package/docs/examples/messaging/list-message-logs.md +2 -3
- package/docs/examples/messaging/list-messages.md +1 -3
- package/docs/examples/messaging/list-provider-logs.md +2 -3
- package/docs/examples/messaging/list-providers.md +1 -3
- package/docs/examples/messaging/list-subscriber-logs.md +2 -3
- package/docs/examples/messaging/list-subscribers.md +2 -4
- package/docs/examples/messaging/list-targets.md +2 -3
- package/docs/examples/messaging/list-topic-logs.md +2 -3
- package/docs/examples/messaging/list-topics.md +1 -3
- package/docs/examples/messaging/update-apns-provider.md +2 -9
- package/docs/examples/messaging/update-email.md +2 -13
- package/docs/examples/messaging/update-fcm-provider.md +2 -5
- package/docs/examples/messaging/update-mailgun-provider.md +2 -11
- package/docs/examples/messaging/update-msg-91-provider.md +2 -0
- package/docs/examples/messaging/update-push.md +2 -20
- package/docs/examples/messaging/update-sendgrid-provider.md +2 -9
- package/docs/examples/messaging/update-sms.md +2 -8
- package/docs/examples/messaging/update-smtp-provider.md +2 -15
- package/docs/examples/messaging/update-telesign-provider.md +2 -7
- package/docs/examples/messaging/update-textmagic-provider.md +2 -7
- package/docs/examples/messaging/update-topic.md +2 -4
- package/docs/examples/messaging/update-twilio-provider.md +2 -7
- package/docs/examples/messaging/update-vonage-provider.md +2 -7
- package/docs/examples/migrations/create-appwrite-migration.md +5 -5
- package/docs/examples/migrations/create-csv-migration.md +4 -4
- package/docs/examples/migrations/create-firebase-migration.md +3 -3
- package/docs/examples/migrations/create-n-host-migration.md +8 -9
- package/docs/examples/migrations/create-supabase-migration.md +7 -8
- package/docs/examples/migrations/delete.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.md +5 -5
- package/docs/examples/migrations/get-firebase-report.md +3 -3
- package/docs/examples/migrations/get-n-host-report.md +8 -9
- package/docs/examples/migrations/get-supabase-report.md +7 -8
- package/docs/examples/migrations/get.md +1 -1
- package/docs/examples/migrations/list.md +1 -3
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/project/create-variable.md +3 -4
- package/docs/examples/project/delete-variable.md +2 -2
- package/docs/examples/project/get-usage.md +3 -4
- package/docs/examples/project/get-variable.md +2 -2
- package/docs/examples/project/list-variables.md +1 -1
- package/docs/examples/project/update-variable.md +3 -5
- package/docs/examples/projects/create-dev-key.md +4 -4
- package/docs/examples/projects/create-jwt.md +3 -0
- package/docs/examples/projects/create-key.md +4 -5
- package/docs/examples/projects/create-platform.md +4 -7
- package/docs/examples/projects/create-smtp-test.md +6 -11
- package/docs/examples/projects/create-webhook.md +6 -9
- package/docs/examples/projects/create.md +3 -13
- package/docs/examples/projects/delete-dev-key.md +3 -3
- package/docs/examples/projects/delete-email-template.md +4 -4
- package/docs/examples/projects/delete-key.md +3 -3
- package/docs/examples/projects/delete-platform.md +3 -3
- package/docs/examples/projects/delete-sms-template.md +4 -4
- package/docs/examples/projects/delete-webhook.md +3 -3
- package/docs/examples/projects/delete.md +1 -1
- package/docs/examples/projects/get-dev-key.md +3 -3
- package/docs/examples/projects/get-email-template.md +4 -4
- package/docs/examples/projects/get-key.md +3 -3
- package/docs/examples/projects/get-platform.md +3 -3
- package/docs/examples/projects/get-sms-template.md +4 -4
- package/docs/examples/projects/get-webhook.md +3 -3
- package/docs/examples/projects/get.md +1 -1
- package/docs/examples/projects/list-dev-keys.md +2 -3
- package/docs/examples/projects/list-keys.md +2 -2
- package/docs/examples/projects/list-platforms.md +2 -2
- package/docs/examples/projects/list-webhooks.md +2 -2
- package/docs/examples/projects/list.md +1 -3
- package/docs/examples/projects/update-api-status-all.md +3 -3
- package/docs/examples/projects/update-api-status.md +4 -4
- package/docs/examples/projects/update-auth-duration.md +3 -3
- package/docs/examples/projects/update-auth-limit.md +3 -3
- package/docs/examples/projects/update-auth-password-dictionary.md +3 -3
- package/docs/examples/projects/update-auth-password-history.md +3 -3
- package/docs/examples/projects/update-auth-sessions-limit.md +3 -3
- package/docs/examples/projects/update-auth-status.md +4 -4
- package/docs/examples/projects/update-dev-key.md +5 -5
- package/docs/examples/projects/update-email-template.md +6 -9
- package/docs/examples/projects/update-key.md +5 -6
- package/docs/examples/projects/update-memberships-privacy.md +5 -5
- package/docs/examples/projects/update-mock-numbers.md +3 -3
- package/docs/examples/projects/update-o-auth-2.md +3 -0
- package/docs/examples/projects/update-personal-data-check.md +3 -3
- package/docs/examples/projects/update-platform.md +4 -7
- package/docs/examples/projects/update-service-status-all.md +3 -3
- package/docs/examples/projects/update-service-status.md +4 -4
- package/docs/examples/projects/update-session-alerts.md +3 -3
- package/docs/examples/projects/update-session-invalidation.md +3 -0
- package/docs/examples/projects/update-sms-template.md +5 -5
- package/docs/examples/projects/update-smtp.md +3 -11
- package/docs/examples/projects/update-team.md +3 -3
- package/docs/examples/projects/update-webhook-signature.md +3 -3
- package/docs/examples/projects/update-webhook.md +7 -10
- package/docs/examples/projects/update.md +2 -11
- package/docs/examples/proxy/create-api-rule.md +2 -0
- package/docs/examples/proxy/create-function-rule.md +3 -4
- package/docs/examples/proxy/create-redirect-rule.md +6 -6
- package/docs/examples/proxy/create-site-rule.md +3 -4
- package/docs/examples/proxy/delete-rule.md +2 -2
- package/docs/examples/proxy/get-rule.md +2 -2
- package/docs/examples/proxy/list-rules.md +1 -3
- package/docs/examples/proxy/update-rule-verification.md +2 -2
- package/docs/examples/sites/create-deployment.md +4 -7
- package/docs/examples/sites/create-duplicate-deployment.md +3 -3
- package/docs/examples/sites/create-template-deployment.md +6 -7
- package/docs/examples/sites/create-variable.md +4 -5
- package/docs/examples/sites/create-vcs-deployment.md +4 -5
- package/docs/examples/sites/create.md +4 -18
- package/docs/examples/sites/delete-deployment.md +3 -3
- package/docs/examples/sites/delete-log.md +3 -3
- package/docs/examples/sites/delete-variable.md +3 -3
- package/docs/examples/sites/delete.md +1 -1
- package/docs/examples/sites/get-deployment-download.md +3 -4
- package/docs/examples/sites/get-deployment.md +3 -3
- package/docs/examples/sites/get-log.md +3 -3
- package/docs/examples/sites/get-template.md +2 -2
- package/docs/examples/sites/get-usage.md +2 -3
- package/docs/examples/sites/get-variable.md +3 -3
- package/docs/examples/sites/get.md +1 -1
- package/docs/examples/sites/list-deployments.md +2 -4
- package/docs/examples/sites/list-frameworks.md +1 -1
- package/docs/examples/sites/list-logs.md +2 -3
- package/docs/examples/sites/list-specifications.md +1 -1
- package/docs/examples/sites/list-templates.md +1 -5
- package/docs/examples/sites/list-usage.md +1 -2
- package/docs/examples/sites/list-variables.md +2 -2
- package/docs/examples/sites/list.md +1 -3
- package/docs/examples/sites/update-deployment-status.md +3 -3
- package/docs/examples/sites/update-site-deployment.md +3 -3
- package/docs/examples/sites/update-variable.md +4 -6
- package/docs/examples/sites/update.md +3 -18
- package/docs/examples/storage/create-bucket.md +3 -11
- package/docs/examples/storage/create-file.md +4 -5
- package/docs/examples/storage/delete-bucket.md +2 -2
- package/docs/examples/storage/delete-file.md +3 -3
- package/docs/examples/storage/get-bucket-usage.md +2 -3
- package/docs/examples/storage/get-bucket.md +2 -2
- package/docs/examples/storage/get-file-download.md +3 -4
- package/docs/examples/storage/get-file-preview.md +3 -15
- package/docs/examples/storage/get-file-view.md +3 -4
- package/docs/examples/storage/get-file.md +3 -3
- package/docs/examples/storage/get-usage.md +1 -2
- package/docs/examples/storage/list-buckets.md +1 -3
- package/docs/examples/storage/list-files.md +2 -4
- package/docs/examples/storage/update-bucket.md +3 -11
- package/docs/examples/storage/update-file.md +3 -5
- package/docs/examples/tablesdb/create-boolean-column.md +5 -0
- package/docs/examples/tablesdb/create-datetime-column.md +5 -0
- package/docs/examples/tablesdb/create-email-column.md +5 -0
- package/docs/examples/tablesdb/create-enum-column.md +6 -0
- package/docs/examples/tablesdb/create-float-column.md +5 -0
- package/docs/examples/tablesdb/create-index.md +6 -0
- package/docs/examples/tablesdb/create-integer-column.md +5 -0
- package/docs/examples/tablesdb/create-ip-column.md +5 -0
- package/docs/examples/tablesdb/create-relationship-column.md +5 -0
- package/docs/examples/tablesdb/create-row.md +5 -0
- package/docs/examples/tablesdb/create-rows.md +4 -0
- package/docs/examples/tablesdb/create-string-column.md +6 -0
- package/docs/examples/tablesdb/create-table.md +4 -0
- package/docs/examples/tablesdb/create-url-column.md +5 -0
- package/docs/examples/tablesdb/create.md +3 -0
- package/docs/examples/tablesdb/decrement-row-column.md +5 -0
- package/docs/examples/tablesdb/delete-column.md +4 -0
- package/docs/examples/tablesdb/delete-index.md +4 -0
- package/docs/examples/tablesdb/delete-row.md +4 -0
- package/docs/examples/tablesdb/delete-rows.md +3 -0
- package/docs/examples/tablesdb/delete-table.md +3 -0
- package/docs/examples/tablesdb/delete.md +2 -0
- package/docs/examples/tablesdb/get-column.md +4 -0
- package/docs/examples/tablesdb/get-index.md +4 -0
- package/docs/examples/tablesdb/get-row.md +4 -0
- package/docs/examples/tablesdb/get-table-usage.md +3 -0
- package/docs/examples/tablesdb/get-table.md +3 -0
- package/docs/examples/tablesdb/get-usage.md +2 -0
- package/docs/examples/tablesdb/get.md +2 -0
- package/docs/examples/tablesdb/increment-row-column.md +5 -0
- package/docs/examples/tablesdb/list-columns.md +3 -0
- package/docs/examples/tablesdb/list-indexes.md +3 -0
- package/docs/examples/tablesdb/list-row-logs.md +4 -0
- package/docs/examples/tablesdb/list-rows.md +3 -0
- package/docs/examples/tablesdb/list-table-logs.md +3 -0
- package/docs/examples/tablesdb/list-tables.md +2 -0
- package/docs/examples/tablesdb/list-usage.md +1 -0
- package/docs/examples/tablesdb/list.md +1 -0
- package/docs/examples/tablesdb/update-boolean-column.md +6 -0
- package/docs/examples/tablesdb/update-datetime-column.md +6 -0
- package/docs/examples/tablesdb/update-email-column.md +6 -0
- package/docs/examples/tablesdb/update-enum-column.md +7 -0
- package/docs/examples/tablesdb/update-float-column.md +6 -0
- package/docs/examples/tablesdb/update-integer-column.md +6 -0
- package/docs/examples/tablesdb/update-ip-column.md +6 -0
- package/docs/examples/tablesdb/update-relationship-column.md +4 -0
- package/docs/examples/tablesdb/update-row.md +4 -0
- package/docs/examples/tablesdb/update-rows.md +3 -0
- package/docs/examples/tablesdb/update-string-column.md +6 -0
- package/docs/examples/tablesdb/update-table.md +4 -0
- package/docs/examples/tablesdb/update-url-column.md +6 -0
- package/docs/examples/tablesdb/update.md +3 -0
- package/docs/examples/tablesdb/upsert-row.md +4 -0
- package/docs/examples/tablesdb/upsert-rows.md +4 -0
- package/docs/examples/teams/create-membership.md +3 -8
- package/docs/examples/teams/create.md +2 -3
- package/docs/examples/teams/delete-membership.md +3 -3
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +3 -3
- package/docs/examples/teams/get-prefs.md +2 -2
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-logs.md +2 -3
- package/docs/examples/teams/list-memberships.md +2 -4
- package/docs/examples/teams/list.md +1 -3
- package/docs/examples/teams/update-membership-status.md +5 -5
- package/docs/examples/teams/update-membership.md +4 -4
- package/docs/examples/teams/update-name.md +3 -3
- package/docs/examples/teams/update-prefs.md +3 -3
- package/docs/examples/tokens/create-file-token.md +3 -4
- package/docs/examples/tokens/delete.md +1 -1
- package/docs/examples/tokens/get.md +1 -1
- package/docs/examples/tokens/list.md +2 -3
- package/docs/examples/tokens/update.md +1 -2
- package/docs/examples/users/create-argon-2-user.md +4 -0
- package/docs/examples/users/create-bcrypt-user.md +4 -5
- package/docs/examples/users/create-jwt.md +2 -0
- package/docs/examples/users/create-md-5-user.md +4 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +2 -2
- package/docs/examples/users/create-ph-pass-user.md +4 -0
- package/docs/examples/users/create-scrypt-modified-user.md +7 -8
- package/docs/examples/users/create-scrypt-user.md +9 -10
- package/docs/examples/users/create-session.md +2 -2
- package/docs/examples/users/create-sha-user.md +4 -0
- package/docs/examples/users/create-target.md +5 -7
- package/docs/examples/users/create-token.md +2 -4
- package/docs/examples/users/create.md +1 -5
- package/docs/examples/users/delete-identity.md +2 -2
- package/docs/examples/users/delete-mfa-authenticator.md +3 -3
- package/docs/examples/users/delete-session.md +3 -3
- package/docs/examples/users/delete-sessions.md +2 -2
- package/docs/examples/users/delete-target.md +3 -3
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-mfa-recovery-codes.md +2 -2
- package/docs/examples/users/get-prefs.md +2 -2
- package/docs/examples/users/get-target.md +3 -3
- package/docs/examples/users/get-usage.md +1 -2
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-identities.md +1 -3
- package/docs/examples/users/list-logs.md +2 -3
- package/docs/examples/users/list-memberships.md +2 -4
- package/docs/examples/users/list-mfa-factors.md +2 -2
- package/docs/examples/users/list-sessions.md +2 -2
- package/docs/examples/users/list-targets.md +2 -3
- package/docs/examples/users/list.md +1 -3
- package/docs/examples/users/update-email-verification.md +3 -3
- package/docs/examples/users/update-email.md +3 -3
- package/docs/examples/users/update-labels.md +3 -3
- package/docs/examples/users/update-mfa-recovery-codes.md +2 -2
- package/docs/examples/users/update-mfa.md +3 -3
- package/docs/examples/users/update-name.md +3 -3
- package/docs/examples/users/update-password.md +3 -3
- package/docs/examples/users/update-phone-verification.md +3 -3
- package/docs/examples/users/update-phone.md +3 -3
- package/docs/examples/users/update-prefs.md +3 -3
- package/docs/examples/users/update-status.md +3 -3
- package/docs/examples/users/update-target.md +3 -6
- package/docs/examples/vcs/create-repository-detection.md +4 -5
- package/docs/examples/vcs/create-repository.md +4 -4
- package/docs/examples/vcs/delete-installation.md +2 -2
- package/docs/examples/vcs/get-installation.md +2 -2
- package/docs/examples/vcs/get-repository-contents.md +3 -5
- package/docs/examples/vcs/get-repository.md +3 -3
- package/docs/examples/vcs/list-installations.md +1 -3
- package/docs/examples/vcs/list-repositories.md +3 -4
- package/docs/examples/vcs/list-repository-branches.md +3 -3
- package/docs/examples/vcs/update-external-deployments.md +4 -4
- package/index.js +40 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +3 -8
- package/lib/commands/account.js +55 -103
- package/lib/commands/avatars.js +1 -8
- package/lib/commands/console.js +1 -3
- package/lib/commands/databases.js +279 -226
- package/lib/commands/functions.js +3 -33
- package/lib/commands/graphql.js +1 -3
- package/lib/commands/health.js +1 -23
- package/lib/commands/init.js +1 -1
- package/lib/commands/locale.js +1 -9
- package/lib/commands/messaging.js +41 -87
- package/lib/commands/migrations.js +7 -15
- package/lib/commands/project.js +1 -7
- package/lib/commands/projects.js +77 -86
- package/lib/commands/proxy.js +1 -9
- package/lib/commands/pull.js +62 -1
- package/lib/commands/push.js +163 -8
- package/lib/commands/run.js +1 -1
- package/lib/commands/sites.js +3 -32
- package/lib/commands/storage.js +3 -18
- package/lib/commands/tables-db.js +2896 -0
- package/lib/commands/teams.js +1 -15
- package/lib/commands/tokens.js +1 -6
- package/lib/commands/types.js +7 -9
- package/lib/commands/update.js +218 -0
- package/lib/commands/users.js +34 -77
- package/lib/commands/vcs.js +2 -12
- package/lib/config.js +99 -14
- package/lib/parser.js +2 -1
- package/lib/questions.js +32 -7
- package/lib/type-generation/languages/dart.js +13 -13
- package/lib/type-generation/languages/java.js +13 -13
- package/lib/type-generation/languages/javascript.js +14 -14
- package/lib/type-generation/languages/kotlin.js +11 -10
- package/lib/type-generation/languages/php.js +15 -14
- package/lib/type-generation/languages/swift.js +13 -13
- package/lib/type-generation/languages/typescript.js +8 -8
- package/lib/utils.js +39 -2
- package/package.json +1 -1
- package/scoop/{appwrite.json → appwrite.config.json} +3 -3
- package/docs/examples/account/create-j-w-t.md +0 -1
- package/docs/examples/account/create-magic-u-r-l-token.md +0 -5
- package/docs/examples/account/create-o-auth2session.md +0 -5
- package/docs/examples/account/create-o-auth2token.md +0 -5
- package/docs/examples/account/update-m-f-a.md +0 -2
- package/docs/examples/account/update-magic-u-r-l-session.md +0 -3
- package/docs/examples/avatars/get-q-r.md +0 -5
- package/docs/examples/databases/get-database-usage.md +0 -3
- package/docs/examples/health/get-d-b.md +0 -1
- package/docs/examples/locale/list-countries-e-u.md +0 -1
- package/docs/examples/messaging/create-msg91provider.md +0 -7
- package/docs/examples/messaging/update-msg91provider.md +0 -7
- package/docs/examples/projects/create-j-w-t.md +0 -4
- package/docs/examples/projects/update-o-auth2.md +0 -6
- package/docs/examples/proxy/create-a-p-i-rule.md +0 -2
- package/docs/examples/users/create-argon2user.md +0 -5
- package/docs/examples/users/create-j-w-t.md +0 -4
- package/docs/examples/users/create-m-d5user.md +0 -5
- package/docs/examples/users/create-p-h-pass-user.md +0 -5
- package/docs/examples/users/create-s-h-a-user.md +0 -6
package/lib/config.js
CHANGED
|
@@ -9,6 +9,7 @@ const KeysSite = new Set(["path", "$id", "name", "enabled", "logging", "timeout"
|
|
|
9
9
|
const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logging", "runtime", "specification", "scopes", "events", "schedule", "timeout", "entrypoint", "commands", "vars"]);
|
|
10
10
|
const KeysDatabase = new Set(["$id", "name", "enabled"]);
|
|
11
11
|
const KeysCollection = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"]);
|
|
12
|
+
const KeysTable = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "columns", "indexes"]);
|
|
12
13
|
const KeysStorage = new Set(["$id", "$permissions", "fileSecurity", "name", "enabled", "maximumFileSize", "allowedFileExtensions", "compression", "encryption", "antivirus"]);
|
|
13
14
|
const KeysTopics = new Set(["$id", "name", "subscribe"]);
|
|
14
15
|
const KeysTeams = new Set(["$id", "name"]);
|
|
@@ -39,6 +40,33 @@ const KeysAttributes = new Set([
|
|
|
39
40
|
// Strings
|
|
40
41
|
"encrypt",
|
|
41
42
|
]);
|
|
43
|
+
const KeysColumns = new Set([
|
|
44
|
+
"key",
|
|
45
|
+
"type",
|
|
46
|
+
"required",
|
|
47
|
+
"array",
|
|
48
|
+
"size",
|
|
49
|
+
"default",
|
|
50
|
+
// integer and float
|
|
51
|
+
"min",
|
|
52
|
+
"max",
|
|
53
|
+
// email, enum, URL, IP, and datetime
|
|
54
|
+
"format",
|
|
55
|
+
// enum
|
|
56
|
+
"elements",
|
|
57
|
+
// relationship
|
|
58
|
+
"relatedCollection",
|
|
59
|
+
"relationType",
|
|
60
|
+
"twoWay",
|
|
61
|
+
"twoWayKey",
|
|
62
|
+
"onDelete",
|
|
63
|
+
"side",
|
|
64
|
+
// Indexes
|
|
65
|
+
"attributes",
|
|
66
|
+
"orders",
|
|
67
|
+
// Strings
|
|
68
|
+
"encrypt",
|
|
69
|
+
]);
|
|
42
70
|
const KeyIndexes = new Set(["key", "type", "status", "attributes", "orders"]);
|
|
43
71
|
|
|
44
72
|
function whitelistKeys(value, keys, nestedKeys = {}) {
|
|
@@ -125,27 +153,39 @@ class Config {
|
|
|
125
153
|
}
|
|
126
154
|
|
|
127
155
|
class Local extends Config {
|
|
128
|
-
static CONFIG_FILE_PATH = "appwrite.json";
|
|
156
|
+
static CONFIG_FILE_PATH = "appwrite.config.json";
|
|
157
|
+
static CONFIG_FILE_PATH_LEGACY = "appwrite.json";
|
|
129
158
|
configDirectoryPath = ""
|
|
130
159
|
|
|
131
|
-
constructor(path = Local.CONFIG_FILE_PATH) {
|
|
160
|
+
constructor(path = Local.CONFIG_FILE_PATH, legacyPath = Local.CONFIG_FILE_PATH_LEGACY) {
|
|
161
|
+
let absolutePath = Local.findConfigFile(path) || Local.findConfigFile(legacyPath);
|
|
162
|
+
|
|
163
|
+
if (!absolutePath) {
|
|
164
|
+
absolutePath = `${process.cwd()}/${path}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
super(absolutePath);
|
|
168
|
+
this.configDirectoryPath = _path.dirname(absolutePath);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static findConfigFile(filename) {
|
|
132
172
|
let currentPath = process.cwd();
|
|
133
|
-
let absolutePath = `${currentPath}/${path}`;
|
|
134
173
|
|
|
135
174
|
while (true) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
175
|
+
const filePath = `${currentPath}/${filename}`;
|
|
176
|
+
|
|
177
|
+
if (fs.existsSync(filePath)) {
|
|
178
|
+
return filePath;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const parentDirectory = _path.dirname(currentPath);
|
|
182
|
+
if (parentDirectory === currentPath) {
|
|
183
|
+
break;
|
|
145
184
|
}
|
|
185
|
+
currentPath = parentDirectory;
|
|
146
186
|
}
|
|
147
|
-
|
|
148
|
-
|
|
187
|
+
|
|
188
|
+
return null;
|
|
149
189
|
}
|
|
150
190
|
|
|
151
191
|
getDirname() {
|
|
@@ -298,6 +338,50 @@ class Local extends Config {
|
|
|
298
338
|
this.set("collections", collections);
|
|
299
339
|
}
|
|
300
340
|
|
|
341
|
+
getTables() {
|
|
342
|
+
if (!this.has("tables")) {
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
345
|
+
return this.get("tables");
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
getTable($id) {
|
|
349
|
+
if (!this.has("tables")) {
|
|
350
|
+
return {};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
let tables = this.get("tables");
|
|
354
|
+
for (let i = 0; i < tables.length; i++) {
|
|
355
|
+
if (tables[i]['$id'] == $id) {
|
|
356
|
+
return tables[i];
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return {};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
addTable(props) {
|
|
364
|
+
props = whitelistKeys(props, KeysTable, {
|
|
365
|
+
columns: KeysColumns,
|
|
366
|
+
indexes: KeyIndexes
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
if (!this.has("tables")) {
|
|
370
|
+
this.set("tables", []);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
let tables = this.get("tables");
|
|
374
|
+
for (let i = 0; i < tables.length; i++) {
|
|
375
|
+
if (tables[i]['$id'] == props['$id'] && tables[i]['databaseId'] == props['databaseId']) {
|
|
376
|
+
tables[i] = props;
|
|
377
|
+
this.set("tables", tables);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
tables.push(props);
|
|
382
|
+
this.set("tables", tables);
|
|
383
|
+
}
|
|
384
|
+
|
|
301
385
|
getBuckets() {
|
|
302
386
|
if (!this.has("buckets")) {
|
|
303
387
|
return [];
|
|
@@ -701,5 +785,6 @@ module.exports = {
|
|
|
701
785
|
KeysStorage,
|
|
702
786
|
KeysTeams,
|
|
703
787
|
KeysCollection,
|
|
788
|
+
KeysTable,
|
|
704
789
|
whitelistKeys
|
|
705
790
|
};
|
package/lib/parser.js
CHANGED
|
@@ -122,7 +122,7 @@ const parseError = (err) => {
|
|
|
122
122
|
} catch {
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
const version = '
|
|
125
|
+
const version = '9.0.0';
|
|
126
126
|
const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
|
|
127
127
|
const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud()}`;
|
|
128
128
|
|
|
@@ -216,6 +216,7 @@ const commandDescriptions = {
|
|
|
216
216
|
"sites": `The sites command allows you to view, create and manage your Appwrite Sites.`,
|
|
217
217
|
"storage": `The storage command allows you to manage your project files.`,
|
|
218
218
|
"teams": `The teams command allows you to group users of your project to enable them to share read and write access to your project resources.`,
|
|
219
|
+
"update": `The update command allows you to update the Appwrite CLI to the latest version.`,
|
|
219
220
|
"users": `The users command allows you to manage your project users.`,
|
|
220
221
|
"client": `The client command allows you to configure your CLI`,
|
|
221
222
|
"login": `The login command allows you to authenticate and manage a user account.`,
|
package/lib/questions.js
CHANGED
|
@@ -255,10 +255,11 @@ const questionsPullResources = [
|
|
|
255
255
|
choices: [
|
|
256
256
|
{ name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' },
|
|
257
257
|
{ name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' },
|
|
258
|
-
{ name: `
|
|
258
|
+
{ name: `Tables ${chalk.blackBright(`(Grids)`)}`, value: 'tables' },
|
|
259
259
|
{ name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' },
|
|
260
260
|
{ name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' },
|
|
261
|
-
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' }
|
|
261
|
+
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' },
|
|
262
|
+
{ name: `Collections ${chalk.blackBright(`(Database)`)}`, value: 'collections' }
|
|
262
263
|
]
|
|
263
264
|
}
|
|
264
265
|
]
|
|
@@ -666,10 +667,11 @@ const questionsPushResources = [
|
|
|
666
667
|
choices: [
|
|
667
668
|
{ name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' },
|
|
668
669
|
{ name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' },
|
|
669
|
-
{ name: `
|
|
670
|
+
{ name: `Tables ${chalk.blackBright(`(Grids)`)}`, value: 'tables' },
|
|
670
671
|
{ name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' },
|
|
671
672
|
{ name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' },
|
|
672
|
-
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' }
|
|
673
|
+
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' },
|
|
674
|
+
{ name: `Collections ${chalk.blackBright(`(Database)`)}`, value: 'collections' }
|
|
673
675
|
]
|
|
674
676
|
}
|
|
675
677
|
];
|
|
@@ -682,10 +684,11 @@ const questionsInitResources = [
|
|
|
682
684
|
choices: [
|
|
683
685
|
{ name: 'Function', value: 'function' },
|
|
684
686
|
{ name: 'Site', value: 'site' },
|
|
685
|
-
{ name: '
|
|
687
|
+
{ name: 'Table', value: 'table' },
|
|
686
688
|
{ name: 'Bucket', value: 'bucket' },
|
|
687
689
|
{ name: 'Team', value: 'team' },
|
|
688
|
-
{ name: 'Topic', value: 'message' }
|
|
690
|
+
{ name: 'Topic', value: 'message' },
|
|
691
|
+
{ name: 'Collection', value: 'collection' }
|
|
689
692
|
]
|
|
690
693
|
}
|
|
691
694
|
];
|
|
@@ -753,6 +756,27 @@ const questionsPushCollections = [
|
|
|
753
756
|
}
|
|
754
757
|
];
|
|
755
758
|
|
|
759
|
+
const questionsPushTables = [
|
|
760
|
+
{
|
|
761
|
+
type: "checkbox",
|
|
762
|
+
name: "tables",
|
|
763
|
+
message: "Which tables would you like to push?",
|
|
764
|
+
validate: (value) => validateRequired('table', value),
|
|
765
|
+
when: () => localConfig.getTables().length > 0,
|
|
766
|
+
choices: () => {
|
|
767
|
+
let tables = localConfig.getTables();
|
|
768
|
+
checkDeployConditions(localConfig)
|
|
769
|
+
|
|
770
|
+
return tables.map(table => {
|
|
771
|
+
return {
|
|
772
|
+
name: `${table.name} (${table['databaseId']} - ${table['$id']})`,
|
|
773
|
+
value: `${table['databaseId']}|${table['$id']}`
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
];
|
|
779
|
+
|
|
756
780
|
const questionPushChanges = [
|
|
757
781
|
{
|
|
758
782
|
type: "input",
|
|
@@ -1002,5 +1026,6 @@ module.exports = {
|
|
|
1002
1026
|
questionsCreateTeam,
|
|
1003
1027
|
questionPushChanges,
|
|
1004
1028
|
questionPushChangesConfirmation,
|
|
1005
|
-
questionsCreateSite
|
|
1029
|
+
questionsCreateSite,
|
|
1030
|
+
questionsPushTables
|
|
1006
1031
|
};
|
|
@@ -6,7 +6,7 @@ const path = require('path');
|
|
|
6
6
|
|
|
7
7
|
class Dart extends LanguageMeta {
|
|
8
8
|
getPackageName() {
|
|
9
|
-
const pubspecPath = path.join(
|
|
9
|
+
const pubspecPath = path.join(process.cwd(), 'pubspec.yaml');
|
|
10
10
|
if (fs.existsSync(pubspecPath)) {
|
|
11
11
|
const pubspecContent = fs.readFileSync(pubspecPath, 'utf8');
|
|
12
12
|
const lines = pubspecContent.split('\n');
|
|
@@ -40,7 +40,7 @@ class Dart extends LanguageMeta {
|
|
|
40
40
|
return 'appwrite';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
getType(attribute) {
|
|
43
|
+
getType(attribute, collections) {
|
|
44
44
|
let type = "";
|
|
45
45
|
switch (attribute.type) {
|
|
46
46
|
case AttributeType.STRING:
|
|
@@ -61,7 +61,11 @@ class Dart extends LanguageMeta {
|
|
|
61
61
|
type = "bool";
|
|
62
62
|
break;
|
|
63
63
|
case AttributeType.RELATIONSHIP:
|
|
64
|
-
|
|
64
|
+
const relatedCollection = collections.find(c => c.$id === attribute.relatedCollection);
|
|
65
|
+
if (!relatedCollection) {
|
|
66
|
+
throw new Error(`Related collection with ID '${attribute.relatedCollection}' not found.`);
|
|
67
|
+
}
|
|
68
|
+
type = LanguageMeta.toPascalCase(relatedCollection.name);
|
|
65
69
|
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
|
|
66
70
|
type = `List<${type}>`;
|
|
67
71
|
}
|
|
@@ -78,19 +82,15 @@ class Dart extends LanguageMeta {
|
|
|
78
82
|
return type;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
getCurrentDirectory() {
|
|
82
|
-
return process.cwd();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
85
|
getTemplate() {
|
|
86
86
|
return `<% for (const attribute of collection.attributes) { -%>
|
|
87
87
|
<% if (attribute.type === 'relationship') { -%>
|
|
88
|
-
import '<%- toSnakeCase(attribute.relatedCollection) %>.dart';
|
|
88
|
+
import '<%- toSnakeCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>.dart';
|
|
89
89
|
|
|
90
90
|
<% } -%>
|
|
91
91
|
<% } -%>
|
|
92
92
|
/// This file is auto-generated by the Appwrite CLI.
|
|
93
|
-
/// You can regenerate it by running \`appwrite
|
|
93
|
+
/// You can regenerate it by running \`appwrite ${process.argv.slice(2).join(' ')}\`.
|
|
94
94
|
|
|
95
95
|
<% for (const attribute of collection.attributes) { -%>
|
|
96
96
|
<% if (attribute.format === 'enum') { -%>
|
|
@@ -104,7 +104,7 @@ enum <%- toPascalCase(attribute.key) %> {
|
|
|
104
104
|
<% } -%>
|
|
105
105
|
class <%= toPascalCase(collection.name) %> {
|
|
106
106
|
<% for (const [index, attribute] of Object.entries(collection.attributes)) { -%>
|
|
107
|
-
<%- getType(attribute) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
107
|
+
<%- getType(attribute, collections) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
108
108
|
<% } -%>
|
|
109
109
|
|
|
110
110
|
<%= toPascalCase(collection.name) %>({
|
|
@@ -152,11 +152,11 @@ map['<%= attribute.key %>']<% if (!attribute.required) { %> ?? null<% } -%>
|
|
|
152
152
|
<% } -%>
|
|
153
153
|
<% } else if (attribute.type === 'relationship') { -%>
|
|
154
154
|
<% if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') { -%>
|
|
155
|
-
(map['<%= attribute.key %>'] as List<dynamic>?)?.map((e) => <%- toPascalCase(attribute.relatedCollection) %>.fromMap(e)).toList()<% if (!attribute.required) { %> ?? []<% } -%>
|
|
155
|
+
(map['<%= attribute.key %>'] as List<dynamic>?)?.map((e) => <%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>.fromMap(e)).toList()<% if (!attribute.required) { %> ?? []<% } -%>
|
|
156
156
|
<% } else { -%>
|
|
157
157
|
<% if (!attribute.required) { -%>
|
|
158
|
-
map['<%= attribute.key %>'] != null ? <%- toPascalCase(attribute.relatedCollection) %>.fromMap(map['<%= attribute.key %>']) : null<% } else { -%>
|
|
159
|
-
<%- toPascalCase(attribute.relatedCollection) %>.fromMap(map['<%= attribute.key %>'])<% } -%>
|
|
158
|
+
map['<%= attribute.key %>'] != null ? <%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>.fromMap(map['<%= attribute.key %>']) : null<% } else { -%>
|
|
159
|
+
<%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>.fromMap(map['<%= attribute.key %>'])<% } -%>
|
|
160
160
|
<% } -%>
|
|
161
161
|
<% } -%><% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
162
162
|
<% } -%>
|
|
@@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute');
|
|
|
3
3
|
const { LanguageMeta } = require("./language");
|
|
4
4
|
|
|
5
5
|
class Java extends LanguageMeta {
|
|
6
|
-
getType(attribute) {
|
|
6
|
+
getType(attribute, collections) {
|
|
7
7
|
let type = "";
|
|
8
8
|
switch (attribute.type) {
|
|
9
9
|
case AttributeType.STRING:
|
|
@@ -24,7 +24,11 @@ class Java extends LanguageMeta {
|
|
|
24
24
|
type = "boolean";
|
|
25
25
|
break;
|
|
26
26
|
case AttributeType.RELATIONSHIP:
|
|
27
|
-
|
|
27
|
+
const relatedCollection = collections.find(c => c.$id === attribute.relatedCollection);
|
|
28
|
+
if (!relatedCollection) {
|
|
29
|
+
throw new Error(`Related collection with ID '${attribute.relatedCollection}' not found.`);
|
|
30
|
+
}
|
|
31
|
+
type = LanguageMeta.toPascalCase(relatedCollection.name);
|
|
28
32
|
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
|
|
29
33
|
type = "List<" + type + ">";
|
|
30
34
|
}
|
|
@@ -38,25 +42,21 @@ class Java extends LanguageMeta {
|
|
|
38
42
|
return type;
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
getCurrentDirectory() {
|
|
42
|
-
return process.cwd();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
45
|
getTemplate() {
|
|
46
46
|
return `package io.appwrite.models;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* This file is auto-generated by the Appwrite CLI.
|
|
50
|
-
* You can regenerate it by running \`appwrite
|
|
50
|
+
* You can regenerate it by running \`appwrite ${process.argv.slice(2).join(' ')}\`.
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
53
|
import java.util.Objects;
|
|
54
54
|
<% for (const attribute of collection.attributes) { -%>
|
|
55
55
|
<% if (attribute.type === 'relationship') { -%>
|
|
56
|
-
import io.appwrite.models.<%- toPascalCase(attribute.relatedCollection) %>;
|
|
57
|
-
|
|
56
|
+
import io.appwrite.models.<%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>;
|
|
58
57
|
<% } -%>
|
|
59
58
|
<% } -%>
|
|
59
|
+
|
|
60
60
|
public class <%- toPascalCase(collection.name) %> {
|
|
61
61
|
<% for (const attribute of collection.attributes) { -%>
|
|
62
62
|
<% if (attribute.format === 'enum') { -%>
|
|
@@ -70,7 +70,7 @@ public class <%- toPascalCase(collection.name) %> {
|
|
|
70
70
|
<% } -%>
|
|
71
71
|
<% } -%>
|
|
72
72
|
<% for (const attribute of collection.attributes) { -%>
|
|
73
|
-
private <%- getType(attribute) %> <%- strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
73
|
+
private <%- getType(attribute, collections) %> <%- strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
74
74
|
<% } -%>
|
|
75
75
|
|
|
76
76
|
public <%- toPascalCase(collection.name) %>() {
|
|
@@ -78,7 +78,7 @@ public class <%- toPascalCase(collection.name) %> {
|
|
|
78
78
|
|
|
79
79
|
public <%- toPascalCase(collection.name) %>(
|
|
80
80
|
<% for (const [index, attribute] of Object.entries(collection.attributes)) { -%>
|
|
81
|
-
<%- getType(attribute) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %><%- index < collection.attributes.length - 1 ? ',' : '' %>
|
|
81
|
+
<%- getType(attribute, collections) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %><%- index < collection.attributes.length - 1 ? ',' : '' %>
|
|
82
82
|
<% } -%>
|
|
83
83
|
) {
|
|
84
84
|
<% for (const attribute of collection.attributes) { -%>
|
|
@@ -87,11 +87,11 @@ public class <%- toPascalCase(collection.name) %> {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
<% for (const attribute of collection.attributes) { -%>
|
|
90
|
-
public <%- getType(attribute) %> get<%- toPascalCase(attribute.key) %>() {
|
|
90
|
+
public <%- getType(attribute, collections) %> get<%- toPascalCase(attribute.key) %>() {
|
|
91
91
|
return <%= strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
public void set<%- toPascalCase(attribute.key) %>(<%- getType(attribute) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>) {
|
|
94
|
+
public void set<%- toPascalCase(attribute.key) %>(<%- getType(attribute, collections) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>) {
|
|
95
95
|
this.<%= strict ? toCamelCase(attribute.key) : attribute.key %> = <%= strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -6,7 +6,7 @@ const { AttributeType } = require('../attribute');
|
|
|
6
6
|
const { LanguageMeta } = require("./language");
|
|
7
7
|
|
|
8
8
|
class JavaScript extends LanguageMeta {
|
|
9
|
-
getType(attribute) {
|
|
9
|
+
getType(attribute, collections) {
|
|
10
10
|
let type = ""
|
|
11
11
|
switch (attribute.type) {
|
|
12
12
|
case AttributeType.STRING:
|
|
@@ -29,7 +29,11 @@ class JavaScript extends LanguageMeta {
|
|
|
29
29
|
type = "boolean";
|
|
30
30
|
break;
|
|
31
31
|
case AttributeType.RELATIONSHIP:
|
|
32
|
-
|
|
32
|
+
const relatedCollection = collections.find(c => c.$id === attribute.relatedCollection);
|
|
33
|
+
if (!relatedCollection) {
|
|
34
|
+
throw new Error(`Related collection with ID '${attribute.relatedCollection}' not found.`);
|
|
35
|
+
}
|
|
36
|
+
type = LanguageMeta.toPascalCase(relatedCollection.name);
|
|
33
37
|
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
|
|
34
38
|
type = `${type}[]`;
|
|
35
39
|
}
|
|
@@ -60,19 +64,14 @@ class JavaScript extends LanguageMeta {
|
|
|
60
64
|
return "appwrite";
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
getCurrentDirectory() {
|
|
64
|
-
return process.cwd();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
67
|
getTemplate() {
|
|
68
|
-
return
|
|
69
|
-
// This file is auto-generated by the Appwrite CLI.
|
|
70
|
-
// You can regenerate it by running \`appwrite types -l js ${this.getCurrentDirectory()}\`.
|
|
71
|
-
|
|
72
|
-
/**
|
|
68
|
+
return `/**
|
|
73
69
|
* @typedef {import('${this._getAppwriteDependency()}').Models.Document} Document
|
|
74
70
|
*/
|
|
75
71
|
|
|
72
|
+
// This file is auto-generated by the Appwrite CLI.
|
|
73
|
+
// You can regenerate it by running \`appwrite ${process.argv.slice(2).join(' ')}\`.
|
|
74
|
+
|
|
76
75
|
<% for (const collection of collections) { -%>
|
|
77
76
|
<% for (const attribute of collection.attributes) { -%>
|
|
78
77
|
<% if (attribute.format === 'enum') { -%>
|
|
@@ -83,14 +82,15 @@ class JavaScript extends LanguageMeta {
|
|
|
83
82
|
<% } -%>
|
|
84
83
|
<% } -%>
|
|
85
84
|
<% } -%>
|
|
86
|
-
<% for (const collection of collections) { %>/**
|
|
85
|
+
<% for (const [index, collection] of Object.entries(collections)) { %>/**
|
|
87
86
|
* @typedef {Document & {
|
|
88
87
|
<% for (const attribute of collection.attributes) { -%>
|
|
89
|
-
* <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute) %>;
|
|
88
|
+
* <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %>;
|
|
90
89
|
<% } -%>
|
|
91
90
|
* }} <%- toPascalCase(collection.name) %>
|
|
92
91
|
*/
|
|
93
|
-
|
|
92
|
+
<% if (index < collections.length - 1) { %>
|
|
93
|
+
<% } -%>
|
|
94
94
|
<% } %>`;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute');
|
|
|
3
3
|
const { LanguageMeta } = require("./language");
|
|
4
4
|
|
|
5
5
|
class Kotlin extends LanguageMeta {
|
|
6
|
-
getType(attribute) {
|
|
6
|
+
getType(attribute, collections) {
|
|
7
7
|
let type = "";
|
|
8
8
|
switch (attribute.type) {
|
|
9
9
|
case AttributeType.STRING:
|
|
@@ -24,7 +24,11 @@ class Kotlin extends LanguageMeta {
|
|
|
24
24
|
type = "Boolean";
|
|
25
25
|
break;
|
|
26
26
|
case AttributeType.RELATIONSHIP:
|
|
27
|
-
|
|
27
|
+
const relatedCollection = collections.find(c => c.$id === attribute.relatedCollection);
|
|
28
|
+
if (!relatedCollection) {
|
|
29
|
+
throw new Error(`Related collection with ID '${attribute.relatedCollection}' not found.`);
|
|
30
|
+
}
|
|
31
|
+
type = LanguageMeta.toPascalCase(relatedCollection.name);
|
|
28
32
|
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
|
|
29
33
|
type = `List<${type}>`;
|
|
30
34
|
}
|
|
@@ -41,22 +45,18 @@ class Kotlin extends LanguageMeta {
|
|
|
41
45
|
return type;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
getCurrentDirectory() {
|
|
45
|
-
return process.cwd();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
48
|
getTemplate() {
|
|
49
49
|
return `package io.appwrite.models
|
|
50
50
|
|
|
51
51
|
<% for (const attribute of collection.attributes) { -%>
|
|
52
52
|
<% if (attribute.type === 'relationship') { -%>
|
|
53
|
-
import <%- toPascalCase(attribute.relatedCollection) %>
|
|
53
|
+
import <%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>
|
|
54
54
|
|
|
55
55
|
<% } -%>
|
|
56
56
|
<% } -%>
|
|
57
57
|
/**
|
|
58
58
|
* This file is auto-generated by the Appwrite CLI.
|
|
59
|
-
* You can regenerate it by running \`appwrite
|
|
59
|
+
* You can regenerate it by running \`appwrite ${process.argv.slice(2).join(' ')}\`.
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
62
|
<% for (const attribute of collection.attributes) { -%>
|
|
@@ -71,9 +71,10 @@ enum class <%- toPascalCase(attribute.key) %> {
|
|
|
71
71
|
<% } -%>
|
|
72
72
|
data class <%- toPascalCase(collection.name) %>(
|
|
73
73
|
<% for (const [index, attribute] of Object.entries(collection.attributes)) { -%>
|
|
74
|
-
val <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute) %><% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
74
|
+
val <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %><% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
75
75
|
<% } -%>
|
|
76
|
-
)
|
|
76
|
+
)
|
|
77
|
+
`;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
getFileName(collection) {
|
|
@@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute');
|
|
|
3
3
|
const { LanguageMeta } = require("./language");
|
|
4
4
|
|
|
5
5
|
class PHP extends LanguageMeta {
|
|
6
|
-
getType(attribute) {
|
|
6
|
+
getType(attribute, collections) {
|
|
7
7
|
if (attribute.array) {
|
|
8
8
|
return "array";
|
|
9
9
|
}
|
|
@@ -27,7 +27,11 @@ class PHP extends LanguageMeta {
|
|
|
27
27
|
type = "bool";
|
|
28
28
|
break;
|
|
29
29
|
case AttributeType.RELATIONSHIP:
|
|
30
|
-
|
|
30
|
+
const relatedCollection = collections.find(c => c.$id === attribute.relatedCollection);
|
|
31
|
+
if (!relatedCollection) {
|
|
32
|
+
throw new Error(`Related collection with ID '${attribute.relatedCollection}' not found.`);
|
|
33
|
+
}
|
|
34
|
+
type = LanguageMeta.toPascalCase(relatedCollection.name);
|
|
31
35
|
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
|
|
32
36
|
type = "array";
|
|
33
37
|
}
|
|
@@ -41,20 +45,16 @@ class PHP extends LanguageMeta {
|
|
|
41
45
|
return type;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
getCurrentDirectory() {
|
|
45
|
-
return process.cwd();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
48
|
getTemplate() {
|
|
49
49
|
return `<?php
|
|
50
50
|
namespace Appwrite\\Models;
|
|
51
51
|
|
|
52
52
|
// This file is auto-generated by the Appwrite CLI.
|
|
53
|
-
// You can regenerate it by running \`appwrite
|
|
53
|
+
// You can regenerate it by running \`appwrite ${process.argv.slice(2).join(' ')}\`.
|
|
54
54
|
|
|
55
55
|
<% for (const attribute of collection.attributes) { -%>
|
|
56
56
|
<% if (attribute.type === 'relationship' && !(attribute.relationType === 'manyToMany') && !(attribute.relationType === 'oneToMany' && attribute.side === 'parent')) { -%>
|
|
57
|
-
use Appwrite\\Models\\<%- toPascalCase(attribute.relatedCollection) %>;
|
|
57
|
+
use Appwrite\\Models\\<%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollection).name) %>;
|
|
58
58
|
|
|
59
59
|
<% } -%>
|
|
60
60
|
<% } -%>
|
|
@@ -70,15 +70,15 @@ enum <%- toPascalCase(attribute.key) %>: string {
|
|
|
70
70
|
<% } -%>
|
|
71
71
|
class <%- toPascalCase(collection.name) %> {
|
|
72
72
|
<% for (const attribute of collection.attributes ){ -%>
|
|
73
|
-
private <%- getType(attribute) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
73
|
+
private <%- getType(attribute, collections) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
74
74
|
<% } -%>
|
|
75
75
|
|
|
76
76
|
public function __construct(
|
|
77
77
|
<% for (const attribute of collection.attributes ){ -%>
|
|
78
78
|
<% if (attribute.required) { -%>
|
|
79
|
-
<%- getType(attribute).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %><% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %>
|
|
79
|
+
<%- getType(attribute, collections).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %><% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %>
|
|
80
80
|
<% } else { -%>
|
|
81
|
-
?<%- getType(attribute).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %> = null<% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %>
|
|
81
|
+
?<%- getType(attribute, collections).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %> = null<% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %>
|
|
82
82
|
<% } -%>
|
|
83
83
|
<% } -%>
|
|
84
84
|
) {
|
|
@@ -88,17 +88,18 @@ class <%- toPascalCase(collection.name) %> {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
<% for (const [index, attribute] of Object.entries(collection.attributes)) { -%>
|
|
91
|
-
public function get<%- toPascalCase(attribute.key) %>(): <%- getType(attribute) %> {
|
|
91
|
+
public function get<%- toPascalCase(attribute.key) %>(): <%- getType(attribute, collections) %> {
|
|
92
92
|
return $this-><%- strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
public function set<%- toPascalCase(attribute.key) %>(<%- getType(attribute) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>): void {
|
|
95
|
+
public function set<%- toPascalCase(attribute.key) %>(<%- getType(attribute, collections) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>): void {
|
|
96
96
|
$this-><%- strict ? toCamelCase(attribute.key) : attribute.key %> = $<%- strict ? toCamelCase(attribute.key) : attribute.key %>;
|
|
97
97
|
}
|
|
98
98
|
<% if (index < collection.attributes.length - 1) { %>
|
|
99
99
|
<% } -%>
|
|
100
100
|
<% } -%>
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
getFileName(collection) {
|