export interface RpcError {
  type: 'UNAUTHORIZED' | 'VALIDATION_ERROR' | 'NOT_FOUND' | 'INTERNAL_ERROR' | 'FORBIDDEN' | 'RATE_LIMITED' | string;
  message: string;
  code?: number;
}

export interface RpcResponse<T = unknown, Extensions = unknown> {
  datetime: number;
  success: boolean;
  result: T | null;
  extensions: Extensions | null;
  error: RpcError | null;
}

export type ActionNSTVType = {
  name?: string,
  type?: string,
  value?: string,
  text?: string,
  style?: StyleDPEnum,
  uuid?: string
};
export type ArgsAuthInput = {
  withEmailCode?: boolean,
  code?: number,
  login: string,
  password?: string,
  deviceInfo?: DeviceInfoMNPUInput
};
export type ArgsChannelCloseInput = {
  channel?: string
};
export type ArgsChannelDeleteMessageInput = {
  channel?: string,
  message?: string
};
export type ArgsChannelInfoInput = {
  channel?: string
};
export type ArgsChannelListInput = {
  limit?: number,
  offset?: number,
  onlyHash?: boolean
};
export type ArgsChannelMessagesInput = {
  channel?: string,
  limit?: number,
  offset?: number,
  onlyHash?: boolean
};
export type ArgsChannelReactionInput = {
  message?: string,
  channel?: string,
  reaction?: ReactionACFHLPSWEnum
};
export type ArgsChannelSendMessageInput = {
  channel: string,
  reply?: string,
  text?: string,
  attachments?: FileDocumentFileInput[],
  voice?: FileAudioFileInput,
  payload?: PayloadMInput
};
export type ArgsJoinChannelInput = {
  channel: string
};
export type ArgsJoinChannelListInput = {
  limit?: number,
  offset?: number,
  onlyHash?: boolean
};
export type ArgsMFastAnswersInput = {
  id?: string,
  delete?: boolean,
  name?: string,
  text?: string
};
export type ArgsPinnedMessageInput = {
  message?: string
};
export type ChannelListDHType = {
  data?: ShmChannelType[],
  hash?: string
};
export type ChannelMessageDHType = {
  data?: ShmChannelMessageType[],
  hash?: string
};
export type DeviceInfoMNPUInput = {
  name?: string,
  model?: string,
  platform?: string,
  uuid?: string
};
export type FileAudioFileInput = {
  _id?: string
};
export type FileAudioFileType = {
  _id?: string,
  fileType?: string,
  name?: string,
  url?: string,
  duration?: number,
  type?: string,
  created_at?: string
};
export type FileDocumentFileInput = {
  _id?: string
};
export type FileDocumentFileType = {
  _id?: string,
  fileType?: string,
  name?: string,
  url?: string,
  type?: string,
  created_at?: string
};
export type JoinChannelListDHType = {
  data?: ShmChannelType[],
  hash?: string
};
export type MemberORUType = {
  owner?: string,
  ownerCollection?: string,
  role?: RoleAMOSEnum,
  uuid?: string
};
export type ModeFWEnum = "widget" | "full";
export type PayloadMInput = {
  [key: string]: any
};
export type PayloadMType = {
  [key: string]: any
};
export type PinnedETUType = {
  enabled?: boolean,
  user?: string,
  timestamp?: number
};
export type ReactionACFHLPSWEnum = "heart" | "like" | "laugh" | "wow" | "sad" | "angry" | "clap" | "party" | "poop" | "fire";
export type ReactionCTUType = {
  user?: string,
  type?: TypeACFHLPSWEnum,
  created_at?: number,
  uuid?: string
};
export type RoleAMOSEnum = "member" | "owner" | "admin" | "support";
export type ShmChannelMessageType = {
  channel?: string,
  owner?: string,
  ownerCollection?: string,
  text?: string,
  type?: TypeRSEnum,
  attachments?: FileDocumentFileType[],
  reply?: string,
  voice?: FileAudioFileType,
  actions?: ActionNSTVType[],
  reactions?: ReactionCTUType[],
  pinned?: PinnedETUType,
  payload?: PayloadMType,
  viewed?: boolean,
  deleted?: string,
  _id?: string,
  created_at?: number,
  updated_at?: number
};
export type ShmChannelType = {
  space?: string,
  name?: string,
  lastMessage?: string,
  payload?: PayloadMType,
  members?: MemberORUType[],
  closed?: boolean,
  unreadCounts?: UnreadCountMType,
  type?: TypeDSEnum,
  _id?: string,
  created_at?: number,
  updated_at?: number
};
export type ShmFastAnswerType = {
  owner?: string,
  ownerCollection?: string,
  name?: string,
  text?: string,
  _id?: string,
  created_at?: number,
  updated_at?: number
};
export type StyleDPEnum = "default" | "primary" | "danger";
export type TypeACFHLPSWEnum = "heart" | "like" | "laugh" | "wow" | "sad" | "angry" | "clap" | "party" | "poop" | "fire";
export type TypeDSEnum = "default" | "support" | "supportSystem";
export type TypeRSEnum = "regular" | "system";
export type UnreadCountMType = {
  [key: string]: number
};