@giosg/pub-sdk
Advanced tools
Comparing version 0.26.2 to 0.27.0
@@ -7,2 +7,5 @@ # Changelog | ||
## 0.27.0 | ||
- Add `is_active` query parameter to `streamJoinedChannels`. | ||
## 0.26.2 | ||
@@ -9,0 +12,0 @@ |
@@ -44,2 +44,6 @@ import { UserUid, OrganizationUid } from "@giosg/types"; | ||
latest_message_created_at: string; | ||
/** | ||
* Does user have any unread messages in unmuted channel or not | ||
*/ | ||
is_active?: boolean; | ||
} | ||
@@ -46,0 +50,0 @@ export interface PubChannelMember { |
@@ -12,3 +12,3 @@ import { IRealtimeSdk } from "@giosg/realtime-sdk"; | ||
patchChannel(orgId: OrganizationUid, channelId: PubChannelUid, payload: ChannelPayload): Promise<PubChannel>; | ||
streamJoinedChannels(orgId: OrganizationUid, userId: UserUid, ordering?: "created_at" | "-created_at" | "latest_message_created_at" | "-latest_message_created_at"): Observable<Observable<PubChannel>>; | ||
streamJoinedChannels(orgId: OrganizationUid, userId: UserUid, ordering?: "created_at" | "-created_at" | "latest_message_created_at" | "-latest_message_created_at", isActive?: boolean): Observable<Observable<PubChannel>>; | ||
streamJoinedChannel(orgId: OrganizationUid, userId: UserUid, channelId: PubChannelUid): Observable<PubChannel>; | ||
@@ -15,0 +15,0 @@ deleteChannel(orgId: OrganizationUid, channelId: PubChannelUid): Promise<void>; |
@@ -30,5 +30,6 @@ "use strict"; | ||
} | ||
streamJoinedChannels(orgId, userId, ordering = "-latest_message_created_at") { | ||
streamJoinedChannels(orgId, userId, ordering = "-latest_message_created_at", isActive) { | ||
const apiUrl = `/api/pub/v1/orgs/${orgId}/users/${userId}/joined-channels`; | ||
return this.sdk.streamCollection(apiUrl, { ordering }); | ||
const filters = isActive === undefined ? {} : { is_active: isActive }; | ||
return this.sdk.streamCollection(apiUrl, Object.assign({ ordering }, filters)); | ||
} | ||
@@ -35,0 +36,0 @@ streamJoinedChannel(orgId, userId, channelId) { |
{ | ||
"name": "@giosg/pub-sdk", | ||
"version": "0.26.2", | ||
"version": "0.27.0", | ||
"description": "TypeScript interfaces for Giosg Pub", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35599
434