├── lib ├── client_io.dart ├── client_browser.dart └── src │ ├── models │ ├── model.dart │ ├── jwt.dart │ ├── algo_md5.dart │ ├── algo_sha.dart │ ├── algo_bcrypt.dart │ ├── algo_phpass.dart │ ├── health_queue.dart │ └── preferences.dart │ ├── service.dart │ ├── enums │ ├── theme.dart │ ├── adapter.dart │ ├── authenticator_type.dart │ ├── database_type.dart │ ├── message_priority.dart │ ├── health_check_status.dart │ ├── compression.dart │ ├── smtp_encryption.dart │ ├── deployment_download_type.dart │ ├── execution_trigger.dart │ ├── vcs_reference_type.dart │ ├── relation_mutate.dart │ ├── messaging_provider_type.dart │ ├── index_type.dart │ ├── template_reference_type.dart │ ├── health_antivirus_status.dart │ ├── authentication_factor.dart │ ├── relationship_type.dart │ ├── message_status.dart │ ├── output.dart │ ├── column_status.dart │ ├── index_status.dart │ ├── attribute_status.dart │ ├── deployment_status.dart │ ├── execution_status.dart │ ├── image_format.dart │ ├── execution_method.dart │ ├── image_gravity.dart │ └── password_hash.dart │ ├── client_stub.dart │ └── response.dart ├── analysis_options.yaml ├── .github └── workflows │ ├── autoclose.yml │ ├── test.yml │ └── publish.yml ├── docs └── examples │ ├── account │ ├── create-jwt.md │ ├── create-anonymous-session.md │ ├── get.md │ ├── delete-sessions.md │ ├── get-prefs.md │ ├── create-session.md │ ├── update-status.md │ ├── create-mfa-challenge.md │ ├── list-sessions.md │ ├── create-phone-token.md │ ├── list-mfa-factors.md │ ├── update-phone-session.md │ ├── create-phone-verification.md │ ├── update-magic-url-session.md │ ├── update-mfa.md │ ├── get-mfa-recovery-codes.md │ ├── update-name.md │ ├── create-mfa-recovery-codes.md │ ├── delete-identity.md │ ├── delete-session.md │ ├── update-mfa-recovery-codes.md │ ├── create-email-password-session.md │ ├── get-session.md │ ├── update-session.md │ ├── delete-mfa-authenticator.md │ ├── create-email-token.md │ ├── create-verification.md │ ├── create.md │ ├── create-email-verification.md │ ├── create-mfa-authenticator.md │ ├── update-phone.md │ ├── list-logs.md │ ├── update-email.md │ ├── update-verification.md │ ├── update-password.md │ ├── create-recovery.md │ ├── update-email-verification.md │ ├── update-mfa-authenticator.md │ ├── update-mfa-challenge.md │ ├── update-phone-verification.md │ ├── list-identities.md │ ├── update-recovery.md │ ├── create-magic-url-token.md │ ├── create-o-auth-2-token.md │ └── update-prefs.md │ ├── health │ ├── get.md │ ├── get-db.md │ ├── get-time.md │ ├── get-cache.md │ ├── get-pub-sub.md │ ├── get-storage.md │ ├── get-antivirus.md │ ├── get-storage-local.md │ ├── get-queue-logs.md │ ├── get-queue-builds.md │ ├── get-queue-deletes.md │ ├── get-queue-mails.md │ ├── get-queue-usage.md │ ├── get-certificate.md │ ├── get-queue-functions.md │ ├── get-queue-messaging.md │ ├── get-queue-webhooks.md │ ├── get-queue-certificates.md │ ├── get-queue-migrations.md │ ├── get-queue-stats-resources.md │ ├── get-failed-jobs.md │ └── get-queue-databases.md │ ├── locale │ ├── get.md │ ├── list-codes.md │ ├── list-countries.md │ ├── list-continents.md │ ├── list-countries-eu.md │ ├── list-currencies.md │ ├── list-languages.md │ └── list-countries-phones.md │ ├── sites │ ├── delete.md │ ├── get.md │ ├── list-frameworks.md │ ├── list-specifications.md │ ├── delete-log.md │ ├── list-variables.md │ ├── get-log.md │ ├── delete-variable.md │ ├── delete-deployment.md │ ├── get-variable.md │ ├── get-deployment.md │ ├── update-site-deployment.md │ ├── update-deployment-status.md │ ├── create-duplicate-deployment.md │ ├── list-logs.md │ ├── list.md │ ├── create-variable.md │ ├── get-deployment-download.md │ ├── create-vcs-deployment.md │ ├── list-deployments.md │ └── update-variable.md │ ├── users │ ├── delete.md │ ├── get.md │ ├── delete-sessions.md │ ├── delete-identity.md │ ├── get-prefs.md │ ├── create-session.md │ ├── list-mfa-factors.md │ ├── update-mfa.md │ ├── delete-target.md │ ├── update-labels.md │ ├── update-name.md │ ├── delete-session.md │ ├── update-prefs.md │ ├── update-status.md │ ├── get-mfa-recovery-codes.md │ ├── get-target.md │ ├── update-password.md │ ├── update-phone.md │ ├── create-mfa-recovery-codes.md │ ├── update-email.md │ ├── update-mfa-recovery-codes.md │ ├── delete-mfa-authenticator.md │ ├── list-sessions.md │ ├── update-email-verification.md │ ├── update-phone-verification.md │ ├── create-token.md │ ├── list-logs.md │ ├── list.md │ ├── create-jwt.md │ ├── list-targets.md │ ├── list-identities.md │ ├── create-md-5-user.md │ ├── create-bcrypt-user.md │ ├── create-argon-2-user.md │ ├── create-ph-pass-user.md │ ├── list-memberships.md │ ├── create.md │ ├── create-sha-user.md │ └── update-target.md │ ├── teams │ ├── delete.md │ ├── get.md │ ├── get-prefs.md │ ├── update-name.md │ ├── update-prefs.md │ ├── delete-membership.md │ ├── create.md │ ├── get-membership.md │ ├── list.md │ ├── update-membership.md │ ├── update-membership-status.md │ └── list-memberships.md │ ├── tokens │ ├── delete.md │ ├── get.md │ ├── update.md │ ├── create-file-token.md │ └── list.md │ ├── graphql │ ├── query.md │ └── mutation.md │ ├── functions │ ├── list-runtimes.md │ ├── delete.md │ ├── get.md │ ├── list-specifications.md │ ├── list-variables.md │ ├── delete-variable.md │ ├── delete-execution.md │ ├── delete-deployment.md │ ├── get-variable.md │ ├── get-deployment.md │ ├── get-execution.md │ ├── update-function-deployment.md │ ├── list.md │ ├── update-deployment-status.md │ ├── create-variable.md │ ├── list-executions.md │ ├── create-duplicate-deployment.md │ ├── get-deployment-download.md │ ├── list-deployments.md │ ├── create-vcs-deployment.md │ └── update-variable.md │ ├── tablesdb │ ├── delete.md │ ├── get.md │ ├── delete-transaction.md │ ├── create-transaction.md │ ├── delete-table.md │ ├── get-transaction.md │ ├── list-transactions.md │ ├── get-table.md │ ├── delete-column.md │ ├── delete-index.md │ ├── get-column.md │ ├── get-index.md │ ├── create.md │ ├── update.md │ ├── list.md │ ├── update-transaction.md │ ├── create-rows.md │ ├── delete-row.md │ ├── delete-rows.md │ ├── upsert-rows.md │ ├── list-columns.md │ ├── list-indexes.md │ ├── list-tables.md │ ├── create-point-column.md │ ├── update-ip-column.md │ ├── create-line-column.md │ ├── get-row.md │ ├── update-rows.md │ ├── create-ip-column.md │ └── update-boolean-column.md │ ├── databases │ ├── delete.md │ ├── get.md │ ├── delete-transaction.md │ ├── create-transaction.md │ ├── get-transaction.md │ ├── list-transactions.md │ ├── delete-collection.md │ ├── delete-index.md │ ├── delete-attribute.md │ ├── get-collection.md │ ├── get-index.md │ ├── create.md │ ├── get-attribute.md │ ├── update.md │ ├── list.md │ ├── update-transaction.md │ ├── list-indexes.md │ ├── delete-documents.md │ ├── list-attributes.md │ ├── list-collections.md │ ├── create-documents.md │ ├── delete-document.md │ ├── upsert-documents.md │ └── create-point-attribute.md │ ├── messaging │ ├── delete.md │ ├── delete-topic.md │ ├── get-topic.md │ ├── delete-provider.md │ ├── get-message.md │ ├── get-provider.md │ ├── delete-subscriber.md │ ├── get-subscriber.md │ ├── create-topic.md │ ├── list-topic-logs.md │ ├── list-targets.md │ ├── update-topic.md │ ├── list-message-logs.md │ ├── list-topics.md │ ├── create-subscriber.md │ ├── list-messages.md │ ├── list-provider-logs.md │ ├── list-providers.md │ ├── list-subscriber-logs.md │ ├── create-fcm-provider.md │ ├── list-subscribers.md │ └── update-fcm-provider.md │ ├── storage │ ├── delete-bucket.md │ ├── get-bucket.md │ ├── delete-file.md │ ├── get-file.md │ ├── get-file-view.md │ ├── list-buckets.md │ ├── get-file-download.md │ └── list-files.md │ └── avatars │ ├── get-favicon.md │ ├── get-image.md │ ├── get-qr.md │ ├── get-flag.md │ ├── get-browser.md │ ├── get-initials.md │ └── get-credit-card.md ├── test ├── src │ ├── models │ │ ├── preferences_test.dart │ │ ├── algo_md5_test.dart │ │ ├── algo_sha_test.dart │ │ ├── health_queue_test.dart │ │ ├── algo_bcrypt_test.dart │ │ ├── algo_phpass_test.dart │ │ ├── mfa_recovery_codes_test.dart │ │ ├── log_list_test.dart │ │ ├── row_list_test.dart │ │ ├── file_list_test.dart │ │ ├── mfa_type_test.dart │ │ ├── site_list_test.dart │ │ ├── team_list_test.dart │ │ ├── user_list_test.dart │ │ ├── index_list_test.dart │ │ ├── phone_list_test.dart │ │ ├── table_list_test.dart │ │ ├── topic_list_test.dart │ │ ├── bucket_list_test.dart │ │ ├── column_list_test.dart │ │ ├── target_list_test.dart │ │ ├── continent_test.dart │ │ ├── message_list_test.dart │ │ ├── runtime_list_test.dart │ │ ├── session_list_test.dart │ │ ├── country_list_test.dart │ │ ├── country_test.dart │ │ ├── locale_code_test.dart │ │ ├── currency_list_test.dart │ │ ├── database_list_test.dart │ │ ├── document_list_test.dart │ │ ├── function_list_test.dart │ │ ├── identity_list_test.dart │ │ ├── language_list_test.dart │ │ ├── provider_list_test.dart │ │ ├── variable_list_test.dart │ │ ├── attribute_list_test.dart │ │ ├── column_index_list_test.dart │ │ ├── continent_list_test.dart │ │ ├── execution_list_test.dart │ │ ├── framework_list_test.dart │ │ ├── collection_list_test.dart │ │ ├── deployment_list_test.dart │ │ ├── locale_code_list_test.dart │ │ ├── membership_list_test.dart │ │ ├── subscriber_list_test.dart │ │ ├── resource_token_list_test.dart │ │ ├── transaction_list_test.dart │ │ ├── headers_test.dart │ │ ├── specification_list_test.dart │ │ ├── language_test.dart │ │ ├── phone_test.dart │ │ └── health_time_test.dart │ ├── response_test.dart │ └── enums_test.dart └── id_test.dart └── pubspec.yaml /lib/client_io.dart: -------------------------------------------------------------------------------- 1 | export 'src/client_io.dart'; 2 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lints/recommended.yaml -------------------------------------------------------------------------------- /lib/client_browser.dart: -------------------------------------------------------------------------------- 1 | export 'src/client_browser.dart'; 2 | -------------------------------------------------------------------------------- /lib/src/models/model.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | abstract class Model { 4 | Map toMap(); 5 | } 6 | -------------------------------------------------------------------------------- /lib/src/service.dart: -------------------------------------------------------------------------------- 1 | import 'client.dart'; 2 | 3 | class Service { 4 | final Client client; 5 | 6 | const Service(this.client); 7 | } 8 | -------------------------------------------------------------------------------- /lib/src/enums/theme.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum Theme { 4 | light(value: 'light'), 5 | dark(value: 'dark'); 6 | 7 | const Theme({required this.value}); 8 | 9 | final String value; 10 | 11 | String toJson() => value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/enums/adapter.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum Adapter { 4 | xstatic(value: 'static'), 5 | ssr(value: 'ssr'); 6 | 7 | const Adapter({required this.value}); 8 | 9 | final String value; 10 | 11 | String toJson() => value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/enums/authenticator_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum AuthenticatorType { 4 | totp(value: 'totp'); 5 | 6 | const AuthenticatorType({required this.value}); 7 | 8 | final String value; 9 | 10 | String toJson() => value; 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/enums/database_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum DatabaseType { 4 | legacy(value: 'legacy'), 5 | tablesdb(value: 'tablesdb'); 6 | 7 | const DatabaseType({required this.value}); 8 | 9 | final String value; 10 | 11 | String toJson() => value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/enums/message_priority.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum MessagePriority { 4 | normal(value: 'normal'), 5 | high(value: 'high'); 6 | 7 | const MessagePriority({required this.value}); 8 | 9 | final String value; 10 | 11 | String toJson() => value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/enums/health_check_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum HealthCheckStatus { 4 | pass(value: 'pass'), 5 | fail(value: 'fail'); 6 | 7 | const HealthCheckStatus({required this.value}); 8 | 9 | final String value; 10 | 11 | String toJson() => value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/enums/compression.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum Compression { 4 | none(value: 'none'), 5 | gzip(value: 'gzip'), 6 | zstd(value: 'zstd'); 7 | 8 | const Compression({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/enums/smtp_encryption.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum SmtpEncryption { 4 | none(value: 'none'), 5 | ssl(value: 'ssl'), 6 | tls(value: 'tls'); 7 | 8 | const SmtpEncryption({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/client_stub.dart: -------------------------------------------------------------------------------- 1 | import 'client_base.dart'; 2 | 3 | /// Implemented in `browser_client.dart` and `io_client.dart`. 4 | ClientBase createClient({required String endPoint, required bool selfSigned}) => 5 | throw UnsupportedError( 6 | 'Cannot create a client without dart:html or dart:io.', 7 | ); 8 | -------------------------------------------------------------------------------- /lib/src/enums/deployment_download_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum DeploymentDownloadType { 4 | source(value: 'source'), 5 | output(value: 'output'); 6 | 7 | const DeploymentDownloadType({required this.value}); 8 | 9 | final String value; 10 | 11 | String toJson() => value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/enums/execution_trigger.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum ExecutionTrigger { 4 | http(value: 'http'), 5 | schedule(value: 'schedule'), 6 | event(value: 'event'); 7 | 8 | const ExecutionTrigger({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/enums/vcs_reference_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum VCSReferenceType { 4 | branch(value: 'branch'), 5 | commit(value: 'commit'), 6 | tag(value: 'tag'); 7 | 8 | const VCSReferenceType({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/enums/relation_mutate.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum RelationMutate { 4 | cascade(value: 'cascade'), 5 | restrict(value: 'restrict'), 6 | setNull(value: 'setNull'); 7 | 8 | const RelationMutate({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/enums/messaging_provider_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum MessagingProviderType { 4 | email(value: 'email'), 5 | sms(value: 'sms'), 6 | push(value: 'push'); 7 | 8 | const MessagingProviderType({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /.github/workflows/autoclose.yml: -------------------------------------------------------------------------------- 1 | name: Auto-close External Pull Requests 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, reopened] 6 | 7 | jobs: 8 | auto_close: 9 | uses: appwrite/.github/.github/workflows/autoclose.yml@main 10 | secrets: 11 | GH_AUTO_CLOSE_PR_TOKEN: ${{ secrets.GH_AUTO_CLOSE_PR_TOKEN }} 12 | -------------------------------------------------------------------------------- /lib/src/enums/index_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum IndexType { 4 | key(value: 'key'), 5 | fulltext(value: 'fulltext'), 6 | unique(value: 'unique'), 7 | spatial(value: 'spatial'); 8 | 9 | const IndexType({required this.value}); 10 | 11 | final String value; 12 | 13 | String toJson() => value; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/enums/template_reference_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum TemplateReferenceType { 4 | branch(value: 'branch'), 5 | commit(value: 'commit'), 6 | tag(value: 'tag'); 7 | 8 | const TemplateReferenceType({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/enums/health_antivirus_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum HealthAntivirusStatus { 4 | disabled(value: 'disabled'), 5 | offline(value: 'offline'), 6 | online(value: 'online'); 7 | 8 | const HealthAntivirusStatus({required this.value}); 9 | 10 | final String value; 11 | 12 | String toJson() => value; 13 | } 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-jwt.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Jwt result = await account.createJWT(); 10 | -------------------------------------------------------------------------------- /lib/src/enums/authentication_factor.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum AuthenticationFactor { 4 | email(value: 'email'), 5 | phone(value: 'phone'), 6 | totp(value: 'totp'), 7 | recoverycode(value: 'recoverycode'); 8 | 9 | const AuthenticationFactor({required this.value}); 10 | 11 | final String value; 12 | 13 | String toJson() => value; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/enums/relationship_type.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum RelationshipType { 4 | oneToOne(value: 'oneToOne'), 5 | manyToOne(value: 'manyToOne'), 6 | manyToMany(value: 'manyToMany'), 7 | oneToMany(value: 'oneToMany'); 8 | 9 | const RelationshipType({required this.value}); 10 | 11 | final String value; 12 | 13 | String toJson() => value; 14 | } 15 | -------------------------------------------------------------------------------- /docs/examples/account/create-anonymous-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Session result = await account.createAnonymousSession(); 10 | -------------------------------------------------------------------------------- /lib/src/enums/message_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum MessageStatus { 4 | draft(value: 'draft'), 5 | processing(value: 'processing'), 6 | scheduled(value: 'scheduled'), 7 | sent(value: 'sent'), 8 | failed(value: 'failed'); 9 | 10 | const MessageStatus({required this.value}); 11 | 12 | final String value; 13 | 14 | String toJson() => value; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/enums/output.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum Output { 4 | jpg(value: 'jpg'), 5 | jpeg(value: 'jpeg'), 6 | png(value: 'png'), 7 | webp(value: 'webp'), 8 | heic(value: 'heic'), 9 | avif(value: 'avif'), 10 | gif(value: 'gif'); 11 | 12 | const Output({required this.value}); 13 | 14 | final String value; 15 | 16 | String toJson() => value; 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/enums/column_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum ColumnStatus { 4 | available(value: 'available'), 5 | processing(value: 'processing'), 6 | deleting(value: 'deleting'), 7 | stuck(value: 'stuck'), 8 | failed(value: 'failed'); 9 | 10 | const ColumnStatus({required this.value}); 11 | 12 | final String value; 13 | 14 | String toJson() => value; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/enums/index_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum IndexStatus { 4 | available(value: 'available'), 5 | processing(value: 'processing'), 6 | deleting(value: 'deleting'), 7 | stuck(value: 'stuck'), 8 | failed(value: 'failed'); 9 | 10 | const IndexStatus({required this.value}); 11 | 12 | final String value; 13 | 14 | String toJson() => value; 15 | } 16 | -------------------------------------------------------------------------------- /test/src/models/preferences_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('Preferences', () { 6 | test('model', () { 7 | final model = Preferences( 8 | data: {}, 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = Preferences.fromMap(map); 13 | }); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/enums/attribute_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum AttributeStatus { 4 | available(value: 'available'), 5 | processing(value: 'processing'), 6 | deleting(value: 'deleting'), 7 | stuck(value: 'stuck'), 8 | failed(value: 'failed'); 9 | 10 | const AttributeStatus({required this.value}); 11 | 12 | final String value; 13 | 14 | String toJson() => value; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/enums/deployment_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum DeploymentStatus { 4 | waiting(value: 'waiting'), 5 | processing(value: 'processing'), 6 | building(value: 'building'), 7 | ready(value: 'ready'), 8 | failed(value: 'failed'); 9 | 10 | const DeploymentStatus({required this.value}); 11 | 12 | final String value; 13 | 14 | String toJson() => value; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/response.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | /// Appwrite Response 4 | class Response { 5 | /// Initializes a [Response] 6 | Response({this.data}); 7 | 8 | /// HTTP body returned from Appwrite 9 | T? data; 10 | 11 | @override 12 | String toString() { 13 | if (data is Map) { 14 | return json.encode(data); 15 | } 16 | return data.toString(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/examples/health/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthStatus result = await health.get(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | Locale result = await locale.get(); 11 | -------------------------------------------------------------------------------- /lib/src/enums/execution_status.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum ExecutionStatus { 4 | waiting(value: 'waiting'), 5 | processing(value: 'processing'), 6 | completed(value: 'completed'), 7 | failed(value: 'failed'), 8 | scheduled(value: 'scheduled'); 9 | 10 | const ExecutionStatus({required this.value}); 11 | 12 | final String value; 13 | 14 | String toJson() => value; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/enums/image_format.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum ImageFormat { 4 | jpg(value: 'jpg'), 5 | jpeg(value: 'jpeg'), 6 | png(value: 'png'), 7 | webp(value: 'webp'), 8 | heic(value: 'heic'), 9 | avif(value: 'avif'), 10 | gif(value: 'gif'); 11 | 12 | const ImageFormat({required this.value}); 13 | 14 | final String value; 15 | 16 | String toJson() => value; 17 | } 18 | -------------------------------------------------------------------------------- /docs/examples/account/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.get(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-db.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthStatus result = await health.getDB(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-time.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthTime result = await health.getTime(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-cache.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthStatus result = await health.getCache(); 11 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Analyze and test 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - uses: dart-lang/setup-dart@v1 11 | - name: Install dependencies 12 | run: dart pub get 13 | - name: Analyze 14 | run: dart analyze --no-fatal-warnings 15 | - name: Test 16 | run: dart test -------------------------------------------------------------------------------- /docs/examples/account/delete-sessions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | await account.deleteSessions(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-pub-sub.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthStatus result = await health.getPubSub(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-storage.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthStatus result = await health.getStorage(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | await sites.delete( 11 | siteId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | await users.delete( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/get-prefs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Preferences result = await account.getPrefs(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-antivirus.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthAntivirus result = await health.getAntivirus(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | LocaleCodeList result = await locale.listCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Site result = await sites.get( 11 | siteId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/list-frameworks.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | FrameworkList result = await sites.listFrameworks(); 11 | -------------------------------------------------------------------------------- /docs/examples/teams/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | await teams.delete( 11 | teamId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/tokens/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Tokens tokens = Tokens(client); 9 | 10 | await tokens.delete( 11 | tokenId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.get( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /test/id_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('unique()', () { 6 | test('returns unique ID', () { 7 | expect((ID.unique()).length, 20); 8 | }); 9 | }); 10 | 11 | group('custom()', () { 12 | test('returns the custom string', () { 13 | expect(ID.custom('custom'), 'custom'); 14 | }); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /docs/examples/account/create-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Session result = await account.createSession( 10 | userId: '', 11 | secret: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-status.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updateStatus(); 11 | -------------------------------------------------------------------------------- /docs/examples/graphql/query.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Graphql graphql = Graphql(client); 9 | 10 | Any result = await graphql.query( 11 | query: {}, 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-storage-local.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthStatus result = await health.getStorageLocal(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-countries.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | CountryList result = await locale.listCountries(); 11 | -------------------------------------------------------------------------------- /lib/src/enums/execution_method.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum ExecutionMethod { 4 | gET(value: 'GET'), 5 | pOST(value: 'POST'), 6 | pUT(value: 'PUT'), 7 | pATCH(value: 'PATCH'), 8 | dELETE(value: 'DELETE'), 9 | oPTIONS(value: 'OPTIONS'), 10 | hEAD(value: 'HEAD'); 11 | 12 | const ExecutionMethod({required this.value}); 13 | 14 | final String value; 15 | 16 | String toJson() => value; 17 | } 18 | -------------------------------------------------------------------------------- /test/src/models/algo_md5_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('AlgoMd5', () { 6 | test('model', () { 7 | final model = AlgoMd5( 8 | type: 'md5', 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = AlgoMd5.fromMap(map); 13 | 14 | expect(result.type, 'md5'); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /test/src/models/algo_sha_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('AlgoSha', () { 6 | test('model', () { 7 | final model = AlgoSha( 8 | type: 'sha', 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = AlgoSha.fromMap(map); 13 | 14 | expect(result.type, 'sha'); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /docs/examples/account/create-mfa-challenge.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | MfaChallenge result = await account.createMFAChallenge( 10 | factor: AuthenticationFactor.email, 11 | ); 12 | -------------------------------------------------------------------------------- /docs/examples/account/list-sessions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | SessionList result = await account.listSessions(); 11 | -------------------------------------------------------------------------------- /docs/examples/functions/list-runtimes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | RuntimeList result = await functions.listRuntimes(); 11 | -------------------------------------------------------------------------------- /docs/examples/graphql/mutation.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Graphql graphql = Graphql(client); 9 | 10 | Any result = await graphql.mutation( 11 | query: {}, 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/locale/list-continents.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | ContinentList result = await locale.listContinents(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-countries-eu.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | CountryList result = await locale.listCountriesEU(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-currencies.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | CurrencyList result = await locale.listCurrencies(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-languages.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | LanguageList result = await locale.listLanguages(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/list-specifications.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | SpecificationList result = await sites.listSpecifications(); 11 | -------------------------------------------------------------------------------- /docs/examples/teams/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Team result = await teams.get( 11 | teamId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete-sessions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | await users.deleteSessions( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create-phone-token.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Token result = await account.createPhoneToken( 10 | userId: '', 11 | phone: '+12065550100', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/list-mfa-factors.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | MfaFactors result = await account.listMFAFactors(); 11 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.delete( 11 | databaseId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /test/src/models/health_queue_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('HealthQueue', () { 6 | test('model', () { 7 | final model = HealthQueue( 8 | size: 8, 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = HealthQueue.fromMap(map); 13 | 14 | expect(result.size, 8); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /docs/examples/account/update-phone-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Session result = await account.updatePhoneSession( 10 | userId: '', 11 | secret: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.delete( 11 | databaseId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | await functions.delete( 11 | functionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/locale/list-countries-phones.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Locale locale = Locale(client); 9 | 10 | PhoneList result = await locale.listCountriesPhones(); 11 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | await messaging.delete( 11 | messageId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/storage/delete-bucket.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Storage storage = Storage(client); 9 | 10 | await storage.deleteBucket( 11 | bucketId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/tokens/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Tokens tokens = Tokens(client); 9 | 10 | ResourceToken result = await tokens.get( 11 | tokenId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete-identity.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | await users.deleteIdentity( 11 | identityId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/get-prefs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Preferences result = await users.getPrefs( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create-phone-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.createPhoneVerification(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/update-magic-url-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Session result = await account.updateMagicURLSession( 10 | userId: '', 11 | secret: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updateMFA( 11 | mfa: false, 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete-topic.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | await messaging.deleteTopic( 11 | topicId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/create-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Session result = await users.createSession( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /test/src/models/algo_bcrypt_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('AlgoBcrypt', () { 6 | test('model', () { 7 | final model = AlgoBcrypt( 8 | type: 'bcrypt', 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = AlgoBcrypt.fromMap(map); 13 | 14 | expect(result.type, 'bcrypt'); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /test/src/models/algo_phpass_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('AlgoPhpass', () { 6 | test('model', () { 7 | final model = AlgoPhpass( 8 | type: 'phpass', 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = AlgoPhpass.fromMap(map); 13 | 14 | expect(result.type, 'phpass'); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /docs/examples/account/get-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | MfaRecoveryCodes result = await account.getMFARecoveryCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/update-name.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updateName( 11 | name: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Func result = await functions.get( 11 | functionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/list-specifications.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | SpecificationList result = await functions.listSpecifications(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/delete-log.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | await sites.deleteLog( 11 | siteId: '', 12 | logId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/list-variables.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | VariableList result = await sites.listVariables( 11 | siteId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/storage/get-bucket.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Storage storage = Storage(client); 9 | 10 | Bucket result = await storage.getBucket( 11 | bucketId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Database result = await tablesDB.get( 11 | databaseId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/teams/get-prefs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Preferences result = await teams.getPrefs( 11 | teamId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/list-mfa-factors.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | MfaFactors result = await users.listMFAFactors( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | MfaRecoveryCodes result = await account.createMFARecoveryCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/delete-identity.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | await account.deleteIdentity( 11 | identityId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/delete-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | await account.deleteSession( 11 | sessionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | MfaRecoveryCodes result = await account.updateMFARecoveryCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/databases/get.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Database result = await databases.get( 11 | databaseId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-topic.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Topic result = await messaging.getTopic( 11 | topicId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/update-mfa.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updateMFA( 11 | userId: '', 12 | mfa: false, 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueLogs( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete-provider.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | await messaging.deleteProvider( 11 | providerId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/get-log.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Execution result = await sites.getLog( 11 | siteId: '', 12 | logId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/delete-target.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | await users.deleteTarget( 11 | userId: '', 12 | targetId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-labels.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updateLabels( 11 | userId: '', 12 | labels: [], 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-name.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updateName( 11 | userId: '', 12 | name: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-email-password-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Session result = await account.createEmailPasswordSession( 10 | email: 'email@example.com', 11 | password: 'password', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/get-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Session result = await account.getSession( 11 | sessionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-favicon.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getFavicon( 11 | url: 'https://example.com', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-builds.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueBuilds( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-deletes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueDeletes( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-mails.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueMails( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-usage.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueUsage( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-message.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Message result = await messaging.getMessage( 11 | messageId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.deleteTransaction( 11 | transactionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | await users.deleteSession( 11 | userId: '', 12 | sessionId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-prefs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Preferences result = await users.updatePrefs( 11 | userId: '', 12 | prefs: {}, 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-status.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updateStatus( 11 | userId: '', 12 | status: false, 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-session.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Session result = await account.updateSession( 11 | sessionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.deleteTransaction( 11 | transactionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-certificate.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthCertificate result = await health.getCertificate( 11 | domain: '', // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-functions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueFunctions( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-messaging.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueMessaging( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-webhooks.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueWebhooks( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-provider.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Provider result = await messaging.getProvider( 11 | providerId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/delete-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | await sites.deleteVariable( 11 | siteId: '', 12 | variableId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/teams/update-name.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Team result = await teams.updateName( 11 | teamId: '', 12 | name: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/get-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | MfaRecoveryCodes result = await users.getMFARecoveryCodes( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/get-target.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Target result = await users.getTarget( 11 | userId: '', 12 | targetId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-password.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updatePassword( 11 | userId: '', 12 | password: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-phone.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updatePhone( 11 | userId: '', 12 | number: '+12065550100', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/delete-mfa-authenticator.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | await account.deleteMFAAuthenticator( 11 | type: AuthenticatorType.totp, 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-certificates.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueCertificates( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-migrations.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueMigrations( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/delete-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | await sites.deleteDeployment( 11 | siteId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/storage/delete-file.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Storage storage = Storage(client); 9 | 10 | await storage.deleteFile( 11 | bucketId: '', 12 | fileId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Transaction result = await tablesDB.createTransaction( 11 | ttl: 60, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/teams/update-prefs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Preferences result = await teams.updatePrefs( 11 | teamId: '', 12 | prefs: {}, 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/create-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | MfaRecoveryCodes result = await users.createMFARecoveryCodes( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/users/update-email.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updateEmail( 11 | userId: '', 12 | email: 'email@example.com', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | MfaRecoveryCodes result = await users.updateMFARecoveryCodes( 11 | userId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /lib/src/models/jwt.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// JWT 4 | class Jwt implements Model { 5 | /// JWT encoded string. 6 | final String jwt; 7 | 8 | Jwt({ 9 | required this.jwt, 10 | }); 11 | 12 | factory Jwt.fromMap(Map map) { 13 | return Jwt( 14 | jwt: map['jwt'].toString(), 15 | ); 16 | } 17 | 18 | @override 19 | Map toMap() { 20 | return { 21 | "jwt": jwt, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/src/models/mfa_recovery_codes_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('MfaRecoveryCodes', () { 6 | test('model', () { 7 | final model = MfaRecoveryCodes( 8 | recoveryCodes: [], 9 | ); 10 | 11 | final map = model.toMap(); 12 | final result = MfaRecoveryCodes.fromMap(map); 13 | 14 | expect(result.recoveryCodes, []); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /docs/examples/account/create-email-token.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Token result = await account.createEmailToken( 10 | userId: '', 11 | email: 'email@example.com', 12 | phrase: false, // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.createVerification( 11 | url: 'https://example.com', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | User result = await account.create( 10 | userId: '', 11 | email: 'email@example.com', 12 | password: '', 13 | name: '', // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/create-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Transaction result = await databases.createTransaction( 11 | ttl: 60, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/list-variables.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | VariableList result = await functions.listVariables( 11 | functionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-stats-resources.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueStatsResources( 11 | threshold: 0, // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/get-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Variable result = await sites.getVariable( 11 | siteId: '', 12 | variableId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-table.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.deleteTable( 11 | databaseId: '', 12 | tableId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Transaction result = await tablesDB.getTransaction( 11 | transactionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-transactions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | TransactionList result = await tablesDB.listTransactions( 11 | queries: [], // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/tokens/update.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Tokens tokens = Tokens(client); 9 | 10 | ResourceToken result = await tokens.update( 11 | tokenId: '', 12 | expire: '', // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /test/src/models/log_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('LogList', () { 6 | test('model', () { 7 | final model = LogList( 8 | total: 5, 9 | logs: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = LogList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.logs, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/row_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('RowList', () { 6 | test('model', () { 7 | final model = RowList( 8 | total: 5, 9 | rows: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = RowList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.rows, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/databases/get-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Transaction result = await databases.getTransaction( 11 | transactionId: '', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/list-transactions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | TransactionList result = await databases.listTransactions( 11 | queries: [], // (optional) 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/storage/get-file.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Storage storage = Storage(client); 9 | 10 | File result = await storage.getFile( 11 | bucketId: '', 12 | fileId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/teams/delete-membership.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | await teams.deleteMembership( 11 | teamId: '', 12 | membershipId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/delete-mfa-authenticator.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | await users.deleteMFAAuthenticator( 11 | userId: '', 12 | type: AuthenticatorType.totp, 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/list-sessions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | SessionList result = await users.listSessions( 11 | userId: '', 12 | total: false, // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /test/src/models/file_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('FileList', () { 6 | test('model', () { 7 | final model = FileList( 8 | total: 5, 9 | files: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = FileList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.files, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/mfa_type_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('MfaType', () { 6 | test('model', () { 7 | final model = MfaType( 8 | secret: '1', 9 | uri: '1', 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = MfaType.fromMap(map); 14 | 15 | expect(result.secret, '1'); 16 | expect(result.uri, '1'); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/site_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('SiteList', () { 6 | test('model', () { 7 | final model = SiteList( 8 | total: 5, 9 | sites: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = SiteList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.sites, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/team_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('TeamList', () { 6 | test('model', () { 7 | final model = TeamList( 8 | total: 5, 9 | teams: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = TeamList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.teams, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/user_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('UserList', () { 6 | test('model', () { 7 | final model = UserList( 8 | total: 5, 9 | users: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = UserList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.users, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/account/create-email-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.createEmailVerification( 11 | url: 'https://example.com', 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create-mfa-authenticator.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | MfaType result = await account.createMFAAuthenticator( 11 | type: AuthenticatorType.totp, 12 | ); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-phone.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updatePhone( 11 | phone: '+12065550100', 12 | password: 'password', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/get-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Deployment result = await sites.getDeployment( 11 | siteId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-table.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Table result = await tablesDB.getTable( 11 | databaseId: '', 12 | tableId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /test/src/models/index_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('IndexList', () { 6 | test('model', () { 7 | final model = IndexList( 8 | total: 5, 9 | indexes: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = IndexList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.indexes, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/phone_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('PhoneList', () { 6 | test('model', () { 7 | final model = PhoneList( 8 | total: 5, 9 | phones: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = PhoneList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.phones, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/table_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('TableList', () { 6 | test('model', () { 7 | final model = TableList( 8 | total: 5, 9 | tables: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = TableList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.tables, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/topic_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('TopicList', () { 6 | test('model', () { 7 | final model = TopicList( 8 | total: 5, 9 | topics: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = TopicList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.topics, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/account/list-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | LogList result = await account.listLogs( 11 | queries: [], // (optional) 12 | total: false, // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-email.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updateEmail( 11 | email: 'email@example.com', 12 | password: 'password', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/delete-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | await functions.deleteVariable( 11 | functionId: '', 12 | variableId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/health/get-failed-jobs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getFailedJobs( 11 | name: Name.v1Database, 12 | threshold: 0, // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/teams/create.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Team result = await teams.create( 11 | teamId: '', 12 | name: '', 13 | roles: [], // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/models/bucket_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('BucketList', () { 6 | test('model', () { 7 | final model = BucketList( 8 | total: 5, 9 | buckets: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = BucketList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.buckets, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/column_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ColumnList', () { 6 | test('model', () { 7 | final model = ColumnList( 8 | total: 5, 9 | columns: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = ColumnList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.columns, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/target_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('TargetList', () { 6 | test('model', () { 7 | final model = TargetList( 8 | total: 5, 9 | targets: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = TargetList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.targets, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/response_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/src/response.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('toString()', () { 6 | test('with a string', () { 7 | final response = Response(data: 'string'); 8 | 9 | expect(response.toString(), 'string'); 10 | }); 11 | 12 | test('with a map', () { 13 | final response = Response(data: {'x': 1}); 14 | 15 | expect(response.toString(), '{"x":1}'); 16 | }); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /docs/examples/account/update-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.updateVerification( 11 | userId: '', 12 | secret: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/delete-execution.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | await functions.deleteExecution( 11 | functionId: '', 12 | executionId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete-subscriber.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setJWT(''); // Your secret JSON Web Token 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | await messaging.deleteSubscriber( 11 | topicId: '', 12 | subscriberId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/update-site-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Site result = await sites.updateSiteDeployment( 11 | siteId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.deleteColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-index.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.deleteIndex( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/get-membership.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Membership result = await teams.getMembership( 11 | teamId: '', 12 | membershipId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-email-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updateEmailVerification( 11 | userId: '', 12 | emailVerification: false, 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-phone-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.updatePhoneVerification( 11 | userId: '', 12 | phoneVerification: false, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/src/models/algo_md5.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// AlgoMD5 4 | class AlgoMd5 implements Model { 5 | /// Algo type. 6 | final String type; 7 | 8 | AlgoMd5({ 9 | required this.type, 10 | }); 11 | 12 | factory AlgoMd5.fromMap(Map map) { 13 | return AlgoMd5( 14 | type: map['type'].toString(), 15 | ); 16 | } 17 | 18 | @override 19 | Map toMap() { 20 | return { 21 | "type": type, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/models/algo_sha.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// AlgoSHA 4 | class AlgoSha implements Model { 5 | /// Algo type. 6 | final String type; 7 | 8 | AlgoSha({ 9 | required this.type, 10 | }); 11 | 12 | factory AlgoSha.fromMap(Map map) { 13 | return AlgoSha( 14 | type: map['type'].toString(), 15 | ); 16 | } 17 | 18 | @override 19 | Map toMap() { 20 | return { 21 | "type": type, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/src/models/continent_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('Continent', () { 6 | test('model', () { 7 | final model = Continent( 8 | name: 'Europe', 9 | code: 'EU', 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = Continent.fromMap(map); 14 | 15 | expect(result.name, 'Europe'); 16 | expect(result.code, 'EU'); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/message_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('MessageList', () { 6 | test('model', () { 7 | final model = MessageList( 8 | total: 5, 9 | messages: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = MessageList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.messages, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/runtime_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('RuntimeList', () { 6 | test('model', () { 7 | final model = RuntimeList( 8 | total: 5, 9 | runtimes: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = RuntimeList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.runtimes, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/session_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('SessionList', () { 6 | test('model', () { 7 | final model = SessionList( 8 | total: 5, 9 | sessions: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = SessionList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.sessions, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/account/update-password.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updatePassword( 11 | password: '', 12 | oldPassword: 'password', // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-collection.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.deleteCollection( 11 | databaseId: '', 12 | collectionId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/delete-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | await functions.deleteDeployment( 11 | functionId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | result = await tablesDB.getColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/models/country_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('CountryList', () { 6 | test('model', () { 7 | final model = CountryList( 8 | total: 5, 9 | countries: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = CountryList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.countries, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/country_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('Country', () { 6 | test('model', () { 7 | final model = Country( 8 | name: 'United States', 9 | code: 'US', 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = Country.fromMap(map); 14 | 15 | expect(result.name, 'United States'); 16 | expect(result.code, 'US'); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/locale_code_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('LocaleCode', () { 6 | test('model', () { 7 | final model = LocaleCode( 8 | code: 'en-us', 9 | name: 'US', 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = LocaleCode.fromMap(map); 14 | 15 | expect(result.code, 'en-us'); 16 | expect(result.name, 'US'); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/account/create-recovery.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.createRecovery( 11 | email: 'email@example.com', 12 | url: 'https://example.com', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-email-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.updateEmailVerification( 11 | userId: '', 12 | secret: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa-authenticator.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updateMFAAuthenticator( 11 | type: AuthenticatorType.totp, 12 | otp: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa-challenge.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Session result = await account.updateMFAChallenge( 11 | challengeId: '', 12 | otp: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-phone-verification.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.updatePhoneVerification( 11 | userId: '', 12 | secret: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/get-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Variable result = await functions.getVariable( 11 | functionId: '', 12 | variableId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-databases.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Health health = Health(client); 9 | 10 | HealthQueue result = await health.getQueueDatabases( 11 | name: '', // (optional) 12 | threshold: 0, // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/update-deployment-status.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Deployment result = await sites.updateDeploymentStatus( 11 | siteId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/users/create-token.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Token result = await users.createToken( 11 | userId: '', 12 | length: 4, // (optional) 13 | expire: 60, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/list-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | LogList result = await users.listLogs( 11 | userId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/models/currency_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('CurrencyList', () { 6 | test('model', () { 7 | final model = CurrencyList( 8 | total: 5, 9 | currencies: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = CurrencyList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.currencies, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/database_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('DatabaseList', () { 6 | test('model', () { 7 | final model = DatabaseList( 8 | total: 5, 9 | databases: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = DatabaseList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.databases, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/document_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('DocumentList', () { 6 | test('model', () { 7 | final model = DocumentList( 8 | total: 5, 9 | documents: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = DocumentList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.documents, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/function_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('FunctionList', () { 6 | test('model', () { 7 | final model = FunctionList( 8 | total: 5, 9 | functions: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = FunctionList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.functions, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/identity_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('IdentityList', () { 6 | test('model', () { 7 | final model = IdentityList( 8 | total: 5, 9 | identities: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = IdentityList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.identities, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/language_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('LanguageList', () { 6 | test('model', () { 7 | final model = LanguageList( 8 | total: 5, 9 | languages: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = LanguageList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.languages, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/provider_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ProviderList', () { 6 | test('model', () { 7 | final model = ProviderList( 8 | total: 5, 9 | providers: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = ProviderList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.providers, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/variable_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('VariableList', () { 6 | test('model', () { 7 | final model = VariableList( 8 | total: 5, 9 | variables: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = VariableList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.variables, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to pub.dev 2 | 3 | on: 4 | push: 5 | tags: 6 | - '[0-9]+\.[0-9]+\.[0-9]+*' 7 | 8 | jobs: 9 | publish: 10 | permissions: 11 | id-token: write # Required for authentication using OIDC 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: dart-lang/setup-dart@v1 16 | - name: Install dependencies 17 | run: dart pub get 18 | - name: Publish 19 | run: dart pub publish --force 20 | -------------------------------------------------------------------------------- /docs/examples/account/list-identities.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | IdentityList result = await account.listIdentities( 11 | queries: [], // (optional) 12 | total: false, // (optional) 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-recovery.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | Token result = await account.updateRecovery( 11 | userId: '', 12 | secret: '', 13 | password: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-index.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.deleteIndex( 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-subscriber.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Subscriber result = await messaging.getSubscriber( 11 | topicId: '', 12 | subscriberId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/create-duplicate-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Deployment result = await sites.createDuplicateDeployment( 11 | siteId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/list-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | ExecutionList result = await sites.listLogs( 11 | siteId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/sites/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | SiteList result = await sites.list( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-index.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnIndex result = await tablesDB.getIndex( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | UserList result = await users.list( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /lib/src/enums/image_gravity.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum ImageGravity { 4 | center(value: 'center'), 5 | topLeft(value: 'top-left'), 6 | top(value: 'top'), 7 | topRight(value: 'top-right'), 8 | left(value: 'left'), 9 | right(value: 'right'), 10 | bottomLeft(value: 'bottom-left'), 11 | bottom(value: 'bottom'), 12 | bottomRight(value: 'bottom-right'); 13 | 14 | const ImageGravity({required this.value}); 15 | 16 | final String value; 17 | 18 | String toJson() => value; 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/models/algo_bcrypt.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// AlgoBcrypt 4 | class AlgoBcrypt implements Model { 5 | /// Algo type. 6 | final String type; 7 | 8 | AlgoBcrypt({ 9 | required this.type, 10 | }); 11 | 12 | factory AlgoBcrypt.fromMap(Map map) { 13 | return AlgoBcrypt( 14 | type: map['type'].toString(), 15 | ); 16 | } 17 | 18 | @override 19 | Map toMap() { 20 | return { 21 | "type": type, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/models/algo_phpass.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// AlgoPHPass 4 | class AlgoPhpass implements Model { 5 | /// Algo type. 6 | final String type; 7 | 8 | AlgoPhpass({ 9 | required this.type, 10 | }); 11 | 12 | factory AlgoPhpass.fromMap(Map map) { 13 | return AlgoPhpass( 14 | type: map['type'].toString(), 15 | ); 16 | } 17 | 18 | @override 19 | Map toMap() { 20 | return { 21 | "type": type, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/src/models/attribute_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('AttributeList', () { 6 | test('model', () { 7 | final model = AttributeList( 8 | total: 5, 9 | attributes: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = AttributeList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.attributes, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/column_index_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ColumnIndexList', () { 6 | test('model', () { 7 | final model = ColumnIndexList( 8 | total: 5, 9 | indexes: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = ColumnIndexList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.indexes, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/continent_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ContinentList', () { 6 | test('model', () { 7 | final model = ContinentList( 8 | total: 5, 9 | continents: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = ContinentList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.continents, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/execution_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ExecutionList', () { 6 | test('model', () { 7 | final model = ExecutionList( 8 | total: 5, 9 | executions: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = ExecutionList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.executions, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/framework_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('FrameworkList', () { 6 | test('model', () { 7 | final model = FrameworkList( 8 | total: 5, 9 | frameworks: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = FrameworkList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.frameworks, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-attribute.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.deleteAttribute( 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/get-collection.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Collection result = await databases.getCollection( 11 | databaseId: '', 12 | collectionId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/databases/get-index.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Index result = await databases.getIndex( 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/get-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Deployment result = await functions.getDeployment( 11 | functionId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/get-execution.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Functions functions = Functions(client); 9 | 10 | Execution result = await functions.getExecution( 11 | functionId: '', 12 | executionId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Database result = await tablesDB.create( 11 | databaseId: '', 12 | name: '', 13 | enabled: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Database result = await tablesDB.update( 11 | databaseId: '', 12 | name: '', 13 | enabled: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | TeamList result = await teams.list( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/create-jwt.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Jwt result = await users.createJWT( 11 | userId: '', 12 | sessionId: '', // (optional) 13 | duration: 0, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/list-targets.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | TargetList result = await users.listTargets( 11 | userId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/enums_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/src/enums.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('name()', () { 6 | for (final method in HttpMethod.values) { 7 | test( 8 | 'returns ${method.toString().split('.').last.toUpperCase()} for $method', 9 | () { 10 | expect( 11 | method.name(), 12 | method.toString().split('.').last.toUpperCase(), 13 | ); 14 | }, 15 | ); 16 | } 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /test/src/models/collection_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('CollectionList', () { 6 | test('model', () { 7 | final model = CollectionList( 8 | total: 5, 9 | collections: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = CollectionList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.collections, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/deployment_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('DeploymentList', () { 6 | test('model', () { 7 | final model = DeploymentList( 8 | total: 5, 9 | deployments: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = DeploymentList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.deployments, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/locale_code_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('LocaleCodeList', () { 6 | test('model', () { 7 | final model = LocaleCodeList( 8 | total: 5, 9 | localeCodes: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = LocaleCodeList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.localeCodes, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/membership_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('MembershipList', () { 6 | test('model', () { 7 | final model = MembershipList( 8 | total: 5, 9 | memberships: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = MembershipList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.memberships, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/subscriber_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('SubscriberList', () { 6 | test('model', () { 7 | final model = SubscriberList( 8 | total: 5, 9 | subscribers: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = SubscriberList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.subscribers, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/databases/create.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Database result = await databases.create( 11 | databaseId: '', 12 | name: '', 13 | enabled: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/get-attribute.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | result = await databases.getAttribute( 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/update.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Database result = await databases.update( 11 | databaseId: '', 12 | name: '', 13 | enabled: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/update-membership.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Membership result = await teams.updateMembership( 11 | teamId: '', 12 | membershipId: '', 13 | roles: [], 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/models/resource_token_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('ResourceTokenList', () { 6 | test('model', () { 7 | final model = ResourceTokenList( 8 | total: 5, 9 | tokens: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = ResourceTokenList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.tokens, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /test/src/models/transaction_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('TransactionList', () { 6 | test('model', () { 7 | final model = TransactionList( 8 | total: 5, 9 | transactions: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = TransactionList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.transactions, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-image.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getImage( 11 | url: 'https://example.com', 12 | width: 0, // (optional) 13 | height: 0, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-topic.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Topic result = await messaging.createTopic( 11 | topicId: '', 12 | name: '', 13 | subscribe: ["any"], // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tokens/create-file-token.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Tokens tokens = Tokens(client); 9 | 10 | ResourceToken result = await tokens.createFileToken( 11 | bucketId: '', 12 | fileId: '', 13 | expire: '', // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /lib/src/models/health_queue.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// Health Queue 4 | class HealthQueue implements Model { 5 | /// Amount of actions in the queue. 6 | final int size; 7 | 8 | HealthQueue({ 9 | required this.size, 10 | }); 11 | 12 | factory HealthQueue.fromMap(Map map) { 13 | return HealthQueue( 14 | size: map['size'], 15 | ); 16 | } 17 | 18 | @override 19 | Map toMap() { 20 | return { 21 | "size": size, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs/examples/account/create-magic-url-token.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | Token result = await account.createMagicURLToken( 10 | userId: '', 11 | email: 'email@example.com', 12 | url: 'https://example.com', // (optional) 13 | phrase: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/update-function-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Func result = await functions.updateFunctionDeployment( 11 | functionId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/create-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Variable result = await sites.createVariable( 11 | siteId: '', 12 | key: '', 13 | value: '', 14 | secret: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | DatabaseList result = await tablesDB.list( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/models/headers_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('Headers', () { 6 | test('model', () { 7 | final model = Headers( 8 | name: 'Content-Type', 9 | value: 'application/json', 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = Headers.fromMap(map); 14 | 15 | expect(result.name, 'Content-Type'); 16 | expect(result.value, 'application/json'); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/databases/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | DatabaseList result = await databases.list( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | FunctionList result = await functions.list( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/update-deployment-status.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Deployment result = await functions.updateDeploymentStatus( 11 | functionId: '', 12 | deploymentId: '', 13 | ); 14 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-topic-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | LogList result = await messaging.listTopicLogs( 11 | topicId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/storage/get-file-view.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Storage storage = Storage(client); 9 | 10 | Uint8List result = await storage.getFileView( 11 | bucketId: '', 12 | fileId: '', 13 | token: '', // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/storage/list-buckets.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Storage storage = Storage(client); 9 | 10 | BucketList result = await storage.listBuckets( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/list-identities.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | IdentityList result = await users.listIdentities( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /test/src/models/specification_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('SpecificationList', () { 6 | test('model', () { 7 | final model = SpecificationList( 8 | total: 5, 9 | specifications: [], 10 | ); 11 | 12 | final map = model.toMap(); 13 | final result = SpecificationList.fromMap(map); 14 | 15 | expect(result.total, 5); 16 | expect(result.specifications, []); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-targets.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | TargetList result = await messaging.listTargets( 11 | messageId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/update-topic.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Topic result = await messaging.updateTopic( 11 | topicId: '', 12 | name: '', // (optional) 13 | subscribe: ["any"], // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/storage/get-file-download.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Storage storage = Storage(client); 9 | 10 | Uint8List result = await storage.getFileDownload( 11 | bucketId: '', 12 | fileId: '', 13 | token: '', // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/account/create-o-auth-2-token.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject(''); // Your project ID 6 | 7 | Account account = Account(client); 8 | 9 | await account.createOAuth2Token( 10 | provider: OAuthProvider.amazon, 11 | success: 'https://example.com', // (optional) 12 | failure: 'https://example.com', // (optional) 13 | scopes: [], // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/account/update-prefs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Account account = Account(client); 9 | 10 | User result = await account.updatePrefs( 11 | prefs: { 12 | "language": "en", 13 | "timezone": "UTC", 14 | "darkTheme": true 15 | }, 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-qr.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getQR( 11 | text: '', 12 | size: 1, // (optional) 13 | margin: 0, // (optional) 14 | download: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-message-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | LogList result = await messaging.listMessageLogs( 11 | messageId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-topics.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | TopicList result = await messaging.listTopics( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tokens/list.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Tokens tokens = Tokens(client); 9 | 10 | ResourceTokenList result = await tokens.list( 11 | bucketId: '', 12 | fileId: '', 13 | queries: [], // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/users/create-md-5-user.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.createMD5User( 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-subscriber.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setJWT(''); // Your secret JSON Web Token 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Subscriber result = await messaging.createSubscriber( 11 | topicId: '', 12 | subscriberId: '', 13 | targetId: '', 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-messages.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | MessageList result = await messaging.listMessages( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-provider-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | LogList result = await messaging.listProviderLogs( 11 | providerId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-providers.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | ProviderList result = await messaging.listProviders( 11 | queries: [], // (optional) 12 | search: '', // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/create-bcrypt-user.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.createBcryptUser( 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-flag.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getFlag( 11 | code: Flag.afghanistan, 12 | width: 0, // (optional) 13 | height: 0, // (optional) 14 | quality: -1, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-subscriber-logs.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | LogList result = await messaging.listSubscriberLogs( 11 | subscriberId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/users/create-argon-2-user.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.createArgon2User( 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/users/create-ph-pass-user.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.createPHPassUser( 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/create-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Variable result = await functions.createVariable( 11 | functionId: '', 12 | key: '', 13 | value: '', 14 | secret: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/list-executions.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Functions functions = Functions(client); 9 | 10 | ExecutionList result = await functions.listExecutions( 11 | functionId: '', 12 | queries: [], // (optional) 13 | total: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/sites/get-deployment-download.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Uint8List result = await sites.getDeploymentDownload( 11 | siteId: '', 12 | deploymentId: '', 13 | type: DeploymentDownloadType.source, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Transaction result = await tablesDB.updateTransaction( 11 | transactionId: '', 12 | commit: false, // (optional) 13 | rollback: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-browser.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getBrowser( 11 | code: Browser.avantBrowser, 12 | width: 0, // (optional) 13 | height: 0, // (optional) 14 | quality: -1, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/update-transaction.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | Transaction result = await databases.updateTransaction( 11 | transactionId: '', 12 | commit: false, // (optional) 13 | rollback: false, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-rows.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | RowList result = await tablesDB.createRows( 11 | databaseId: '', 12 | tableId: '', 13 | rows: [], 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-row.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.deleteRow( 11 | databaseId: '', 12 | tableId: '', 13 | rowId: '', 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-rows.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | await tablesDB.deleteRows( 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // (optional) 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/upsert-rows.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | RowList result = await tablesDB.upsertRows( 11 | databaseId: '', 12 | tableId: '', 13 | rows: [], 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-initials.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getInitials( 11 | name: '', // (optional) 12 | width: 0, // (optional) 13 | height: 0, // (optional) 14 | background: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/sites/create-vcs-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Deployment result = await sites.createVcsDeployment( 11 | siteId: '', 12 | type: VCSReferenceType.branch, 13 | reference: '', 14 | activate: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/sites/list-deployments.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | DeploymentList result = await sites.listDeployments( 11 | siteId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/storage/list-files.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Storage storage = Storage(client); 9 | 10 | FileList result = await storage.listFiles( 11 | bucketId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-columns.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnList result = await tablesDB.listColumns( 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/teams/update-membership-status.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | Membership result = await teams.updateMembershipStatus( 11 | teamId: '', 12 | membershipId: '', 13 | userId: '', 14 | secret: '', 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/users/list-memberships.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | MembershipList result = await users.listMemberships( 11 | userId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-indexes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnIndexList result = await tablesDB.listIndexes( 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-tables.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | TableList result = await tablesDB.listTables( 11 | databaseId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/teams/list-memberships.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Teams teams = Teams(client); 9 | 10 | MembershipList result = await teams.listMemberships( 11 | teamId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-credit-card.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Avatars avatars = Avatars(client); 9 | 10 | Uint8List result = await avatars.getCreditCard( 11 | code: CreditCard.americanExpress, 12 | width: 0, // (optional) 13 | height: 0, // (optional) 14 | quality: -1, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/list-indexes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | IndexList result = await databases.listIndexes( 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /lib/src/enums/password_hash.dart: -------------------------------------------------------------------------------- 1 | part of '../../enums.dart'; 2 | 3 | enum PasswordHash { 4 | sha1(value: 'sha1'), 5 | sha224(value: 'sha224'), 6 | sha256(value: 'sha256'), 7 | sha384(value: 'sha384'), 8 | sha512224(value: 'sha512/224'), 9 | sha512256(value: 'sha512/256'), 10 | sha512(value: 'sha512'), 11 | sha3224(value: 'sha3-224'), 12 | sha3256(value: 'sha3-256'), 13 | sha3384(value: 'sha3-384'), 14 | sha3512(value: 'sha3-512'); 15 | 16 | const PasswordHash({required this.value}); 17 | 18 | final String value; 19 | 20 | String toJson() => value; 21 | } 22 | -------------------------------------------------------------------------------- /test/src/models/language_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('Language', () { 6 | test('model', () { 7 | final model = Language( 8 | name: 'Italian', 9 | code: 'it', 10 | nativeName: 'Italiano', 11 | ); 12 | 13 | final map = model.toMap(); 14 | final result = Language.fromMap(map); 15 | 16 | expect(result.name, 'Italian'); 17 | expect(result.code, 'it'); 18 | expect(result.nativeName, 'Italiano'); 19 | }); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /docs/examples/functions/create-duplicate-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Deployment result = await functions.createDuplicateDeployment( 11 | functionId: '', 12 | deploymentId: '', 13 | buildId: '', // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/sites/update-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Sites sites = Sites(client); 9 | 10 | Variable result = await sites.updateVariable( 11 | siteId: '', 12 | variableId: '', 13 | key: '', 14 | value: '', // (optional) 15 | secret: false, // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /test/src/models/phone_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('Phone', () { 6 | test('model', () { 7 | final model = Phone( 8 | code: '+1', 9 | countryCode: 'US', 10 | countryName: 'United States', 11 | ); 12 | 13 | final map = model.toMap(); 14 | final result = Phone.fromMap(map); 15 | 16 | expect(result.code, '+1'); 17 | expect(result.countryCode, 'US'); 18 | expect(result.countryName, 'United States'); 19 | }); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-documents.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.deleteDocuments( 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // (optional) 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/list-attributes.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | AttributeList result = await databases.listAttributes( 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/get-deployment-download.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Uint8List result = await functions.getDeploymentDownload( 11 | functionId: '', 12 | deploymentId: '', 13 | type: DeploymentDownloadType.source, // (optional) 14 | ); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-fcm-provider.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Provider result = await messaging.createFCMProvider( 11 | providerId: '', 12 | name: '', 13 | serviceAccountJSON: {}, // (optional) 14 | enabled: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-subscribers.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | SubscriberList result = await messaging.listSubscribers( 11 | topicId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/list-collections.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | CollectionList result = await databases.listCollections( 11 | databaseId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/list-deployments.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | DeploymentList result = await functions.listDeployments( 11 | functionId: '', 12 | queries: [], // (optional) 13 | search: '', // (optional) 14 | total: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-point-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnPoint result = await tablesDB.createPointColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | xrequired: false, 15 | xdefault: [1, 2], // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/users/create.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.create( 11 | userId: '', 12 | email: 'email@example.com', // (optional) 13 | phone: '+12065550100', // (optional) 14 | password: '', // (optional) 15 | name: '', // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /lib/src/models/preferences.dart: -------------------------------------------------------------------------------- 1 | part of '../../models.dart'; 2 | 3 | /// Preferences 4 | class Preferences implements Model { 5 | final Map data; 6 | 7 | Preferences({ 8 | required this.data, 9 | }); 10 | 11 | factory Preferences.fromMap(Map map) { 12 | return Preferences( 13 | data: map["data"] ?? map, 14 | ); 15 | } 16 | 17 | @override 18 | Map toMap() { 19 | return { 20 | "data": data, 21 | }; 22 | } 23 | 24 | T convertTo(T Function(Map) fromJson) => fromJson(data); 25 | } 26 | -------------------------------------------------------------------------------- /docs/examples/databases/create-documents.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | DocumentList result = await databases.createDocuments( 11 | databaseId: '', 12 | collectionId: '', 13 | documents: [], 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-document.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | Databases databases = Databases(client); 9 | 10 | await databases.deleteDocument( 11 | databaseId: '', 12 | collectionId: '', 13 | documentId: '', 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/upsert-documents.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | DocumentList result = await databases.upsertDocuments( 11 | databaseId: '', 12 | collectionId: '', 13 | documents: [], 14 | transactionId: '', // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/create-vcs-deployment.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Deployment result = await functions.createVcsDeployment( 11 | functionId: '', 12 | type: VCSReferenceType.branch, 13 | reference: '', 14 | activate: false, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /test/src/models/health_time_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/models.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | group('HealthTime', () { 6 | test('model', () { 7 | final model = HealthTime( 8 | remoteTime: 1639490751, 9 | localTime: 1639490844, 10 | diff: 93, 11 | ); 12 | 13 | final map = model.toMap(); 14 | final result = HealthTime.fromMap(map); 15 | 16 | expect(result.remoteTime, 1639490751); 17 | expect(result.localTime, 1639490844); 18 | expect(result.diff, 93); 19 | }); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /docs/examples/messaging/update-fcm-provider.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Messaging messaging = Messaging(client); 9 | 10 | Provider result = await messaging.updateFCMProvider( 11 | providerId: '', 12 | name: '', // (optional) 13 | enabled: false, // (optional) 14 | serviceAccountJSON: {}, // (optional) 15 | ); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-ip-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnIp result = await tablesDB.updateIpColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | xrequired: false, 15 | xdefault: '', 16 | newKey: '', // (optional) 17 | ); 18 | -------------------------------------------------------------------------------- /docs/examples/users/create-sha-user.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | User result = await users.createSHAUser( 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | passwordVersion: PasswordHash.sha1, // (optional) 15 | name: '', // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dart_appwrite 2 | version: 20.0.0 3 | description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API 4 | homepage: https://appwrite.io 5 | repository: https://github.com/appwrite/sdk-for-dart 6 | issue_tracker: https://github.com/appwrite/sdk-generator/issues 7 | documentation: https://appwrite.io/support 8 | environment: 9 | sdk: '>=2.17.0 <4.0.0' 10 | dependencies: 11 | http: '>=0.13.6 <2.0.0' 12 | 13 | dev_dependencies: 14 | lints: ^6.0.0 15 | test: ^1.25.8 16 | mockito: ^5.4.4 17 | -------------------------------------------------------------------------------- /docs/examples/functions/update-variable.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Functions functions = Functions(client); 9 | 10 | Variable result = await functions.updateVariable( 11 | functionId: '', 12 | variableId: '', 13 | key: '', 14 | value: '', // (optional) 15 | secret: false, // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-line-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnLine result = await tablesDB.createLineColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | xrequired: false, 15 | xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-row.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | Row result = await tablesDB.getRow( 11 | databaseId: '', 12 | tableId: '', 13 | rowId: '', 14 | queries: [], // (optional) 15 | transactionId: '', // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-rows.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | RowList result = await tablesDB.updateRows( 11 | databaseId: '', 12 | tableId: '', 13 | data: {}, // (optional) 14 | queries: [], // (optional) 15 | transactionId: '', // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/users/update-target.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Users users = Users(client); 9 | 10 | Target result = await users.updateTarget( 11 | userId: '', 12 | targetId: '', 13 | identifier: '', // (optional) 14 | providerId: '', // (optional) 15 | name: '', // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/create-point-attribute.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | Databases databases = Databases(client); 9 | 10 | AttributePoint result = await databases.createPointAttribute( 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | xrequired: false, 15 | xdefault: [1, 2], // (optional) 16 | ); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-ip-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnIp result = await tablesDB.createIpColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | xrequired: false, 15 | xdefault: '', // (optional) 16 | array: false, // (optional) 17 | ); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-boolean-column.md: -------------------------------------------------------------------------------- 1 | import 'package:dart_appwrite/dart_appwrite.dart'; 2 | 3 | Client client = Client() 4 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 5 | .setProject('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | TablesDB tablesDB = TablesDB(client); 9 | 10 | ColumnBoolean result = await tablesDB.updateBooleanColumn( 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | xrequired: false, 15 | xdefault: false, 16 | newKey: '', // (optional) 17 | ); 18 | --------------------------------------------------------------------------------