Skip to content

Commit

Permalink
New changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas committed Aug 23, 2022
1 parent 04dac42 commit 2ea3367
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
ChannelFilters,
ChannelMute,
ChannelOptions,
ChannelResponse,
ChannelSort,
ChannelStateOptions,
CheckPushResponse,
Expand Down Expand Up @@ -2695,9 +2696,7 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG
*/
async querySegments(filters: SegmentFilters, options: CampaignQueryOptions = {}) {
const { segments } = await this.get<{
campaigns: Record<string, Campaign>;
segments: Segment[];
users: Record<string, UserResponse<StreamChatGenerics>>;
}>(this.baseURL + `/segments`, {
payload: {
filter_conditions: filters,
Expand Down Expand Up @@ -2753,7 +2752,8 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG
const { campaigns } = await this.get<{
campaigns: Campaign[];
segments: Record<string, Segment>;
users: Record<string, UserResponse<StreamChatGenerics>>;
channels?: Record<string, ChannelResponse<StreamChatGenerics>>;
users?: Record<string, UserResponse<StreamChatGenerics>>;
}>(this.baseURL + `/campaigns`, {
payload: {
filter_conditions: filters,
Expand Down Expand Up @@ -2853,7 +2853,8 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG
campaigns: Record<string, Campaign>;
recipients: Recipient[];
segments: Record<string, Segment>;
users: Record<string, UserResponse<StreamChatGenerics>>;
channels?: Record<string, ChannelResponse<StreamChatGenerics>>;
users?: Record<string, UserResponse<StreamChatGenerics>>;
}>(this.baseURL + `/recipients`, {
payload: {
filter_conditions: filters,
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2286,8 +2286,9 @@ export type SegmentData = {
export type Segment = {
created_at: string;
id: string;
in_use: boolean;
size: number;
status: string;
status: 'computing' | 'ready';
updated_at: string;
} & SegmentData;

Expand Down

0 comments on commit 2ea3367

Please sign in to comment.