appwrite 27.0.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 +27 -24
- data/lib/appwrite/enums/adapter.rb +1 -1
- data/lib/appwrite/enums/attribute_status.rb +1 -1
- data/lib/appwrite/enums/authentication_factor.rb +1 -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 +2 -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 +1 -3
- 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 +1 -1
- 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 +14 -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 +1 -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 +2 -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 +19 -10
- data/lib/appwrite/models/billing_plan_addon.rb +3 -3
- data/lib/appwrite/models/billing_plan_addon_details.rb +2 -2
- 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 +6 -1
- data/lib/appwrite/models/database_migration_list.rb +1 -1
- data/lib/appwrite/models/database_status.rb +3 -3
- 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 -3
- 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 +7 -2
- data/lib/appwrite/models/dedicated_database_operation.rb +4 -4
- data/lib/appwrite/models/dedicated_database_operation_list.rb +1 -1
- 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 +3 -3
- 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 -1
- 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 +1 -1
- data/lib/appwrite/models/embedding_list.rb +1 -1
- 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 +1 -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 +1 -1
- data/lib/appwrite/models/mfa_factors.rb +1 -1
- 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 +14 -14
- 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 +1 -1
- 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 +19 -19
- 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 +1 -1
- 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 +4 -4
- 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 +328 -289
- data/lib/appwrite/services/activities.rb +13 -14
- data/lib/appwrite/services/advisor.rb +41 -37
- data/lib/appwrite/services/apps.rb +185 -130
- data/lib/appwrite/services/avatars.rb +156 -55
- data/lib/appwrite/services/backups.rb +102 -83
- data/lib/appwrite/services/databases.rb +871 -512
- data/lib/appwrite/services/documents_db.rb +1683 -0
- data/lib/appwrite/services/embeddings.rb +9 -9
- data/lib/appwrite/services/functions.rb +276 -172
- 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 +842 -528
- data/lib/appwrite/services/proxy.rb +73 -58
- data/lib/appwrite/services/sites.rb +269 -164
- data/lib/appwrite/services/storage.rb +151 -92
- data/lib/appwrite/services/tables_db.rb +947 -568
- data/lib/appwrite/services/teams.rb +161 -122
- data/lib/appwrite/services/tokens.rb +38 -31
- data/lib/appwrite/services/users.rb +376 -274
- data/lib/appwrite/services/vectors_db.rb +1614 -0
- data/lib/appwrite/services/webhooks.rb +59 -40
- data/lib/appwrite.rb +27 -0
- metadata +31 -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,17 +384,18 @@ 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
|
-
|
|
397
|
+
api_params = {}
|
|
398
|
+
|
|
386
399
|
api_headers = {
|
|
387
400
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
388
401
|
"content-type": 'application/json',
|
|
@@ -394,7 +407,6 @@ module Appwrite
|
|
|
394
407
|
headers: api_headers,
|
|
395
408
|
params: api_params,
|
|
396
409
|
)
|
|
397
|
-
|
|
398
410
|
end
|
|
399
411
|
|
|
400
412
|
# Get the list of latest security activity logs for the currently logged in
|
|
@@ -404,14 +416,17 @@ module Appwrite
|
|
|
404
416
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
405
417
|
#
|
|
406
418
|
# @return [LogList]
|
|
407
|
-
def list_logs(
|
|
419
|
+
def list_logs(
|
|
420
|
+
queries: nil,
|
|
421
|
+
total: nil
|
|
422
|
+
)
|
|
408
423
|
api_path = '/account/logs'
|
|
409
424
|
|
|
410
425
|
api_params = {
|
|
411
426
|
queries: queries,
|
|
412
427
|
total: total,
|
|
413
428
|
}
|
|
414
|
-
|
|
429
|
+
|
|
415
430
|
api_headers = {
|
|
416
431
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
417
432
|
"accept": 'application/json',
|
|
@@ -424,7 +439,6 @@ module Appwrite
|
|
|
424
439
|
params: api_params,
|
|
425
440
|
response_type: Models::LogList
|
|
426
441
|
)
|
|
427
|
-
|
|
428
442
|
end
|
|
429
443
|
|
|
430
444
|
# Enable or disable MFA on an account.
|
|
@@ -432,17 +446,19 @@ module Appwrite
|
|
|
432
446
|
# @param [] mfa Enable or disable MFA.
|
|
433
447
|
#
|
|
434
448
|
# @return [User]
|
|
435
|
-
def update_mfa(
|
|
449
|
+
def update_mfa(
|
|
450
|
+
mfa:
|
|
451
|
+
)
|
|
436
452
|
api_path = '/account/mfa'
|
|
437
453
|
|
|
438
454
|
if mfa.nil?
|
|
439
|
-
|
|
455
|
+
raise Appwrite::Exception.new('Missing required parameter: "mfa"')
|
|
440
456
|
end
|
|
441
457
|
|
|
442
458
|
api_params = {
|
|
443
459
|
mfa: mfa,
|
|
444
460
|
}
|
|
445
|
-
|
|
461
|
+
|
|
446
462
|
api_headers = {
|
|
447
463
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
448
464
|
"content-type": 'application/json',
|
|
@@ -456,7 +472,6 @@ module Appwrite
|
|
|
456
472
|
params: api_params,
|
|
457
473
|
response_type: Models::User
|
|
458
474
|
)
|
|
459
|
-
|
|
460
475
|
end
|
|
461
476
|
|
|
462
477
|
# Add an authenticator app to be used as an MFA factor. Verify the
|
|
@@ -467,17 +482,18 @@ module Appwrite
|
|
|
467
482
|
# @param [AuthenticatorType] type Type of authenticator. Must be `totp`
|
|
468
483
|
#
|
|
469
484
|
# @return [MfaType]
|
|
470
|
-
def create_mfa_authenticator(
|
|
485
|
+
def create_mfa_authenticator(
|
|
486
|
+
type:
|
|
487
|
+
)
|
|
471
488
|
api_path = '/account/mfa/authenticators/{type}'
|
|
472
489
|
.gsub('{type}', type)
|
|
473
490
|
|
|
474
491
|
if type.nil?
|
|
475
|
-
|
|
492
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
476
493
|
end
|
|
477
494
|
|
|
478
|
-
api_params = {
|
|
479
|
-
|
|
480
|
-
|
|
495
|
+
api_params = {}
|
|
496
|
+
|
|
481
497
|
api_headers = {
|
|
482
498
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
483
499
|
"content-type": 'application/json',
|
|
@@ -491,7 +507,6 @@ module Appwrite
|
|
|
491
507
|
params: api_params,
|
|
492
508
|
response_type: Models::MfaType
|
|
493
509
|
)
|
|
494
|
-
|
|
495
510
|
end
|
|
496
511
|
|
|
497
512
|
# Verify an authenticator app after adding it using the [add
|
|
@@ -502,22 +517,25 @@ module Appwrite
|
|
|
502
517
|
# @param [String] otp Valid verification token.
|
|
503
518
|
#
|
|
504
519
|
# @return [User]
|
|
505
|
-
def update_mfa_authenticator(
|
|
520
|
+
def update_mfa_authenticator(
|
|
521
|
+
type:,
|
|
522
|
+
otp:
|
|
523
|
+
)
|
|
506
524
|
api_path = '/account/mfa/authenticators/{type}'
|
|
507
525
|
.gsub('{type}', type)
|
|
508
526
|
|
|
509
527
|
if type.nil?
|
|
510
|
-
|
|
528
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
511
529
|
end
|
|
512
530
|
|
|
513
531
|
if otp.nil?
|
|
514
|
-
|
|
532
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
|
515
533
|
end
|
|
516
534
|
|
|
517
535
|
api_params = {
|
|
518
536
|
otp: otp,
|
|
519
537
|
}
|
|
520
|
-
|
|
538
|
+
|
|
521
539
|
api_headers = {
|
|
522
540
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
523
541
|
"content-type": 'application/json',
|
|
@@ -531,7 +549,6 @@ module Appwrite
|
|
|
531
549
|
params: api_params,
|
|
532
550
|
response_type: Models::User
|
|
533
551
|
)
|
|
534
|
-
|
|
535
552
|
end
|
|
536
553
|
|
|
537
554
|
# Delete an authenticator for a user by ID.
|
|
@@ -539,17 +556,18 @@ module Appwrite
|
|
|
539
556
|
# @param [AuthenticatorType] type Type of authenticator.
|
|
540
557
|
#
|
|
541
558
|
# @return []
|
|
542
|
-
def delete_mfa_authenticator(
|
|
559
|
+
def delete_mfa_authenticator(
|
|
560
|
+
type:
|
|
561
|
+
)
|
|
543
562
|
api_path = '/account/mfa/authenticators/{type}'
|
|
544
563
|
.gsub('{type}', type)
|
|
545
564
|
|
|
546
565
|
if type.nil?
|
|
547
|
-
|
|
566
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
548
567
|
end
|
|
549
568
|
|
|
550
|
-
api_params = {
|
|
551
|
-
|
|
552
|
-
|
|
569
|
+
api_params = {}
|
|
570
|
+
|
|
553
571
|
api_headers = {
|
|
554
572
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
555
573
|
"content-type": 'application/json',
|
|
@@ -561,7 +579,6 @@ module Appwrite
|
|
|
561
579
|
headers: api_headers,
|
|
562
580
|
params: api_params,
|
|
563
581
|
)
|
|
564
|
-
|
|
565
582
|
end
|
|
566
583
|
|
|
567
584
|
# Begin the process of MFA verification after sign-in. Finish the flow with
|
|
@@ -571,17 +588,19 @@ module Appwrite
|
|
|
571
588
|
# @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
|
|
572
589
|
#
|
|
573
590
|
# @return [MfaChallenge]
|
|
574
|
-
def create_mfa_challenge(
|
|
591
|
+
def create_mfa_challenge(
|
|
592
|
+
factor:
|
|
593
|
+
)
|
|
575
594
|
api_path = '/account/mfa/challenges'
|
|
576
595
|
|
|
577
596
|
if factor.nil?
|
|
578
|
-
|
|
597
|
+
raise Appwrite::Exception.new('Missing required parameter: "factor"')
|
|
579
598
|
end
|
|
580
599
|
|
|
581
600
|
api_params = {
|
|
582
601
|
factor: factor,
|
|
583
602
|
}
|
|
584
|
-
|
|
603
|
+
|
|
585
604
|
api_headers = {
|
|
586
605
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
587
606
|
"content-type": 'application/json',
|
|
@@ -595,7 +614,6 @@ module Appwrite
|
|
|
595
614
|
params: api_params,
|
|
596
615
|
response_type: Models::MfaChallenge
|
|
597
616
|
)
|
|
598
|
-
|
|
599
617
|
end
|
|
600
618
|
|
|
601
619
|
# Complete the MFA challenge by providing the one-time password. Finish the
|
|
@@ -608,22 +626,25 @@ module Appwrite
|
|
|
608
626
|
# @param [String] otp Valid verification token.
|
|
609
627
|
#
|
|
610
628
|
# @return [Session]
|
|
611
|
-
def update_mfa_challenge(
|
|
629
|
+
def update_mfa_challenge(
|
|
630
|
+
challenge_id:,
|
|
631
|
+
otp:
|
|
632
|
+
)
|
|
612
633
|
api_path = '/account/mfa/challenges'
|
|
613
634
|
|
|
614
635
|
if challenge_id.nil?
|
|
615
|
-
|
|
636
|
+
raise Appwrite::Exception.new('Missing required parameter: "challengeId"')
|
|
616
637
|
end
|
|
617
638
|
|
|
618
639
|
if otp.nil?
|
|
619
|
-
|
|
640
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
|
620
641
|
end
|
|
621
642
|
|
|
622
643
|
api_params = {
|
|
623
644
|
challengeId: challenge_id,
|
|
624
645
|
otp: otp,
|
|
625
646
|
}
|
|
626
|
-
|
|
647
|
+
|
|
627
648
|
api_headers = {
|
|
628
649
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
629
650
|
"content-type": 'application/json',
|
|
@@ -637,7 +658,6 @@ module Appwrite
|
|
|
637
658
|
params: api_params,
|
|
638
659
|
response_type: Models::Session
|
|
639
660
|
)
|
|
640
|
-
|
|
641
661
|
end
|
|
642
662
|
|
|
643
663
|
# List the factors available on the account to be used as a MFA challange.
|
|
@@ -647,9 +667,8 @@ module Appwrite
|
|
|
647
667
|
def list_mfa_factors()
|
|
648
668
|
api_path = '/account/mfa/factors'
|
|
649
669
|
|
|
650
|
-
api_params = {
|
|
651
|
-
|
|
652
|
-
|
|
670
|
+
api_params = {}
|
|
671
|
+
|
|
653
672
|
api_headers = {
|
|
654
673
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
655
674
|
"accept": 'application/json',
|
|
@@ -662,7 +681,6 @@ module Appwrite
|
|
|
662
681
|
params: api_params,
|
|
663
682
|
response_type: Models::MfaFactors
|
|
664
683
|
)
|
|
665
|
-
|
|
666
684
|
end
|
|
667
685
|
|
|
668
686
|
# Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
@@ -675,9 +693,8 @@ module Appwrite
|
|
|
675
693
|
def get_mfa_recovery_codes()
|
|
676
694
|
api_path = '/account/mfa/recovery-codes'
|
|
677
695
|
|
|
678
|
-
api_params = {
|
|
679
|
-
|
|
680
|
-
|
|
696
|
+
api_params = {}
|
|
697
|
+
|
|
681
698
|
api_headers = {
|
|
682
699
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
683
700
|
"accept": 'application/json',
|
|
@@ -690,10 +707,9 @@ module Appwrite
|
|
|
690
707
|
params: api_params,
|
|
691
708
|
response_type: Models::MfaRecoveryCodes
|
|
692
709
|
)
|
|
693
|
-
|
|
694
710
|
end
|
|
695
711
|
|
|
696
|
-
# Generate recovery codes as backup for MFA flow. It
|
|
712
|
+
# Generate recovery codes as backup for MFA flow. It's recommended to
|
|
697
713
|
# generate and show then immediately after user successfully adds their
|
|
698
714
|
# authehticator. Recovery codes can be used as a MFA verification type in
|
|
699
715
|
# [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
@@ -704,9 +720,8 @@ module Appwrite
|
|
|
704
720
|
def create_mfa_recovery_codes()
|
|
705
721
|
api_path = '/account/mfa/recovery-codes'
|
|
706
722
|
|
|
707
|
-
api_params = {
|
|
708
|
-
|
|
709
|
-
|
|
723
|
+
api_params = {}
|
|
724
|
+
|
|
710
725
|
api_headers = {
|
|
711
726
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
712
727
|
"content-type": 'application/json',
|
|
@@ -720,7 +735,6 @@ module Appwrite
|
|
|
720
735
|
params: api_params,
|
|
721
736
|
response_type: Models::MfaRecoveryCodes
|
|
722
737
|
)
|
|
723
|
-
|
|
724
738
|
end
|
|
725
739
|
|
|
726
740
|
# Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
@@ -733,9 +747,8 @@ module Appwrite
|
|
|
733
747
|
def update_mfa_recovery_codes()
|
|
734
748
|
api_path = '/account/mfa/recovery-codes'
|
|
735
749
|
|
|
736
|
-
api_params = {
|
|
737
|
-
|
|
738
|
-
|
|
750
|
+
api_params = {}
|
|
751
|
+
|
|
739
752
|
api_headers = {
|
|
740
753
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
741
754
|
"content-type": 'application/json',
|
|
@@ -749,7 +762,6 @@ module Appwrite
|
|
|
749
762
|
params: api_params,
|
|
750
763
|
response_type: Models::MfaRecoveryCodes
|
|
751
764
|
)
|
|
752
|
-
|
|
753
765
|
end
|
|
754
766
|
|
|
755
767
|
# Update currently logged in user account name.
|
|
@@ -757,17 +769,19 @@ module Appwrite
|
|
|
757
769
|
# @param [String] name User name. Max length: 128 chars.
|
|
758
770
|
#
|
|
759
771
|
# @return [User]
|
|
760
|
-
def update_name(
|
|
772
|
+
def update_name(
|
|
773
|
+
name:
|
|
774
|
+
)
|
|
761
775
|
api_path = '/account/name'
|
|
762
776
|
|
|
763
777
|
if name.nil?
|
|
764
|
-
|
|
778
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
765
779
|
end
|
|
766
780
|
|
|
767
781
|
api_params = {
|
|
768
782
|
name: name,
|
|
769
783
|
}
|
|
770
|
-
|
|
784
|
+
|
|
771
785
|
api_headers = {
|
|
772
786
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
773
787
|
"content-type": 'application/json',
|
|
@@ -781,7 +795,6 @@ module Appwrite
|
|
|
781
795
|
params: api_params,
|
|
782
796
|
response_type: Models::User
|
|
783
797
|
)
|
|
784
|
-
|
|
785
798
|
end
|
|
786
799
|
|
|
787
800
|
# Update currently logged in user password. For validation, user is required
|
|
@@ -792,18 +805,21 @@ module Appwrite
|
|
|
792
805
|
# @param [String] old_password Current user password. Max length: 256 chars.
|
|
793
806
|
#
|
|
794
807
|
# @return [User]
|
|
795
|
-
def update_password(
|
|
808
|
+
def update_password(
|
|
809
|
+
password:,
|
|
810
|
+
old_password: nil
|
|
811
|
+
)
|
|
796
812
|
api_path = '/account/password'
|
|
797
813
|
|
|
798
814
|
if password.nil?
|
|
799
|
-
|
|
815
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
800
816
|
end
|
|
801
817
|
|
|
802
818
|
api_params = {
|
|
803
819
|
password: password,
|
|
804
820
|
oldPassword: old_password,
|
|
805
821
|
}
|
|
806
|
-
|
|
822
|
+
|
|
807
823
|
api_headers = {
|
|
808
824
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
809
825
|
"content-type": 'application/json',
|
|
@@ -817,35 +833,37 @@ module Appwrite
|
|
|
817
833
|
params: api_params,
|
|
818
834
|
response_type: Models::User
|
|
819
835
|
)
|
|
820
|
-
|
|
821
836
|
end
|
|
822
837
|
|
|
823
|
-
# Update the currently logged in user
|
|
838
|
+
# Update the currently logged in user's phone number. After updating the
|
|
824
839
|
# phone number, the phone verification status will be reset. A confirmation
|
|
825
840
|
# SMS is not sent automatically, however you can use the [POST
|
|
826
841
|
# /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification)
|
|
827
842
|
# endpoint to send a confirmation SMS.
|
|
828
843
|
#
|
|
829
|
-
# @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.
|
|
830
845
|
# @param [String] password User password. Must be at least 8 chars.
|
|
831
846
|
#
|
|
832
847
|
# @return [User]
|
|
833
|
-
def update_phone(
|
|
848
|
+
def update_phone(
|
|
849
|
+
phone:,
|
|
850
|
+
password:
|
|
851
|
+
)
|
|
834
852
|
api_path = '/account/phone'
|
|
835
853
|
|
|
836
854
|
if phone.nil?
|
|
837
|
-
|
|
855
|
+
raise Appwrite::Exception.new('Missing required parameter: "phone"')
|
|
838
856
|
end
|
|
839
857
|
|
|
840
858
|
if password.nil?
|
|
841
|
-
|
|
859
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
842
860
|
end
|
|
843
861
|
|
|
844
862
|
api_params = {
|
|
845
863
|
phone: phone,
|
|
846
864
|
password: password,
|
|
847
865
|
}
|
|
848
|
-
|
|
866
|
+
|
|
849
867
|
api_headers = {
|
|
850
868
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
851
869
|
"content-type": 'application/json',
|
|
@@ -859,7 +877,6 @@ module Appwrite
|
|
|
859
877
|
params: api_params,
|
|
860
878
|
response_type: Models::User
|
|
861
879
|
)
|
|
862
|
-
|
|
863
880
|
end
|
|
864
881
|
|
|
865
882
|
# Get the preferences as a key-value object for the currently logged in user.
|
|
@@ -869,9 +886,8 @@ module Appwrite
|
|
|
869
886
|
def get_prefs()
|
|
870
887
|
api_path = '/account/prefs'
|
|
871
888
|
|
|
872
|
-
api_params = {
|
|
873
|
-
|
|
874
|
-
|
|
889
|
+
api_params = {}
|
|
890
|
+
|
|
875
891
|
api_headers = {
|
|
876
892
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
877
893
|
"accept": 'application/json',
|
|
@@ -884,7 +900,6 @@ module Appwrite
|
|
|
884
900
|
params: api_params,
|
|
885
901
|
response_type: Models::Preferences
|
|
886
902
|
)
|
|
887
|
-
|
|
888
903
|
end
|
|
889
904
|
|
|
890
905
|
# Update currently logged in user account preferences. The object you pass is
|
|
@@ -894,17 +909,19 @@ module Appwrite
|
|
|
894
909
|
# @param [Hash] prefs Prefs key-value JSON object.
|
|
895
910
|
#
|
|
896
911
|
# @return [User]
|
|
897
|
-
def update_prefs(
|
|
912
|
+
def update_prefs(
|
|
913
|
+
prefs:
|
|
914
|
+
)
|
|
898
915
|
api_path = '/account/prefs'
|
|
899
916
|
|
|
900
917
|
if prefs.nil?
|
|
901
|
-
|
|
918
|
+
raise Appwrite::Exception.new('Missing required parameter: "prefs"')
|
|
902
919
|
end
|
|
903
920
|
|
|
904
921
|
api_params = {
|
|
905
922
|
prefs: prefs,
|
|
906
923
|
}
|
|
907
|
-
|
|
924
|
+
|
|
908
925
|
api_headers = {
|
|
909
926
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
910
927
|
"content-type": 'application/json',
|
|
@@ -918,7 +935,6 @@ module Appwrite
|
|
|
918
935
|
params: api_params,
|
|
919
936
|
response_type: Models::User
|
|
920
937
|
)
|
|
921
|
-
|
|
922
938
|
end
|
|
923
939
|
|
|
924
940
|
# Sends the user an email with a temporary secret key for password reset.
|
|
@@ -927,29 +943,32 @@ module Appwrite
|
|
|
927
943
|
# attached to the URL query string. Use the query string params to submit a
|
|
928
944
|
# request to the [PUT
|
|
929
945
|
# /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery)
|
|
930
|
-
# 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
|
|
931
947
|
# email address is valid for 1 hour.
|
|
932
948
|
#
|
|
933
949
|
# @param [String] email User email.
|
|
934
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.
|
|
935
951
|
#
|
|
936
952
|
# @return [Token]
|
|
937
|
-
def create_recovery(
|
|
953
|
+
def create_recovery(
|
|
954
|
+
email:,
|
|
955
|
+
url:
|
|
956
|
+
)
|
|
938
957
|
api_path = '/account/recovery'
|
|
939
958
|
|
|
940
959
|
if email.nil?
|
|
941
|
-
|
|
960
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
942
961
|
end
|
|
943
962
|
|
|
944
963
|
if url.nil?
|
|
945
|
-
|
|
964
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
946
965
|
end
|
|
947
966
|
|
|
948
967
|
api_params = {
|
|
949
968
|
email: email,
|
|
950
969
|
url: url,
|
|
951
970
|
}
|
|
952
|
-
|
|
971
|
+
|
|
953
972
|
api_headers = {
|
|
954
973
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
955
974
|
"content-type": 'application/json',
|
|
@@ -963,7 +982,6 @@ module Appwrite
|
|
|
963
982
|
params: api_params,
|
|
964
983
|
response_type: Models::Token
|
|
965
984
|
)
|
|
966
|
-
|
|
967
985
|
end
|
|
968
986
|
|
|
969
987
|
# Use this endpoint to complete the user account password reset. Both the
|
|
@@ -971,7 +989,7 @@ module Appwrite
|
|
|
971
989
|
# the redirect URL you have provided when sending your request to the [POST
|
|
972
990
|
# /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery)
|
|
973
991
|
# endpoint.
|
|
974
|
-
#
|
|
992
|
+
#
|
|
975
993
|
# Please note that in order to avoid a [Redirect
|
|
976
994
|
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
977
995
|
# the only valid redirect URLs are the ones from domains you have set when
|
|
@@ -982,19 +1000,23 @@ module Appwrite
|
|
|
982
1000
|
# @param [String] password New user password. Must be between 8 and 256 chars.
|
|
983
1001
|
#
|
|
984
1002
|
# @return [Token]
|
|
985
|
-
def update_recovery(
|
|
1003
|
+
def update_recovery(
|
|
1004
|
+
user_id:,
|
|
1005
|
+
secret:,
|
|
1006
|
+
password:
|
|
1007
|
+
)
|
|
986
1008
|
api_path = '/account/recovery'
|
|
987
1009
|
|
|
988
1010
|
if user_id.nil?
|
|
989
|
-
|
|
1011
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
990
1012
|
end
|
|
991
1013
|
|
|
992
1014
|
if secret.nil?
|
|
993
|
-
|
|
1015
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
994
1016
|
end
|
|
995
1017
|
|
|
996
1018
|
if password.nil?
|
|
997
|
-
|
|
1019
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
998
1020
|
end
|
|
999
1021
|
|
|
1000
1022
|
api_params = {
|
|
@@ -1002,7 +1024,7 @@ module Appwrite
|
|
|
1002
1024
|
secret: secret,
|
|
1003
1025
|
password: password,
|
|
1004
1026
|
}
|
|
1005
|
-
|
|
1027
|
+
|
|
1006
1028
|
api_headers = {
|
|
1007
1029
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1008
1030
|
"content-type": 'application/json',
|
|
@@ -1016,7 +1038,6 @@ module Appwrite
|
|
|
1016
1038
|
params: api_params,
|
|
1017
1039
|
response_type: Models::Token
|
|
1018
1040
|
)
|
|
1019
|
-
|
|
1020
1041
|
end
|
|
1021
1042
|
|
|
1022
1043
|
# Get the list of active sessions across different devices for the currently
|
|
@@ -1027,9 +1048,8 @@ module Appwrite
|
|
|
1027
1048
|
def list_sessions()
|
|
1028
1049
|
api_path = '/account/sessions'
|
|
1029
1050
|
|
|
1030
|
-
api_params = {
|
|
1031
|
-
|
|
1032
|
-
|
|
1051
|
+
api_params = {}
|
|
1052
|
+
|
|
1033
1053
|
api_headers = {
|
|
1034
1054
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1035
1055
|
"accept": 'application/json',
|
|
@@ -1042,7 +1062,6 @@ module Appwrite
|
|
|
1042
1062
|
params: api_params,
|
|
1043
1063
|
response_type: Models::SessionList
|
|
1044
1064
|
)
|
|
1045
|
-
|
|
1046
1065
|
end
|
|
1047
1066
|
|
|
1048
1067
|
# Delete all sessions from the user account and remove any sessions cookies
|
|
@@ -1053,9 +1072,8 @@ module Appwrite
|
|
|
1053
1072
|
def delete_sessions()
|
|
1054
1073
|
api_path = '/account/sessions'
|
|
1055
1074
|
|
|
1056
|
-
api_params = {
|
|
1057
|
-
|
|
1058
|
-
|
|
1075
|
+
api_params = {}
|
|
1076
|
+
|
|
1059
1077
|
api_headers = {
|
|
1060
1078
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1061
1079
|
"content-type": 'application/json',
|
|
@@ -1067,7 +1085,6 @@ module Appwrite
|
|
|
1067
1085
|
headers: api_headers,
|
|
1068
1086
|
params: api_params,
|
|
1069
1087
|
)
|
|
1070
|
-
|
|
1071
1088
|
end
|
|
1072
1089
|
|
|
1073
1090
|
# Use this endpoint to allow a new user to register an anonymous account in
|
|
@@ -1083,9 +1100,8 @@ module Appwrite
|
|
|
1083
1100
|
def create_anonymous_session()
|
|
1084
1101
|
api_path = '/account/sessions/anonymous'
|
|
1085
1102
|
|
|
1086
|
-
api_params = {
|
|
1087
|
-
|
|
1088
|
-
|
|
1103
|
+
api_params = {}
|
|
1104
|
+
|
|
1089
1105
|
api_headers = {
|
|
1090
1106
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1091
1107
|
"content-type": 'application/json',
|
|
@@ -1099,12 +1115,11 @@ module Appwrite
|
|
|
1099
1115
|
params: api_params,
|
|
1100
1116
|
response_type: Models::Session
|
|
1101
1117
|
)
|
|
1102
|
-
|
|
1103
1118
|
end
|
|
1104
1119
|
|
|
1105
1120
|
# Allow the user to login into their account by providing a valid email and
|
|
1106
1121
|
# password combination. This route will create a new session for the user.
|
|
1107
|
-
#
|
|
1122
|
+
#
|
|
1108
1123
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1109
1124
|
# about session
|
|
1110
1125
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1113,22 +1128,25 @@ module Appwrite
|
|
|
1113
1128
|
# @param [String] password User password. Must be at least 8 chars.
|
|
1114
1129
|
#
|
|
1115
1130
|
# @return [Session]
|
|
1116
|
-
def create_email_password_session(
|
|
1131
|
+
def create_email_password_session(
|
|
1132
|
+
email:,
|
|
1133
|
+
password:
|
|
1134
|
+
)
|
|
1117
1135
|
api_path = '/account/sessions/email'
|
|
1118
1136
|
|
|
1119
1137
|
if email.nil?
|
|
1120
|
-
|
|
1138
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1121
1139
|
end
|
|
1122
1140
|
|
|
1123
1141
|
if password.nil?
|
|
1124
|
-
|
|
1142
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
1125
1143
|
end
|
|
1126
1144
|
|
|
1127
1145
|
api_params = {
|
|
1128
1146
|
email: email,
|
|
1129
1147
|
password: password,
|
|
1130
1148
|
}
|
|
1131
|
-
|
|
1149
|
+
|
|
1132
1150
|
api_headers = {
|
|
1133
1151
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1134
1152
|
"content-type": 'application/json',
|
|
@@ -1142,7 +1160,6 @@ module Appwrite
|
|
|
1142
1160
|
params: api_params,
|
|
1143
1161
|
response_type: Models::Session
|
|
1144
1162
|
)
|
|
1145
|
-
|
|
1146
1163
|
end
|
|
1147
1164
|
|
|
1148
1165
|
#
|
|
@@ -1152,26 +1169,29 @@ module Appwrite
|
|
|
1152
1169
|
# and **secret** parameters from the successful response of authentication
|
|
1153
1170
|
# flows initiated by token creation. For example, magic URL and phone login.
|
|
1154
1171
|
#
|
|
1155
|
-
# @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.
|
|
1156
1173
|
# @param [String] secret Valid verification token.
|
|
1157
1174
|
#
|
|
1158
1175
|
# @return [Session]
|
|
1159
|
-
def update_magic_url_session(
|
|
1176
|
+
def update_magic_url_session(
|
|
1177
|
+
user_id:,
|
|
1178
|
+
secret:
|
|
1179
|
+
)
|
|
1160
1180
|
api_path = '/account/sessions/magic-url'
|
|
1161
1181
|
|
|
1162
1182
|
if user_id.nil?
|
|
1163
|
-
|
|
1183
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1164
1184
|
end
|
|
1165
1185
|
|
|
1166
1186
|
if secret.nil?
|
|
1167
|
-
|
|
1187
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1168
1188
|
end
|
|
1169
1189
|
|
|
1170
1190
|
api_params = {
|
|
1171
1191
|
userId: user_id,
|
|
1172
1192
|
secret: secret,
|
|
1173
1193
|
}
|
|
1174
|
-
|
|
1194
|
+
|
|
1175
1195
|
api_headers = {
|
|
1176
1196
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1177
1197
|
"content-type": 'application/json',
|
|
@@ -1185,7 +1205,6 @@ module Appwrite
|
|
|
1185
1205
|
params: api_params,
|
|
1186
1206
|
response_type: Models::Session
|
|
1187
1207
|
)
|
|
1188
|
-
|
|
1189
1208
|
end
|
|
1190
1209
|
|
|
1191
1210
|
#
|
|
@@ -1195,26 +1214,29 @@ module Appwrite
|
|
|
1195
1214
|
# and **secret** parameters from the successful response of authentication
|
|
1196
1215
|
# flows initiated by token creation. For example, magic URL and phone login.
|
|
1197
1216
|
#
|
|
1198
|
-
# @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.
|
|
1199
1218
|
# @param [String] secret Valid verification token.
|
|
1200
1219
|
#
|
|
1201
1220
|
# @return [Session]
|
|
1202
|
-
def update_phone_session(
|
|
1221
|
+
def update_phone_session(
|
|
1222
|
+
user_id:,
|
|
1223
|
+
secret:
|
|
1224
|
+
)
|
|
1203
1225
|
api_path = '/account/sessions/phone'
|
|
1204
1226
|
|
|
1205
1227
|
if user_id.nil?
|
|
1206
|
-
|
|
1228
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1207
1229
|
end
|
|
1208
1230
|
|
|
1209
1231
|
if secret.nil?
|
|
1210
|
-
|
|
1232
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1211
1233
|
end
|
|
1212
1234
|
|
|
1213
1235
|
api_params = {
|
|
1214
1236
|
userId: user_id,
|
|
1215
1237
|
secret: secret,
|
|
1216
1238
|
}
|
|
1217
|
-
|
|
1239
|
+
|
|
1218
1240
|
api_headers = {
|
|
1219
1241
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1220
1242
|
"content-type": 'application/json',
|
|
@@ -1228,33 +1250,35 @@ module Appwrite
|
|
|
1228
1250
|
params: api_params,
|
|
1229
1251
|
response_type: Models::Session
|
|
1230
1252
|
)
|
|
1231
|
-
|
|
1232
1253
|
end
|
|
1233
1254
|
|
|
1234
1255
|
# Use this endpoint to create a session from token. Provide the **userId**
|
|
1235
1256
|
# and **secret** parameters from the successful response of authentication
|
|
1236
1257
|
# flows initiated by token creation. For example, magic URL and phone login.
|
|
1237
1258
|
#
|
|
1238
|
-
# @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.
|
|
1239
1260
|
# @param [String] secret Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.
|
|
1240
1261
|
#
|
|
1241
1262
|
# @return [Session]
|
|
1242
|
-
def create_session(
|
|
1263
|
+
def create_session(
|
|
1264
|
+
user_id:,
|
|
1265
|
+
secret:
|
|
1266
|
+
)
|
|
1243
1267
|
api_path = '/account/sessions/token'
|
|
1244
1268
|
|
|
1245
1269
|
if user_id.nil?
|
|
1246
|
-
|
|
1270
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1247
1271
|
end
|
|
1248
1272
|
|
|
1249
1273
|
if secret.nil?
|
|
1250
|
-
|
|
1274
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1251
1275
|
end
|
|
1252
1276
|
|
|
1253
1277
|
api_params = {
|
|
1254
1278
|
userId: user_id,
|
|
1255
1279
|
secret: secret,
|
|
1256
1280
|
}
|
|
1257
|
-
|
|
1281
|
+
|
|
1258
1282
|
api_headers = {
|
|
1259
1283
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1260
1284
|
"content-type": 'application/json',
|
|
@@ -1268,26 +1292,26 @@ module Appwrite
|
|
|
1268
1292
|
params: api_params,
|
|
1269
1293
|
response_type: Models::Session
|
|
1270
1294
|
)
|
|
1271
|
-
|
|
1272
1295
|
end
|
|
1273
1296
|
|
|
1274
|
-
# Use this endpoint to get a logged in user
|
|
1275
|
-
# 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.
|
|
1276
1299
|
#
|
|
1277
|
-
# @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.
|
|
1278
1301
|
#
|
|
1279
1302
|
# @return [Session]
|
|
1280
|
-
def get_session(
|
|
1303
|
+
def get_session(
|
|
1304
|
+
session_id:
|
|
1305
|
+
)
|
|
1281
1306
|
api_path = '/account/sessions/{sessionId}'
|
|
1282
1307
|
.gsub('{sessionId}', session_id)
|
|
1283
1308
|
|
|
1284
1309
|
if session_id.nil?
|
|
1285
|
-
|
|
1310
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
|
1286
1311
|
end
|
|
1287
1312
|
|
|
1288
|
-
api_params = {
|
|
1289
|
-
|
|
1290
|
-
|
|
1313
|
+
api_params = {}
|
|
1314
|
+
|
|
1291
1315
|
api_headers = {
|
|
1292
1316
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1293
1317
|
"accept": 'application/json',
|
|
@@ -1300,27 +1324,27 @@ module Appwrite
|
|
|
1300
1324
|
params: api_params,
|
|
1301
1325
|
response_type: Models::Session
|
|
1302
1326
|
)
|
|
1303
|
-
|
|
1304
1327
|
end
|
|
1305
1328
|
|
|
1306
|
-
# Use this endpoint to extend a session
|
|
1329
|
+
# Use this endpoint to extend a session's length. Extending a session is
|
|
1307
1330
|
# useful when session expiry is short. If the session was created using an
|
|
1308
1331
|
# OAuth provider, this endpoint refreshes the access token from the provider.
|
|
1309
1332
|
#
|
|
1310
|
-
# @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.
|
|
1311
1334
|
#
|
|
1312
1335
|
# @return [Session]
|
|
1313
|
-
def update_session(
|
|
1336
|
+
def update_session(
|
|
1337
|
+
session_id:
|
|
1338
|
+
)
|
|
1314
1339
|
api_path = '/account/sessions/{sessionId}'
|
|
1315
1340
|
.gsub('{sessionId}', session_id)
|
|
1316
1341
|
|
|
1317
1342
|
if session_id.nil?
|
|
1318
|
-
|
|
1343
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
|
1319
1344
|
end
|
|
1320
1345
|
|
|
1321
|
-
api_params = {
|
|
1322
|
-
|
|
1323
|
-
|
|
1346
|
+
api_params = {}
|
|
1347
|
+
|
|
1324
1348
|
api_headers = {
|
|
1325
1349
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1326
1350
|
"content-type": 'application/json',
|
|
@@ -1334,29 +1358,29 @@ module Appwrite
|
|
|
1334
1358
|
params: api_params,
|
|
1335
1359
|
response_type: Models::Session
|
|
1336
1360
|
)
|
|
1337
|
-
|
|
1338
1361
|
end
|
|
1339
1362
|
|
|
1340
|
-
# Logout the user. Use
|
|
1341
|
-
# 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
|
|
1342
1365
|
# the user on all devices, use [Delete
|
|
1343
1366
|
# Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions)
|
|
1344
1367
|
# instead.
|
|
1345
1368
|
#
|
|
1346
|
-
# @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.
|
|
1347
1370
|
#
|
|
1348
1371
|
# @return []
|
|
1349
|
-
def delete_session(
|
|
1372
|
+
def delete_session(
|
|
1373
|
+
session_id:
|
|
1374
|
+
)
|
|
1350
1375
|
api_path = '/account/sessions/{sessionId}'
|
|
1351
1376
|
.gsub('{sessionId}', session_id)
|
|
1352
1377
|
|
|
1353
1378
|
if session_id.nil?
|
|
1354
|
-
|
|
1379
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
|
1355
1380
|
end
|
|
1356
1381
|
|
|
1357
|
-
api_params = {
|
|
1358
|
-
|
|
1359
|
-
|
|
1382
|
+
api_params = {}
|
|
1383
|
+
|
|
1360
1384
|
api_headers = {
|
|
1361
1385
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1362
1386
|
"content-type": 'application/json',
|
|
@@ -1368,7 +1392,6 @@ module Appwrite
|
|
|
1368
1392
|
headers: api_headers,
|
|
1369
1393
|
params: api_params,
|
|
1370
1394
|
)
|
|
1371
|
-
|
|
1372
1395
|
end
|
|
1373
1396
|
|
|
1374
1397
|
# Block the currently logged in user account. Behind the scene, the user
|
|
@@ -1380,9 +1403,8 @@ module Appwrite
|
|
|
1380
1403
|
def update_status()
|
|
1381
1404
|
api_path = '/account/status'
|
|
1382
1405
|
|
|
1383
|
-
api_params = {
|
|
1384
|
-
|
|
1385
|
-
|
|
1406
|
+
api_params = {}
|
|
1407
|
+
|
|
1386
1408
|
api_headers = {
|
|
1387
1409
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1388
1410
|
"content-type": 'application/json',
|
|
@@ -1396,7 +1418,6 @@ module Appwrite
|
|
|
1396
1418
|
params: api_params,
|
|
1397
1419
|
response_type: Models::User
|
|
1398
1420
|
)
|
|
1399
|
-
|
|
1400
1421
|
end
|
|
1401
1422
|
|
|
1402
1423
|
# Sends the user an email with a secret key for creating a session. If the
|
|
@@ -1406,28 +1427,32 @@ module Appwrite
|
|
|
1406
1427
|
# email with the one-time password. Use the returned user ID and secret and
|
|
1407
1428
|
# submit a request to the [POST
|
|
1408
1429
|
# /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1409
|
-
# 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
|
|
1410
1431
|
# is valid for 15 minutes.
|
|
1411
|
-
#
|
|
1432
|
+
#
|
|
1412
1433
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1413
1434
|
# about session
|
|
1414
1435
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1415
|
-
#
|
|
1416
1436
|
#
|
|
1417
|
-
#
|
|
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.
|
|
1418
1439
|
# @param [String] email User email.
|
|
1419
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.
|
|
1420
1441
|
#
|
|
1421
1442
|
# @return [Token]
|
|
1422
|
-
def create_email_token(
|
|
1443
|
+
def create_email_token(
|
|
1444
|
+
user_id:,
|
|
1445
|
+
email:,
|
|
1446
|
+
phrase: nil
|
|
1447
|
+
)
|
|
1423
1448
|
api_path = '/account/tokens/email'
|
|
1424
1449
|
|
|
1425
1450
|
if user_id.nil?
|
|
1426
|
-
|
|
1451
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1427
1452
|
end
|
|
1428
1453
|
|
|
1429
1454
|
if email.nil?
|
|
1430
|
-
|
|
1455
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1431
1456
|
end
|
|
1432
1457
|
|
|
1433
1458
|
api_params = {
|
|
@@ -1435,7 +1460,7 @@ module Appwrite
|
|
|
1435
1460
|
email: email,
|
|
1436
1461
|
phrase: phrase,
|
|
1437
1462
|
}
|
|
1438
|
-
|
|
1463
|
+
|
|
1439
1464
|
api_headers = {
|
|
1440
1465
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1441
1466
|
"content-type": 'application/json',
|
|
@@ -1449,7 +1474,6 @@ module Appwrite
|
|
|
1449
1474
|
params: api_params,
|
|
1450
1475
|
response_type: Models::Token
|
|
1451
1476
|
)
|
|
1452
|
-
|
|
1453
1477
|
end
|
|
1454
1478
|
|
|
1455
1479
|
# Sends the user an email with a secret key for creating a session. If the
|
|
@@ -1459,29 +1483,34 @@ module Appwrite
|
|
|
1459
1483
|
# query string. Use the query string parameters to submit a request to the
|
|
1460
1484
|
# [POST
|
|
1461
1485
|
# /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1462
|
-
# 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
|
|
1463
1487
|
# address is valid for 1 hour.
|
|
1464
|
-
#
|
|
1488
|
+
#
|
|
1465
1489
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1466
1490
|
# about session
|
|
1467
1491
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1468
|
-
#
|
|
1469
1492
|
#
|
|
1470
|
-
#
|
|
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.
|
|
1471
1495
|
# @param [String] email User email.
|
|
1472
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.
|
|
1473
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.
|
|
1474
1498
|
#
|
|
1475
1499
|
# @return [Token]
|
|
1476
|
-
def create_magic_url_token(
|
|
1500
|
+
def create_magic_url_token(
|
|
1501
|
+
user_id:,
|
|
1502
|
+
email:,
|
|
1503
|
+
url: nil,
|
|
1504
|
+
phrase: nil
|
|
1505
|
+
)
|
|
1477
1506
|
api_path = '/account/tokens/magic-url'
|
|
1478
1507
|
|
|
1479
1508
|
if user_id.nil?
|
|
1480
|
-
|
|
1509
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1481
1510
|
end
|
|
1482
1511
|
|
|
1483
1512
|
if email.nil?
|
|
1484
|
-
|
|
1513
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1485
1514
|
end
|
|
1486
1515
|
|
|
1487
1516
|
api_params = {
|
|
@@ -1490,7 +1519,7 @@ module Appwrite
|
|
|
1490
1519
|
url: url,
|
|
1491
1520
|
phrase: phrase,
|
|
1492
1521
|
}
|
|
1493
|
-
|
|
1522
|
+
|
|
1494
1523
|
api_headers = {
|
|
1495
1524
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1496
1525
|
"content-type": 'application/json',
|
|
@@ -1504,36 +1533,40 @@ module Appwrite
|
|
|
1504
1533
|
params: api_params,
|
|
1505
1534
|
response_type: Models::Token
|
|
1506
1535
|
)
|
|
1507
|
-
|
|
1508
1536
|
end
|
|
1509
1537
|
|
|
1510
1538
|
# Allow the user to login to their account using the OAuth2 provider of their
|
|
1511
1539
|
# choice. Each OAuth2 provider should be enabled from the Appwrite console
|
|
1512
|
-
# first. Use the success and failure arguments to provide a redirect URL
|
|
1513
|
-
# back to your app when login is completed.
|
|
1514
|
-
#
|
|
1540
|
+
# first. Use the success and failure arguments to provide a redirect URL's
|
|
1541
|
+
# back to your app when login is completed.
|
|
1542
|
+
#
|
|
1515
1543
|
# If authentication succeeds, `userId` and `secret` of a token will be
|
|
1516
1544
|
# appended to the success URL as query parameters. These can be used to
|
|
1517
1545
|
# create a new session using the [Create
|
|
1518
1546
|
# session](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1519
1547
|
# endpoint.
|
|
1520
|
-
#
|
|
1548
|
+
#
|
|
1521
1549
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1522
1550
|
# about session
|
|
1523
1551
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1524
1552
|
#
|
|
1525
|
-
# @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.
|
|
1526
|
-
# @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project
|
|
1527
|
-
# @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.
|
|
1528
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.
|
|
1529
1557
|
#
|
|
1530
1558
|
# @return []
|
|
1531
|
-
def create_o_auth2_token(
|
|
1559
|
+
def create_o_auth2_token(
|
|
1560
|
+
provider:,
|
|
1561
|
+
success: nil,
|
|
1562
|
+
failure: nil,
|
|
1563
|
+
scopes: nil
|
|
1564
|
+
)
|
|
1532
1565
|
api_path = '/account/tokens/oauth2/{provider}'
|
|
1533
1566
|
.gsub('{provider}', provider)
|
|
1534
1567
|
|
|
1535
1568
|
if provider.nil?
|
|
1536
|
-
|
|
1569
|
+
raise Appwrite::Exception.new('Missing required parameter: "provider"')
|
|
1537
1570
|
end
|
|
1538
1571
|
|
|
1539
1572
|
api_params = {
|
|
@@ -1541,7 +1574,7 @@ module Appwrite
|
|
|
1541
1574
|
failure: failure,
|
|
1542
1575
|
scopes: scopes,
|
|
1543
1576
|
}
|
|
1544
|
-
|
|
1577
|
+
|
|
1545
1578
|
api_headers = {
|
|
1546
1579
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1547
1580
|
"accept": 'text/html',
|
|
@@ -1554,40 +1587,42 @@ module Appwrite
|
|
|
1554
1587
|
params: api_params,
|
|
1555
1588
|
response_type: "location"
|
|
1556
1589
|
)
|
|
1557
|
-
|
|
1558
1590
|
end
|
|
1559
1591
|
|
|
1560
1592
|
# Sends the user an SMS with a secret key for creating a session. If the
|
|
1561
1593
|
# provided user ID has not be registered, a new user will be created. Use the
|
|
1562
1594
|
# returned user ID and secret and submit a request to the [POST
|
|
1563
1595
|
# /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1564
|
-
# 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
|
|
1565
1597
|
# is valid for 15 minutes.
|
|
1566
|
-
#
|
|
1598
|
+
#
|
|
1567
1599
|
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1568
1600
|
# about session
|
|
1569
1601
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1570
1602
|
#
|
|
1571
|
-
# @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
|
|
1572
|
-
# @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.
|
|
1573
1605
|
#
|
|
1574
1606
|
# @return [Token]
|
|
1575
|
-
def create_phone_token(
|
|
1607
|
+
def create_phone_token(
|
|
1608
|
+
user_id:,
|
|
1609
|
+
phone:
|
|
1610
|
+
)
|
|
1576
1611
|
api_path = '/account/tokens/phone'
|
|
1577
1612
|
|
|
1578
1613
|
if user_id.nil?
|
|
1579
|
-
|
|
1614
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1580
1615
|
end
|
|
1581
1616
|
|
|
1582
1617
|
if phone.nil?
|
|
1583
|
-
|
|
1618
|
+
raise Appwrite::Exception.new('Missing required parameter: "phone"')
|
|
1584
1619
|
end
|
|
1585
1620
|
|
|
1586
1621
|
api_params = {
|
|
1587
1622
|
userId: user_id,
|
|
1588
1623
|
phone: phone,
|
|
1589
1624
|
}
|
|
1590
|
-
|
|
1625
|
+
|
|
1591
1626
|
api_headers = {
|
|
1592
1627
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1593
1628
|
"content-type": 'application/json',
|
|
@@ -1601,7 +1636,6 @@ module Appwrite
|
|
|
1601
1636
|
params: api_params,
|
|
1602
1637
|
response_type: Models::Token
|
|
1603
1638
|
)
|
|
1604
|
-
|
|
1605
1639
|
end
|
|
1606
1640
|
|
|
1607
1641
|
# Use this endpoint to send a verification message to your user email address
|
|
@@ -1612,28 +1646,30 @@ module Appwrite
|
|
|
1612
1646
|
# verification process by verifying both the **userId** and **secret**
|
|
1613
1647
|
# parameters. Learn more about how to [complete the verification
|
|
1614
1648
|
# process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
|
|
1615
|
-
# The verification link sent to the user
|
|
1616
|
-
#
|
|
1649
|
+
# The verification link sent to the user's email address is valid for 7 days.
|
|
1650
|
+
#
|
|
1617
1651
|
# Please note that in order to avoid a [Redirect
|
|
1618
1652
|
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
1619
1653
|
# the only valid redirect URLs are the ones from domains you have set when
|
|
1620
1654
|
# adding your platforms in the console interface.
|
|
1621
|
-
#
|
|
1655
|
+
#
|
|
1622
1656
|
#
|
|
1623
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.
|
|
1624
1658
|
#
|
|
1625
1659
|
# @return [Token]
|
|
1626
|
-
def create_email_verification(
|
|
1660
|
+
def create_email_verification(
|
|
1661
|
+
url:
|
|
1662
|
+
)
|
|
1627
1663
|
api_path = '/account/verifications/email'
|
|
1628
1664
|
|
|
1629
1665
|
if url.nil?
|
|
1630
|
-
|
|
1666
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
1631
1667
|
end
|
|
1632
1668
|
|
|
1633
1669
|
api_params = {
|
|
1634
1670
|
url: url,
|
|
1635
1671
|
}
|
|
1636
|
-
|
|
1672
|
+
|
|
1637
1673
|
api_headers = {
|
|
1638
1674
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1639
1675
|
"content-type": 'application/json',
|
|
@@ -1647,7 +1683,6 @@ module Appwrite
|
|
|
1647
1683
|
params: api_params,
|
|
1648
1684
|
response_type: Models::Token
|
|
1649
1685
|
)
|
|
1650
|
-
|
|
1651
1686
|
end
|
|
1652
1687
|
|
|
1653
1688
|
#
|
|
@@ -1661,28 +1696,30 @@ module Appwrite
|
|
|
1661
1696
|
# verification process by verifying both the **userId** and **secret**
|
|
1662
1697
|
# parameters. Learn more about how to [complete the verification
|
|
1663
1698
|
# process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
|
|
1664
|
-
# The verification link sent to the user
|
|
1665
|
-
#
|
|
1699
|
+
# The verification link sent to the user's email address is valid for 7 days.
|
|
1700
|
+
#
|
|
1666
1701
|
# Please note that in order to avoid a [Redirect
|
|
1667
1702
|
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
1668
1703
|
# the only valid redirect URLs are the ones from domains you have set when
|
|
1669
1704
|
# adding your platforms in the console interface.
|
|
1670
|
-
#
|
|
1705
|
+
#
|
|
1671
1706
|
#
|
|
1672
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.
|
|
1673
1708
|
#
|
|
1674
1709
|
# @return [Token]
|
|
1675
|
-
def create_verification(
|
|
1710
|
+
def create_verification(
|
|
1711
|
+
url:
|
|
1712
|
+
)
|
|
1676
1713
|
api_path = '/account/verifications/email'
|
|
1677
1714
|
|
|
1678
1715
|
if url.nil?
|
|
1679
|
-
|
|
1716
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
1680
1717
|
end
|
|
1681
1718
|
|
|
1682
1719
|
api_params = {
|
|
1683
1720
|
url: url,
|
|
1684
1721
|
}
|
|
1685
|
-
|
|
1722
|
+
|
|
1686
1723
|
api_headers = {
|
|
1687
1724
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1688
1725
|
"content-type": 'application/json',
|
|
@@ -1696,7 +1733,6 @@ module Appwrite
|
|
|
1696
1733
|
params: api_params,
|
|
1697
1734
|
response_type: Models::Token
|
|
1698
1735
|
)
|
|
1699
|
-
|
|
1700
1736
|
end
|
|
1701
1737
|
|
|
1702
1738
|
# Use this endpoint to complete the user email verification process. Use both
|
|
@@ -1708,22 +1744,25 @@ module Appwrite
|
|
|
1708
1744
|
# @param [String] secret Valid verification token.
|
|
1709
1745
|
#
|
|
1710
1746
|
# @return [Token]
|
|
1711
|
-
def update_email_verification(
|
|
1747
|
+
def update_email_verification(
|
|
1748
|
+
user_id:,
|
|
1749
|
+
secret:
|
|
1750
|
+
)
|
|
1712
1751
|
api_path = '/account/verifications/email'
|
|
1713
1752
|
|
|
1714
1753
|
if user_id.nil?
|
|
1715
|
-
|
|
1754
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1716
1755
|
end
|
|
1717
1756
|
|
|
1718
1757
|
if secret.nil?
|
|
1719
|
-
|
|
1758
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1720
1759
|
end
|
|
1721
1760
|
|
|
1722
1761
|
api_params = {
|
|
1723
1762
|
userId: user_id,
|
|
1724
1763
|
secret: secret,
|
|
1725
1764
|
}
|
|
1726
|
-
|
|
1765
|
+
|
|
1727
1766
|
api_headers = {
|
|
1728
1767
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1729
1768
|
"content-type": 'application/json',
|
|
@@ -1737,7 +1776,6 @@ module Appwrite
|
|
|
1737
1776
|
params: api_params,
|
|
1738
1777
|
response_type: Models::Token
|
|
1739
1778
|
)
|
|
1740
|
-
|
|
1741
1779
|
end
|
|
1742
1780
|
|
|
1743
1781
|
#
|
|
@@ -1752,22 +1790,25 @@ module Appwrite
|
|
|
1752
1790
|
# @param [String] secret Valid verification token.
|
|
1753
1791
|
#
|
|
1754
1792
|
# @return [Token]
|
|
1755
|
-
def update_verification(
|
|
1793
|
+
def update_verification(
|
|
1794
|
+
user_id:,
|
|
1795
|
+
secret:
|
|
1796
|
+
)
|
|
1756
1797
|
api_path = '/account/verifications/email'
|
|
1757
1798
|
|
|
1758
1799
|
if user_id.nil?
|
|
1759
|
-
|
|
1800
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1760
1801
|
end
|
|
1761
1802
|
|
|
1762
1803
|
if secret.nil?
|
|
1763
|
-
|
|
1804
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1764
1805
|
end
|
|
1765
1806
|
|
|
1766
1807
|
api_params = {
|
|
1767
1808
|
userId: user_id,
|
|
1768
1809
|
secret: secret,
|
|
1769
1810
|
}
|
|
1770
|
-
|
|
1811
|
+
|
|
1771
1812
|
api_headers = {
|
|
1772
1813
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1773
1814
|
"content-type": 'application/json',
|
|
@@ -1781,16 +1822,15 @@ module Appwrite
|
|
|
1781
1822
|
params: api_params,
|
|
1782
1823
|
response_type: Models::Token
|
|
1783
1824
|
)
|
|
1784
|
-
|
|
1785
1825
|
end
|
|
1786
1826
|
|
|
1787
1827
|
# Use this endpoint to send a verification SMS to the currently logged in
|
|
1788
|
-
# 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
|
|
1789
1829
|
# using the
|
|
1790
1830
|
# [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone)
|
|
1791
1831
|
# endpoint. Learn more about how to [complete the verification
|
|
1792
1832
|
# process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification).
|
|
1793
|
-
# The verification code sent to the user
|
|
1833
|
+
# The verification code sent to the user's phone number is valid for 15
|
|
1794
1834
|
# minutes.
|
|
1795
1835
|
#
|
|
1796
1836
|
#
|
|
@@ -1798,9 +1838,8 @@ module Appwrite
|
|
|
1798
1838
|
def create_phone_verification()
|
|
1799
1839
|
api_path = '/account/verifications/phone'
|
|
1800
1840
|
|
|
1801
|
-
api_params = {
|
|
1802
|
-
|
|
1803
|
-
|
|
1841
|
+
api_params = {}
|
|
1842
|
+
|
|
1804
1843
|
api_headers = {
|
|
1805
1844
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1806
1845
|
"content-type": 'application/json',
|
|
@@ -1814,11 +1853,10 @@ module Appwrite
|
|
|
1814
1853
|
params: api_params,
|
|
1815
1854
|
response_type: Models::Token
|
|
1816
1855
|
)
|
|
1817
|
-
|
|
1818
1856
|
end
|
|
1819
1857
|
|
|
1820
1858
|
# Use this endpoint to complete the user phone verification process. Use the
|
|
1821
|
-
# **userId** and **secret** that were sent to your user
|
|
1859
|
+
# **userId** and **secret** that were sent to your user's phone number to
|
|
1822
1860
|
# verify the user email ownership. If confirmed this route will return a 200
|
|
1823
1861
|
# status code.
|
|
1824
1862
|
#
|
|
@@ -1826,22 +1864,25 @@ module Appwrite
|
|
|
1826
1864
|
# @param [String] secret Valid verification token.
|
|
1827
1865
|
#
|
|
1828
1866
|
# @return [Token]
|
|
1829
|
-
def update_phone_verification(
|
|
1867
|
+
def update_phone_verification(
|
|
1868
|
+
user_id:,
|
|
1869
|
+
secret:
|
|
1870
|
+
)
|
|
1830
1871
|
api_path = '/account/verifications/phone'
|
|
1831
1872
|
|
|
1832
1873
|
if user_id.nil?
|
|
1833
|
-
|
|
1874
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1834
1875
|
end
|
|
1835
1876
|
|
|
1836
1877
|
if secret.nil?
|
|
1837
|
-
|
|
1878
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1838
1879
|
end
|
|
1839
1880
|
|
|
1840
1881
|
api_params = {
|
|
1841
1882
|
userId: user_id,
|
|
1842
1883
|
secret: secret,
|
|
1843
1884
|
}
|
|
1844
|
-
|
|
1885
|
+
|
|
1845
1886
|
api_headers = {
|
|
1846
1887
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
1847
1888
|
"content-type": 'application/json',
|
|
@@ -1855,8 +1896,6 @@ module Appwrite
|
|
|
1855
1896
|
params: api_params,
|
|
1856
1897
|
response_type: Models::Token
|
|
1857
1898
|
)
|
|
1858
|
-
|
|
1859
1899
|
end
|
|
1860
|
-
|
|
1861
|
-
end
|
|
1900
|
+
end
|
|
1862
1901
|
end
|