libkazv
Kazv Namespace Reference

Namespaces

 Api
 
 Base64Opts
 
 CryptoConstants
 
 CursorOp
 
 detail
 
 Factory
 
 PromiseCombination
 

Classes

class  AbstractPromise
 
struct  AddAccountDataAction
 
struct  AddEphemeralAction
 
struct  AddLocalEchoAction
 
struct  AddPendingRoomKeyAction
 
struct  AddStateEventsAction
 
struct  AddToTimelineAction
 
class  AES256CTRDesc
 
struct  AppendTimelineAction
 
class  AsioPromise
 
class  AsioPromiseHandler
 
class  AsioStdFileHandler
 
class  AsioStdFileProvider
 
class  AsioStdFileStream
 
struct  BanAction
 
class  BaseJob
 
struct  ChangeInviteStateAction
 
struct  ChangeMembershipAction
 
struct  ClaimKeysAction
 
struct  ClaimKeysFailed
 
struct  ClaimKeysSuccessful
 
class  Client
 Represent a Matrix client. More...
 
struct  ClientModel
 
class  ContextBase
 
struct  CprJobHandler
 
struct  CreateRoomAction
 
struct  CreateRoomFailed
 
struct  CreateRoomSuccessful
 
class  Crypto
 
struct  CryptoPrivate
 
struct  DeviceKeyInfo
 
struct  DeviceListTracker
 
struct  DownloadContentAction
 
struct  DownloadContentFailed
 
struct  DownloadContentSuccessful
 
struct  DownloadThumbnailAction
 
struct  DownloadThumbnailFailed
 
struct  DownloadThumbnailSuccessful
 
class  DumbFileInterface
 
struct  DumbFileProvider
 
struct  DumbFileStream
 
class  EffectBase
 
class  EffectStatus
 
struct  EmptyBody
 
class  EncryptedFileDesc
 
struct  EncryptMegOlmEventAction
 The action to encrypt an megolm event for a room. More...
 
struct  EncryptOlmEventAction
 The action to encrypt events with olm for multiple devices. More...
 
class  Event
 
class  EventInterface
 
struct  EventReader
 
class  FileDesc
 
class  FileInterface
 
class  FileProvider
 
class  FileStream
 
struct  ForgetRoomAction
 
struct  ForgetRoomFailed
 
struct  ForgetRoomSuccessful
 
struct  GenerateAndUploadOneTimeKeysAction
 The action to generate one-time keys. More...
 
struct  GetRoomStatesAction
 
struct  GetRoomStatesFailed
 
struct  GetRoomStatesSuccessful
 
struct  GetStateEventAction
 
struct  GetStateEventFailed
 
struct  GetStateEventSuccessful
 
struct  GetUserProfileAction
 
struct  GetVersionsAction
 
struct  GetWellknownAction
 
class  InboundGroupSession
 
struct  InboundGroupSessionPrivate
 
struct  InboundSessionTag
 
struct  InvalidMessageFormat
 
struct  InviteToRoomAction
 
struct  InviteUserFailed
 
struct  InviteUserSuccessful
 
struct  JobInterface
 
struct  JoinRoomAction
 
struct  JoinRoomByIdAction
 
struct  JoinRoomFailed
 
struct  JoinRoomSuccessful
 
class  JsonWrap
 
struct  KeyOfDecryptedEvent
 
struct  KeyOfGroupSession
 
struct  KeyOfOutboundSession
 
struct  KeyOfState
 
struct  KickAction
 
class  LagerStoreEventEmitter
 
struct  LeaveRoomAction
 
struct  LeaveRoomFailed
 
struct  LeaveRoomSuccessful
 
struct  LocalEchoDesc
 Describes a local echo. More...
 
struct  LoginAction
 
struct  LoginFailed
 
struct  LoginSuccessful
 
struct  LogoutAction
 
struct  MarkMembersFullyLoadedAction
 
class  Maybe
 
struct  MegOlmSessionRotateDesc
 
class  NotBut
 
class  NotificationHandler
 A class to handle a notification. More...
 
struct  Null
 
class  OutboundGroupSession
 
struct  OutboundGroupSessionPrivate
 
struct  OutboundSessionTag
 
struct  PaginateFailed
 
struct  PaginateSuccessful
 
struct  PaginateTimelineAction
 
struct  PendingRoomKeyEvent
 
struct  PostInitialFiltersAction
 
struct  PostInitialFiltersFailed
 
struct  PostInitialFiltersSuccessful
 
struct  PostReceiptAction
 
struct  PostReceiptFailed
 
struct  PostReceiptSuccessful
 
class  PowerLevelsDesc
 Represent a m.power_levels event. More...
 
struct  PrepareForSharingRoomKeyAction
 Encrypt room key as olm and add it to the room's pending keyshare slots. More...
 
struct  PrependTimelineAction
 
struct  ProcessResponseAction
 
class  PromiseInterface
 
struct  PushAction
 Describe what actions are to be taken for a specific event. More...
 
class  PushRulesDesc
 
struct  PushRulesDescPrivate
 
struct  QueryKeysAction
 
class  RandomDeviceGenerator
 A movable wrapper around std::random_device. More...
 
class  RandomInterface
 
struct  RandomTag
 The tag to indicate that a constructor should use user-provided random data. More...
 
struct  ReadReceipt
 
struct  ReceivingAccountDataEvent
 
struct  ReceivingPresenceEvent
 
struct  ReceivingRoomAccountDataEvent
 
struct  ReceivingRoomStateEvent
 
struct  ReceivingRoomTimelineEvent
 
struct  ReceivingToDeviceMessage
 
struct  RedactEventAction
 
struct  RemoveLocalEchoAction
 
struct  RemovePendingRoomKeyAction
 
struct  Response
 
struct  ResubmitJobAction
 
class  Room
 Represent a Matrix room. More...
 
struct  RoomListModel
 
struct  RoomMembershipChanged
 
struct  RoomModel
 
struct  SaveLocalEchoAction
 Saves an local echo. More...
 
class  Sdk
 Contain the single source of truth of a matrix sdk. More...
 
struct  SdkModel
 
struct  SdkModelCursorTag
 
struct  SendMessageAction
 
struct  SendMessageFailed
 
struct  SendMessageSuccessful
 
struct  SendMultipleToDeviceMessagesAction
 Send multiple to device messages. More...
 
struct  SendStateEventAction
 
struct  SendStateEventFailed
 
struct  SendStateEventSuccessful
 
struct  SendToDeviceMessageAction
 
struct  SendToDeviceMessageFailed
 
struct  SendToDeviceMessageSuccessful
 
class  Session
 
struct  SessionPrivate
 
struct  SetAccountDataAction
 
struct  SetAccountDataPerRoomAction
 
struct  SetAvatarUrlAction
 
struct  SetDeviceTrustLevelAction
 
struct  SetDisplayNameAction
 
struct  SetHeroIdsAction
 
struct  SetLocalDraftAction
 
struct  SetReadMarkerAction
 
struct  SetReadMarkerFailed
 
struct  SetReadMarkerSuccessful
 
struct  SetRoomEncryptionAction
 
struct  SetShouldSyncAction
 
struct  SetTrustLevelNeededToSendKeysAction
 
struct  SetTypingAction
 
struct  SetTypingFailed
 
struct  SetTypingSuccessful
 
class  SHA256Desc
 
struct  ShouldQueryKeys
 
class  SingleTypePromise
 
class  SingleTypePromiseInterface
 
class  StoreBase
 
struct  SyncAction
 
struct  SyncFailed
 
struct  SyncSuccessful
 
struct  TokenLoginAction
 
class  TypelessPromise
 
struct  UnbanAction
 
struct  UnrecognizedResponse
 
struct  UpdateInvitedMemberCountAction
 
struct  UpdateJoinedMemberCountAction
 
struct  UpdateLocalEchoStatusAction
 Updates the status of an local echo. More...
 
struct  UpdateRoomAction
 
struct  UploadContentAction
 
struct  UploadContentFailed
 
struct  UploadContentSuccessful
 
struct  UploadIdentityKeysAction
 
struct  UploadIdentityKeysFailed
 
struct  UploadIdentityKeysSuccessful
 
struct  UploadOneTimeKeysFailed
 
struct  UploadOneTimeKeysSuccessful
 

Typedefs

using Header = immer::box< std::map< std::string, std::string > >
 
using BytesBody = Bytes
 
using JsonBody = JsonWrap
 
using FileBody = FileDesc
 
using Body = std::variant< EmptyBody, JsonBody, BytesBody, FileBody >
 
using Timestamp = std::int_fast64_t
 
using FileContent = immer::flex_vector< char >
 
using json = nlohmann::json
 
using KazvEvent = std::variant< std::monostate, ReceivingPresenceEvent, ReceivingAccountDataEvent, ReceivingRoomTimelineEvent, ReceivingRoomStateEvent, RoomMembershipChanged, ReceivingRoomAccountDataEvent, ReceivingToDeviceMessage, LoginSuccessful, LoginFailed, SyncSuccessful, SyncFailed, PostInitialFiltersSuccessful, PostInitialFiltersFailed, PaginateSuccessful, PaginateFailed, CreateRoomSuccessful, CreateRoomFailed, InviteUserSuccessful, InviteUserFailed, JoinRoomSuccessful, JoinRoomFailed, LeaveRoomSuccessful, LeaveRoomFailed, ForgetRoomSuccessful, ForgetRoomFailed, SendMessageSuccessful, SendMessageFailed, SendToDeviceMessageSuccessful, SendToDeviceMessageFailed, InvalidMessageFormat, GetRoomStatesSuccessful, GetRoomStatesFailed, GetStateEventSuccessful, GetStateEventFailed, SendStateEventSuccessful, SendStateEventFailed, SetTypingSuccessful, SetTypingFailed, PostReceiptSuccessful, PostReceiptFailed, SetReadMarkerSuccessful, SetReadMarkerFailed, UploadContentSuccessful, UploadContentFailed, DownloadContentSuccessful, DownloadContentFailed, DownloadThumbnailSuccessful, DownloadThumbnailFailed, UploadIdentityKeysSuccessful, UploadIdentityKeysFailed, UploadOneTimeKeysSuccessful, UploadOneTimeKeysFailed, ClaimKeysSuccessful, ClaimKeysFailed, UnrecognizedResponse, ShouldQueryKeys >
 
using KazvEventList = immer::flex_vector< KazvEvent >
 
using MaybeString = Maybe< std::string >
 
template<class T , class P >
using PromiseThenResult = typename detail::PromiseThenResultT< T, P >::type
 
using BoolPromise = SingleTypePromise< bool >
 
using BoolPromiseInterface = SingleTypePromiseInterface< bool >
 
using Bytes = std::string
 
using EventList = immer::flex_vector< Event >
 
using Variant = std::variant< std::string, JsonWrap, Null >
 
using ClientAction = std::variant< RoomListAction, LoginAction, TokenLoginAction, LogoutAction, GetWellknownAction, GetVersionsAction, SyncAction, SetShouldSyncAction, PostInitialFiltersAction, SetAccountDataAction, PaginateTimelineAction, SendMessageAction, SendStateEventAction, SaveLocalEchoAction, UpdateLocalEchoStatusAction, RedactEventAction, CreateRoomAction, GetRoomStatesAction, GetStateEventAction, InviteToRoomAction, JoinRoomByIdAction, JoinRoomAction, LeaveRoomAction, ForgetRoomAction, KickAction, BanAction, UnbanAction, SetAccountDataPerRoomAction, ProcessResponseAction, SetTypingAction, PostReceiptAction, SetReadMarkerAction, UploadContentAction, DownloadContentAction, DownloadThumbnailAction, SendToDeviceMessageAction, SendMultipleToDeviceMessagesAction, UploadIdentityKeysAction, GenerateAndUploadOneTimeKeysAction, QueryKeysAction, ClaimKeysAction, EncryptMegOlmEventAction, EncryptOlmEventAction, SetDeviceTrustLevelAction, SetTrustLevelNeededToSendKeysAction, PrepareForSharingRoomKeyAction, GetUserProfileAction, SetAvatarUrlAction, SetDisplayNameAction, ResubmitJobAction >
 
using ClientEffect = Effect< ClientAction, lager::deps<> >
 
using ClientResult = std::pair< ClientModel, ClientEffect >
 
using PowerLevel = std::int_fast64_t
 
using RoomAction = RoomModel::Action
 
using RoomListAction = RoomListModel::Action
 
using SdkModelCursorKey = lager::dep::key< SdkModelCursorTag, lager::dep::fn< std::shared_ptr< lager::reader< SdkModel > >> >
 
using SdkAction = std::variant< ClientAction >
 
using SdkEffect = Effect< SdkAction, lager::deps< JobInterface &, EventInterface & > >
 
using SdkResult = std::pair< SdkModel, SdkEffect >
 
using SessionList = std::vector< Session >
 
using ByteArray = std::vector< unsigned char >
 
using RandomData = std::string
 
using DefaultRetType = EffectStatus
 
template<class A , class D = lager::deps<>>
using Context = ContextBase< DefaultRetType, A, D >
 
template<class A , class D = lager::deps<>>
using Effect = EffectBase< DefaultRetType, A, D >
 
template<class Action , class Model , class Reducer , class Deps = lager::deps<>, class Tag = lager::automatic_tag>
using Store = StoreBase< Action, DefaultRetType, Model, Reducer, Deps, Tag >
 

Enumerations

enum  JobQueuePolicy { AlwaysContinue, CancelFutureIfFailed }
 
enum  FileOpRetCode { FileOpRetCode::Error, FileOpRetCode::Success, FileOpRetCode::Eof }
 
enum  FileOpenMode { FileOpenMode::Read, FileOpenMode::Write }
 
enum  Status : bool { FAIL, SUCC }
 
enum  RoomMembership { Invite, Join, Leave }
 
enum  RoomVisibility { Private, Public }
 
enum  CreateRoomPreset { PrivateChat, PublicChat, TrustedPrivateChat }
 
enum  ThumbnailResizingMethod { Crop, Scale }
 
enum  DeviceTrustLevel { Blocked, Unseen, Seen, Verified }
 
enum  CastArrayStrategy { CastArrayStrategy::IgnoreInvalid, CastArrayStrategy::FailAll }
 Strategy used for castArray(). More...
 
enum  CastObjectStrategy { CastObjectStrategy::IgnoreInvalid, CastObjectStrategy::FailAll }
 Strategy used for castObject(). More...
 

Functions

template<class Exec >
 AsioStdFileHandler (Exec) -> AsioStdFileHandler< Exec >
 
bool operator== (BaseJob a, BaseJob b)
 
bool operator!= (BaseJob a, BaseJob b)
 
bool operator== (EmptyBody, EmptyBody)
 
bool isBodyJson (Body body)
 
bool operator== (Response a, Response b)
 
bool operator== (BaseJob::Get, BaseJob::Get)
 
bool operator== (BaseJob::Post, BaseJob::Post)
 
bool operator== (BaseJob::Put, BaseJob::Put)
 
bool operator== (BaseJob::Delete, BaseJob::Delete)
 
template<class T >
void addToQuery (BaseJob::Query &q, std::string name, T &&arg)
 
template<class T >
void addToQueryIfNeeded (BaseJob::Query &q, std::string name, T &&arg)
 
template<class T , class V >
constexpr auto jsonAtOr (T &&key, V &&defaultValue)
 
template<class Cursor , class ... Cursors>
constexpr auto allCursors (Cursor &&first, Cursors &&...cursors)
 
auto allCursors ()
 
template<class Cursor , class ... Cursors>
constexpr auto anyCursor (Cursor &&first, Cursors &&...cursors)
 
auto anyCursor ()
 
bool operator== (const Event &a, const Event &b)
 
bool operator!= (const Event &a, const Event &b)
 
template<class T >
auto getIn (T &&item)
 
template<class ImmerT , class K , class ... Keys>
auto getIn (ImmerT &&container, K &&key, Keys &&...keys)
 
template<class T >
auto setIn (T, T newVal)
 
template<class ImmerT , class K >
auto setIn (ImmerT container, std::decay_t< decltype(getIn(std::declval< ImmerT >(), std::declval< K >()))> newVal, K &&key) -> std::decay_t< ImmerT >
 
template<class ImmerT , class K , class ... Keys>
auto setIn (ImmerT container, std::decay_t< decltype(getIn(std::declval< ImmerT >(), std::declval< K >(), std::declval< Keys >()...))> newVal, K &&key, Keys &&...keys) -> std::decay_t< ImmerT >
 
template<class T , class Func >
auto updateIn (T oldVal, Func func) -> T
 
template<class ImmerT , class Func , class ... Keys>
auto updateIn (ImmerT container, Func func, Keys &&...keys) -> ImmerT
 
template<class Jsonish , class Key , class Func >
bool hasAtThat (Jsonish &&j, Key &&k, Func &&f)
 
bool isNonCompoundCanonicalJsonValue (const nlohmann::json &j)
 
template<class Jsonish , class RangeT >
std::optional< std::decay_t< Jsonish > > getInJson (Jsonish &&j, RangeT &&path, std::size_t index=0)
 
bool operator== (JsonWrap a, JsonWrap b)
 
template<class T >
void addToJsonIfNeeded (json &j, std::string name, T &&arg)
 
template<class MapT , std::enable_if_t<!std::is_same_v< std::decay_t< MapT >, json > &&!std::is_same_v< std::decay_t< MapT >, JsonWrap >, int > = 0>
void addPropertyMapToJson (json &j, MapT &&arg)
 
void addPropertyMapToJson (json &j, const json &arg)
 
ClientResult updateClient (ClientModel m, SetAccountDataPerRoomAction a)
 
ClientResult processResponse (ClientModel m, SetAccountDataPerRoomResponse r)
 
ClientResult updateClient (ClientModel m, SetAccountDataAction a)
 
ClientResult processResponse (ClientModel m, SetAccountDataResponse r)
 
ClientResult updateClient (ClientModel m, LoginAction a)
 
ClientResult processResponse (ClientModel m, LoginResponse r)
 
ClientResult updateClient (ClientModel m, TokenLoginAction a)
 
ClientResult updateClient (ClientModel m, LogoutAction)
 
ClientResult updateClient (ClientModel m, GetWellknownAction a)
 
ClientResult processResponse (ClientModel m, GetWellknownResponse r)
 
ClientResult updateClient (ClientModel m, GetVersionsAction a)
 
ClientResult processResponse (ClientModel m, GetVersionsResponse r)
 
std::pair< std::string, std::string > mxcUriToMediaDesc (std::string mxcUri)
 
ClientResult updateClient (ClientModel m, UploadContentAction a)
 
ClientResult processResponse (ClientModel m, UploadContentResponse r)
 
ClientResult updateClient (ClientModel m, DownloadContentAction a)
 
ClientResult processResponse (ClientModel m, GetContentResponse r)
 
ClientResult updateClient (ClientModel m, DownloadThumbnailAction a)
 
ClientResult processResponse (ClientModel m, GetContentThumbnailResponse r)
 
ClientResult updateClient (ClientModel m, UploadIdentityKeysAction)
 
ClientResult updateClient (ClientModel m, GenerateAndUploadOneTimeKeysAction a)
 
ClientResult processResponse (ClientModel m, UploadKeysResponse r)
 
ClientModel tryDecryptEvents (ClientModel m)
 
std::optional< BaseJobclientPerform (ClientModel m, QueryKeysAction a)
 
ClientResult updateClient (ClientModel m, QueryKeysAction a)
 
ClientResult processResponse (ClientModel m, QueryKeysResponse r)
 
ClientResult updateClient (ClientModel m, ClaimKeysAction a)
 
ClientResult processResponse (ClientModel m, ClaimKeysResponse r)
 
ClientResult updateClient (ClientModel m, EncryptMegOlmEventAction a)
 
ClientResult updateClient (ClientModel m, EncryptOlmEventAction a)
 
ClientResult updateClient (ClientModel m, SetDeviceTrustLevelAction a)
 
ClientResult updateClient (ClientModel m, SetTrustLevelNeededToSendKeysAction a)
 
ClientResult updateClient (ClientModel m, PrepareForSharingRoomKeyAction a)
 
ClientResult updateClient (ClientModel m, SetTypingAction a)
 
ClientResult processResponse (ClientModel m, SetTypingResponse r)
 
ClientResult updateClient (ClientModel m, PostReceiptAction a)
 
ClientResult processResponse (ClientModel m, PostReceiptResponse r)
 
ClientResult updateClient (ClientModel m, SetReadMarkerAction a)
 
ClientResult processResponse (ClientModel m, SetReadMarkerResponse r)
 
ClientResult updateClient (ClientModel m, CreateRoomAction a)
 
ClientResult processResponse (ClientModel m, CreateRoomResponse r)
 
ClientResult updateClient (ClientModel m, InviteToRoomAction a)
 
ClientResult processResponse (ClientModel m, InviteUserResponse r)
 
ClientResult updateClient (ClientModel m, JoinRoomAction a)
 
ClientResult processResponse (ClientModel m, JoinRoomResponse r)
 
ClientResult updateClient (ClientModel m, JoinRoomByIdAction a)
 
ClientResult processResponse (ClientModel m, JoinRoomByIdResponse r)
 
ClientResult updateClient (ClientModel m, LeaveRoomAction a)
 
ClientResult processResponse (ClientModel m, LeaveRoomResponse r)
 
ClientResult updateClient (ClientModel m, ForgetRoomAction a)
 
ClientResult processResponse (ClientModel m, ForgetRoomResponse r)
 
ClientResult updateClient (ClientModel m, KickAction a)
 
ClientResult processResponse (ClientModel m, KickResponse r)
 
ClientResult updateClient (ClientModel m, BanAction a)
 
ClientResult processResponse (ClientModel m, BanResponse r)
 
ClientResult updateClient (ClientModel m, UnbanAction a)
 
ClientResult processResponse (ClientModel m, UnbanResponse r)
 
ClientResult updateClient (ClientModel m, PaginateTimelineAction a)
 
ClientResult processResponse (ClientModel m, GetRoomEventsResponse r)
 
ClientResult updateClient (ClientModel m, GetUserProfileAction a)
 
ClientResult processResponse (ClientModel m, GetUserProfileResponse r)
 
ClientResult updateClient (ClientModel m, SetAvatarUrlAction a)
 
ClientResult processResponse (ClientModel m, SetAvatarUrlResponse r)
 
ClientResult updateClient (ClientModel m, SetDisplayNameAction a)
 
ClientResult processResponse (ClientModel m, SetDisplayNameResponse r)
 
ClientResult updateClient (ClientModel m, SendMessageAction a)
 
ClientResult processResponse (ClientModel m, SendMessageResponse r)
 
ClientResult updateClient (ClientModel m, SendToDeviceMessageAction a)
 
ClientResult updateClient (ClientModel m, SendMultipleToDeviceMessagesAction a)
 
ClientResult processResponse (ClientModel m, SendToDeviceResponse r)
 
ClientResult updateClient (ClientModel m, SaveLocalEchoAction a)
 
ClientResult updateClient (ClientModel m, UpdateLocalEchoStatusAction a)
 
ClientResult updateClient (ClientModel m, RedactEventAction a)
 
ClientResult processResponse (ClientModel m, RedactEventResponse r)
 
BaseJob clientPerform (ClientModel m, GetRoomStatesAction a)
 
ClientResult updateClient (ClientModel m, GetRoomStatesAction a)
 
ClientResult processResponse (ClientModel m, GetRoomStateResponse r)
 
ClientResult updateClient (ClientModel m, GetStateEventAction a)
 
ClientResult processResponse (ClientModel m, GetRoomStateWithKeyResponse r)
 
ClientResult updateClient (ClientModel m, SendStateEventAction a)
 
ClientResult processResponse (ClientModel m, SetRoomStateWithKeyResponse r)
 
ClientResult updateClient (ClientModel m, SyncAction)
 
ClientResult processResponse (ClientModel m, SyncResponse r)
 
ClientResult updateClient (ClientModel m, SetShouldSyncAction a)
 
ClientResult updateClient (ClientModel m, PostInitialFiltersAction)
 
ClientResult processResponse (ClientModel m, DefineFilterResponse r)
 
template<class Archive >
void serialize (Archive &ar, ClientModel &m, std::uint32_t const version)
 
std::string increaseTxnId (std::string cur)
 
std::string getTxnId (Event, ClientModel &m)
 
template<class K , class V , class List , class Func >
immer::map< K, V > merge (immer::map< K, V > map, List list, Func keyOf)
 
std::string keyOfPresence (Event e)
 
std::string keyOfAccountData (Event e)
 
std::string keyOfTimeline (Event e)
 
std::string keyOfEphemeral (Event e)
 
template<class Archive >
void serialize (Archive &ar, KeyOfState &m, std::uint32_t const)
 
bool operator== (KeyOfState a, KeyOfState b)
 
KeyOfState keyOfState (Event e)
 
template<class Context >
JobInterfacegetJobHandler (Context &&ctx)
 
template<class Context >
EventInterfacegetEventEmitter (Context &&ctx)
 
template<class ImmerT1 , class RangeT2 , class Pred , class Func >
ImmerT1 sortedUniqueMerge (ImmerT1 base, RangeT2 addon, Pred exists, Func keyOf)
 
bool operator== (DeviceKeyInfo a, DeviceKeyInfo b)
 
bool operator!= (DeviceKeyInfo a, DeviceKeyInfo b)
 
template<class Archive >
void serialize (Archive &ar, DeviceKeyInfo &i, std::uint32_t const)
 
template<class Archive >
void serialize (Archive &ar, DeviceListTracker &t, std::uint32_t const)
 
 KAZV_DEFINE_COPYABLE_UNIQUE_PTR (PowerLevelsDesc, m_d)
 
std::vector< std::string > splitPath (std::string path)
 
bool matchGlob (std::string target, std::string pattern)
 
std::pair< bool, jsonvalidateRule (std::string ruleSetName, const json &rule)
 
Event validatePushRules (const Event &e)
 
 KAZV_DEFINE_COPYABLE_UNIQUE_PTR (PushRulesDesc, m_d)
 
bool operator== (const LocalEchoDesc &a, const LocalEchoDesc &b)
 
bool operator!= (const LocalEchoDesc &a, const LocalEchoDesc &b)
 
PendingRoomKeyEvent makePendingRoomKeyEventV0 (std::string txnId, Event event, immer::map< std::string, immer::flex_vector< std::string >> devices)
 
bool operator== (const ReadReceipt &a, const ReadReceipt &b)
 
bool operator!= (const ReadReceipt &a, const ReadReceipt &b)
 
bool operator== (const EventReader &a, const EventReader &b)
 
bool operator!= (const EventReader &a, const EventReader &b)
 
auto memberEventsByMembership (immer::map< KeyOfState, Event > stateEvents, const std::string &membership)
 
template<class Archive >
void serialize (Archive &ar, ReadReceipt &r, std::uint32_t const)
 
bool operator== (const PendingRoomKeyEvent &a, const PendingRoomKeyEvent &b)
 
bool operator!= (const PendingRoomKeyEvent &a, const PendingRoomKeyEvent &b)
 
template<class Archive >
void serialize (Archive &ar, PendingRoomKeyEvent &e, std::uint32_t const version)
 
bool operator== (const RoomModel &a, const RoomModel &b)
 
bool operator== (const RoomListModel &a, const RoomListModel &b)
 
template<class Archive >
void serialize (Archive &ar, RoomModel &r, std::uint32_t const version)
 
template<class Archive >
void serialize (Archive &ar, RoomListModel &l, std::uint32_t const)
 
template<class Archive >
void serialize (Archive &ar, SdkModel &s, std::uint32_t const)
 
template<class EventLoop , class Xform , class ... Enhancers>
auto makeSdk (SdkModel sdk, JobInterface &jobHandler, EventInterface &eventEmitter, EventLoop &&eventLoop, Xform &&xform, Enhancers &&...enhancers) -> Sdk< EventLoop, Xform, Enhancers... >
 Create an sdk with the provided model. More...
 
std::size_t makeDefaultSdkWithCryptoRandomSize ()
 
template<class EventLoop , class Xform , class ... Enhancers>
auto makeDefaultEncryptedSdk (JobInterface &jobHandler, EventInterface &eventEmitter, EventLoop &&eventLoop, Xform &&xform, Enhancers &&...enhancers) -> Sdk< EventLoop, Xform, Enhancers... >
 
template<class PH , class Xform , class ... Enhancers>
auto makeDefaultSdkWithCryptoRandom (RandomData random, JobInterface &jobHandler, EventInterface &eventEmitter, PH &&ph, Xform &&xform, Enhancers &&...enhancers) -> Sdk< PH, Xform, Enhancers... >
 Create an sdk with a default-constructed model, and a Crypto constructed with user-provided random data. More...
 
auto withRandomGenerator (RandomInterface &random)
 An enhancer to use a custom random generator. More...
 
template<class Resp >
constexpr auto failWithResponse (Resp &&r)
 A effect that returns a failed EffectStatus upon invocation. More...
 
auto failEffect (std::string errorCode, std::string errorMsg)
 An effect that returns a failed EffectStatus with the given error code and message. More...
 
template<class Jsonish , class Key , class Validator >
bool cast (Jsonish &ret, const Jsonish &input, Key &&k, Validator &&f)
 Run validator against input[k] and add it to ret. More...
 
template<class Func >
auto identValidate (Func &&f)
 Make an identity validator. More...
 
template<class Jsonish , class Key , class Validator >
bool castArray (Jsonish &ret, const Jsonish &input, Key &&k, Validator &&f, CastArrayStrategy strategy)
 Cast an array of items. More...
 
template<class Jsonish , class Key , class Validator >
bool castObject (Jsonish &ret, const Jsonish &input, Key &&k, Validator &&f, CastObjectStrategy strategy)
 Cast an object of items. More...
 
template<class Jsonish , class Key , class Jsonish2 >
std::decay_t< Jsonish > makeDefaultValue (Jsonish &&input, Key &&k, Jsonish2 &&defaultValue)
 Replace a non-existent value with a default one. More...
 
std::string encodeBase64 (std::string original, int flags=Base64Opts::none)
 Encodes the original string to base64. More...
 
std::string decodeBase64 (std::string encoded, int flags=Base64Opts::none)
 Decode base64 string. More...
 
void from_json (const nlohmann::json &j, KeyOfGroupSession &k)
 
void to_json (nlohmann::json &j, const KeyOfGroupSession &k)
 
bool operator== (KeyOfGroupSession a, KeyOfGroupSession b)
 
bool operator== (KeyOfOutboundSession a, KeyOfOutboundSession b)
 
ByteArray genRandom (int len)
 
RandomData genRandomData (int len)
 
void to_json (nlohmann::json &j, const KeyOfDecryptedEvent &k)
 
void from_json (const nlohmann::json &j, KeyOfDecryptedEvent &k)
 
bool operator== (KeyOfDecryptedEvent a, KeyOfDecryptedEvent b)
 
bool operator!= (KeyOfDecryptedEvent a, KeyOfDecryptedEvent b)
 
void to_json (nlohmann::json &j, const InboundGroupSession &s)
 
void from_json (const nlohmann::json &j, InboundGroupSession &s)
 
void to_json (nlohmann::json &j, const OutboundGroupSession &s)
 
void from_json (const nlohmann::json &j, OutboundGroupSession &s)
 
void to_json (nlohmann::json &j, const Session &s)
 
void from_json (const nlohmann::json &j, Session &s)
 
Timestamp currentTimeMs ()
 
template<class Exec >
 AsioPromiseHandler (Exec) -> AsioPromiseHandler< Exec >
 
EffectStatus createDefaultForPromiseThen (EffectStatus)
 
EffectStatus dataCombine (EffectStatus a, EffectStatus b)
 
EffectStatus dataCombineNone (EffectStatus)
 
template<class Action , class Tag = lager::automatic_tag, class Model , class Reducer , class PH , class ... Enhancers>
auto makeStore (Model &&initialModel, Reducer &&reducer, PH &&ph, Enhancers &&...enhancers)
 

Variables

detail::IntoImmerT intoImmer {}
 
detail::ContainerMapT containerMap {}
 
constexpr auto eventContent
 
const detail::OutputConfig kzo {}
 
const std::string headFailureCancelledErrorCode {"MOE_KAZV_MXC_HEAD_FAILURE_CANCELLED"}
 
const std::string headFailureCancelledErrorMsg {"This job is cancelled because one before it failed."}
 
const int headFailureCancelledStatusCode {490}
 
template<class T >
constexpr auto isPromise = std::is_base_of_v<TypelessPromise, T>
 
constexpr detail::DefaultValT DEFVAL
 
const std::string DEFTXNID {"0"}
 
const double ROOM_TAG_DEFAULT_ORDER = 2
 
constexpr auto simpleFail = detail::SimpleFailT{}
 A effect that returns a failed EffectStatus upon invocation. More...
 
template<class Reducer , class RetType , class Model , class Action , class Deps >
constexpr bool hasEffect
 

Typedef Documentation

◆ Body

using Kazv::Body = typedef std::variant<EmptyBody, JsonBody, BytesBody, FileBody>

◆ BoolPromise

using Kazv::BoolPromise = typedef SingleTypePromise<bool>

◆ BoolPromiseInterface

◆ ByteArray

using Kazv::ByteArray = typedef std::vector<unsigned char>

◆ Bytes

using Kazv::Bytes = typedef std::string

◆ BytesBody

using Kazv::BytesBody = typedef Bytes

◆ ClientAction

◆ ClientEffect

using Kazv::ClientEffect = typedef Effect<ClientAction, lager::deps<> >

◆ ClientResult

using Kazv::ClientResult = typedef std::pair<ClientModel, ClientEffect>

◆ Context

template<class A , class D = lager::deps<>>
using Kazv::Context = typedef ContextBase<DefaultRetType, A, D>

◆ DefaultRetType

◆ Effect

template<class A , class D = lager::deps<>>
using Kazv::Effect = typedef EffectBase<DefaultRetType, A, D>

◆ EventList

using Kazv::EventList = typedef immer::flex_vector<Event>

◆ FileBody

using Kazv::FileBody = typedef FileDesc

◆ FileContent

using Kazv::FileContent = typedef immer::flex_vector<char>

◆ Header

using Kazv::Header = typedef immer::box<std::map<std::string, std::string> >

◆ json

using Kazv::json = typedef nlohmann::json

◆ JsonBody

using Kazv::JsonBody = typedef JsonWrap

◆ KazvEvent

◆ KazvEventList

using Kazv::KazvEventList = typedef immer::flex_vector<KazvEvent>

◆ MaybeString

using Kazv::MaybeString = typedef Maybe<std::string>

◆ PowerLevel

using Kazv::PowerLevel = typedef std::int_fast64_t

◆ PromiseThenResult

template<class T , class P >
using Kazv::PromiseThenResult = typedef typename detail::PromiseThenResultT<T, P>::type

◆ RandomData

using Kazv::RandomData = typedef std::string

◆ RoomAction

◆ RoomListAction

◆ SdkAction

using Kazv::SdkAction = typedef std::variant< ClientAction >

◆ SdkEffect

using Kazv::SdkEffect = typedef Effect<SdkAction, lager::deps<JobInterface &, EventInterface &> >

◆ SdkModelCursorKey

using Kazv::SdkModelCursorKey = typedef lager::dep::key<SdkModelCursorTag, lager::dep::fn<std::shared_ptr<lager::reader<SdkModel> >> >

◆ SdkResult

using Kazv::SdkResult = typedef std::pair<SdkModel, SdkEffect>

◆ SessionList

using Kazv::SessionList = typedef std::vector<Session>

◆ Store

template<class Action , class Model , class Reducer , class Deps = lager::deps<>, class Tag = lager::automatic_tag>
using Kazv::Store = typedef StoreBase<Action, DefaultRetType, Model, Reducer, Deps, Tag>

◆ Timestamp

using Kazv::Timestamp = typedef std::int_fast64_t

◆ Variant

using Kazv::Variant = typedef std::variant<std::string, JsonWrap, Null>

Enumeration Type Documentation

◆ CastArrayStrategy

Strategy used for castArray().

Enumerator
IgnoreInvalid 

If any item is invalid, ignore them and add all valid entries into the output.

FailAll 

If any item is invalid, fail the entire cast.

◆ CastObjectStrategy

Strategy used for castObject().

Enumerator
IgnoreInvalid 

If any item is invalid, ignore them and add all valid entries into the output.

FailAll 

If any item is invalid, fail the entire cast.

◆ CreateRoomPreset

Enumerator
PrivateChat 
PublicChat 
TrustedPrivateChat 

◆ DeviceTrustLevel

Enumerator
Blocked 
Unseen 
Seen 
Verified 

◆ FileOpenMode

enum Kazv::FileOpenMode
strong
Enumerator
Read 
Write 

◆ FileOpRetCode

enum Kazv::FileOpRetCode
strong
Enumerator
Error 
Success 
Eof 

◆ JobQueuePolicy

Enumerator
AlwaysContinue 
CancelFutureIfFailed 

◆ RoomMembership

Enumerator
Invite 
Join 
Leave 

◆ RoomVisibility

Enumerator
Private 
Public 

◆ Status

enum Kazv::Status : bool
Enumerator
FAIL 
SUCC 

◆ ThumbnailResizingMethod

Enumerator
Crop 
Scale 

Function Documentation

◆ addPropertyMapToJson() [1/2]

void Kazv::addPropertyMapToJson ( json j,
const json arg 
)
inline

◆ addPropertyMapToJson() [2/2]

template<class MapT , std::enable_if_t<!std::is_same_v< std::decay_t< MapT >, json > &&!std::is_same_v< std::decay_t< MapT >, JsonWrap >, int > = 0>
void Kazv::addPropertyMapToJson ( json j,
MapT &&  arg 
)
inline

◆ addToJsonIfNeeded()

template<class T >
void Kazv::addToJsonIfNeeded ( json j,
std::string  name,
T &&  arg 
)
inline

◆ addToQuery()

template<class T >
void Kazv::addToQuery ( BaseJob::Query q,
std::string  name,
T &&  arg 
)
inline

◆ addToQueryIfNeeded()

template<class T >
void Kazv::addToQueryIfNeeded ( BaseJob::Query q,
std::string  name,
T &&  arg 
)
inline

◆ allCursors() [1/2]

auto Kazv::allCursors ( )
inline

◆ allCursors() [2/2]

template<class Cursor , class ... Cursors>
constexpr auto Kazv::allCursors ( Cursor &&  first,
Cursors &&...  cursors 
)
constexpr

◆ anyCursor() [1/2]

auto Kazv::anyCursor ( )
inline

◆ anyCursor() [2/2]

template<class Cursor , class ... Cursors>
constexpr auto Kazv::anyCursor ( Cursor &&  first,
Cursors &&...  cursors 
)
constexpr

◆ AsioPromiseHandler()

template<class Exec >
Kazv::AsioPromiseHandler ( Exec  ) -> AsioPromiseHandler< Exec >

◆ AsioStdFileHandler()

template<class Exec >
Kazv::AsioStdFileHandler ( Exec  ) -> AsioStdFileHandler< Exec >

◆ cast()

template<class Jsonish , class Key , class Validator >
bool Kazv::cast ( Jsonish &  ret,
const Jsonish &  input,
Key &&  k,
Validator &&  f 
)

Run validator against input[k] and add it to ret.

A validator is a function taking a Jsonish value and return a pair of boolean (the status) and a Jsonish value (the output).

If the status is true, the output will be added to ret[k]. If the status is false, the output will be ignored.

Example:

json j = json::object();
j,
json{{"foo", "1"}},
"foo",
[](const json &v) -> std::pair<bool, json> {
return v.is_string()
? {true, v.template get<std::string>() + "x"}
: {false, v};
}
); // true, j = {{"foo", "1x"}}};
json j2 = json::object();
j,
json{{"foo", 1}},
"foo",
[](const json &v) -> std::pair<bool, json> {
return v.is_string()
? {true, v.template get<std::string>() + "x"}
: {false, v};
}
); // true, j2 = json::object();
Parameters
inputThe original json taken from user input.
kThe key (usually a property name of a json object) to process on.
fThe validator.
retThe read-write reference of the returning json.
Returns
Whether the cast is successful. The cast is successful if and only if the validator returns a status of true.

◆ castArray()

template<class Jsonish , class Key , class Validator >
bool Kazv::castArray ( Jsonish &  ret,
const Jsonish &  input,
Key &&  k,
Validator &&  f,
CastArrayStrategy  strategy 
)

Cast an array of items.

Run the validator on each item of input[k] and accumulate the result into ret.

Example:

json j = json::object();
j,
json{{"foo", {"1", "2", "3", 4}}},
"foo",
[](const json &v) -> std::pair<bool, json> {
return v.is_string()
? {true, v.template get<std::string>() + "x"}
: {false, v};
},
); // true, j = {{"foo", {"1x", "2x", "3x"}}};
json j2 = json::object();
j2,
json{{"foo", {"1", "2", "3", 4}}},
"foo",
[](const json &v) -> std::pair<bool, json> {
return v.is_string()
? {true, v.template get<std::string>() + "x"}
: {false, v};
},
); // false, j2 = json::object();
Parameters
inputThe original json taken from user input.
kThe key (usually a property name of a json object) to process on.
fThe validator.
retThe read-write reference of the returning json.
strategyThe strategy to use when handling invalid items. CastArrayStrategy::IgnoreInvalid makes the cast always successful (providing input[k] is an array), and all valid items will be added to ret. CastArrayStrategy::FailAll makes the cast successful only when all input items can be casted.
Returns
Whether the cast is successful. If input[k] is not an array, it be unsuccessful.

◆ castObject()

template<class Jsonish , class Key , class Validator >
bool Kazv::castObject ( Jsonish &  ret,
const Jsonish &  input,
Key &&  k,
Validator &&  f,
CastObjectStrategy  strategy 
)

Cast an object of items.

Run the validator on each key-value pair (as a json array) of input[k] and accumulate the result into ret.

Example:

json j = json::object();
j,
json{{"foo", {{"1", "2"}, {"3", 4}}}},
"foo",
[](const json &kv) -> std::pair<bool, json> {
const key = kv[0];
const value = kv[1];
return value.is_string()
? {true, json::array({key, v.template get<std::string>() + "x"})}
: {false, v};
},
); // true, j = {{"foo", {{"1", "2x"}}}};
json j2 = json::object();
j2,
json{{"foo", {{"1", "2"}, {"3", 4}}}},
"foo",
[](const json &v) -> std::pair<bool, json> {
const key = kv[0];
const value = kv[1];
return value.is_string()
? {true, json::array({key, v.template get<std::string>() + "x"})}
: {false, v};
},
); // false, j2 = json::object();
Parameters
inputThe original json taken from user input.
kThe key (usually a property name of a json object) to process on.
fThe validator.
retThe read-write reference of the returning json.
strategyThe strategy to use when handling invalid items. CastObjectStrategy::IgnoreInvalid makes the cast always successful (providing input[k] is an object), and all valid items will be added to ret. CastObjectStrategy::FailAll makes the cast successful only when all input items can be casted.
Returns
Whether the cast is successful. If input[k] is not an object, it be unsuccessful.

◆ clientPerform() [1/2]

BaseJob Kazv::clientPerform ( ClientModel  m,
GetRoomStatesAction  a 
)

◆ clientPerform() [2/2]

std::optional< BaseJob > Kazv::clientPerform ( ClientModel  m,
QueryKeysAction  a 
)

◆ createDefaultForPromiseThen()

EffectStatus Kazv::createDefaultForPromiseThen ( EffectStatus  )
inline

◆ currentTimeMs()

Timestamp Kazv::currentTimeMs ( )
inline

◆ dataCombine()

EffectStatus Kazv::dataCombine ( EffectStatus  a,
EffectStatus  b 
)
inline

◆ dataCombineNone()

EffectStatus Kazv::dataCombineNone ( EffectStatus  )
inline

◆ decodeBase64()

std::string Kazv::decodeBase64 ( std::string  encoded,
int  flags = Base64Opts::none 
)

Decode base64 string.

Parameters
encodedThe base64-encoded string.
flagsOptions for the decoder. See Base64Opts.

◆ encodeBase64()

std::string Kazv::encodeBase64 ( std::string  original,
int  flags = Base64Opts::none 
)

Encodes the original string to base64.

Parameters
originalThe original string to encode.
flagsOptions for the encoder. See Base64Opts.

◆ failEffect()

auto Kazv::failEffect ( std::string  errorCode,
std::string  errorMsg 
)
inline

An effect that returns a failed EffectStatus with the given error code and message.

◆ failWithResponse()

template<class Resp >
constexpr auto Kazv::failWithResponse ( Resp &&  r)
constexpr

A effect that returns a failed EffectStatus upon invocation.

◆ from_json() [1/5]

void Kazv::from_json ( const nlohmann::json j,
InboundGroupSession s 
)

◆ from_json() [2/5]

void Kazv::from_json ( const nlohmann::json j,
KeyOfDecryptedEvent k 
)
inline

◆ from_json() [3/5]

void Kazv::from_json ( const nlohmann::json j,
KeyOfGroupSession k 
)
inline

◆ from_json() [4/5]

void Kazv::from_json ( const nlohmann::json j,
OutboundGroupSession s 
)

◆ from_json() [5/5]

void Kazv::from_json ( const nlohmann::json j,
Session s 
)

◆ genRandom()

ByteArray Kazv::genRandom ( int  len)
inline

◆ genRandomData()

RandomData Kazv::genRandomData ( int  len)
inline

◆ getEventEmitter()

template<class Context >
EventInterface& Kazv::getEventEmitter ( Context &&  ctx)

◆ getIn() [1/2]

template<class ImmerT , class K , class ... Keys>
auto Kazv::getIn ( ImmerT &&  container,
K &&  key,
Keys &&...  keys 
)

◆ getIn() [2/2]

template<class T >
auto Kazv::getIn ( T &&  item)

◆ getInJson()

template<class Jsonish , class RangeT >
std::optional<std::decay_t<Jsonish> > Kazv::getInJson ( Jsonish &&  j,
RangeT &&  path,
std::size_t  index = 0 
)

◆ getJobHandler()

template<class Context >
JobInterface& Kazv::getJobHandler ( Context &&  ctx)

◆ getTxnId()

std::string Kazv::getTxnId ( Event  ,
ClientModel m 
)

◆ hasAtThat()

template<class Jsonish , class Key , class Func >
bool Kazv::hasAtThat ( Jsonish &&  j,
Key &&  k,
Func &&  f 
)

◆ identValidate()

template<class Func >
auto Kazv::identValidate ( Func &&  f)

Make an identity validator.

The returned validator runs a predicate f against a value val. If the return value is true, return a pair of true and val. Otherwise, return a pair of false and val.

Parameters
fThe predicate that judges the validity of a value.
Returns
A validator.

◆ increaseTxnId()

std::string Kazv::increaseTxnId ( std::string  cur)

◆ isBodyJson()

bool Kazv::isBodyJson ( Body  body)
inline

◆ isNonCompoundCanonicalJsonValue()

bool Kazv::isNonCompoundCanonicalJsonValue ( const nlohmann::json j)
inline

◆ jsonAtOr()

template<class T , class V >
constexpr auto Kazv::jsonAtOr ( T &&  key,
V &&  defaultValue 
)
constexpr

◆ KAZV_DEFINE_COPYABLE_UNIQUE_PTR() [1/2]

Kazv::KAZV_DEFINE_COPYABLE_UNIQUE_PTR ( PowerLevelsDesc  ,
m_d   
)

◆ KAZV_DEFINE_COPYABLE_UNIQUE_PTR() [2/2]

Kazv::KAZV_DEFINE_COPYABLE_UNIQUE_PTR ( PushRulesDesc  ,
m_d   
)

◆ keyOfAccountData()

std::string Kazv::keyOfAccountData ( Event  e)
inline

◆ keyOfEphemeral()

std::string Kazv::keyOfEphemeral ( Event  e)
inline

◆ keyOfPresence()

std::string Kazv::keyOfPresence ( Event  e)
inline

◆ keyOfState()

KeyOfState Kazv::keyOfState ( Event  e)
inline

◆ keyOfTimeline()

std::string Kazv::keyOfTimeline ( Event  e)
inline

◆ makeDefaultEncryptedSdk()

template<class EventLoop , class Xform , class ... Enhancers>
auto Kazv::makeDefaultEncryptedSdk ( JobInterface jobHandler,
EventInterface eventEmitter,
EventLoop &&  eventLoop,
Xform &&  xform,
Enhancers &&...  enhancers 
) -> Sdk<EventLoop, Xform, Enhancers...>
inline

◆ makeDefaultSdkWithCryptoRandom()

template<class PH , class Xform , class ... Enhancers>
auto Kazv::makeDefaultSdkWithCryptoRandom ( RandomData  random,
JobInterface jobHandler,
EventInterface eventEmitter,
PH &&  ph,
Xform &&  xform,
Enhancers &&...  enhancers 
) -> Sdk<PH, Xform, Enhancers...>
inline

Create an sdk with a default-constructed model, and a Crypto constructed with user-provided random data.

Parameters
randomThe random data to construct Crypto. Must be of at least size makeDefaultSdkWithCryptoRandomSize().
jobHandlerThe job handler for the sdk.
eventEmitterThe event emitter for the sdk.
phThe Promise handler for the sdk.
xformA function to extract the SdkModel from the model type of the created Store. This is to take into account any enhancer that changes the model type. If you do not use any enhancer that changes the model type, put an identity function (e.g. zug::identity) here.
enhancersThe enhancers to pass to makeStore().
Returns
An Sdk created with these parameters.
See also
JobInterface, EventInterface, PromiseInterface

◆ makeDefaultSdkWithCryptoRandomSize()

std::size_t Kazv::makeDefaultSdkWithCryptoRandomSize ( )
inline
Returns
The size of random data needed for makeDefaultSdkWithCryptoRandom

◆ makeDefaultValue()

template<class Jsonish , class Key , class Jsonish2 >
std::decay_t<Jsonish> Kazv::makeDefaultValue ( Jsonish &&  input,
Key &&  k,
Jsonish2 &&  defaultValue 
)

Replace a non-existent value with a default one.

If input contains k, return input as-is. Otherwise return input but with [k] replaced with defaultValue.

Parameters
inputThe input value.
kThe key to process on.
defaultValueThe default value to replace with.
Returns
input if input contains k, otherwise, input where [k] is replaced with defaultValue.

◆ makePendingRoomKeyEventV0()

PendingRoomKeyEvent Kazv::makePendingRoomKeyEventV0 ( std::string  txnId,
Event  event,
immer::map< std::string, immer::flex_vector< std::string >>  devices 
)

◆ makeSdk()

template<class EventLoop , class Xform , class ... Enhancers>
auto Kazv::makeSdk ( SdkModel  sdk,
JobInterface jobHandler,
EventInterface eventEmitter,
EventLoop &&  eventLoop,
Xform &&  xform,
Enhancers &&...  enhancers 
) -> Sdk<EventLoop, Xform, Enhancers...>
inline

Create an sdk with the provided model.

Parameters
sdkThe initial SdkModel.
jobHandlerThe job handler for the sdk.
eventEmitterThe event emitter for the sdk.
phThe Promise handler for the sdk.
xformA function to extract the SdkModel from the model type of the created Store. This is to take into account any enhancer that changes the model type. If you do not use any enhancer that changes the model type, put an identity function (e.g. zug::identity) here.
enhancersThe enhancers to pass to makeStore().
Returns
An Sdk created with these parameters.
See also
JobInterface, EventInterface, PromiseInterface

◆ makeStore()

template<class Action , class Tag = lager::automatic_tag, class Model , class Reducer , class PH , class ... Enhancers>
auto Kazv::makeStore ( Model &&  initialModel,
Reducer &&  reducer,
PH &&  ph,
Enhancers &&...  enhancers 
)

◆ matchGlob()

bool Kazv::matchGlob ( std::string  target,
std::string  pattern 
)

◆ memberEventsByMembership()

auto Kazv::memberEventsByMembership ( immer::map< KeyOfState, Event stateEvents,
const std::string &  membership 
)

◆ merge()

template<class K , class V , class List , class Func >
immer::map<K, V> Kazv::merge ( immer::map< K, V >  map,
List  list,
Func  keyOf 
)

◆ mxcUriToMediaDesc()

std::pair< std::string, std::string > Kazv::mxcUriToMediaDesc ( std::string  mxcUri)

◆ operator!=() [1/8]

bool Kazv::operator!= ( BaseJob  a,
BaseJob  b 
)

◆ operator!=() [2/8]

bool Kazv::operator!= ( const Event a,
const Event b 
)
inline

◆ operator!=() [3/8]

bool Kazv::operator!= ( const EventReader a,
const EventReader b 
)

◆ operator!=() [4/8]

bool Kazv::operator!= ( const LocalEchoDesc a,
const LocalEchoDesc b 
)
inline

◆ operator!=() [5/8]

bool Kazv::operator!= ( const PendingRoomKeyEvent a,
const PendingRoomKeyEvent b 
)
inline

◆ operator!=() [6/8]

bool Kazv::operator!= ( const ReadReceipt a,
const ReadReceipt b 
)

◆ operator!=() [7/8]

bool Kazv::operator!= ( DeviceKeyInfo  a,
DeviceKeyInfo  b 
)

◆ operator!=() [8/8]

bool Kazv::operator!= ( KeyOfDecryptedEvent  a,
KeyOfDecryptedEvent  b 
)
inline

◆ operator==() [1/20]

bool Kazv::operator== ( BaseJob  a,
BaseJob  b 
)

◆ operator==() [2/20]

bool Kazv::operator== ( BaseJob::Delete  ,
BaseJob::Delete   
)
inline

◆ operator==() [3/20]

bool Kazv::operator== ( BaseJob::Get  ,
BaseJob::Get   
)
inline

◆ operator==() [4/20]

bool Kazv::operator== ( BaseJob::Post  ,
BaseJob::Post   
)
inline

◆ operator==() [5/20]

bool Kazv::operator== ( BaseJob::Put  ,
BaseJob::Put   
)
inline

◆ operator==() [6/20]

bool Kazv::operator== ( const Event a,
const Event b 
)

◆ operator==() [7/20]

bool Kazv::operator== ( const EventReader a,
const EventReader b 
)

◆ operator==() [8/20]

bool Kazv::operator== ( const LocalEchoDesc a,
const LocalEchoDesc b 
)
inline

◆ operator==() [9/20]

bool Kazv::operator== ( const PendingRoomKeyEvent a,
const PendingRoomKeyEvent b 
)
inline

◆ operator==() [10/20]

bool Kazv::operator== ( const ReadReceipt a,
const ReadReceipt b 
)

◆ operator==() [11/20]

bool Kazv::operator== ( const RoomListModel a,
const RoomListModel b 
)
inline

◆ operator==() [12/20]

bool Kazv::operator== ( const RoomModel a,
const RoomModel b 
)
inline

◆ operator==() [13/20]

bool Kazv::operator== ( DeviceKeyInfo  a,
DeviceKeyInfo  b 
)

◆ operator==() [14/20]

bool Kazv::operator== ( EmptyBody  ,
EmptyBody   
)
inline

◆ operator==() [15/20]

bool Kazv::operator== ( JsonWrap  a,
JsonWrap  b 
)
inline

◆ operator==() [16/20]

bool Kazv::operator== ( KeyOfDecryptedEvent  a,
KeyOfDecryptedEvent  b 
)
inline

◆ operator==() [17/20]

bool Kazv::operator== ( KeyOfGroupSession  a,
KeyOfGroupSession  b 
)
inline

◆ operator==() [18/20]

bool Kazv::operator== ( KeyOfOutboundSession  a,
KeyOfOutboundSession  b 
)
inline

◆ operator==() [19/20]

bool Kazv::operator== ( KeyOfState  a,
KeyOfState  b 
)
inline

◆ operator==() [20/20]

bool Kazv::operator== ( Response  a,
Response  b 
)
inline

◆ processResponse() [1/35]

ClientResult Kazv::processResponse ( ClientModel  m,
BanResponse  r 
)

◆ processResponse() [2/35]

ClientResult Kazv::processResponse ( ClientModel  m,
ClaimKeysResponse  r 
)

◆ processResponse() [3/35]

ClientResult Kazv::processResponse ( ClientModel  m,
CreateRoomResponse  r 
)

◆ processResponse() [4/35]

ClientResult Kazv::processResponse ( ClientModel  m,
DefineFilterResponse  r 
)

◆ processResponse() [5/35]

ClientResult Kazv::processResponse ( ClientModel  m,
ForgetRoomResponse  r 
)

◆ processResponse() [6/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetContentResponse  r 
)

◆ processResponse() [7/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetContentThumbnailResponse  r 
)

◆ processResponse() [8/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetRoomEventsResponse  r 
)

◆ processResponse() [9/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetRoomStateResponse  r 
)

◆ processResponse() [10/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetRoomStateWithKeyResponse  r 
)

◆ processResponse() [11/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetUserProfileResponse  r 
)

◆ processResponse() [12/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetVersionsResponse  r 
)

◆ processResponse() [13/35]

ClientResult Kazv::processResponse ( ClientModel  m,
GetWellknownResponse  r 
)

◆ processResponse() [14/35]

ClientResult Kazv::processResponse ( ClientModel  m,
InviteUserResponse  r 
)

◆ processResponse() [15/35]

ClientResult Kazv::processResponse ( ClientModel  m,
JoinRoomByIdResponse  r 
)

◆ processResponse() [16/35]

ClientResult Kazv::processResponse ( ClientModel  m,
JoinRoomResponse  r 
)

◆ processResponse() [17/35]

ClientResult Kazv::processResponse ( ClientModel  m,
KickResponse  r 
)

◆ processResponse() [18/35]

ClientResult Kazv::processResponse ( ClientModel  m,
LeaveRoomResponse  r 
)

◆ processResponse() [19/35]

ClientResult Kazv::processResponse ( ClientModel  m,
LoginResponse  r 
)

◆ processResponse() [20/35]

ClientResult Kazv::processResponse ( ClientModel  m,
PostReceiptResponse  r 
)

◆ processResponse() [21/35]

ClientResult Kazv::processResponse ( ClientModel  m,
QueryKeysResponse  r 
)

◆ processResponse() [22/35]

ClientResult Kazv::processResponse ( ClientModel  m,
RedactEventResponse  r 
)

◆ processResponse() [23/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SendMessageResponse  r 
)

◆ processResponse() [24/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SendToDeviceResponse  r 
)

◆ processResponse() [25/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetAccountDataPerRoomResponse  r 
)

◆ processResponse() [26/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetAccountDataResponse  r 
)

◆ processResponse() [27/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetAvatarUrlResponse  r 
)

◆ processResponse() [28/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetDisplayNameResponse  r 
)

◆ processResponse() [29/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetReadMarkerResponse  r 
)

◆ processResponse() [30/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetRoomStateWithKeyResponse  r 
)

◆ processResponse() [31/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SetTypingResponse  r 
)

◆ processResponse() [32/35]

ClientResult Kazv::processResponse ( ClientModel  m,
SyncResponse  r 
)

◆ processResponse() [33/35]

ClientResult Kazv::processResponse ( ClientModel  m,
UnbanResponse  r 
)

◆ processResponse() [34/35]

ClientResult Kazv::processResponse ( ClientModel  m,
UploadContentResponse  r 
)

◆ processResponse() [35/35]

ClientResult Kazv::processResponse ( ClientModel  m,
UploadKeysResponse  r 
)

◆ serialize() [1/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
ClientModel m,
std::uint32_t const  version 
)

◆ serialize() [2/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
DeviceKeyInfo i,
std::uint32_t const   
)

◆ serialize() [3/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
DeviceListTracker t,
std::uint32_t const   
)

◆ serialize() [4/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
KeyOfState m,
std::uint32_t const   
)

◆ serialize() [5/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
PendingRoomKeyEvent e,
std::uint32_t const  version 
)

◆ serialize() [6/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
ReadReceipt r,
std::uint32_t const   
)

◆ serialize() [7/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
RoomListModel l,
std::uint32_t const   
)

◆ serialize() [8/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
RoomModel r,
std::uint32_t const  version 
)

◆ serialize() [9/9]

template<class Archive >
void Kazv::serialize ( Archive &  ar,
SdkModel s,
std::uint32_t const   
)

◆ setIn() [1/3]

template<class ImmerT , class K >
auto Kazv::setIn ( ImmerT  container,
std::decay_t< decltype(getIn(std::declval< ImmerT >(), std::declval< K >()))>  newVal,
K &&  key 
) -> std::decay_t<ImmerT>

◆ setIn() [2/3]

template<class ImmerT , class K , class ... Keys>
auto Kazv::setIn ( ImmerT  container,
std::decay_t< decltype(getIn(std::declval< ImmerT >(), std::declval< K >(), std::declval< Keys >()...))>  newVal,
K &&  key,
Keys &&...  keys 
) -> std::decay_t<ImmerT>

◆ setIn() [3/3]

template<class T >
auto Kazv::setIn ( ,
newVal 
)

◆ sortedUniqueMerge()

template<class ImmerT1 , class RangeT2 , class Pred , class Func >
ImmerT1 Kazv::sortedUniqueMerge ( ImmerT1  base,
RangeT2  addon,
Pred  exists,
Func  keyOf 
)

◆ splitPath()

std::vector< std::string > Kazv::splitPath ( std::string  path)

◆ to_json() [1/5]

void Kazv::to_json ( nlohmann::json j,
const InboundGroupSession s 
)

◆ to_json() [2/5]

void Kazv::to_json ( nlohmann::json j,
const KeyOfDecryptedEvent k 
)
inline

◆ to_json() [3/5]

void Kazv::to_json ( nlohmann::json j,
const KeyOfGroupSession k 
)
inline

◆ to_json() [4/5]

void Kazv::to_json ( nlohmann::json j,
const OutboundGroupSession s 
)

◆ to_json() [5/5]

void Kazv::to_json ( nlohmann::json j,
const Session s 
)

◆ tryDecryptEvents()

ClientModel Kazv::tryDecryptEvents ( ClientModel  m)

◆ updateClient() [1/47]

ClientResult Kazv::updateClient ( ClientModel  m,
BanAction  a 
)

◆ updateClient() [2/47]

ClientResult Kazv::updateClient ( ClientModel  m,
ClaimKeysAction  a 
)

◆ updateClient() [3/47]

ClientResult Kazv::updateClient ( ClientModel  m,
CreateRoomAction  a 
)

◆ updateClient() [4/47]

ClientResult Kazv::updateClient ( ClientModel  m,
DownloadContentAction  a 
)

◆ updateClient() [5/47]

ClientResult Kazv::updateClient ( ClientModel  m,
DownloadThumbnailAction  a 
)

◆ updateClient() [6/47]

ClientResult Kazv::updateClient ( ClientModel  m,
EncryptMegOlmEventAction  a 
)

◆ updateClient() [7/47]

ClientResult Kazv::updateClient ( ClientModel  m,
EncryptOlmEventAction  a 
)

◆ updateClient() [8/47]

ClientResult Kazv::updateClient ( ClientModel  m,
ForgetRoomAction  a 
)

◆ updateClient() [9/47]

ClientResult Kazv::updateClient ( ClientModel  m,
GenerateAndUploadOneTimeKeysAction  a 
)

◆ updateClient() [10/47]

ClientResult Kazv::updateClient ( ClientModel  m,
GetRoomStatesAction  a 
)

◆ updateClient() [11/47]

ClientResult Kazv::updateClient ( ClientModel  m,
GetStateEventAction  a 
)

◆ updateClient() [12/47]

ClientResult Kazv::updateClient ( ClientModel  m,
GetUserProfileAction  a 
)

◆ updateClient() [13/47]

ClientResult Kazv::updateClient ( ClientModel  m,
GetVersionsAction  a 
)

◆ updateClient() [14/47]

ClientResult Kazv::updateClient ( ClientModel  m,
GetWellknownAction  a 
)

◆ updateClient() [15/47]

ClientResult Kazv::updateClient ( ClientModel  m,
InviteToRoomAction  a 
)

◆ updateClient() [16/47]

ClientResult Kazv::updateClient ( ClientModel  m,
JoinRoomAction  a 
)

HACK: wait for real boost::url

◆ updateClient() [17/47]

ClientResult Kazv::updateClient ( ClientModel  m,
JoinRoomByIdAction  a 
)

◆ updateClient() [18/47]

ClientResult Kazv::updateClient ( ClientModel  m,
KickAction  a 
)

◆ updateClient() [19/47]

ClientResult Kazv::updateClient ( ClientModel  m,
LeaveRoomAction  a 
)

◆ updateClient() [20/47]

ClientResult Kazv::updateClient ( ClientModel  m,
LoginAction  a 
)

◆ updateClient() [21/47]

ClientResult Kazv::updateClient ( ClientModel  m,
LogoutAction   
)

◆ updateClient() [22/47]

ClientResult Kazv::updateClient ( ClientModel  m,
PaginateTimelineAction  a 
)

◆ updateClient() [23/47]

ClientResult Kazv::updateClient ( ClientModel  m,
PostInitialFiltersAction   
)

◆ updateClient() [24/47]

ClientResult Kazv::updateClient ( ClientModel  m,
PostReceiptAction  a 
)

◆ updateClient() [25/47]

ClientResult Kazv::updateClient ( ClientModel  m,
PrepareForSharingRoomKeyAction  a 
)

◆ updateClient() [26/47]

ClientResult Kazv::updateClient ( ClientModel  m,
QueryKeysAction  a 
)

◆ updateClient() [27/47]

ClientResult Kazv::updateClient ( ClientModel  m,
RedactEventAction  a 
)

◆ updateClient() [28/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SaveLocalEchoAction  a 
)

◆ updateClient() [29/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SendMessageAction  a 
)

◆ updateClient() [30/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SendMultipleToDeviceMessagesAction  a 
)

◆ updateClient() [31/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SendStateEventAction  a 
)

◆ updateClient() [32/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SendToDeviceMessageAction  a 
)

◆ updateClient() [33/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetAccountDataAction  a 
)

◆ updateClient() [34/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetAccountDataPerRoomAction  a 
)

◆ updateClient() [35/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetAvatarUrlAction  a 
)

◆ updateClient() [36/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetDeviceTrustLevelAction  a 
)

◆ updateClient() [37/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetDisplayNameAction  a 
)

◆ updateClient() [38/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetReadMarkerAction  a 
)

◆ updateClient() [39/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetShouldSyncAction  a 
)

◆ updateClient() [40/47]

◆ updateClient() [41/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SetTypingAction  a 
)

◆ updateClient() [42/47]

ClientResult Kazv::updateClient ( ClientModel  m,
SyncAction   
)

◆ updateClient() [43/47]

ClientResult Kazv::updateClient ( ClientModel  m,
TokenLoginAction  a 
)

◆ updateClient() [44/47]

ClientResult Kazv::updateClient ( ClientModel  m,
UnbanAction  a 
)

◆ updateClient() [45/47]

ClientResult Kazv::updateClient ( ClientModel  m,
UpdateLocalEchoStatusAction  a 
)

◆ updateClient() [46/47]

ClientResult Kazv::updateClient ( ClientModel  m,
UploadContentAction  a 
)

◆ updateClient() [47/47]

ClientResult Kazv::updateClient ( ClientModel  m,
UploadIdentityKeysAction   
)

◆ updateIn() [1/2]

template<class ImmerT , class Func , class ... Keys>
auto Kazv::updateIn ( ImmerT  container,
Func  func,
Keys &&...  keys 
) -> ImmerT

◆ updateIn() [2/2]

template<class T , class Func >
auto Kazv::updateIn ( oldVal,
Func  func 
) -> T

◆ validatePushRules()

Event Kazv::validatePushRules ( const Event e)

◆ validateRule()

std::pair< bool, json > Kazv::validateRule ( std::string  ruleSetName,
const json rule 
)

◆ withRandomGenerator()

auto Kazv::withRandomGenerator ( RandomInterface random)
inline

An enhancer to use a custom random generator.

This is to be used with makeSdk()-series functions.

Parameters
randomThe random generator to use.

Variable Documentation

◆ containerMap

detail::ContainerMapT Kazv::containerMap {}
inline

◆ DEFTXNID

const std::string Kazv::DEFTXNID {"0"}
inline

◆ DEFVAL

constexpr detail::DefaultValT Kazv::DEFVAL
constexpr

◆ eventContent

constexpr auto Kazv::eventContent
inlineconstexpr
Initial value:
=
zug::map([](auto &&event) {
return std::forward<decltype(event)>(event).content();
})

◆ hasEffect

template<class Reducer , class RetType , class Model , class Action , class Deps >
constexpr bool Kazv::hasEffect
constexpr
Initial value:
= boost::hana::is_valid(
[]() -> decltype((void)EffectBase<RetType, Action, Deps>(
std::get<1>(std::declval<std::invoke_result_t<Reducer, Model, Action>>()))) {}
)()

◆ headFailureCancelledErrorCode

const std::string Kazv::headFailureCancelledErrorCode {"MOE_KAZV_MXC_HEAD_FAILURE_CANCELLED"}
inline

◆ headFailureCancelledErrorMsg

const std::string Kazv::headFailureCancelledErrorMsg {"This job is cancelled because one before it failed."}
inline

◆ headFailureCancelledStatusCode

const int Kazv::headFailureCancelledStatusCode {490}
inline

◆ intoImmer

detail::IntoImmerT Kazv::intoImmer {}
inline

◆ isPromise

template<class T >
constexpr auto Kazv::isPromise = std::is_base_of_v<TypelessPromise, T>
constexpr

◆ kzo

const detail::OutputConfig Kazv::kzo {}

◆ ROOM_TAG_DEFAULT_ORDER

const double Kazv::ROOM_TAG_DEFAULT_ORDER = 2
inline

◆ simpleFail

constexpr auto Kazv::simpleFail = detail::SimpleFailT{}
constexpr

A effect that returns a failed EffectStatus upon invocation.

Kazv::CastObjectStrategy::FailAll
@ FailAll
If any item is invalid, fail the entire cast.
Kazv::castObject
bool castObject(Jsonish &ret, const Jsonish &input, Key &&k, Validator &&f, CastObjectStrategy strategy)
Cast an object of items.
Definition: validator.hpp:245
Kazv::cast
bool cast(Jsonish &ret, const Jsonish &input, Key &&k, Validator &&f)
Run validator against input[k] and add it to ret.
Definition: validator.hpp:61
Kazv::CastArrayStrategy::IgnoreInvalid
@ IgnoreInvalid
If any item is invalid, ignore them and add all valid entries into the output.
Kazv::CastArrayStrategy::FailAll
@ FailAll
If any item is invalid, fail the entire cast.
Kazv::castArray
bool castArray(Jsonish &ret, const Jsonish &input, Key &&k, Validator &&f, CastArrayStrategy strategy)
Cast an array of items.
Definition: validator.hpp:154
Kazv::json
nlohmann::json json
Definition: jsonwrap.hpp:20
Kazv::CastObjectStrategy::IgnoreInvalid
@ IgnoreInvalid
If any item is invalid, ignore them and add all valid entries into the output.