appwrite 26.1.0 → 28.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +42 -25
- data/lib/appwrite/enums/adapter.rb +1 -1
- data/lib/appwrite/enums/attribute_status.rb +1 -1
- data/lib/appwrite/enums/authentication_factor.rb +2 -1
- data/lib/appwrite/enums/authenticator_type.rb +1 -1
- data/lib/appwrite/enums/backup_services.rb +1 -1
- data/lib/appwrite/enums/billing_plan_group.rb +1 -1
- data/lib/appwrite/enums/browser.rb +1 -1
- data/lib/appwrite/enums/browser_permission.rb +1 -1
- data/lib/appwrite/enums/browser_theme.rb +1 -1
- data/lib/appwrite/enums/build_runtime.rb +3 -1
- data/lib/appwrite/enums/column_status.rb +1 -1
- data/lib/appwrite/enums/compression.rb +1 -1
- data/lib/appwrite/enums/credit_card.rb +1 -1
- data/lib/appwrite/enums/database_status.rb +1 -1
- data/lib/appwrite/enums/database_type.rb +1 -1
- data/lib/appwrite/enums/databases_index_type.rb +1 -1
- data/lib/appwrite/enums/deployment_download_type.rb +1 -1
- data/lib/appwrite/enums/deployment_status.rb +1 -1
- data/lib/appwrite/enums/documents_db_index_type.rb +9 -0
- data/lib/appwrite/enums/embedding_model.rb +8 -0
- data/lib/appwrite/enums/execution_method.rb +1 -1
- data/lib/appwrite/enums/execution_resource_type.rb +8 -0
- data/lib/appwrite/enums/execution_status.rb +1 -1
- data/lib/appwrite/enums/execution_trigger.rb +1 -1
- data/lib/appwrite/enums/flag.rb +1 -1
- data/lib/appwrite/enums/framework.rb +1 -1
- data/lib/appwrite/enums/image_format.rb +1 -1
- data/lib/appwrite/enums/image_gravity.rb +1 -1
- data/lib/appwrite/enums/index_status.rb +1 -1
- data/lib/appwrite/enums/invalidation_type.rb +9 -0
- data/lib/appwrite/enums/message_priority.rb +1 -1
- data/lib/appwrite/enums/message_status.rb +1 -1
- data/lib/appwrite/enums/messaging_provider_type.rb +1 -1
- data/lib/appwrite/enums/o_auth2_google_prompt.rb +1 -1
- data/lib/appwrite/enums/o_auth2_oidc_prompt.rb +1 -1
- data/lib/appwrite/enums/o_auth_provider.rb +2 -1
- data/lib/appwrite/enums/order_by.rb +1 -1
- data/lib/appwrite/enums/organization_key_scopes.rb +1 -1
- data/lib/appwrite/enums/password_hash.rb +1 -1
- data/lib/appwrite/enums/platform_type.rb +1 -1
- data/lib/appwrite/enums/project_auth_method_id.rb +1 -1
- data/lib/appwrite/enums/project_email_template_id.rb +1 -1
- data/lib/appwrite/enums/project_email_template_locale.rb +1 -1
- data/lib/appwrite/enums/project_key_scopes.rb +16 -3
- data/lib/appwrite/enums/project_o_auth2_google_prompt.rb +1 -1
- data/lib/appwrite/enums/project_o_auth2_oidc_prompt.rb +1 -1
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +2 -1
- data/lib/appwrite/enums/project_policy_id.rb +2 -1
- data/lib/appwrite/enums/project_protocol_id.rb +1 -1
- data/lib/appwrite/enums/project_service_id.rb +1 -1
- data/lib/appwrite/enums/project_smtp_secure.rb +1 -1
- data/lib/appwrite/enums/proxy_resource_type.rb +1 -1
- data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -1
- data/lib/appwrite/enums/proxy_rule_status.rb +1 -1
- data/lib/appwrite/enums/region.rb +1 -1
- data/lib/appwrite/enums/relation_mutate.rb +1 -1
- data/lib/appwrite/enums/relationship_type.rb +1 -1
- data/lib/appwrite/enums/runtime.rb +3 -1
- data/lib/appwrite/enums/smtp_encryption.rb +1 -1
- data/lib/appwrite/enums/status_code.rb +1 -1
- data/lib/appwrite/enums/tables_db_index_type.rb +1 -1
- data/lib/appwrite/enums/template_reference_type.rb +1 -1
- data/lib/appwrite/enums/timezone.rb +1 -1
- data/lib/appwrite/enums/vcs_reference_type.rb +1 -1
- data/lib/appwrite/enums/vectors_db_index_type.rb +12 -0
- data/lib/appwrite/exception.rb +1 -1
- data/lib/appwrite/id.rb +3 -3
- data/lib/appwrite/input_file.rb +1 -1
- data/lib/appwrite/models/activity_event.rb +1 -1
- data/lib/appwrite/models/activity_event_list.rb +1 -1
- data/lib/appwrite/models/additional_resource.rb +1 -1
- data/lib/appwrite/models/algo_argon2.rb +1 -1
- data/lib/appwrite/models/algo_bcrypt.rb +1 -1
- data/lib/appwrite/models/algo_md5.rb +1 -1
- data/lib/appwrite/models/algo_phpass.rb +1 -1
- data/lib/appwrite/models/algo_scrypt.rb +1 -1
- data/lib/appwrite/models/algo_scrypt_modified.rb +1 -1
- data/lib/appwrite/models/algo_sha.rb +1 -1
- data/lib/appwrite/models/app.rb +1 -1
- data/lib/appwrite/models/app_installation.rb +2 -2
- data/lib/appwrite/models/app_installation_list.rb +1 -1
- data/lib/appwrite/models/app_key.rb +2 -2
- data/lib/appwrite/models/app_key_list.rb +1 -1
- data/lib/appwrite/models/app_scope.rb +1 -1
- data/lib/appwrite/models/app_scope_list.rb +1 -1
- data/lib/appwrite/models/app_secret.rb +2 -2
- data/lib/appwrite/models/app_secret_list.rb +1 -1
- data/lib/appwrite/models/app_secret_plaintext.rb +2 -2
- data/lib/appwrite/models/apps_list.rb +1 -1
- data/lib/appwrite/models/attribute_bigint.rb +5 -6
- data/lib/appwrite/models/attribute_boolean.rb +3 -4
- data/lib/appwrite/models/attribute_datetime.rb +3 -4
- data/lib/appwrite/models/attribute_email.rb +3 -4
- data/lib/appwrite/models/attribute_enum.rb +3 -4
- data/lib/appwrite/models/attribute_float.rb +5 -6
- data/lib/appwrite/models/attribute_integer.rb +5 -6
- data/lib/appwrite/models/attribute_ip.rb +3 -4
- data/lib/appwrite/models/attribute_line.rb +3 -4
- data/lib/appwrite/models/attribute_list.rb +1 -1
- data/lib/appwrite/models/attribute_longtext.rb +4 -5
- data/lib/appwrite/models/attribute_mediumtext.rb +4 -5
- data/lib/appwrite/models/attribute_object.rb +80 -0
- data/lib/appwrite/models/attribute_point.rb +3 -4
- data/lib/appwrite/models/attribute_polygon.rb +3 -4
- data/lib/appwrite/models/attribute_relationship.rb +2 -3
- data/lib/appwrite/models/attribute_string.rb +4 -5
- data/lib/appwrite/models/attribute_text.rb +4 -5
- data/lib/appwrite/models/attribute_url.rb +3 -4
- data/lib/appwrite/models/attribute_varchar.rb +4 -5
- data/lib/appwrite/models/attribute_vector.rb +85 -0
- data/lib/appwrite/models/backup_archive.rb +3 -3
- data/lib/appwrite/models/backup_archive_list.rb +1 -1
- data/lib/appwrite/models/backup_policy.rb +3 -3
- data/lib/appwrite/models/backup_policy_list.rb +1 -1
- data/lib/appwrite/models/backup_restoration.rb +1 -1
- data/lib/appwrite/models/backup_restoration_list.rb +1 -1
- data/lib/appwrite/models/billing_limits.rb +9 -9
- data/lib/appwrite/models/billing_plan.rb +15 -6
- data/lib/appwrite/models/billing_plan_addon.rb +5 -5
- data/lib/appwrite/models/billing_plan_addon_details.rb +1 -1
- data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +20 -20
- data/lib/appwrite/models/billing_plan_limits.rb +3 -3
- data/lib/appwrite/models/billing_plan_supported_addons.rb +1 -1
- data/lib/appwrite/models/block.rb +3 -3
- data/lib/appwrite/models/bucket.rb +1 -1
- data/lib/appwrite/models/bucket_list.rb +1 -1
- data/lib/appwrite/models/collection.rb +1 -1
- data/lib/appwrite/models/collection_list.rb +1 -1
- data/lib/appwrite/models/column_bigint.rb +5 -6
- data/lib/appwrite/models/column_boolean.rb +3 -4
- data/lib/appwrite/models/column_datetime.rb +3 -4
- data/lib/appwrite/models/column_email.rb +3 -4
- data/lib/appwrite/models/column_enum.rb +3 -4
- data/lib/appwrite/models/column_float.rb +5 -6
- data/lib/appwrite/models/column_index.rb +2 -2
- data/lib/appwrite/models/column_index_list.rb +1 -1
- data/lib/appwrite/models/column_integer.rb +5 -6
- data/lib/appwrite/models/column_ip.rb +3 -4
- data/lib/appwrite/models/column_line.rb +3 -4
- data/lib/appwrite/models/column_list.rb +1 -1
- data/lib/appwrite/models/column_longtext.rb +4 -5
- data/lib/appwrite/models/column_mediumtext.rb +4 -5
- data/lib/appwrite/models/column_point.rb +3 -4
- data/lib/appwrite/models/column_polygon.rb +3 -4
- data/lib/appwrite/models/column_relationship.rb +2 -3
- data/lib/appwrite/models/column_string.rb +4 -5
- data/lib/appwrite/models/column_text.rb +4 -5
- data/lib/appwrite/models/column_url.rb +3 -4
- data/lib/appwrite/models/column_varchar.rb +4 -5
- data/lib/appwrite/models/continent.rb +1 -1
- data/lib/appwrite/models/continent_list.rb +1 -1
- data/lib/appwrite/models/country.rb +1 -1
- data/lib/appwrite/models/country_list.rb +1 -1
- data/lib/appwrite/models/currency.rb +1 -1
- data/lib/appwrite/models/currency_list.rb +1 -1
- data/lib/appwrite/models/database.rb +22 -8
- data/lib/appwrite/models/database_list.rb +1 -1
- data/lib/appwrite/models/database_migration.rb +107 -0
- data/lib/appwrite/models/database_migration_list.rb +32 -0
- data/lib/appwrite/models/database_status.rb +31 -1
- data/lib/appwrite/models/database_status_connections.rb +1 -1
- data/lib/appwrite/models/database_status_replica.rb +7 -2
- data/lib/appwrite/models/database_status_volume.rb +1 -1
- data/lib/appwrite/models/dedicated_database.rb +3 -8
- data/lib/appwrite/models/dedicated_database_backup.rb +107 -0
- data/lib/appwrite/models/dedicated_database_backup_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_backup_storage.rb +47 -0
- data/lib/appwrite/models/dedicated_database_branch.rb +82 -0
- data/lib/appwrite/models/dedicated_database_branch_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_execution.rb +52 -0
- data/lib/appwrite/models/dedicated_database_execution_column.rb +32 -0
- data/lib/appwrite/models/dedicated_database_extensions.rb +37 -0
- data/lib/appwrite/models/dedicated_database_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_member.rb +6 -1
- data/lib/appwrite/models/dedicated_database_operation.rb +77 -0
- data/lib/appwrite/models/dedicated_database_operation_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_pitr_windows.rb +32 -0
- data/lib/appwrite/models/dedicated_database_pooler.rb +72 -0
- data/lib/appwrite/models/dedicated_database_replicas.rb +26 -1
- data/lib/appwrite/models/dedicated_database_restoration.rb +82 -0
- data/lib/appwrite/models/dedicated_database_restoration_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_specification.rb +1 -1
- data/lib/appwrite/models/dedicated_database_specification_list.rb +1 -1
- data/lib/appwrite/models/dedicated_database_specification_pricing.rb +1 -6
- data/lib/appwrite/models/deployment.rb +1 -2
- data/lib/appwrite/models/deployment_list.rb +1 -1
- data/lib/appwrite/models/dev_key.rb +1 -1
- data/lib/appwrite/models/document.rb +1 -1
- data/lib/appwrite/models/document_list.rb +1 -1
- data/lib/appwrite/models/email_template.rb +1 -1
- data/lib/appwrite/models/email_template_list.rb +1 -1
- data/lib/appwrite/models/embedding.rb +42 -0
- data/lib/appwrite/models/embedding_list.rb +32 -0
- data/lib/appwrite/models/ephemeral_key.rb +1 -1
- data/lib/appwrite/models/execution.rb +25 -8
- data/lib/appwrite/models/execution_list.rb +1 -1
- data/lib/appwrite/models/file.rb +11 -1
- data/lib/appwrite/models/file_list.rb +1 -1
- data/lib/appwrite/models/framework.rb +1 -1
- data/lib/appwrite/models/framework_adapter.rb +1 -1
- data/lib/appwrite/models/framework_list.rb +1 -1
- data/lib/appwrite/models/function.rb +1 -1
- data/lib/appwrite/models/function_list.rb +1 -1
- data/lib/appwrite/models/headers.rb +1 -1
- data/lib/appwrite/models/identity.rb +1 -1
- data/lib/appwrite/models/identity_list.rb +1 -1
- data/lib/appwrite/models/index.rb +2 -3
- data/lib/appwrite/models/index_list.rb +1 -1
- data/lib/appwrite/models/insight.rb +4 -4
- data/lib/appwrite/models/insight_cta.rb +1 -1
- data/lib/appwrite/models/insight_list.rb +1 -1
- data/lib/appwrite/models/jwt.rb +1 -1
- data/lib/appwrite/models/key.rb +1 -1
- data/lib/appwrite/models/key_list.rb +1 -1
- data/lib/appwrite/models/language.rb +1 -1
- data/lib/appwrite/models/language_list.rb +1 -1
- data/lib/appwrite/models/locale.rb +12 -12
- data/lib/appwrite/models/locale_code.rb +1 -1
- data/lib/appwrite/models/locale_code_list.rb +1 -1
- data/lib/appwrite/models/log.rb +1 -1
- data/lib/appwrite/models/log_list.rb +1 -1
- data/lib/appwrite/models/membership.rb +1 -1
- data/lib/appwrite/models/membership_list.rb +1 -1
- data/lib/appwrite/models/message.rb +4 -5
- data/lib/appwrite/models/message_list.rb +1 -1
- data/lib/appwrite/models/mfa_challenge.rb +1 -1
- data/lib/appwrite/models/mfa_challenge_secret.rb +47 -0
- data/lib/appwrite/models/mfa_factors.rb +9 -4
- data/lib/appwrite/models/mfa_recovery_codes.rb +1 -1
- data/lib/appwrite/models/mfa_type.rb +1 -1
- data/lib/appwrite/models/mock_number.rb +1 -1
- data/lib/appwrite/models/mock_number_list.rb +1 -1
- data/lib/appwrite/models/o_auth2_amazon.rb +1 -1
- data/lib/appwrite/models/o_auth2_apple.rb +1 -1
- data/lib/appwrite/models/o_auth2_appwrite.rb +1 -1
- data/lib/appwrite/models/o_auth2_auth0.rb +1 -1
- data/lib/appwrite/models/o_auth2_authentik.rb +1 -1
- data/lib/appwrite/models/o_auth2_autodesk.rb +1 -1
- data/lib/appwrite/models/o_auth2_bitbucket.rb +1 -1
- data/lib/appwrite/models/o_auth2_bitly.rb +1 -1
- data/lib/appwrite/models/o_auth2_box.rb +1 -1
- data/lib/appwrite/models/o_auth2_dailymotion.rb +1 -1
- data/lib/appwrite/models/o_auth2_discord.rb +1 -1
- data/lib/appwrite/models/o_auth2_disqus.rb +1 -1
- data/lib/appwrite/models/o_auth2_dropbox.rb +1 -1
- data/lib/appwrite/models/o_auth2_etsy.rb +1 -1
- data/lib/appwrite/models/o_auth2_facebook.rb +1 -1
- data/lib/appwrite/models/o_auth2_figma.rb +1 -1
- data/lib/appwrite/models/o_auth2_fusion_auth.rb +1 -1
- data/lib/appwrite/models/o_auth2_github.rb +1 -1
- data/lib/appwrite/models/o_auth2_gitlab.rb +1 -1
- data/lib/appwrite/models/o_auth2_google.rb +18 -2
- data/lib/appwrite/models/o_auth2_hugging_face.rb +42 -0
- data/lib/appwrite/models/o_auth2_keycloak.rb +1 -1
- data/lib/appwrite/models/o_auth2_kick.rb +1 -1
- data/lib/appwrite/models/o_auth2_linkedin.rb +1 -1
- data/lib/appwrite/models/o_auth2_microsoft.rb +1 -1
- data/lib/appwrite/models/o_auth2_notion.rb +1 -1
- data/lib/appwrite/models/o_auth2_oidc.rb +20 -3
- data/lib/appwrite/models/o_auth2_okta.rb +1 -1
- data/lib/appwrite/models/o_auth2_paypal.rb +1 -1
- data/lib/appwrite/models/o_auth2_podio.rb +1 -1
- data/lib/appwrite/models/o_auth2_provider_list.rb +1 -1
- data/lib/appwrite/models/o_auth2_salesforce.rb +1 -1
- data/lib/appwrite/models/o_auth2_slack.rb +1 -1
- data/lib/appwrite/models/o_auth2_spotify.rb +1 -1
- data/lib/appwrite/models/o_auth2_stripe.rb +1 -1
- data/lib/appwrite/models/o_auth2_tradeshift.rb +1 -1
- data/lib/appwrite/models/o_auth2_twitch.rb +1 -1
- data/lib/appwrite/models/o_auth2_word_press.rb +1 -1
- data/lib/appwrite/models/o_auth2_x.rb +1 -1
- data/lib/appwrite/models/o_auth2_yahoo.rb +1 -1
- data/lib/appwrite/models/o_auth2_yandex.rb +1 -1
- data/lib/appwrite/models/o_auth2_zoho.rb +1 -1
- data/lib/appwrite/models/o_auth2_zoom.rb +1 -1
- data/lib/appwrite/models/oauth2_approve.rb +1 -1
- data/lib/appwrite/models/oauth2_authorize.rb +1 -1
- data/lib/appwrite/models/oauth2_consent.rb +1 -1
- data/lib/appwrite/models/oauth2_consent_list.rb +1 -1
- data/lib/appwrite/models/oauth2_consent_token.rb +1 -1
- data/lib/appwrite/models/oauth2_consent_token_list.rb +1 -1
- data/lib/appwrite/models/oauth2_device_authorization.rb +1 -1
- data/lib/appwrite/models/oauth2_grant.rb +1 -1
- data/lib/appwrite/models/oauth2_organization.rb +1 -1
- data/lib/appwrite/models/oauth2_organization_list.rb +1 -1
- data/lib/appwrite/models/oauth2_par.rb +1 -1
- data/lib/appwrite/models/oauth2_project.rb +1 -1
- data/lib/appwrite/models/oauth2_project_list.rb +1 -1
- data/lib/appwrite/models/oauth2_reject.rb +1 -1
- data/lib/appwrite/models/oauth2_token.rb +3 -3
- data/lib/appwrite/models/organization.rb +2 -2
- data/lib/appwrite/models/phone.rb +1 -1
- data/lib/appwrite/models/phone_list.rb +1 -1
- data/lib/appwrite/models/platform_android.rb +1 -2
- data/lib/appwrite/models/platform_apple.rb +1 -2
- data/lib/appwrite/models/platform_linux.rb +1 -2
- data/lib/appwrite/models/platform_list.rb +1 -1
- data/lib/appwrite/models/platform_web.rb +1 -2
- data/lib/appwrite/models/platform_windows.rb +1 -2
- data/lib/appwrite/models/policy_deny_aliased_email.rb +1 -1
- data/lib/appwrite/models/policy_deny_corporate_email.rb +1 -1
- data/lib/appwrite/models/policy_deny_disposable_email.rb +1 -1
- data/lib/appwrite/models/policy_deny_free_email.rb +1 -1
- data/lib/appwrite/models/policy_list.rb +1 -1
- data/lib/appwrite/models/policy_membership_privacy.rb +1 -1
- data/lib/appwrite/models/policy_mfa_factors.rb +47 -0
- data/lib/appwrite/models/policy_password_dictionary.rb +1 -1
- data/lib/appwrite/models/policy_password_history.rb +1 -1
- data/lib/appwrite/models/policy_password_personal_data.rb +1 -1
- data/lib/appwrite/models/policy_password_strength.rb +1 -1
- data/lib/appwrite/models/policy_session_alert.rb +1 -1
- data/lib/appwrite/models/policy_session_duration.rb +1 -1
- data/lib/appwrite/models/policy_session_invalidation.rb +1 -1
- data/lib/appwrite/models/policy_session_limit.rb +1 -1
- data/lib/appwrite/models/policy_user_limit.rb +1 -1
- data/lib/appwrite/models/postgres_extension.rb +42 -0
- data/lib/appwrite/models/preferences.rb +1 -1
- data/lib/appwrite/models/presence.rb +4 -4
- data/lib/appwrite/models/presence_list.rb +1 -1
- data/lib/appwrite/models/program.rb +1 -1
- data/lib/appwrite/models/project.rb +23 -18
- data/lib/appwrite/models/project_auth_method.rb +1 -2
- data/lib/appwrite/models/project_list.rb +1 -1
- data/lib/appwrite/models/project_protocol.rb +1 -2
- data/lib/appwrite/models/project_service.rb +1 -2
- data/lib/appwrite/models/provider.rb +2 -2
- data/lib/appwrite/models/provider_list.rb +1 -1
- data/lib/appwrite/models/proxy_invalidation.rb +42 -0
- data/lib/appwrite/models/proxy_rule.rb +2 -3
- data/lib/appwrite/models/proxy_rule_list.rb +1 -1
- data/lib/appwrite/models/report.rb +2 -2
- data/lib/appwrite/models/report_list.rb +1 -1
- data/lib/appwrite/models/resource_token.rb +1 -1
- data/lib/appwrite/models/resource_token_list.rb +1 -1
- data/lib/appwrite/models/row.rb +1 -1
- data/lib/appwrite/models/row_list.rb +1 -1
- data/lib/appwrite/models/runtime.rb +1 -1
- data/lib/appwrite/models/runtime_list.rb +1 -1
- data/lib/appwrite/models/session.rb +1 -1
- data/lib/appwrite/models/session_list.rb +1 -1
- data/lib/appwrite/models/site.rb +6 -1
- data/lib/appwrite/models/site_list.rb +1 -1
- data/lib/appwrite/models/specification.rb +1 -1
- data/lib/appwrite/models/specification_list.rb +1 -1
- data/lib/appwrite/models/subscriber.rb +1 -1
- data/lib/appwrite/models/subscriber_list.rb +1 -1
- data/lib/appwrite/models/table.rb +1 -1
- data/lib/appwrite/models/table_list.rb +1 -1
- data/lib/appwrite/models/target.rb +2 -2
- data/lib/appwrite/models/target_list.rb +1 -1
- data/lib/appwrite/models/team.rb +1 -1
- data/lib/appwrite/models/team_list.rb +1 -1
- data/lib/appwrite/models/token.rb +1 -1
- data/lib/appwrite/models/topic.rb +1 -1
- data/lib/appwrite/models/topic_list.rb +1 -1
- data/lib/appwrite/models/transaction.rb +1 -1
- data/lib/appwrite/models/transaction_list.rb +1 -1
- data/lib/appwrite/models/usage_billing_plan.rb +7 -7
- data/lib/appwrite/models/user.rb +11 -11
- data/lib/appwrite/models/user_list.rb +1 -1
- data/lib/appwrite/models/variable.rb +1 -1
- data/lib/appwrite/models/variable_list.rb +1 -1
- data/lib/appwrite/models/vectorsdb_collection.rb +87 -0
- data/lib/appwrite/models/vectorsdb_collection_list.rb +32 -0
- data/lib/appwrite/models/webhook.rb +1 -1
- data/lib/appwrite/models/webhook_list.rb +1 -1
- data/lib/appwrite/operator.rb +6 -0
- data/lib/appwrite/permission.rb +4 -0
- data/lib/appwrite/query.rb +4 -4
- data/lib/appwrite/role.rb +12 -14
- data/lib/appwrite/service.rb +1 -1
- data/lib/appwrite/services/account.rb +329 -322
- data/lib/appwrite/services/activities.rb +14 -15
- data/lib/appwrite/services/advisor.rb +41 -37
- data/lib/appwrite/services/apps.rb +228 -131
- data/lib/appwrite/services/avatars.rb +156 -55
- data/lib/appwrite/services/backups.rb +113 -88
- data/lib/appwrite/services/databases.rb +875 -516
- data/lib/appwrite/services/documents_db.rb +1683 -0
- data/lib/appwrite/services/embeddings.rb +48 -0
- data/lib/appwrite/services/functions.rb +277 -173
- data/lib/appwrite/services/graphql.rb +12 -12
- data/lib/appwrite/services/locale.rb +19 -37
- data/lib/appwrite/services/messaging.rb +544 -259
- data/lib/appwrite/services/mongo.rb +1359 -0
- data/lib/appwrite/services/mysql.rb +1503 -0
- data/lib/appwrite/services/oauth2.rb +122 -53
- data/lib/appwrite/services/organization.rb +153 -123
- data/lib/appwrite/services/postgresql.rb +1615 -0
- data/lib/appwrite/services/presences.rb +49 -35
- data/lib/appwrite/services/project.rb +889 -580
- data/lib/appwrite/services/proxy.rb +111 -52
- data/lib/appwrite/services/sites.rb +270 -165
- data/lib/appwrite/services/storage.rb +153 -92
- data/lib/appwrite/services/tables_db.rb +1153 -534
- data/lib/appwrite/services/teams.rb +161 -122
- data/lib/appwrite/services/tokens.rb +38 -31
- data/lib/appwrite/services/users.rb +406 -266
- data/lib/appwrite/services/vectors_db.rb +1614 -0
- data/lib/appwrite/services/webhooks.rb +59 -40
- data/lib/appwrite.rb +39 -0
- metadata +43 -4
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#frozen_string_literal: true
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Appwrite
|
|
4
4
|
class Account < Service
|
|
5
|
-
|
|
6
5
|
def initialize(client)
|
|
7
6
|
@client = client
|
|
8
7
|
end
|
|
@@ -14,9 +13,8 @@ module Appwrite
|
|
|
14
13
|
def get()
|
|
15
14
|
api_path = '/account'
|
|
16
15
|
|
|
17
|
-
api_params = {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
api_params = {}
|
|
17
|
+
|
|
20
18
|
api_headers = {
|
|
21
19
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
22
20
|
"accept": 'application/json',
|
|
@@ -29,7 +27,6 @@ module Appwrite
|
|
|
29
27
|
params: api_params,
|
|
30
28
|
response_type: Models::User
|
|
31
29
|
)
|
|
32
|
-
|
|
33
30
|
end
|
|
34
31
|
|
|
35
32
|
# Use this endpoint to allow a new user to register a new account in your
|
|
@@ -40,25 +37,30 @@ module Appwrite
|
|
|
40
37
|
# login to their new account, you need to create a new [account
|
|
41
38
|
# session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
|
|
42
39
|
#
|
|
43
|
-
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can
|
|
40
|
+
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
44
41
|
# @param [String] email User email.
|
|
45
42
|
# @param [String] password New user password. Must be between 8 and 256 chars.
|
|
46
43
|
# @param [String] name User name. Max length: 128 chars.
|
|
47
44
|
#
|
|
48
45
|
# @return [User]
|
|
49
|
-
def create(
|
|
46
|
+
def create(
|
|
47
|
+
user_id:,
|
|
48
|
+
email:,
|
|
49
|
+
password:,
|
|
50
|
+
name: nil
|
|
51
|
+
)
|
|
50
52
|
api_path = '/account'
|
|
51
53
|
|
|
52
54
|
if user_id.nil?
|
|
53
|
-
|
|
55
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
54
56
|
end
|
|
55
57
|
|
|
56
58
|
if email.nil?
|
|
57
|
-
|
|
59
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
58
60
|
end
|
|
59
61
|
|
|
60
62
|
if password.nil?
|
|
61
|
-
|
|
63
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
api_params = {
|
|
@@ -67,7 +69,7 @@ module Appwrite
|
|
|
67
69
|
password: password,
|
|
68
70
|
name: name,
|
|
69
71
|
}
|
|
70
|
-
|
|
72
|
+
|
|
71
73
|
api_headers = {
|
|
72
74
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
73
75
|
"content-type": 'application/json',
|
|
@@ -81,7 +83,6 @@ module Appwrite
|
|
|
81
83
|
params: api_params,
|
|
82
84
|
response_type: Models::User
|
|
83
85
|
)
|
|
84
|
-
|
|
85
86
|
end
|
|
86
87
|
|
|
87
88
|
# Get a list of the OAuth2 consents the current user has given to third-party
|
|
@@ -91,14 +92,17 @@ module Appwrite
|
|
|
91
92
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
92
93
|
#
|
|
93
94
|
# @return [Oauth2ConsentList]
|
|
94
|
-
def list_consents(
|
|
95
|
+
def list_consents(
|
|
96
|
+
queries: nil,
|
|
97
|
+
total: nil
|
|
98
|
+
)
|
|
95
99
|
api_path = '/account/consents'
|
|
96
100
|
|
|
97
101
|
api_params = {
|
|
98
102
|
queries: queries,
|
|
99
103
|
total: total,
|
|
100
104
|
}
|
|
101
|
-
|
|
105
|
+
|
|
102
106
|
api_headers = {
|
|
103
107
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
104
108
|
"accept": 'application/json',
|
|
@@ -111,7 +115,6 @@ module Appwrite
|
|
|
111
115
|
params: api_params,
|
|
112
116
|
response_type: Models::Oauth2ConsentList
|
|
113
117
|
)
|
|
114
|
-
|
|
115
118
|
end
|
|
116
119
|
|
|
117
120
|
# Get an OAuth2 consent the current user has given to a third-party app by
|
|
@@ -120,17 +123,18 @@ module Appwrite
|
|
|
120
123
|
# @param [String] consent_id Consent unique ID.
|
|
121
124
|
#
|
|
122
125
|
# @return [Oauth2Consent]
|
|
123
|
-
def get_consent(
|
|
126
|
+
def get_consent(
|
|
127
|
+
consent_id:
|
|
128
|
+
)
|
|
124
129
|
api_path = '/account/consents/{consentId}'
|
|
125
130
|
.gsub('{consentId}', consent_id)
|
|
126
131
|
|
|
127
132
|
if consent_id.nil?
|
|
128
|
-
|
|
133
|
+
raise Appwrite::Exception.new('Missing required parameter: "consentId"')
|
|
129
134
|
end
|
|
130
135
|
|
|
131
|
-
api_params = {
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
api_params = {}
|
|
137
|
+
|
|
134
138
|
api_headers = {
|
|
135
139
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
136
140
|
"accept": 'application/json',
|
|
@@ -143,7 +147,6 @@ module Appwrite
|
|
|
143
147
|
params: api_params,
|
|
144
148
|
response_type: Models::Oauth2Consent
|
|
145
149
|
)
|
|
146
|
-
|
|
147
150
|
end
|
|
148
151
|
|
|
149
152
|
# Delete an OAuth2 consent by its unique ID. All token families issued under
|
|
@@ -153,17 +156,18 @@ module Appwrite
|
|
|
153
156
|
# @param [String] consent_id Consent unique ID.
|
|
154
157
|
#
|
|
155
158
|
# @return []
|
|
156
|
-
def delete_consent(
|
|
159
|
+
def delete_consent(
|
|
160
|
+
consent_id:
|
|
161
|
+
)
|
|
157
162
|
api_path = '/account/consents/{consentId}'
|
|
158
163
|
.gsub('{consentId}', consent_id)
|
|
159
164
|
|
|
160
165
|
if consent_id.nil?
|
|
161
|
-
|
|
166
|
+
raise Appwrite::Exception.new('Missing required parameter: "consentId"')
|
|
162
167
|
end
|
|
163
168
|
|
|
164
|
-
api_params = {
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
api_params = {}
|
|
170
|
+
|
|
167
171
|
api_headers = {
|
|
168
172
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
169
173
|
"content-type": 'application/json',
|
|
@@ -176,7 +180,6 @@ module Appwrite
|
|
|
176
180
|
headers: api_headers,
|
|
177
181
|
params: api_params,
|
|
178
182
|
)
|
|
179
|
-
|
|
180
183
|
end
|
|
181
184
|
|
|
182
185
|
# Get a list of the token families issued under an OAuth2 consent. Each entry
|
|
@@ -188,19 +191,23 @@ module Appwrite
|
|
|
188
191
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
189
192
|
#
|
|
190
193
|
# @return [Oauth2ConsentTokenList]
|
|
191
|
-
def list_consent_tokens(
|
|
194
|
+
def list_consent_tokens(
|
|
195
|
+
consent_id:,
|
|
196
|
+
queries: nil,
|
|
197
|
+
total: nil
|
|
198
|
+
)
|
|
192
199
|
api_path = '/account/consents/{consentId}/tokens'
|
|
193
200
|
.gsub('{consentId}', consent_id)
|
|
194
201
|
|
|
195
202
|
if consent_id.nil?
|
|
196
|
-
|
|
203
|
+
raise Appwrite::Exception.new('Missing required parameter: "consentId"')
|
|
197
204
|
end
|
|
198
205
|
|
|
199
206
|
api_params = {
|
|
200
207
|
queries: queries,
|
|
201
208
|
total: total,
|
|
202
209
|
}
|
|
203
|
-
|
|
210
|
+
|
|
204
211
|
api_headers = {
|
|
205
212
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
206
213
|
"accept": 'application/json',
|
|
@@ -213,7 +220,6 @@ module Appwrite
|
|
|
213
220
|
params: api_params,
|
|
214
221
|
response_type: Models::Oauth2ConsentTokenList
|
|
215
222
|
)
|
|
216
|
-
|
|
217
223
|
end
|
|
218
224
|
|
|
219
225
|
# Get a token family issued under an OAuth2 consent by its unique ID. The
|
|
@@ -223,22 +229,24 @@ module Appwrite
|
|
|
223
229
|
# @param [String] token_id Token unique ID.
|
|
224
230
|
#
|
|
225
231
|
# @return [Oauth2ConsentToken]
|
|
226
|
-
def get_consent_token(
|
|
232
|
+
def get_consent_token(
|
|
233
|
+
consent_id:,
|
|
234
|
+
token_id:
|
|
235
|
+
)
|
|
227
236
|
api_path = '/account/consents/{consentId}/tokens/{tokenId}'
|
|
228
237
|
.gsub('{consentId}', consent_id)
|
|
229
238
|
.gsub('{tokenId}', token_id)
|
|
230
239
|
|
|
231
240
|
if consent_id.nil?
|
|
232
|
-
|
|
241
|
+
raise Appwrite::Exception.new('Missing required parameter: "consentId"')
|
|
233
242
|
end
|
|
234
243
|
|
|
235
244
|
if token_id.nil?
|
|
236
|
-
|
|
245
|
+
raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
|
|
237
246
|
end
|
|
238
247
|
|
|
239
|
-
api_params = {
|
|
240
|
-
|
|
241
|
-
|
|
248
|
+
api_params = {}
|
|
249
|
+
|
|
242
250
|
api_headers = {
|
|
243
251
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
244
252
|
"accept": 'application/json',
|
|
@@ -251,7 +259,6 @@ module Appwrite
|
|
|
251
259
|
params: api_params,
|
|
252
260
|
response_type: Models::Oauth2ConsentToken
|
|
253
261
|
)
|
|
254
|
-
|
|
255
262
|
end
|
|
256
263
|
|
|
257
264
|
# Delete a token family issued under an OAuth2 consent by its unique ID. The
|
|
@@ -262,22 +269,24 @@ module Appwrite
|
|
|
262
269
|
# @param [String] token_id Token unique ID.
|
|
263
270
|
#
|
|
264
271
|
# @return []
|
|
265
|
-
def delete_consent_token(
|
|
272
|
+
def delete_consent_token(
|
|
273
|
+
consent_id:,
|
|
274
|
+
token_id:
|
|
275
|
+
)
|
|
266
276
|
api_path = '/account/consents/{consentId}/tokens/{tokenId}'
|
|
267
277
|
.gsub('{consentId}', consent_id)
|
|
268
278
|
.gsub('{tokenId}', token_id)
|
|
269
279
|
|
|
270
280
|
if consent_id.nil?
|
|
271
|
-
|
|
281
|
+
raise Appwrite::Exception.new('Missing required parameter: "consentId"')
|
|
272
282
|
end
|
|
273
283
|
|
|
274
284
|
if token_id.nil?
|
|
275
|
-
|
|
285
|
+
raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
|
|
276
286
|
end
|
|
277
287
|
|
|
278
|
-
api_params = {
|
|
279
|
-
|
|
280
|
-
|
|
288
|
+
api_params = {}
|
|
289
|
+
|
|
281
290
|
api_headers = {
|
|
282
291
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
283
292
|
"content-type": 'application/json',
|
|
@@ -290,7 +299,6 @@ module Appwrite
|
|
|
290
299
|
headers: api_headers,
|
|
291
300
|
params: api_params,
|
|
292
301
|
)
|
|
293
|
-
|
|
294
302
|
end
|
|
295
303
|
|
|
296
304
|
# Update currently logged in user account email address. After changing user
|
|
@@ -300,28 +308,31 @@ module Appwrite
|
|
|
300
308
|
# user password is required to complete this request.
|
|
301
309
|
# This endpoint can also be used to convert an anonymous account to a normal
|
|
302
310
|
# one, by passing an email address and a new password.
|
|
303
|
-
#
|
|
311
|
+
#
|
|
304
312
|
#
|
|
305
313
|
# @param [String] email User email.
|
|
306
314
|
# @param [String] password User password. Must be at least 8 chars.
|
|
307
315
|
#
|
|
308
316
|
# @return [User]
|
|
309
|
-
def update_email(
|
|
317
|
+
def update_email(
|
|
318
|
+
email:,
|
|
319
|
+
password:
|
|
320
|
+
)
|
|
310
321
|
api_path = '/account/email'
|
|
311
322
|
|
|
312
323
|
if email.nil?
|
|
313
|
-
|
|
324
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
314
325
|
end
|
|
315
326
|
|
|
316
327
|
if password.nil?
|
|
317
|
-
|
|
328
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
318
329
|
end
|
|
319
330
|
|
|
320
331
|
api_params = {
|
|
321
332
|
email: email,
|
|
322
333
|
password: password,
|
|
323
334
|
}
|
|
324
|
-
|
|
335
|
+
|
|
325
336
|
api_headers = {
|
|
326
337
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
327
338
|
"content-type": 'application/json',
|
|
@@ -335,7 +346,6 @@ module Appwrite
|
|
|
335
346
|
params: api_params,
|
|
336
347
|
response_type: Models::User
|
|
337
348
|
)
|
|
338
|
-
|
|
339
349
|
end
|
|
340
350
|
|
|
341
351
|
# Get the list of identities for the currently logged in user.
|
|
@@ -344,14 +354,17 @@ module Appwrite
|
|
|
344
354
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
345
355
|
#
|
|
346
356
|
# @return [IdentityList]
|
|
347
|
-
def list_identities(
|
|
357
|
+
def list_identities(
|
|
358
|
+
queries: nil,
|
|
359
|
+
total: nil
|
|
360
|
+
)
|
|
348
361
|
api_path = '/account/identities'
|
|
349
362
|
|
|
350
363
|
api_params = {
|
|
351
364
|
queries: queries,
|
|
352
365
|
total: total,
|
|
353
366
|
}
|
|
354
|
-
|
|
367
|
+
|
|
355
368
|
api_headers = {
|
|
356
369
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
357
370
|
"accept": 'application/json',
|
|
@@ -364,7 +377,6 @@ module Appwrite
|
|
|
364
377
|
params: api_params,
|
|
365
378
|
response_type: Models::IdentityList
|
|
366
379
|
)
|
|
367
|
-
|
|
368
380
|
end
|
|
369
381
|
|
|
370
382
|
# Delete an identity by its unique ID.
|
|
@@ -372,61 +384,29 @@ module Appwrite
|
|
|
372
384
|
# @param [String] identity_id Identity ID.
|
|
373
385
|
#
|
|
374
386
|
# @return []
|
|
375
|
-
def delete_identity(
|
|
387
|
+
def delete_identity(
|
|
388
|
+
identity_id:
|
|
389
|
+
)
|
|
376
390
|
api_path = '/account/identities/{identityId}'
|
|
377
391
|
.gsub('{identityId}', identity_id)
|
|
378
392
|
|
|
379
393
|
if identity_id.nil?
|
|
380
|
-
|
|
394
|
+
raise Appwrite::Exception.new('Missing required parameter: "identityId"')
|
|
381
395
|
end
|
|
382
396
|
|
|
383
|
-
api_params = {
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
api_headers = {
|
|
387
|
-
"X-Appwrite-Project": @client.get_config('project'),
|
|
388
|
-
"content-type": 'application/json',
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
@client.call(
|
|
392
|
-
method: 'DELETE',
|
|
393
|
-
path: api_path,
|
|
394
|
-
headers: api_headers,
|
|
395
|
-
params: api_params,
|
|
396
|
-
)
|
|
397
|
+
api_params = {}
|
|
397
398
|
|
|
398
|
-
end
|
|
399
|
-
|
|
400
|
-
# Use this endpoint to create a JSON Web Token. You can use the resulting JWT
|
|
401
|
-
# to authenticate on behalf of the current user when working with the
|
|
402
|
-
# Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
|
|
403
|
-
# from its creation and will be invalid if the user will logout in that time
|
|
404
|
-
# frame.
|
|
405
|
-
#
|
|
406
|
-
# @param [Integer] duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
407
|
-
#
|
|
408
|
-
# @return [Jwt]
|
|
409
|
-
def create_jwt(duration: nil)
|
|
410
|
-
api_path = '/account/jwts'
|
|
411
|
-
|
|
412
|
-
api_params = {
|
|
413
|
-
duration: duration,
|
|
414
|
-
}
|
|
415
|
-
|
|
416
399
|
api_headers = {
|
|
417
400
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
418
401
|
"content-type": 'application/json',
|
|
419
|
-
"accept": 'application/json',
|
|
420
402
|
}
|
|
421
403
|
|
|
422
404
|
@client.call(
|
|
423
|
-
method: '
|
|
405
|
+
method: 'DELETE',
|
|
424
406
|
path: api_path,
|
|
425
407
|
headers: api_headers,
|
|
426
408
|
params: api_params,
|
|
427
|
-
response_type: Models::Jwt
|
|
428
409
|
)
|
|
429
|
-
|
|
430
410
|
end
|
|
431
411
|
|
|
432
412
|
# Get the list of latest security activity logs for the currently logged in
|
|
@@ -436,14 +416,17 @@ module Appwrite
|
|
|
436
416
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
437
417
|
#
|
|
438
418
|
# @return [LogList]
|
|
439
|
-
def list_logs(
|
|
419
|
+
def list_logs(
|
|
420
|
+
queries: nil,
|
|
421
|
+
total: nil
|
|
422
|
+
)
|
|
440
423
|
api_path = '/account/logs'
|
|
441
424
|
|
|
442
425
|
api_params = {
|
|
443
426
|
queries: queries,
|
|
444
427
|
total: total,
|
|
445
428
|
}
|
|
446
|
-
|
|
429
|
+
|
|
447
430
|
api_headers = {
|
|
448
431
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
449
432
|
"accept": 'application/json',
|
|
@@ -456,7 +439,6 @@ module Appwrite
|
|
|
456
439
|
params: api_params,
|
|
457
440
|
response_type: Models::LogList
|
|
458
441
|
)
|
|
459
|
-
|
|
460
442
|
end
|
|
461
443
|
|
|
462
444
|
# Enable or disable MFA on an account.
|
|
@@ -464,17 +446,19 @@ module Appwrite
|
|
|
464
446
|
# @param [] mfa Enable or disable MFA.
|
|
465
447
|
#
|
|
466
448
|
# @return [User]
|
|
467
|
-
def update_mfa(
|
|
449
|
+
def update_mfa(
|
|
450
|
+
mfa:
|
|
451
|
+
)
|
|
468
452
|
api_path = '/account/mfa'
|
|
469
453
|
|
|
470
454
|
if mfa.nil?
|
|
471
|
-
|
|
455
|
+
raise Appwrite::Exception.new('Missing required parameter: "mfa"')
|
|
472
456
|
end
|
|
473
457
|
|
|
474
458
|
api_params = {
|
|
475
459
|
mfa: mfa,
|
|
476
460
|
}
|
|
477
|
-
|
|
461
|
+
|
|
478
462
|
api_headers = {
|
|
479
463
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
480
464
|
"content-type": 'application/json',
|
|
@@ -488,7 +472,6 @@ module Appwrite
|
|
|
488
472
|
params: api_params,
|
|
489
473
|
response_type: Models::User
|
|
490
474
|
)
|
|
491
|
-
|
|
492
475
|
end
|
|
493
476
|
|
|
494
477
|
# Add an authenticator app to be used as an MFA factor. Verify the
|
|
@@ -499,17 +482,18 @@ module Appwrite
|
|
|
499
482
|
# @param [AuthenticatorType] type Type of authenticator. Must be `totp`
|
|
500
483
|
#
|
|
501
484
|
# @return [MfaType]
|
|
502
|
-
def create_mfa_authenticator(
|
|
485
|
+
def create_mfa_authenticator(
|
|
486
|
+
type:
|
|
487
|
+
)
|
|
503
488
|
api_path = '/account/mfa/authenticators/{type}'
|
|
504
489
|
.gsub('{type}', type)
|
|
505
490
|
|
|
506
491
|
if type.nil?
|
|
507
|
-
|
|
492
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
508
493
|
end
|
|
509
494
|
|
|
510
|
-
api_params = {
|
|
511
|
-
|
|
512
|
-
|
|
495
|
+
api_params = {}
|
|
496
|
+
|
|
513
497
|
api_headers = {
|
|
514
498
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
515
499
|
"content-type": 'application/json',
|
|
@@ -523,7 +507,6 @@ module Appwrite
|
|
|
523
507
|
params: api_params,
|
|
524
508
|
response_type: Models::MfaType
|
|
525
509
|
)
|
|
526
|
-
|
|
527
510
|
end
|
|
528
511
|
|
|
529
512
|
# Verify an authenticator app after adding it using the [add
|
|
@@ -534,22 +517,25 @@ module Appwrite
|
|
|
534
517
|
# @param [String] otp Valid verification token.
|
|
535
518
|
#
|
|
536
519
|
# @return [User]
|
|
537
|
-
def update_mfa_authenticator(
|
|
520
|
+
def update_mfa_authenticator(
|
|
521
|
+
type:,
|
|
522
|
+
otp:
|
|
523
|
+
)
|
|
538
524
|
api_path = '/account/mfa/authenticators/{type}'
|
|
539
525
|
.gsub('{type}', type)
|
|
540
526
|
|
|
541
527
|
if type.nil?
|
|
542
|
-
|
|
528
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
543
529
|
end
|
|
544
530
|
|
|
545
531
|
if otp.nil?
|
|
546
|
-
|
|
532
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
|
547
533
|
end
|
|
548
534
|
|
|
549
535
|
api_params = {
|
|
550
536
|
otp: otp,
|
|
551
537
|
}
|
|
552
|
-
|
|
538
|
+
|
|
553
539
|
api_headers = {
|
|
554
540
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
555
541
|
"content-type": 'application/json',
|
|
@@ -563,7 +549,6 @@ module Appwrite
|
|
|
563
549
|
params: api_params,
|
|
564
550
|
response_type: Models::User
|
|
565
551
|
)
|
|
566
|
-
|
|
567
552
|
end
|
|
568
553
|
|
|
569
554
|
# Delete an authenticator for a user by ID.
|
|
@@ -571,17 +556,18 @@ module Appwrite
|
|
|
571
556
|
# @param [AuthenticatorType] type Type of authenticator.
|
|
572
557
|
#
|
|
573
558
|
# @return []
|
|
574
|
-
def delete_mfa_authenticator(
|
|
559
|
+
def delete_mfa_authenticator(
|
|
560
|
+
type:
|
|
561
|
+
)
|
|
575
562
|
api_path = '/account/mfa/authenticators/{type}'
|
|
576
563
|
.gsub('{type}', type)
|
|
577
564
|
|
|
578
565
|
if type.nil?
|
|
579
|
-
|
|
566
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
580
567
|
end
|
|
581
568
|
|
|
582
|
-
api_params = {
|
|
583
|
-
|
|
584
|
-
|
|
569
|
+
api_params = {}
|
|
570
|
+
|
|
585
571
|
api_headers = {
|
|
586
572
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
587
573
|
"content-type": 'application/json',
|
|
@@ -593,27 +579,28 @@ module Appwrite
|
|
|
593
579
|
headers: api_headers,
|
|
594
580
|
params: api_params,
|
|
595
581
|
)
|
|
596
|
-
|
|
597
582
|
end
|
|
598
583
|
|
|
599
584
|
# Begin the process of MFA verification after sign-in. Finish the flow with
|
|
600
585
|
# [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
601
586
|
# method.
|
|
602
587
|
#
|
|
603
|
-
# @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
|
|
588
|
+
# @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
|
|
604
589
|
#
|
|
605
590
|
# @return [MfaChallenge]
|
|
606
|
-
def create_mfa_challenge(
|
|
591
|
+
def create_mfa_challenge(
|
|
592
|
+
factor:
|
|
593
|
+
)
|
|
607
594
|
api_path = '/account/mfa/challenges'
|
|
608
595
|
|
|
609
596
|
if factor.nil?
|
|
610
|
-
|
|
597
|
+
raise Appwrite::Exception.new('Missing required parameter: "factor"')
|
|
611
598
|
end
|
|
612
599
|
|
|
613
600
|
api_params = {
|
|
614
601
|
factor: factor,
|
|
615
602
|
}
|
|
616
|
-
|
|
603
|
+
|
|
617
604
|
api_headers = {
|
|
618
605
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
619
606
|
"content-type": 'application/json',
|
|
@@ -627,7 +614,6 @@ module Appwrite
|
|
|
627
614
|
params: api_params,
|
|
628
615
|
response_type: Models::MfaChallenge
|
|
629
616
|
)
|
|
630
|
-
|
|
631
617
|
end
|
|
632
618
|
|
|
633
619
|
# Complete the MFA challenge by providing the one-time password. Finish the
|
|
@@ -640,22 +626,25 @@ module Appwrite
|
|
|
640
626
|
# @param [String] otp Valid verification token.
|
|
641
627
|
#
|
|
642
628
|
# @return [Session]
|
|
643
|
-
def update_mfa_challenge(
|
|
629
|
+
def update_mfa_challenge(
|
|
630
|
+
challenge_id:,
|
|
631
|
+
otp:
|
|
632
|
+
)
|
|
644
633
|
api_path = '/account/mfa/challenges'
|
|
645
634
|
|
|
646
635
|
if challenge_id.nil?
|
|
647
|
-
|
|
636
|
+
raise Appwrite::Exception.new('Missing required parameter: "challengeId"')
|
|
648
637
|
end
|
|
649
638
|
|
|
650
639
|
if otp.nil?
|
|
651
|
-
|
|
640
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
|
652
641
|
end
|
|
653
642
|
|
|
654
643
|
api_params = {
|
|
655
644
|
challengeId: challenge_id,
|
|
656
645
|
otp: otp,
|
|
657
646
|
}
|
|
658
|
-
|
|
647
|
+
|
|
659
648
|
api_headers = {
|
|
660
649
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
661
650
|
"content-type": 'application/json',
|
|
@@ -669,7 +658,6 @@ module Appwrite
|
|
|
669
658
|
params: api_params,
|
|
670
659
|
response_type: Models::Session
|
|
671
660
|
)
|
|
672
|
-
|
|
673
661
|
end
|
|
674
662
|
|
|
675
663
|
# List the factors available on the account to be used as a MFA challange.
|
|
@@ -679,9 +667,8 @@ module Appwrite
|
|
|
679
667
|
def list_mfa_factors()
|
|
680
668
|
api_path = '/account/mfa/factors'
|
|
681
669
|
|
|
682
|
-
api_params = {
|
|
683
|
-
|
|
684
|
-
|
|
670
|
+
api_params = {}
|
|
671
|
+
|
|
685
672
|
api_headers = {
|
|
686
673
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
687
674
|
"accept": 'application/json',
|
|
@@ -694,7 +681,6 @@ module Appwrite
|
|
|
694
681
|
params: api_params,
|
|
695
682
|
response_type: Models::MfaFactors
|
|
696
683
|
)
|
|
697
|
-
|
|
698
684
|
end
|
|
699
685
|
|
|
700
686
|
# Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
@@ -707,9 +693,8 @@ module Appwrite
|
|
|
707
693
|
def get_mfa_recovery_codes()
|
|
708
694
|
api_path = '/account/mfa/recovery-codes'
|
|
709
695
|
|
|
710
|
-
api_params = {
|
|
711
|
-
|
|
712
|
-
|
|
696
|
+
api_params = {}
|
|
697
|
+
|
|
713
698
|
api_headers = {
|
|
714
699
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
715
700
|
"accept": 'application/json',
|
|
@@ -722,10 +707,9 @@ module Appwrite
|
|
|
722
707
|
params: api_params,
|
|
723
708
|
response_type: Models::MfaRecoveryCodes
|
|
724
709
|
)
|
|
725
|
-
|
|
726
710
|
end
|
|
727
711
|
|
|
728
|
-
# Generate recovery codes as backup for MFA flow. It
|
|
712
|
+
# Generate recovery codes as backup for MFA flow. It's recommended to
|
|
729
713
|
# generate and show then immediately after user successfully adds their
|
|
730
714
|
# authehticator. Recovery codes can be used as a MFA verification type in
|
|
731
715
|
# [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
@@ -736,9 +720,8 @@ module Appwrite
|
|
|
736
720
|
def create_mfa_recovery_codes()
|
|
737
721
|
api_path = '/account/mfa/recovery-codes'
|
|
738
722
|
|
|
739
|
-
api_params = {
|
|
740
|
-
|
|
741
|
-
|
|
723
|
+
api_params = {}
|
|
724
|
+
|
|
742
725
|
api_headers = {
|
|
743
726
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
744
727
|
"content-type": 'application/json',
|
|
@@ -752,7 +735,6 @@ module Appwrite
|
|
|
752
735
|
params: api_params,
|
|
753
736
|
response_type: Models::MfaRecoveryCodes
|
|
754
737
|
)
|
|
755
|
-
|
|
756
738
|
end
|
|
757
739
|
|
|
758
740
|
# Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
@@ -765,9 +747,8 @@ module Appwrite
|
|
|
765
747
|
def update_mfa_recovery_codes()
|
|
766
748
|
api_path = '/account/mfa/recovery-codes'
|
|
767
749
|
|
|
768
|
-
api_params = {
|
|
769
|
-
|
|
770
|
-
|
|
750
|
+
api_params = {}
|
|
751
|
+
|
|
771
752
|
api_headers = {
|
|
772
753
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
773
754
|
"content-type": 'application/json',
|
|
@@ -781,7 +762,6 @@ module Appwrite
|
|
|
781
762
|
params: api_params,
|
|
782
763
|
response_type: Models::MfaRecoveryCodes
|
|
783
764
|
)
|
|
784
|
-
|
|
785
765
|
end
|
|
786
766
|
|
|
787
767
|
# Update currently logged in user account name.
|
|
@@ -789,17 +769,19 @@ module Appwrite
|
|
|
789
769
|
# @param [String] name User name. Max length: 128 chars.
|
|
790
770
|
#
|
|
791
771
|
# @return [User]
|
|
792
|
-
def update_name(
|
|
772
|
+
def update_name(
|
|
773
|
+
name:
|
|
774
|
+
)
|
|
793
775
|
api_path = '/account/name'
|
|
794
776
|
|
|
795
777
|
if name.nil?
|
|
796
|
-
|
|
778
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
797
779
|
end
|
|
798
780
|
|
|
799
781
|
api_params = {
|
|
800
782
|
name: name,
|
|
801
783
|
}
|
|
802
|
-
|
|
784
|
+
|
|
803
785
|
api_headers = {
|
|
804
786
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
805
787
|
"content-type": 'application/json',
|
|
@@ -813,7 +795,6 @@ module Appwrite
|
|
|
813
795
|
params: api_params,
|
|
814
796
|
response_type: Models::User
|
|
815
797
|
)
|
|
816
|
-
|
|
817
798
|
end
|
|
818
799
|
|
|
819
800
|
# Update currently logged in user password. For validation, user is required
|
|
@@ -824,18 +805,21 @@ module Appwrite
|
|
|
824
805
|
# @param [String] old_password Current user password. Max length: 256 chars.
|
|
825
806
|
#
|
|
826
807
|
# @return [User]
|
|
827
|
-
def update_password(
|
|
808
|
+
def update_password(
|
|
809
|
+
password:,
|
|
810
|
+
old_password: nil
|
|
811
|
+
)
|
|
828
812
|
api_path = '/account/password'
|
|
829
813
|
|
|
830
814
|
if password.nil?
|
|
831
|
-
|
|
815
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
832
816
|
end
|
|
833
817
|
|
|
834
818
|
api_params = {
|
|
835
819
|
password: password,
|
|
836
820
|
oldPassword: old_password,
|
|
837
821
|
}
|
|
838
|
-
|
|
822
|
+
|
|
839
823
|
api_headers = {
|
|
840
824
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
841
825
|
"content-type": 'application/json',
|
|
@@ -849,35 +833,37 @@ module Appwrite
|
|
|
849
833
|
params: api_params,
|
|
850
834
|
response_type: Models::User
|
|
851
835
|
)
|
|
852
|
-
|
|
853
836
|
end
|
|
854
837
|
|
|
855
|
-
# Update the currently logged in user
|
|
838
|
+
# Update the currently logged in user's phone number. After updating the
|
|
856
839
|
# phone number, the phone verification status will be reset. A confirmation
|
|
857
840
|
# SMS is not sent automatically, however you can use the [POST
|
|
858
841
|
# /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification)
|
|
859
842
|
# endpoint to send a confirmation SMS.
|
|
860
843
|
#
|
|
861
|
-
# @param [String] phone Phone number. Format this number with a leading
|
|
844
|
+
# @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
862
845
|
# @param [String] password User password. Must be at least 8 chars.
|
|
863
846
|
#
|
|
864
847
|
# @return [User]
|
|
865
|
-
def update_phone(
|
|
848
|
+
def update_phone(
|
|
849
|
+
phone:,
|
|
850
|
+
password:
|
|
851
|
+
)
|
|
866
852
|
api_path = '/account/phone'
|
|
867
853
|
|
|
868
854
|
if phone.nil?
|
|
869
|
-
|
|
855
|
+
raise Appwrite::Exception.new('Missing required parameter: "phone"')
|
|
870
856
|
end
|
|
871
857
|
|
|
872
858
|
if password.nil?
|
|
873
|
-
|
|
859
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
874
860
|
end
|
|
875
861
|
|
|
876
862
|
api_params = {
|
|
877
863
|
phone: phone,
|
|
878
864
|
password: password,
|
|
879
865
|
}
|
|
880
|
-
|
|
866
|
+
|
|
881
867
|
api_headers = {
|
|
882
868
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
883
869
|
"content-type": 'application/json',
|
|
@@ -891,7 +877,6 @@ module Appwrite
|
|
|
891
877
|
params: api_params,
|
|
892
878
|
response_type: Models::User
|
|
893
879
|
)
|
|
894
|
-
|
|
895
880
|
end
|
|
896
881
|
|
|
897
882
|
# Get the preferences as a key-value object for the currently logged in user.
|
|
@@ -901,9 +886,8 @@ module Appwrite
|
|
|
901
886
|
def get_prefs()
|
|
902
887
|
api_path = '/account/prefs'
|
|
903
888
|
|
|
904
|
-
api_params = {
|
|
905
|
-
|
|
906
|
-
|
|
889
|
+
api_params = {}
|
|
890
|
+
|
|
907
891
|
api_headers = {
|
|
908
892
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
909
893
|
"accept": 'application/json',
|
|
@@ -916,7 +900,6 @@ module Appwrite
|
|
|
916
900
|
params: api_params,
|
|
917
901
|
response_type: Models::Preferences
|
|
918
902
|
)
|
|
919
|
-
|
|
920
903
|
end
|
|
921
904
|
|
|
922
905
|
# Update currently logged in user account preferences. The object you pass is
|
|
@@ -926,17 +909,19 @@ module Appwrite
|
|
|
926
909
|
# @param [Hash] prefs Prefs key-value JSON object.
|
|
927
910
|
#
|
|
928
911
|
# @return [User]
|
|
929
|
-
def update_prefs(
|
|
912
|
+
def update_prefs(
|
|
913
|
+
prefs:
|
|
914
|
+
)
|
|
930
915
|
api_path = '/account/prefs'
|
|
931
916
|
|
|
932
917
|
if prefs.nil?
|
|
933
|
-
|
|
918
|
+
raise Appwrite::Exception.new('Missing required parameter: "prefs"')
|
|
934
919
|
end
|
|
935
920
|
|
|
936
921
|
api_params = {
|
|
937
922
|
prefs: prefs,
|
|
938
923
|
}
|
|
939
|
-
|
|
924
|
+
|
|
940
925
|
api_headers = {
|
|
941
926
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
942
927
|
"content-type": 'application/json',
|
|
@@ -950,7 +935,6 @@ module Appwrite
|
|
|
950
935
|
params: api_params,
|
|
951
936
|
response_type: Models::User
|
|
952
937
|
)
|
|
953
|
-
|
|
954
938
|
end
|
|
955
939
|
|
|
956
940
|
# Sends the user an email with a temporary secret key for password reset.
|
|
@@ -959,29 +943,32 @@ module Appwrite
|
|
|
959
943
|
# attached to the URL query string. Use the query string params to submit a
|
|
960
944
|
# request to the [PUT
|
|
961
945
|
# /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery)
|
|
962
|
-
# endpoint to complete the process. The verification link sent to the user
|
|
946
|
+
# endpoint to complete the process. The verification link sent to the user's
|
|
963
947
|
# email address is valid for 1 hour.
|
|
964
948
|
#
|
|
965
949
|
# @param [String] email User email.
|
|
966
950
|
# @param [String] url URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
967
951
|
#
|
|
968
952
|
# @return [Token]
|
|
969
|
-
def create_recovery(
|
|
953
|
+
def create_recovery(
|
|
954
|
+
email:,
|
|
955
|
+
url:
|
|
956
|
+
)
|
|
970
957
|
api_path = '/account/recovery'
|
|
971
958
|
|
|
972
959
|
if email.nil?
|
|
973
|
-
|
|
960
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
974
961
|
end
|
|
975
962
|
|
|
976
963
|
if url.nil?
|
|
977
|
-
|
|
964
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
978
965
|
end
|
|
979
966
|
|
|
980
967
|
api_params = {
|
|
981
968
|
email: email,
|
|
982
969
|
url: url,
|
|
983
970
|
}
|
|
984
|
-
|
|
971
|
+
|
|
985
972
|
api_headers = {
|
|
986
973
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
987
974
|
"content-type": 'application/json',
|
|
@@ -995,7 +982,6 @@ module Appwrite
|
|
|
995
982
|
params: api_params,
|
|
996
983
|
response_type: Models::Token
|
|
997
984
|
)
|
|
998
|
-
|
|
999
985
|
end
|
|
1000
986
|
|
|
1001
987
|
# Use this endpoint to complete the user account password reset. Both the
|
|
@@ -1003,7 +989,7 @@ module Appwrite
|
|
|
1003
989
|
# the redirect URL you have provided when sending your request to the [POST
|
|
1004
990
|
# /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery)
|
|
1005
991
|
# endpoint.
|
|
1006
|
-
#
|
|
992
|
+
#
|
|
1007
993
|
# Please note that in order to avoid a [Redirect
|
|
1008
994
|
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
1009
995
|
# the only valid redirect URLs are the ones from domains you have set when
|
|
@@ -1014,19 +1000,23 @@ module Appwrite
|
|
|
1014
1000
|
# @param [String] password New user password. Must be between 8 and 256 chars.
|
|
1015
1001
|
#
|
|
1016
1002
|
# @return [Token]
|
|
1017
|
-
def update_recovery(
|
|
1003
|
+
def update_recovery(
|
|
1004
|
+
user_id:,
|
|
1005
|
+
secret:,
|
|
1006
|
+
password:
|
|
1007
|
+
)
|
|
1018
1008
|
api_path = '/account/recovery'
|
|
1019
1009
|
|
|
1020
1010
|
if user_id.nil?
|
|
1021
|
-
|
|
1011
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1022
1012
|
end
|
|
1023
1013
|
|
|
1024
1014
|
if secret.nil?
|
|
1025
|
-
|
|
1015
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1026
1016
|
end
|
|
1027
1017
|
|
|
1028
1018
|
if password.nil?
|
|
1029
|
-
|
|
1019
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
1030
1020
|
end
|
|
1031
1021
|
|
|
1032
1022
|
api_params = {
|
|
@@ -1034,7 +1024,7 @@ module Appwrite
|
|
|
1034
1024
|
secret: secret,
|
|
1035
1025
|
password: password,
|
|
1036
1026
|
}
|
|
1037
|
-
|
|
1027
|
+
|
|
1038
1028
|
api_headers = {
|
|
1039
1029
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1040
1030
|
"content-type": 'application/json',
|
|
@@ -1048,7 +1038,6 @@ module Appwrite
|
|
|
1048
1038
|
params: api_params,
|
|
1049
1039
|
response_type: Models::Token
|
|
1050
1040
|
)
|
|
1051
|
-
|
|
1052
1041
|
end
|
|
1053
1042
|
|
|
1054
1043
|
# Get the list of active sessions across different devices for the currently
|
|
@@ -1059,9 +1048,8 @@ module Appwrite
|
|
|
1059
1048
|
def list_sessions()
|
|
1060
1049
|
api_path = '/account/sessions'
|
|
1061
1050
|
|
|
1062
|
-
api_params = {
|
|
1063
|
-
|
|
1064
|
-
|
|
1051
|
+
api_params = {}
|
|
1052
|
+
|
|
1065
1053
|
api_headers = {
|
|
1066
1054
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1067
1055
|
"accept": 'application/json',
|
|
@@ -1074,7 +1062,6 @@ module Appwrite
|
|
|
1074
1062
|
params: api_params,
|
|
1075
1063
|
response_type: Models::SessionList
|
|
1076
1064
|
)
|
|
1077
|
-
|
|
1078
1065
|
end
|
|
1079
1066
|
|
|
1080
1067
|
# Delete all sessions from the user account and remove any sessions cookies
|
|
@@ -1085,9 +1072,8 @@ module Appwrite
|
|
|
1085
1072
|
def delete_sessions()
|
|
1086
1073
|
api_path = '/account/sessions'
|
|
1087
1074
|
|
|
1088
|
-
api_params = {
|
|
1089
|
-
|
|
1090
|
-
|
|
1075
|
+
api_params = {}
|
|
1076
|
+
|
|
1091
1077
|
api_headers = {
|
|
1092
1078
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1093
1079
|
"content-type": 'application/json',
|
|
@@ -1099,7 +1085,6 @@ module Appwrite
|
|
|
1099
1085
|
headers: api_headers,
|
|
1100
1086
|
params: api_params,
|
|
1101
1087
|
)
|
|
1102
|
-
|
|
1103
1088
|
end
|
|
1104
1089
|
|
|
1105
1090
|
# Use this endpoint to allow a new user to register an anonymous account in
|
|
@@ -1115,9 +1100,8 @@ module Appwrite
|
|
|
1115
1100
|
def create_anonymous_session()
|
|
1116
1101
|
api_path = '/account/sessions/anonymous'
|
|
1117
1102
|
|
|
1118
|
-
api_params = {
|
|
1119
|
-
|
|
1120
|
-
|
|
1103
|
+
api_params = {}
|
|
1104
|
+
|
|
1121
1105
|
api_headers = {
|
|
1122
1106
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1123
1107
|
"content-type": 'application/json',
|
|
@@ -1131,12 +1115,11 @@ module Appwrite
|
|
|
1131
1115
|
params: api_params,
|
|
1132
1116
|
response_type: Models::Session
|
|
1133
1117
|
)
|
|
1134
|
-
|
|
1135
1118
|
end
|
|
1136
1119
|
|
|
1137
1120
|
# Allow the user to login into their account by providing a valid email and
|
|
1138
1121
|
# password combination. This route will create a new session for the user.
|
|
1139
|
-
#
|
|
1122
|
+
#
|
|
1140
1123
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1141
1124
|
# about session
|
|
1142
1125
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1145,22 +1128,25 @@ module Appwrite
|
|
|
1145
1128
|
# @param [String] password User password. Must be at least 8 chars.
|
|
1146
1129
|
#
|
|
1147
1130
|
# @return [Session]
|
|
1148
|
-
def create_email_password_session(
|
|
1131
|
+
def create_email_password_session(
|
|
1132
|
+
email:,
|
|
1133
|
+
password:
|
|
1134
|
+
)
|
|
1149
1135
|
api_path = '/account/sessions/email'
|
|
1150
1136
|
|
|
1151
1137
|
if email.nil?
|
|
1152
|
-
|
|
1138
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1153
1139
|
end
|
|
1154
1140
|
|
|
1155
1141
|
if password.nil?
|
|
1156
|
-
|
|
1142
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
1157
1143
|
end
|
|
1158
1144
|
|
|
1159
1145
|
api_params = {
|
|
1160
1146
|
email: email,
|
|
1161
1147
|
password: password,
|
|
1162
1148
|
}
|
|
1163
|
-
|
|
1149
|
+
|
|
1164
1150
|
api_headers = {
|
|
1165
1151
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1166
1152
|
"content-type": 'application/json',
|
|
@@ -1174,7 +1160,6 @@ module Appwrite
|
|
|
1174
1160
|
params: api_params,
|
|
1175
1161
|
response_type: Models::Session
|
|
1176
1162
|
)
|
|
1177
|
-
|
|
1178
1163
|
end
|
|
1179
1164
|
|
|
1180
1165
|
#
|
|
@@ -1184,26 +1169,29 @@ module Appwrite
|
|
|
1184
1169
|
# and **secret** parameters from the successful response of authentication
|
|
1185
1170
|
# flows initiated by token creation. For example, magic URL and phone login.
|
|
1186
1171
|
#
|
|
1187
|
-
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can
|
|
1172
|
+
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1188
1173
|
# @param [String] secret Valid verification token.
|
|
1189
1174
|
#
|
|
1190
1175
|
# @return [Session]
|
|
1191
|
-
def update_magic_url_session(
|
|
1176
|
+
def update_magic_url_session(
|
|
1177
|
+
user_id:,
|
|
1178
|
+
secret:
|
|
1179
|
+
)
|
|
1192
1180
|
api_path = '/account/sessions/magic-url'
|
|
1193
1181
|
|
|
1194
1182
|
if user_id.nil?
|
|
1195
|
-
|
|
1183
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1196
1184
|
end
|
|
1197
1185
|
|
|
1198
1186
|
if secret.nil?
|
|
1199
|
-
|
|
1187
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1200
1188
|
end
|
|
1201
1189
|
|
|
1202
1190
|
api_params = {
|
|
1203
1191
|
userId: user_id,
|
|
1204
1192
|
secret: secret,
|
|
1205
1193
|
}
|
|
1206
|
-
|
|
1194
|
+
|
|
1207
1195
|
api_headers = {
|
|
1208
1196
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1209
1197
|
"content-type": 'application/json',
|
|
@@ -1217,7 +1205,6 @@ module Appwrite
|
|
|
1217
1205
|
params: api_params,
|
|
1218
1206
|
response_type: Models::Session
|
|
1219
1207
|
)
|
|
1220
|
-
|
|
1221
1208
|
end
|
|
1222
1209
|
|
|
1223
1210
|
#
|
|
@@ -1227,26 +1214,29 @@ module Appwrite
|
|
|
1227
1214
|
# and **secret** parameters from the successful response of authentication
|
|
1228
1215
|
# flows initiated by token creation. For example, magic URL and phone login.
|
|
1229
1216
|
#
|
|
1230
|
-
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can
|
|
1217
|
+
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1231
1218
|
# @param [String] secret Valid verification token.
|
|
1232
1219
|
#
|
|
1233
1220
|
# @return [Session]
|
|
1234
|
-
def update_phone_session(
|
|
1221
|
+
def update_phone_session(
|
|
1222
|
+
user_id:,
|
|
1223
|
+
secret:
|
|
1224
|
+
)
|
|
1235
1225
|
api_path = '/account/sessions/phone'
|
|
1236
1226
|
|
|
1237
1227
|
if user_id.nil?
|
|
1238
|
-
|
|
1228
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1239
1229
|
end
|
|
1240
1230
|
|
|
1241
1231
|
if secret.nil?
|
|
1242
|
-
|
|
1232
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1243
1233
|
end
|
|
1244
1234
|
|
|
1245
1235
|
api_params = {
|
|
1246
1236
|
userId: user_id,
|
|
1247
1237
|
secret: secret,
|
|
1248
1238
|
}
|
|
1249
|
-
|
|
1239
|
+
|
|
1250
1240
|
api_headers = {
|
|
1251
1241
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1252
1242
|
"content-type": 'application/json',
|
|
@@ -1260,33 +1250,35 @@ module Appwrite
|
|
|
1260
1250
|
params: api_params,
|
|
1261
1251
|
response_type: Models::Session
|
|
1262
1252
|
)
|
|
1263
|
-
|
|
1264
1253
|
end
|
|
1265
1254
|
|
|
1266
1255
|
# Use this endpoint to create a session from token. Provide the **userId**
|
|
1267
1256
|
# and **secret** parameters from the successful response of authentication
|
|
1268
1257
|
# flows initiated by token creation. For example, magic URL and phone login.
|
|
1269
1258
|
#
|
|
1270
|
-
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can
|
|
1259
|
+
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1271
1260
|
# @param [String] secret Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.
|
|
1272
1261
|
#
|
|
1273
1262
|
# @return [Session]
|
|
1274
|
-
def create_session(
|
|
1263
|
+
def create_session(
|
|
1264
|
+
user_id:,
|
|
1265
|
+
secret:
|
|
1266
|
+
)
|
|
1275
1267
|
api_path = '/account/sessions/token'
|
|
1276
1268
|
|
|
1277
1269
|
if user_id.nil?
|
|
1278
|
-
|
|
1270
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1279
1271
|
end
|
|
1280
1272
|
|
|
1281
1273
|
if secret.nil?
|
|
1282
|
-
|
|
1274
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1283
1275
|
end
|
|
1284
1276
|
|
|
1285
1277
|
api_params = {
|
|
1286
1278
|
userId: user_id,
|
|
1287
1279
|
secret: secret,
|
|
1288
1280
|
}
|
|
1289
|
-
|
|
1281
|
+
|
|
1290
1282
|
api_headers = {
|
|
1291
1283
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1292
1284
|
"content-type": 'application/json',
|
|
@@ -1300,26 +1292,26 @@ module Appwrite
|
|
|
1300
1292
|
params: api_params,
|
|
1301
1293
|
response_type: Models::Session
|
|
1302
1294
|
)
|
|
1303
|
-
|
|
1304
1295
|
end
|
|
1305
1296
|
|
|
1306
|
-
# Use this endpoint to get a logged in user
|
|
1307
|
-
# Inputting
|
|
1297
|
+
# Use this endpoint to get a logged in user's session using a Session ID.
|
|
1298
|
+
# Inputting 'current' will return the current session being used.
|
|
1308
1299
|
#
|
|
1309
|
-
# @param [String] session_id Session ID. Use the string
|
|
1300
|
+
# @param [String] session_id Session ID. Use the string 'current' to get the current device session.
|
|
1310
1301
|
#
|
|
1311
1302
|
# @return [Session]
|
|
1312
|
-
def get_session(
|
|
1303
|
+
def get_session(
|
|
1304
|
+
session_id:
|
|
1305
|
+
)
|
|
1313
1306
|
api_path = '/account/sessions/{sessionId}'
|
|
1314
1307
|
.gsub('{sessionId}', session_id)
|
|
1315
1308
|
|
|
1316
1309
|
if session_id.nil?
|
|
1317
|
-
|
|
1310
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
|
1318
1311
|
end
|
|
1319
1312
|
|
|
1320
|
-
api_params = {
|
|
1321
|
-
|
|
1322
|
-
|
|
1313
|
+
api_params = {}
|
|
1314
|
+
|
|
1323
1315
|
api_headers = {
|
|
1324
1316
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1325
1317
|
"accept": 'application/json',
|
|
@@ -1332,27 +1324,27 @@ module Appwrite
|
|
|
1332
1324
|
params: api_params,
|
|
1333
1325
|
response_type: Models::Session
|
|
1334
1326
|
)
|
|
1335
|
-
|
|
1336
1327
|
end
|
|
1337
1328
|
|
|
1338
|
-
# Use this endpoint to extend a session
|
|
1329
|
+
# Use this endpoint to extend a session's length. Extending a session is
|
|
1339
1330
|
# useful when session expiry is short. If the session was created using an
|
|
1340
1331
|
# OAuth provider, this endpoint refreshes the access token from the provider.
|
|
1341
1332
|
#
|
|
1342
|
-
# @param [String] session_id Session ID. Use the string
|
|
1333
|
+
# @param [String] session_id Session ID. Use the string 'current' to update the current device session.
|
|
1343
1334
|
#
|
|
1344
1335
|
# @return [Session]
|
|
1345
|
-
def update_session(
|
|
1336
|
+
def update_session(
|
|
1337
|
+
session_id:
|
|
1338
|
+
)
|
|
1346
1339
|
api_path = '/account/sessions/{sessionId}'
|
|
1347
1340
|
.gsub('{sessionId}', session_id)
|
|
1348
1341
|
|
|
1349
1342
|
if session_id.nil?
|
|
1350
|
-
|
|
1343
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
|
1351
1344
|
end
|
|
1352
1345
|
|
|
1353
|
-
api_params = {
|
|
1354
|
-
|
|
1355
|
-
|
|
1346
|
+
api_params = {}
|
|
1347
|
+
|
|
1356
1348
|
api_headers = {
|
|
1357
1349
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1358
1350
|
"content-type": 'application/json',
|
|
@@ -1366,29 +1358,29 @@ module Appwrite
|
|
|
1366
1358
|
params: api_params,
|
|
1367
1359
|
response_type: Models::Session
|
|
1368
1360
|
)
|
|
1369
|
-
|
|
1370
1361
|
end
|
|
1371
1362
|
|
|
1372
|
-
# Logout the user. Use
|
|
1373
|
-
# use a session ID to logout on another device. If you
|
|
1363
|
+
# Logout the user. Use 'current' as the session ID to logout on this device,
|
|
1364
|
+
# use a session ID to logout on another device. If you're looking to logout
|
|
1374
1365
|
# the user on all devices, use [Delete
|
|
1375
1366
|
# Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions)
|
|
1376
1367
|
# instead.
|
|
1377
1368
|
#
|
|
1378
|
-
# @param [String] session_id Session ID. Use the string
|
|
1369
|
+
# @param [String] session_id Session ID. Use the string 'current' to delete the current device session.
|
|
1379
1370
|
#
|
|
1380
1371
|
# @return []
|
|
1381
|
-
def delete_session(
|
|
1372
|
+
def delete_session(
|
|
1373
|
+
session_id:
|
|
1374
|
+
)
|
|
1382
1375
|
api_path = '/account/sessions/{sessionId}'
|
|
1383
1376
|
.gsub('{sessionId}', session_id)
|
|
1384
1377
|
|
|
1385
1378
|
if session_id.nil?
|
|
1386
|
-
|
|
1379
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
|
1387
1380
|
end
|
|
1388
1381
|
|
|
1389
|
-
api_params = {
|
|
1390
|
-
|
|
1391
|
-
|
|
1382
|
+
api_params = {}
|
|
1383
|
+
|
|
1392
1384
|
api_headers = {
|
|
1393
1385
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1394
1386
|
"content-type": 'application/json',
|
|
@@ -1400,7 +1392,6 @@ module Appwrite
|
|
|
1400
1392
|
headers: api_headers,
|
|
1401
1393
|
params: api_params,
|
|
1402
1394
|
)
|
|
1403
|
-
|
|
1404
1395
|
end
|
|
1405
1396
|
|
|
1406
1397
|
# Block the currently logged in user account. Behind the scene, the user
|
|
@@ -1412,9 +1403,8 @@ module Appwrite
|
|
|
1412
1403
|
def update_status()
|
|
1413
1404
|
api_path = '/account/status'
|
|
1414
1405
|
|
|
1415
|
-
api_params = {
|
|
1416
|
-
|
|
1417
|
-
|
|
1406
|
+
api_params = {}
|
|
1407
|
+
|
|
1418
1408
|
api_headers = {
|
|
1419
1409
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1420
1410
|
"content-type": 'application/json',
|
|
@@ -1428,7 +1418,6 @@ module Appwrite
|
|
|
1428
1418
|
params: api_params,
|
|
1429
1419
|
response_type: Models::User
|
|
1430
1420
|
)
|
|
1431
|
-
|
|
1432
1421
|
end
|
|
1433
1422
|
|
|
1434
1423
|
# Sends the user an email with a secret key for creating a session. If the
|
|
@@ -1438,28 +1427,32 @@ module Appwrite
|
|
|
1438
1427
|
# email with the one-time password. Use the returned user ID and secret and
|
|
1439
1428
|
# submit a request to the [POST
|
|
1440
1429
|
# /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1441
|
-
# endpoint to complete the login process. The secret sent to the user
|
|
1430
|
+
# endpoint to complete the login process. The secret sent to the user's email
|
|
1442
1431
|
# is valid for 15 minutes.
|
|
1443
|
-
#
|
|
1432
|
+
#
|
|
1444
1433
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1445
1434
|
# about session
|
|
1446
1435
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1447
|
-
#
|
|
1448
1436
|
#
|
|
1449
|
-
#
|
|
1437
|
+
#
|
|
1438
|
+
# @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
|
|
1450
1439
|
# @param [String] email User email.
|
|
1451
1440
|
# @param [] phrase Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
|
|
1452
1441
|
#
|
|
1453
1442
|
# @return [Token]
|
|
1454
|
-
def create_email_token(
|
|
1443
|
+
def create_email_token(
|
|
1444
|
+
user_id:,
|
|
1445
|
+
email:,
|
|
1446
|
+
phrase: nil
|
|
1447
|
+
)
|
|
1455
1448
|
api_path = '/account/tokens/email'
|
|
1456
1449
|
|
|
1457
1450
|
if user_id.nil?
|
|
1458
|
-
|
|
1451
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1459
1452
|
end
|
|
1460
1453
|
|
|
1461
1454
|
if email.nil?
|
|
1462
|
-
|
|
1455
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1463
1456
|
end
|
|
1464
1457
|
|
|
1465
1458
|
api_params = {
|
|
@@ -1467,7 +1460,7 @@ module Appwrite
|
|
|
1467
1460
|
email: email,
|
|
1468
1461
|
phrase: phrase,
|
|
1469
1462
|
}
|
|
1470
|
-
|
|
1463
|
+
|
|
1471
1464
|
api_headers = {
|
|
1472
1465
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1473
1466
|
"content-type": 'application/json',
|
|
@@ -1481,7 +1474,6 @@ module Appwrite
|
|
|
1481
1474
|
params: api_params,
|
|
1482
1475
|
response_type: Models::Token
|
|
1483
1476
|
)
|
|
1484
|
-
|
|
1485
1477
|
end
|
|
1486
1478
|
|
|
1487
1479
|
# Sends the user an email with a secret key for creating a session. If the
|
|
@@ -1491,29 +1483,34 @@ module Appwrite
|
|
|
1491
1483
|
# query string. Use the query string parameters to submit a request to the
|
|
1492
1484
|
# [POST
|
|
1493
1485
|
# /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1494
|
-
# endpoint to complete the login process. The link sent to the user
|
|
1486
|
+
# endpoint to complete the login process. The link sent to the user's email
|
|
1495
1487
|
# address is valid for 1 hour.
|
|
1496
|
-
#
|
|
1488
|
+
#
|
|
1497
1489
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1498
1490
|
# about session
|
|
1499
1491
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1500
|
-
#
|
|
1501
1492
|
#
|
|
1502
|
-
#
|
|
1493
|
+
#
|
|
1494
|
+
# @param [String] user_id Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
|
|
1503
1495
|
# @param [String] email User email.
|
|
1504
1496
|
# @param [String] url URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
1505
1497
|
# @param [] phrase Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
|
|
1506
1498
|
#
|
|
1507
1499
|
# @return [Token]
|
|
1508
|
-
def create_magic_url_token(
|
|
1500
|
+
def create_magic_url_token(
|
|
1501
|
+
user_id:,
|
|
1502
|
+
email:,
|
|
1503
|
+
url: nil,
|
|
1504
|
+
phrase: nil
|
|
1505
|
+
)
|
|
1509
1506
|
api_path = '/account/tokens/magic-url'
|
|
1510
1507
|
|
|
1511
1508
|
if user_id.nil?
|
|
1512
|
-
|
|
1509
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1513
1510
|
end
|
|
1514
1511
|
|
|
1515
1512
|
if email.nil?
|
|
1516
|
-
|
|
1513
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1517
1514
|
end
|
|
1518
1515
|
|
|
1519
1516
|
api_params = {
|
|
@@ -1522,7 +1519,7 @@ module Appwrite
|
|
|
1522
1519
|
url: url,
|
|
1523
1520
|
phrase: phrase,
|
|
1524
1521
|
}
|
|
1525
|
-
|
|
1522
|
+
|
|
1526
1523
|
api_headers = {
|
|
1527
1524
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1528
1525
|
"content-type": 'application/json',
|
|
@@ -1536,36 +1533,40 @@ module Appwrite
|
|
|
1536
1533
|
params: api_params,
|
|
1537
1534
|
response_type: Models::Token
|
|
1538
1535
|
)
|
|
1539
|
-
|
|
1540
1536
|
end
|
|
1541
1537
|
|
|
1542
1538
|
# Allow the user to login to their account using the OAuth2 provider of their
|
|
1543
1539
|
# choice. Each OAuth2 provider should be enabled from the Appwrite console
|
|
1544
|
-
# first. Use the success and failure arguments to provide a redirect URL
|
|
1545
|
-
# back to your app when login is completed.
|
|
1546
|
-
#
|
|
1540
|
+
# first. Use the success and failure arguments to provide a redirect URL's
|
|
1541
|
+
# back to your app when login is completed.
|
|
1542
|
+
#
|
|
1547
1543
|
# If authentication succeeds, `userId` and `secret` of a token will be
|
|
1548
1544
|
# appended to the success URL as query parameters. These can be used to
|
|
1549
1545
|
# create a new session using the [Create
|
|
1550
1546
|
# session](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1551
1547
|
# endpoint.
|
|
1552
|
-
#
|
|
1548
|
+
#
|
|
1553
1549
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1554
1550
|
# about session
|
|
1555
1551
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1556
1552
|
#
|
|
1557
|
-
# @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
|
|
1558
|
-
# @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project
|
|
1559
|
-
# @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project
|
|
1553
|
+
# @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
|
|
1554
|
+
# @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
1555
|
+
# @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
1560
1556
|
# @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
|
1561
1557
|
#
|
|
1562
1558
|
# @return []
|
|
1563
|
-
def create_o_auth2_token(
|
|
1559
|
+
def create_o_auth2_token(
|
|
1560
|
+
provider:,
|
|
1561
|
+
success: nil,
|
|
1562
|
+
failure: nil,
|
|
1563
|
+
scopes: nil
|
|
1564
|
+
)
|
|
1564
1565
|
api_path = '/account/tokens/oauth2/{provider}'
|
|
1565
1566
|
.gsub('{provider}', provider)
|
|
1566
1567
|
|
|
1567
1568
|
if provider.nil?
|
|
1568
|
-
|
|
1569
|
+
raise Appwrite::Exception.new('Missing required parameter: "provider"')
|
|
1569
1570
|
end
|
|
1570
1571
|
|
|
1571
1572
|
api_params = {
|
|
@@ -1573,7 +1574,7 @@ module Appwrite
|
|
|
1573
1574
|
failure: failure,
|
|
1574
1575
|
scopes: scopes,
|
|
1575
1576
|
}
|
|
1576
|
-
|
|
1577
|
+
|
|
1577
1578
|
api_headers = {
|
|
1578
1579
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1579
1580
|
"accept": 'text/html',
|
|
@@ -1586,40 +1587,42 @@ module Appwrite
|
|
|
1586
1587
|
params: api_params,
|
|
1587
1588
|
response_type: "location"
|
|
1588
1589
|
)
|
|
1589
|
-
|
|
1590
1590
|
end
|
|
1591
1591
|
|
|
1592
1592
|
# Sends the user an SMS with a secret key for creating a session. If the
|
|
1593
1593
|
# provided user ID has not be registered, a new user will be created. Use the
|
|
1594
1594
|
# returned user ID and secret and submit a request to the [POST
|
|
1595
1595
|
# /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1596
|
-
# endpoint to complete the login process. The secret sent to the user
|
|
1596
|
+
# endpoint to complete the login process. The secret sent to the user's phone
|
|
1597
1597
|
# is valid for 15 minutes.
|
|
1598
|
-
#
|
|
1598
|
+
#
|
|
1599
1599
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1600
1600
|
# about session
|
|
1601
1601
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1602
1602
|
#
|
|
1603
|
-
# @param [String] user_id Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can
|
|
1604
|
-
# @param [String] phone Phone number. Format this number with a leading
|
|
1603
|
+
# @param [String] user_id Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
|
|
1604
|
+
# @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
1605
1605
|
#
|
|
1606
1606
|
# @return [Token]
|
|
1607
|
-
def create_phone_token(
|
|
1607
|
+
def create_phone_token(
|
|
1608
|
+
user_id:,
|
|
1609
|
+
phone:
|
|
1610
|
+
)
|
|
1608
1611
|
api_path = '/account/tokens/phone'
|
|
1609
1612
|
|
|
1610
1613
|
if user_id.nil?
|
|
1611
|
-
|
|
1614
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1612
1615
|
end
|
|
1613
1616
|
|
|
1614
1617
|
if phone.nil?
|
|
1615
|
-
|
|
1618
|
+
raise Appwrite::Exception.new('Missing required parameter: "phone"')
|
|
1616
1619
|
end
|
|
1617
1620
|
|
|
1618
1621
|
api_params = {
|
|
1619
1622
|
userId: user_id,
|
|
1620
1623
|
phone: phone,
|
|
1621
1624
|
}
|
|
1622
|
-
|
|
1625
|
+
|
|
1623
1626
|
api_headers = {
|
|
1624
1627
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1625
1628
|
"content-type": 'application/json',
|
|
@@ -1633,7 +1636,6 @@ module Appwrite
|
|
|
1633
1636
|
params: api_params,
|
|
1634
1637
|
response_type: Models::Token
|
|
1635
1638
|
)
|
|
1636
|
-
|
|
1637
1639
|
end
|
|
1638
1640
|
|
|
1639
1641
|
# Use this endpoint to send a verification message to your user email address
|
|
@@ -1644,28 +1646,30 @@ module Appwrite
|
|
|
1644
1646
|
# verification process by verifying both the **userId** and **secret**
|
|
1645
1647
|
# parameters. Learn more about how to [complete the verification
|
|
1646
1648
|
# process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
|
|
1647
|
-
# The verification link sent to the user
|
|
1648
|
-
#
|
|
1649
|
+
# The verification link sent to the user's email address is valid for 7 days.
|
|
1650
|
+
#
|
|
1649
1651
|
# Please note that in order to avoid a [Redirect
|
|
1650
1652
|
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
1651
1653
|
# the only valid redirect URLs are the ones from domains you have set when
|
|
1652
1654
|
# adding your platforms in the console interface.
|
|
1653
|
-
#
|
|
1655
|
+
#
|
|
1654
1656
|
#
|
|
1655
1657
|
# @param [String] url URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
1656
1658
|
#
|
|
1657
1659
|
# @return [Token]
|
|
1658
|
-
def create_email_verification(
|
|
1660
|
+
def create_email_verification(
|
|
1661
|
+
url:
|
|
1662
|
+
)
|
|
1659
1663
|
api_path = '/account/verifications/email'
|
|
1660
1664
|
|
|
1661
1665
|
if url.nil?
|
|
1662
|
-
|
|
1666
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
1663
1667
|
end
|
|
1664
1668
|
|
|
1665
1669
|
api_params = {
|
|
1666
1670
|
url: url,
|
|
1667
1671
|
}
|
|
1668
|
-
|
|
1672
|
+
|
|
1669
1673
|
api_headers = {
|
|
1670
1674
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1671
1675
|
"content-type": 'application/json',
|
|
@@ -1679,7 +1683,6 @@ module Appwrite
|
|
|
1679
1683
|
params: api_params,
|
|
1680
1684
|
response_type: Models::Token
|
|
1681
1685
|
)
|
|
1682
|
-
|
|
1683
1686
|
end
|
|
1684
1687
|
|
|
1685
1688
|
#
|
|
@@ -1693,28 +1696,30 @@ module Appwrite
|
|
|
1693
1696
|
# verification process by verifying both the **userId** and **secret**
|
|
1694
1697
|
# parameters. Learn more about how to [complete the verification
|
|
1695
1698
|
# process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
|
|
1696
|
-
# The verification link sent to the user
|
|
1697
|
-
#
|
|
1699
|
+
# The verification link sent to the user's email address is valid for 7 days.
|
|
1700
|
+
#
|
|
1698
1701
|
# Please note that in order to avoid a [Redirect
|
|
1699
1702
|
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
1700
1703
|
# the only valid redirect URLs are the ones from domains you have set when
|
|
1701
1704
|
# adding your platforms in the console interface.
|
|
1702
|
-
#
|
|
1705
|
+
#
|
|
1703
1706
|
#
|
|
1704
1707
|
# @param [String] url URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
1705
1708
|
#
|
|
1706
1709
|
# @return [Token]
|
|
1707
|
-
def create_verification(
|
|
1710
|
+
def create_verification(
|
|
1711
|
+
url:
|
|
1712
|
+
)
|
|
1708
1713
|
api_path = '/account/verifications/email'
|
|
1709
1714
|
|
|
1710
1715
|
if url.nil?
|
|
1711
|
-
|
|
1716
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
1712
1717
|
end
|
|
1713
1718
|
|
|
1714
1719
|
api_params = {
|
|
1715
1720
|
url: url,
|
|
1716
1721
|
}
|
|
1717
|
-
|
|
1722
|
+
|
|
1718
1723
|
api_headers = {
|
|
1719
1724
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1720
1725
|
"content-type": 'application/json',
|
|
@@ -1728,7 +1733,6 @@ module Appwrite
|
|
|
1728
1733
|
params: api_params,
|
|
1729
1734
|
response_type: Models::Token
|
|
1730
1735
|
)
|
|
1731
|
-
|
|
1732
1736
|
end
|
|
1733
1737
|
|
|
1734
1738
|
# Use this endpoint to complete the user email verification process. Use both
|
|
@@ -1740,22 +1744,25 @@ module Appwrite
|
|
|
1740
1744
|
# @param [String] secret Valid verification token.
|
|
1741
1745
|
#
|
|
1742
1746
|
# @return [Token]
|
|
1743
|
-
def update_email_verification(
|
|
1747
|
+
def update_email_verification(
|
|
1748
|
+
user_id:,
|
|
1749
|
+
secret:
|
|
1750
|
+
)
|
|
1744
1751
|
api_path = '/account/verifications/email'
|
|
1745
1752
|
|
|
1746
1753
|
if user_id.nil?
|
|
1747
|
-
|
|
1754
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1748
1755
|
end
|
|
1749
1756
|
|
|
1750
1757
|
if secret.nil?
|
|
1751
|
-
|
|
1758
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1752
1759
|
end
|
|
1753
1760
|
|
|
1754
1761
|
api_params = {
|
|
1755
1762
|
userId: user_id,
|
|
1756
1763
|
secret: secret,
|
|
1757
1764
|
}
|
|
1758
|
-
|
|
1765
|
+
|
|
1759
1766
|
api_headers = {
|
|
1760
1767
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1761
1768
|
"content-type": 'application/json',
|
|
@@ -1769,7 +1776,6 @@ module Appwrite
|
|
|
1769
1776
|
params: api_params,
|
|
1770
1777
|
response_type: Models::Token
|
|
1771
1778
|
)
|
|
1772
|
-
|
|
1773
1779
|
end
|
|
1774
1780
|
|
|
1775
1781
|
#
|
|
@@ -1784,22 +1790,25 @@ module Appwrite
|
|
|
1784
1790
|
# @param [String] secret Valid verification token.
|
|
1785
1791
|
#
|
|
1786
1792
|
# @return [Token]
|
|
1787
|
-
def update_verification(
|
|
1793
|
+
def update_verification(
|
|
1794
|
+
user_id:,
|
|
1795
|
+
secret:
|
|
1796
|
+
)
|
|
1788
1797
|
api_path = '/account/verifications/email'
|
|
1789
1798
|
|
|
1790
1799
|
if user_id.nil?
|
|
1791
|
-
|
|
1800
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1792
1801
|
end
|
|
1793
1802
|
|
|
1794
1803
|
if secret.nil?
|
|
1795
|
-
|
|
1804
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1796
1805
|
end
|
|
1797
1806
|
|
|
1798
1807
|
api_params = {
|
|
1799
1808
|
userId: user_id,
|
|
1800
1809
|
secret: secret,
|
|
1801
1810
|
}
|
|
1802
|
-
|
|
1811
|
+
|
|
1803
1812
|
api_headers = {
|
|
1804
1813
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1805
1814
|
"content-type": 'application/json',
|
|
@@ -1813,16 +1822,15 @@ module Appwrite
|
|
|
1813
1822
|
params: api_params,
|
|
1814
1823
|
response_type: Models::Token
|
|
1815
1824
|
)
|
|
1816
|
-
|
|
1817
1825
|
end
|
|
1818
1826
|
|
|
1819
1827
|
# Use this endpoint to send a verification SMS to the currently logged in
|
|
1820
|
-
# user. This endpoint is meant for use after updating a user
|
|
1828
|
+
# user. This endpoint is meant for use after updating a user's phone number
|
|
1821
1829
|
# using the
|
|
1822
1830
|
# [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone)
|
|
1823
1831
|
# endpoint. Learn more about how to [complete the verification
|
|
1824
1832
|
# process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification).
|
|
1825
|
-
# The verification code sent to the user
|
|
1833
|
+
# The verification code sent to the user's phone number is valid for 15
|
|
1826
1834
|
# minutes.
|
|
1827
1835
|
#
|
|
1828
1836
|
#
|
|
@@ -1830,9 +1838,8 @@ module Appwrite
|
|
|
1830
1838
|
def create_phone_verification()
|
|
1831
1839
|
api_path = '/account/verifications/phone'
|
|
1832
1840
|
|
|
1833
|
-
api_params = {
|
|
1834
|
-
|
|
1835
|
-
|
|
1841
|
+
api_params = {}
|
|
1842
|
+
|
|
1836
1843
|
api_headers = {
|
|
1837
1844
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1838
1845
|
"content-type": 'application/json',
|
|
@@ -1846,11 +1853,10 @@ module Appwrite
|
|
|
1846
1853
|
params: api_params,
|
|
1847
1854
|
response_type: Models::Token
|
|
1848
1855
|
)
|
|
1849
|
-
|
|
1850
1856
|
end
|
|
1851
1857
|
|
|
1852
1858
|
# Use this endpoint to complete the user phone verification process. Use the
|
|
1853
|
-
# **userId** and **secret** that were sent to your user
|
|
1859
|
+
# **userId** and **secret** that were sent to your user's phone number to
|
|
1854
1860
|
# verify the user email ownership. If confirmed this route will return a 200
|
|
1855
1861
|
# status code.
|
|
1856
1862
|
#
|
|
@@ -1858,22 +1864,25 @@ module Appwrite
|
|
|
1858
1864
|
# @param [String] secret Valid verification token.
|
|
1859
1865
|
#
|
|
1860
1866
|
# @return [Token]
|
|
1861
|
-
def update_phone_verification(
|
|
1867
|
+
def update_phone_verification(
|
|
1868
|
+
user_id:,
|
|
1869
|
+
secret:
|
|
1870
|
+
)
|
|
1862
1871
|
api_path = '/account/verifications/phone'
|
|
1863
1872
|
|
|
1864
1873
|
if user_id.nil?
|
|
1865
|
-
|
|
1874
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1866
1875
|
end
|
|
1867
1876
|
|
|
1868
1877
|
if secret.nil?
|
|
1869
|
-
|
|
1878
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1870
1879
|
end
|
|
1871
1880
|
|
|
1872
1881
|
api_params = {
|
|
1873
1882
|
userId: user_id,
|
|
1874
1883
|
secret: secret,
|
|
1875
1884
|
}
|
|
1876
|
-
|
|
1885
|
+
|
|
1877
1886
|
api_headers = {
|
|
1878
1887
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1879
1888
|
"content-type": 'application/json',
|
|
@@ -1887,8 +1896,6 @@ module Appwrite
|
|
|
1887
1896
|
params: api_params,
|
|
1888
1897
|
response_type: Models::Token
|
|
1889
1898
|
)
|
|
1890
|
-
|
|
1891
1899
|
end
|
|
1892
|
-
|
|
1893
|
-
end
|
|
1900
|
+
end
|
|
1894
1901
|
end
|