diff --git a/lib/src/entities/chat.ts b/lib/src/entities/chat.ts index 8d461be..97a3e93 100644 --- a/lib/src/entities/chat.ts +++ b/lib/src/entities/chat.ts @@ -313,7 +313,7 @@ export class Chat { } } - async getUsers(params: Omit) { + async getUsers(params: Omit = {}) { const mandatoryOptions = { include: { totalCount: true, @@ -522,7 +522,7 @@ export class Chat { } } - async getChannels(params: Omit) { + async getChannels(params: Omit = {}) { const mandatoryOptions = { include: { totalCount: true, @@ -569,11 +569,11 @@ export class Chat { */ async createPublicConversation({ channelId, - channelData, + channelData = {}, }: { channelId?: string - channelData: PubNub.ChannelMetadata - }) { + channelData?: PubNub.ChannelMetadata + } = {}) { const finalChannelId = channelId || uuidv4() return this.createChannel(finalChannelId, { @@ -718,12 +718,12 @@ export class Chat { async createDirectConversation({ user, channelId, - channelData, + channelData = {}, membershipData = {}, }: { user: User channelId?: string - channelData: PubNub.ChannelMetadata + channelData?: PubNub.ChannelMetadata membershipData?: Omit< PubNub.SetMembershipsParameters, "channels" | "include" | "filter" @@ -783,12 +783,12 @@ export class Chat { async createGroupConversation({ users, channelId, - channelData, + channelData = {}, membershipData = {}, }: { users: User[] channelId?: string - channelData: PubNub.ChannelMetadata + channelData?: PubNub.ChannelMetadata membershipData?: Omit< PubNub.SetMembershipsParameters, "channels" | "include" | "filter"