diff --git a/services/commtest/tests/identity_device_list_tests.rs b/services/commtest/tests/identity_device_list_tests.rs index bed24adfc..fb22862a2 100644 --- a/services/commtest/tests/identity_device_list_tests.rs +++ b/services/commtest/tests/identity_device_list_tests.rs @@ -1,290 +1,352 @@ +use std::collections::{HashMap, HashSet}; use std::str::FromStr; use commtest::identity::device::{ login_user_device, logout_user_device, register_user_device, DEVICE_TYPE, PLACEHOLDER_CODE_VERSION, }; use commtest::service_addr; use grpc_clients::identity::authenticated::ChainedInterceptedAuthClient; use grpc_clients::identity::get_auth_client; -use grpc_clients::identity::protos::auth::UpdateDeviceListRequest; +use grpc_clients::identity::protos::auth::{ + PeersDeviceListsRequest, UpdateDeviceListRequest, +}; use grpc_clients::identity::protos::authenticated::GetDeviceListRequest; use grpc_clients::identity::DeviceType; use serde::Deserialize; use serde_json::json; // 1. register user with android device // 2. register a web device // 3. remove android device // 4. register ios device // 5. get device list - should have 4 updates: // - [android] // - [android, web] // - [web] // - [ios, web] - mobile should be first #[tokio::test] async fn test_device_list_rotation() { use commtest::identity::olm_account_infos::{ DEFAULT_CLIENT_KEYS as DEVICE_KEYS_ANDROID, MOCK_CLIENT_KEYS_1 as DEVICE_KEYS_WEB, MOCK_CLIENT_KEYS_2 as DEVICE_KEYS_IOS, }; // Create viewer (user that doesn't change devices) let viewer = register_user_device(None, None).await; let mut auth_client = get_auth_client( &service_addr::IDENTITY_GRPC.to_string(), viewer.user_id.clone(), viewer.device_id, viewer.access_token, PLACEHOLDER_CODE_VERSION, DEVICE_TYPE.to_string(), ) .await .expect("Couldn't connect to identity service"); let android_device_id = &DEVICE_KEYS_ANDROID.primary_identity_public_keys.ed25519; let web_device_id = &DEVICE_KEYS_WEB.primary_identity_public_keys.ed25519; let ios_device_id = &DEVICE_KEYS_IOS.primary_identity_public_keys.ed25519; // 1. Register user with primary Android device let android = register_user_device(Some(&DEVICE_KEYS_ANDROID), Some(DeviceType::Android)) .await; let user_id = android.user_id.clone(); let username = android.username.clone(); // 2. Log in a web device let _web = login_user_device( &username, Some(&DEVICE_KEYS_WEB), Some(DeviceType::Web), false, ) .await; // 3. Remove android device logout_user_device(android).await; // 4. Log in an iOS device let _ios = login_user_device( &username, Some(&DEVICE_KEYS_IOS), Some(DeviceType::Ios), false, ) .await; // Get device list updates for the user let device_lists_response: Vec> = get_device_list_history(&mut auth_client, &user_id) .await .into_iter() .map(|device_list| device_list.devices) .collect(); let expected_device_list: Vec> = vec![ vec![android_device_id.into()], vec![android_device_id.into(), web_device_id.into()], vec![web_device_id.into()], vec![ios_device_id.into(), web_device_id.into()], ]; assert_eq!(device_lists_response, expected_device_list); } #[tokio::test] async fn test_update_device_list_rpc() { // Register user with primary device let primary_device = register_user_device(None, None).await; let mut auth_client = get_auth_client( &service_addr::IDENTITY_GRPC.to_string(), primary_device.user_id.clone(), primary_device.device_id, primary_device.access_token, PLACEHOLDER_CODE_VERSION, DEVICE_TYPE.to_string(), ) .await .expect("Couldn't connect to identity service"); // Initial device list check let initial_device_list = get_device_list_history(&mut auth_client, &primary_device.user_id) .await .into_iter() .map(|device_list| device_list.devices) .next() .expect("Expected to get single device list update"); assert!(initial_device_list.len() == 1, "Expected single device"); let primary_device_id = initial_device_list[0].clone(); // perform update by adding a new device let raw_update_payload = json!({ "devices": [primary_device_id, "device2"], "timestamp": 123456789, }); let update_payload = json!({ "rawDeviceList": serde_json::to_string(&raw_update_payload).unwrap(), }); let update_request = UpdateDeviceListRequest { new_device_list: serde_json::to_string(&update_payload) .expect("failed to serialize payload"), }; auth_client .update_device_list(update_request) .await .expect("Update device list RPC failed"); // get device list again let last_device_list = get_device_list_history(&mut auth_client, &primary_device.user_id).await; let last_device_list = last_device_list .last() .expect("Failed to get last device list update"); // check that the device list is properly updated assert_eq!( last_device_list.devices, vec![primary_device_id, "device2".into()] ); } #[tokio::test] async fn test_keyserver_force_login() { use commtest::identity::olm_account_infos::{ DEFAULT_CLIENT_KEYS as DEVICE_KEYS_ANDROID, MOCK_CLIENT_KEYS_1 as DEVICE_KEYS_KEYSERVER_1, MOCK_CLIENT_KEYS_2 as DEVICE_KEYS_KEYSERVER_2, }; // Create viewer (user that doesn't change devices) let viewer = register_user_device(None, None).await; let mut auth_client = get_auth_client( &service_addr::IDENTITY_GRPC.to_string(), viewer.user_id.clone(), viewer.device_id, viewer.access_token, PLACEHOLDER_CODE_VERSION, DEVICE_TYPE.to_string(), ) .await .expect("Couldn't connect to identity service"); let android_device_id = &DEVICE_KEYS_ANDROID.primary_identity_public_keys.ed25519; let keyserver_1_device_id = &DEVICE_KEYS_KEYSERVER_1.primary_identity_public_keys.ed25519; let keyserver_2_device_id = &DEVICE_KEYS_KEYSERVER_2.primary_identity_public_keys.ed25519; // 1. Register user with primary Android device let android = register_user_device(Some(&DEVICE_KEYS_ANDROID), Some(DeviceType::Android)) .await; let user_id = android.user_id.clone(); let username = android.username.clone(); // 2. Log in on keyserver 1 let _keyserver_1 = login_user_device( &username, Some(&DEVICE_KEYS_KEYSERVER_1), Some(DeviceType::Keyserver), false, ) .await; // 3. Log in on keyserver 2 with force = true let _keyserver_2 = login_user_device( &username, Some(&DEVICE_KEYS_KEYSERVER_2), Some(DeviceType::Keyserver), true, ) .await; // Get device list updates for the user let device_lists_response: Vec> = get_device_list_history(&mut auth_client, &user_id) .await .into_iter() .map(|device_list| device_list.devices) .collect(); let expected_device_list: Vec> = vec![ vec![android_device_id.into()], vec![android_device_id.into(), keyserver_1_device_id.into()], vec![android_device_id.into()], vec![android_device_id.into(), keyserver_2_device_id.into()], ]; assert_eq!(device_lists_response, expected_device_list); } +#[tokio::test] +async fn test_device_list_multifetch() { + // Create viewer (user that only auths request) + let viewer = register_user_device(None, None).await; + let mut auth_client = get_auth_client( + &service_addr::IDENTITY_GRPC.to_string(), + viewer.user_id.clone(), + viewer.device_id, + viewer.access_token, + PLACEHOLDER_CODE_VERSION, + DEVICE_TYPE.to_string(), + ) + .await + .expect("Couldn't connect to identity service"); + + // Register users and prepare expected device lists + let mut expected_device_lists = HashMap::new(); + for _ in 0..5 { + let user = register_user_device(None, None).await; + expected_device_lists.insert(user.user_id, vec![user.device_id]); + } + + // Fetch device lists from server + let user_ids: Vec<_> = expected_device_lists.keys().cloned().collect(); + let request = PeersDeviceListsRequest { user_ids }; + let response_device_lists = auth_client + .get_device_lists_for_users(request) + .await + .expect("GetDeviceListsForUser RPC failed") + .into_inner() + .users_device_lists; + + // verify if response has the same user IDs as request + let expected_user_ids: HashSet = + expected_device_lists.keys().cloned().collect(); + let response_user_ids: HashSet = + response_device_lists.keys().cloned().collect(); + let difference: HashSet<_> = expected_user_ids + .symmetric_difference(&response_user_ids) + .collect(); + assert!(difference.is_empty(), "User IDs differ: {:?}", difference); + + // verify device list for each user + for (user_id, expected_devices) in expected_device_lists { + let response_payload = response_device_lists.get(&user_id).unwrap(); + + let returned_devices = SignedDeviceList::from_str(response_payload) + .expect("failed to deserialize signed device list") + .into_raw() + .devices; + + assert_eq!( + returned_devices, expected_devices, + "Device list differs for user: {}, Expected {:?}, but got {:?}", + user_id, expected_devices, returned_devices + ); + } +} + // See GetDeviceListResponse in identity_authenticated.proto // for details on the response format. #[derive(Deserialize)] #[serde(rename_all = "camelCase")] #[allow(unused)] struct RawDeviceList { devices: Vec, timestamp: i64, } #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct SignedDeviceList { raw_device_list: String, } impl SignedDeviceList { fn into_raw(self) -> RawDeviceList { self .raw_device_list .parse() .expect("Failed to parse raw device list") } } impl FromStr for SignedDeviceList { type Err = serde_json::Error; fn from_str(s: &str) -> Result { serde_json::from_str(s) } } impl FromStr for RawDeviceList { type Err = serde_json::Error; fn from_str(s: &str) -> Result { // The device list payload is sent as an escaped JSON payload. // Escaped double quotes need to be trimmed before attempting to deserialize serde_json::from_str(&s.replace(r#"\""#, r#"""#)) } } async fn get_device_list_history( client: &mut ChainedInterceptedAuthClient, user_id: &str, ) -> Vec { let request = GetDeviceListRequest { user_id: user_id.to_string(), since_timestamp: None, }; let response = client .get_device_list_for_user(request) .await .expect("Get device list request failed") .into_inner(); response .device_list_updates .into_iter() .map(|update| { SignedDeviceList::from_str(&update) .expect("Failed to parse device list update") .into_raw() }) .collect() } diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs index d8bc2b879..8d0a80e99 100644 --- a/services/identity/src/grpc_services/authenticated.rs +++ b/services/identity/src/grpc_services/authenticated.rs @@ -1,608 +1,663 @@ use std::collections::HashMap; use crate::config::CONFIG; use crate::database::{DeviceListRow, DeviceListUpdate}; use crate::{ client_service::{handle_db_error, UpdateState, WorkflowInProgress}, constants::request_metadata, database::DatabaseClient, ddb_utils::DateTimeExt, grpc_services::shared::get_value, }; use chrono::{DateTime, Utc}; use comm_opaque2::grpc::protocol_error_to_grpc_status; use tonic::{Request, Response, Status}; use tracing::{debug, error, warn}; use super::protos::auth::{ identity_client_service_server::IdentityClientService, GetDeviceListRequest, GetDeviceListResponse, InboundKeyInfo, InboundKeysForUserRequest, InboundKeysForUserResponse, KeyserverKeysResponse, LinkFarcasterAccountRequest, OutboundKeyInfo, OutboundKeysForUserRequest, OutboundKeysForUserResponse, RefreshUserPrekeysRequest, UpdateDeviceListRequest, UpdateUserPasswordFinishRequest, UpdateUserPasswordStartRequest, UpdateUserPasswordStartResponse, UploadOneTimeKeysRequest, }; -use super::protos::auth::{UserIdentityRequest, UserIdentityResponse}; +use super::protos::auth::{ + PeersDeviceListsRequest, PeersDeviceListsResponse, UserIdentityRequest, + UserIdentityResponse, +}; use super::protos::unauth::Empty; #[derive(derive_more::Constructor)] pub struct AuthenticatedService { db_client: DatabaseClient, } fn get_auth_info(req: &Request<()>) -> Option<(String, String, String)> { debug!("Retrieving auth info for request: {:?}", req); let user_id = get_value(req, request_metadata::USER_ID)?; let device_id = get_value(req, request_metadata::DEVICE_ID)?; let access_token = get_value(req, request_metadata::ACCESS_TOKEN)?; Some((user_id, device_id, access_token)) } pub fn auth_interceptor( req: Request<()>, db_client: &DatabaseClient, ) -> Result, Status> { debug!("Intercepting request to check auth info: {:?}", req); let (user_id, device_id, access_token) = get_auth_info(&req) .ok_or_else(|| Status::unauthenticated("Missing credentials"))?; let handle = tokio::runtime::Handle::current(); let new_db_client = db_client.clone(); // This function cannot be `async`, yet must call the async db call // Force tokio to resolve future in current thread without an explicit .await let valid_token = tokio::task::block_in_place(move || { handle .block_on(new_db_client.verify_access_token( user_id, device_id, access_token, )) .map_err(handle_db_error) })?; if !valid_token { return Err(Status::aborted("Bad Credentials")); } Ok(req) } pub fn get_user_and_device_id( request: &Request, ) -> Result<(String, String), Status> { let user_id = get_value(request, request_metadata::USER_ID) .ok_or_else(|| Status::unauthenticated("Missing user_id field"))?; let device_id = get_value(request, request_metadata::DEVICE_ID) .ok_or_else(|| Status::unauthenticated("Missing device_id field"))?; Ok((user_id, device_id)) } #[tonic::async_trait] impl IdentityClientService for AuthenticatedService { async fn refresh_user_prekeys( &self, request: Request, ) -> Result, Status> { let (user_id, device_id) = get_user_and_device_id(&request)?; let message = request.into_inner(); debug!("Refreshing prekeys for user: {}", user_id); let content_keys = message .new_content_prekeys .ok_or_else(|| Status::invalid_argument("Missing content keys"))?; let notif_keys = message .new_notif_prekeys .ok_or_else(|| Status::invalid_argument("Missing notification keys"))?; self .db_client .update_device_prekeys( user_id, device_id, content_keys.into(), notif_keys.into(), ) .await .map_err(handle_db_error)?; let response = Response::new(Empty {}); Ok(response) } async fn get_outbound_keys_for_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let user_id = &message.user_id; let devices_map = self .db_client .get_keys_for_user(user_id, true) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let transformed_devices = devices_map .into_iter() .map(|(key, device_info)| (key, OutboundKeyInfo::from(device_info))) .collect::>(); Ok(tonic::Response::new(OutboundKeysForUserResponse { devices: transformed_devices, })) } async fn get_inbound_keys_for_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let user_id = &message.user_id; let devices_map = self .db_client .get_keys_for_user(user_id, false) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let transformed_devices = devices_map .into_iter() .map(|(key, device_info)| (key, InboundKeyInfo::from(device_info))) .collect::>(); let identifier = self .db_client .get_user_identifier(user_id) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; Ok(tonic::Response::new(InboundKeysForUserResponse { devices: transformed_devices, identity: Some(identifier.into()), })) } async fn get_keyserver_keys( &self, request: Request, ) -> Result, Status> { let message = request.into_inner(); let identifier = self .db_client .get_user_identifier(&message.user_id) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let Some(keyserver_info) = self .db_client .get_keyserver_keys_for_user(&message.user_id) .await .map_err(handle_db_error)? else { return Err(Status::not_found("keyserver not found")); }; let primary_device_data = self .db_client .get_primary_device_data(&message.user_id) .await .map_err(handle_db_error)?; let primary_device_keys = primary_device_data.device_key_info; let response = Response::new(KeyserverKeysResponse { keyserver_info: Some(keyserver_info.into()), identity: Some(identifier.into()), primary_device_identity_info: Some(primary_device_keys.into()), }); return Ok(response); } async fn upload_one_time_keys( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, device_id) = get_user_and_device_id(&request)?; let message = request.into_inner(); debug!("Attempting to update one time keys for user: {}", user_id); self .db_client .append_one_time_prekeys( device_id, message.content_one_time_prekeys, message.notif_one_time_prekeys, ) .await .map_err(handle_db_error)?; Ok(tonic::Response::new(Empty {})) } async fn update_user_password_start( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; let message = request.into_inner(); let server_registration = comm_opaque2::server::Registration::new(); let server_message = server_registration .start( &CONFIG.server_setup, &message.opaque_registration_request, user_id.as_bytes(), ) .map_err(protocol_error_to_grpc_status)?; let update_state = UpdateState { user_id }; let session_id = self .db_client .insert_workflow(WorkflowInProgress::Update(update_state)) .await .map_err(handle_db_error)?; let response = UpdateUserPasswordStartResponse { session_id, opaque_registration_response: server_message, }; Ok(Response::new(response)) } async fn update_user_password_finish( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let Some(WorkflowInProgress::Update(state)) = self .db_client .get_workflow(message.session_id) .await .map_err(handle_db_error)? else { return Err(tonic::Status::not_found("session not found")); }; let server_registration = comm_opaque2::server::Registration::new(); let password_file = server_registration .finish(&message.opaque_registration_upload) .map_err(protocol_error_to_grpc_status)?; self .db_client .update_user_password(state.user_id, password_file) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn log_out_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, device_id) = get_user_and_device_id(&request)?; self .db_client .remove_device(&user_id, &device_id) .await .map_err(handle_db_error)?; self .db_client .delete_access_token_data(user_id, device_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn delete_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; self .db_client .delete_user(user_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn get_device_list_for_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let GetDeviceListRequest { user_id, since_timestamp, } = request.into_inner(); let since = since_timestamp .map(|timestamp| { DateTime::::from_utc_timestamp_millis(timestamp) .ok_or_else(|| tonic::Status::invalid_argument("Invalid timestamp")) }) .transpose()?; let mut db_result = self .db_client .get_device_list_history(user_id, since) .await .map_err(handle_db_error)?; // these should be sorted already, but just in case db_result.sort_by_key(|list| list.timestamp); let device_list_updates: Vec = db_result .into_iter() .map(RawDeviceList::from) .map(SignedDeviceList::try_from_raw) .collect::, _>>()?; let stringified_updates = device_list_updates .iter() - .map(serde_json::to_string) - .collect::, _>>() - .map_err(|err| { - error!("Failed to serialize device list updates: {}", err); - tonic::Status::failed_precondition("unexpected error") - })?; + .map(SignedDeviceList::as_json_string) + .collect::, _>>()?; Ok(Response::new(GetDeviceListResponse { device_list_updates: stringified_updates, })) } + async fn get_device_lists_for_users( + &self, + request: tonic::Request, + ) -> Result, tonic::Status> { + let PeersDeviceListsRequest { user_ids } = request.into_inner(); + + // do all fetches concurrently + let mut fetch_tasks = tokio::task::JoinSet::new(); + let mut device_lists = HashMap::with_capacity(user_ids.len()); + for user_id in user_ids { + let db_client = self.db_client.clone(); + fetch_tasks.spawn(async move { + let result = db_client.get_current_device_list(&user_id).await; + (user_id, result) + }); + } + + while let Some(task_result) = fetch_tasks.join_next().await { + match task_result { + Ok((user_id, Ok(Some(device_list_row)))) => { + let raw_list = RawDeviceList::from(device_list_row); + let signed_list = SignedDeviceList::try_from_raw(raw_list)?; + let serialized_list = signed_list.as_json_string()?; + device_lists.insert(user_id, serialized_list); + } + Ok((user_id, Ok(None))) => { + warn!(user_id, "User has no device list, skipping!"); + } + Ok((user_id, Err(err))) => { + error!(user_id, "Failed fetching device list: {err}"); + // abort fetching other users + fetch_tasks.abort_all(); + return Err(handle_db_error(err)); + } + Err(join_error) => { + error!("Failed to join device list task: {join_error}"); + fetch_tasks.abort_all(); + return Err(Status::aborted("unexpected error")); + } + } + } + + let response = PeersDeviceListsResponse { + users_device_lists: device_lists, + }; + Ok(Response::new(response)) + } + async fn update_device_list( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _device_id) = get_user_and_device_id(&request)?; // TODO: when we stop doing "primary device rotation" (migration procedure) // we should verify if this RPC is called by primary device only let new_list = SignedDeviceList::try_from(request.into_inner())?; let update = DeviceListUpdate::try_from(new_list)?; self .db_client .apply_devicelist_update(&user_id, update) .await .map_err(handle_db_error)?; Ok(Response::new(Empty {})) } async fn link_farcaster_account( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; let message = request.into_inner(); let mut get_farcaster_users_response = self .db_client .get_farcaster_users(vec![message.farcaster_id.clone()]) .await .map_err(handle_db_error)?; if get_farcaster_users_response.len() > 1 { error!("multiple users associated with the same Farcaster ID"); return Err(Status::failed_precondition("cannot link Farcaster ID")); } if let Some(u) = get_farcaster_users_response.pop() { if u.0.user_id == user_id { return Ok(Response::new(Empty {})); } else { return Err(Status::already_exists( "farcaster ID already associated with different user", )); } } self .db_client .add_farcaster_id(user_id, message.farcaster_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn unlink_farcaster_account( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; self .db_client .remove_farcaster_id(user_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn find_user_identity( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let identifier = self .db_client .get_user_identifier(&message.user_id) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let response = UserIdentityResponse { identity: Some(identifier.into()), }; return Ok(Response::new(response)); } } // raw device list that can be serialized to JSON (and then signed in the future) #[derive(serde::Serialize, serde::Deserialize)] struct RawDeviceList { devices: Vec, timestamp: i64, } impl From for RawDeviceList { fn from(row: DeviceListRow) -> Self { Self { devices: row.device_ids, timestamp: row.timestamp.timestamp_millis(), } } } #[derive(serde::Serialize, serde::Deserialize)] #[serde(rename_all = "camelCase")] struct SignedDeviceList { /// JSON-stringified [`RawDeviceList`] raw_device_list: String, } impl SignedDeviceList { /// Serialize (and sign in the future) a [`RawDeviceList`] fn try_from_raw(raw: RawDeviceList) -> Result { let stringified_list = serde_json::to_string(&raw).map_err(|err| { error!("Failed to serialize raw device list: {}", err); tonic::Status::failed_precondition("unexpected error") })?; Ok(Self { raw_device_list: stringified_list, }) } fn as_raw(&self) -> Result { // The device list payload is sent as an escaped JSON payload. // Escaped double quotes need to be trimmed before attempting to deserialize serde_json::from_str(&self.raw_device_list.replace(r#"\""#, r#"""#)) .map_err(|err| { warn!("Failed to deserialize raw device list: {}", err); tonic::Status::invalid_argument("invalid device list payload") }) } + + /// Serializes the signed device list to a JSON string + fn as_json_string(&self) -> Result { + serde_json::to_string(self).map_err(|err| { + error!("Failed to serialize device list updates: {}", err); + tonic::Status::failed_precondition("unexpected error") + }) + } } impl TryFrom for SignedDeviceList { type Error = tonic::Status; fn try_from(request: UpdateDeviceListRequest) -> Result { serde_json::from_str(&request.new_device_list).map_err(|err| { warn!("Failed to deserialize device list update: {}", err); tonic::Status::invalid_argument("invalid device list payload") }) } } impl TryFrom for DeviceListUpdate { type Error = tonic::Status; fn try_from(signed_list: SignedDeviceList) -> Result { let RawDeviceList { devices, timestamp: raw_timestamp, } = signed_list.as_raw()?; let timestamp = DateTime::::from_utc_timestamp_millis(raw_timestamp) .ok_or_else(|| { error!("Failed to parse RawDeviceList timestamp!"); tonic::Status::invalid_argument("invalid timestamp") })?; Ok(DeviceListUpdate::new(devices, timestamp)) } } #[cfg(test)] mod tests { use super::*; #[test] fn serialize_device_list_updates() { let raw_updates = vec![ RawDeviceList { devices: vec!["device1".into()], timestamp: 111111111, }, RawDeviceList { devices: vec!["device1".into(), "device2".into()], timestamp: 222222222, }, ]; let expected_raw_list1 = r#"{"devices":["device1"],"timestamp":111111111}"#; let expected_raw_list2 = r#"{"devices":["device1","device2"],"timestamp":222222222}"#; let signed_updates = raw_updates .into_iter() .map(SignedDeviceList::try_from_raw) .collect::, _>>() .expect("signing device list updates failed"); assert_eq!(signed_updates[0].raw_device_list, expected_raw_list1); assert_eq!(signed_updates[1].raw_device_list, expected_raw_list2); let stringified_updates = signed_updates .iter() .map(serde_json::to_string) .collect::, _>>() .expect("serialize signed device lists failed"); let expected_stringified_list1 = r#"{"rawDeviceList":"{\"devices\":[\"device1\"],\"timestamp\":111111111}"}"#; let expected_stringified_list2 = r#"{"rawDeviceList":"{\"devices\":[\"device1\",\"device2\"],\"timestamp\":222222222}"}"#; assert_eq!(stringified_updates[0], expected_stringified_list1); assert_eq!(stringified_updates[1], expected_stringified_list2); } #[test] fn deserialize_device_list_update() { let raw_payload = r#"{"rawDeviceList":"{\"devices\":[\"device1\",\"device2\"],\"timestamp\":123456789}"}"#; let request = UpdateDeviceListRequest { new_device_list: raw_payload.to_string(), }; let signed_list = SignedDeviceList::try_from(request) .expect("Failed to parse SignedDeviceList"); let update = DeviceListUpdate::try_from(signed_list) .expect("Failed to parse DeviceListUpdate from signed list"); let expected_timestamp = DateTime::::from_utc_timestamp_millis(123456789).unwrap(); assert_eq!(update.timestamp, expected_timestamp); assert_eq!( update.devices, vec!["device1".to_string(), "device2".to_string()] ); } } diff --git a/shared/protos/identity_auth.proto b/shared/protos/identity_auth.proto index f1ffec56a..0ed793217 100644 --- a/shared/protos/identity_auth.proto +++ b/shared/protos/identity_auth.proto @@ -1,229 +1,245 @@ syntax = "proto3"; import "identity_unauth.proto"; package identity.auth; // RPCs from a client (iOS, Android, or web) to identity service // // This service will assert authenticity of a device by verifying the access // token through an interceptor, thus avoiding the need to explicitly pass // the credentials on every request service IdentityClientService { /* X3DH actions */ // Replenish one-time preKeys rpc UploadOneTimeKeys(UploadOneTimeKeysRequest) returns (identity.unauth.Empty) {} // Rotate a device's prekey and prekey signature // Rotated for deniability of older messages rpc RefreshUserPrekeys(RefreshUserPrekeysRequest) returns (identity.unauth.Empty) {} // Called by clients to get all device keys associated with a user in order // to open a new channel of communication on any of their devices. // Specially, this will return the following per device: // - Identity keys (both Content and Notif Keys) // - Prekey (including prekey signature) // - One-time Prekey rpc GetOutboundKeysForUser(OutboundKeysForUserRequest) returns (OutboundKeysForUserResponse) {} // Called by receivers of a communication request. The reponse will return // identity keys (both content and notif keys) and related prekeys per device, // but will not contain one-time keys. Additionally, the response will contain // the other user's username. rpc GetInboundKeysForUser(InboundKeysForUserRequest) returns (InboundKeysForUserResponse) {} // Called by clients to get required keys for opening a connection // to a user's keyserver rpc GetKeyserverKeys(OutboundKeysForUserRequest) returns (KeyserverKeysResponse) {} /* Account actions */ // Called by user to update password and receive new access token rpc UpdateUserPasswordStart(UpdateUserPasswordStartRequest) returns (UpdateUserPasswordStartResponse) {} rpc UpdateUserPasswordFinish(UpdateUserPasswordFinishRequest) returns (identity.unauth.Empty) {} // Called by user to log out (clears device's keys and access token) rpc LogOutUser(identity.unauth.Empty) returns (identity.unauth.Empty) {} // Called by a user to delete their own account rpc DeleteUser(identity.unauth.Empty) returns (identity.unauth.Empty) {} /* Device list actions */ // Returns device list history rpc GetDeviceListForUser(GetDeviceListRequest) returns (GetDeviceListResponse) {} + // Returns current device list for a set of users + rpc GetDeviceListsForUsers (PeersDeviceListsRequest) returns + (PeersDeviceListsResponse) {} rpc UpdateDeviceList(UpdateDeviceListRequest) returns (identity.unauth.Empty) {} /* Farcaster actions */ // Called by an existing user to link their Farcaster account rpc LinkFarcasterAccount(LinkFarcasterAccountRequest) returns (identity.unauth.Empty) {} // Called by an existing user to unlink their Farcaster account rpc UnlinkFarcasterAccount(identity.unauth.Empty) returns (identity.unauth.Empty) {} /* Miscellaneous actions */ rpc FindUserIdentity(UserIdentityRequest) returns (UserIdentityResponse) {} } // Helper types message EthereumIdentity { string wallet_address = 1; string siwe_message = 2; string siwe_signature = 3; } message Identity { // this is wallet address for Ethereum users string username = 1; optional EthereumIdentity eth_identity = 2; } // UploadOneTimeKeys // As OPKs get exhausted, they need to be refreshed message UploadOneTimeKeysRequest { repeated string content_one_time_prekeys = 1; repeated string notif_one_time_prekeys = 2; } // RefreshUserPreKeys message RefreshUserPrekeysRequest { identity.unauth.Prekey new_content_prekeys = 1; identity.unauth.Prekey new_notif_prekeys = 2; } // Information needed when establishing communication to someone else's device message OutboundKeyInfo { identity.unauth.IdentityKeyInfo identity_info = 1; identity.unauth.Prekey content_prekey = 2; identity.unauth.Prekey notif_prekey = 3; optional string one_time_content_prekey = 4; optional string one_time_notif_prekey = 5; } message KeyserverKeysResponse { OutboundKeyInfo keyserver_info = 1; Identity identity = 2; identity.unauth.IdentityKeyInfo primary_device_identity_info = 3; } // GetOutboundKeysForUser message OutboundKeysForUserResponse { // Map is keyed on devices' public ed25519 key used for signing map devices = 1; } // Information needed by a device to establish communcation when responding // to a request. // The device receiving a request only needs the content key and prekey. message OutboundKeysForUserRequest { string user_id = 1; } // GetInboundKeysForUser message InboundKeyInfo { identity.unauth.IdentityKeyInfo identity_info = 1; identity.unauth.Prekey content_prekey = 2; identity.unauth.Prekey notif_prekey = 3; } message InboundKeysForUserResponse { // Map is keyed on devices' public ed25519 key used for signing map devices = 1; Identity identity = 2; } message InboundKeysForUserRequest { string user_id = 1; } // UpdateUserPassword // Request for updating a user, similar to registration but need a // access token to validate user before updating password message UpdateUserPasswordStartRequest { // Message sent to initiate PAKE registration (step 1) bytes opaque_registration_request = 1; } // Do a user registration, but overwrite the existing credentials // after validation of user message UpdateUserPasswordFinishRequest { // Identifier used to correlate start and finish request string session_id = 1; // Opaque client registration upload (step 3) bytes opaque_registration_upload = 2; } message UpdateUserPasswordStartResponse { // Identifier used to correlate start request with finish request string session_id = 1; bytes opaque_registration_response = 2; } // GetDeviceListForUser message GetDeviceListRequest { // User whose device lists we want to retrieve string user_id = 1; // UTC timestamp in milliseconds // If none, whole device list history will be retrieved optional int64 since_timestamp = 2; } message GetDeviceListResponse { // A list of stringified JSON objects of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [, ...] // "timestamp": , // }) // } repeated string device_list_updates = 1; } +// GetDeviceListsForUsers + +message PeersDeviceListsRequest { + repeated string user_ids = 1; +} + +message PeersDeviceListsResponse { + // keys are user_id + // values are JSON-stringified device list payloads + // (see GetDeviceListResponse message for payload structure) + map users_device_lists = 1; +} + // UpdateDeviceListForUser message UpdateDeviceListRequest { // A stringified JSON object of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [, ...] // "timestamp": , // }) // } string new_device_list = 1; } // LinkFarcasterAccount message LinkFarcasterAccountRequest { string farcaster_id = 1; } // FindUserIdentity message UserIdentityRequest { // user ID for which we want to get the identity string user_id = 1; } message UserIdentityResponse { Identity identity = 1; } diff --git a/web/protobufs/identity-auth-client.cjs b/web/protobufs/identity-auth-client.cjs index f6d1fddfc..221301aba 100644 --- a/web/protobufs/identity-auth-client.cjs +++ b/web/protobufs/identity-auth-client.cjs @@ -1,936 +1,997 @@ /** * @fileoverview gRPC-Web generated client stub for identity.auth * @enhanceable * @public * @generated */ // Code generated by protoc-gen-grpc-web. DO NOT EDIT. // versions: // protoc-gen-grpc-web v1.4.2 // protoc v3.21.12 // source: identity_auth.proto /* eslint-disable */ // @ts-nocheck const grpc = {}; grpc.web = require('grpc-web'); var identity_unauth_pb = require('./identity-unauth-structs.cjs') const proto = {}; proto.identity = {}; proto.identity.auth = require('./identity-auth-structs.cjs'); /** * @param {string} hostname * @param {?Object} credentials * @param {?grpc.web.ClientOptions} options * @constructor * @struct * @final */ proto.identity.auth.IdentityClientServiceClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'text'; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname.replace(/\/+$/, ''); }; /** * @param {string} hostname * @param {?Object} credentials * @param {?grpc.web.ClientOptions} options * @constructor * @struct * @final */ proto.identity.auth.IdentityClientServicePromiseClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'text'; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname.replace(/\/+$/, ''); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UploadOneTimeKeysRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UploadOneTimeKeys = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UploadOneTimeKeys', grpc.web.MethodType.UNARY, proto.identity.auth.UploadOneTimeKeysRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.UploadOneTimeKeysRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.UploadOneTimeKeysRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.uploadOneTimeKeys = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UploadOneTimeKeys', request, metadata || {}, methodDescriptor_IdentityClientService_UploadOneTimeKeys, callback); }; /** * @param {!proto.identity.auth.UploadOneTimeKeysRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.uploadOneTimeKeys = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UploadOneTimeKeys', request, metadata || {}, methodDescriptor_IdentityClientService_UploadOneTimeKeys); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.RefreshUserPrekeysRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_RefreshUserPrekeys = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/RefreshUserPrekeys', grpc.web.MethodType.UNARY, proto.identity.auth.RefreshUserPrekeysRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.RefreshUserPrekeysRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.RefreshUserPrekeysRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.refreshUserPrekeys = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/RefreshUserPrekeys', request, metadata || {}, methodDescriptor_IdentityClientService_RefreshUserPrekeys, callback); }; /** * @param {!proto.identity.auth.RefreshUserPrekeysRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.refreshUserPrekeys = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/RefreshUserPrekeys', request, metadata || {}, methodDescriptor_IdentityClientService_RefreshUserPrekeys); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.OutboundKeysForUserRequest, * !proto.identity.auth.OutboundKeysForUserResponse>} */ const methodDescriptor_IdentityClientService_GetOutboundKeysForUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetOutboundKeysForUser', grpc.web.MethodType.UNARY, proto.identity.auth.OutboundKeysForUserRequest, proto.identity.auth.OutboundKeysForUserResponse, /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.OutboundKeysForUserResponse.deserializeBinary ); /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.OutboundKeysForUserResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getOutboundKeysForUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetOutboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetOutboundKeysForUser, callback); }; /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getOutboundKeysForUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetOutboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetOutboundKeysForUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.InboundKeysForUserRequest, * !proto.identity.auth.InboundKeysForUserResponse>} */ const methodDescriptor_IdentityClientService_GetInboundKeysForUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetInboundKeysForUser', grpc.web.MethodType.UNARY, proto.identity.auth.InboundKeysForUserRequest, proto.identity.auth.InboundKeysForUserResponse, /** * @param {!proto.identity.auth.InboundKeysForUserRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.InboundKeysForUserResponse.deserializeBinary ); /** * @param {!proto.identity.auth.InboundKeysForUserRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.InboundKeysForUserResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getInboundKeysForUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetInboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetInboundKeysForUser, callback); }; /** * @param {!proto.identity.auth.InboundKeysForUserRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getInboundKeysForUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetInboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetInboundKeysForUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.OutboundKeysForUserRequest, * !proto.identity.auth.KeyserverKeysResponse>} */ const methodDescriptor_IdentityClientService_GetKeyserverKeys = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetKeyserverKeys', grpc.web.MethodType.UNARY, proto.identity.auth.OutboundKeysForUserRequest, proto.identity.auth.KeyserverKeysResponse, /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.KeyserverKeysResponse.deserializeBinary ); /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.KeyserverKeysResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getKeyserverKeys = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetKeyserverKeys', request, metadata || {}, methodDescriptor_IdentityClientService_GetKeyserverKeys, callback); }; /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getKeyserverKeys = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetKeyserverKeys', request, metadata || {}, methodDescriptor_IdentityClientService_GetKeyserverKeys); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UpdateUserPasswordStartRequest, * !proto.identity.auth.UpdateUserPasswordStartResponse>} */ const methodDescriptor_IdentityClientService_UpdateUserPasswordStart = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UpdateUserPasswordStart', grpc.web.MethodType.UNARY, proto.identity.auth.UpdateUserPasswordStartRequest, proto.identity.auth.UpdateUserPasswordStartResponse, /** * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.UpdateUserPasswordStartResponse.deserializeBinary ); /** * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.UpdateUserPasswordStartResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.updateUserPasswordStart = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordStart', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordStart, callback); }; /** * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.updateUserPasswordStart = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordStart', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordStart); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UpdateUserPasswordFinishRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UpdateUserPasswordFinish = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UpdateUserPasswordFinish', grpc.web.MethodType.UNARY, proto.identity.auth.UpdateUserPasswordFinishRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.updateUserPasswordFinish = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordFinish', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordFinish, callback); }; /** * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.updateUserPasswordFinish = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordFinish', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordFinish); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.unauth.Empty, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_LogOutUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/LogOutUser', grpc.web.MethodType.UNARY, identity_unauth_pb.Empty, identity_unauth_pb.Empty, /** * @param {!proto.identity.unauth.Empty} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.logOutUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/LogOutUser', request, metadata || {}, methodDescriptor_IdentityClientService_LogOutUser, callback); }; /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.logOutUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/LogOutUser', request, metadata || {}, methodDescriptor_IdentityClientService_LogOutUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.unauth.Empty, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_DeleteUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/DeleteUser', grpc.web.MethodType.UNARY, identity_unauth_pb.Empty, identity_unauth_pb.Empty, /** * @param {!proto.identity.unauth.Empty} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.deleteUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/DeleteUser', request, metadata || {}, methodDescriptor_IdentityClientService_DeleteUser, callback); }; /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.deleteUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/DeleteUser', request, metadata || {}, methodDescriptor_IdentityClientService_DeleteUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.GetDeviceListRequest, * !proto.identity.auth.GetDeviceListResponse>} */ const methodDescriptor_IdentityClientService_GetDeviceListForUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetDeviceListForUser', grpc.web.MethodType.UNARY, proto.identity.auth.GetDeviceListRequest, proto.identity.auth.GetDeviceListResponse, /** * @param {!proto.identity.auth.GetDeviceListRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.GetDeviceListResponse.deserializeBinary ); /** * @param {!proto.identity.auth.GetDeviceListRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.GetDeviceListResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getDeviceListForUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetDeviceListForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetDeviceListForUser, callback); }; /** * @param {!proto.identity.auth.GetDeviceListRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getDeviceListForUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetDeviceListForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetDeviceListForUser); }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.identity.auth.PeersDeviceListsRequest, + * !proto.identity.auth.PeersDeviceListsResponse>} + */ +const methodDescriptor_IdentityClientService_GetDeviceListsForUsers = new grpc.web.MethodDescriptor( + '/identity.auth.IdentityClientService/GetDeviceListsForUsers', + grpc.web.MethodType.UNARY, + proto.identity.auth.PeersDeviceListsRequest, + proto.identity.auth.PeersDeviceListsResponse, + /** + * @param {!proto.identity.auth.PeersDeviceListsRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.identity.auth.PeersDeviceListsResponse.deserializeBinary +); + + +/** + * @param {!proto.identity.auth.PeersDeviceListsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.identity.auth.PeersDeviceListsResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.identity.auth.IdentityClientServiceClient.prototype.getDeviceListsForUsers = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/identity.auth.IdentityClientService/GetDeviceListsForUsers', + request, + metadata || {}, + methodDescriptor_IdentityClientService_GetDeviceListsForUsers, + callback); +}; + + +/** + * @param {!proto.identity.auth.PeersDeviceListsRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.identity.auth.IdentityClientServicePromiseClient.prototype.getDeviceListsForUsers = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/identity.auth.IdentityClientService/GetDeviceListsForUsers', + request, + metadata || {}, + methodDescriptor_IdentityClientService_GetDeviceListsForUsers); +}; + + /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UpdateDeviceListRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UpdateDeviceList = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UpdateDeviceList', grpc.web.MethodType.UNARY, proto.identity.auth.UpdateDeviceListRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.UpdateDeviceListRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.UpdateDeviceListRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.updateDeviceList = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateDeviceList', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateDeviceList, callback); }; /** * @param {!proto.identity.auth.UpdateDeviceListRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.updateDeviceList = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateDeviceList', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateDeviceList); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.LinkFarcasterAccountRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_LinkFarcasterAccount = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/LinkFarcasterAccount', grpc.web.MethodType.UNARY, proto.identity.auth.LinkFarcasterAccountRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.LinkFarcasterAccountRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.LinkFarcasterAccountRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.linkFarcasterAccount = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/LinkFarcasterAccount', request, metadata || {}, methodDescriptor_IdentityClientService_LinkFarcasterAccount, callback); }; /** * @param {!proto.identity.auth.LinkFarcasterAccountRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.linkFarcasterAccount = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/LinkFarcasterAccount', request, metadata || {}, methodDescriptor_IdentityClientService_LinkFarcasterAccount); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.unauth.Empty, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UnlinkFarcasterAccount = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UnlinkFarcasterAccount', grpc.web.MethodType.UNARY, identity_unauth_pb.Empty, identity_unauth_pb.Empty, /** * @param {!proto.identity.unauth.Empty} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.unlinkFarcasterAccount = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UnlinkFarcasterAccount', request, metadata || {}, methodDescriptor_IdentityClientService_UnlinkFarcasterAccount, callback); }; /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.unlinkFarcasterAccount = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UnlinkFarcasterAccount', request, metadata || {}, methodDescriptor_IdentityClientService_UnlinkFarcasterAccount); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UserIdentityRequest, * !proto.identity.auth.UserIdentityResponse>} */ const methodDescriptor_IdentityClientService_FindUserIdentity = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/FindUserIdentity', grpc.web.MethodType.UNARY, proto.identity.auth.UserIdentityRequest, proto.identity.auth.UserIdentityResponse, /** * @param {!proto.identity.auth.UserIdentityRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.UserIdentityResponse.deserializeBinary ); /** * @param {!proto.identity.auth.UserIdentityRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.UserIdentityResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.findUserIdentity = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/FindUserIdentity', request, metadata || {}, methodDescriptor_IdentityClientService_FindUserIdentity, callback); }; /** * @param {!proto.identity.auth.UserIdentityRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.findUserIdentity = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/FindUserIdentity', request, metadata || {}, methodDescriptor_IdentityClientService_FindUserIdentity); }; module.exports = proto.identity.auth; diff --git a/web/protobufs/identity-auth-client.cjs.flow b/web/protobufs/identity-auth-client.cjs.flow index a5490f1f7..863400add 100644 --- a/web/protobufs/identity-auth-client.cjs.flow +++ b/web/protobufs/identity-auth-client.cjs.flow @@ -1,187 +1,199 @@ // @flow import * as grpcWeb from 'grpc-web'; import * as identityAuthStructs from './identity-auth-structs.cjs'; import * as identityStructs from './identity-unauth-structs.cjs'; declare export class IdentityClientServiceClient { constructor (hostname: string, credentials?: null | { +[index: string]: string; }, options?: null | { +[index: string]: any; }): void; uploadOneTimeKeys( request: identityAuthStructs.UploadOneTimeKeysRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; refreshUserPrekeys( request: identityAuthStructs.RefreshUserPrekeysRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; getOutboundKeysForUser( request: identityAuthStructs.OutboundKeysForUserRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.OutboundKeysForUserResponse) => void ): grpcWeb.ClientReadableStream; getInboundKeysForUser( request: identityAuthStructs.InboundKeysForUserRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.InboundKeysForUserResponse) => void ): grpcWeb.ClientReadableStream; getKeyserverKeys( request: identityAuthStructs.OutboundKeysForUserRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.KeyserverKeysResponse) => void ): grpcWeb.ClientReadableStream; updateUserPasswordStart( request: identityAuthStructs.UpdateUserPasswordStartRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.UpdateUserPasswordStartResponse) => void ): grpcWeb.ClientReadableStream; updateUserPasswordFinish( request: identityAuthStructs.UpdateUserPasswordFinishRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; logOutUser( request: identityStructs.Empty, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; deleteUser( request: identityStructs.Empty, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; getDeviceListForUser( request: identityAuthStructs.GetDeviceListRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.GetDeviceListResponse) => void ): grpcWeb.ClientReadableStream; + getDeviceListsForUsers( + request: identityAuthStructs.PeersDeviceListsRequest, + metadata: grpcWeb.Metadata | void, + callback: (err: grpcWeb.RpcError, + response: identityAuthStructs.PeersDeviceListsResponse) => void + ): grpcWeb.ClientReadableStream; + updateDeviceList( request: identityAuthStructs.UpdateDeviceListRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; linkFarcasterAccount( request: identityAuthStructs.LinkFarcasterAccountRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; unlinkFarcasterAccount( request: identityStructs.Empty, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; findUserIdentity( request: identityAuthStructs.UserIdentityRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.UserIdentityResponse) => void ): grpcWeb.ClientReadableStream; } declare export class IdentityClientServicePromiseClient { constructor (hostname: string, credentials?: null | { +[index: string]: string; }, options?: null | { +[index: string]: any; }): void; uploadOneTimeKeys( request: identityAuthStructs.UploadOneTimeKeysRequest, metadata?: grpcWeb.Metadata ): Promise; refreshUserPrekeys( request: identityAuthStructs.RefreshUserPrekeysRequest, metadata?: grpcWeb.Metadata ): Promise; getOutboundKeysForUser( request: identityAuthStructs.OutboundKeysForUserRequest, metadata?: grpcWeb.Metadata ): Promise; getInboundKeysForUser( request: identityAuthStructs.InboundKeysForUserRequest, metadata?: grpcWeb.Metadata ): Promise; getKeyserverKeys( request: identityAuthStructs.OutboundKeysForUserRequest, metadata?: grpcWeb.Metadata ): Promise; updateUserPasswordStart( request: identityAuthStructs.UpdateUserPasswordStartRequest, metadata?: grpcWeb.Metadata ): Promise; updateUserPasswordFinish( request: identityAuthStructs.UpdateUserPasswordFinishRequest, metadata?: grpcWeb.Metadata ): Promise; logOutUser( request: identityStructs.Empty, metadata?: grpcWeb.Metadata ): Promise; deleteUser( request: identityStructs.Empty, metadata?: grpcWeb.Metadata ): Promise; getDeviceListForUser( request: identityAuthStructs.GetDeviceListRequest, metadata?: grpcWeb.Metadata ): Promise; + getDeviceListsForUsers( + request: identityAuthStructs.PeersDeviceListsRequest, + metadata?: grpcWeb.Metadata + ): Promise; + updateDeviceList( request: identityAuthStructs.UpdateDeviceListRequest, metadata?: grpcWeb.Metadata ): Promise; linkFarcasterAccount( request: identityAuthStructs.LinkFarcasterAccountRequest, metadata?: grpcWeb.Metadata ): Promise; unlinkFarcasterAccount( request: identityStructs.Empty, metadata?: grpcWeb.Metadata ): Promise; findUserIdentity( request: identityAuthStructs.UserIdentityRequest, metadata?: grpcWeb.Metadata ): Promise; } diff --git a/web/protobufs/identity-auth-structs.cjs b/web/protobufs/identity-auth-structs.cjs index 4faeb8874..c71405dca 100644 --- a/web/protobufs/identity-auth-structs.cjs +++ b/web/protobufs/identity-auth-structs.cjs @@ -1,4076 +1,4410 @@ // source: identity_auth.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public * @generated */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = (typeof globalThis !== 'undefined' && globalThis) || (typeof window !== 'undefined' && window) || (typeof global !== 'undefined' && global) || (typeof self !== 'undefined' && self) || (function () { return this; }).call(null) || Function('return this')(); var identity_unauth_pb = require('./identity-unauth-structs.cjs'); goog.object.extend(proto, identity_unauth_pb); goog.exportSymbol('proto.identity.auth.EthereumIdentity', null, global); goog.exportSymbol('proto.identity.auth.GetDeviceListRequest', null, global); goog.exportSymbol('proto.identity.auth.GetDeviceListResponse', null, global); goog.exportSymbol('proto.identity.auth.Identity', null, global); goog.exportSymbol('proto.identity.auth.InboundKeyInfo', null, global); goog.exportSymbol('proto.identity.auth.InboundKeysForUserRequest', null, global); goog.exportSymbol('proto.identity.auth.InboundKeysForUserResponse', null, global); goog.exportSymbol('proto.identity.auth.KeyserverKeysResponse', null, global); goog.exportSymbol('proto.identity.auth.LinkFarcasterAccountRequest', null, global); goog.exportSymbol('proto.identity.auth.OutboundKeyInfo', null, global); goog.exportSymbol('proto.identity.auth.OutboundKeysForUserRequest', null, global); goog.exportSymbol('proto.identity.auth.OutboundKeysForUserResponse', null, global); +goog.exportSymbol('proto.identity.auth.PeersDeviceListsRequest', null, global); +goog.exportSymbol('proto.identity.auth.PeersDeviceListsResponse', null, global); goog.exportSymbol('proto.identity.auth.RefreshUserPrekeysRequest', null, global); goog.exportSymbol('proto.identity.auth.UpdateDeviceListRequest', null, global); goog.exportSymbol('proto.identity.auth.UpdateUserPasswordFinishRequest', null, global); goog.exportSymbol('proto.identity.auth.UpdateUserPasswordStartRequest', null, global); goog.exportSymbol('proto.identity.auth.UpdateUserPasswordStartResponse', null, global); goog.exportSymbol('proto.identity.auth.UploadOneTimeKeysRequest', null, global); goog.exportSymbol('proto.identity.auth.UserIdentityRequest', null, global); goog.exportSymbol('proto.identity.auth.UserIdentityResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.EthereumIdentity = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.EthereumIdentity, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.EthereumIdentity.displayName = 'proto.identity.auth.EthereumIdentity'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.Identity = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.Identity, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.Identity.displayName = 'proto.identity.auth.Identity'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UploadOneTimeKeysRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.auth.UploadOneTimeKeysRequest.repeatedFields_, null); }; goog.inherits(proto.identity.auth.UploadOneTimeKeysRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UploadOneTimeKeysRequest.displayName = 'proto.identity.auth.UploadOneTimeKeysRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.RefreshUserPrekeysRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.RefreshUserPrekeysRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.RefreshUserPrekeysRequest.displayName = 'proto.identity.auth.RefreshUserPrekeysRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.OutboundKeyInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.OutboundKeyInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.OutboundKeyInfo.displayName = 'proto.identity.auth.OutboundKeyInfo'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.KeyserverKeysResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.KeyserverKeysResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.KeyserverKeysResponse.displayName = 'proto.identity.auth.KeyserverKeysResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.OutboundKeysForUserResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.OutboundKeysForUserResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.OutboundKeysForUserResponse.displayName = 'proto.identity.auth.OutboundKeysForUserResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.OutboundKeysForUserRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.OutboundKeysForUserRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.OutboundKeysForUserRequest.displayName = 'proto.identity.auth.OutboundKeysForUserRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.InboundKeyInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.InboundKeyInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.InboundKeyInfo.displayName = 'proto.identity.auth.InboundKeyInfo'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.InboundKeysForUserResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.InboundKeysForUserResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.InboundKeysForUserResponse.displayName = 'proto.identity.auth.InboundKeysForUserResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.InboundKeysForUserRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.InboundKeysForUserRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.InboundKeysForUserRequest.displayName = 'proto.identity.auth.InboundKeysForUserRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UpdateUserPasswordStartRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.UpdateUserPasswordStartRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UpdateUserPasswordStartRequest.displayName = 'proto.identity.auth.UpdateUserPasswordStartRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UpdateUserPasswordFinishRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.UpdateUserPasswordFinishRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UpdateUserPasswordFinishRequest.displayName = 'proto.identity.auth.UpdateUserPasswordFinishRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UpdateUserPasswordStartResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.UpdateUserPasswordStartResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UpdateUserPasswordStartResponse.displayName = 'proto.identity.auth.UpdateUserPasswordStartResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.GetDeviceListRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.GetDeviceListRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.GetDeviceListRequest.displayName = 'proto.identity.auth.GetDeviceListRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.GetDeviceListResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.auth.GetDeviceListResponse.repeatedFields_, null); }; goog.inherits(proto.identity.auth.GetDeviceListResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.GetDeviceListResponse.displayName = 'proto.identity.auth.GetDeviceListResponse'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.auth.PeersDeviceListsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.auth.PeersDeviceListsRequest.repeatedFields_, null); +}; +goog.inherits(proto.identity.auth.PeersDeviceListsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.auth.PeersDeviceListsRequest.displayName = 'proto.identity.auth.PeersDeviceListsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.auth.PeersDeviceListsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.identity.auth.PeersDeviceListsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.auth.PeersDeviceListsResponse.displayName = 'proto.identity.auth.PeersDeviceListsResponse'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UpdateDeviceListRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.UpdateDeviceListRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UpdateDeviceListRequest.displayName = 'proto.identity.auth.UpdateDeviceListRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.LinkFarcasterAccountRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.LinkFarcasterAccountRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.LinkFarcasterAccountRequest.displayName = 'proto.identity.auth.LinkFarcasterAccountRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UserIdentityRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.UserIdentityRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UserIdentityRequest.displayName = 'proto.identity.auth.UserIdentityRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.auth.UserIdentityResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.auth.UserIdentityResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.auth.UserIdentityResponse.displayName = 'proto.identity.auth.UserIdentityResponse'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.EthereumIdentity.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.EthereumIdentity.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.EthereumIdentity} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.EthereumIdentity.toObject = function(includeInstance, msg) { var f, obj = { walletAddress: jspb.Message.getFieldWithDefault(msg, 1, ""), siweMessage: jspb.Message.getFieldWithDefault(msg, 2, ""), siweSignature: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.EthereumIdentity} */ proto.identity.auth.EthereumIdentity.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.EthereumIdentity; return proto.identity.auth.EthereumIdentity.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.EthereumIdentity} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.EthereumIdentity} */ proto.identity.auth.EthereumIdentity.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setWalletAddress(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSiweMessage(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setSiweSignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.EthereumIdentity.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.EthereumIdentity.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.EthereumIdentity} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.EthereumIdentity.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getWalletAddress(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getSiweMessage(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getSiweSignature(); if (f.length > 0) { writer.writeString( 3, f ); } }; /** * optional string wallet_address = 1; * @return {string} */ proto.identity.auth.EthereumIdentity.prototype.getWalletAddress = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.EthereumIdentity} returns this */ proto.identity.auth.EthereumIdentity.prototype.setWalletAddress = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string siwe_message = 2; * @return {string} */ proto.identity.auth.EthereumIdentity.prototype.getSiweMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.auth.EthereumIdentity} returns this */ proto.identity.auth.EthereumIdentity.prototype.setSiweMessage = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string siwe_signature = 3; * @return {string} */ proto.identity.auth.EthereumIdentity.prototype.getSiweSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.identity.auth.EthereumIdentity} returns this */ proto.identity.auth.EthereumIdentity.prototype.setSiweSignature = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.Identity.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.Identity.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.Identity} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.Identity.toObject = function(includeInstance, msg) { var f, obj = { username: jspb.Message.getFieldWithDefault(msg, 1, ""), ethIdentity: (f = msg.getEthIdentity()) && proto.identity.auth.EthereumIdentity.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.Identity} */ proto.identity.auth.Identity.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.Identity; return proto.identity.auth.Identity.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.Identity} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.Identity} */ proto.identity.auth.Identity.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUsername(value); break; case 2: var value = new proto.identity.auth.EthereumIdentity; reader.readMessage(value,proto.identity.auth.EthereumIdentity.deserializeBinaryFromReader); msg.setEthIdentity(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.Identity.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.Identity.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.Identity} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.Identity.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUsername(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getEthIdentity(); if (f != null) { writer.writeMessage( 2, f, proto.identity.auth.EthereumIdentity.serializeBinaryToWriter ); } }; /** * optional string username = 1; * @return {string} */ proto.identity.auth.Identity.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.Identity} returns this */ proto.identity.auth.Identity.prototype.setUsername = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional EthereumIdentity eth_identity = 2; * @return {?proto.identity.auth.EthereumIdentity} */ proto.identity.auth.Identity.prototype.getEthIdentity = function() { return /** @type{?proto.identity.auth.EthereumIdentity} */ ( jspb.Message.getWrapperField(this, proto.identity.auth.EthereumIdentity, 2)); }; /** * @param {?proto.identity.auth.EthereumIdentity|undefined} value * @return {!proto.identity.auth.Identity} returns this */ proto.identity.auth.Identity.prototype.setEthIdentity = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.Identity} returns this */ proto.identity.auth.Identity.prototype.clearEthIdentity = function() { return this.setEthIdentity(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.Identity.prototype.hasEthIdentity = function() { return jspb.Message.getField(this, 2) != null; }; /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.identity.auth.UploadOneTimeKeysRequest.repeatedFields_ = [1,2]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UploadOneTimeKeysRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UploadOneTimeKeysRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UploadOneTimeKeysRequest.toObject = function(includeInstance, msg) { var f, obj = { contentOneTimePrekeysList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, notifOneTimePrekeysList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UploadOneTimeKeysRequest} */ proto.identity.auth.UploadOneTimeKeysRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UploadOneTimeKeysRequest; return proto.identity.auth.UploadOneTimeKeysRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UploadOneTimeKeysRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UploadOneTimeKeysRequest} */ proto.identity.auth.UploadOneTimeKeysRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.addContentOneTimePrekeys(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.addNotifOneTimePrekeys(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UploadOneTimeKeysRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UploadOneTimeKeysRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UploadOneTimeKeysRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getContentOneTimePrekeysList(); if (f.length > 0) { writer.writeRepeatedString( 1, f ); } f = message.getNotifOneTimePrekeysList(); if (f.length > 0) { writer.writeRepeatedString( 2, f ); } }; /** * repeated string content_one_time_prekeys = 1; * @return {!Array} */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.getContentOneTimePrekeysList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** * @param {!Array} value * @return {!proto.identity.auth.UploadOneTimeKeysRequest} returns this */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.setContentOneTimePrekeysList = function(value) { return jspb.Message.setField(this, 1, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.identity.auth.UploadOneTimeKeysRequest} returns this */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.addContentOneTimePrekeys = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.auth.UploadOneTimeKeysRequest} returns this */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.clearContentOneTimePrekeysList = function() { return this.setContentOneTimePrekeysList([]); }; /** * repeated string notif_one_time_prekeys = 2; * @return {!Array} */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.getNotifOneTimePrekeysList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); }; /** * @param {!Array} value * @return {!proto.identity.auth.UploadOneTimeKeysRequest} returns this */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.setNotifOneTimePrekeysList = function(value) { return jspb.Message.setField(this, 2, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.identity.auth.UploadOneTimeKeysRequest} returns this */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.addNotifOneTimePrekeys = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.auth.UploadOneTimeKeysRequest} returns this */ proto.identity.auth.UploadOneTimeKeysRequest.prototype.clearNotifOneTimePrekeysList = function() { return this.setNotifOneTimePrekeysList([]); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.RefreshUserPrekeysRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.RefreshUserPrekeysRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.RefreshUserPrekeysRequest.toObject = function(includeInstance, msg) { var f, obj = { newContentPrekeys: (f = msg.getNewContentPrekeys()) && identity_unauth_pb.Prekey.toObject(includeInstance, f), newNotifPrekeys: (f = msg.getNewNotifPrekeys()) && identity_unauth_pb.Prekey.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.RefreshUserPrekeysRequest} */ proto.identity.auth.RefreshUserPrekeysRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.RefreshUserPrekeysRequest; return proto.identity.auth.RefreshUserPrekeysRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.RefreshUserPrekeysRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.RefreshUserPrekeysRequest} */ proto.identity.auth.RefreshUserPrekeysRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); msg.setNewContentPrekeys(value); break; case 2: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); msg.setNewNotifPrekeys(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.RefreshUserPrekeysRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.RefreshUserPrekeysRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.RefreshUserPrekeysRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNewContentPrekeys(); if (f != null) { writer.writeMessage( 1, f, identity_unauth_pb.Prekey.serializeBinaryToWriter ); } f = message.getNewNotifPrekeys(); if (f != null) { writer.writeMessage( 2, f, identity_unauth_pb.Prekey.serializeBinaryToWriter ); } }; /** * optional identity.unauth.Prekey new_content_prekeys = 1; * @return {?proto.identity.unauth.Prekey} */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.getNewContentPrekeys = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 1)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.setNewContentPrekeys = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.clearNewContentPrekeys = function() { return this.setNewContentPrekeys(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.hasNewContentPrekeys = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional identity.unauth.Prekey new_notif_prekeys = 2; * @return {?proto.identity.unauth.Prekey} */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.getNewNotifPrekeys = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 2)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.setNewNotifPrekeys = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.clearNewNotifPrekeys = function() { return this.setNewNotifPrekeys(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.RefreshUserPrekeysRequest.prototype.hasNewNotifPrekeys = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.OutboundKeyInfo.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.OutboundKeyInfo.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.OutboundKeyInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.OutboundKeyInfo.toObject = function(includeInstance, msg) { var f, obj = { identityInfo: (f = msg.getIdentityInfo()) && identity_unauth_pb.IdentityKeyInfo.toObject(includeInstance, f), contentPrekey: (f = msg.getContentPrekey()) && identity_unauth_pb.Prekey.toObject(includeInstance, f), notifPrekey: (f = msg.getNotifPrekey()) && identity_unauth_pb.Prekey.toObject(includeInstance, f), oneTimeContentPrekey: jspb.Message.getFieldWithDefault(msg, 4, ""), oneTimeNotifPrekey: jspb.Message.getFieldWithDefault(msg, 5, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.OutboundKeyInfo} */ proto.identity.auth.OutboundKeyInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.OutboundKeyInfo; return proto.identity.auth.OutboundKeyInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.OutboundKeyInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.OutboundKeyInfo} */ proto.identity.auth.OutboundKeyInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new identity_unauth_pb.IdentityKeyInfo; reader.readMessage(value,identity_unauth_pb.IdentityKeyInfo.deserializeBinaryFromReader); msg.setIdentityInfo(value); break; case 2: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); msg.setContentPrekey(value); break; case 3: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); msg.setNotifPrekey(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setOneTimeContentPrekey(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setOneTimeNotifPrekey(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.OutboundKeyInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.OutboundKeyInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.OutboundKeyInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.OutboundKeyInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIdentityInfo(); if (f != null) { writer.writeMessage( 1, f, identity_unauth_pb.IdentityKeyInfo.serializeBinaryToWriter ); } f = message.getContentPrekey(); if (f != null) { writer.writeMessage( 2, f, identity_unauth_pb.Prekey.serializeBinaryToWriter ); } f = message.getNotifPrekey(); if (f != null) { writer.writeMessage( 3, f, identity_unauth_pb.Prekey.serializeBinaryToWriter ); } f = /** @type {string} */ (jspb.Message.getField(message, 4)); if (f != null) { writer.writeString( 4, f ); } f = /** @type {string} */ (jspb.Message.getField(message, 5)); if (f != null) { writer.writeString( 5, f ); } }; /** * optional identity.unauth.IdentityKeyInfo identity_info = 1; * @return {?proto.identity.unauth.IdentityKeyInfo} */ proto.identity.auth.OutboundKeyInfo.prototype.getIdentityInfo = function() { return /** @type{?proto.identity.unauth.IdentityKeyInfo} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.IdentityKeyInfo, 1)); }; /** * @param {?proto.identity.unauth.IdentityKeyInfo|undefined} value * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.setIdentityInfo = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.clearIdentityInfo = function() { return this.setIdentityInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.OutboundKeyInfo.prototype.hasIdentityInfo = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional identity.unauth.Prekey content_prekey = 2; * @return {?proto.identity.unauth.Prekey} */ proto.identity.auth.OutboundKeyInfo.prototype.getContentPrekey = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 2)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.setContentPrekey = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.clearContentPrekey = function() { return this.setContentPrekey(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.OutboundKeyInfo.prototype.hasContentPrekey = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional identity.unauth.Prekey notif_prekey = 3; * @return {?proto.identity.unauth.Prekey} */ proto.identity.auth.OutboundKeyInfo.prototype.getNotifPrekey = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 3)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.setNotifPrekey = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.clearNotifPrekey = function() { return this.setNotifPrekey(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.OutboundKeyInfo.prototype.hasNotifPrekey = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional string one_time_content_prekey = 4; * @return {string} */ proto.identity.auth.OutboundKeyInfo.prototype.getOneTimeContentPrekey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.setOneTimeContentPrekey = function(value) { return jspb.Message.setField(this, 4, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.clearOneTimeContentPrekey = function() { return jspb.Message.setField(this, 4, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.OutboundKeyInfo.prototype.hasOneTimeContentPrekey = function() { return jspb.Message.getField(this, 4) != null; }; /** * optional string one_time_notif_prekey = 5; * @return {string} */ proto.identity.auth.OutboundKeyInfo.prototype.getOneTimeNotifPrekey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.setOneTimeNotifPrekey = function(value) { return jspb.Message.setField(this, 5, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.auth.OutboundKeyInfo} returns this */ proto.identity.auth.OutboundKeyInfo.prototype.clearOneTimeNotifPrekey = function() { return jspb.Message.setField(this, 5, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.OutboundKeyInfo.prototype.hasOneTimeNotifPrekey = function() { return jspb.Message.getField(this, 5) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.KeyserverKeysResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.KeyserverKeysResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.KeyserverKeysResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.KeyserverKeysResponse.toObject = function(includeInstance, msg) { var f, obj = { keyserverInfo: (f = msg.getKeyserverInfo()) && proto.identity.auth.OutboundKeyInfo.toObject(includeInstance, f), identity: (f = msg.getIdentity()) && proto.identity.auth.Identity.toObject(includeInstance, f), primaryDeviceIdentityInfo: (f = msg.getPrimaryDeviceIdentityInfo()) && identity_unauth_pb.IdentityKeyInfo.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.KeyserverKeysResponse} */ proto.identity.auth.KeyserverKeysResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.KeyserverKeysResponse; return proto.identity.auth.KeyserverKeysResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.KeyserverKeysResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.KeyserverKeysResponse} */ proto.identity.auth.KeyserverKeysResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.identity.auth.OutboundKeyInfo; reader.readMessage(value,proto.identity.auth.OutboundKeyInfo.deserializeBinaryFromReader); msg.setKeyserverInfo(value); break; case 2: var value = new proto.identity.auth.Identity; reader.readMessage(value,proto.identity.auth.Identity.deserializeBinaryFromReader); msg.setIdentity(value); break; case 3: var value = new identity_unauth_pb.IdentityKeyInfo; reader.readMessage(value,identity_unauth_pb.IdentityKeyInfo.deserializeBinaryFromReader); msg.setPrimaryDeviceIdentityInfo(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.KeyserverKeysResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.KeyserverKeysResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.KeyserverKeysResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.KeyserverKeysResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getKeyserverInfo(); if (f != null) { writer.writeMessage( 1, f, proto.identity.auth.OutboundKeyInfo.serializeBinaryToWriter ); } f = message.getIdentity(); if (f != null) { writer.writeMessage( 2, f, proto.identity.auth.Identity.serializeBinaryToWriter ); } f = message.getPrimaryDeviceIdentityInfo(); if (f != null) { writer.writeMessage( 3, f, identity_unauth_pb.IdentityKeyInfo.serializeBinaryToWriter ); } }; /** * optional OutboundKeyInfo keyserver_info = 1; * @return {?proto.identity.auth.OutboundKeyInfo} */ proto.identity.auth.KeyserverKeysResponse.prototype.getKeyserverInfo = function() { return /** @type{?proto.identity.auth.OutboundKeyInfo} */ ( jspb.Message.getWrapperField(this, proto.identity.auth.OutboundKeyInfo, 1)); }; /** * @param {?proto.identity.auth.OutboundKeyInfo|undefined} value * @return {!proto.identity.auth.KeyserverKeysResponse} returns this */ proto.identity.auth.KeyserverKeysResponse.prototype.setKeyserverInfo = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.KeyserverKeysResponse} returns this */ proto.identity.auth.KeyserverKeysResponse.prototype.clearKeyserverInfo = function() { return this.setKeyserverInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.KeyserverKeysResponse.prototype.hasKeyserverInfo = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional Identity identity = 2; * @return {?proto.identity.auth.Identity} */ proto.identity.auth.KeyserverKeysResponse.prototype.getIdentity = function() { return /** @type{?proto.identity.auth.Identity} */ ( jspb.Message.getWrapperField(this, proto.identity.auth.Identity, 2)); }; /** * @param {?proto.identity.auth.Identity|undefined} value * @return {!proto.identity.auth.KeyserverKeysResponse} returns this */ proto.identity.auth.KeyserverKeysResponse.prototype.setIdentity = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.KeyserverKeysResponse} returns this */ proto.identity.auth.KeyserverKeysResponse.prototype.clearIdentity = function() { return this.setIdentity(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.KeyserverKeysResponse.prototype.hasIdentity = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional identity.unauth.IdentityKeyInfo primary_device_identity_info = 3; * @return {?proto.identity.unauth.IdentityKeyInfo} */ proto.identity.auth.KeyserverKeysResponse.prototype.getPrimaryDeviceIdentityInfo = function() { return /** @type{?proto.identity.unauth.IdentityKeyInfo} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.IdentityKeyInfo, 3)); }; /** * @param {?proto.identity.unauth.IdentityKeyInfo|undefined} value * @return {!proto.identity.auth.KeyserverKeysResponse} returns this */ proto.identity.auth.KeyserverKeysResponse.prototype.setPrimaryDeviceIdentityInfo = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.KeyserverKeysResponse} returns this */ proto.identity.auth.KeyserverKeysResponse.prototype.clearPrimaryDeviceIdentityInfo = function() { return this.setPrimaryDeviceIdentityInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.KeyserverKeysResponse.prototype.hasPrimaryDeviceIdentityInfo = function() { return jspb.Message.getField(this, 3) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.OutboundKeysForUserResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.OutboundKeysForUserResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.OutboundKeysForUserResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.OutboundKeysForUserResponse.toObject = function(includeInstance, msg) { var f, obj = { devicesMap: (f = msg.getDevicesMap()) ? f.toObject(includeInstance, proto.identity.auth.OutboundKeyInfo.toObject) : [] }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.OutboundKeysForUserResponse} */ proto.identity.auth.OutboundKeysForUserResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.OutboundKeysForUserResponse; return proto.identity.auth.OutboundKeysForUserResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.OutboundKeysForUserResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.OutboundKeysForUserResponse} */ proto.identity.auth.OutboundKeysForUserResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = msg.getDevicesMap(); reader.readMessage(value, function(message, reader) { jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.identity.auth.OutboundKeyInfo.deserializeBinaryFromReader, "", new proto.identity.auth.OutboundKeyInfo()); }); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.OutboundKeysForUserResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.OutboundKeysForUserResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.OutboundKeysForUserResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.OutboundKeysForUserResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDevicesMap(true); if (f && f.getLength() > 0) { f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.identity.auth.OutboundKeyInfo.serializeBinaryToWriter); } }; /** * map devices = 1; * @param {boolean=} opt_noLazyCreate Do not create the map if * empty, instead returning `undefined` * @return {!jspb.Map} */ proto.identity.auth.OutboundKeysForUserResponse.prototype.getDevicesMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 1, opt_noLazyCreate, proto.identity.auth.OutboundKeyInfo)); }; /** * Clears values from the map. The map will be non-null. * @return {!proto.identity.auth.OutboundKeysForUserResponse} returns this */ proto.identity.auth.OutboundKeysForUserResponse.prototype.clearDevicesMap = function() { this.getDevicesMap().clear(); return this; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.OutboundKeysForUserRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.OutboundKeysForUserRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.OutboundKeysForUserRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.OutboundKeysForUserRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.OutboundKeysForUserRequest} */ proto.identity.auth.OutboundKeysForUserRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.OutboundKeysForUserRequest; return proto.identity.auth.OutboundKeysForUserRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.OutboundKeysForUserRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.OutboundKeysForUserRequest} */ proto.identity.auth.OutboundKeysForUserRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.OutboundKeysForUserRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.OutboundKeysForUserRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.OutboundKeysForUserRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.OutboundKeysForUserRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.auth.OutboundKeysForUserRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.OutboundKeysForUserRequest} returns this */ proto.identity.auth.OutboundKeysForUserRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.InboundKeyInfo.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.InboundKeyInfo.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.InboundKeyInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.InboundKeyInfo.toObject = function(includeInstance, msg) { var f, obj = { identityInfo: (f = msg.getIdentityInfo()) && identity_unauth_pb.IdentityKeyInfo.toObject(includeInstance, f), contentPrekey: (f = msg.getContentPrekey()) && identity_unauth_pb.Prekey.toObject(includeInstance, f), notifPrekey: (f = msg.getNotifPrekey()) && identity_unauth_pb.Prekey.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.InboundKeyInfo} */ proto.identity.auth.InboundKeyInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.InboundKeyInfo; return proto.identity.auth.InboundKeyInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.InboundKeyInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.InboundKeyInfo} */ proto.identity.auth.InboundKeyInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new identity_unauth_pb.IdentityKeyInfo; reader.readMessage(value,identity_unauth_pb.IdentityKeyInfo.deserializeBinaryFromReader); msg.setIdentityInfo(value); break; case 2: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); msg.setContentPrekey(value); break; case 3: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); msg.setNotifPrekey(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.InboundKeyInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.InboundKeyInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.InboundKeyInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.InboundKeyInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIdentityInfo(); if (f != null) { writer.writeMessage( 1, f, identity_unauth_pb.IdentityKeyInfo.serializeBinaryToWriter ); } f = message.getContentPrekey(); if (f != null) { writer.writeMessage( 2, f, identity_unauth_pb.Prekey.serializeBinaryToWriter ); } f = message.getNotifPrekey(); if (f != null) { writer.writeMessage( 3, f, identity_unauth_pb.Prekey.serializeBinaryToWriter ); } }; /** * optional identity.unauth.IdentityKeyInfo identity_info = 1; * @return {?proto.identity.unauth.IdentityKeyInfo} */ proto.identity.auth.InboundKeyInfo.prototype.getIdentityInfo = function() { return /** @type{?proto.identity.unauth.IdentityKeyInfo} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.IdentityKeyInfo, 1)); }; /** * @param {?proto.identity.unauth.IdentityKeyInfo|undefined} value * @return {!proto.identity.auth.InboundKeyInfo} returns this */ proto.identity.auth.InboundKeyInfo.prototype.setIdentityInfo = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.InboundKeyInfo} returns this */ proto.identity.auth.InboundKeyInfo.prototype.clearIdentityInfo = function() { return this.setIdentityInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.InboundKeyInfo.prototype.hasIdentityInfo = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional identity.unauth.Prekey content_prekey = 2; * @return {?proto.identity.unauth.Prekey} */ proto.identity.auth.InboundKeyInfo.prototype.getContentPrekey = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 2)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.InboundKeyInfo} returns this */ proto.identity.auth.InboundKeyInfo.prototype.setContentPrekey = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.InboundKeyInfo} returns this */ proto.identity.auth.InboundKeyInfo.prototype.clearContentPrekey = function() { return this.setContentPrekey(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.InboundKeyInfo.prototype.hasContentPrekey = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional identity.unauth.Prekey notif_prekey = 3; * @return {?proto.identity.unauth.Prekey} */ proto.identity.auth.InboundKeyInfo.prototype.getNotifPrekey = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 3)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.InboundKeyInfo} returns this */ proto.identity.auth.InboundKeyInfo.prototype.setNotifPrekey = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.InboundKeyInfo} returns this */ proto.identity.auth.InboundKeyInfo.prototype.clearNotifPrekey = function() { return this.setNotifPrekey(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.InboundKeyInfo.prototype.hasNotifPrekey = function() { return jspb.Message.getField(this, 3) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.InboundKeysForUserResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.InboundKeysForUserResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.InboundKeysForUserResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.InboundKeysForUserResponse.toObject = function(includeInstance, msg) { var f, obj = { devicesMap: (f = msg.getDevicesMap()) ? f.toObject(includeInstance, proto.identity.auth.InboundKeyInfo.toObject) : [], identity: (f = msg.getIdentity()) && proto.identity.auth.Identity.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.InboundKeysForUserResponse} */ proto.identity.auth.InboundKeysForUserResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.InboundKeysForUserResponse; return proto.identity.auth.InboundKeysForUserResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.InboundKeysForUserResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.InboundKeysForUserResponse} */ proto.identity.auth.InboundKeysForUserResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = msg.getDevicesMap(); reader.readMessage(value, function(message, reader) { jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.identity.auth.InboundKeyInfo.deserializeBinaryFromReader, "", new proto.identity.auth.InboundKeyInfo()); }); break; case 2: var value = new proto.identity.auth.Identity; reader.readMessage(value,proto.identity.auth.Identity.deserializeBinaryFromReader); msg.setIdentity(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.InboundKeysForUserResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.InboundKeysForUserResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.InboundKeysForUserResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.InboundKeysForUserResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDevicesMap(true); if (f && f.getLength() > 0) { f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.identity.auth.InboundKeyInfo.serializeBinaryToWriter); } f = message.getIdentity(); if (f != null) { writer.writeMessage( 2, f, proto.identity.auth.Identity.serializeBinaryToWriter ); } }; /** * map devices = 1; * @param {boolean=} opt_noLazyCreate Do not create the map if * empty, instead returning `undefined` * @return {!jspb.Map} */ proto.identity.auth.InboundKeysForUserResponse.prototype.getDevicesMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 1, opt_noLazyCreate, proto.identity.auth.InboundKeyInfo)); }; /** * Clears values from the map. The map will be non-null. * @return {!proto.identity.auth.InboundKeysForUserResponse} returns this */ proto.identity.auth.InboundKeysForUserResponse.prototype.clearDevicesMap = function() { this.getDevicesMap().clear(); return this; }; /** * optional Identity identity = 2; * @return {?proto.identity.auth.Identity} */ proto.identity.auth.InboundKeysForUserResponse.prototype.getIdentity = function() { return /** @type{?proto.identity.auth.Identity} */ ( jspb.Message.getWrapperField(this, proto.identity.auth.Identity, 2)); }; /** * @param {?proto.identity.auth.Identity|undefined} value * @return {!proto.identity.auth.InboundKeysForUserResponse} returns this */ proto.identity.auth.InboundKeysForUserResponse.prototype.setIdentity = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.InboundKeysForUserResponse} returns this */ proto.identity.auth.InboundKeysForUserResponse.prototype.clearIdentity = function() { return this.setIdentity(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.InboundKeysForUserResponse.prototype.hasIdentity = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.InboundKeysForUserRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.InboundKeysForUserRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.InboundKeysForUserRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.InboundKeysForUserRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.InboundKeysForUserRequest} */ proto.identity.auth.InboundKeysForUserRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.InboundKeysForUserRequest; return proto.identity.auth.InboundKeysForUserRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.InboundKeysForUserRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.InboundKeysForUserRequest} */ proto.identity.auth.InboundKeysForUserRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.InboundKeysForUserRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.InboundKeysForUserRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.InboundKeysForUserRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.InboundKeysForUserRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.auth.InboundKeysForUserRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.InboundKeysForUserRequest} returns this */ proto.identity.auth.InboundKeysForUserRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UpdateUserPasswordStartRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UpdateUserPasswordStartRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateUserPasswordStartRequest.toObject = function(includeInstance, msg) { var f, obj = { opaqueRegistrationRequest: msg.getOpaqueRegistrationRequest_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UpdateUserPasswordStartRequest} */ proto.identity.auth.UpdateUserPasswordStartRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UpdateUserPasswordStartRequest; return proto.identity.auth.UpdateUserPasswordStartRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UpdateUserPasswordStartRequest} */ proto.identity.auth.UpdateUserPasswordStartRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationRequest(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UpdateUserPasswordStartRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UpdateUserPasswordStartRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateUserPasswordStartRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOpaqueRegistrationRequest_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } }; /** * optional bytes opaque_registration_request = 1; * @return {string} */ proto.identity.auth.UpdateUserPasswordStartRequest.prototype.getOpaqueRegistrationRequest = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes opaque_registration_request = 1; * This is a type-conversion wrapper around `getOpaqueRegistrationRequest()` * @return {string} */ proto.identity.auth.UpdateUserPasswordStartRequest.prototype.getOpaqueRegistrationRequest_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationRequest())); }; /** * optional bytes opaque_registration_request = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationRequest()` * @return {!Uint8Array} */ proto.identity.auth.UpdateUserPasswordStartRequest.prototype.getOpaqueRegistrationRequest_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationRequest())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.auth.UpdateUserPasswordStartRequest} returns this */ proto.identity.auth.UpdateUserPasswordStartRequest.prototype.setOpaqueRegistrationRequest = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UpdateUserPasswordFinishRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateUserPasswordFinishRequest.toObject = function(includeInstance, msg) { var f, obj = { sessionId: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueRegistrationUpload: msg.getOpaqueRegistrationUpload_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UpdateUserPasswordFinishRequest} */ proto.identity.auth.UpdateUserPasswordFinishRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UpdateUserPasswordFinishRequest; return proto.identity.auth.UpdateUserPasswordFinishRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UpdateUserPasswordFinishRequest} */ proto.identity.auth.UpdateUserPasswordFinishRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSessionId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationUpload(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UpdateUserPasswordFinishRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateUserPasswordFinishRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSessionId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueRegistrationUpload_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional string session_id = 1; * @return {string} */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.getSessionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.UpdateUserPasswordFinishRequest} returns this */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.setSessionId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_registration_upload = 2; * @return {string} */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.getOpaqueRegistrationUpload = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_registration_upload = 2; * This is a type-conversion wrapper around `getOpaqueRegistrationUpload()` * @return {string} */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.getOpaqueRegistrationUpload_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationUpload())); }; /** * optional bytes opaque_registration_upload = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationUpload()` * @return {!Uint8Array} */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.getOpaqueRegistrationUpload_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationUpload())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.auth.UpdateUserPasswordFinishRequest} returns this */ proto.identity.auth.UpdateUserPasswordFinishRequest.prototype.setOpaqueRegistrationUpload = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UpdateUserPasswordStartResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UpdateUserPasswordStartResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateUserPasswordStartResponse.toObject = function(includeInstance, msg) { var f, obj = { sessionId: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueRegistrationResponse: msg.getOpaqueRegistrationResponse_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UpdateUserPasswordStartResponse} */ proto.identity.auth.UpdateUserPasswordStartResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UpdateUserPasswordStartResponse; return proto.identity.auth.UpdateUserPasswordStartResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UpdateUserPasswordStartResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UpdateUserPasswordStartResponse} */ proto.identity.auth.UpdateUserPasswordStartResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSessionId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationResponse(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UpdateUserPasswordStartResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UpdateUserPasswordStartResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateUserPasswordStartResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSessionId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueRegistrationResponse_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional string session_id = 1; * @return {string} */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.getSessionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.UpdateUserPasswordStartResponse} returns this */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.setSessionId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_registration_response = 2; * @return {string} */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.getOpaqueRegistrationResponse = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_registration_response = 2; * This is a type-conversion wrapper around `getOpaqueRegistrationResponse()` * @return {string} */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.getOpaqueRegistrationResponse_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationResponse())); }; /** * optional bytes opaque_registration_response = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationResponse()` * @return {!Uint8Array} */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.getOpaqueRegistrationResponse_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationResponse())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.auth.UpdateUserPasswordStartResponse} returns this */ proto.identity.auth.UpdateUserPasswordStartResponse.prototype.setOpaqueRegistrationResponse = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.GetDeviceListRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.GetDeviceListRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.GetDeviceListRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.GetDeviceListRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), sinceTimestamp: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.GetDeviceListRequest} */ proto.identity.auth.GetDeviceListRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.GetDeviceListRequest; return proto.identity.auth.GetDeviceListRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.GetDeviceListRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.GetDeviceListRequest} */ proto.identity.auth.GetDeviceListRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {number} */ (reader.readInt64()); msg.setSinceTimestamp(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.GetDeviceListRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.GetDeviceListRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.GetDeviceListRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.GetDeviceListRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = /** @type {number} */ (jspb.Message.getField(message, 2)); if (f != null) { writer.writeInt64( 2, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.auth.GetDeviceListRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.GetDeviceListRequest} returns this */ proto.identity.auth.GetDeviceListRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional int64 since_timestamp = 2; * @return {number} */ proto.identity.auth.GetDeviceListRequest.prototype.getSinceTimestamp = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.identity.auth.GetDeviceListRequest} returns this */ proto.identity.auth.GetDeviceListRequest.prototype.setSinceTimestamp = function(value) { return jspb.Message.setField(this, 2, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.auth.GetDeviceListRequest} returns this */ proto.identity.auth.GetDeviceListRequest.prototype.clearSinceTimestamp = function() { return jspb.Message.setField(this, 2, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.GetDeviceListRequest.prototype.hasSinceTimestamp = function() { return jspb.Message.getField(this, 2) != null; }; /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.identity.auth.GetDeviceListResponse.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.GetDeviceListResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.GetDeviceListResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.GetDeviceListResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.GetDeviceListResponse.toObject = function(includeInstance, msg) { var f, obj = { deviceListUpdatesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.GetDeviceListResponse} */ proto.identity.auth.GetDeviceListResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.GetDeviceListResponse; return proto.identity.auth.GetDeviceListResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.GetDeviceListResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.GetDeviceListResponse} */ proto.identity.auth.GetDeviceListResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.addDeviceListUpdates(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.GetDeviceListResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.GetDeviceListResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.GetDeviceListResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.GetDeviceListResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDeviceListUpdatesList(); if (f.length > 0) { writer.writeRepeatedString( 1, f ); } }; /** * repeated string device_list_updates = 1; * @return {!Array} */ proto.identity.auth.GetDeviceListResponse.prototype.getDeviceListUpdatesList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** * @param {!Array} value * @return {!proto.identity.auth.GetDeviceListResponse} returns this */ proto.identity.auth.GetDeviceListResponse.prototype.setDeviceListUpdatesList = function(value) { return jspb.Message.setField(this, 1, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.identity.auth.GetDeviceListResponse} returns this */ proto.identity.auth.GetDeviceListResponse.prototype.addDeviceListUpdates = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.auth.GetDeviceListResponse} returns this */ proto.identity.auth.GetDeviceListResponse.prototype.clearDeviceListUpdatesList = function() { return this.setDeviceListUpdatesList([]); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.identity.auth.PeersDeviceListsRequest.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.auth.PeersDeviceListsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.identity.auth.PeersDeviceListsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.auth.PeersDeviceListsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.auth.PeersDeviceListsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + userIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.auth.PeersDeviceListsRequest} + */ +proto.identity.auth.PeersDeviceListsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.auth.PeersDeviceListsRequest; + return proto.identity.auth.PeersDeviceListsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.auth.PeersDeviceListsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.auth.PeersDeviceListsRequest} + */ +proto.identity.auth.PeersDeviceListsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addUserIds(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.auth.PeersDeviceListsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.auth.PeersDeviceListsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.auth.PeersDeviceListsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.auth.PeersDeviceListsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUserIdsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string user_ids = 1; + * @return {!Array} + */ +proto.identity.auth.PeersDeviceListsRequest.prototype.getUserIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.identity.auth.PeersDeviceListsRequest} returns this + */ +proto.identity.auth.PeersDeviceListsRequest.prototype.setUserIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.identity.auth.PeersDeviceListsRequest} returns this + */ +proto.identity.auth.PeersDeviceListsRequest.prototype.addUserIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.identity.auth.PeersDeviceListsRequest} returns this + */ +proto.identity.auth.PeersDeviceListsRequest.prototype.clearUserIdsList = function() { + return this.setUserIdsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.auth.PeersDeviceListsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.identity.auth.PeersDeviceListsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.auth.PeersDeviceListsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.auth.PeersDeviceListsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + usersDeviceListsMap: (f = msg.getUsersDeviceListsMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.auth.PeersDeviceListsResponse} + */ +proto.identity.auth.PeersDeviceListsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.auth.PeersDeviceListsResponse; + return proto.identity.auth.PeersDeviceListsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.auth.PeersDeviceListsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.auth.PeersDeviceListsResponse} + */ +proto.identity.auth.PeersDeviceListsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getUsersDeviceListsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.auth.PeersDeviceListsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.auth.PeersDeviceListsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.auth.PeersDeviceListsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.auth.PeersDeviceListsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUsersDeviceListsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * map users_device_lists = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.identity.auth.PeersDeviceListsResponse.prototype.getUsersDeviceListsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.identity.auth.PeersDeviceListsResponse} returns this + */ +proto.identity.auth.PeersDeviceListsResponse.prototype.clearUsersDeviceListsMap = function() { + this.getUsersDeviceListsMap().clear(); + return this; +}; + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UpdateDeviceListRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UpdateDeviceListRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UpdateDeviceListRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateDeviceListRequest.toObject = function(includeInstance, msg) { var f, obj = { newDeviceList: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UpdateDeviceListRequest} */ proto.identity.auth.UpdateDeviceListRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UpdateDeviceListRequest; return proto.identity.auth.UpdateDeviceListRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UpdateDeviceListRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UpdateDeviceListRequest} */ proto.identity.auth.UpdateDeviceListRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setNewDeviceList(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UpdateDeviceListRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UpdateDeviceListRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UpdateDeviceListRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UpdateDeviceListRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNewDeviceList(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string new_device_list = 1; * @return {string} */ proto.identity.auth.UpdateDeviceListRequest.prototype.getNewDeviceList = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.UpdateDeviceListRequest} returns this */ proto.identity.auth.UpdateDeviceListRequest.prototype.setNewDeviceList = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.LinkFarcasterAccountRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.LinkFarcasterAccountRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.LinkFarcasterAccountRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.LinkFarcasterAccountRequest.toObject = function(includeInstance, msg) { var f, obj = { farcasterId: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.LinkFarcasterAccountRequest} */ proto.identity.auth.LinkFarcasterAccountRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.LinkFarcasterAccountRequest; return proto.identity.auth.LinkFarcasterAccountRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.LinkFarcasterAccountRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.LinkFarcasterAccountRequest} */ proto.identity.auth.LinkFarcasterAccountRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setFarcasterId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.LinkFarcasterAccountRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.LinkFarcasterAccountRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.LinkFarcasterAccountRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.LinkFarcasterAccountRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getFarcasterId(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string farcaster_id = 1; * @return {string} */ proto.identity.auth.LinkFarcasterAccountRequest.prototype.getFarcasterId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.LinkFarcasterAccountRequest} returns this */ proto.identity.auth.LinkFarcasterAccountRequest.prototype.setFarcasterId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UserIdentityRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UserIdentityRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UserIdentityRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UserIdentityRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UserIdentityRequest} */ proto.identity.auth.UserIdentityRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UserIdentityRequest; return proto.identity.auth.UserIdentityRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UserIdentityRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UserIdentityRequest} */ proto.identity.auth.UserIdentityRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UserIdentityRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UserIdentityRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UserIdentityRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UserIdentityRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.auth.UserIdentityRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.auth.UserIdentityRequest} returns this */ proto.identity.auth.UserIdentityRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.auth.UserIdentityResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.auth.UserIdentityResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.auth.UserIdentityResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UserIdentityResponse.toObject = function(includeInstance, msg) { var f, obj = { identity: (f = msg.getIdentity()) && proto.identity.auth.Identity.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.auth.UserIdentityResponse} */ proto.identity.auth.UserIdentityResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.auth.UserIdentityResponse; return proto.identity.auth.UserIdentityResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.auth.UserIdentityResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.auth.UserIdentityResponse} */ proto.identity.auth.UserIdentityResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.identity.auth.Identity; reader.readMessage(value,proto.identity.auth.Identity.deserializeBinaryFromReader); msg.setIdentity(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.auth.UserIdentityResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.auth.UserIdentityResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.auth.UserIdentityResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.auth.UserIdentityResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIdentity(); if (f != null) { writer.writeMessage( 1, f, proto.identity.auth.Identity.serializeBinaryToWriter ); } }; /** * optional Identity identity = 1; * @return {?proto.identity.auth.Identity} */ proto.identity.auth.UserIdentityResponse.prototype.getIdentity = function() { return /** @type{?proto.identity.auth.Identity} */ ( jspb.Message.getWrapperField(this, proto.identity.auth.Identity, 1)); }; /** * @param {?proto.identity.auth.Identity|undefined} value * @return {!proto.identity.auth.UserIdentityResponse} returns this */ proto.identity.auth.UserIdentityResponse.prototype.setIdentity = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.auth.UserIdentityResponse} returns this */ proto.identity.auth.UserIdentityResponse.prototype.clearIdentity = function() { return this.setIdentity(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.auth.UserIdentityResponse.prototype.hasIdentity = function() { return jspb.Message.getField(this, 1) != null; }; goog.object.extend(exports, proto.identity.auth); diff --git a/web/protobufs/identity-auth-structs.cjs.flow b/web/protobufs/identity-auth-structs.cjs.flow index 6bc5a5127..cfdb2ef65 100644 --- a/web/protobufs/identity-auth-structs.cjs.flow +++ b/web/protobufs/identity-auth-structs.cjs.flow @@ -1,446 +1,480 @@ // @flow import { Message, BinaryWriter, BinaryReader, Map as ProtoMap, } from 'google-protobuf'; import * as identityStructs from './identity-unauth-structs.cjs'; declare export class EthereumIdentity extends Message { getWalletAddress(): string; setWalletAddress(value: string): EthereumIdentity; getSiweMessage(): string; setSiweMessage(value: string): EthereumIdentity; getSiweSignature(): string; setSiweSignature(value: string): EthereumIdentity; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): EthereumIdentityObject; static toObject(includeInstance: boolean, msg: EthereumIdentity): EthereumIdentityObject; static serializeBinaryToWriter(message: EthereumIdentity, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): EthereumIdentity; static deserializeBinaryFromReader(message: EthereumIdentity, reader: BinaryReader): EthereumIdentity; } export type EthereumIdentityObject = { walletAddress: string, siweMessage: string, siweSignature: string, } declare export class Identity extends Message { getUsername(): string; setUsername(value: string): Identity; getEthIdentity(): EthereumIdentity | void; setEthIdentity(value?: EthereumIdentity): Identity; hasEthIdentity(): boolean; clearEthIdentity(): Identity; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): IdentityObject; static toObject(includeInstance: boolean, msg: Identity): IdentityObject; static serializeBinaryToWriter(message: Identity, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Identity; static deserializeBinaryFromReader(message: Identity, reader: BinaryReader): Identity; } export type IdentityObject = { username: string, ethIdentity: ?EthereumIdentityObject, } declare export class UploadOneTimeKeysRequest extends Message { getContentOneTimePrekeysList(): Array; setContentOneTimePrekeysList(value: Array): UploadOneTimeKeysRequest; clearContentOneTimePrekeysList(): UploadOneTimeKeysRequest; addContentOneTimePrekeys(value: string, index?: number): UploadOneTimeKeysRequest; getNotifOneTimePrekeysList(): Array; setNotifOneTimePrekeysList(value: Array): UploadOneTimeKeysRequest; clearNotifOneTimePrekeysList(): UploadOneTimeKeysRequest; addNotifOneTimePrekeys(value: string, index?: number): UploadOneTimeKeysRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UploadOneTimeKeysRequestObject; static toObject(includeInstance: boolean, msg: UploadOneTimeKeysRequest): UploadOneTimeKeysRequestObject; static serializeBinaryToWriter(message: UploadOneTimeKeysRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UploadOneTimeKeysRequest; static deserializeBinaryFromReader(message: UploadOneTimeKeysRequest, reader: BinaryReader): UploadOneTimeKeysRequest; } export type UploadOneTimeKeysRequestObject = { contentOneTimePrekeysList: Array, notifOneTimePrekeysList: Array, }; declare export class RefreshUserPrekeysRequest extends Message { getNewContentPrekeys(): identityStructs.Prekey | void; setNewContentPrekeys(value?: identityStructs.Prekey): RefreshUserPrekeysRequest; hasNewContentPrekeys(): boolean; clearNewContentPrekeys(): RefreshUserPrekeysRequest; getNewNotifPrekeys(): identityStructs.Prekey | void; setNewNotifPrekeys(value?: identityStructs.Prekey): RefreshUserPrekeysRequest; hasNewNotifPrekeys(): boolean; clearNewNotifPrekeys(): RefreshUserPrekeysRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RefreshUserPrekeysRequestObject; static toObject(includeInstance: boolean, msg: RefreshUserPrekeysRequest): RefreshUserPrekeysRequestObject; static serializeBinaryToWriter(message: RefreshUserPrekeysRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): RefreshUserPrekeysRequest; static deserializeBinaryFromReader(message: RefreshUserPrekeysRequest, reader: BinaryReader): RefreshUserPrekeysRequest; } export type RefreshUserPrekeysRequestObject = { newContentPrekeys?: identityStructs.PrekeyObject, newNotifPrekeys?: identityStructs.PrekeyObject, } declare export class OutboundKeyInfo extends Message { getIdentityInfo(): identityStructs.IdentityKeyInfo | void; setIdentityInfo(value?: identityStructs.IdentityKeyInfo): OutboundKeyInfo; hasIdentityInfo(): boolean; clearIdentityInfo(): OutboundKeyInfo; getContentPrekey(): identityStructs.Prekey | void; setContentPrekey(value?: identityStructs.Prekey): OutboundKeyInfo; hasContentPrekey(): boolean; clearContentPrekey(): OutboundKeyInfo; getNotifPrekey(): identityStructs.Prekey | void; setNotifPrekey(value?: identityStructs.Prekey): OutboundKeyInfo; hasNotifPrekey(): boolean; clearNotifPrekey(): OutboundKeyInfo; getOneTimeContentPrekey(): string; setOneTimeContentPrekey(value: string): OutboundKeyInfo; hasOneTimeContentPrekey(): boolean; clearOneTimeContentPrekey(): OutboundKeyInfo; getOneTimeNotifPrekey(): string; setOneTimeNotifPrekey(value: string): OutboundKeyInfo; hasOneTimeNotifPrekey(): boolean; clearOneTimeNotifPrekey(): OutboundKeyInfo; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OutboundKeyInfoObject; static toObject(includeInstance: boolean, msg: OutboundKeyInfo): OutboundKeyInfoObject; static serializeBinaryToWriter(message: OutboundKeyInfo, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): OutboundKeyInfo; static deserializeBinaryFromReader(message: OutboundKeyInfo, reader: BinaryReader): OutboundKeyInfo; } export type OutboundKeyInfoObject = { identityInfo?: identityStructs.IdentityKeyInfoObject, contentPrekey?: identityStructs.PrekeyObject, notifPrekey?: identityStructs.PrekeyObject, oneTimeContentPrekey?: string, oneTimeNotifPrekey?: string, }; declare export class KeyserverKeysResponse extends Message { getKeyserverInfo(): OutboundKeyInfo | void; setKeyserverInfo(value?: OutboundKeyInfo): KeyserverKeysResponse; hasKeyserverInfo(): boolean; clearKeyserverInfo(): KeyserverKeysResponse; getIdentity(): Identity | void; setIdentity(value?: Identity): KeyserverKeysResponse; hasIdentity(): boolean; clearIdentity(): KeyserverKeysResponse; getPrimaryDeviceIdentityInfo(): identityStructs.IdentityKeyInfo | void; setPrimaryDeviceIdentityInfo(value?: identityStructs.IdentityKeyInfo): KeyserverKeysResponse; hasPrimaryDeviceIdentityInfo(): boolean; clearPrimaryDeviceIdentityInfo(): KeyserverKeysResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): KeyserverKeysResponseObject; static toObject(includeInstance: boolean, msg: KeyserverKeysResponse): KeyserverKeysResponseObject; static serializeBinaryToWriter(message: KeyserverKeysResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): KeyserverKeysResponse; static deserializeBinaryFromReader(message: KeyserverKeysResponse, reader: BinaryReader): KeyserverKeysResponse; } export type KeyserverKeysResponseObject = { keyserverInfo: ?OutboundKeyInfoObject, identity: ?IdentityObject, primaryDeviceIdentityInfo: ?identityStructs.IdentityKeyInfoObject, }; declare export class OutboundKeysForUserResponse extends Message { getDevicesMap(): ProtoMap; clearDevicesMap(): OutboundKeysForUserResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OutboundKeysForUserResponseObject; static toObject(includeInstance: boolean, msg: OutboundKeysForUserResponse): OutboundKeysForUserResponseObject; static serializeBinaryToWriter(message: OutboundKeysForUserResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): OutboundKeysForUserResponse; static deserializeBinaryFromReader(message: OutboundKeysForUserResponse, reader: BinaryReader): OutboundKeysForUserResponse; } export type OutboundKeysForUserResponseObject = { devicesMap: Array<[string, OutboundKeyInfoObject]>, }; declare export class OutboundKeysForUserRequest extends Message { getUserId(): string; setUserId(value: string): OutboundKeysForUserRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OutboundKeysForUserRequestObject; static toObject(includeInstance: boolean, msg: OutboundKeysForUserRequest): OutboundKeysForUserRequestObject; static serializeBinaryToWriter(message: OutboundKeysForUserRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): OutboundKeysForUserRequest; static deserializeBinaryFromReader(message: OutboundKeysForUserRequest, reader: BinaryReader): OutboundKeysForUserRequest; } export type OutboundKeysForUserRequestObject = { userId: string, }; declare export class InboundKeyInfo extends Message { getIdentityInfo(): identityStructs.IdentityKeyInfo | void; setIdentityInfo(value?: identityStructs.IdentityKeyInfo): InboundKeyInfo; hasIdentityInfo(): boolean; clearIdentityInfo(): InboundKeyInfo; getContentPrekey(): identityStructs.Prekey | void; setContentPrekey(value?: identityStructs.Prekey): InboundKeyInfo; hasContentPrekey(): boolean; clearContentPrekey(): InboundKeyInfo; getNotifPrekey(): identityStructs.Prekey | void; setNotifPrekey(value?: identityStructs.Prekey): InboundKeyInfo; hasNotifPrekey(): boolean; clearNotifPrekey(): InboundKeyInfo; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InboundKeyInfoObject; static toObject(includeInstance: boolean, msg: InboundKeyInfo): InboundKeyInfoObject; static serializeBinaryToWriter(message: InboundKeyInfo, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): InboundKeyInfo; static deserializeBinaryFromReader(message: InboundKeyInfo, reader: BinaryReader): InboundKeyInfo; } export type InboundKeyInfoObject = { identityInfo?: identityStructs.IdentityKeyInfoObject, contentPrekey?: identityStructs.PrekeyObject, notifPrekey?: identityStructs.PrekeyObject, }; declare export class InboundKeysForUserResponse extends Message { getDevicesMap(): ProtoMap; clearDevicesMap(): InboundKeysForUserResponse; getIdentity(): Identity | void; setIdentity(value?: Identity): InboundKeysForUserResponse; hasIdentity(): boolean; clearIdentity(): InboundKeysForUserResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InboundKeysForUserResponseObject; static toObject(includeInstance: boolean, msg: InboundKeysForUserResponse): InboundKeysForUserResponseObject; static serializeBinaryToWriter(message: InboundKeysForUserResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): InboundKeysForUserResponse; static deserializeBinaryFromReader(message: InboundKeysForUserResponse, reader: BinaryReader): InboundKeysForUserResponse; } export type InboundKeysForUserResponseObject = { devicesMap: Array<[string, InboundKeyInfoObject]>, identity: ?IdentityObject, } declare export class InboundKeysForUserRequest extends Message { getUserId(): string; setUserId(value: string): InboundKeysForUserRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InboundKeysForUserRequestObject; static toObject(includeInstance: boolean, msg: InboundKeysForUserRequest): InboundKeysForUserRequestObject; static serializeBinaryToWriter(message: InboundKeysForUserRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): InboundKeysForUserRequest; static deserializeBinaryFromReader(message: InboundKeysForUserRequest, reader: BinaryReader): InboundKeysForUserRequest; } export type InboundKeysForUserRequestObject = { userId: string, }; declare export class UpdateUserPasswordStartRequest extends Message { getOpaqueRegistrationRequest(): Uint8Array | string; getOpaqueRegistrationRequest_asU8(): Uint8Array; getOpaqueRegistrationRequest_asB64(): string; setOpaqueRegistrationRequest(value: Uint8Array | string): UpdateUserPasswordStartRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UpdateUserPasswordStartRequestObject; static toObject(includeInstance: boolean, msg: UpdateUserPasswordStartRequest): UpdateUserPasswordStartRequestObject; static serializeBinaryToWriter(message: UpdateUserPasswordStartRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UpdateUserPasswordStartRequest; static deserializeBinaryFromReader(message: UpdateUserPasswordStartRequest, reader: BinaryReader): UpdateUserPasswordStartRequest; } export type UpdateUserPasswordStartRequestObject = { opaqueRegistrationRequest: Uint8Array | string, }; declare export class UpdateUserPasswordFinishRequest extends Message { getSessionId(): string; setSessionId(value: string): UpdateUserPasswordFinishRequest; getOpaqueRegistrationUpload(): Uint8Array | string; getOpaqueRegistrationUpload_asU8(): Uint8Array; getOpaqueRegistrationUpload_asB64(): string; setOpaqueRegistrationUpload(value: Uint8Array | string): UpdateUserPasswordFinishRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UpdateUserPasswordFinishRequestObject; static toObject(includeInstance: boolean, msg: UpdateUserPasswordFinishRequest): UpdateUserPasswordFinishRequestObject; static serializeBinaryToWriter(message: UpdateUserPasswordFinishRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UpdateUserPasswordFinishRequest; static deserializeBinaryFromReader(message: UpdateUserPasswordFinishRequest, reader: BinaryReader): UpdateUserPasswordFinishRequest; } export type UpdateUserPasswordFinishRequestObject = { sessionId: string, opaqueRegistrationUpload: Uint8Array | string, }; declare export class UpdateUserPasswordStartResponse extends Message { getSessionId(): string; setSessionId(value: string): UpdateUserPasswordStartResponse; getOpaqueRegistrationResponse(): Uint8Array | string; getOpaqueRegistrationResponse_asU8(): Uint8Array; getOpaqueRegistrationResponse_asB64(): string; setOpaqueRegistrationResponse(value: Uint8Array | string): UpdateUserPasswordStartResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UpdateUserPasswordStartResponseObject; static toObject(includeInstance: boolean, msg: UpdateUserPasswordStartResponse): UpdateUserPasswordStartResponseObject; static serializeBinaryToWriter(message: UpdateUserPasswordStartResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UpdateUserPasswordStartResponse; static deserializeBinaryFromReader(message: UpdateUserPasswordStartResponse, reader: BinaryReader): UpdateUserPasswordStartResponse; } export type UpdateUserPasswordStartResponseObject = { sessionId: string, opaqueRegistrationResponse: Uint8Array | string, }; export type SinceTimestampCase = 0 | 2; declare export class GetDeviceListRequest extends Message { getUserId(): string; setUserId(value: string): GetDeviceListRequest; getSinceTimestamp(): number; setSinceTimestamp(value: number): GetDeviceListRequest; hasSinceTimestamp(): boolean; clearSinceTimestamp(): GetDeviceListRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetDeviceListRequestObject; static toObject(includeInstance: boolean, msg: GetDeviceListRequest): GetDeviceListRequestObject; static serializeBinaryToWriter(message: GetDeviceListRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): GetDeviceListRequest; static deserializeBinaryFromReader(message: GetDeviceListRequest, reader: BinaryReader): GetDeviceListRequest; } export type GetDeviceListRequestObject = { userId: string, sinceTimestamp?: number, } declare export class GetDeviceListResponse extends Message { getDeviceListUpdatesList(): Array; setDeviceListUpdatesList(value: Array): GetDeviceListResponse; clearDeviceListUpdatesList(): GetDeviceListResponse; addDeviceListUpdates(value: string, index?: number): GetDeviceListResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetDeviceListResponseObject; static toObject(includeInstance: boolean, msg: GetDeviceListResponse): GetDeviceListResponseObject; static serializeBinaryToWriter(message: GetDeviceListResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): GetDeviceListResponse; static deserializeBinaryFromReader(message: GetDeviceListResponse, reader: BinaryReader): GetDeviceListResponse; } export type GetDeviceListResponseObject = { deviceListUpdatesList: Array, } +declare export class PeersDeviceListsRequest extends Message { + getUserIdsList(): Array; + setUserIdsList(value: Array): PeersDeviceListsRequest; + clearUserIdsList(): PeersDeviceListsRequest; + addUserIds(value: string, index?: number): PeersDeviceListsRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PeersDeviceListsRequestObject; + static toObject(includeInstance: boolean, msg: PeersDeviceListsRequest): PeersDeviceListsRequestObject; + static serializeBinaryToWriter(message: PeersDeviceListsRequest, writer: BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PeersDeviceListsRequest; + static deserializeBinaryFromReader(message: PeersDeviceListsRequest, reader: BinaryReader): PeersDeviceListsRequest; +} + +export type PeersDeviceListsRequestObject = { + userIdsList: Array, +} + +declare export class PeersDeviceListsResponse extends Message { + getUsersDeviceListsMap(): ProtoMap; + clearUsersDeviceListsMap(): PeersDeviceListsResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PeersDeviceListsResponseObject; + static toObject(includeInstance: boolean, msg: PeersDeviceListsResponse): PeersDeviceListsResponseObject; + static serializeBinaryToWriter(message: PeersDeviceListsResponse, writer: BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PeersDeviceListsResponse; + static deserializeBinaryFromReader(message: PeersDeviceListsResponse, reader: BinaryReader): PeersDeviceListsResponse; +} + +export type PeersDeviceListsResponseObject = { + usersDeviceListsMap: Array<[string, string]>, +} + declare export class UpdateDeviceListRequest extends Message { getNewDeviceList(): string; setNewDeviceList(value: string): UpdateDeviceListRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UpdateDeviceListRequestObject; static toObject(includeInstance: boolean, msg: UpdateDeviceListRequest): UpdateDeviceListRequestObject; static serializeBinaryToWriter(message: UpdateDeviceListRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UpdateDeviceListRequest; static deserializeBinaryFromReader(message: UpdateDeviceListRequest, reader: BinaryReader): UpdateDeviceListRequest; } export type UpdateDeviceListRequestObject = { newDeviceList: string, } declare export class LinkFarcasterAccountRequest extends Message { getFarcasterId(): string; setFarcasterId(value: string): LinkFarcasterAccountRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LinkFarcasterAccountRequestObject; static toObject(includeInstance: boolean, msg: LinkFarcasterAccountRequest): LinkFarcasterAccountRequestObject; static serializeBinaryToWriter(message: LinkFarcasterAccountRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): LinkFarcasterAccountRequest; static deserializeBinaryFromReader(message: LinkFarcasterAccountRequest, reader: BinaryReader): LinkFarcasterAccountRequest; } export type LinkFarcasterAccountRequestObject = { farcasterId: string, } declare export class UserIdentityRequest extends Message { getUserId(): string; setUserId(value: string): UserIdentityRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UserIdentityRequestObject; static toObject(includeInstance: boolean, msg: UserIdentityRequest): UserIdentityRequestObject; static serializeBinaryToWriter(message: UserIdentityRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UserIdentityRequest; static deserializeBinaryFromReader(message: UserIdentityRequest, reader: BinaryReader): UserIdentityRequest; } export type UserIdentityRequestObject = { userId: string, } declare export class UserIdentityResponse extends Message { getIdentity(): Identity | void; setIdentity(value?: Identity): UserIdentityResponse; hasIdentity(): boolean; clearIdentity(): UserIdentityResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UserIdentityResponseObject; static toObject(includeInstance: boolean, msg: UserIdentityResponse): UserIdentityResponseObject; static serializeBinaryToWriter(message: UserIdentityResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): UserIdentityResponse; static deserializeBinaryFromReader(message: UserIdentityResponse, reader: BinaryReader): UserIdentityResponse; } export type UserIdentityResponseObject = { identity: ?IdentityObject, }