From b202cd65badecb0fa4562f09d90207bd26b7b6d1 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Thu, 26 Sep 2024 12:49:25 +0100 Subject: [PATCH] Add MessagePack versions of all Community/Group/User endpoints (#6463) --- backend/canisters/community/CHANGELOG.md | 4 ++ .../api/src/queries/channel_summary.rs | 3 ++ .../src/queries/channel_summary_updates.rs | 3 ++ .../api/src/queries/deleted_message.rs | 4 ++ .../community/api/src/queries/events.rs | 2 + .../api/src/queries/events_by_index.rs | 2 + .../api/src/queries/events_window.rs | 2 + .../api/src/queries/explore_channels.rs | 4 ++ .../community/api/src/queries/invite_code.rs | 3 ++ .../api/src/queries/local_user_index.rs | 2 + .../src/queries/messages_by_message_index.rs | 3 ++ .../api/src/queries/search_channel.rs | 4 ++ .../src/queries/selected_channel_initial.rs | 4 ++ .../queries/selected_channel_updates_v2.rs | 3 ++ .../api/src/queries/selected_initial.rs | 4 ++ .../api/src/queries/selected_updates_v2.rs | 15 ++---- .../community/api/src/queries/summary.rs | 3 ++ .../api/src/queries/summary_updates.rs | 3 ++ .../api/src/queries/thread_previews.rs | 4 ++ .../src/queries/video_call_participants.rs | 3 ++ .../api/src/updates/accept_p2p_swap.rs | 3 ++ .../api/src/updates/add_members_to_channel.rs | 6 +++ .../community/api/src/updates/add_reaction.rs | 3 ++ .../community/api/src/updates/block_user.rs | 3 ++ .../api/src/updates/cancel_invites.rs | 3 ++ .../api/src/updates/cancel_p2p_swap.rs | 3 ++ .../api/src/updates/change_channel_role.rs | 3 ++ .../community/api/src/updates/change_role.rs | 3 ++ .../community/api/src/updates/claim_prize.rs | 3 ++ .../api/src/updates/create_channel.rs | 4 ++ .../api/src/updates/create_user_group.rs | 4 ++ .../api/src/updates/decline_invitation.rs | 3 ++ .../api/src/updates/delete_channel.rs | 3 ++ .../api/src/updates/delete_messages.rs | 3 ++ .../api/src/updates/delete_user_groups.rs | 3 ++ .../api/src/updates/disable_invite_code.rs | 2 + .../community/api/src/updates/edit_message.rs | 3 ++ .../api/src/updates/enable_invite_code.rs | 3 ++ .../api/src/updates/follow_thread.rs | 3 ++ .../community/api/src/updates/import_group.rs | 4 ++ .../api/src/updates/join_video_call.rs | 2 + .../api/src/updates/leave_channel.rs | 3 ++ .../community/api/src/updates/pin_message.rs | 3 ++ .../api/src/updates/register_poll_vote.rs | 3 ++ .../api/src/updates/register_proposal_vote.rs | 3 ++ .../api/src/updates/remove_member.rs | 3 ++ .../src/updates/remove_member_from_channel.rs | 3 ++ .../api/src/updates/remove_reaction.rs | 3 ++ .../api/src/updates/report_message.rs | 3 ++ .../src/updates/set_member_display_name.rs | 3 ++ .../src/updates/set_video_call_presence.rs | 3 ++ .../src/updates/toggle_mute_notifications.rs | 3 ++ .../community/api/src/updates/unblock_user.rs | 3 ++ .../api/src/updates/undelete_messages.rs | 4 ++ .../api/src/updates/unfollow_thread.rs | 3 ++ .../api/src/updates/update_channel.rs | 8 +++ .../api/src/updates/update_community.rs | 7 +++ .../api/src/updates/update_user_group.rs | 3 ++ .../impl/src/queries/channel_summary.rs | 4 +- .../src/queries/channel_summary_updates.rs | 4 +- .../impl/src/queries/deleted_message.rs | 4 +- .../community/impl/src/queries/events.rs | 2 +- .../impl/src/queries/events_by_index.rs | 2 +- .../impl/src/queries/events_window.rs | 2 +- .../impl/src/queries/explore_channels.rs | 4 +- .../community/impl/src/queries/invite_code.rs | 4 +- .../impl/src/queries/local_user_index.rs | 4 +- .../src/queries/messages_by_message_index.rs | 4 +- .../impl/src/queries/search_channel.rs | 4 +- .../src/queries/selected_channel_initial.rs | 4 +- .../src/queries/selected_channel_updates.rs | 4 +- .../impl/src/queries/selected_initial.rs | 4 +- .../impl/src/queries/selected_updates.rs | 4 +- .../community/impl/src/queries/summary.rs | 2 +- .../impl/src/queries/summary_updates.rs | 2 +- .../impl/src/queries/thread_previews.rs | 4 +- .../src/queries/video_call_participants.rs | 4 +- .../impl/src/updates/accept_p2p_swap.rs | 4 +- .../src/updates/add_members_to_channel.rs | 4 +- .../impl/src/updates/cancel_invites.rs | 4 +- .../impl/src/updates/cancel_p2p_swap.rs | 4 +- .../community/impl/src/updates/change_role.rs | 4 +- .../community/impl/src/updates/claim_prize.rs | 4 +- .../impl/src/updates/create_channel.rs | 2 +- .../impl/src/updates/create_user_group.rs | 4 +- .../impl/src/updates/decline_invitation.rs | 4 +- .../impl/src/updates/delete_user_groups.rs | 4 +- .../impl/src/updates/disable_invite_code.rs | 4 +- .../impl/src/updates/edit_message.rs | 4 +- .../impl/src/updates/enable_invite_code.rs | 6 +-- .../impl/src/updates/follow_thread.rs | 4 +- .../impl/src/updates/join_video_call.rs | 4 +- .../impl/src/updates/leave_channel.rs | 4 +- .../community/impl/src/updates/pin_message.rs | 6 +-- .../impl/src/updates/register_poll_vote.rs | 4 +- .../src/updates/register_proposal_vote.rs | 4 +- .../src/updates/register_proposal_vote_v2.rs | 4 +- .../impl/src/updates/remove_member.rs | 6 +-- .../src/updates/remove_member_from_channel.rs | 4 +- .../impl/src/updates/remove_reaction.rs | 4 +- .../impl/src/updates/report_message.rs | 4 +- .../src/updates/set_member_display_name.rs | 4 +- .../src/updates/set_video_call_presence.rs | 4 +- .../src/updates/toggle_mute_notifications.rs | 4 +- .../impl/src/updates/unblock_user.rs | 4 +- .../impl/src/updates/undelete_messages.rs | 4 +- .../impl/src/updates/unfollow_thread.rs | 4 +- .../impl/src/updates/update_channel.rs | 4 +- .../impl/src/updates/update_community.rs | 4 +- .../impl/src/updates/update_user_group.rs | 4 +- backend/canisters/group/CHANGELOG.md | 4 ++ backend/canisters/group/api/src/lib.rs | 2 + .../group/api/src/queries/deleted_message.rs | 4 ++ .../canisters/group/api/src/queries/events.rs | 2 + .../group/api/src/queries/events_by_index.rs | 2 + .../group/api/src/queries/events_window.rs | 2 + .../group/api/src/queries/invite_code.rs | 3 ++ .../group/api/src/queries/local_user_index.rs | 2 + .../src/queries/messages_by_message_index.rs | 3 ++ .../group/api/src/queries/public_summary.rs | 4 ++ .../canisters/group/api/src/queries/rules.rs | 4 ++ .../group/api/src/queries/search_messages.rs | 4 ++ .../group/api/src/queries/selected_initial.rs | 3 ++ .../api/src/queries/selected_updates_v2.rs | 3 ++ .../group/api/src/queries/summary.rs | 3 ++ .../group/api/src/queries/summary_updates.rs | 4 ++ .../group/api/src/queries/thread_previews.rs | 4 ++ .../src/queries/video_call_participants.rs | 3 ++ .../group/api/src/updates/accept_p2p_swap.rs | 3 ++ .../group/api/src/updates/add_reaction.rs | 3 ++ .../group/api/src/updates/block_user.rs | 3 ++ .../group/api/src/updates/cancel_invites.rs | 3 ++ .../group/api/src/updates/cancel_p2p_swap.rs | 3 ++ .../group/api/src/updates/change_role.rs | 3 ++ .../group/api/src/updates/claim_prize.rs | 3 ++ .../api/src/updates/convert_into_community.rs | 4 ++ .../api/src/updates/decline_invitation.rs | 2 + .../group/api/src/updates/delete_messages.rs | 3 ++ .../api/src/updates/disable_invite_code.rs | 3 ++ .../group/api/src/updates/edit_message_v2.rs | 3 ++ .../api/src/updates/enable_invite_code.rs | 4 ++ .../group/api/src/updates/follow_thread.rs | 3 ++ .../group/api/src/updates/join_video_call.rs | 2 + .../group/api/src/updates/pin_message_v2.rs | 3 ++ .../api/src/updates/register_poll_vote.rs | 3 ++ .../api/src/updates/register_proposal_vote.rs | 3 ++ .../api/src/updates/remove_participant.rs | 3 ++ .../group/api/src/updates/remove_reaction.rs | 3 ++ .../group/api/src/updates/report_message.rs | 3 ++ .../src/updates/set_video_call_presence.rs | 3 ++ .../src/updates/toggle_mute_notifications.rs | 3 ++ .../group/api/src/updates/unblock_user.rs | 3 ++ .../api/src/updates/undelete_messages.rs | 4 ++ .../group/api/src/updates/unfollow_thread.rs | 3 ++ .../group/api/src/updates/unpin_message.rs | 3 ++ .../group/api/src/updates/update_group_v2.rs | 7 +++ .../group/impl/src/queries/deleted_message.rs | 4 +- .../group/impl/src/queries/invite_code.rs | 4 +- .../impl/src/queries/local_user_index.rs | 4 +- .../src/queries/messages_by_message_index.rs | 4 +- .../group/impl/src/queries/search_messages.rs | 4 +- .../impl/src/queries/selected_initial.rs | 4 +- .../impl/src/queries/selected_updates.rs | 4 +- .../group/impl/src/queries/thread_previews.rs | 4 +- .../src/queries/video_call_participants.rs | 4 +- .../group/impl/src/updates/accept_p2p_swap.rs | 4 +- .../group/impl/src/updates/add_reaction.rs | 4 +- .../group/impl/src/updates/cancel_invites.rs | 4 +- .../group/impl/src/updates/cancel_p2p_swap.rs | 4 +- .../group/impl/src/updates/change_role.rs | 4 +- .../group/impl/src/updates/claim_prize.rs | 4 +- .../src/updates/convert_into_community.rs | 4 +- .../impl/src/updates/decline_invitation.rs | 4 +- .../impl/src/updates/disable_invite_code.rs | 4 +- .../group/impl/src/updates/edit_message.rs | 4 +- .../impl/src/updates/enable_invite_code.rs | 6 +-- .../group/impl/src/updates/follow_thread.rs | 4 +- .../group/impl/src/updates/join_video_call.rs | 4 +- .../group/impl/src/updates/pin_message.rs | 4 +- .../impl/src/updates/register_poll_vote.rs | 4 +- .../src/updates/register_proposal_vote.rs | 4 +- .../src/updates/register_proposal_vote_v2.rs | 4 +- .../impl/src/updates/remove_participant.rs | 6 +-- .../group/impl/src/updates/remove_reaction.rs | 4 +- .../group/impl/src/updates/report_message.rs | 4 +- .../src/updates/set_video_call_presence.rs | 4 +- .../src/updates/toggle_mute_notifications.rs | 4 +- .../group/impl/src/updates/unblock_user.rs | 4 +- .../impl/src/updates/undelete_messages.rs | 4 +- .../group/impl/src/updates/unfollow_thread.rs | 4 +- .../group/impl/src/updates/unpin_message.rs | 4 +- .../group/impl/src/updates/update_group_v2.rs | 4 +- .../canisters/proposals_bot/api/src/lib.rs | 14 ++--- backend/canisters/user/CHANGELOG.md | 1 + .../user/impl/src/queries/chit_events.rs | 2 +- .../user/impl/src/queries/contacts.rs | 2 +- .../user/impl/src/queries/deleted_message.rs | 2 +- .../impl/src/queries/hot_group_exclusions.rs | 2 +- .../user/impl/src/queries/local_user_index.rs | 2 +- .../user/impl/src/queries/public_profile.rs | 2 +- .../impl/src/queries/saved_crypto_accounts.rs | 2 +- .../user/impl/src/queries/search_messages.rs | 2 +- .../impl/src/queries/token_swap_status.rs | 2 +- .../user/impl/src/updates/accept_p2p_swap.rs | 2 +- .../src/updates/add_hot_group_exclusions.rs | 4 +- .../user/impl/src/updates/add_reaction.rs | 2 +- .../user/impl/src/updates/approve_transfer.rs | 2 +- .../src/updates/archive_unarchive_chats.rs | 2 +- .../user/impl/src/updates/block_user.rs | 2 +- .../user/impl/src/updates/btc_address.rs | 2 +- .../src/updates/cancel_message_reminder.rs | 2 +- .../user/impl/src/updates/cancel_p2p_swap.rs | 2 +- .../user/impl/src/updates/claim_daily_chit.rs | 2 +- .../user/impl/src/updates/configure_wallet.rs | 2 +- .../user/impl/src/updates/create_community.rs | 2 +- .../user/impl/src/updates/create_group.rs | 2 +- .../user/impl/src/updates/delete_community.rs | 2 +- .../impl/src/updates/delete_direct_chat.rs | 2 +- .../user/impl/src/updates/delete_group.rs | 2 +- .../user/impl/src/updates/delete_messages.rs | 2 +- .../user/impl/src/updates/edit_message.rs | 2 +- .../user/impl/src/updates/join_video_call.rs | 2 +- .../user/impl/src/updates/leave_community.rs | 2 +- .../user/impl/src/updates/leave_group.rs | 2 +- .../src/updates/manage_favourite_chats.rs | 2 +- .../src/updates/mark_achievements_seen.rs | 2 +- .../user/impl/src/updates/mark_read.rs | 2 +- .../impl/src/updates/mute_notifications.rs | 4 +- .../user/impl/src/updates/pin_chat_v2.rs | 2 +- .../user/impl/src/updates/remove_reaction.rs | 2 +- .../user/impl/src/updates/report_message.rs | 2 +- .../user/impl/src/updates/retrieve_btc.rs | 2 +- .../impl/src/updates/save_crypto_account.rs | 2 +- .../user/impl/src/updates/set_avatar.rs | 2 +- .../user/impl/src/updates/set_bio.rs | 2 +- .../impl/src/updates/set_community_indexes.rs | 2 +- .../user/impl/src/updates/set_contact.rs | 2 +- .../impl/src/updates/set_message_reminder.rs | 2 +- .../user/impl/src/updates/set_pin_number.rs | 2 +- .../user/impl/src/updates/submit_proposal.rs | 2 +- .../user/impl/src/updates/swap_tokens.rs | 2 +- .../user/impl/src/updates/tip_message.rs | 2 +- .../user/impl/src/updates/unblock_user.rs | 2 +- .../impl/src/updates/undelete_messages.rs | 2 +- .../user/impl/src/updates/unpin_chat_v2.rs | 2 +- .../user/impl/src/updates/withdraw_crypto.rs | 2 +- backend/libraries/types/src/option.rs | 1 + backend/libraries/types/src/thread_preview.rs | 4 ++ backend/libraries/types/src/video_calls.rs | 3 ++ frontend/openchat-agent/src/typebox.ts | 52 +++++++++---------- ....ts => ProposalsBotCanisterInstallMode.ts} | 2 +- ...sBotExecuteGenericNervousSystemFunction.ts | 4 ++ .../ProposalsBotProposalToSubmit.ts | 4 ++ .../ProposalsBotProposalToSubmitAction.ts | 6 +++ .../ProposalsBotTransferSnsTreasuryFunds.ts | 5 ++ ...monTreasury.ts => ProposalsBotTreasury.ts} | 2 +- ...roposalsBotUpgradeSnsControlledCanister.ts | 5 ++ ...mmonExecuteGenericNervousSystemFunction.ts | 4 -- .../ProposalsBotCommonProposalToSubmit.ts | 4 -- ...roposalsBotCommonProposalToSubmitAction.ts | 6 --- ...posalsBotCommonTransferSnsTreasuryFunds.ts | 5 -- ...lsBotCommonUpgradeSnsControlledCanister.ts | 5 -- tsBindings/types.d.ts | 16 +++--- .../submitProposal/UserSubmitProposalArgs.ts | 4 +- 264 files changed, 642 insertions(+), 311 deletions(-) rename tsBindings/proposalsBot/{common/ProposalsBotCommonCanisterInstallMode.ts => ProposalsBotCanisterInstallMode.ts} (55%) create mode 100644 tsBindings/proposalsBot/ProposalsBotExecuteGenericNervousSystemFunction.ts create mode 100644 tsBindings/proposalsBot/ProposalsBotProposalToSubmit.ts create mode 100644 tsBindings/proposalsBot/ProposalsBotProposalToSubmitAction.ts create mode 100644 tsBindings/proposalsBot/ProposalsBotTransferSnsTreasuryFunds.ts rename tsBindings/proposalsBot/{common/ProposalsBotCommonTreasury.ts => ProposalsBotTreasury.ts} (66%) create mode 100644 tsBindings/proposalsBot/ProposalsBotUpgradeSnsControlledCanister.ts delete mode 100644 tsBindings/proposalsBot/common/ProposalsBotCommonExecuteGenericNervousSystemFunction.ts delete mode 100644 tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmit.ts delete mode 100644 tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmitAction.ts delete mode 100644 tsBindings/proposalsBot/common/ProposalsBotCommonTransferSnsTreasuryFunds.ts delete mode 100644 tsBindings/proposalsBot/common/ProposalsBotCommonUpgradeSnsControlledCanister.ts diff --git a/backend/canisters/community/CHANGELOG.md b/backend/canisters/community/CHANGELOG.md index 44f81427ee..dee38d60fc 100644 --- a/backend/canisters/community/CHANGELOG.md +++ b/backend/canisters/community/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +### Added + +- Add MessagePack versions of all endpoints ([#6463](https://github.com/open-chat-labs/open-chat/pull/6463)) + ### Changed - Increase max stable memory read / write buffer size ([#6440](https://github.com/open-chat-labs/open-chat/pull/6440)) diff --git a/backend/canisters/community/api/src/queries/channel_summary.rs b/backend/canisters/community/api/src/queries/channel_summary.rs index 0967b429ac..f982a5f82e 100644 --- a/backend/canisters/community/api/src/queries/channel_summary.rs +++ b/backend/canisters/community/api/src/queries/channel_summary.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, CommunityCanisterChannelSummary}; +#[ts_export(community, channel_summary)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub invite_code: Option, } +#[ts_export(community, channel_summary)] // Allow the large size difference because essentially all responses are the large variant anyway #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] diff --git a/backend/canisters/community/api/src/queries/channel_summary_updates.rs b/backend/canisters/community/api/src/queries/channel_summary_updates.rs index c697303569..6a4aa1ee7a 100644 --- a/backend/canisters/community/api/src/queries/channel_summary_updates.rs +++ b/backend/canisters/community/api/src/queries/channel_summary_updates.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, CommunityCanisterChannelSummary, CommunityCanisterChannelSummaryUpdates, TimestampMillis}; +#[ts_export(community, channel_summary_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { } // Allow the large size difference because essentially all responses are the large variant anyway +#[ts_export(community, channel_summary_updates)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { diff --git a/backend/canisters/community/api/src/queries/deleted_message.rs b/backend/canisters/community/api/src/queries/deleted_message.rs index 836647c51f..0f84f61d47 100644 --- a/backend/canisters/community/api/src/queries/deleted_message.rs +++ b/backend/canisters/community/api/src/queries/deleted_message.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageContent, MessageId, MessageIndex}; +#[ts_export(community, delete_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub message_id: MessageId, } +#[ts_export(community, delete_message)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { @@ -21,6 +24,7 @@ pub enum Response { MessageHardDeleted, } +#[ts_export(community, delete_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub content: MessageContent, diff --git a/backend/canisters/community/api/src/queries/events.rs b/backend/canisters/community/api/src/queries/events.rs index 8035c6a549..234ffcb18e 100644 --- a/backend/canisters/community/api/src/queries/events.rs +++ b/backend/canisters/community/api/src/queries/events.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, EventIndex, MessageIndex, TimestampMillis}; +#[ts_export(community, events)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, diff --git a/backend/canisters/community/api/src/queries/events_by_index.rs b/backend/canisters/community/api/src/queries/events_by_index.rs index 7d00314750..7ed5887f88 100644 --- a/backend/canisters/community/api/src/queries/events_by_index.rs +++ b/backend/canisters/community/api/src/queries/events_by_index.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, EventIndex, MessageIndex, TimestampMillis}; +#[ts_export(community, events_by_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, diff --git a/backend/canisters/community/api/src/queries/events_window.rs b/backend/canisters/community/api/src/queries/events_window.rs index ea4139b8e7..087e8bea8c 100644 --- a/backend/canisters/community/api/src/queries/events_window.rs +++ b/backend/canisters/community/api/src/queries/events_window.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex, TimestampMillis}; +#[ts_export(community, events_window)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, diff --git a/backend/canisters/community/api/src/queries/explore_channels.rs b/backend/canisters/community/api/src/queries/explore_channels.rs index 6663ec9f32..7ae27d9e58 100644 --- a/backend/canisters/community/api/src/queries/explore_channels.rs +++ b/backend/canisters/community/api/src/queries/explore_channels.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::ChannelMatch; +#[ts_export(community, explore_channels)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, @@ -10,6 +12,7 @@ pub struct Args { pub page_size: u8, } +#[ts_export(community, explore_channels)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -19,6 +22,7 @@ pub enum Response { PrivateCommunity, } +#[ts_export(community, explore_channels)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub matches: Vec, diff --git a/backend/canisters/community/api/src/queries/invite_code.rs b/backend/canisters/community/api/src/queries/invite_code.rs index cb47044853..5cfc06a6fa 100644 --- a/backend/canisters/community/api/src/queries/invite_code.rs +++ b/backend/canisters/community/api/src/queries/invite_code.rs @@ -1,9 +1,11 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::Empty; pub type Args = Empty; +#[ts_export(community, invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -11,6 +13,7 @@ pub enum Response { NotAuthorized, } +#[ts_export(community, invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub code: Option, diff --git a/backend/canisters/community/api/src/queries/local_user_index.rs b/backend/canisters/community/api/src/queries/local_user_index.rs index 91c8faf6ff..b782865a77 100644 --- a/backend/canisters/community/api/src/queries/local_user_index.rs +++ b/backend/canisters/community/api/src/queries/local_user_index.rs @@ -1,9 +1,11 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CanisterId, Empty}; pub type Args = Empty; +#[ts_export(community, local_user_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(CanisterId), diff --git a/backend/canisters/community/api/src/queries/messages_by_message_index.rs b/backend/canisters/community/api/src/queries/messages_by_message_index.rs index b9e7e1c18a..d64cce1a23 100644 --- a/backend/canisters/community/api/src/queries/messages_by_message_index.rs +++ b/backend/canisters/community/api/src/queries/messages_by_message_index.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex, MessagesResponse, TimestampMillis}; +#[ts_export(community, messages_by_message_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { pub latest_known_update: Option, } +#[ts_export(community, messages_by_message_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(MessagesResponse), diff --git a/backend/canisters/community/api/src/queries/search_channel.rs b/backend/canisters/community/api/src/queries/search_channel.rs index 2219260cc9..2a37dc8a61 100644 --- a/backend/canisters/community/api/src/queries/search_channel.rs +++ b/backend/canisters/community/api/src/queries/search_channel.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageMatch, UserId}; +#[ts_export(community, search_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { pub users: Option>, } +#[ts_export(community, search_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -22,6 +25,7 @@ pub enum Response { UserNotInChannel, } +#[ts_export(community, search_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub matches: Vec, diff --git a/backend/canisters/community/api/src/queries/selected_channel_initial.rs b/backend/canisters/community/api/src/queries/selected_channel_initial.rs index 3d37f7865a..fc4edc834e 100644 --- a/backend/canisters/community/api/src/queries/selected_channel_initial.rs +++ b/backend/canisters/community/api/src/queries/selected_channel_initial.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, EventIndex, GroupMember, MessageIndex, TimestampMillis, UserId, VersionedRules}; +#[ts_export(community, selected_channel_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, } +#[ts_export(community, selected_channel_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -15,6 +18,7 @@ pub enum Response { PrivateChannel, } +#[ts_export(community, selected_channel_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub timestamp: TimestampMillis, diff --git a/backend/canisters/community/api/src/queries/selected_channel_updates_v2.rs b/backend/canisters/community/api/src/queries/selected_channel_updates_v2.rs index b694c421ed..85fd0bdcd6 100644 --- a/backend/canisters/community/api/src/queries/selected_channel_updates_v2.rs +++ b/backend/canisters/community/api/src/queries/selected_channel_updates_v2.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, SelectedGroupUpdates, TimestampMillis}; +#[ts_export(community, selected_channel_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub updates_since: TimestampMillis, } +#[ts_export(community, selected_channel_updates)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { diff --git a/backend/canisters/community/api/src/queries/selected_initial.rs b/backend/canisters/community/api/src/queries/selected_initial.rs index c4b7c792a3..89446d7965 100644 --- a/backend/canisters/community/api/src/queries/selected_initial.rs +++ b/backend/canisters/community/api/src/queries/selected_initial.rs @@ -1,18 +1,22 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CommunityMember, EventIndex, TimestampMillis, UserGroupDetails, UserId, VersionedRules}; +#[ts_export(community, selected_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, } +#[ts_export(community, selected_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), PrivateCommunity, } +#[ts_export(community, selected_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub timestamp: TimestampMillis, diff --git a/backend/canisters/community/api/src/queries/selected_updates_v2.rs b/backend/canisters/community/api/src/queries/selected_updates_v2.rs index bb92e83912..36801bf2c3 100644 --- a/backend/canisters/community/api/src/queries/selected_updates_v2.rs +++ b/backend/canisters/community/api/src/queries/selected_updates_v2.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CommunityMember, TimestampMillis, UserGroupDetails, UserId, VersionedRules}; +#[ts_export(community, selected_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, pub updates_since: TimestampMillis, } +#[ts_export(community, selected_updates)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { @@ -16,6 +19,7 @@ pub enum Response { PrivateCommunity, } +#[ts_export(community, selected_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub timestamp: TimestampMillis, @@ -31,14 +35,3 @@ pub struct SuccessResult { pub referrals_added: Vec, pub referrals_removed: Vec, } - -impl SuccessResult { - pub fn has_updates(&self) -> bool { - !self.members_added_or_updated.is_empty() - || !self.members_removed.is_empty() - || !self.blocked_users_added.is_empty() - || !self.blocked_users_removed.is_empty() - || self.invited_users.is_some() - || self.chat_rules.is_some() - } -} diff --git a/backend/canisters/community/api/src/queries/summary.rs b/backend/canisters/community/api/src/queries/summary.rs index a0b41a53b0..21122f7839 100644 --- a/backend/canisters/community/api/src/queries/summary.rs +++ b/backend/canisters/community/api/src/queries/summary.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::CommunityCanisterCommunitySummary; +#[ts_export(community, summary)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, } +#[ts_export(community, summary)] // Allow the large size difference because essentially all responses are the large variant anyway #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] diff --git a/backend/canisters/community/api/src/queries/summary_updates.rs b/backend/canisters/community/api/src/queries/summary_updates.rs index f74d615606..287a2308d0 100644 --- a/backend/canisters/community/api/src/queries/summary_updates.rs +++ b/backend/canisters/community/api/src/queries/summary_updates.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CommunityCanisterCommunitySummaryUpdates, TimestampMillis}; +#[ts_export(community, summary_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, @@ -9,6 +11,7 @@ pub struct Args { } // Allow the large size difference because essentially all responses are the large variant anyway +#[ts_export(community, summary_updates)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { diff --git a/backend/canisters/community/api/src/queries/thread_previews.rs b/backend/canisters/community/api/src/queries/thread_previews.rs index c315969d18..14e68fe88c 100644 --- a/backend/canisters/community/api/src/queries/thread_previews.rs +++ b/backend/canisters/community/api/src/queries/thread_previews.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex, ThreadPreview, TimestampMillis}; +#[ts_export(community, thread_previews)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub latest_client_thread_update: Option, } +#[ts_export(community, thread_previews)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -18,6 +21,7 @@ pub enum Response { ReplicaNotUpToDate(TimestampMillis), } +#[ts_export(community, thread_previews)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub threads: Vec, diff --git a/backend/canisters/community/api/src/queries/video_call_participants.rs b/backend/canisters/community/api/src/queries/video_call_participants.rs index 490ff2265e..bbb39330a7 100644 --- a/backend/canisters/community/api/src/queries/video_call_participants.rs +++ b/backend/canisters/community/api/src/queries/video_call_participants.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, TimestampMillis, VideoCallParticipants}; +#[ts_export(community, video_call_participants)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub updated_since: Option, } +#[ts_export(community, video_call_participants)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(VideoCallParticipants), diff --git a/backend/canisters/community/api/src/updates/accept_p2p_swap.rs b/backend/canisters/community/api/src/updates/accept_p2p_swap.rs index 7d5852f482..ec2335f520 100644 --- a/backend/canisters/community/api/src/updates/accept_p2p_swap.rs +++ b/backend/canisters/community/api/src/updates/accept_p2p_swap.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{AcceptSwapSuccess, ChannelId, MessageId, MessageIndex, Milliseconds, SwapStatusError}; +#[ts_export(community, accept_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -11,6 +13,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(community, accept_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(AcceptSwapSuccess), diff --git a/backend/canisters/community/api/src/updates/add_members_to_channel.rs b/backend/canisters/community/api/src/updates/add_members_to_channel.rs index e352bd8da7..87070e9b14 100644 --- a/backend/canisters/community/api/src/updates/add_members_to_channel.rs +++ b/backend/canisters/community/api/src/updates/add_members_to_channel.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, UserId}; +#[ts_export(community, add_members_to_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { pub added_by_display_name: Option, } +#[ts_export(community, add_members_to_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, @@ -26,6 +29,7 @@ pub enum Response { InternalError(String), } +#[ts_export(community, add_members_to_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct PartialSuccessResult { pub users_added: Vec, @@ -34,6 +38,7 @@ pub struct PartialSuccessResult { pub users_failed_with_error: Vec, } +#[ts_export(community, add_members_to_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct FailedResult { pub users_already_in_channel: Vec, @@ -41,6 +46,7 @@ pub struct FailedResult { pub users_failed_with_error: Vec, } +#[ts_export(community, add_members_to_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct UserFailedError { pub user_id: UserId, diff --git a/backend/canisters/community/api/src/updates/add_reaction.rs b/backend/canisters/community/api/src/updates/add_reaction.rs index b75f41524a..672527de5b 100644 --- a/backend/canisters/community/api/src/updates/add_reaction.rs +++ b/backend/canisters/community/api/src/updates/add_reaction.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, MessageIndex, Reaction}; +#[ts_export(community, add_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -13,6 +15,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(community, add_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/block_user.rs b/backend/canisters/community/api/src/updates/block_user.rs index 0cc4ebfa9f..46cf09db2a 100644 --- a/backend/canisters/community/api/src/updates/block_user.rs +++ b/backend/canisters/community/api/src/updates/block_user.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(community, block_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, } +#[ts_export(community, block_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/cancel_invites.rs b/backend/canisters/community/api/src/updates/cancel_invites.rs index 64aeb0e7a7..2f32f734b7 100644 --- a/backend/canisters/community/api/src/updates/cancel_invites.rs +++ b/backend/canisters/community/api/src/updates/cancel_invites.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, UserId}; +#[ts_export(community, cancel_invites)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: Option, pub user_ids: Vec, } +#[ts_export(community, cancel_invites)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/cancel_p2p_swap.rs b/backend/canisters/community/api/src/updates/cancel_p2p_swap.rs index f277fc99c3..5e1cdff88f 100644 --- a/backend/canisters/community/api/src/updates/cancel_p2p_swap.rs +++ b/backend/canisters/community/api/src/updates/cancel_p2p_swap.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, MessageIndex, SwapStatusError}; +#[ts_export(community, cancel_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub message_id: MessageId, } +#[ts_export(community, cancel_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/change_channel_role.rs b/backend/canisters/community/api/src/updates/change_channel_role.rs index 583c14d983..30ea9d654f 100644 --- a/backend/canisters/community/api/src/updates/change_channel_role.rs +++ b/backend/canisters/community/api/src/updates/change_channel_role.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, GroupRole, UserId}; +#[ts_export(community, change_channel_role)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub new_role: GroupRole, } +#[ts_export(community, change_channel_role)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/change_role.rs b/backend/canisters/community/api/src/updates/change_role.rs index 5b92cc88c3..ffa3d7e6cb 100644 --- a/backend/canisters/community/api/src/updates/change_role.rs +++ b/backend/canisters/community/api/src/updates/change_role.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CommunityRole, UserId}; +#[ts_export(community, change_role)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, pub new_role: CommunityRole, } +#[ts_export(community, change_role)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/claim_prize.rs b/backend/canisters/community/api/src/updates/claim_prize.rs index 3a89c040dd..326a6a5ca7 100644 --- a/backend/canisters/community/api/src/updates/claim_prize.rs +++ b/backend/canisters/community/api/src/updates/claim_prize.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, CompletedCryptoTransaction, FailedCryptoTransaction, MessageId}; +#[ts_export(community, claim_prize)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub message_id: MessageId, } +#[ts_export(community, claim_prize)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/create_channel.rs b/backend/canisters/community/api/src/updates/create_channel.rs index 196d4be2f7..db1053ef1c 100644 --- a/backend/canisters/community/api/src/updates/create_channel.rs +++ b/backend/canisters/community/api/src/updates/create_channel.rs @@ -1,10 +1,12 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ AccessGate, ChannelId, Document, FieldTooLongResult, FieldTooShortResult, GroupPermissions, GroupSubtype, Milliseconds, Rules, }; +#[ts_export(community, create_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub is_public: bool, @@ -21,6 +23,7 @@ pub struct Args { pub external_url: Option, } +#[ts_export(community, create_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -41,6 +44,7 @@ pub enum Response { InternalError(String), } +#[ts_export(community, create_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub channel_id: ChannelId, diff --git a/backend/canisters/community/api/src/updates/create_user_group.rs b/backend/canisters/community/api/src/updates/create_user_group.rs index a70072603b..12a5a6601d 100644 --- a/backend/canisters/community/api/src/updates/create_user_group.rs +++ b/backend/canisters/community/api/src/updates/create_user_group.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{FieldTooLongResult, FieldTooShortResult, UserId}; +#[ts_export(community, create_user_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub name: String, pub user_ids: Vec, } +#[ts_export(community, create_user_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -20,6 +23,7 @@ pub enum Response { UserSuspended, } +#[ts_export(community, create_user_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub user_group_id: u32, diff --git a/backend/canisters/community/api/src/updates/decline_invitation.rs b/backend/canisters/community/api/src/updates/decline_invitation.rs index efbf80fd40..4788cf2181 100644 --- a/backend/canisters/community/api/src/updates/decline_invitation.rs +++ b/backend/canisters/community/api/src/updates/decline_invitation.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::ChannelId; +#[ts_export(community, decline_invitation)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: Option, } +#[ts_export(community, decline_invitation)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/delete_channel.rs b/backend/canisters/community/api/src/updates/delete_channel.rs index 0f1b7c29d3..639a5a13b7 100644 --- a/backend/canisters/community/api/src/updates/delete_channel.rs +++ b/backend/canisters/community/api/src/updates/delete_channel.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::ChannelId; +#[ts_export(community, delete_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, } +#[ts_export(community, delete_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/delete_messages.rs b/backend/canisters/community/api/src/updates/delete_messages.rs index 0d581ea4cd..f615d6b278 100644 --- a/backend/canisters/community/api/src/updates/delete_messages.rs +++ b/backend/canisters/community/api/src/updates/delete_messages.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, MessageIndex}; +#[ts_export(community, delete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -11,6 +13,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(community, delete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/delete_user_groups.rs b/backend/canisters/community/api/src/updates/delete_user_groups.rs index 08fefadc31..3b7e7a6253 100644 --- a/backend/canisters/community/api/src/updates/delete_user_groups.rs +++ b/backend/canisters/community/api/src/updates/delete_user_groups.rs @@ -1,11 +1,14 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export(community, delete_user_groups)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_group_ids: Vec, } +#[ts_export(community, delete_user_groups)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/disable_invite_code.rs b/backend/canisters/community/api/src/updates/disable_invite_code.rs index cd2fbab08c..fa6d6b192c 100644 --- a/backend/canisters/community/api/src/updates/disable_invite_code.rs +++ b/backend/canisters/community/api/src/updates/disable_invite_code.rs @@ -1,9 +1,11 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::Empty; pub type Args = Empty; +#[ts_export(community, disable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/edit_message.rs b/backend/canisters/community/api/src/updates/edit_message.rs index 48aa28ef43..fe8a8cb114 100644 --- a/backend/canisters/community/api/src/updates/edit_message.rs +++ b/backend/canisters/community/api/src/updates/edit_message.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageContentInitial, MessageId, MessageIndex}; +#[ts_export(community, edit_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -12,6 +14,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(community, edit_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/enable_invite_code.rs b/backend/canisters/community/api/src/updates/enable_invite_code.rs index 5b52af4cab..f9969a00fd 100644 --- a/backend/canisters/community/api/src/updates/enable_invite_code.rs +++ b/backend/canisters/community/api/src/updates/enable_invite_code.rs @@ -1,9 +1,11 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::Empty; pub type Args = Empty; +#[ts_export(community, enable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -12,6 +14,7 @@ pub enum Response { CommunityFrozen, } +#[ts_export(community, enable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub code: u64, diff --git a/backend/canisters/community/api/src/updates/follow_thread.rs b/backend/canisters/community/api/src/updates/follow_thread.rs index 122a5817c7..dd216676fa 100644 --- a/backend/canisters/community/api/src/updates/follow_thread.rs +++ b/backend/canisters/community/api/src/updates/follow_thread.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex}; +#[ts_export(community, follow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub thread_root_message_index: MessageIndex, } +#[ts_export(community, follow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/import_group.rs b/backend/canisters/community/api/src/updates/import_group.rs index 9201ed479b..a10869ee1b 100644 --- a/backend/canisters/community/api/src/updates/import_group.rs +++ b/backend/canisters/community/api/src/updates/import_group.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, ChatId}; +#[ts_export(community, import_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub group_id: ChatId, } +#[ts_export(community, import_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -22,6 +25,7 @@ pub enum Response { InternalError(String), } +#[ts_export(community, import_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub channel_id: ChannelId, diff --git a/backend/canisters/community/api/src/updates/join_video_call.rs b/backend/canisters/community/api/src/updates/join_video_call.rs index c8208020d1..d984a0fc01 100644 --- a/backend/canisters/community/api/src/updates/join_video_call.rs +++ b/backend/canisters/community/api/src/updates/join_video_call.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, VideoCallPresence}; +#[ts_export(community, join_video_call)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, diff --git a/backend/canisters/community/api/src/updates/leave_channel.rs b/backend/canisters/community/api/src/updates/leave_channel.rs index 1039a80cf3..53362a2e45 100644 --- a/backend/canisters/community/api/src/updates/leave_channel.rs +++ b/backend/canisters/community/api/src/updates/leave_channel.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::ChannelId; +#[ts_export(community, leave_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, } +#[ts_export(community, leave_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/pin_message.rs b/backend/canisters/community/api/src/updates/pin_message.rs index 4ce69a5b76..60a77fb093 100644 --- a/backend/canisters/community/api/src/updates/pin_message.rs +++ b/backend/canisters/community/api/src/updates/pin_message.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex, PushEventResult}; +#[ts_export(community, pin_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub message_index: MessageIndex, } +#[ts_export(community, pin_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(PushEventResult), diff --git a/backend/canisters/community/api/src/updates/register_poll_vote.rs b/backend/canisters/community/api/src/updates/register_poll_vote.rs index e8a93070e6..5119cccbf5 100644 --- a/backend/canisters/community/api/src/updates/register_poll_vote.rs +++ b/backend/canisters/community/api/src/updates/register_poll_vote.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex, PollVotes, VoteOperation}; +#[ts_export(community, register_poll_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -12,6 +14,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(community, register_poll_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(PollVotes), diff --git a/backend/canisters/community/api/src/updates/register_proposal_vote.rs b/backend/canisters/community/api/src/updates/register_proposal_vote.rs index 7465f20055..6760e4013e 100644 --- a/backend/canisters/community/api/src/updates/register_proposal_vote.rs +++ b/backend/canisters/community/api/src/updates/register_proposal_vote.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex}; +#[ts_export(community, register_proposal_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub adopt: bool, } +#[ts_export(community, register_proposal_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/remove_member.rs b/backend/canisters/community/api/src/updates/remove_member.rs index 970c1cf8b2..f9b7bb8c62 100644 --- a/backend/canisters/community/api/src/updates/remove_member.rs +++ b/backend/canisters/community/api/src/updates/remove_member.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(community, remove_member)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, } +#[ts_export(community, remove_member)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/remove_member_from_channel.rs b/backend/canisters/community/api/src/updates/remove_member_from_channel.rs index 4ed31d809d..93064f82da 100644 --- a/backend/canisters/community/api/src/updates/remove_member_from_channel.rs +++ b/backend/canisters/community/api/src/updates/remove_member_from_channel.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, UserId}; +#[ts_export(community, remove_member_from_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub user_id: UserId, } +#[ts_export(community, remove_member_from_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/remove_reaction.rs b/backend/canisters/community/api/src/updates/remove_reaction.rs index 2846b5115d..6e801ce864 100644 --- a/backend/canisters/community/api/src/updates/remove_reaction.rs +++ b/backend/canisters/community/api/src/updates/remove_reaction.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, MessageIndex, Reaction}; +#[ts_export(community, remove_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { pub reaction: Reaction, } +#[ts_export(community, remove_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/report_message.rs b/backend/canisters/community/api/src/updates/report_message.rs index 4c61f638ee..48fd36d6ce 100644 --- a/backend/canisters/community/api/src/updates/report_message.rs +++ b/backend/canisters/community/api/src/updates/report_message.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, MessageIndex}; +#[ts_export(community, report_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { pub delete: bool, } +#[ts_export(community, report_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/set_member_display_name.rs b/backend/canisters/community/api/src/updates/set_member_display_name.rs index bc9807b377..a4c210f087 100644 --- a/backend/canisters/community/api/src/updates/set_member_display_name.rs +++ b/backend/canisters/community/api/src/updates/set_member_display_name.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export(community, set_member_display_name)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub display_name: Option, pub new_achievement: bool, } +#[ts_export(community, set_member_display_name)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/set_video_call_presence.rs b/backend/canisters/community/api/src/updates/set_video_call_presence.rs index 553ba1f6ff..d851bfad97 100644 --- a/backend/canisters/community/api/src/updates/set_video_call_presence.rs +++ b/backend/canisters/community/api/src/updates/set_video_call_presence.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageId, VideoCallPresence}; +#[ts_export(community, set_video_call_presence)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -10,6 +12,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(community, set_video_call_presence)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/toggle_mute_notifications.rs b/backend/canisters/community/api/src/updates/toggle_mute_notifications.rs index 1909b5fbb4..8af533d831 100644 --- a/backend/canisters/community/api/src/updates/toggle_mute_notifications.rs +++ b/backend/canisters/community/api/src/updates/toggle_mute_notifications.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::ChannelId; +#[ts_export(community, toggle_mute_notifications)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: Option, pub mute: bool, } +#[ts_export(community, toggle_mute_notifications)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/unblock_user.rs b/backend/canisters/community/api/src/updates/unblock_user.rs index 40fdc499db..96b9ffdb5a 100644 --- a/backend/canisters/community/api/src/updates/unblock_user.rs +++ b/backend/canisters/community/api/src/updates/unblock_user.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(community, unblock_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, } +#[ts_export(community, unblock_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/undelete_messages.rs b/backend/canisters/community/api/src/updates/undelete_messages.rs index 55298b393e..cd71e9a15e 100644 --- a/backend/canisters/community/api/src/updates/undelete_messages.rs +++ b/backend/canisters/community/api/src/updates/undelete_messages.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, Message, MessageId, MessageIndex}; +#[ts_export(community, undelete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, @@ -9,6 +11,7 @@ pub struct Args { pub message_ids: Vec, } +#[ts_export(community, undelete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -20,6 +23,7 @@ pub enum Response { CommunityFrozen, } +#[ts_export(community, undelete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub messages: Vec, diff --git a/backend/canisters/community/api/src/updates/unfollow_thread.rs b/backend/canisters/community/api/src/updates/unfollow_thread.rs index 5b35bfdf1a..ea7c5ddff3 100644 --- a/backend/canisters/community/api/src/updates/unfollow_thread.rs +++ b/backend/canisters/community/api/src/updates/unfollow_thread.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, MessageIndex}; +#[ts_export(community, unfollow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub thread_root_message_index: MessageIndex, } +#[ts_export(community, unfollow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/api/src/updates/update_channel.rs b/backend/canisters/community/api/src/updates/update_channel.rs index c8e13b5751..8e2ede54d5 100644 --- a/backend/canisters/community/api/src/updates/update_channel.rs +++ b/backend/canisters/community/api/src/updates/update_channel.rs @@ -1,25 +1,32 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ AccessGate, ChannelId, Document, FieldTooLongResult, FieldTooShortResult, Milliseconds, OptionUpdate, OptionalGroupPermissions, UpdatedRules, Version, }; +#[ts_export(community, update_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub channel_id: ChannelId, pub name: Option, pub description: Option, pub rules: Option, + #[ts(as = "types::OptionUpdateDocument")] pub avatar: OptionUpdate, pub permissions_v2: Option, + #[ts(as = "types::OptionUpdateU64")] pub events_ttl: OptionUpdate, + #[ts(as = "types::OptionUpdateAccessGate")] pub gate: OptionUpdate, pub public: Option, pub messages_visible_to_non_members: Option, + #[ts(as = "types::OptionUpdateString")] pub external_url: OptionUpdate, } +#[ts_export(community, update_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { SuccessV2(SuccessResult), @@ -41,6 +48,7 @@ pub enum Response { CommunityFrozen, } +#[ts_export(community, update_channel)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub rules_version: Option, diff --git a/backend/canisters/community/api/src/updates/update_community.rs b/backend/canisters/community/api/src/updates/update_community.rs index f6f113c5dd..164cb2095a 100644 --- a/backend/canisters/community/api/src/updates/update_community.rs +++ b/backend/canisters/community/api/src/updates/update_community.rs @@ -1,23 +1,29 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ AccessGate, Document, FieldTooLongResult, FieldTooShortResult, OptionUpdate, OptionalCommunityPermissions, UpdatedRules, Version, }; +#[ts_export(community, update_community)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub name: Option, pub description: Option, pub rules: Option, + #[ts(as = "types::OptionUpdateDocument")] pub avatar: OptionUpdate, + #[ts(as = "types::OptionUpdateDocument")] pub banner: OptionUpdate, pub permissions: Option, + #[ts(as = "types::OptionUpdateAccessGate")] pub gate: OptionUpdate, pub public: Option, pub primary_language: Option, } +#[ts_export(community, update_community)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { SuccessV2(SuccessResult), @@ -39,6 +45,7 @@ pub enum Response { InvalidLanguage, } +#[ts_export(community, update_community)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub rules_version: Option, diff --git a/backend/canisters/community/api/src/updates/update_user_group.rs b/backend/canisters/community/api/src/updates/update_user_group.rs index 810a981742..7840efc372 100644 --- a/backend/canisters/community/api/src/updates/update_user_group.rs +++ b/backend/canisters/community/api/src/updates/update_user_group.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{FieldTooLongResult, FieldTooShortResult, UserId}; +#[ts_export(community, update_user_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_group_id: u32, @@ -10,6 +12,7 @@ pub struct Args { pub users_to_remove: Vec, } +#[ts_export(community, update_user_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/community/impl/src/queries/channel_summary.rs b/backend/canisters/community/impl/src/queries/channel_summary.rs index ca88f1eaf5..44b91b0df6 100644 --- a/backend/canisters/community/impl/src/queries/channel_summary.rs +++ b/backend/canisters/community/impl/src/queries/channel_summary.rs @@ -1,9 +1,9 @@ use crate::read_state; use crate::RuntimeState; +use canister_api_macros::query; use community_canister::channel_summary::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn channel_summary(args: Args) -> Response { read_state(|state| summary_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/channel_summary_updates.rs b/backend/canisters/community/impl/src/queries/channel_summary_updates.rs index 1a343879f2..12610b99fa 100644 --- a/backend/canisters/community/impl/src/queries/channel_summary_updates.rs +++ b/backend/canisters/community/impl/src/queries/channel_summary_updates.rs @@ -1,10 +1,10 @@ use crate::model::channels::ChannelUpdates; use crate::read_state; use crate::RuntimeState; +use canister_api_macros::query; use community_canister::channel_summary_updates::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn channel_summary_updates(args: Args) -> Response { read_state(|state| channel_summary_updates_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/deleted_message.rs b/backend/canisters/community/impl/src/queries/deleted_message.rs index 809708b8c0..fc0fa2f7ad 100644 --- a/backend/canisters/community/impl/src/queries/deleted_message.rs +++ b/backend/canisters/community/impl/src/queries/deleted_message.rs @@ -1,9 +1,9 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::deleted_message::{Response::*, *}; use group_chat_core::DeletedMessageResult; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn deleted_message(args: Args) -> Response { read_state(|state| deleted_message_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/events.rs b/backend/canisters/community/impl/src/queries/events.rs index 77a1eb43d0..554750e6a4 100644 --- a/backend/canisters/community/impl/src/queries/events.rs +++ b/backend/canisters/community/impl/src/queries/events.rs @@ -7,7 +7,7 @@ use community_canister::c2c_events::Args as C2CArgs; use community_canister::events::{Response::*, *}; use group_chat_core::EventsResult; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn events(args: Args) -> Response { read_state(|state| events_impl(args, None, state)) } diff --git a/backend/canisters/community/impl/src/queries/events_by_index.rs b/backend/canisters/community/impl/src/queries/events_by_index.rs index 54aa57680a..a45491581c 100644 --- a/backend/canisters/community/impl/src/queries/events_by_index.rs +++ b/backend/canisters/community/impl/src/queries/events_by_index.rs @@ -7,7 +7,7 @@ use community_canister::c2c_events_by_index::Args as C2CArgs; use community_canister::events_by_index::{Response::*, *}; use group_chat_core::EventsResult; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn events_by_index(args: Args) -> Response { read_state(|state| events_by_index_impl(args, None, state)) } diff --git a/backend/canisters/community/impl/src/queries/events_window.rs b/backend/canisters/community/impl/src/queries/events_window.rs index 189bf6243c..02b3a96724 100644 --- a/backend/canisters/community/impl/src/queries/events_window.rs +++ b/backend/canisters/community/impl/src/queries/events_window.rs @@ -7,7 +7,7 @@ use community_canister::c2c_events_window::Args as C2CArgs; use community_canister::events_window::{Response::*, *}; use group_chat_core::EventsResult; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn events_window(args: Args) -> Response { read_state(|state| events_window_impl(args, None, state)) } diff --git a/backend/canisters/community/impl/src/queries/explore_channels.rs b/backend/canisters/community/impl/src/queries/explore_channels.rs index d0b65fd5eb..6901b2d6f7 100644 --- a/backend/canisters/community/impl/src/queries/explore_channels.rs +++ b/backend/canisters/community/impl/src/queries/explore_channels.rs @@ -1,12 +1,12 @@ use crate::read_state; use crate::RuntimeState; +use canister_api_macros::query; use community_canister::explore_channels::{Response::*, *}; -use ic_cdk::query; const MIN_TERM_LENGTH: u8 = 2; const MAX_TERM_LENGTH: u8 = 20; -#[query] +#[query(candid = true, msgpack = true)] fn explore_channels(args: Args) -> Response { read_state(|state| explore_channels_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/invite_code.rs b/backend/canisters/community/impl/src/queries/invite_code.rs index 2f0f99fc5c..7f14d9f3de 100644 --- a/backend/canisters/community/impl/src/queries/invite_code.rs +++ b/backend/canisters/community/impl/src/queries/invite_code.rs @@ -1,9 +1,9 @@ use crate::read_state; use crate::RuntimeState; +use canister_api_macros::query; use community_canister::invite_code::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn invite_code(_: Args) -> Response { read_state(invite_code_impl) } diff --git a/backend/canisters/community/impl/src/queries/local_user_index.rs b/backend/canisters/community/impl/src/queries/local_user_index.rs index ccdf2299f9..46d7c13049 100644 --- a/backend/canisters/community/impl/src/queries/local_user_index.rs +++ b/backend/canisters/community/impl/src/queries/local_user_index.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::local_user_index::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn local_user_index(_args: Args) -> Response { read_state(local_user_index_impl) } diff --git a/backend/canisters/community/impl/src/queries/messages_by_message_index.rs b/backend/canisters/community/impl/src/queries/messages_by_message_index.rs index 390693cd39..8acbf3d1b7 100644 --- a/backend/canisters/community/impl/src/queries/messages_by_message_index.rs +++ b/backend/canisters/community/impl/src/queries/messages_by_message_index.rs @@ -1,10 +1,10 @@ use crate::queries::check_replica_up_to_date; use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::messages_by_message_index::{Response::*, *}; use group_chat_core::MessagesResult; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn messages_by_message_index(args: Args) -> Response { read_state(|state| messages_by_message_index_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/search_channel.rs b/backend/canisters/community/impl/src/queries/search_channel.rs index f5cdddd7f3..921cf669e3 100644 --- a/backend/canisters/community/impl/src/queries/search_channel.rs +++ b/backend/canisters/community/impl/src/queries/search_channel.rs @@ -1,9 +1,9 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::search_channel::{Response::*, *}; use group_chat_core::SearchResults; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn search_channel(args: Args) -> Response { read_state(|state| search_channel_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/selected_channel_initial.rs b/backend/canisters/community/impl/src/queries/selected_channel_initial.rs index d116b923f6..4b1b8b2e3e 100644 --- a/backend/canisters/community/impl/src/queries/selected_channel_initial.rs +++ b/backend/canisters/community/impl/src/queries/selected_channel_initial.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::selected_channel_initial::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn selected_channel_initial(args: Args) -> Response { read_state(|state| selected_channel_initial_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/selected_channel_updates.rs b/backend/canisters/community/impl/src/queries/selected_channel_updates.rs index c14ebdc061..5e9da226b3 100644 --- a/backend/canisters/community/impl/src/queries/selected_channel_updates.rs +++ b/backend/canisters/community/impl/src/queries/selected_channel_updates.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::selected_channel_updates_v2::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn selected_channel_updates_v2(args: Args) -> Response { read_state(|state| selected_channel_updates_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/selected_initial.rs b/backend/canisters/community/impl/src/queries/selected_initial.rs index 6eb0860ef3..c74c1af5f9 100644 --- a/backend/canisters/community/impl/src/queries/selected_initial.rs +++ b/backend/canisters/community/impl/src/queries/selected_initial.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::selected_initial::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn selected_initial(args: Args) -> Response { read_state(|state| selected_initial_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/selected_updates.rs b/backend/canisters/community/impl/src/queries/selected_updates.rs index c79e7f1ede..c7d4a1ca73 100644 --- a/backend/canisters/community/impl/src/queries/selected_updates.rs +++ b/backend/canisters/community/impl/src/queries/selected_updates.rs @@ -2,13 +2,13 @@ use crate::{ model::{events::CommunityEventInternal, members::CommunityMembers}, read_state, RuntimeState, }; +use canister_api_macros::query; use community_canister::selected_updates_v2::{Response::*, *}; -use ic_cdk::query; use std::cell::LazyCell; use std::collections::HashSet; use types::UserId; -#[query] +#[query(candid = true, msgpack = true)] fn selected_updates_v2(args: Args) -> Response { read_state(|state| selected_updates_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/summary.rs b/backend/canisters/community/impl/src/queries/summary.rs index 4ce18bf38c..3e4dd58c6d 100644 --- a/backend/canisters/community/impl/src/queries/summary.rs +++ b/backend/canisters/community/impl/src/queries/summary.rs @@ -5,7 +5,7 @@ use canister_api_macros::query; use community_canister::c2c_summary::{Args as C2CArgs, Response as C2CResponse}; use community_canister::summary::{Response::*, *}; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn summary(args: Args) -> Response { read_state(|state| summary_impl(args.invite_code, None, state)) } diff --git a/backend/canisters/community/impl/src/queries/summary_updates.rs b/backend/canisters/community/impl/src/queries/summary_updates.rs index 7919ead25b..1dce926841 100644 --- a/backend/canisters/community/impl/src/queries/summary_updates.rs +++ b/backend/canisters/community/impl/src/queries/summary_updates.rs @@ -12,7 +12,7 @@ use types::{ FrozenGroupInfo, OptionUpdate, TimestampMillis, }; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn summary_updates(args: Args) -> Response { read_state(|state| summary_updates_impl(args.updates_since, args.invite_code, None, state)) } diff --git a/backend/canisters/community/impl/src/queries/thread_previews.rs b/backend/canisters/community/impl/src/queries/thread_previews.rs index ded89c4d73..400ab753c1 100644 --- a/backend/canisters/community/impl/src/queries/thread_previews.rs +++ b/backend/canisters/community/impl/src/queries/thread_previews.rs @@ -1,10 +1,10 @@ use crate::queries::check_replica_up_to_date; use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::thread_previews::{Response::*, *}; use group_chat_core::ThreadPreviewsResult; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn thread_previews(args: Args) -> Response { read_state(|state| thread_previews_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/queries/video_call_participants.rs b/backend/canisters/community/impl/src/queries/video_call_participants.rs index 19a0997367..d2952534d1 100644 --- a/backend/canisters/community/impl/src/queries/video_call_participants.rs +++ b/backend/canisters/community/impl/src/queries/video_call_participants.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use community_canister::video_call_participants::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn video_call_participants(args: Args) -> Response { read_state(|state| video_call_participants_impl(args, state)) } diff --git a/backend/canisters/community/impl/src/updates/accept_p2p_swap.rs b/backend/canisters/community/impl/src/updates/accept_p2p_swap.rs index 50caa42311..846ea1c01e 100644 --- a/backend/canisters/community/impl/src/updates/accept_p2p_swap.rs +++ b/backend/canisters/community/impl/src/updates/accept_p2p_swap.rs @@ -1,13 +1,13 @@ use crate::activity_notifications::handle_activity_notification; use crate::timer_job_types::NotifyEscrowCanisterOfDepositJob; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::accept_p2p_swap::{Response::*, *}; -use ic_cdk::update; use icrc_ledger_types::icrc1::transfer::TransferError; use types::{AcceptSwapSuccess, Achievement, ChannelId, Chat, MessageId, MessageIndex, P2PSwapLocation, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn accept_p2p_swap(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/add_members_to_channel.rs b/backend/canisters/community/impl/src/updates/add_members_to_channel.rs index 1d9fa8bde4..a487d0f000 100644 --- a/backend/canisters/community/impl/src/updates/add_members_to_channel.rs +++ b/backend/canisters/community/impl/src/updates/add_members_to_channel.rs @@ -1,12 +1,12 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::ChatEventInternal; use community_canister::add_members_to_channel::{Response::*, *}; use group_chat_core::AddResult; -use ic_cdk::update; use types::{AddedToChannelNotification, ChannelId, EventIndex, MembersAdded, MessageIndex, Notification, UserId, UserType}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn add_members_to_channel(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/cancel_invites.rs b/backend/canisters/community/impl/src/updates/cancel_invites.rs index b99621fbd9..e92854a1e4 100644 --- a/backend/canisters/community/impl/src/updates/cancel_invites.rs +++ b/backend/canisters/community/impl/src/updates/cancel_invites.rs @@ -1,10 +1,10 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::cancel_invites::{Response::*, *}; use group_chat_core::CancelInvitesResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn cancel_invites(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/cancel_p2p_swap.rs b/backend/canisters/community/impl/src/updates/cancel_p2p_swap.rs index 4add72008f..e28e95f133 100644 --- a/backend/canisters/community/impl/src/updates/cancel_p2p_swap.rs +++ b/backend/canisters/community/impl/src/updates/cancel_p2p_swap.rs @@ -1,11 +1,11 @@ use crate::timer_job_types::CancelP2PSwapInEscrowCanisterJob; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::cancel_p2p_swap::{Response::*, *}; -use ic_cdk::update; use types::CancelP2PSwapResult; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn cancel_p2p_swap(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/change_role.rs b/backend/canisters/community/impl/src/updates/change_role.rs index 5cd1aa1f56..fae830f9d6 100644 --- a/backend/canisters/community/impl/src/updates/change_role.rs +++ b/backend/canisters/community/impl/src/updates/change_role.rs @@ -3,13 +3,13 @@ use crate::{ model::{events::CommunityEventInternal, members::ChangeRoleResult}, mutate_state, read_state, run_regular_jobs, RuntimeState, }; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::change_role::{Response::*, *}; -use ic_cdk::update; use types::{CanisterId, CommunityRoleChanged, UserId}; use user_index_canister_c2c_client::{lookup_user, LookupUserError}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn change_role(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/claim_prize.rs b/backend/canisters/community/impl/src/updates/claim_prize.rs index 74b0f1e8e1..0b669c2b82 100644 --- a/backend/canisters/community/impl/src/updates/claim_prize.rs +++ b/backend/canisters/community/impl/src/updates/claim_prize.rs @@ -1,14 +1,14 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::ReservePrizeResult; use community_canister::claim_prize::{Response::*, *}; -use ic_cdk::update; use ledger_utils::{create_pending_transaction, process_transaction}; use types::{CanisterId, CompletedCryptoTransaction, PendingCryptoTransaction, UserId}; use utils::consts::MEMO_PRIZE_CLAIM; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn claim_prize(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/create_channel.rs b/backend/canisters/community/impl/src/updates/create_channel.rs index 2983e0e7b8..2486279f4c 100644 --- a/backend/canisters/community/impl/src/updates/create_channel.rs +++ b/backend/canisters/community/impl/src/updates/create_channel.rs @@ -18,7 +18,7 @@ use utils::text_validation::{ validate_description, validate_group_name, validate_rules, NameValidationError, RulesValidationError, }; -#[update(candid = true)] +#[update(candid = true, msgpack = true)] #[trace] async fn create_channel(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/create_user_group.rs b/backend/canisters/community/impl/src/updates/create_user_group.rs index 05f6b78597..d4dcabd92d 100644 --- a/backend/canisters/community/impl/src/updates/create_user_group.rs +++ b/backend/canisters/community/impl/src/updates/create_user_group.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::create_user_group::{Response::*, *}; -use ic_cdk::update; use utils::text_validation::{validate_user_group_name, UsernameValidationError}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn create_user_group(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/decline_invitation.rs b/backend/canisters/community/impl/src/updates/decline_invitation.rs index 5cb7d6684e..c7f4551b6c 100644 --- a/backend/canisters/community/impl/src/updates/decline_invitation.rs +++ b/backend/canisters/community/impl/src/updates/decline_invitation.rs @@ -1,9 +1,9 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::decline_invitation::{Response::*, *}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn decline_invitation(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/delete_user_groups.rs b/backend/canisters/community/impl/src/updates/delete_user_groups.rs index e1a567cf05..4a53c1216c 100644 --- a/backend/canisters/community/impl/src/updates/delete_user_groups.rs +++ b/backend/canisters/community/impl/src/updates/delete_user_groups.rs @@ -1,10 +1,10 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::delete_user_groups::{Response::*, *}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn delete_user_groups(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/disable_invite_code.rs b/backend/canisters/community/impl/src/updates/disable_invite_code.rs index 36dd996bbd..bf772a2eda 100644 --- a/backend/canisters/community/impl/src/updates/disable_invite_code.rs +++ b/backend/canisters/community/impl/src/updates/disable_invite_code.rs @@ -2,12 +2,12 @@ use crate::{ activity_notifications::handle_activity_notification, model::events::CommunityEventInternal, mutate_state, run_regular_jobs, RuntimeState, }; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::disable_invite_code::{Response::*, *}; -use ic_cdk::update; use types::{GroupInviteCodeChange, GroupInviteCodeChanged}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn disable_invite_code(_args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/edit_message.rs b/backend/canisters/community/impl/src/updates/edit_message.rs index d225cd2a59..0f6735ce77 100644 --- a/backend/canisters/community/impl/src/updates/edit_message.rs +++ b/backend/canisters/community/impl/src/updates/edit_message.rs @@ -1,11 +1,11 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::{EditMessageArgs, EditMessageResult}; use community_canister::edit_message::{Response::*, *}; -use ic_cdk::update; use types::Achievement; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn edit_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/enable_invite_code.rs b/backend/canisters/community/impl/src/updates/enable_invite_code.rs index 854a403465..206662af50 100644 --- a/backend/canisters/community/impl/src/updates/enable_invite_code.rs +++ b/backend/canisters/community/impl/src/updates/enable_invite_code.rs @@ -2,16 +2,16 @@ use crate::activity_notifications::handle_activity_notification; use crate::model::events::CommunityEventInternal; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; use candid::Principal; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::enable_invite_code::{Response::*, *}; use community_canister::reset_invite_code; -use ic_cdk::update; use rand::rngs::StdRng; use rand::{RngCore, SeedableRng}; use types::{GroupInviteCodeChange, GroupInviteCodeChanged}; use utils::canister; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn reset_invite_code(_args: reset_invite_code::Args) -> reset_invite_code::Response { run_regular_jobs(); @@ -32,7 +32,7 @@ async fn reset_invite_code(_args: reset_invite_code::Args) -> reset_invite_code: Success(SuccessResult { code }) } -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn enable_invite_code(_args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/follow_thread.rs b/backend/canisters/community/impl/src/updates/follow_thread.rs index c31e69ca76..cad9b8c4df 100644 --- a/backend/canisters/community/impl/src/updates/follow_thread.rs +++ b/backend/canisters/community/impl/src/updates/follow_thread.rs @@ -1,10 +1,10 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::follow_thread::{Response::*, *}; use group_chat_core::FollowThreadResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn follow_thread(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/join_video_call.rs b/backend/canisters/community/impl/src/updates/join_video_call.rs index 357dcef960..5dc2938dce 100644 --- a/backend/canisters/community/impl/src/updates/join_video_call.rs +++ b/backend/canisters/community/impl/src/updates/join_video_call.rs @@ -1,10 +1,10 @@ use crate::updates::set_video_call_presence::set_video_call_presence_impl; use crate::{mutate_state, run_regular_jobs}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::join_video_call::{Args, Response}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn join_video_call(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/leave_channel.rs b/backend/canisters/community/impl/src/updates/leave_channel.rs index 5d8fc7146d..67dfbc10ce 100644 --- a/backend/canisters/community/impl/src/updates/leave_channel.rs +++ b/backend/canisters/community/impl/src/updates/leave_channel.rs @@ -1,10 +1,10 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::leave_channel::{Response::*, *}; use group_chat_core::LeaveResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn leave_channel(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/pin_message.rs b/backend/canisters/community/impl/src/updates/pin_message.rs index 699d9c04fd..8ed21db8da 100644 --- a/backend/canisters/community/impl/src/updates/pin_message.rs +++ b/backend/canisters/community/impl/src/updates/pin_message.rs @@ -1,10 +1,10 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::pin_message::{Response::*, *}; use group_chat_core::PinUnpinMessageResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn pin_message(args: Args) -> Response { run_regular_jobs(); @@ -12,7 +12,7 @@ fn pin_message(args: Args) -> Response { mutate_state(|state| pin_message_impl(args, true, state)) } -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn unpin_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/register_poll_vote.rs b/backend/canisters/community/impl/src/updates/register_poll_vote.rs index 6386d17ff1..434d8f0422 100644 --- a/backend/canisters/community/impl/src/updates/register_poll_vote.rs +++ b/backend/canisters/community/impl/src/updates/register_poll_vote.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::{RegisterPollVoteArgs, RegisterPollVoteResult}; use community_canister::register_poll_vote::{Response::*, *}; -use ic_cdk::update; use types::Achievement; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn register_poll_vote(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/register_proposal_vote.rs b/backend/canisters/community/impl/src/updates/register_proposal_vote.rs index 07fdcd004c..1f3cae0d10 100644 --- a/backend/canisters/community/impl/src/updates/register_proposal_vote.rs +++ b/backend/canisters/community/impl/src/updates/register_proposal_vote.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::{MessageContentInternal, Reader, RecordProposalVoteResult}; use community_canister::register_proposal_vote::{Response::*, *}; -use ic_cdk::update; use types::{CanisterId, ChannelId, ProposalId, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn register_proposal_vote(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/register_proposal_vote_v2.rs b/backend/canisters/community/impl/src/updates/register_proposal_vote_v2.rs index 535d39c84e..64d7fcc5ab 100644 --- a/backend/canisters/community/impl/src/updates/register_proposal_vote_v2.rs +++ b/backend/canisters/community/impl/src/updates/register_proposal_vote_v2.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::RecordProposalVoteResult; use community_canister::register_proposal_vote_v2::{Response::*, *}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn register_proposal_vote_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/remove_member.rs b/backend/canisters/community/impl/src/updates/remove_member.rs index b0e1b67b8f..0a4d514f74 100644 --- a/backend/canisters/community/impl/src/updates/remove_member.rs +++ b/backend/canisters/community/impl/src/updates/remove_member.rs @@ -4,16 +4,16 @@ use crate::{ activity_notifications::handle_activity_notification, model::events::CommunityEventInternal, mutate_state, read_state, run_regular_jobs, RuntimeState, }; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::remove_member::{Response::*, *}; use fire_and_forget_handler::FireAndForgetHandler; -use ic_cdk::update; use local_user_index_canister_c2c_client::{lookup_user, LookupUserError}; use msgpack::serialize_then_unwrap; use types::{CanisterId, CommunityMembersRemoved, CommunityRole, CommunityUsersBlocked, UserId}; use user_canister::c2c_remove_from_community; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn block_user(args: community_canister::block_user::Args) -> community_canister::block_user::Response { run_regular_jobs(); @@ -25,7 +25,7 @@ async fn block_user(args: community_canister::block_user::Args) -> community_can remove_member_impl(args.user_id, true).await.into() } -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn remove_member(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/remove_member_from_channel.rs b/backend/canisters/community/impl/src/updates/remove_member_from_channel.rs index 8c7366146d..29d9952161 100644 --- a/backend/canisters/community/impl/src/updates/remove_member_from_channel.rs +++ b/backend/canisters/community/impl/src/updates/remove_member_from_channel.rs @@ -1,10 +1,10 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::remove_member_from_channel::{Response::*, *}; use group_chat_core::RemoveMemberResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn remove_member_from_channel(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/remove_reaction.rs b/backend/canisters/community/impl/src/updates/remove_reaction.rs index 96be073f8c..977ba30f15 100644 --- a/backend/canisters/community/impl/src/updates/remove_reaction.rs +++ b/backend/canisters/community/impl/src/updates/remove_reaction.rs @@ -1,10 +1,10 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::remove_reaction::{Response::*, *}; use group_chat_core::AddRemoveReactionResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn remove_reaction(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/report_message.rs b/backend/canisters/community/impl/src/updates/report_message.rs index bf189e6729..6b2d116283 100644 --- a/backend/canisters/community/impl/src/updates/report_message.rs +++ b/backend/canisters/community/impl/src/updates/report_message.rs @@ -1,13 +1,13 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::Reader; use community_canister::report_message::{Response::*, *}; use group_index_canister::c2c_report_message; -use ic_cdk::update; use types::{CanisterId, MultiUserChat, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn report_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/set_member_display_name.rs b/backend/canisters/community/impl/src/updates/set_member_display_name.rs index 2d3c0c47d2..7920aad8f8 100644 --- a/backend/canisters/community/impl/src/updates/set_member_display_name.rs +++ b/backend/canisters/community/impl/src/updates/set_member_display_name.rs @@ -1,11 +1,11 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::set_member_display_name::{Response::*, *}; -use ic_cdk::update; use types::Achievement; use utils::text_validation::{validate_display_name, UsernameValidationError}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn set_member_display_name(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/set_video_call_presence.rs b/backend/canisters/community/impl/src/updates/set_video_call_presence.rs index b4cb671be2..bb509a22a1 100644 --- a/backend/canisters/community/impl/src/updates/set_video_call_presence.rs +++ b/backend/canisters/community/impl/src/updates/set_video_call_presence.rs @@ -1,11 +1,11 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::SetVideoCallPresenceResult; use community_canister::set_video_call_presence::{Response::*, *}; -use ic_cdk::update; use types::Achievement; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn set_video_call_presence(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/toggle_mute_notifications.rs b/backend/canisters/community/impl/src/updates/toggle_mute_notifications.rs index 3f63d80a55..7d38dee66b 100644 --- a/backend/canisters/community/impl/src/updates/toggle_mute_notifications.rs +++ b/backend/canisters/community/impl/src/updates/toggle_mute_notifications.rs @@ -1,9 +1,9 @@ use crate::{model::channels::MuteChannelResult, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::toggle_mute_notifications::{Response::*, *}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn toggle_mute_notifications(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/unblock_user.rs b/backend/canisters/community/impl/src/updates/unblock_user.rs index e2851cfdb2..20f0982b98 100644 --- a/backend/canisters/community/impl/src/updates/unblock_user.rs +++ b/backend/canisters/community/impl/src/updates/unblock_user.rs @@ -2,12 +2,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::model::events::CommunityEventInternal; use crate::updates::unblock_user::Response::*; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::unblock_user::*; -use ic_cdk::update; use types::UsersUnblocked; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn unblock_user(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/undelete_messages.rs b/backend/canisters/community/impl/src/updates/undelete_messages.rs index 3c61625838..c1967e177b 100644 --- a/backend/canisters/community/impl/src/updates/undelete_messages.rs +++ b/backend/canisters/community/impl/src/updates/undelete_messages.rs @@ -1,11 +1,11 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState, TimerJob}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::undelete_messages::{Response::*, *}; use group_chat_core::UndeleteMessagesResult; -use ic_cdk::update; use std::collections::HashSet; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn undelete_messages(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/unfollow_thread.rs b/backend/canisters/community/impl/src/updates/unfollow_thread.rs index 76da54653b..c77d978aaa 100644 --- a/backend/canisters/community/impl/src/updates/unfollow_thread.rs +++ b/backend/canisters/community/impl/src/updates/unfollow_thread.rs @@ -1,10 +1,10 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::unfollow_thread::{Response::*, *}; use group_chat_core::UnfollowThreadResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn unfollow_thread(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/update_channel.rs b/backend/canisters/community/impl/src/updates/update_channel.rs index 4a3fe7b72a..18ad823937 100644 --- a/backend/canisters/community/impl/src/updates/update_channel.rs +++ b/backend/canisters/community/impl/src/updates/update_channel.rs @@ -1,13 +1,13 @@ use crate::updates::c2c_join_channel::join_channel_unchecked; use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::update_channel::{Response::*, *}; use group_chat_core::UpdateResult; -use ic_cdk::update; use types::OptionUpdate; use url::Url; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn update_channel(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/update_community.rs b/backend/canisters/community/impl/src/updates/update_community.rs index 86d30e07ec..f069c65569 100644 --- a/backend/canisters/community/impl/src/updates/update_community.rs +++ b/backend/canisters/community/impl/src/updates/update_community.rs @@ -1,10 +1,10 @@ use crate::activity_notifications::handle_activity_notification; use crate::model::events::CommunityEventInternal; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::update_community::{Response::*, *}; use group_index_canister::{c2c_make_community_private, c2c_update_community}; -use ic_cdk::update; use tracing::error; use types::{ AccessGate, AvatarChanged, BannerChanged, CanisterId, CommunityId, CommunityPermissions, CommunityPermissionsChanged, @@ -16,7 +16,7 @@ use utils::text_validation::{ validate_community_name, validate_description, validate_rules, NameValidationError, RulesValidationError, }; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn update_community(mut args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/community/impl/src/updates/update_user_group.rs b/backend/canisters/community/impl/src/updates/update_user_group.rs index 35b04c16ea..54d69e2d91 100644 --- a/backend/canisters/community/impl/src/updates/update_user_group.rs +++ b/backend/canisters/community/impl/src/updates/update_user_group.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use community_canister::update_user_group::{Response::*, *}; -use ic_cdk::update; use utils::text_validation::{validate_user_group_name, UsernameValidationError}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn update_user_group(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/CHANGELOG.md b/backend/canisters/group/CHANGELOG.md index 9713b21566..8af71a79c2 100644 --- a/backend/canisters/group/CHANGELOG.md +++ b/backend/canisters/group/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +### Added + +- Add MessagePack versions of all endpoints ([#6463](https://github.com/open-chat-labs/open-chat/pull/6463)) + ### Changed - Increase max stable memory read / write buffer size ([#6440](https://github.com/open-chat-labs/open-chat/pull/6440)) diff --git a/backend/canisters/group/api/src/lib.rs b/backend/canisters/group/api/src/lib.rs index e8665b573d..94dbb8e694 100644 --- a/backend/canisters/group/api/src/lib.rs +++ b/backend/canisters/group/api/src/lib.rs @@ -7,8 +7,10 @@ mod updates; pub use lifecycle::*; pub use queries::*; +use ts_export::ts_export; pub use updates::*; +#[ts_export(group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum EventsResponse { Success(types::EventsResponse), diff --git a/backend/canisters/group/api/src/queries/deleted_message.rs b/backend/canisters/group/api/src/queries/deleted_message.rs index a55465d9f5..6db4384993 100644 --- a/backend/canisters/group/api/src/queries/deleted_message.rs +++ b/backend/canisters/group/api/src/queries/deleted_message.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageContent, MessageId, MessageIndex}; +#[ts_export(group, deleted_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, pub message_id: MessageId, } +#[ts_export(group, deleted_message)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { @@ -18,6 +21,7 @@ pub enum Response { MessageHardDeleted, } +#[ts_export(group, deleted_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub content: MessageContent, diff --git a/backend/canisters/group/api/src/queries/events.rs b/backend/canisters/group/api/src/queries/events.rs index 291d6094b0..ff247a4fce 100644 --- a/backend/canisters/group/api/src/queries/events.rs +++ b/backend/canisters/group/api/src/queries/events.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{EventIndex, MessageIndex, TimestampMillis}; +#[ts_export(group, events)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, diff --git a/backend/canisters/group/api/src/queries/events_by_index.rs b/backend/canisters/group/api/src/queries/events_by_index.rs index 23af0e3ddb..00db7192ba 100644 --- a/backend/canisters/group/api/src/queries/events_by_index.rs +++ b/backend/canisters/group/api/src/queries/events_by_index.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{EventIndex, MessageIndex, TimestampMillis}; +#[ts_export(group, events_by_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, diff --git a/backend/canisters/group/api/src/queries/events_window.rs b/backend/canisters/group/api/src/queries/events_window.rs index 75cd79dc1d..8b5de5f870 100644 --- a/backend/canisters/group/api/src/queries/events_window.rs +++ b/backend/canisters/group/api/src/queries/events_window.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageIndex, TimestampMillis}; +#[ts_export(group, events_window)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, diff --git a/backend/canisters/group/api/src/queries/invite_code.rs b/backend/canisters/group/api/src/queries/invite_code.rs index 2f33187b7d..82c3afac26 100644 --- a/backend/canisters/group/api/src/queries/invite_code.rs +++ b/backend/canisters/group/api/src/queries/invite_code.rs @@ -1,15 +1,18 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::Empty; pub type Args = Empty; +#[ts_export(group, invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), NotAuthorized, } +#[ts_export(group, invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub code: Option, diff --git a/backend/canisters/group/api/src/queries/local_user_index.rs b/backend/canisters/group/api/src/queries/local_user_index.rs index 91c8faf6ff..9fe9853dee 100644 --- a/backend/canisters/group/api/src/queries/local_user_index.rs +++ b/backend/canisters/group/api/src/queries/local_user_index.rs @@ -1,9 +1,11 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CanisterId, Empty}; pub type Args = Empty; +#[ts_export(group, local_user_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(CanisterId), diff --git a/backend/canisters/group/api/src/queries/messages_by_message_index.rs b/backend/canisters/group/api/src/queries/messages_by_message_index.rs index ed28c3bb95..a4cc3d741d 100644 --- a/backend/canisters/group/api/src/queries/messages_by_message_index.rs +++ b/backend/canisters/group/api/src/queries/messages_by_message_index.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageIndex, MessagesResponse, TimestampMillis}; +#[ts_export(group, messages_by_message_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -9,6 +11,7 @@ pub struct Args { pub latest_known_update: Option, } +#[ts_export(group, messages_by_message_index)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(MessagesResponse), diff --git a/backend/canisters/group/api/src/queries/public_summary.rs b/backend/canisters/group/api/src/queries/public_summary.rs index a92fca384b..ca6dd56a08 100644 --- a/backend/canisters/group/api/src/queries/public_summary.rs +++ b/backend/canisters/group/api/src/queries/public_summary.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::PublicGroupSummary; +#[ts_export(group, public_summary)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, } +#[ts_export(group, public_summary)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { @@ -14,6 +17,7 @@ pub enum Response { NotAuthorized, } +#[ts_export(group, public_summary)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub summary: PublicGroupSummary, diff --git a/backend/canisters/group/api/src/queries/rules.rs b/backend/canisters/group/api/src/queries/rules.rs index 115a9c4ac8..48d09d79ec 100644 --- a/backend/canisters/group/api/src/queries/rules.rs +++ b/backend/canisters/group/api/src/queries/rules.rs @@ -1,17 +1,21 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export(group, rules)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub invite_code: Option, } +#[ts_export(group, rules)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), NotAuthorized, } +#[ts_export(group, rules)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub rules: Option, diff --git a/backend/canisters/group/api/src/queries/search_messages.rs b/backend/canisters/group/api/src/queries/search_messages.rs index 38187f1a36..0612f80e84 100644 --- a/backend/canisters/group/api/src/queries/search_messages.rs +++ b/backend/canisters/group/api/src/queries/search_messages.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageMatch, UserId}; +#[ts_export(group, search_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub search_term: String, @@ -9,6 +11,7 @@ pub struct Args { pub users: Option>, } +#[ts_export(group, search_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -19,6 +22,7 @@ pub enum Response { CallerNotInGroup, } +#[ts_export(group, search_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub matches: Vec, diff --git a/backend/canisters/group/api/src/queries/selected_initial.rs b/backend/canisters/group/api/src/queries/selected_initial.rs index 3db5503099..43f3e25aa7 100644 --- a/backend/canisters/group/api/src/queries/selected_initial.rs +++ b/backend/canisters/group/api/src/queries/selected_initial.rs @@ -1,15 +1,18 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{Empty, EventIndex, GroupMember, MessageIndex, TimestampMillis, UserId, VersionedRules}; pub type Args = Empty; +#[ts_export(group, selected_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), CallerNotInGroup, } +#[ts_export(group, selected_initial)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub timestamp: TimestampMillis, diff --git a/backend/canisters/group/api/src/queries/selected_updates_v2.rs b/backend/canisters/group/api/src/queries/selected_updates_v2.rs index 620b0d7d3a..cbd08a7b78 100644 --- a/backend/canisters/group/api/src/queries/selected_updates_v2.rs +++ b/backend/canisters/group/api/src/queries/selected_updates_v2.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{SelectedGroupUpdates, TimestampMillis}; +#[ts_export(group, selected_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub updates_since: TimestampMillis, } +#[ts_export(group, selected_updates)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { diff --git a/backend/canisters/group/api/src/queries/summary.rs b/backend/canisters/group/api/src/queries/summary.rs index 4e1161ee12..153d3f694a 100644 --- a/backend/canisters/group/api/src/queries/summary.rs +++ b/backend/canisters/group/api/src/queries/summary.rs @@ -1,10 +1,12 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{Empty, GroupCanisterGroupChatSummary}; pub type Args = Empty; // Allow the large size difference because essentially all responses are the large variant anyway +#[ts_export(group, summary)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { @@ -12,6 +14,7 @@ pub enum Response { CallerNotInGroup, } +#[ts_export(group, summary)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub summary: GroupCanisterGroupChatSummary, diff --git a/backend/canisters/group/api/src/queries/summary_updates.rs b/backend/canisters/group/api/src/queries/summary_updates.rs index 98ba61d1f2..84b4fcbe31 100644 --- a/backend/canisters/group/api/src/queries/summary_updates.rs +++ b/backend/canisters/group/api/src/queries/summary_updates.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{GroupCanisterGroupChatSummaryUpdates, TimestampMillis}; +#[ts_export(group, summary_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub updates_since: TimestampMillis, } +#[ts_export(group, summary_updates)] #[allow(clippy::large_enum_variant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { @@ -15,6 +18,7 @@ pub enum Response { CallerNotInGroup, } +#[ts_export(group, summary_updates)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub updates: GroupCanisterGroupChatSummaryUpdates, diff --git a/backend/canisters/group/api/src/queries/thread_previews.rs b/backend/canisters/group/api/src/queries/thread_previews.rs index 31ec887aec..779300b238 100644 --- a/backend/canisters/group/api/src/queries/thread_previews.rs +++ b/backend/canisters/group/api/src/queries/thread_previews.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageIndex, ThreadPreview, TimestampMillis}; +#[ts_export(group, thread_previews)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub threads: Vec, pub latest_client_thread_update: Option, } +#[ts_export(group, thread_previews)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -15,6 +18,7 @@ pub enum Response { ReplicaNotUpToDate(TimestampMillis), } +#[ts_export(group, thread_previews)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub threads: Vec, diff --git a/backend/canisters/group/api/src/queries/video_call_participants.rs b/backend/canisters/group/api/src/queries/video_call_participants.rs index 5f9d22b1c3..7f36ea8165 100644 --- a/backend/canisters/group/api/src/queries/video_call_participants.rs +++ b/backend/canisters/group/api/src/queries/video_call_participants.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, TimestampMillis, VideoCallParticipants}; +#[ts_export(group, video_call_participants)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub message_id: MessageId, pub updated_since: Option, } +#[ts_export(group, video_call_participants)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(VideoCallParticipants), diff --git a/backend/canisters/group/api/src/updates/accept_p2p_swap.rs b/backend/canisters/group/api/src/updates/accept_p2p_swap.rs index bb8f4e90ca..56b2d45c03 100644 --- a/backend/canisters/group/api/src/updates/accept_p2p_swap.rs +++ b/backend/canisters/group/api/src/updates/accept_p2p_swap.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{AcceptSwapSuccess, MessageId, MessageIndex, Milliseconds, SwapStatusError}; +#[ts_export(group, accept_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -10,6 +12,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(group, accept_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(AcceptSwapSuccess), diff --git a/backend/canisters/group/api/src/updates/add_reaction.rs b/backend/canisters/group/api/src/updates/add_reaction.rs index f5504fd608..900c3ed6f5 100644 --- a/backend/canisters/group/api/src/updates/add_reaction.rs +++ b/backend/canisters/group/api/src/updates/add_reaction.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, MessageIndex, Reaction}; +#[ts_export(group, add_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -13,6 +15,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, add_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/block_user.rs b/backend/canisters/group/api/src/updates/block_user.rs index 58ba0525ad..b0adf06bdb 100644 --- a/backend/canisters/group/api/src/updates/block_user.rs +++ b/backend/canisters/group/api/src/updates/block_user.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(group, block_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, pub correlation_id: u64, } +#[ts_export(group, block_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/cancel_invites.rs b/backend/canisters/group/api/src/updates/cancel_invites.rs index d2a54f04b3..eaa8c8fd47 100644 --- a/backend/canisters/group/api/src/updates/cancel_invites.rs +++ b/backend/canisters/group/api/src/updates/cancel_invites.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(group, cancel_invites)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_ids: Vec, } +#[ts_export(group, cancel_invites)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/cancel_p2p_swap.rs b/backend/canisters/group/api/src/updates/cancel_p2p_swap.rs index 71e529eb80..b575cfbe25 100644 --- a/backend/canisters/group/api/src/updates/cancel_p2p_swap.rs +++ b/backend/canisters/group/api/src/updates/cancel_p2p_swap.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, MessageIndex, SwapStatusError}; +#[ts_export(group, cancel_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, pub message_id: MessageId, } +#[ts_export(group, cancel_p2p_swap)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/change_role.rs b/backend/canisters/group/api/src/updates/change_role.rs index 2defad33b3..e8294a85ff 100644 --- a/backend/canisters/group/api/src/updates/change_role.rs +++ b/backend/canisters/group/api/src/updates/change_role.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{GroupRole, UserId}; +#[ts_export(group, change_role)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, @@ -9,6 +11,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, change_role)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/claim_prize.rs b/backend/canisters/group/api/src/updates/claim_prize.rs index 955ac88259..e348295f1e 100644 --- a/backend/canisters/group/api/src/updates/claim_prize.rs +++ b/backend/canisters/group/api/src/updates/claim_prize.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{CompletedCryptoTransaction, FailedCryptoTransaction, MessageId}; +#[ts_export(group, claim_prize)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub message_id: MessageId, pub correlation_id: u64, } +#[ts_export(group, claim_prize)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/convert_into_community.rs b/backend/canisters/group/api/src/updates/convert_into_community.rs index bfda209e98..d4d67aaada 100644 --- a/backend/canisters/group/api/src/updates/convert_into_community.rs +++ b/backend/canisters/group/api/src/updates/convert_into_community.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ChannelId, CommunityId, CommunityPermissions, Rules}; +#[ts_export(group, convert_into_community)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub rules: Rules, @@ -10,6 +12,7 @@ pub struct Args { pub history_visible_to_new_joiners: bool, } +#[ts_export(group, convert_into_community)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -21,6 +24,7 @@ pub enum Response { InternalError(String), } +#[ts_export(group, convert_into_community)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub community_id: CommunityId, diff --git a/backend/canisters/group/api/src/updates/decline_invitation.rs b/backend/canisters/group/api/src/updates/decline_invitation.rs index 5edb26edd2..7e42363b21 100644 --- a/backend/canisters/group/api/src/updates/decline_invitation.rs +++ b/backend/canisters/group/api/src/updates/decline_invitation.rs @@ -1,9 +1,11 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::Empty; pub type Args = Empty; +#[ts_export(group, decline_invitiation)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/delete_messages.rs b/backend/canisters/group/api/src/updates/delete_messages.rs index 84cd902a85..1f4325aff9 100644 --- a/backend/canisters/group/api/src/updates/delete_messages.rs +++ b/backend/canisters/group/api/src/updates/delete_messages.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, MessageIndex}; +#[ts_export(group, delete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -11,6 +13,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, delete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/disable_invite_code.rs b/backend/canisters/group/api/src/updates/disable_invite_code.rs index b331360383..1f521489f5 100644 --- a/backend/canisters/group/api/src/updates/disable_invite_code.rs +++ b/backend/canisters/group/api/src/updates/disable_invite_code.rs @@ -1,11 +1,14 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export(group, disable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub correlation_id: u64, } +#[ts_export(group, disable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/edit_message_v2.rs b/backend/canisters/group/api/src/updates/edit_message_v2.rs index e33cac510a..a2f1077b67 100644 --- a/backend/canisters/group/api/src/updates/edit_message_v2.rs +++ b/backend/canisters/group/api/src/updates/edit_message_v2.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageContentInitial, MessageId, MessageIndex}; +#[ts_export(group, edit_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -12,6 +14,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, edit_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/enable_invite_code.rs b/backend/canisters/group/api/src/updates/enable_invite_code.rs index 220fd3f008..3b676b1f26 100644 --- a/backend/canisters/group/api/src/updates/enable_invite_code.rs +++ b/backend/canisters/group/api/src/updates/enable_invite_code.rs @@ -1,11 +1,14 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export(group, enable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub correlation_id: u64, } +#[ts_export(group, enable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -14,6 +17,7 @@ pub enum Response { ChatFrozen, } +#[ts_export(group, enable_invite_code)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub code: u64, diff --git a/backend/canisters/group/api/src/updates/follow_thread.rs b/backend/canisters/group/api/src/updates/follow_thread.rs index 68fd71bc82..0779a358e4 100644 --- a/backend/canisters/group/api/src/updates/follow_thread.rs +++ b/backend/canisters/group/api/src/updates/follow_thread.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::MessageIndex; +#[ts_export(group, follow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: MessageIndex, } +#[ts_export(group, follow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/join_video_call.rs b/backend/canisters/group/api/src/updates/join_video_call.rs index f46bce2301..18908b7cc9 100644 --- a/backend/canisters/group/api/src/updates/join_video_call.rs +++ b/backend/canisters/group/api/src/updates/join_video_call.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, VideoCallPresence}; +#[ts_export(group, join_video_call)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub message_id: MessageId, diff --git a/backend/canisters/group/api/src/updates/pin_message_v2.rs b/backend/canisters/group/api/src/updates/pin_message_v2.rs index 9a89ab9a5a..a6196d7674 100644 --- a/backend/canisters/group/api/src/updates/pin_message_v2.rs +++ b/backend/canisters/group/api/src/updates/pin_message_v2.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageIndex, PushEventResult}; +#[ts_export(group, pin_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub message_index: MessageIndex, pub correlation_id: u64, } +#[ts_export(group, pin_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(PushEventResult), diff --git a/backend/canisters/group/api/src/updates/register_poll_vote.rs b/backend/canisters/group/api/src/updates/register_poll_vote.rs index 135a67ab02..7832800041 100644 --- a/backend/canisters/group/api/src/updates/register_poll_vote.rs +++ b/backend/canisters/group/api/src/updates/register_poll_vote.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageIndex, PollVotes, VoteOperation}; +#[ts_export(group, register_poll_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -12,6 +14,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, register_poll_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(PollVotes), diff --git a/backend/canisters/group/api/src/updates/register_proposal_vote.rs b/backend/canisters/group/api/src/updates/register_proposal_vote.rs index 990726610c..62c83edef1 100644 --- a/backend/canisters/group/api/src/updates/register_proposal_vote.rs +++ b/backend/canisters/group/api/src/updates/register_proposal_vote.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::MessageIndex; +#[ts_export(group, register_proposal_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub message_index: MessageIndex, pub adopt: bool, } +#[ts_export(group, register_proposal_vote)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/remove_participant.rs b/backend/canisters/group/api/src/updates/remove_participant.rs index 379ab65e39..4cd1df85a0 100644 --- a/backend/canisters/group/api/src/updates/remove_participant.rs +++ b/backend/canisters/group/api/src/updates/remove_participant.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(group, remove_participant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, pub correlation_id: u64, } +#[ts_export(group, remove_participant)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/remove_reaction.rs b/backend/canisters/group/api/src/updates/remove_reaction.rs index 7f0556dd4f..0575091404 100644 --- a/backend/canisters/group/api/src/updates/remove_reaction.rs +++ b/backend/canisters/group/api/src/updates/remove_reaction.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, MessageIndex, Reaction}; +#[ts_export(group, remove_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -10,6 +12,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, remove_reaction)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/report_message.rs b/backend/canisters/group/api/src/updates/report_message.rs index 8eaeb02a14..fc7e3aada4 100644 --- a/backend/canisters/group/api/src/updates/report_message.rs +++ b/backend/canisters/group/api/src/updates/report_message.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, MessageIndex}; +#[ts_export(group, report_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -9,6 +11,7 @@ pub struct Args { pub delete: bool, } +#[ts_export(group, report_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/set_video_call_presence.rs b/backend/canisters/group/api/src/updates/set_video_call_presence.rs index 1ad34a274c..72f363660f 100644 --- a/backend/canisters/group/api/src/updates/set_video_call_presence.rs +++ b/backend/canisters/group/api/src/updates/set_video_call_presence.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageId, VideoCallPresence}; +#[ts_export(group, set_video_call_presence)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub struct Args { pub message_id: MessageId, @@ -9,6 +11,7 @@ pub struct Args { pub new_achievement: bool, } +#[ts_export(group, set_video_call_presence)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/toggle_mute_notifications.rs b/backend/canisters/group/api/src/updates/toggle_mute_notifications.rs index 612715d581..617fb8296a 100644 --- a/backend/canisters/group/api/src/updates/toggle_mute_notifications.rs +++ b/backend/canisters/group/api/src/updates/toggle_mute_notifications.rs @@ -1,11 +1,14 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export(group, toggle_mute_notifications)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub mute: bool, } +#[ts_export(group, toggle_mute_notifications)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/unblock_user.rs b/backend/canisters/group/api/src/updates/unblock_user.rs index 504ec03088..e3f10aba59 100644 --- a/backend/canisters/group/api/src/updates/unblock_user.rs +++ b/backend/canisters/group/api/src/updates/unblock_user.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::UserId; +#[ts_export(group, unblock_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub user_id: UserId, pub correlation_id: u64, } +#[ts_export(group, unblock_user)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/undelete_messages.rs b/backend/canisters/group/api/src/updates/undelete_messages.rs index ea885f87ab..0b7402f963 100644 --- a/backend/canisters/group/api/src/updates/undelete_messages.rs +++ b/backend/canisters/group/api/src/updates/undelete_messages.rs @@ -1,7 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{Message, MessageId, MessageIndex}; +#[ts_export(group, undelete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: Option, @@ -9,6 +11,7 @@ pub struct Args { pub correlation_id: u64, } +#[ts_export(group, undelete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success(SuccessResult), @@ -18,6 +21,7 @@ pub enum Response { ChatFrozen, } +#[ts_export(group, undelete_messages)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub messages: Vec, diff --git a/backend/canisters/group/api/src/updates/unfollow_thread.rs b/backend/canisters/group/api/src/updates/unfollow_thread.rs index d478860e79..7ac7370f21 100644 --- a/backend/canisters/group/api/src/updates/unfollow_thread.rs +++ b/backend/canisters/group/api/src/updates/unfollow_thread.rs @@ -1,12 +1,15 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::MessageIndex; +#[ts_export(group, unfollow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub thread_root_message_index: MessageIndex, } +#[ts_export(group, unfollow_thread)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/api/src/updates/unpin_message.rs b/backend/canisters/group/api/src/updates/unpin_message.rs index c8f8c36eff..1ade5711a4 100644 --- a/backend/canisters/group/api/src/updates/unpin_message.rs +++ b/backend/canisters/group/api/src/updates/unpin_message.rs @@ -1,13 +1,16 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{MessageIndex, PushEventResult}; +#[ts_export(group, unpin_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct Args { pub message_index: MessageIndex, pub correlation_id: u64, } +#[ts_export(group, unpin_message)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { SuccessV2(PushEventResult), diff --git a/backend/canisters/group/api/src/updates/update_group_v2.rs b/backend/canisters/group/api/src/updates/update_group_v2.rs index b96a31c739..f6ea84a50b 100644 --- a/backend/canisters/group/api/src/updates/update_group_v2.rs +++ b/backend/canisters/group/api/src/updates/update_group_v2.rs @@ -1,24 +1,30 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; use types::{ AccessGate, Document, FieldTooLongResult, FieldTooShortResult, Milliseconds, OptionUpdate, OptionalGroupPermissions, UpdatedRules, Version, }; +#[ts_export(group, update_group)] #[derive(CandidType, Serialize, Deserialize, Debug, Default)] pub struct Args { pub name: Option, pub description: Option, pub rules: Option, + #[ts(as = "types::OptionUpdateDocument")] pub avatar: OptionUpdate, pub permissions_v2: Option, + #[ts(as = "types::OptionUpdateU64")] pub events_ttl: OptionUpdate, + #[ts(as = "types::OptionUpdateAccessGate")] pub gate: OptionUpdate, pub public: Option, pub messages_visible_to_non_members: Option, pub correlation_id: u64, } +#[ts_export(group, update_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { SuccessV2(SuccessResult), @@ -38,6 +44,7 @@ pub enum Response { InternalError, } +#[ts_export(group, update_group)] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct SuccessResult { pub rules_version: Option, diff --git a/backend/canisters/group/impl/src/queries/deleted_message.rs b/backend/canisters/group/impl/src/queries/deleted_message.rs index 2b53a02ace..b353833057 100644 --- a/backend/canisters/group/impl/src/queries/deleted_message.rs +++ b/backend/canisters/group/impl/src/queries/deleted_message.rs @@ -1,9 +1,9 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::deleted_message::{Response::*, *}; use group_chat_core::DeletedMessageResult; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn deleted_message(args: Args) -> Response { read_state(|state| deleted_message_impl(args, state)) } diff --git a/backend/canisters/group/impl/src/queries/invite_code.rs b/backend/canisters/group/impl/src/queries/invite_code.rs index 78d3f58d31..80c53aa078 100644 --- a/backend/canisters/group/impl/src/queries/invite_code.rs +++ b/backend/canisters/group/impl/src/queries/invite_code.rs @@ -1,9 +1,9 @@ use crate::read_state; use crate::RuntimeState; +use canister_api_macros::query; use group_canister::invite_code::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn invite_code(_: Args) -> Response { read_state(invite_code_impl) } diff --git a/backend/canisters/group/impl/src/queries/local_user_index.rs b/backend/canisters/group/impl/src/queries/local_user_index.rs index 60949eb5b6..b23563440a 100644 --- a/backend/canisters/group/impl/src/queries/local_user_index.rs +++ b/backend/canisters/group/impl/src/queries/local_user_index.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::local_user_index::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn local_user_index(_args: Args) -> Response { read_state(local_user_index_impl) } diff --git a/backend/canisters/group/impl/src/queries/messages_by_message_index.rs b/backend/canisters/group/impl/src/queries/messages_by_message_index.rs index 538d9df5a2..c625c0bf81 100644 --- a/backend/canisters/group/impl/src/queries/messages_by_message_index.rs +++ b/backend/canisters/group/impl/src/queries/messages_by_message_index.rs @@ -1,10 +1,10 @@ use crate::queries::check_replica_up_to_date; use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::messages_by_message_index::{Response::*, *}; use group_chat_core::MessagesResult; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn messages_by_message_index(args: Args) -> Response { read_state(|state| messages_by_message_index_impl(args, state)) } diff --git a/backend/canisters/group/impl/src/queries/search_messages.rs b/backend/canisters/group/impl/src/queries/search_messages.rs index 842c2cf4ef..c197990f2b 100644 --- a/backend/canisters/group/impl/src/queries/search_messages.rs +++ b/backend/canisters/group/impl/src/queries/search_messages.rs @@ -1,9 +1,9 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::search_messages::{Response::*, *}; use group_chat_core::SearchResults; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn search_messages(args: Args) -> Response { read_state(|state| search_messages_impl(args, state)) } diff --git a/backend/canisters/group/impl/src/queries/selected_initial.rs b/backend/canisters/group/impl/src/queries/selected_initial.rs index 6bc2a8a17b..70d700f827 100644 --- a/backend/canisters/group/impl/src/queries/selected_initial.rs +++ b/backend/canisters/group/impl/src/queries/selected_initial.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::selected_initial::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn selected_initial(_args: Args) -> Response { read_state(selected_initial_impl) } diff --git a/backend/canisters/group/impl/src/queries/selected_updates.rs b/backend/canisters/group/impl/src/queries/selected_updates.rs index 1b0e85fbd3..891e05d456 100644 --- a/backend/canisters/group/impl/src/queries/selected_updates.rs +++ b/backend/canisters/group/impl/src/queries/selected_updates.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::selected_updates_v2::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn selected_updates_v2(args: Args) -> Response { read_state(|state| selected_updates_impl(args, state)) } diff --git a/backend/canisters/group/impl/src/queries/thread_previews.rs b/backend/canisters/group/impl/src/queries/thread_previews.rs index b2aa172b27..5423ec1491 100644 --- a/backend/canisters/group/impl/src/queries/thread_previews.rs +++ b/backend/canisters/group/impl/src/queries/thread_previews.rs @@ -1,10 +1,10 @@ use crate::queries::check_replica_up_to_date; use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::thread_previews::{Response::*, *}; use group_chat_core::ThreadPreviewsResult; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn thread_previews(args: Args) -> Response { read_state(|state| thread_previews_impl(args, state)) } diff --git a/backend/canisters/group/impl/src/queries/video_call_participants.rs b/backend/canisters/group/impl/src/queries/video_call_participants.rs index 972a7157dc..74dcf5660b 100644 --- a/backend/canisters/group/impl/src/queries/video_call_participants.rs +++ b/backend/canisters/group/impl/src/queries/video_call_participants.rs @@ -1,8 +1,8 @@ use crate::{read_state, RuntimeState}; +use canister_api_macros::query; use group_canister::video_call_participants::{Response::*, *}; -use ic_cdk::query; -#[query] +#[query(candid = true, msgpack = true)] fn video_call_participants(args: Args) -> Response { read_state(|state| video_call_participants_impl(args, state)) } diff --git a/backend/canisters/group/impl/src/updates/accept_p2p_swap.rs b/backend/canisters/group/impl/src/updates/accept_p2p_swap.rs index e9df99fdf5..506604b2ec 100644 --- a/backend/canisters/group/impl/src/updates/accept_p2p_swap.rs +++ b/backend/canisters/group/impl/src/updates/accept_p2p_swap.rs @@ -1,13 +1,13 @@ use crate::activity_notifications::handle_activity_notification; use crate::timer_job_types::NotifyEscrowCanisterOfDepositJob; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::accept_p2p_swap::{Response::*, *}; -use ic_cdk::update; use icrc_ledger_types::icrc1::transfer::TransferError; use types::{AcceptSwapSuccess, Achievement, Chat, MessageId, MessageIndex, P2PSwapLocation, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn accept_p2p_swap(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/add_reaction.rs b/backend/canisters/group/impl/src/updates/add_reaction.rs index 72f051f4dc..bf258db6f8 100644 --- a/backend/canisters/group/impl/src/updates/add_reaction.rs +++ b/backend/canisters/group/impl/src/updates/add_reaction.rs @@ -1,13 +1,13 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::Reader; use group_canister::add_reaction::{Response::*, *}; use group_chat_core::AddRemoveReactionResult; -use ic_cdk::update; use types::{Achievement, EventIndex, GroupReactionAddedNotification, Notification, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn add_reaction(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/cancel_invites.rs b/backend/canisters/group/impl/src/updates/cancel_invites.rs index 2f9045d0af..0969c69949 100644 --- a/backend/canisters/group/impl/src/updates/cancel_invites.rs +++ b/backend/canisters/group/impl/src/updates/cancel_invites.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::cancel_invites::{Response::*, *}; use group_chat_core::CancelInvitesResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn cancel_invites(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/cancel_p2p_swap.rs b/backend/canisters/group/impl/src/updates/cancel_p2p_swap.rs index 2a8fa48c32..b4c0f56ac5 100644 --- a/backend/canisters/group/impl/src/updates/cancel_p2p_swap.rs +++ b/backend/canisters/group/impl/src/updates/cancel_p2p_swap.rs @@ -1,11 +1,11 @@ use crate::timer_job_types::CancelP2PSwapInEscrowCanisterJob; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::cancel_p2p_swap::{Response::*, *}; -use ic_cdk::update; use types::CancelP2PSwapResult; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn cancel_p2p_swap(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/change_role.rs b/backend/canisters/group/impl/src/updates/change_role.rs index 0a1460a0c4..84d5907d7d 100644 --- a/backend/canisters/group/impl/src/updates/change_role.rs +++ b/backend/canisters/group/impl/src/updates/change_role.rs @@ -1,14 +1,14 @@ use crate::activity_notifications::handle_activity_notification; use crate::updates::change_role::Response::*; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::change_role::*; use group_chat_core::{ChangeRoleResult, GroupRoleInternal}; -use ic_cdk::update; use types::{CanisterId, UserId}; use user_index_canister_c2c_client::{lookup_user, LookupUserError}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn change_role(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/claim_prize.rs b/backend/canisters/group/impl/src/updates/claim_prize.rs index e8904e06eb..4e662cbf46 100644 --- a/backend/canisters/group/impl/src/updates/claim_prize.rs +++ b/backend/canisters/group/impl/src/updates/claim_prize.rs @@ -1,14 +1,14 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::ReservePrizeResult; use group_canister::claim_prize::{Response::*, *}; -use ic_cdk::update; use ledger_utils::{create_pending_transaction, process_transaction}; use types::{CanisterId, CompletedCryptoTransaction, PendingCryptoTransaction, UserId}; use utils::consts::MEMO_PRIZE_CLAIM; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn claim_prize(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/convert_into_community.rs b/backend/canisters/group/impl/src/updates/convert_into_community.rs index 2ddb64e875..08a2bc4a30 100644 --- a/backend/canisters/group/impl/src/updates/convert_into_community.rs +++ b/backend/canisters/group/impl/src/updates/convert_into_community.rs @@ -1,15 +1,15 @@ use crate::updates::c2c_unfreeze_group::c2c_unfreeze_group_impl; use crate::{mutate_state, run_regular_jobs, CommunityBeingImportedInto, RuntimeState, StartImportIntoCommunityResult}; use candid::Principal; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::convert_into_community::{Response::*, *}; -use ic_cdk::update; use rand::Rng; use std::collections::HashMap; use types::{CanisterId, UserId}; use utils::consts::OPENCHAT_BOT_USER_ID; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn convert_into_community(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/decline_invitation.rs b/backend/canisters/group/impl/src/updates/decline_invitation.rs index 61fa4861b8..5188a22eec 100644 --- a/backend/canisters/group/impl/src/updates/decline_invitation.rs +++ b/backend/canisters/group/impl/src/updates/decline_invitation.rs @@ -1,9 +1,9 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::decline_invitation::{Response::*, *}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn decline_invitation(_args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/disable_invite_code.rs b/backend/canisters/group/impl/src/updates/disable_invite_code.rs index dd41d21a5f..c864f5ab46 100644 --- a/backend/canisters/group/impl/src/updates/disable_invite_code.rs +++ b/backend/canisters/group/impl/src/updates/disable_invite_code.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::ChatEventInternal; use group_canister::disable_invite_code::{Response::*, *}; -use ic_cdk::update; use types::{GroupInviteCodeChange, GroupInviteCodeChanged}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn disable_invite_code(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/edit_message.rs b/backend/canisters/group/impl/src/updates/edit_message.rs index d14bd42106..d6a62a6c60 100644 --- a/backend/canisters/group/impl/src/updates/edit_message.rs +++ b/backend/canisters/group/impl/src/updates/edit_message.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::{EditMessageArgs, EditMessageResult}; use group_canister::edit_message_v2::{Response::*, *}; -use ic_cdk::update; use types::Achievement; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn edit_message_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/enable_invite_code.rs b/backend/canisters/group/impl/src/updates/enable_invite_code.rs index 33def4475b..a3440452ae 100644 --- a/backend/canisters/group/impl/src/updates/enable_invite_code.rs +++ b/backend/canisters/group/impl/src/updates/enable_invite_code.rs @@ -1,17 +1,17 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; use candid::Principal; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::ChatEventInternal; use group_canister::enable_invite_code::{Response::*, *}; use group_canister::reset_invite_code; -use ic_cdk::update; use rand::rngs::StdRng; use rand::{RngCore, SeedableRng}; use types::{GroupInviteCodeChange, GroupInviteCodeChanged}; use utils::canister; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn reset_invite_code(args: reset_invite_code::Args) -> reset_invite_code::Response { run_regular_jobs(); @@ -32,7 +32,7 @@ async fn reset_invite_code(args: reset_invite_code::Args) -> reset_invite_code:: Success(SuccessResult { code }) } -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn enable_invite_code(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/follow_thread.rs b/backend/canisters/group/impl/src/updates/follow_thread.rs index e6deebc173..3e7d474154 100644 --- a/backend/canisters/group/impl/src/updates/follow_thread.rs +++ b/backend/canisters/group/impl/src/updates/follow_thread.rs @@ -1,10 +1,10 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::follow_thread::{Response::*, *}; use group_chat_core::FollowThreadResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn follow_thread(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/join_video_call.rs b/backend/canisters/group/impl/src/updates/join_video_call.rs index a129db7fd1..cfc82a2496 100644 --- a/backend/canisters/group/impl/src/updates/join_video_call.rs +++ b/backend/canisters/group/impl/src/updates/join_video_call.rs @@ -1,10 +1,10 @@ use crate::updates::set_video_call_presence::set_video_call_presence_impl; use crate::{mutate_state, run_regular_jobs}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::join_video_call::{Args, Response}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn join_video_call(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/pin_message.rs b/backend/canisters/group/impl/src/updates/pin_message.rs index 9efeb3f3e4..c2d9ac12e5 100644 --- a/backend/canisters/group/impl/src/updates/pin_message.rs +++ b/backend/canisters/group/impl/src/updates/pin_message.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::pin_message_v2::{Response::*, *}; use group_chat_core::PinUnpinMessageResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn pin_message_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/register_poll_vote.rs b/backend/canisters/group/impl/src/updates/register_poll_vote.rs index 34f022465f..88f5d52828 100644 --- a/backend/canisters/group/impl/src/updates/register_poll_vote.rs +++ b/backend/canisters/group/impl/src/updates/register_poll_vote.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::{RegisterPollVoteArgs, RegisterPollVoteResult}; use group_canister::register_poll_vote::{Response::*, *}; -use ic_cdk::update; use types::Achievement; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn register_poll_vote(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/register_proposal_vote.rs b/backend/canisters/group/impl/src/updates/register_proposal_vote.rs index 9e0e712463..a7062ca5f4 100644 --- a/backend/canisters/group/impl/src/updates/register_proposal_vote.rs +++ b/backend/canisters/group/impl/src/updates/register_proposal_vote.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::{MessageContentInternal, Reader, RecordProposalVoteResult}; use group_canister::register_proposal_vote::{Response::*, *}; -use ic_cdk::update; use types::{CanisterId, ProposalId, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn register_proposal_vote(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/register_proposal_vote_v2.rs b/backend/canisters/group/impl/src/updates/register_proposal_vote_v2.rs index bb56ecf4e6..46f5f2001b 100644 --- a/backend/canisters/group/impl/src/updates/register_proposal_vote_v2.rs +++ b/backend/canisters/group/impl/src/updates/register_proposal_vote_v2.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::RecordProposalVoteResult; use group_canister::register_proposal_vote_v2::{Response::*, *}; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn register_proposal_vote_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/remove_participant.rs b/backend/canisters/group/impl/src/updates/remove_participant.rs index 4353761e59..bc83f35772 100644 --- a/backend/canisters/group/impl/src/updates/remove_participant.rs +++ b/backend/canisters/group/impl/src/updates/remove_participant.rs @@ -1,16 +1,16 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, read_state, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use fire_and_forget_handler::FireAndForgetHandler; use group_canister::remove_participant::{Response::*, *}; use group_chat_core::GroupRoleInternal; -use ic_cdk::update; use local_user_index_canister_c2c_client::{lookup_user, LookupUserError}; use msgpack::serialize_then_unwrap; use types::{CanisterId, UserId}; use user_canister::c2c_remove_from_group; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn block_user(args: group_canister::block_user::Args) -> group_canister::block_user::Response { if !read_state(|state| state.data.chat.is_public.value) { @@ -20,7 +20,7 @@ async fn block_user(args: group_canister::block_user::Args) -> group_canister::b remove_participant_impl(args.user_id, true).await.into() } -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn remove_participant(args: Args) -> Response { remove_participant_impl(args.user_id, false).await diff --git a/backend/canisters/group/impl/src/updates/remove_reaction.rs b/backend/canisters/group/impl/src/updates/remove_reaction.rs index eede8ca600..b3ddb91cfa 100644 --- a/backend/canisters/group/impl/src/updates/remove_reaction.rs +++ b/backend/canisters/group/impl/src/updates/remove_reaction.rs @@ -1,10 +1,10 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::remove_reaction::{Response::*, *}; use group_chat_core::AddRemoveReactionResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn remove_reaction(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/report_message.rs b/backend/canisters/group/impl/src/updates/report_message.rs index 833fb20bac..d9da66b594 100644 --- a/backend/canisters/group/impl/src/updates/report_message.rs +++ b/backend/canisters/group/impl/src/updates/report_message.rs @@ -1,13 +1,13 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::Reader; use group_canister::report_message::{Response::*, *}; use group_index_canister::c2c_report_message; -use ic_cdk::update; use types::{CanisterId, MultiUserChat, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn report_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/set_video_call_presence.rs b/backend/canisters/group/impl/src/updates/set_video_call_presence.rs index cbd90d5689..0293bf8508 100644 --- a/backend/canisters/group/impl/src/updates/set_video_call_presence.rs +++ b/backend/canisters/group/impl/src/updates/set_video_call_presence.rs @@ -1,11 +1,11 @@ use crate::{activity_notifications::handle_activity_notification, mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::SetVideoCallPresenceResult; use group_canister::set_video_call_presence::{Response::*, *}; -use ic_cdk::update; use types::Achievement; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn set_video_call_presence(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/toggle_mute_notifications.rs b/backend/canisters/group/impl/src/updates/toggle_mute_notifications.rs index d0aa7a6167..73cce2c07d 100644 --- a/backend/canisters/group/impl/src/updates/toggle_mute_notifications.rs +++ b/backend/canisters/group/impl/src/updates/toggle_mute_notifications.rs @@ -1,10 +1,10 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::toggle_mute_notifications::{Response::*, *}; -use ic_cdk::update; use types::Timestamped; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn toggle_mute_notifications(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/unblock_user.rs b/backend/canisters/group/impl/src/updates/unblock_user.rs index 9edc2b39b7..e946e30a89 100644 --- a/backend/canisters/group/impl/src/updates/unblock_user.rs +++ b/backend/canisters/group/impl/src/updates/unblock_user.rs @@ -1,13 +1,13 @@ use crate::activity_notifications::handle_activity_notification; use crate::updates::unblock_user::Response::*; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use chat_events::ChatEventInternal; use group_canister::unblock_user::*; -use ic_cdk::update; use types::UsersUnblocked; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn unblock_user(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/undelete_messages.rs b/backend/canisters/group/impl/src/updates/undelete_messages.rs index 69b1447ee7..618c782cbd 100644 --- a/backend/canisters/group/impl/src/updates/undelete_messages.rs +++ b/backend/canisters/group/impl/src/updates/undelete_messages.rs @@ -1,12 +1,12 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState, TimerJob}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::undelete_messages::{Response::*, *}; use group_chat_core::UndeleteMessagesResult; -use ic_cdk::update; use std::collections::HashSet; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn undelete_messages(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/unfollow_thread.rs b/backend/canisters/group/impl/src/updates/unfollow_thread.rs index e3751c7ccb..1aab368696 100644 --- a/backend/canisters/group/impl/src/updates/unfollow_thread.rs +++ b/backend/canisters/group/impl/src/updates/unfollow_thread.rs @@ -1,10 +1,10 @@ use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::unfollow_thread::{Response::*, *}; use group_chat_core::UnfollowThreadResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] fn unfollow_thread(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/unpin_message.rs b/backend/canisters/group/impl/src/updates/unpin_message.rs index 2219476211..a241eaa851 100644 --- a/backend/canisters/group/impl/src/updates/unpin_message.rs +++ b/backend/canisters/group/impl/src/updates/unpin_message.rs @@ -1,11 +1,11 @@ use crate::activity_notifications::handle_activity_notification; use crate::{mutate_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::unpin_message::{Response::*, *}; use group_chat_core::PinUnpinMessageResult; -use ic_cdk::update; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn unpin_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/group/impl/src/updates/update_group_v2.rs b/backend/canisters/group/impl/src/updates/update_group_v2.rs index 9bd08e138b..39e92d6e5a 100644 --- a/backend/canisters/group/impl/src/updates/update_group_v2.rs +++ b/backend/canisters/group/impl/src/updates/update_group_v2.rs @@ -1,15 +1,15 @@ use crate::activity_notifications::handle_activity_notification; use crate::updates::update_group_v2::Response::*; use crate::{mutate_state, read_state, run_regular_jobs, RuntimeState}; +use canister_api_macros::update; use canister_tracing_macros::trace; use group_canister::update_group_v2::*; use group_chat_core::UpdateResult; use group_index_canister::{c2c_make_private, c2c_update_group}; -use ic_cdk::update; use tracing::error; use types::{AccessGate, CanisterId, ChatId, Document, OptionUpdate, UserId}; -#[update] +#[update(candid = true, msgpack = true)] #[trace] async fn update_group_v2(mut args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/proposals_bot/api/src/lib.rs b/backend/canisters/proposals_bot/api/src/lib.rs index afed7008a8..c9316f5074 100644 --- a/backend/canisters/proposals_bot/api/src/lib.rs +++ b/backend/canisters/proposals_bot/api/src/lib.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use ts_export::ts_export; use types::{icrc1::Account, CanisterId}; -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub struct ProposalToSubmit { pub title: String, @@ -12,7 +12,7 @@ pub struct ProposalToSubmit { pub action: ProposalToSubmitAction, } -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub enum ProposalToSubmitAction { Motion, @@ -22,7 +22,7 @@ pub enum ProposalToSubmitAction { ExecuteGenericNervousSystemFunction(ExecuteGenericNervousSystemFunction), } -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub struct TransferSnsTreasuryFunds { pub treasury: Treasury, @@ -31,14 +31,14 @@ pub struct TransferSnsTreasuryFunds { pub memo: Option, } -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub enum Treasury { ICP, SNS, } -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub struct UpgradeSnsControlledCanister { pub canister_id: CanisterId, @@ -47,7 +47,7 @@ pub struct UpgradeSnsControlledCanister { pub mode: CanisterInstallMode, } -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub enum CanisterInstallMode { Install = 1, @@ -65,7 +65,7 @@ impl From for i32 { } } -#[ts_export(proposals_bot, common)] +#[ts_export(proposals_bot)] #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub struct ExecuteGenericNervousSystemFunction { pub function_id: u64, diff --git a/backend/canisters/user/CHANGELOG.md b/backend/canisters/user/CHANGELOG.md index fc28162d5b..a6c87cd97a 100644 --- a/backend/canisters/user/CHANGELOG.md +++ b/backend/canisters/user/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Allow changing PIN number if signed in within last 5 minutes ([#6459](https://github.com/open-chat-labs/open-chat/pull/6459)) - Re-add BTC methods now that we can support larger wasms ([#6462](https://github.com/open-chat-labs/open-chat/pull/6462)) +- Add MessagePack versions of all endpoints ([#6463](https://github.com/open-chat-labs/open-chat/pull/6463)) ### Changed diff --git a/backend/canisters/user/impl/src/queries/chit_events.rs b/backend/canisters/user/impl/src/queries/chit_events.rs index 34cb1e7fc4..86ccf74902 100644 --- a/backend/canisters/user/impl/src/queries/chit_events.rs +++ b/backend/canisters/user/impl/src/queries/chit_events.rs @@ -3,7 +3,7 @@ use crate::{read_state, RuntimeState}; use canister_api_macros::query; use user_canister::chit_events::*; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn chit_events(args: Args) -> Response { read_state(|state| chit_events_impl(args, state)) } diff --git a/backend/canisters/user/impl/src/queries/contacts.rs b/backend/canisters/user/impl/src/queries/contacts.rs index 225463e5f3..bedba69a3d 100644 --- a/backend/canisters/user/impl/src/queries/contacts.rs +++ b/backend/canisters/user/impl/src/queries/contacts.rs @@ -3,7 +3,7 @@ use crate::read_state; use canister_api_macros::query; use user_canister::contacts::{Response::*, *}; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn contacts(_args: Args) -> Response { read_state(|state| { Success(SuccessResult { diff --git a/backend/canisters/user/impl/src/queries/deleted_message.rs b/backend/canisters/user/impl/src/queries/deleted_message.rs index 9da59de32f..a37cfbb07b 100644 --- a/backend/canisters/user/impl/src/queries/deleted_message.rs +++ b/backend/canisters/user/impl/src/queries/deleted_message.rs @@ -4,7 +4,7 @@ use canister_api_macros::query; use chat_events::{MessageContentInternal, Reader}; use user_canister::deleted_message::{Response::*, *}; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn deleted_message(args: Args) -> Response { read_state(|state| deleted_message_impl(args, state)) } diff --git a/backend/canisters/user/impl/src/queries/hot_group_exclusions.rs b/backend/canisters/user/impl/src/queries/hot_group_exclusions.rs index e299de6e9d..a6c6817b39 100644 --- a/backend/canisters/user/impl/src/queries/hot_group_exclusions.rs +++ b/backend/canisters/user/impl/src/queries/hot_group_exclusions.rs @@ -3,7 +3,7 @@ use crate::{read_state, RuntimeState}; use canister_api_macros::query; use user_canister::hot_group_exclusions::{Response::*, *}; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn hot_group_exclusions(_args: Args) -> Response { read_state(hot_group_exclusions_impl) } diff --git a/backend/canisters/user/impl/src/queries/local_user_index.rs b/backend/canisters/user/impl/src/queries/local_user_index.rs index 16c90f5226..3a952327d0 100644 --- a/backend/canisters/user/impl/src/queries/local_user_index.rs +++ b/backend/canisters/user/impl/src/queries/local_user_index.rs @@ -2,7 +2,7 @@ use crate::{read_state, RuntimeState}; use canister_api_macros::query; use user_canister::local_user_index::{Response::*, *}; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn local_user_index(_args: Args) -> Response { read_state(local_user_index_impl) } diff --git a/backend/canisters/user/impl/src/queries/public_profile.rs b/backend/canisters/user/impl/src/queries/public_profile.rs index c3fb994138..54dbc4d667 100644 --- a/backend/canisters/user/impl/src/queries/public_profile.rs +++ b/backend/canisters/user/impl/src/queries/public_profile.rs @@ -2,7 +2,7 @@ use crate::read_state; use canister_api_macros::query; use user_canister::public_profile::{Response::*, *}; -#[query(candid = true)] +#[query(candid = true, msgpack = true)] fn public_profile(_args: Args) -> Response { read_state(|state| { Success(PublicProfile { diff --git a/backend/canisters/user/impl/src/queries/saved_crypto_accounts.rs b/backend/canisters/user/impl/src/queries/saved_crypto_accounts.rs index bcece9db20..f85ebab8c6 100644 --- a/backend/canisters/user/impl/src/queries/saved_crypto_accounts.rs +++ b/backend/canisters/user/impl/src/queries/saved_crypto_accounts.rs @@ -3,7 +3,7 @@ use crate::{read_state, RuntimeState}; use canister_api_macros::query; use user_canister::saved_crypto_accounts::{Response::*, *}; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn saved_crypto_accounts(_args: Args) -> Response { read_state(saved_crypto_accounts_impl) } diff --git a/backend/canisters/user/impl/src/queries/search_messages.rs b/backend/canisters/user/impl/src/queries/search_messages.rs index dcedb609e9..4067b76bc6 100644 --- a/backend/canisters/user/impl/src/queries/search_messages.rs +++ b/backend/canisters/user/impl/src/queries/search_messages.rs @@ -8,7 +8,7 @@ use user_canister::search_messages::{Response::*, *}; const MIN_TERM_LENGTH: u8 = 3; const MAX_TERM_LENGTH: u8 = 30; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn search_messages(args: Args) -> Response { read_state(|state| search_messages_impl(args, state)) } diff --git a/backend/canisters/user/impl/src/queries/token_swap_status.rs b/backend/canisters/user/impl/src/queries/token_swap_status.rs index bbd650cd8f..3db29a8d31 100644 --- a/backend/canisters/user/impl/src/queries/token_swap_status.rs +++ b/backend/canisters/user/impl/src/queries/token_swap_status.rs @@ -3,7 +3,7 @@ use crate::{read_state, RuntimeState}; use canister_api_macros::query; use user_canister::token_swap_status::{Response::*, *}; -#[query(guard = "caller_is_owner", candid = true)] +#[query(guard = "caller_is_owner", candid = true, msgpack = true)] fn token_swap_status(args: Args) -> Response { read_state(|state| token_swap_status_impl(args, state)) } diff --git a/backend/canisters/user/impl/src/updates/accept_p2p_swap.rs b/backend/canisters/user/impl/src/updates/accept_p2p_swap.rs index a6fd25eb9a..9183a5f84d 100644 --- a/backend/canisters/user/impl/src/updates/accept_p2p_swap.rs +++ b/backend/canisters/user/impl/src/updates/accept_p2p_swap.rs @@ -17,7 +17,7 @@ use user_canister::{P2PSwapStatusChange, UserCanisterEvent}; use utils::consts::MEMO_P2P_SWAP_ACCEPT; use utils::time::NANOS_PER_MILLISECOND; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn accept_p2p_swap(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/add_hot_group_exclusions.rs b/backend/canisters/user/impl/src/updates/add_hot_group_exclusions.rs index 1206312711..66cb8e96c6 100644 --- a/backend/canisters/user/impl/src/updates/add_hot_group_exclusions.rs +++ b/backend/canisters/user/impl/src/updates/add_hot_group_exclusions.rs @@ -4,7 +4,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::add_hot_group_exclusions::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn add_hot_group_exclusions(args: Args) -> Response { run_regular_jobs(); @@ -12,7 +12,7 @@ fn add_hot_group_exclusions(args: Args) -> Response { mutate_state(|state| add_hot_group_exclusions_impl(args, state)) } -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn add_recommended_group_exclusions(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/add_reaction.rs b/backend/canisters/user/impl/src/updates/add_reaction.rs index 7c000529bc..b3bc5e1071 100644 --- a/backend/canisters/user/impl/src/updates/add_reaction.rs +++ b/backend/canisters/user/impl/src/updates/add_reaction.rs @@ -7,7 +7,7 @@ use types::{Achievement, EventIndex}; use user_canister::add_reaction::{Response::*, *}; use user_canister::{ToggleReactionArgs, UserCanisterEvent}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn add_reaction(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/approve_transfer.rs b/backend/canisters/user/impl/src/updates/approve_transfer.rs index d1803a851e..666d56d1be 100644 --- a/backend/canisters/user/impl/src/updates/approve_transfer.rs +++ b/backend/canisters/user/impl/src/updates/approve_transfer.rs @@ -8,7 +8,7 @@ use types::TimestampNanos; use user_canister::approve_transfer::{Response::*, *}; use utils::time::NANOS_PER_MILLISECOND; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn approve_transfer(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/archive_unarchive_chats.rs b/backend/canisters/user/impl/src/updates/archive_unarchive_chats.rs index 492023ea9d..376fbf789d 100644 --- a/backend/canisters/user/impl/src/updates/archive_unarchive_chats.rs +++ b/backend/canisters/user/impl/src/updates/archive_unarchive_chats.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use types::{Chat, TimestampMillis, Timestamped}; use user_canister::archive_unarchive_chats::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn archive_unarchive_chats(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/block_user.rs b/backend/canisters/user/impl/src/updates/block_user.rs index 8c1eec8842..7ffddb38fd 100644 --- a/backend/canisters/user/impl/src/updates/block_user.rs +++ b/backend/canisters/user/impl/src/updates/block_user.rs @@ -4,7 +4,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::block_user::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn block_user(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/btc_address.rs b/backend/canisters/user/impl/src/updates/btc_address.rs index e8273068a6..c2dcc7ac18 100644 --- a/backend/canisters/user/impl/src/updates/btc_address.rs +++ b/backend/canisters/user/impl/src/updates/btc_address.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use ckbtc_minter_canister::CKBTC_MINTER_CANISTER_ID; use user_canister::btc_address::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn btc_address(_args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/cancel_message_reminder.rs b/backend/canisters/user/impl/src/updates/cancel_message_reminder.rs index d066985dd5..91eeab7523 100644 --- a/backend/canisters/user/impl/src/updates/cancel_message_reminder.rs +++ b/backend/canisters/user/impl/src/updates/cancel_message_reminder.rs @@ -6,7 +6,7 @@ use canister_tracing_macros::trace; use user_canister::cancel_message_reminder::{Response::*, *}; use utils::consts::OPENCHAT_BOT_USER_ID; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn cancel_message_reminder(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/cancel_p2p_swap.rs b/backend/canisters/user/impl/src/updates/cancel_p2p_swap.rs index e4145e0f60..2cf67b7760 100644 --- a/backend/canisters/user/impl/src/updates/cancel_p2p_swap.rs +++ b/backend/canisters/user/impl/src/updates/cancel_p2p_swap.rs @@ -6,7 +6,7 @@ use canister_tracing_macros::trace; use types::CancelP2PSwapResult; use user_canister::cancel_p2p_swap::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn cancel_p2p_swap(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/claim_daily_chit.rs b/backend/canisters/user/impl/src/updates/claim_daily_chit.rs index 45f342b313..e667651718 100644 --- a/backend/canisters/user/impl/src/updates/claim_daily_chit.rs +++ b/backend/canisters/user/impl/src/updates/claim_daily_chit.rs @@ -8,7 +8,7 @@ use types::{Achievement, ChitEarned, ChitEarnedReason, UserId}; use user_canister::claim_daily_chit::{Response::*, *}; use utils::time::tomorrow; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn claim_daily_chit(_args: Args) -> Response { mutate_state(claim_daily_chit_impl) diff --git a/backend/canisters/user/impl/src/updates/configure_wallet.rs b/backend/canisters/user/impl/src/updates/configure_wallet.rs index 22a007c9f6..7c64e4485d 100644 --- a/backend/canisters/user/impl/src/updates/configure_wallet.rs +++ b/backend/canisters/user/impl/src/updates/configure_wallet.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use types::Timestamped; use user_canister::configure_wallet::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn configure_wallet(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/create_community.rs b/backend/canisters/user/impl/src/updates/create_community.rs index 5904ce6b0e..527ffc6696 100644 --- a/backend/canisters/user/impl/src/updates/create_community.rs +++ b/backend/canisters/user/impl/src/updates/create_community.rs @@ -13,7 +13,7 @@ use utils::text_validation::{ RulesValidationError, }; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn create_community(mut args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/create_group.rs b/backend/canisters/user/impl/src/updates/create_group.rs index bdcbacf83f..b42b80ef45 100644 --- a/backend/canisters/user/impl/src/updates/create_group.rs +++ b/backend/canisters/user/impl/src/updates/create_group.rs @@ -13,7 +13,7 @@ use utils::text_validation::{ validate_description, validate_group_name, validate_rules, NameValidationError, RulesValidationError, }; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn create_group(mut args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/delete_community.rs b/backend/canisters/user/impl/src/updates/delete_community.rs index d6813a2e37..4dbafff578 100644 --- a/backend/canisters/user/impl/src/updates/delete_community.rs +++ b/backend/canisters/user/impl/src/updates/delete_community.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use community_canister::c2c_delete_community; use user_canister::delete_community::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn delete_community(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/delete_direct_chat.rs b/backend/canisters/user/impl/src/updates/delete_direct_chat.rs index 9c60491b24..70fce1fb0e 100644 --- a/backend/canisters/user/impl/src/updates/delete_direct_chat.rs +++ b/backend/canisters/user/impl/src/updates/delete_direct_chat.rs @@ -4,7 +4,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::delete_direct_chat::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn delete_direct_chat(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/delete_group.rs b/backend/canisters/user/impl/src/updates/delete_group.rs index d1ee263d3a..d130035724 100644 --- a/backend/canisters/user/impl/src/updates/delete_group.rs +++ b/backend/canisters/user/impl/src/updates/delete_group.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use group_canister::c2c_delete_group; use user_canister::delete_group::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn delete_group(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/delete_messages.rs b/backend/canisters/user/impl/src/updates/delete_messages.rs index 0b18906f49..b191c0b857 100644 --- a/backend/canisters/user/impl/src/updates/delete_messages.rs +++ b/backend/canisters/user/impl/src/updates/delete_messages.rs @@ -10,7 +10,7 @@ use user_canister::UserCanisterEvent; use utils::consts::OPENCHAT_BOT_USER_ID; use utils::time::MINUTE_IN_MS; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn delete_messages(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/edit_message.rs b/backend/canisters/user/impl/src/updates/edit_message.rs index 3aea11ff34..6135d1235a 100644 --- a/backend/canisters/user/impl/src/updates/edit_message.rs +++ b/backend/canisters/user/impl/src/updates/edit_message.rs @@ -8,7 +8,7 @@ use user_canister::edit_message_v2::{Response::*, *}; use user_canister::UserCanisterEvent; use utils::consts::OPENCHAT_BOT_USER_ID; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn edit_message_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/join_video_call.rs b/backend/canisters/user/impl/src/updates/join_video_call.rs index fe80279218..6f099e9473 100644 --- a/backend/canisters/user/impl/src/updates/join_video_call.rs +++ b/backend/canisters/user/impl/src/updates/join_video_call.rs @@ -9,7 +9,7 @@ use user_canister::{ JoinVideoCall, UserCanisterEvent, }; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn join_video_call(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/leave_community.rs b/backend/canisters/user/impl/src/updates/leave_community.rs index 53a3d31fd8..c3cedc3ab0 100644 --- a/backend/canisters/user/impl/src/updates/leave_community.rs +++ b/backend/canisters/user/impl/src/updates/leave_community.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use community_canister::c2c_leave_community; use user_canister::leave_community::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn leave_community(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/leave_group.rs b/backend/canisters/user/impl/src/updates/leave_group.rs index fc14ff5b77..24ed2a796e 100644 --- a/backend/canisters/user/impl/src/updates/leave_group.rs +++ b/backend/canisters/user/impl/src/updates/leave_group.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use group_canister::c2c_leave_group; use user_canister::leave_group::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn leave_group(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/manage_favourite_chats.rs b/backend/canisters/user/impl/src/updates/manage_favourite_chats.rs index bc84a6a26c..65183e8826 100644 --- a/backend/canisters/user/impl/src/updates/manage_favourite_chats.rs +++ b/backend/canisters/user/impl/src/updates/manage_favourite_chats.rs @@ -4,7 +4,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::manage_favourite_chats::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn manage_favourite_chats(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/mark_achievements_seen.rs b/backend/canisters/user/impl/src/updates/mark_achievements_seen.rs index a05cbe6afe..ba9b3cad2f 100644 --- a/backend/canisters/user/impl/src/updates/mark_achievements_seen.rs +++ b/backend/canisters/user/impl/src/updates/mark_achievements_seen.rs @@ -4,7 +4,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::mark_achievements_seen::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn mark_achievements_seen(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/mark_read.rs b/backend/canisters/user/impl/src/updates/mark_read.rs index feddc0b95e..224ea9008f 100644 --- a/backend/canisters/user/impl/src/updates/mark_read.rs +++ b/backend/canisters/user/impl/src/updates/mark_read.rs @@ -6,7 +6,7 @@ use user_canister::mark_read::{Response::*, *}; use user_canister::{MarkMessagesReadArgs, UserCanisterEvent}; use utils::consts::OPENCHAT_BOT_USER_ID; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn mark_read(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/mute_notifications.rs b/backend/canisters/user/impl/src/updates/mute_notifications.rs index b185ab9f0a..9609172552 100644 --- a/backend/canisters/user/impl/src/updates/mute_notifications.rs +++ b/backend/canisters/user/impl/src/updates/mute_notifications.rs @@ -5,13 +5,13 @@ use canister_tracing_macros::trace; use types::{ChatId, Timestamped}; use user_canister::mute_notifications::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn mute_notifications(args: Args) -> Response { toggle_mute_notifications_impl(args.chat_id, true) } -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn unmute_notifications(args: Args) -> Response { toggle_mute_notifications_impl(args.chat_id, false) diff --git a/backend/canisters/user/impl/src/updates/pin_chat_v2.rs b/backend/canisters/user/impl/src/updates/pin_chat_v2.rs index 8372a5da09..c766842653 100644 --- a/backend/canisters/user/impl/src/updates/pin_chat_v2.rs +++ b/backend/canisters/user/impl/src/updates/pin_chat_v2.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use user_canister::pin_chat_v2::{Response::*, *}; use user_canister::ChatInList; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn pin_chat_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/remove_reaction.rs b/backend/canisters/user/impl/src/updates/remove_reaction.rs index 03c3448562..a6fa41bd2b 100644 --- a/backend/canisters/user/impl/src/updates/remove_reaction.rs +++ b/backend/canisters/user/impl/src/updates/remove_reaction.rs @@ -7,7 +7,7 @@ use types::EventIndex; use user_canister::remove_reaction::{Response::*, *}; use user_canister::{ToggleReactionArgs, UserCanisterEvent}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn remove_reaction(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/report_message.rs b/backend/canisters/user/impl/src/updates/report_message.rs index 99f0cf9ad8..b4427817c6 100644 --- a/backend/canisters/user/impl/src/updates/report_message.rs +++ b/backend/canisters/user/impl/src/updates/report_message.rs @@ -7,7 +7,7 @@ use types::{CanisterId, Chat, EventIndex, UserId}; use user_canister::report_message::{Response::*, *}; use user_index_canister::c2c_report_message; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn report_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/retrieve_btc.rs b/backend/canisters/user/impl/src/updates/retrieve_btc.rs index a58dec2619..7d305dbefc 100644 --- a/backend/canisters/user/impl/src/updates/retrieve_btc.rs +++ b/backend/canisters/user/impl/src/updates/retrieve_btc.rs @@ -7,7 +7,7 @@ use types::Cryptocurrency; use user_canister::retrieve_btc::{Response::*, *}; use utils::time::{MINUTE_IN_MS, NANOS_PER_MILLISECOND}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn retrieve_btc(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/save_crypto_account.rs b/backend/canisters/user/impl/src/updates/save_crypto_account.rs index 2f7f963d57..874eb917d0 100644 --- a/backend/canisters/user/impl/src/updates/save_crypto_account.rs +++ b/backend/canisters/user/impl/src/updates/save_crypto_account.rs @@ -6,7 +6,7 @@ use canister_tracing_macros::trace; use ic_ledger_types::AccountIdentifier; use user_canister::save_crypto_account::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn save_crypto_account(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/set_avatar.rs b/backend/canisters/user/impl/src/updates/set_avatar.rs index b6ac8c300e..4afc8237be 100644 --- a/backend/canisters/user/impl/src/updates/set_avatar.rs +++ b/backend/canisters/user/impl/src/updates/set_avatar.rs @@ -7,7 +7,7 @@ use types::{Achievement, CanisterId, Timestamped}; use user_canister::set_avatar::*; use utils::document_validation::validate_avatar; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn set_avatar(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/set_bio.rs b/backend/canisters/user/impl/src/updates/set_bio.rs index cc7f38182c..042cd18f25 100644 --- a/backend/canisters/user/impl/src/updates/set_bio.rs +++ b/backend/canisters/user/impl/src/updates/set_bio.rs @@ -7,7 +7,7 @@ use user_canister::set_bio::{Response::*, *}; const MAX_BIO_LEN: u32 = 2000; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn set_bio(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/set_community_indexes.rs b/backend/canisters/user/impl/src/updates/set_community_indexes.rs index 0f9e701c9f..16c0889510 100644 --- a/backend/canisters/user/impl/src/updates/set_community_indexes.rs +++ b/backend/canisters/user/impl/src/updates/set_community_indexes.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use types::Timestamped; use user_canister::set_community_indexes::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn set_community_indexes(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/set_contact.rs b/backend/canisters/user/impl/src/updates/set_contact.rs index 9d3aa0e412..26afc934fd 100644 --- a/backend/canisters/user/impl/src/updates/set_contact.rs +++ b/backend/canisters/user/impl/src/updates/set_contact.rs @@ -5,7 +5,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::set_contact::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn set_contact(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/set_message_reminder.rs b/backend/canisters/user/impl/src/updates/set_message_reminder.rs index a60ba0926b..9dc702a093 100644 --- a/backend/canisters/user/impl/src/updates/set_message_reminder.rs +++ b/backend/canisters/user/impl/src/updates/set_message_reminder.rs @@ -11,7 +11,7 @@ use user_canister::C2CReplyContext; const MAX_NOTES_LENGTH: usize = 1000; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn set_message_reminder_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/set_pin_number.rs b/backend/canisters/user/impl/src/updates/set_pin_number.rs index ffd7ad13b2..d34df549a2 100644 --- a/backend/canisters/user/impl/src/updates/set_pin_number.rs +++ b/backend/canisters/user/impl/src/updates/set_pin_number.rs @@ -11,7 +11,7 @@ use utils::time::{MINUTE_IN_MS, NANOS_PER_MILLISECOND}; const MIN_LENGTH: usize = 4; const MAX_LENGTH: usize = 20; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn set_pin_number(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/submit_proposal.rs b/backend/canisters/user/impl/src/updates/submit_proposal.rs index 481d36b2b5..ab19f6d2bc 100644 --- a/backend/canisters/user/impl/src/updates/submit_proposal.rs +++ b/backend/canisters/user/impl/src/updates/submit_proposal.rs @@ -7,7 +7,7 @@ use types::icrc1::PendingCryptoTransaction; use types::{CanisterId, UserId}; use user_canister::submit_proposal::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn submit_proposal(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/swap_tokens.rs b/backend/canisters/user/impl/src/updates/swap_tokens.rs index 3f6685623f..0ec6007fa1 100644 --- a/backend/canisters/user/impl/src/updates/swap_tokens.rs +++ b/backend/canisters/user/impl/src/updates/swap_tokens.rs @@ -15,7 +15,7 @@ use user_canister::swap_tokens::{Response::*, *}; use utils::consts::MEMO_SWAP; use utils::time::{NANOS_PER_MILLISECOND, SECOND_IN_MS}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn swap_tokens(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/tip_message.rs b/backend/canisters/user/impl/src/updates/tip_message.rs index e694473b3c..1fc87ea2f4 100644 --- a/backend/canisters/user/impl/src/updates/tip_message.rs +++ b/backend/canisters/user/impl/src/updates/tip_message.rs @@ -15,7 +15,7 @@ use user_canister::UserCanisterEvent; use utils::consts::MEMO_TIP; use utils::time::NANOS_PER_MILLISECOND; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn tip_message(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/unblock_user.rs b/backend/canisters/user/impl/src/updates/unblock_user.rs index 17370e44e9..9a5d5c7613 100644 --- a/backend/canisters/user/impl/src/updates/unblock_user.rs +++ b/backend/canisters/user/impl/src/updates/unblock_user.rs @@ -4,7 +4,7 @@ use canister_api_macros::update; use canister_tracing_macros::trace; use user_canister::unblock_user::{Response::*, *}; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn unblock_user(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/undelete_messages.rs b/backend/canisters/user/impl/src/updates/undelete_messages.rs index 9daa98ede8..c6e4de70ac 100644 --- a/backend/canisters/user/impl/src/updates/undelete_messages.rs +++ b/backend/canisters/user/impl/src/updates/undelete_messages.rs @@ -8,7 +8,7 @@ use user_canister::undelete_messages::{Response::*, *}; use user_canister::UserCanisterEvent; use utils::consts::OPENCHAT_BOT_USER_ID; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn undelete_messages(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/unpin_chat_v2.rs b/backend/canisters/user/impl/src/updates/unpin_chat_v2.rs index bdab11086d..4c74df72c7 100644 --- a/backend/canisters/user/impl/src/updates/unpin_chat_v2.rs +++ b/backend/canisters/user/impl/src/updates/unpin_chat_v2.rs @@ -5,7 +5,7 @@ use canister_tracing_macros::trace; use user_canister::unpin_chat_v2::{Response::*, *}; use user_canister::ChatInList; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] fn unpin_chat_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/canisters/user/impl/src/updates/withdraw_crypto.rs b/backend/canisters/user/impl/src/updates/withdraw_crypto.rs index df752b39a4..45b8a7bc12 100644 --- a/backend/canisters/user/impl/src/updates/withdraw_crypto.rs +++ b/backend/canisters/user/impl/src/updates/withdraw_crypto.rs @@ -7,7 +7,7 @@ use canister_tracing_macros::trace; use user_canister::withdraw_crypto_v2::{Response::*, *}; use utils::consts::MEMO_SEND; -#[update(guard = "caller_is_owner", candid = true)] +#[update(guard = "caller_is_owner", candid = true, msgpack = true)] #[trace] async fn withdraw_crypto_v2(args: Args) -> Response { run_regular_jobs(); diff --git a/backend/libraries/types/src/option.rs b/backend/libraries/types/src/option.rs index 15d09b254d..c66903a18e 100644 --- a/backend/libraries/types/src/option.rs +++ b/backend/libraries/types/src/option.rs @@ -77,6 +77,7 @@ option_update!(OptionUpdateString, String); option_update!(OptionUpdateU64, u64); option_update!(OptionUpdateU128, u128); option_update!(OptionUpdateAccessGate, crate::AccessGate); +option_update!(OptionUpdateDocument, crate::Document); option_update!(OptionUpdateFrozenGroupInfo, crate::FrozenGroupInfo); option_update!(OptionUpdateGroupPermissionRole, crate::GroupPermissionRole); option_update!(OptionUpdateGroupSubtype, crate::GroupSubtype); diff --git a/backend/libraries/types/src/thread_preview.rs b/backend/libraries/types/src/thread_preview.rs index f134e4279f..e0cbf98774 100644 --- a/backend/libraries/types/src/thread_preview.rs +++ b/backend/libraries/types/src/thread_preview.rs @@ -1,10 +1,14 @@ use crate::{EventWrapper, Message}; use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct ThreadPreview { + #[ts(as = "crate::EventWrapperMessage")] pub root_message: EventWrapper, + #[ts(as = "Vec::")] pub latest_replies: Vec>, pub total_replies: u32, } diff --git a/backend/libraries/types/src/video_calls.rs b/backend/libraries/types/src/video_calls.rs index 3a5e39b3ac..dc5ab55c65 100644 --- a/backend/libraries/types/src/video_calls.rs +++ b/backend/libraries/types/src/video_calls.rs @@ -1,7 +1,9 @@ use crate::{CallParticipant, TimestampMillis}; use candid::CandidType; use serde::{Deserialize, Serialize}; +use ts_export::ts_export; +#[ts_export] #[derive(CandidType, Serialize, Deserialize, Clone, Debug, Default, Eq, PartialEq)] pub enum VideoCallPresence { #[default] @@ -10,6 +12,7 @@ pub enum VideoCallPresence { Hidden, } +#[ts_export] #[derive(CandidType, Serialize, Deserialize, Debug)] pub struct VideoCallParticipants { pub participants: Vec, diff --git a/frontend/openchat-agent/src/typebox.ts b/frontend/openchat-agent/src/typebox.ts index 22abc16437..ccdd85bf68 100644 --- a/frontend/openchat-agent/src/typebox.ts +++ b/frontend/openchat-agent/src/typebox.ts @@ -8,17 +8,15 @@ import { Type, type Static } from "@sinclair/typebox"; -export type ProposalsBotCommonCanisterInstallMode = Static< - typeof ProposalsBotCommonCanisterInstallMode ->; -export const ProposalsBotCommonCanisterInstallMode = Type.Union([ +export type ProposalsBotCanisterInstallMode = Static; +export const ProposalsBotCanisterInstallMode = Type.Union([ Type.Literal("Install"), Type.Literal("Reinstall"), Type.Literal("Upgrade"), ]); -export type ProposalsBotCommonTreasury = Static; -export const ProposalsBotCommonTreasury = Type.Union([Type.Literal("ICP"), Type.Literal("SNS")]); +export type ProposalsBotTreasury = Static; +export const ProposalsBotTreasury = Type.Union([Type.Literal("ICP"), Type.Literal("SNS")]); export type ReferralStatus = Static; export const ReferralStatus = Type.Union([ @@ -2075,21 +2073,21 @@ export const StorageBucketForwardFileArgs = Type.Object({ accessors: Type.Array(TSBytes), }); -export type ProposalsBotCommonExecuteGenericNervousSystemFunction = Static< - typeof ProposalsBotCommonExecuteGenericNervousSystemFunction +export type ProposalsBotExecuteGenericNervousSystemFunction = Static< + typeof ProposalsBotExecuteGenericNervousSystemFunction >; -export const ProposalsBotCommonExecuteGenericNervousSystemFunction = Type.Object({ +export const ProposalsBotExecuteGenericNervousSystemFunction = Type.Object({ function_id: Type.BigInt(), payload: TSBytes, }); -export type ProposalsBotCommonUpgradeSnsControlledCanister = Static< - typeof ProposalsBotCommonUpgradeSnsControlledCanister +export type ProposalsBotUpgradeSnsControlledCanister = Static< + typeof ProposalsBotUpgradeSnsControlledCanister >; -export const ProposalsBotCommonUpgradeSnsControlledCanister = Type.Object({ +export const ProposalsBotUpgradeSnsControlledCanister = Type.Object({ canister_id: TSBytes, new_canister_wasm: TSBytes, - mode: ProposalsBotCommonCanisterInstallMode, + mode: ProposalsBotCanisterInstallMode, }); export type GroupSendMessageSuccessResult = Static; @@ -3274,11 +3272,11 @@ export const StorageBucketDeleteFilesResponse = Type.Object({ failures: Type.Array(StorageBucketDeleteFilesDeleteFileFailure), }); -export type ProposalsBotCommonTransferSnsTreasuryFunds = Static< - typeof ProposalsBotCommonTransferSnsTreasuryFunds +export type ProposalsBotTransferSnsTreasuryFunds = Static< + typeof ProposalsBotTransferSnsTreasuryFunds >; -export const ProposalsBotCommonTransferSnsTreasuryFunds = Type.Object({ - treasury: ProposalsBotCommonTreasury, +export const ProposalsBotTransferSnsTreasuryFunds = Type.Object({ + treasury: ProposalsBotTreasury, amount: Type.BigInt(), to: AccountICRC1, memo: Type.Optional(Type.BigInt()), @@ -4434,29 +4432,27 @@ export const LocalUserIndexReportMessageArgs = Type.Object({ notes: Type.Optional(Type.String()), }); -export type ProposalsBotCommonProposalToSubmitAction = Static< - typeof ProposalsBotCommonProposalToSubmitAction ->; -export const ProposalsBotCommonProposalToSubmitAction = Type.Union([ +export type ProposalsBotProposalToSubmitAction = Static; +export const ProposalsBotProposalToSubmitAction = Type.Union([ Type.Literal("Motion"), Type.Object({ - TransferSnsTreasuryFunds: ProposalsBotCommonTransferSnsTreasuryFunds, + TransferSnsTreasuryFunds: ProposalsBotTransferSnsTreasuryFunds, }), Type.Literal("UpgradeSnsToNextVersion"), Type.Object({ - UpgradeSnsControlledCanister: ProposalsBotCommonUpgradeSnsControlledCanister, + UpgradeSnsControlledCanister: ProposalsBotUpgradeSnsControlledCanister, }), Type.Object({ - ExecuteGenericNervousSystemFunction: ProposalsBotCommonExecuteGenericNervousSystemFunction, + ExecuteGenericNervousSystemFunction: ProposalsBotExecuteGenericNervousSystemFunction, }), ]); -export type ProposalsBotCommonProposalToSubmit = Static; -export const ProposalsBotCommonProposalToSubmit = Type.Object({ +export type ProposalsBotProposalToSubmit = Static; +export const ProposalsBotProposalToSubmit = Type.Object({ title: Type.String(), summary: Type.String(), url: Type.String(), - action: ProposalsBotCommonProposalToSubmitAction, + action: ProposalsBotProposalToSubmitAction, }); export type OnlineUsersLastOnlineResponse = Static; @@ -4610,7 +4606,7 @@ export const UserUpdatesFavouriteChatsUpdates = Type.Object({ export type UserSubmitProposalArgs = Static; export const UserSubmitProposalArgs = Type.Object({ governance_canister_id: TSBytes, - proposal: ProposalsBotCommonProposalToSubmit, + proposal: ProposalsBotProposalToSubmit, ledger: TSBytes, token: Cryptocurrency, proposal_rejection_fee: Type.BigInt(), diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonCanisterInstallMode.ts b/tsBindings/proposalsBot/ProposalsBotCanisterInstallMode.ts similarity index 55% rename from tsBindings/proposalsBot/common/ProposalsBotCommonCanisterInstallMode.ts rename to tsBindings/proposalsBot/ProposalsBotCanisterInstallMode.ts index a552cde420..7acc565655 100644 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonCanisterInstallMode.ts +++ b/tsBindings/proposalsBot/ProposalsBotCanisterInstallMode.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ProposalsBotCommonCanisterInstallMode = "Install" | "Reinstall" | "Upgrade"; +export type ProposalsBotCanisterInstallMode = "Install" | "Reinstall" | "Upgrade"; diff --git a/tsBindings/proposalsBot/ProposalsBotExecuteGenericNervousSystemFunction.ts b/tsBindings/proposalsBot/ProposalsBotExecuteGenericNervousSystemFunction.ts new file mode 100644 index 0000000000..f61f07e4d1 --- /dev/null +++ b/tsBindings/proposalsBot/ProposalsBotExecuteGenericNervousSystemFunction.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { TSBytes } from "../shared/TSBytes"; + +export type ProposalsBotExecuteGenericNervousSystemFunction = { function_id: bigint, payload: TSBytes, }; diff --git a/tsBindings/proposalsBot/ProposalsBotProposalToSubmit.ts b/tsBindings/proposalsBot/ProposalsBotProposalToSubmit.ts new file mode 100644 index 0000000000..efb9356422 --- /dev/null +++ b/tsBindings/proposalsBot/ProposalsBotProposalToSubmit.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ProposalsBotProposalToSubmitAction } from "./ProposalsBotProposalToSubmitAction"; + +export type ProposalsBotProposalToSubmit = { title: string, summary: string, url: string, action: ProposalsBotProposalToSubmitAction, }; diff --git a/tsBindings/proposalsBot/ProposalsBotProposalToSubmitAction.ts b/tsBindings/proposalsBot/ProposalsBotProposalToSubmitAction.ts new file mode 100644 index 0000000000..a20c89b792 --- /dev/null +++ b/tsBindings/proposalsBot/ProposalsBotProposalToSubmitAction.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ProposalsBotExecuteGenericNervousSystemFunction } from "./ProposalsBotExecuteGenericNervousSystemFunction"; +import type { ProposalsBotTransferSnsTreasuryFunds } from "./ProposalsBotTransferSnsTreasuryFunds"; +import type { ProposalsBotUpgradeSnsControlledCanister } from "./ProposalsBotUpgradeSnsControlledCanister"; + +export type ProposalsBotProposalToSubmitAction = "Motion" | { "TransferSnsTreasuryFunds": ProposalsBotTransferSnsTreasuryFunds } | "UpgradeSnsToNextVersion" | { "UpgradeSnsControlledCanister": ProposalsBotUpgradeSnsControlledCanister } | { "ExecuteGenericNervousSystemFunction": ProposalsBotExecuteGenericNervousSystemFunction }; diff --git a/tsBindings/proposalsBot/ProposalsBotTransferSnsTreasuryFunds.ts b/tsBindings/proposalsBot/ProposalsBotTransferSnsTreasuryFunds.ts new file mode 100644 index 0000000000..8077dd05e9 --- /dev/null +++ b/tsBindings/proposalsBot/ProposalsBotTransferSnsTreasuryFunds.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AccountICRC1 } from "../shared/AccountICRC1"; +import type { ProposalsBotTreasury } from "./ProposalsBotTreasury"; + +export type ProposalsBotTransferSnsTreasuryFunds = { treasury: ProposalsBotTreasury, amount: bigint, to: AccountICRC1, memo?: bigint, }; diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonTreasury.ts b/tsBindings/proposalsBot/ProposalsBotTreasury.ts similarity index 66% rename from tsBindings/proposalsBot/common/ProposalsBotCommonTreasury.ts rename to tsBindings/proposalsBot/ProposalsBotTreasury.ts index c1dc63f36f..cb22ebb360 100644 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonTreasury.ts +++ b/tsBindings/proposalsBot/ProposalsBotTreasury.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ProposalsBotCommonTreasury = "ICP" | "SNS"; +export type ProposalsBotTreasury = "ICP" | "SNS"; diff --git a/tsBindings/proposalsBot/ProposalsBotUpgradeSnsControlledCanister.ts b/tsBindings/proposalsBot/ProposalsBotUpgradeSnsControlledCanister.ts new file mode 100644 index 0000000000..28e86f880e --- /dev/null +++ b/tsBindings/proposalsBot/ProposalsBotUpgradeSnsControlledCanister.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ProposalsBotCanisterInstallMode } from "./ProposalsBotCanisterInstallMode"; +import type { TSBytes } from "../shared/TSBytes"; + +export type ProposalsBotUpgradeSnsControlledCanister = { canister_id: TSBytes, new_canister_wasm: TSBytes, mode: ProposalsBotCanisterInstallMode, }; diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonExecuteGenericNervousSystemFunction.ts b/tsBindings/proposalsBot/common/ProposalsBotCommonExecuteGenericNervousSystemFunction.ts deleted file mode 100644 index 1ccdc34d09..0000000000 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonExecuteGenericNervousSystemFunction.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TSBytes } from "../../shared/TSBytes"; - -export type ProposalsBotCommonExecuteGenericNervousSystemFunction = { function_id: bigint, payload: TSBytes, }; diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmit.ts b/tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmit.ts deleted file mode 100644 index 8bff941e09..0000000000 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmit.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ProposalsBotCommonProposalToSubmitAction } from "./ProposalsBotCommonProposalToSubmitAction"; - -export type ProposalsBotCommonProposalToSubmit = { title: string, summary: string, url: string, action: ProposalsBotCommonProposalToSubmitAction, }; diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmitAction.ts b/tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmitAction.ts deleted file mode 100644 index 45efcb7927..0000000000 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonProposalToSubmitAction.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ProposalsBotCommonExecuteGenericNervousSystemFunction } from "./ProposalsBotCommonExecuteGenericNervousSystemFunction"; -import type { ProposalsBotCommonTransferSnsTreasuryFunds } from "./ProposalsBotCommonTransferSnsTreasuryFunds"; -import type { ProposalsBotCommonUpgradeSnsControlledCanister } from "./ProposalsBotCommonUpgradeSnsControlledCanister"; - -export type ProposalsBotCommonProposalToSubmitAction = "Motion" | { "TransferSnsTreasuryFunds": ProposalsBotCommonTransferSnsTreasuryFunds } | "UpgradeSnsToNextVersion" | { "UpgradeSnsControlledCanister": ProposalsBotCommonUpgradeSnsControlledCanister } | { "ExecuteGenericNervousSystemFunction": ProposalsBotCommonExecuteGenericNervousSystemFunction }; diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonTransferSnsTreasuryFunds.ts b/tsBindings/proposalsBot/common/ProposalsBotCommonTransferSnsTreasuryFunds.ts deleted file mode 100644 index 09c9629545..0000000000 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonTransferSnsTreasuryFunds.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AccountICRC1 } from "../../shared/AccountICRC1"; -import type { ProposalsBotCommonTreasury } from "./ProposalsBotCommonTreasury"; - -export type ProposalsBotCommonTransferSnsTreasuryFunds = { treasury: ProposalsBotCommonTreasury, amount: bigint, to: AccountICRC1, memo?: bigint, }; diff --git a/tsBindings/proposalsBot/common/ProposalsBotCommonUpgradeSnsControlledCanister.ts b/tsBindings/proposalsBot/common/ProposalsBotCommonUpgradeSnsControlledCanister.ts deleted file mode 100644 index 81cd8d4112..0000000000 --- a/tsBindings/proposalsBot/common/ProposalsBotCommonUpgradeSnsControlledCanister.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ProposalsBotCommonCanisterInstallMode } from "./ProposalsBotCommonCanisterInstallMode"; -import type { TSBytes } from "../../shared/TSBytes"; - -export type ProposalsBotCommonUpgradeSnsControlledCanister = { canister_id: TSBytes, new_canister_wasm: TSBytes, mode: ProposalsBotCommonCanisterInstallMode, }; diff --git a/tsBindings/types.d.ts b/tsBindings/types.d.ts index 49cbb7783f..6635911945 100644 --- a/tsBindings/types.d.ts +++ b/tsBindings/types.d.ts @@ -1,5 +1,5 @@ -export type ProposalsBotCommonCanisterInstallMode = "Install" | "Reinstall" | "Upgrade"; -export type ProposalsBotCommonTreasury = "ICP" | "SNS"; +export type ProposalsBotCanisterInstallMode = "Install" | "Reinstall" | "Upgrade"; +export type ProposalsBotTreasury = "ICP" | "SNS"; export type ReferralStatus = "Registered" | "Diamond" | "UniquePerson" | "LifetimeDiamond"; export type OnlineUsersMarkAsOnlineResponse = "Success" | "UserNotFound" | { "InternalError": string }; export type UserManageFavouriteChatsResponse = "Success" | "UserSuspended"; @@ -208,8 +208,8 @@ export type StorageBucketDeleteFileResponse = "Success" | "NotAuthorized" | "Not export type StorageBucketDeleteFileArgs = { file_id: bigint, }; export type StorageBucketForwardFileResponse = { "Success": bigint } | "NotAuthorized" | "NotFound"; export type StorageBucketForwardFileArgs = { file_id: bigint, accessors: Array, }; -export type ProposalsBotCommonExecuteGenericNervousSystemFunction = { function_id: bigint, payload: TSBytes, }; -export type ProposalsBotCommonUpgradeSnsControlledCanister = { canister_id: TSBytes, new_canister_wasm: TSBytes, mode: ProposalsBotCommonCanisterInstallMode, }; +export type ProposalsBotExecuteGenericNervousSystemFunction = { function_id: bigint, payload: TSBytes, }; +export type ProposalsBotUpgradeSnsControlledCanister = { canister_id: TSBytes, new_canister_wasm: TSBytes, mode: ProposalsBotCanisterInstallMode, }; export type GroupSendMessageSuccessResult = { event_index: EventIndex, message_index: MessageIndex, timestamp: bigint, expires_at?: bigint, }; export type GroupSendMessageResponse = { "Success": GroupSendMessageSuccessResult } | "ThreadMessageNotFound" | "MessageEmpty" | { "TextTooLong": number } | { "InvalidPoll": InvalidPollReason } | "NotAuthorized" | "CallerNotInGroup" | "UserSuspended" | { "InvalidRequest": string } | "ChatFrozen" | "RulesNotAccepted"; export type UserSavedCryptoAccountsResponse = { "Success": Array }; @@ -325,7 +325,7 @@ export type LocalUserIndexInviteUsersToChannelPartialSuccessResult = { failed_us export type LocalUserIndexInviteUsersToChannelArgs = { community_id: CommunityId, channel_id: bigint, user_ids: Array, caller_username: string, }; export type LocalUserIndexGroupAndCommunitySummaryUpdatesArgs = { requests: Array, }; export type StorageBucketDeleteFilesResponse = { success: Array, failures: Array, }; -export type ProposalsBotCommonTransferSnsTreasuryFunds = { treasury: ProposalsBotCommonTreasury, amount: bigint, to: AccountICRC1, memo?: bigint, }; +export type ProposalsBotTransferSnsTreasuryFunds = { treasury: ProposalsBotTreasury, amount: bigint, to: AccountICRC1, memo?: bigint, }; export type OnlineUsersLastOnlineArgs = { user_ids: Array, }; export type OnlineUsersLastOnlineUserLastOnline = { user_id: UserId, duration_since_last_online: bigint, }; export type UserSearchMessagesArgs = { user_id: UserId, search_term: string, max_results: number, }; @@ -454,8 +454,8 @@ export type LocalUserIndexRegisterUserResponse = { "Success": LocalUserIndexRegi export type LocalUserIndexChatEventsEventsArgs = { context: LocalUserIndexChatEventsEventsContext, args: LocalUserIndexChatEventsEventsArgsInner, latest_known_update?: bigint, }; export type LocalUserIndexInviteUsersToChannelResponse = "Success" | { "PartialSuccess": LocalUserIndexInviteUsersToChannelPartialSuccessResult } | { "Failed": LocalUserIndexInviteUsersToChannelFailedResult } | "CommunityFrozen" | "UserNotInCommunity" | "ChannelNotFound" | "UserNotInChannel" | "UserSuspended" | "NotAuthorized" | { "TooManyInvites": number } | { "InternalError": string }; export type LocalUserIndexReportMessageArgs = { chat_id: MultiUserChat, thread_root_message_index?: MessageIndex, event_index: EventIndex, reason_code: number, notes?: string, }; -export type ProposalsBotCommonProposalToSubmitAction = "Motion" | { "TransferSnsTreasuryFunds": ProposalsBotCommonTransferSnsTreasuryFunds } | "UpgradeSnsToNextVersion" | { "UpgradeSnsControlledCanister": ProposalsBotCommonUpgradeSnsControlledCanister } | { "ExecuteGenericNervousSystemFunction": ProposalsBotCommonExecuteGenericNervousSystemFunction }; -export type ProposalsBotCommonProposalToSubmit = { title: string, summary: string, url: string, action: ProposalsBotCommonProposalToSubmitAction, }; +export type ProposalsBotProposalToSubmitAction = "Motion" | { "TransferSnsTreasuryFunds": ProposalsBotTransferSnsTreasuryFunds } | "UpgradeSnsToNextVersion" | { "UpgradeSnsControlledCanister": ProposalsBotUpgradeSnsControlledCanister } | { "ExecuteGenericNervousSystemFunction": ProposalsBotExecuteGenericNervousSystemFunction }; +export type ProposalsBotProposalToSubmit = { title: string, summary: string, url: string, action: ProposalsBotProposalToSubmitAction, }; export type OnlineUsersLastOnlineResponse = { "Success": Array }; export type UserManageFavouriteChatsArgs = { to_add: Array, to_remove: Array, }; export type UserCreateGroupResponse = { "Success": UserCreateGroupSuccessResult } | { "NameTooShort": FieldTooShortResult } | { "NameTooLong": FieldTooLongResult } | "NameReserved" | { "DescriptionTooLong": FieldTooLongResult } | { "RulesTooShort": FieldTooShortResult } | { "RulesTooLong": FieldTooLongResult } | { "AvatarTooBig": FieldTooLongResult } | "AccessGateInvalid" | { "MaxGroupsCreated": number } | "NameTaken" | "Throttled" | "UserSuspended" | "UnauthorizedToCreatePublicGroup" | "InternalError"; @@ -468,7 +468,7 @@ export type UserPinChatArgs = { chat: UserChatInList, }; export type UserContactsResponse = { "Success": UserContactsSuccessResult }; export type UserInitialStateFavouriteChatsInitial = { chats: Array, pinned: Array, }; export type UserUpdatesFavouriteChatsUpdates = { chats?: Array, pinned?: Array, }; -export type UserSubmitProposalArgs = { governance_canister_id: TSBytes, proposal: ProposalsBotCommonProposalToSubmit, ledger: TSBytes, token: Cryptocurrency, proposal_rejection_fee: bigint, transaction_fee: bigint, }; +export type UserSubmitProposalArgs = { governance_canister_id: TSBytes, proposal: ProposalsBotProposalToSubmit, ledger: TSBytes, token: Cryptocurrency, proposal_rejection_fee: bigint, transaction_fee: bigint, }; export type UserSendMessageWithTransferToGroupSuccessResult = { event_index: EventIndex, message_index: MessageIndex, timestamp: bigint, expires_at?: bigint, transfer: CompletedCryptoTransaction, }; export type UserSetMessageReminderArgs = { chat: Chat, thread_root_message_index?: MessageIndex, event_index: EventIndex, notes?: string, remind_at: bigint, }; export type UserTokenSwapsResponse = { "Success": UserTokenSwapsSuccessResult }; diff --git a/tsBindings/user/submitProposal/UserSubmitProposalArgs.ts b/tsBindings/user/submitProposal/UserSubmitProposalArgs.ts index 3db16b99a4..09a61fec82 100644 --- a/tsBindings/user/submitProposal/UserSubmitProposalArgs.ts +++ b/tsBindings/user/submitProposal/UserSubmitProposalArgs.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Cryptocurrency } from "../../shared/Cryptocurrency"; -import type { ProposalsBotCommonProposalToSubmit } from "../../proposalsBot/common/ProposalsBotCommonProposalToSubmit"; +import type { ProposalsBotProposalToSubmit } from "../../proposalsBot/ProposalsBotProposalToSubmit"; import type { TSBytes } from "../../shared/TSBytes"; -export type UserSubmitProposalArgs = { governance_canister_id: TSBytes, proposal: ProposalsBotCommonProposalToSubmit, ledger: TSBytes, token: Cryptocurrency, proposal_rejection_fee: bigint, transaction_fee: bigint, }; +export type UserSubmitProposalArgs = { governance_canister_id: TSBytes, proposal: ProposalsBotProposalToSubmit, ledger: TSBytes, token: Cryptocurrency, proposal_rejection_fee: bigint, transaction_fee: bigint, };