volcano-sdk 0.5.2
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 +7 -0
- data/LICENSE +203 -0
- data/README.md +758 -0
- data/lib/volcano/auth.rb +113 -0
- data/lib/volcano/auth_anonymous.rb +51 -0
- data/lib/volcano/auth_confirm_email.rb +19 -0
- data/lib/volcano/auth_email_change.rb +75 -0
- data/lib/volcano/auth_get_user.rb +110 -0
- data/lib/volcano/auth_hosted.rb +43 -0
- data/lib/volcano/auth_oauth.rb +102 -0
- data/lib/volcano/auth_oauth_api.rb +51 -0
- data/lib/volcano/auth_oauth_sign_in.rb +61 -0
- data/lib/volcano/auth_oauth_token.rb +51 -0
- data/lib/volcano/auth_refresh.rb +117 -0
- data/lib/volcano/auth_resend_confirmation.rb +19 -0
- data/lib/volcano/auth_reset_password.rb +23 -0
- data/lib/volcano/auth_reset_password_for_email.rb +19 -0
- data/lib/volcano/auth_sessions.rb +139 -0
- data/lib/volcano/auth_sign_up.rb +40 -0
- data/lib/volcano/auth_state.rb +148 -0
- data/lib/volcano/auth_update_user.rb +32 -0
- data/lib/volcano/client.rb +121 -0
- data/lib/volcano/connection_string.rb +85 -0
- data/lib/volcano/database.rb +243 -0
- data/lib/volcano/errors.rb +38 -0
- data/lib/volcano/function_resolution.rb +120 -0
- data/lib/volcano/function_response.rb +26 -0
- data/lib/volcano/functions.rb +136 -0
- data/lib/volcano/generated/lib/volcano-generated/api/anon_keys_api.rb +471 -0
- data/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb +739 -0
- data/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb +1798 -0
- data/lib/volcano/generated/lib/volcano-generated/api/authentication_api.rb +1523 -0
- data/lib/volcano/generated/lib/volcano-generated/api/database_backups_api.rb +791 -0
- data/lib/volcano/generated/lib/volcano-generated/api/database_branches_api.rb +665 -0
- data/lib/volcano/generated/lib/volcano-generated/api/database_queries_api.rb +905 -0
- data/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +819 -0
- data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +913 -0
- data/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb +1355 -0
- data/lib/volcano/generated/lib/volcano-generated/api/git_connections_api.rb +1012 -0
- data/lib/volcano/generated/lib/volcano-generated/api/locks_api.rb +480 -0
- data/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb +250 -0
- data/lib/volcano/generated/lib/volcano-generated/api/o_auth_authentication_api.rb +962 -0
- data/lib/volcano/generated/lib/volcano-generated/api/o_auth_configuration_api.rb +452 -0
- data/lib/volcano/generated/lib/volcano-generated/api/project_imports_api.rb +599 -0
- data/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb +1862 -0
- data/lib/volcano/generated/lib/volcano-generated/api/realtime_api.rb +222 -0
- data/lib/volcano/generated/lib/volcano-generated/api/service_keys_api.rb +402 -0
- data/lib/volcano/generated/lib/volcano-generated/api/storage_admin_api.rb +189 -0
- data/lib/volcano/generated/lib/volcano-generated/api/storage_buckets_api.rb +437 -0
- data/lib/volcano/generated/lib/volcano-generated/api/storage_objects_api.rb +857 -0
- data/lib/volcano/generated/lib/volcano-generated/api/storage_policies_api.rb +277 -0
- data/lib/volcano/generated/lib/volcano-generated/api/system_api.rb +79 -0
- data/lib/volcano/generated/lib/volcano-generated/api/variables_api.rb +454 -0
- data/lib/volcano/generated/lib/volcano-generated/api_client.rb +393 -0
- data/lib/volcano/generated/lib/volcano-generated/api_error.rb +58 -0
- data/lib/volcano/generated/lib/volcano-generated/api_model_base.rb +88 -0
- data/lib/volcano/generated/lib/volcano-generated/configuration.rb +337 -0
- data/lib/volcano/generated/lib/volcano-generated/models/anon_key.rb +257 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_config.rb +728 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_confirm_email200_response.rb +181 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_confirm_email_change200_response.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_confirm_email_change_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_confirm_email_request.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_convert_anonymous200_response.rb +147 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_device_authorize_request.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_device_token_request.rb +240 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_device_verify200_response.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_device_verify_request.rb +209 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_forgot_password200_response.rb +147 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_forgot_password_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_get_my_sessions200_response.rb +231 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_hosted_page.rb +225 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_hosted_page_defaults.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_hosted_page_response.rb +203 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_hosted_page_runtime.rb +220 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_identities_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_identity.rb +273 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_interval.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_response.rb +270 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_series_point.rb +263 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_summary.rb +210 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_window.rb +238 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_link_o_auth_provider200_response.rb +147 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_list_o_auth_providers200_response.rb +149 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_list_o_auth_providers200_response_providers_inner.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_method_summary.rb +370 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_methods_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_o_auth_exchange_request.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_appearance_defaults.rb +212 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_appearance_options.rb +306 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_appearance_response.rb +299 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_density.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_font.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_layout.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_radius.rb +42 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_scale.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_theme.rb +318 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_page_theme_colors.rb +323 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_password_policy.rb +409 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_platform_exchange_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_refresh_request.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_request_email_change200_response.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_request_email_change_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_reset_password200_response.rb +147 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_reset_password_request.rb +192 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_session.rb +393 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_signin_request.rb +233 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_signup_anonymous_request.rb +150 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_signup_request.rb +202 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_signup_response.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_token_response.rb +254 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_update_user_request.rb +160 -0
- data/lib/volcano/generated/lib/volcano-generated/models/auth_user.rb +330 -0
- data/lib/volcano/generated/lib/volcano-generated/models/ban_auth_user_request.rb +148 -0
- data/lib/volcano/generated/lib/volcano-generated/models/ban_user_response.rb +278 -0
- data/lib/volcano/generated/lib/volcano-generated/models/batch_function_deploy_failure.rb +242 -0
- data/lib/volcano/generated/lib/volcano-generated/models/batch_function_deploy_response.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/call_o_auth_provider_api200_response.rb +272 -0
- data/lib/volcano/generated/lib/volcano-generated/models/call_o_auth_provider_api_request.rb +223 -0
- data/lib/volcano/generated/lib/volcano-generated/models/complete_upload_session_response.rb +148 -0
- data/lib/volcano/generated/lib/volcano-generated/models/configure_auth_methods_request.rb +167 -0
- data/lib/volcano/generated/lib/volcano-generated/models/configure_auth_methods_request_oauth_providers_inner.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/connect_project_git_request.rb +250 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_anon_key_request.rb +228 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_database_backup_request.rb +185 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_database_branch_request.rb +223 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_database_request.rb +290 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_database_restore_request.rb +187 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_email_template_request.rb +270 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_frontend_custom_domain_request.rb +191 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_function_scheduler_request.rb +252 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_o_auth_config_request.rb +230 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_project_request.rb +219 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_service_key_request.rb +206 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_storage_bucket_request.rb +216 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_storage_policy_request.rb +243 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_upload_session_request.rb +276 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_upload_session_response.rb +179 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_variable_request.rb +219 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database.rb +442 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_backup.rb +283 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_backup_list.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_backup_schedule.rb +167 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_backup_schedule_entry.rb +301 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_branch.rb +480 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_branch_list.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_branch_storage.rb +228 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_delete_request.rb +203 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_insert_request.rb +194 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_filter.rb +242 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_filter_value.rb +106 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_filter_value_one_of_inner.rb +105 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_order.rb +187 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_performance_database.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_performance_item.rb +411 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_performance_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_query_result.rb +161 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_restore.rb +388 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_restore_list.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_restore_window.rb +159 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_select_request.rb +268 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_stats.rb +447 -0
- data/lib/volcano/generated/lib/volcano-generated/models/database_update_request.rb +232 -0
- data/lib/volcano/generated/lib/volcano-generated/models/delete_database202_response.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/delete_database_backup200_response.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/delete_database_branch202_response.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/deployment_phase.rb +263 -0
- data/lib/volcano/generated/lib/volcano-generated/models/deployment_progress.rb +324 -0
- data/lib/volcano/generated/lib/volcano-generated/models/deployment_reference.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/device_authorization_response.rb +296 -0
- data/lib/volcano/generated/lib/volcano-generated/models/email_template.rb +305 -0
- data/lib/volcano/generated/lib/volcano-generated/models/error.rb +174 -0
- data/lib/volcano/generated/lib/volcano-generated/models/export_project_source_request.rb +174 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend.rb +504 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_response.rb +370 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_tls_config.rb +253 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_deployment.rb +487 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_domain_routing_record.rb +240 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_domain_verification_record.rb +216 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_usage_daily_entry.rb +247 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_usage_data.rb +204 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_usage_history_response.rb +298 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function.rb +565 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_deployment.rb +477 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_http_auth_mode.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_invocation_mode.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_invocation_request.rb +150 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_region.rb +219 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_runtime_deployment.rb +250 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_runtime_option.rb +245 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_runtimes_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_scheduler.rb +330 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_scheduler_list_response.rb +290 -0
- data/lib/volcano/generated/lib/volcano-generated/models/get_auth_methods200_response.rb +178 -0
- data/lib/volcano/generated/lib/volcano-generated/models/get_auth_methods200_response_email_password.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/get_auth_methods200_response_oauth_providers_inner.rb +194 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_connect_start_response.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_connection.rb +346 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_connections_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_installation.rb +242 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_installations_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_repositories_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/git_repository.rb +270 -0
- data/lib/volcano/generated/lib/volcano-generated/models/hosted_auth_page_type.rb +44 -0
- data/lib/volcano/generated/lib/volcano-generated/models/hosted_login_email_check_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/hosted_login_email_check_response.rb +147 -0
- data/lib/volcano/generated/lib/volcano-generated/models/hosted_login_options_response.rb +185 -0
- data/lib/volcano/generated/lib/volcano-generated/models/hosted_renderable_page_type.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/import_connect_start_response.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/import_connection.rb +432 -0
- data/lib/volcano/generated/lib/volcano-generated/models/import_connections_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/import_provider.rb +39 -0
- data/lib/volcano/generated/lib/volcano-generated/models/import_source.rb +242 -0
- data/lib/volcano/generated/lib/volcano-generated/models/import_sources_response.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_anon_keys200_response.rb +189 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_available_o_auth_providers200_response.rb +149 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_available_o_auth_providers200_response_providers_inner.rb +167 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_database_regions200_response_inner.rb +158 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_email_templates200_response.rb +149 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_o_auth_configs200_response.rb +149 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_postgres_versions200_response_inner.rb +178 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_storage_buckets200_response.rb +104 -0
- data/lib/volcano/generated/lib/volcano-generated/models/list_storage_objects_admin200_response.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/live_log_level.rb +44 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_activity_bucket.rb +246 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_activity_bucket_counts.rb +226 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_activity_request.rb +252 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_activity_response.rb +194 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_database_request_resource.rb +221 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_deployment.rb +210 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_deployment_request_selector.rb +170 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_event.rb +257 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_event_body.rb +108 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_frontend_request_resource.rb +230 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_function_request_resource.rb +230 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_request_resource.rb +58 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_resource.rb +227 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_search_event.rb +297 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_search_request.rb +264 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_search_response.rb +232 -0
- data/lib/volcano/generated/lib/volcano-generated/models/log_stream_request.rb +244 -0
- data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +278 -0
- data/lib/volcano/generated/lib/volcano-generated/models/o_auth_config.rb +256 -0
- data/lib/volcano/generated/lib/volcano-generated/models/o_auth_error_response.rb +173 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_auth_users.rb +284 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_databases.rb +304 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_frontend_deployments.rb +284 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_frontends.rb +304 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_function_deployments.rb +284 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_functions.rb +304 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_project_custom_domains.rb +284 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_project_deployments.rb +306 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_projects.rb +368 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_service_keys.rb +304 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_storage_buckets.rb +251 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_variables.rb +304 -0
- data/lib/volcano/generated/lib/volcano-generated/models/platform_exchange_response.rb +242 -0
- data/lib/volcano/generated/lib/volcano-generated/models/preview_auth_page_request.rb +221 -0
- data/lib/volcano/generated/lib/volcano-generated/models/preview_auth_page_response.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project.rb +419 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +273 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_apply_result.rb +261 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_apply_result_entry.rb +245 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_apply_summary.rb +320 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth.rb +238 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_cors.rb +176 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_email.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_email_from.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_email_password_provider.rb +147 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_email_smtp.rb +184 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_email_verification.rb +158 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_managed_pages.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_page_appearance.rb +156 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_page_layouts.rb +214 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_password.rb +211 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_password_reset.rb +167 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_providers.rb +159 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_rate_limits.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_redirects.rb +180 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_sessions.rb +158 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_signup.rb +232 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_tokens.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_bucket.rb +226 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_bucket_policy.rb +250 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_custom_domain.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_database.rb +274 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_email_template.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_email_templates.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_frontend.rb +183 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_function.rb +248 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_hosted_page.rb +203 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_hosted_pages.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_missing_resource.rb +214 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_o_auth_provider.rb +238 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_project.rb +209 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_realtime.rb +174 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_scheduler.rb +229 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_skipped_resource.rb +240 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_validation_error.rb +201 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_validation_error_response.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_variable.rb +199 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_deployment.rb +412 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_deployment_resource.rb +241 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_deployment_summary.rb +312 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_frontend_custom_domain.rb +403 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_frontend_custom_domain_all_of_frontend.rb +191 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_git_connection.rb +296 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_git_connection_summary.rb +294 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_git_deploy_settings.rb +239 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_category.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_check.rb +316 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_data_status.rb +42 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_evidence.rb +251 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_resource.rb +240 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_response.rb +356 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_scope.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_status.rb +42 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_summary.rb +186 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_action.rb +238 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_action_code.rb +42 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_destination.rb +238 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_destination_mode.rb +39 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_disposition.rb +42 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_finding.rb +327 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_impact.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_preflight_request.rb +305 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_readiness.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_report.rb +476 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_resource.rb +270 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_resource_kind.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_run.rb +412 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_run_status.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_start_request.rb +365 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_summary.rb +348 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_import_target.rb +39 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_lock_lease.rb +192 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_lock_lease_request.rb +183 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_lock_state.rb +185 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_data_status.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_dimensions.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_group_by.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_metric.rb +42 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_query.rb +250 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_query_request.rb +210 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_query_response.rb +227 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_query_time_range.rb +188 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_result.rb +292 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_unit.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_value.rb +199 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_metrics_window.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_source_export.rb +302 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_source_export_omission.rb +218 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_source_export_skip.rb +217 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_source_export_state.rb +228 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_usage_response.rb +234 -0
- data/lib/volcano/generated/lib/volcano-generated/models/realtime_config.rb +217 -0
- data/lib/volcano/generated/lib/volcano-generated/models/realtime_plan_limits.rb +189 -0
- data/lib/volcano/generated/lib/volcano-generated/models/realtime_stats.rb +178 -0
- data/lib/volcano/generated/lib/volcano-generated/models/refresh_o_auth_provider_token200_response.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/reset_database_password200_response.rb +177 -0
- data/lib/volcano/generated/lib/volcano-generated/models/resolve_function_response.rb +248 -0
- data/lib/volcano/generated/lib/volcano-generated/models/resource_reference.rb +241 -0
- data/lib/volcano/generated/lib/volcano-generated/models/schedule_request.rb +210 -0
- data/lib/volcano/generated/lib/volcano-generated/models/service_key.rb +294 -0
- data/lib/volcano/generated/lib/volcano-generated/models/set_project_git_production_branch_request.rb +183 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_bucket.rb +282 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_copy_request.rb +192 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_list_response.rb +159 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_move_request.rb +192 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_object.rb +359 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_object_with_bucket.rb +383 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_policy.rb +313 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_stats.rb +220 -0
- data/lib/volcano/generated/lib/volcano-generated/models/storage_visibility_request.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/test_email_request.rb +234 -0
- data/lib/volcano/generated/lib/volcano-generated/models/test_email_response.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/unban_user_response.rb +267 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_auth_config_request.rb +626 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_auth_hosted_page_request.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_auth_page_layout_request.rb +186 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_auth_page_theme_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_database_branch_request.rb +184 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_database_type_request.rb +190 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_email_template_request.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_function_request.rb +201 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_function_scheduler_request.rb +225 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_o_auth_config_request.rb +187 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_project_git_deploy_settings_request.rb +211 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_project_request.rb +198 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_realtime_config_request.rb +179 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_storage_bucket_request.rb +158 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_variable_request.rb +164 -0
- data/lib/volcano/generated/lib/volcano-generated/models/upload_session_part.rb +169 -0
- data/lib/volcano/generated/lib/volcano-generated/models/upload_session_status_response.rb +295 -0
- data/lib/volcano/generated/lib/volcano-generated/models/upload_storage_object201_response.rb +104 -0
- data/lib/volcano/generated/lib/volcano-generated/models/usage_data_point.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/variable.rb +389 -0
- data/lib/volcano/generated/lib/volcano-generated/version.rb +15 -0
- data/lib/volcano/generated/lib/volcano-generated.rb +405 -0
- data/lib/volcano/generated_transport.rb +131 -0
- data/lib/volcano/generated_transport_anonymous.rb +34 -0
- data/lib/volcano/generated_transport_auth.rb +108 -0
- data/lib/volcano/generated_transport_confirmation.rb +30 -0
- data/lib/volcano/generated_transport_database.rb +54 -0
- data/lib/volcano/generated_transport_email_change.rb +44 -0
- data/lib/volcano/generated_transport_functions.rb +108 -0
- data/lib/volcano/generated_transport_logs.rb +31 -0
- data/lib/volcano/generated_transport_oauth.rb +64 -0
- data/lib/volcano/generated_transport_sessions.rb +27 -0
- data/lib/volcano/generated_transport_storage.rb +86 -0
- data/lib/volcano/generated_transport_support.rb +221 -0
- data/lib/volcano/generated_transport_upload_session_api.rb +69 -0
- data/lib/volcano/generated_transport_upload_sessions.rb +67 -0
- data/lib/volcano/lock_auto_renewal.rb +51 -0
- data/lib/volcano/lock_guard.rb +135 -0
- data/lib/volcano/lock_lease_clock.rb +39 -0
- data/lib/volcano/lock_renewer.rb +73 -0
- data/lib/volcano/lock_session.rb +70 -0
- data/lib/volcano/locks.rb +109 -0
- data/lib/volcano/log_responses.rb +39 -0
- data/lib/volcano/logs.rb +82 -0
- data/lib/volcano/models.rb +115 -0
- data/lib/volcano/realtime/blocking_call.rb +32 -0
- data/lib/volcano/realtime/broadcast_delivery.rb +63 -0
- data/lib/volcano/realtime/channel_callbacks.rb +127 -0
- data/lib/volcano/realtime/channel_lifecycle.rb +133 -0
- data/lib/volcano/realtime/connection.rb +114 -0
- data/lib/volcano/realtime/connection_callbacks.rb +126 -0
- data/lib/volcano/realtime/lifecycle.rb +46 -0
- data/lib/volcano/realtime/postgres_batch.rb +89 -0
- data/lib/volcano/realtime/postgres_changes.rb +107 -0
- data/lib/volcano/realtime/postgres_database.rb +63 -0
- data/lib/volcano/realtime/postgres_delivery.rb +113 -0
- data/lib/volcano/realtime/postgres_expansion.rb +66 -0
- data/lib/volcano/realtime/presence.rb +122 -0
- data/lib/volcano/realtime/presence_state.rb +61 -0
- data/lib/volcano/realtime/protocol.rb +150 -0
- data/lib/volcano/realtime/protocol_dispatch.rb +114 -0
- data/lib/volcano/realtime/protocol_io.rb +96 -0
- data/lib/volcano/realtime/protocol_lifecycle.rb +122 -0
- data/lib/volcano/realtime/protocol_publication_dispatch.rb +121 -0
- data/lib/volcano/realtime/protocol_recovery.rb +117 -0
- data/lib/volcano/realtime/protocol_recovery_dispatch.rb +106 -0
- data/lib/volcano/realtime/protocol_recovery_position.rb +95 -0
- data/lib/volcano/realtime/reconnect.rb +88 -0
- data/lib/volcano/realtime.rb +260 -0
- data/lib/volcano/redaction.rb +60 -0
- data/lib/volcano/sign_up_result.rb +9 -0
- data/lib/volcano/storage.rb +120 -0
- data/lib/volcano/storage_models.rb +121 -0
- data/lib/volcano/storage_mutations.rb +81 -0
- data/lib/volcano/storage_public_url.rb +64 -0
- data/lib/volcano/storage_resumable_upload.rb +90 -0
- data/lib/volcano/storage_upload_sessions.rb +116 -0
- data/lib/volcano/transport.rb +60 -0
- data/lib/volcano/version.rb +5 -0
- data/lib/volcano.rb +58 -0
- metadata +580 -0
data/README.md
ADDED
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
# Volcano Ruby SDK
|
|
2
|
+
|
|
3
|
+
Official Ruby SDK for Volcano. This repository is a private proof of concept;
|
|
4
|
+
the gem is not published yet.
|
|
5
|
+
|
|
6
|
+
## Proof-of-concept API
|
|
7
|
+
|
|
8
|
+
Create a client with the project URL and anonymous key from Volcano:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
require "volcano"
|
|
12
|
+
|
|
13
|
+
client = Volcano::Client.new(
|
|
14
|
+
api_url: "https://api.volcano.dev",
|
|
15
|
+
anon_key: ENV.fetch("VOLCANO_ANON_KEY"),
|
|
16
|
+
service_key: ENV["VOLCANO_SERVICE_KEY"]
|
|
17
|
+
)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The REST facade is synchronous. Successful calls return Volcano-owned values;
|
|
21
|
+
failures raise typed errors under `Volcano::Error`.
|
|
22
|
+
|
|
23
|
+
### Sign up
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
result = client.auth.sign_up(
|
|
27
|
+
email: "new-user@example.com",
|
|
28
|
+
password: "secret",
|
|
29
|
+
metadata: { display_name: "New User" }
|
|
30
|
+
)
|
|
31
|
+
puts result.message if result.confirmation_required
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`sign_up` returns an immutable acknowledgement without changing the session by
|
|
35
|
+
default. The signup acknowledgement is identical for new and existing email
|
|
36
|
+
addresses. Pass `sign_in_when_allowed: true` to follow it with `sign_in` only when
|
|
37
|
+
confirmation is not required:
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
result = client.auth.sign_up(email: "new-user@example.com", password: "secret", sign_in_when_allowed: true)
|
|
41
|
+
session = result.session # nil when no follow-up sign-in ran.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
A successful follow-up stores the session and emits the normal sign-in event.
|
|
45
|
+
A failed follow-up raises its usual typed error; it does not undo the successful signup.
|
|
46
|
+
|
|
47
|
+
### Sign in
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
session = client.auth.sign_in(email: "user@example.com", password: "secret")
|
|
51
|
+
current_session = client.auth.current_session
|
|
52
|
+
raise "session changed" unless current_session == session
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`current_session` reads immutable local state. It does not refresh or validate
|
|
56
|
+
the token.
|
|
57
|
+
|
|
58
|
+
### Get the current user
|
|
59
|
+
|
|
60
|
+
```ruby
|
|
61
|
+
user = client.auth.user
|
|
62
|
+
raise "wrong user" unless user.id == session.user_id
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`user` sends the active access token to Volcano and returns an immutable,
|
|
66
|
+
server-validated `Volcano::User`. The SDK recursively freezes its strings and
|
|
67
|
+
metadata, but does not cache the profile or replace the session. A session
|
|
68
|
+
change while the request is in flight raises
|
|
69
|
+
`Volcano::Error::SessionChangedError` instead of returning a stale profile.
|
|
70
|
+
`get_user` is available as a cross-SDK alias.
|
|
71
|
+
|
|
72
|
+
### Update the current user
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
user = client.auth.update_user(
|
|
76
|
+
password: "new-secret",
|
|
77
|
+
metadata: { display_name: "Grace", avatar: nil }
|
|
78
|
+
)
|
|
79
|
+
raise "wrong user" unless user.id == session.user_id
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`update_user` changes the current user's password, metadata, or both. Metadata
|
|
83
|
+
is a shallow patch: omitted keys remain unchanged, and a `nil` value removes
|
|
84
|
+
that key. The method returns an immutable `Volcano::User` without replacing the
|
|
85
|
+
active session. It rejects a response if another authentication operation
|
|
86
|
+
replaces the session while the request is in flight.
|
|
87
|
+
|
|
88
|
+
### Request a password reset email
|
|
89
|
+
|
|
90
|
+
```ruby
|
|
91
|
+
client.auth.reset_password_for_email(email: "user@example.com")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
When transactional email is configured, Volcano sends the reset link. Success
|
|
95
|
+
returns `nil`, and the acknowledgement is intentionally identical whether or
|
|
96
|
+
not the email belongs to an account. Failures raise the same typed Volcano
|
|
97
|
+
errors as other authentication operations, and the current session remains
|
|
98
|
+
unchanged.
|
|
99
|
+
|
|
100
|
+
### Confirm an email address
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
client.auth.confirm_email(token: "confirmation-token")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Success returns `nil`. Confirmation does not sign in the confirmed account or
|
|
107
|
+
change an unrelated local session.
|
|
108
|
+
|
|
109
|
+
### Resend a confirmation email
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
client.auth.resend_confirmation(email: "user@example.com")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Success returns `nil` whether the account is unknown, already confirmed, or
|
|
116
|
+
eligible. Volcano sends mail only for an existing unconfirmed account when
|
|
117
|
+
transactional email is configured. Rate limits raise
|
|
118
|
+
`Volcano::Error::RateLimitedError` with `retry_after` when supplied.
|
|
119
|
+
|
|
120
|
+
### Request an email change
|
|
121
|
+
|
|
122
|
+
```ruby
|
|
123
|
+
result = client.auth.request_email_change(new_email: "new@example.com")
|
|
124
|
+
puts result.new_email
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The immutable result contains the server acknowledgement. Its `message` and
|
|
128
|
+
`new_email` fields may be `nil`. The request requires an active session and
|
|
129
|
+
rejects a response if that session changes in flight.
|
|
130
|
+
|
|
131
|
+
### Cancel an email change
|
|
132
|
+
|
|
133
|
+
```ruby
|
|
134
|
+
client.auth.cancel_email_change
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Success returns `nil` and preserves the active session. A successful stale
|
|
138
|
+
response is rejected if another authentication operation replaces the session
|
|
139
|
+
while cancellation is in flight.
|
|
140
|
+
|
|
141
|
+
### Confirm an email change
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
user = client.auth.confirm_email_change(token: "email-change-token")
|
|
145
|
+
puts user.email
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The method returns the immutable updated user without replacing the active
|
|
149
|
+
session. A successful stale response is rejected if another authentication
|
|
150
|
+
operation replaces that session in flight.
|
|
151
|
+
|
|
152
|
+
### List sessions
|
|
153
|
+
|
|
154
|
+
```ruby
|
|
155
|
+
page = client.auth.list_sessions(page: 1, limit: 20)
|
|
156
|
+
page.sessions.each do |session|
|
|
157
|
+
puts [session.id, session.user_agent, session.is_current].join(' ')
|
|
158
|
+
end
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The method returns immutable `Volcano::SessionPage` and `Volcano::AuthSession`
|
|
162
|
+
values in activity order. It raises `Volcano::Error::SessionChangedError` instead
|
|
163
|
+
of returning a page for a session that was replaced while the request was in
|
|
164
|
+
flight. Sort, filter, and cursor controls are not yet exposed by this facade.
|
|
165
|
+
|
|
166
|
+
### Build a hosted-auth URL
|
|
167
|
+
|
|
168
|
+
```ruby
|
|
169
|
+
require 'securerandom'
|
|
170
|
+
|
|
171
|
+
hosted_state = SecureRandom.urlsafe_base64(32)
|
|
172
|
+
hosted_url = client.auth.get_hosted_auth_url(
|
|
173
|
+
project_id: '00000000-0000-4000-8000-000000000020',
|
|
174
|
+
action: 'signup',
|
|
175
|
+
state: hosted_state
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Store `hosted_state` in the user's signed server-side session before redirecting
|
|
180
|
+
to `hosted_url`. After parsing the returned fragment into a `Volcano::Session`,
|
|
181
|
+
validate and adopt it atomically:
|
|
182
|
+
|
|
183
|
+
```ruby
|
|
184
|
+
session = client.auth.adopt_hosted_auth_session(
|
|
185
|
+
returned_session,
|
|
186
|
+
state: returned_state,
|
|
187
|
+
expected_state: hosted_state
|
|
188
|
+
)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The SDK rejects a mismatched state before changing local authentication. It
|
|
192
|
+
does not parse browser URLs, navigate, or persist state.
|
|
193
|
+
|
|
194
|
+
The `action` deep link applies to Volcano's built-in page. A customized login
|
|
195
|
+
page receives the request but must implement its own signup or forgot-password
|
|
196
|
+
flow because Hosting ignores `action` for custom pages.
|
|
197
|
+
|
|
198
|
+
### Sign in with OAuth
|
|
199
|
+
|
|
200
|
+
```ruby
|
|
201
|
+
require 'securerandom'
|
|
202
|
+
|
|
203
|
+
oauth_state = SecureRandom.urlsafe_base64(32)
|
|
204
|
+
authorization_url = client.auth.sign_in_with_oauth(
|
|
205
|
+
'github',
|
|
206
|
+
redirect_to: 'https://app.example.com/auth/callback',
|
|
207
|
+
state: oauth_state
|
|
208
|
+
)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Store `oauth_state` in the user's signed server-side session, then redirect the
|
|
212
|
+
user to the returned URL. In the callback, pass the returned and stored states
|
|
213
|
+
to the SDK so it rejects login CSRF before exchanging the one-time code:
|
|
214
|
+
|
|
215
|
+
```ruby
|
|
216
|
+
session = client.auth.exchange_oauth_code(
|
|
217
|
+
code: callback_code,
|
|
218
|
+
redirect_to: 'https://app.example.com/auth/callback',
|
|
219
|
+
state: callback_state,
|
|
220
|
+
expected_state: stored_oauth_state
|
|
221
|
+
)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The callback URL must exactly match a registered project redirect. The exchange
|
|
225
|
+
stores the returned Volcano session on the client. The SDK does not open a
|
|
226
|
+
browser or persist OAuth state between requests; use your framework's signed
|
|
227
|
+
session or equivalent storage for that state.
|
|
228
|
+
|
|
229
|
+
### List linked OAuth providers
|
|
230
|
+
|
|
231
|
+
```ruby
|
|
232
|
+
client.auth.list_linked_oauth_providers.each do |provider|
|
|
233
|
+
puts [provider.provider, provider.linked_at].join(' ')
|
|
234
|
+
end
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
The method returns a frozen array of immutable `Volcano::LinkedOAuthProvider`
|
|
238
|
+
values. It raises `Volcano::Error::SessionChangedError` if the active session
|
|
239
|
+
changes while the request is in flight.
|
|
240
|
+
|
|
241
|
+
### Link an OAuth provider
|
|
242
|
+
|
|
243
|
+
```ruby
|
|
244
|
+
authorization_url = client.auth.link_oauth_provider('github')
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Redirect the user to the returned URL to complete the provider flow. The method
|
|
248
|
+
accepts `apple`, `github`, `google`, or `microsoft` and raises
|
|
249
|
+
`Volcano::Error::SessionChangedError` if the active session changes while the
|
|
250
|
+
request is in flight.
|
|
251
|
+
|
|
252
|
+
### Unlink an OAuth provider
|
|
253
|
+
|
|
254
|
+
```ruby
|
|
255
|
+
client.auth.unlink_oauth_provider('github')
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
The server rejects removal of the account's only authentication method. A
|
|
259
|
+
successful stale response raises `Volcano::Error::SessionChangedError` instead
|
|
260
|
+
of acknowledging work authorized by a replaced session.
|
|
261
|
+
|
|
262
|
+
### Check provider token status
|
|
263
|
+
|
|
264
|
+
```ruby
|
|
265
|
+
status = client.auth.get_oauth_provider_token('github')
|
|
266
|
+
puts [status.provider, status.expires_in].join(' ')
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
The immutable `Volcano::OAuthProviderTokenStatus` contains provider and expiry
|
|
270
|
+
metadata, not the credential. Volcano refreshes an expired token on the server.
|
|
271
|
+
A stale result raises `Volcano::Error::SessionChangedError`.
|
|
272
|
+
|
|
273
|
+
Refresh a provider token explicitly:
|
|
274
|
+
|
|
275
|
+
```ruby
|
|
276
|
+
status = client.auth.refresh_oauth_provider_token('github')
|
|
277
|
+
puts [status.provider, status.expires_in].join(' ')
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The refresh credential and new access token remain on the server. A stale result
|
|
281
|
+
raises `Volcano::Error::SessionChangedError`.
|
|
282
|
+
|
|
283
|
+
Call a provider API through Volcano's fixed-host server proxy:
|
|
284
|
+
|
|
285
|
+
```ruby
|
|
286
|
+
repos = client.auth.call_oauth_api('github', endpoint: '/user/repos')
|
|
287
|
+
puts repos.first.fetch('name')
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
The method returns an immutable copy of the provider's JSON value. Volcano owns
|
|
291
|
+
token refresh and host validation. A stale result raises
|
|
292
|
+
`Volcano::Error::SessionChangedError`.
|
|
293
|
+
|
|
294
|
+
### Sign out all other devices
|
|
295
|
+
|
|
296
|
+
```ruby
|
|
297
|
+
client.auth.delete_all_other_sessions
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Success returns `nil` and keeps the authorizing session active. Do not replace
|
|
301
|
+
the client's session while this request is in flight: the server may revoke that
|
|
302
|
+
replacement as an "other" session. If replacement occurs, the method raises
|
|
303
|
+
`Volcano::Error::SessionChangedError` instead of acknowledging a stale result.
|
|
304
|
+
|
|
305
|
+
### Revoke one session
|
|
306
|
+
|
|
307
|
+
```ruby
|
|
308
|
+
client.auth.delete_session('00000000-0000-4000-8000-000000000099')
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The request uses the current access token. Deleting that token's own session
|
|
312
|
+
clears local credentials, including when the request outcome is uncertain;
|
|
313
|
+
deleting another session preserves them. If another authentication operation
|
|
314
|
+
replaces the session before deletion finishes, the method raises
|
|
315
|
+
`Volcano::Error::SessionChangedError` instead of clearing the replacement or
|
|
316
|
+
acknowledging a stale result.
|
|
317
|
+
|
|
318
|
+
### Sign in anonymously
|
|
319
|
+
|
|
320
|
+
```ruby
|
|
321
|
+
session = client.auth.sign_in_anonymously(metadata: { device: "mobile" })
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Anonymous sign-ins must be enabled for the project. Convert the account before
|
|
325
|
+
signing out if the user needs to recover it later.
|
|
326
|
+
|
|
327
|
+
Attach email credentials without changing the anonymous user's ID or current
|
|
328
|
+
session:
|
|
329
|
+
|
|
330
|
+
```ruby
|
|
331
|
+
user = client.auth.convert_anonymous(
|
|
332
|
+
email: "user@example.com",
|
|
333
|
+
password: "secure-password",
|
|
334
|
+
metadata: { display_name: "Ada" }
|
|
335
|
+
)
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
When email confirmation is required, confirm the new address before treating it
|
|
339
|
+
as verified.
|
|
340
|
+
|
|
341
|
+
### Reset the password
|
|
342
|
+
|
|
343
|
+
```ruby
|
|
344
|
+
client.auth.reset_password(token: "recovery-token", new_password: "new-secret")
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Success returns `nil`. The reset revokes the recovered account's existing
|
|
348
|
+
sessions and does not sign it in. The client keeps any unrelated local session
|
|
349
|
+
unchanged; sign in with the new password when the reset flow completes.
|
|
350
|
+
|
|
351
|
+
### Adopt an existing session
|
|
352
|
+
|
|
353
|
+
```ruby
|
|
354
|
+
session = source.auth.current_session
|
|
355
|
+
fresh.auth.current_session = session if session
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
The writer copies and freezes a complete native session in memory only. It does
|
|
359
|
+
not make a request, persist credentials, or notify auth-state subscribers. It
|
|
360
|
+
raises `ArgumentError` for an incomplete value.
|
|
361
|
+
|
|
362
|
+
Password sign-in raises `Volcano::Error::SessionChangedError` if local session
|
|
363
|
+
state changes while the request is in flight. The late response does not replace
|
|
364
|
+
the newer state or emit a sign-in notification.
|
|
365
|
+
|
|
366
|
+
### Refresh the current session
|
|
367
|
+
|
|
368
|
+
```ruby
|
|
369
|
+
refreshed = client.auth.refresh_session
|
|
370
|
+
raise "refresh failed" unless client.auth.current_session.equal?(refreshed)
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
On success, `refresh_session` replaces the in-memory session and returns the
|
|
374
|
+
immutable new snapshot. An authentication failure clears the session that
|
|
375
|
+
initiated the request. Server and transport failures preserve it, and a late
|
|
376
|
+
response never replaces a newer session. The SDK does not persist sessions.
|
|
377
|
+
|
|
378
|
+
### Observe auth-state changes
|
|
379
|
+
|
|
380
|
+
```ruby
|
|
381
|
+
subscription = client.auth.on_auth_state_change do |event, session|
|
|
382
|
+
puts "#{event}: #{session ? 'authenticated' : 'anonymous'}"
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# Later, stop receiving events.
|
|
386
|
+
subscription.unsubscribe
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
Registration immediately yields `:initial_session`. Successful session
|
|
390
|
+
creation, refresh, and local clearing yield `:signed_in`, `:token_refreshed`,
|
|
391
|
+
and `:signed_out`. Callbacks are delivered locally in transition order after the
|
|
392
|
+
state lock is released, and callback failures cannot interrupt auth operations.
|
|
393
|
+
The SDK does not broadcast between processes or persist sessions.
|
|
394
|
+
|
|
395
|
+
### Sign out the current session
|
|
396
|
+
|
|
397
|
+
```ruby
|
|
398
|
+
client.auth.sign_out
|
|
399
|
+
raise "still signed in" if client.auth.current_session
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`sign_out` revokes the current refresh token and clears the captured in-memory
|
|
403
|
+
session. It succeeds without a request when no session exists. If revocation
|
|
404
|
+
fails, the SDK still clears that session and raises the typed error. A session
|
|
405
|
+
established while sign-out is pending remains current.
|
|
406
|
+
|
|
407
|
+
### Invoke a function
|
|
408
|
+
|
|
409
|
+
```ruby
|
|
410
|
+
result = client.functions.invoke(
|
|
411
|
+
"send-welcome",
|
|
412
|
+
{ user_id: session.user_id }
|
|
413
|
+
)
|
|
414
|
+
puts [result.status, result.version, result.data]
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
`invoke` resolves a DNS-safe function name and sends a JSON object. It uses the
|
|
418
|
+
active user session when present, then a configured service key, then the
|
|
419
|
+
anonymous key. An anonymous key can invoke a public function without a user
|
|
420
|
+
session; the function receives no user identity. The immutable result includes
|
|
421
|
+
the response body, status, headers, and `X-Volcano-Version`. The body can be a
|
|
422
|
+
JSON object, array, scalar, or text; an empty body returns `nil`. Values are
|
|
423
|
+
deeply frozen. Invalid JSON or JSON that cannot decode to valid UTF-8 is
|
|
424
|
+
returned as the original decoded response text; malformed Unicode is not repaired.
|
|
425
|
+
Ruby's standard JSON nesting limit (100) also falls back to text.
|
|
426
|
+
A function's own
|
|
427
|
+
non-2xx response is returned when the version header proves it ran; platform
|
|
428
|
+
failures raise typed SDK errors.
|
|
429
|
+
|
|
430
|
+
### Read project logs
|
|
431
|
+
|
|
432
|
+
```ruby
|
|
433
|
+
project_id = "00000000-0000-4000-8000-000000000001"
|
|
434
|
+
page = client.logs.search(
|
|
435
|
+
project_id,
|
|
436
|
+
{ resource: { type: "function" }, limit: 100 }
|
|
437
|
+
)
|
|
438
|
+
page.data.each { |event| puts [event["timestamp"], event["body"]] }
|
|
439
|
+
|
|
440
|
+
activity = client.logs.activity(
|
|
441
|
+
project_id,
|
|
442
|
+
{ resource: { type: "function" }, bucket_count: 24 }
|
|
443
|
+
)
|
|
444
|
+
puts activity.total
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
`search` returns an immutable page of retained runtime or deployment log
|
|
448
|
+
events. Pass `next_cursor` back as `cursor` to continue a search. `activity`
|
|
449
|
+
returns immutable time buckets using the same resource selector and query
|
|
450
|
+
syntax. Both methods require an active user session.
|
|
451
|
+
|
|
452
|
+
### Query a database
|
|
453
|
+
|
|
454
|
+
```ruby
|
|
455
|
+
rows = client.database("main").from("items").select("*").eq("slug", "a").execute
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Database selects, inserts, updates, deletes, and log reads refresh the captured
|
|
459
|
+
session after an HTTP 401 and retry the same request once. Concurrent requests reuse a successful
|
|
460
|
+
refresh for that session.
|
|
461
|
+
Replacing or signing out the session before replay, or while replay is in flight,
|
|
462
|
+
raises `SessionChangedError`. Requests do not wait for auth callbacks running on
|
|
463
|
+
another thread. A later callback-driven session change does not invalidate a
|
|
464
|
+
completed request.
|
|
465
|
+
A failed refresh preserves the original request error. HTTP 403 responses and
|
|
466
|
+
network failures do not trigger this retry. Mutations are replayed only after an
|
|
467
|
+
explicit authentication rejection, never after an ambiguous transport failure.
|
|
468
|
+
Realtime's fixed-token row reads do not refresh the session.
|
|
469
|
+
|
|
470
|
+
Database builders are immutable, so a base query can be reused safely. Chain
|
|
471
|
+
`neq`, `gt`, `gte`, `lt`, and `lte` for comparison filters:
|
|
472
|
+
|
|
473
|
+
```ruby
|
|
474
|
+
base_query = client.database("main").from("items").select("id", "priority")
|
|
475
|
+
rows = base_query
|
|
476
|
+
.gte("priority", 3)
|
|
477
|
+
.lt("priority", 10)
|
|
478
|
+
.order("priority", ascending: false)
|
|
479
|
+
.order("id")
|
|
480
|
+
.limit(10)
|
|
481
|
+
.offset(20)
|
|
482
|
+
.execute
|
|
483
|
+
|
|
484
|
+
matching_rows = client.database("main")
|
|
485
|
+
.from("items")
|
|
486
|
+
.select("*")
|
|
487
|
+
.ilike("name", "%volcano%")
|
|
488
|
+
.is("deleted_at", nil)
|
|
489
|
+
.in("status", %w[draft published])
|
|
490
|
+
.execute
|
|
491
|
+
|
|
492
|
+
inserted_rows = client.database("main")
|
|
493
|
+
.from("items")
|
|
494
|
+
.insert(name: "Volcano", status: "draft")
|
|
495
|
+
.execute
|
|
496
|
+
|
|
497
|
+
updated_rows = client.database("main")
|
|
498
|
+
.from("items")
|
|
499
|
+
.update(status: "published")
|
|
500
|
+
.eq("name", "Volcano")
|
|
501
|
+
.execute
|
|
502
|
+
|
|
503
|
+
deleted_rows = client.database("main")
|
|
504
|
+
.from("items")
|
|
505
|
+
.delete
|
|
506
|
+
.eq("name", "Volcano")
|
|
507
|
+
.execute
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
Updates and deletes require at least one filter; Volcano rejects filterless mutations.
|
|
511
|
+
|
|
512
|
+
Use `database_connection_string` inside a Volcano function to select database
|
|
513
|
+
access without changing the advertised `DATABASE_URL` target:
|
|
514
|
+
|
|
515
|
+
```ruby
|
|
516
|
+
connection_string = Volcano.database_connection_string(
|
|
517
|
+
ENV.fetch("DATABASE_URL"),
|
|
518
|
+
user_id: event.dig("__volcano_auth", "user_id")
|
|
519
|
+
)
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Pass a user ID to enforce that user's Row-Level Security policies. Omit
|
|
523
|
+
`user_id:` for full service access.
|
|
524
|
+
The helper preserves libpq connection syntax, including hostless and multi-host
|
|
525
|
+
targets, and leaves unrelated query values unchanged.
|
|
526
|
+
|
|
527
|
+
### Upload, download, and list objects
|
|
528
|
+
|
|
529
|
+
```ruby
|
|
530
|
+
bucket = client.storage.from("assets")
|
|
531
|
+
bucket.upload("a.txt", "hello".b, content_type: "text/plain; charset=utf-8")
|
|
532
|
+
bytes = bucket.download("a.txt")
|
|
533
|
+
first_kibibyte = bucket.download("archive.bin", range: "bytes=0-1023")
|
|
534
|
+
video = "demo video".b
|
|
535
|
+
uploaded = bucket.upload_resumable(
|
|
536
|
+
"videos/automatic.mp4",
|
|
537
|
+
video,
|
|
538
|
+
content_type: "video/mp4",
|
|
539
|
+
on_progress: ->(uploaded_bytes, total_bytes) { puts "#{uploaded_bytes}/#{total_bytes}" }
|
|
540
|
+
)
|
|
541
|
+
puts uploaded.name
|
|
542
|
+
upload_session = bucket.create_upload_session(
|
|
543
|
+
"videos/demo.mp4",
|
|
544
|
+
total_size: video.bytesize,
|
|
545
|
+
content_type: "video/mp4",
|
|
546
|
+
part_size: 8_388_608
|
|
547
|
+
)
|
|
548
|
+
puts [upload_session.session_id, upload_session.total_parts]
|
|
549
|
+
part = bucket.upload_part(
|
|
550
|
+
"videos/demo.mp4",
|
|
551
|
+
session_id: upload_session.session_id,
|
|
552
|
+
part_number: 1,
|
|
553
|
+
data: video
|
|
554
|
+
)
|
|
555
|
+
puts part.etag
|
|
556
|
+
status = bucket.get_upload_session(
|
|
557
|
+
"videos/demo.mp4",
|
|
558
|
+
session_id: upload_session.session_id
|
|
559
|
+
)
|
|
560
|
+
puts [status.parts_uploaded, status.bytes_uploaded]
|
|
561
|
+
completed = bucket.complete_upload_session(
|
|
562
|
+
"videos/demo.mp4",
|
|
563
|
+
session_id: upload_session.session_id
|
|
564
|
+
)
|
|
565
|
+
puts completed.name
|
|
566
|
+
|
|
567
|
+
page = bucket.list("avatars", limit: 100)
|
|
568
|
+
page.objects.each { |object| puts object.name }
|
|
569
|
+
|
|
570
|
+
next_page = bucket.list("avatars", limit: 100, cursor: page.next_cursor) if page.next_cursor
|
|
571
|
+
|
|
572
|
+
removed_paths = bucket.remove(["archive/a.txt", "archive/b.txt"])
|
|
573
|
+
moved = bucket.move("drafts/a.txt", "published/a.txt")
|
|
574
|
+
copied = bucket.copy("templates/a.txt", "drafts/a.txt")
|
|
575
|
+
public_object = bucket.update_visibility("avatars/a.png", public: true)
|
|
576
|
+
puts public_object.public_url
|
|
577
|
+
public_url = bucket.get_public_url("avatars/a.png")
|
|
578
|
+
puts public_url
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
Simple uploads accept an optional `content_type:` for the multipart file part.
|
|
582
|
+
Omit it or pass `nil` to retain the transport's filename-based MIME detection and
|
|
583
|
+
`application/octet-stream` fallback. Explicit values must be non-blank printable
|
|
584
|
+
ASCII; MIME parameters such as `charset=utf-8` are allowed.
|
|
585
|
+
|
|
586
|
+
Uploads accept a binary `String` or an `IO`. Downloads return a binary
|
|
587
|
+
`String`. Listing returns immutable object metadata and an optional cursor for
|
|
588
|
+
the next page. Removals run in input order; a failed request raises after any
|
|
589
|
+
earlier paths have already been deleted.
|
|
590
|
+
Pass an HTTP byte range to download only part of an object.
|
|
591
|
+
`create_upload_session` returns the immutable server-selected part size, part
|
|
592
|
+
count, and expiration time for a resumable upload.
|
|
593
|
+
`upload_resumable` creates a session, chunks the data using the server-selected
|
|
594
|
+
part size, and completes the upload. It streams seekable `IO` values directly;
|
|
595
|
+
non-seekable inputs are spooled to a temporary file with bounded reads. If a
|
|
596
|
+
part or progress callback fails, it makes a best-effort abort and raises the
|
|
597
|
+
original error. `on_progress` runs after each successful part with cumulative
|
|
598
|
+
uploaded bytes and the total size.
|
|
599
|
+
`upload_part` returns immutable part metadata and can safely retry the same part
|
|
600
|
+
number to replace that part.
|
|
601
|
+
`get_upload_session` returns immutable progress and uploaded-part metadata for
|
|
602
|
+
resuming an interrupted upload.
|
|
603
|
+
`complete_upload_session` assembles the uploaded parts and returns the stored
|
|
604
|
+
object.
|
|
605
|
+
`abort_upload_session(path, session_id: ...)` abandons a session and discards
|
|
606
|
+
its uploaded parts.
|
|
607
|
+
Visibility updates return the server-confirmed object; `public_url` is set only
|
|
608
|
+
when the object is public.
|
|
609
|
+
`get_public_url` constructs a URL locally and does not check object visibility.
|
|
610
|
+
|
|
611
|
+
### Inspect, acquire, and release a lock
|
|
612
|
+
|
|
613
|
+
```ruby
|
|
614
|
+
state = client.locks.get("build")
|
|
615
|
+
puts state.held
|
|
616
|
+
lease = client.locks.acquire("build", ttl: 30)
|
|
617
|
+
lease = client.locks.renew("build", lease, ttl: 30)
|
|
618
|
+
client.locks.release("build", lease)
|
|
619
|
+
client.locks.force_release("stale-build")
|
|
620
|
+
|
|
621
|
+
client.locks.with_lock("deploy", ttl: 30) do |guard|
|
|
622
|
+
deploy(fencing_token: guard.lease.fencing_token)
|
|
623
|
+
raise "lock lost" if guard.lost?
|
|
624
|
+
end
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
`locks.get` returns immutable lock availability, expiry, and fencing-token
|
|
628
|
+
state without acquiring the lock.
|
|
629
|
+
`locks.renew` returns a new immutable lease and leaves the previous value
|
|
630
|
+
unchanged.
|
|
631
|
+
`locks.with_lock` renews the lease for the lifetime of the block and always
|
|
632
|
+
attempts to release its latest lease. The guard exposes the latest immutable
|
|
633
|
+
lease, `lost?`, and `wait_lost(timeout:)`. Use the fencing token for protected
|
|
634
|
+
writes; stop work when the guard reports lease loss.
|
|
635
|
+
`locks.force_release` drops any current lease without an ownership token. Use
|
|
636
|
+
it only for administrative recovery behind fencing-token enforcement.
|
|
637
|
+
|
|
638
|
+
### Broadcast over realtime
|
|
639
|
+
|
|
640
|
+
Realtime calls are asynchronous and must run in an Async reactor:
|
|
641
|
+
|
|
642
|
+
```ruby
|
|
643
|
+
Async do
|
|
644
|
+
stop_connect = client.realtime.on_connect do |context|
|
|
645
|
+
puts "connected #{context.client}"
|
|
646
|
+
end
|
|
647
|
+
client.realtime.on_disconnect do |context|
|
|
648
|
+
puts "disconnected #{context.reason}"
|
|
649
|
+
end
|
|
650
|
+
client.realtime.on_error { |context| warn context.message }
|
|
651
|
+
|
|
652
|
+
channel = client.realtime.channel("deployments")
|
|
653
|
+
raise "unexpected channel" unless channel.name == "broadcast:deployments"
|
|
654
|
+
channel.on("message") { |message| puts message.fetch("value") }
|
|
655
|
+
channel.subscribe
|
|
656
|
+
raise "not connected" unless client.realtime.connected?
|
|
657
|
+
channel.send(event: "message", value: "contract")
|
|
658
|
+
client.realtime.remove_channel("deployments")
|
|
659
|
+
raise "disconnected" unless client.realtime.connected?
|
|
660
|
+
client.realtime.disconnect
|
|
661
|
+
raise "still connected" if client.realtime.connected?
|
|
662
|
+
stop_connect.call
|
|
663
|
+
end.wait
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
`channel.unsubscribe` waits for the server acknowledgement and pauses delivery.
|
|
667
|
+
Call `channel.subscribe` on the same channel to resume, then send as usual.
|
|
668
|
+
These commands complete even when the connection is otherwise idle.
|
|
669
|
+
|
|
670
|
+
### Track presence
|
|
671
|
+
|
|
672
|
+
Presence identity and metadata come from the authenticated user. `track` keeps
|
|
673
|
+
optional application state locally without replacing that server-managed data:
|
|
674
|
+
|
|
675
|
+
```ruby
|
|
676
|
+
Async do
|
|
677
|
+
lobby = client.realtime.channel("lobby", type: :presence)
|
|
678
|
+
lobby.on_presence_sync do |state|
|
|
679
|
+
puts "#{state.length} clients online"
|
|
680
|
+
end
|
|
681
|
+
lobby.on("join") { |info| puts "joined #{info.user}" }
|
|
682
|
+
lobby.on("leave") { |info| puts "left #{info.user}" }
|
|
683
|
+
|
|
684
|
+
lobby.subscribe
|
|
685
|
+
lobby.track("status" => "online")
|
|
686
|
+
puts lobby.tracked_state.fetch("status")
|
|
687
|
+
lobby.presence_state.each_value { |info| puts info.data }
|
|
688
|
+
lobby.unsubscribe
|
|
689
|
+
client.realtime.disconnect
|
|
690
|
+
end.wait
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
`presence_state` returns an immutable snapshot keyed by Centrifuge client ID.
|
|
694
|
+
`get_presence_state` is an equivalent cross-SDK alias. Subscribe again to fetch
|
|
695
|
+
a fresh authoritative snapshot.
|
|
696
|
+
|
|
697
|
+
### Subscribe to Postgres changes
|
|
698
|
+
|
|
699
|
+
Postgres channels deliver immutable, RLS-scoped row changes and filter
|
|
700
|
+
callbacks by event, schema, and table. Configure the database once to expand
|
|
701
|
+
lightweight INSERT and UPDATE notifications into full rows before delivery:
|
|
702
|
+
|
|
703
|
+
```ruby
|
|
704
|
+
require "async/queue"
|
|
705
|
+
|
|
706
|
+
Async do
|
|
707
|
+
received = Async::Queue.new
|
|
708
|
+
client.realtime.database_name = "app"
|
|
709
|
+
changes = client.realtime.channel("public:messages", type: :postgres)
|
|
710
|
+
changes.on_postgres_changes("INSERT", schema: "public", table: "messages") do |change|
|
|
711
|
+
received.enqueue(change)
|
|
712
|
+
end
|
|
713
|
+
changes.subscribe
|
|
714
|
+
|
|
715
|
+
change = received.dequeue # Wait for an INSERT from another client.
|
|
716
|
+
puts change.record.fetch("body")
|
|
717
|
+
client.realtime.disconnect
|
|
718
|
+
end.wait
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
Auto-fetch is enabled by default and uses the authenticated session captured
|
|
722
|
+
for the subscription. Lookups for the same table that arrive within 20
|
|
723
|
+
milliseconds are grouped into one request, up to 50 rows. Deliveries remain
|
|
724
|
+
ordered, including repeated notifications for the same row. DELETE notifications
|
|
725
|
+
are expanded locally from `old_record` or `id`. If a lookup fails, the error
|
|
726
|
+
callback runs and the original lightweight change is delivered. Use
|
|
727
|
+
`auto_fetch: false` when creating the channel to receive lightweight
|
|
728
|
+
notifications without database requests. Set `fetch_batch_window_ms:` and
|
|
729
|
+
`fetch_max_batch_size:` on the channel to override the batching defaults. Both
|
|
730
|
+
values must be positive integers, and the maximum batch size cannot exceed 128.
|
|
731
|
+
|
|
732
|
+
`remove_channel` unsubscribes and forgets one channel. `remove_all_channels`
|
|
733
|
+
does the same for every managed channel without disconnecting the shared
|
|
734
|
+
realtime transport, so later calls to `channel` return fresh facades. Pass the
|
|
735
|
+
same `type:` to `remove_channel` for every non-broadcast channel. Unexpected
|
|
736
|
+
transport loss reconnects with bounded exponential backoff and restores active
|
|
737
|
+
subscriptions. Broadcast channels recover retained publications only for this
|
|
738
|
+
client lifetime and the same authenticated-user lineage. Recovery state is not
|
|
739
|
+
persisted across processes. Postgres channels do not recover missed
|
|
740
|
+
publications yet; presence channels rebuild their current snapshot.
|
|
741
|
+
Connection callbacks receive immutable contexts and run outside protocol
|
|
742
|
+
processing. Each registration returns an idempotent callable that stops future
|
|
743
|
+
delivery.
|
|
744
|
+
|
|
745
|
+
## Generated boundary
|
|
746
|
+
|
|
747
|
+
The internal REST transport is generated from `openapi/openapi.yaml`, which
|
|
748
|
+
matches the public bundle from [Hosting #991](https://github.com/Kong/volcano-hosting/pull/991)
|
|
749
|
+
at commit `ef03f689e`.
|
|
750
|
+
Its SHA-256 is `076d97809c95f50567d8b100f4188c1fe2b74e73a388e335c79850e66edfc0e4`.
|
|
751
|
+
Generation uses `@openapitools/openapi-generator-cli` 2.41.0 with OpenAPI
|
|
752
|
+
Generator 7.17.0. Node is used only to regenerate the committed client and is
|
|
753
|
+
not a gem runtime dependency.
|
|
754
|
+
|
|
755
|
+
Run `npm ci && bin/check-openapi` to verify generated provenance. Use
|
|
756
|
+
`bundle exec rubocop -A` to apply safe formatting and lint fixes. Before
|
|
757
|
+
changing the facade, run `bundle exec rubocop --parallel`, `bundle exec rspec`,
|
|
758
|
+
and the shared Cucumber contract suite.
|