stream-chat-angular 4.31.1 → 4.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
3
3
  import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelResponse, ChannelSort, Event, UserResponse } from 'stream-chat';
4
4
  import { ChatClientService, ClientEvent } from './chat-client.service';
5
5
  import { NotificationService } from './notification.service';
6
- import { AttachmentUpload, DefaultStreamChatGenerics, MessageReactionType, StreamMessage } from './types';
6
+ import { AttachmentUpload, ChannelQueryState, DefaultStreamChatGenerics, MessageReactionType, StreamMessage } from './types';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
9
  * The `ChannelService` provides data and interaction for the channel list and message list.
@@ -42,6 +42,10 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
42
42
  * Our platform documentation covers the topic of [channel events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript#events) in depth.
43
43
  */
44
44
  channels$: Observable<Channel<T>[] | undefined>;
45
+ /**
46
+ * The result of the latest channel query request.
47
+ */
48
+ channelQueryState$: Observable<ChannelQueryState | undefined>;
45
49
  /**
46
50
  * Emits the currently active channel.
47
51
  *
@@ -174,10 +178,12 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
174
178
  private shouldSetActiveChannel;
175
179
  private clientEventsSubscription;
176
180
  private isStateRecoveryInProgress;
181
+ private channelQueryStateSubject;
177
182
  private channelListSetter;
178
183
  private messageListSetter;
179
184
  private threadListSetter;
180
185
  private parentMessageSetter;
186
+ private dismissErrorNotification?;
181
187
  constructor(chatClientService: ChatClientService<T>, ngZone: NgZone, notificationService: NotificationService);
182
188
  /**
183
189
  * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
@@ -222,7 +228,9 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
222
228
  * @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel, or no channel should be marked as active
223
229
  * @returns the list of channels found by the query
224
230
  */
225
- init(filters: ChannelFilters<T>, sort?: ChannelSort<T>, options?: ChannelOptions, shouldSetActiveChannel?: boolean): Promise<Channel<T>[]>;
231
+ init(filters: ChannelFilters<T>, sort?: ChannelSort<T>, options?: ChannelOptions & {
232
+ keepAliveChannels$OnError?: boolean;
233
+ }, shouldSetActiveChannel?: boolean): Promise<Channel<T>[]>;
226
234
  /**
227
235
  * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).
228
236
  */
@@ -52,11 +52,15 @@ export declare class ChatClientService<T extends DefaultStreamChatGenerics = Def
52
52
  /**
53
53
  * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.
54
54
  * @param apiKey
55
- * @param userOrId
56
- * @param userTokenOrProvider You can provide a token, or the keyword 'guest' to connect as [guest user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#guest-users)
55
+ * @param userOrId you can emit this for anonymous logins
56
+ * @param userTokenOrProvider You can provide:<ul>
57
+ * <li> a token, </li>
58
+ * <li> the keyword 'guest' to connect as [guest user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#guest-users) </li>
59
+ * <li> the keyword 'anonymous' to connect as [anonymous user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#anonymous-users) </li>
60
+ * </ul>
57
61
  * @param clientOptions Setting to provide to the Stream client instance
58
62
  */
59
- init(apiKey: string, userOrId: string | OwnUserResponse<T> | UserResponse<T>, userTokenOrProvider: TokenOrProvider | 'guest', clientOptions?: StreamChatOptions): ConnectAPIResponse<T>;
63
+ init(apiKey: string, userOrId: string | OwnUserResponse<T> | UserResponse<T> | undefined, userTokenOrProvider: TokenOrProvider | 'anonymous' | 'guest', clientOptions?: StreamChatOptions): ConnectAPIResponse<T>;
60
64
  /**
61
65
  * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).
62
66
  */
package/lib/types.d.ts CHANGED
@@ -240,4 +240,8 @@ export declare type DateSeparatorContext = {
240
240
  date: Date;
241
241
  parsedDate: string;
242
242
  };
243
+ export declare type ChannelQueryState = {
244
+ state: 'in-progress' | 'success' | 'error';
245
+ error?: unknown;
246
+ };
243
247
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.31.1",
3
+ "version": "4.32.0",
4
4
  "description": "Angular components to create chat conversations or livestream style chat",
5
5
  "author": "GetStream",
6
6
  "homepage": "https://getstream.io/chat/",
@@ -1 +1 @@
1
- export const version = '4.31.1';
1
+ export const version = '4.32.0';