Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

stream-chat

Package Overview
Dependencies
Maintainers
13
Versions
296
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-chat - npm Package Compare versions

Comparing version 4.0.0-offline-caching.0 to 4.0.0-offline-caching.1

39

dist/types/channel_state.d.ts
import { Channel } from './channel';
import { ChannelMemberResponse, ChannelMembership, FormatMessageResponse, Event, LiteralStringForUnion, MessageResponse, ReactionResponse, UnknownType, UserResponse } from './types';
export declare type ChannelStateData<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, EventType extends UnknownType = UnknownType, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = {
export declare type ChannelStateDataOutput<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = {
isUpToDate: boolean;
last_message_at: string | null;
last_message_at: Date | null;
members: Record<string, ChannelMemberResponse<UserType>>;
membership: ChannelMembership<UserType>;
messages: FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
mutedUsers: Array<UserResponse<UserType>>;
pinnedMessages: FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
read: Record<string, {
last_read: Date;
user: UserResponse<UserType>;
}>;
threads: Record<string, Array<FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>>;
unreadCount: number;
};
export declare type ChannelStateDataInput<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = Omit<ChannelStateDataOutput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>, 'last_message_at' | 'messages' | 'pinnedMessages' | 'read' | 'threads'> & {
last_message_at: string | null;
messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
mutedUsers: Array<UserResponse<UserType>>;
pinnedMessages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];

@@ -16,6 +27,2 @@ read: Record<string, {

threads: Record<string, Array<MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>>;
typing: Record<string, Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>>;
unreadCount: number;
watcher_count: number;
watchers: Record<string, UserResponse<UserType>>;
};

@@ -133,18 +140,4 @@ /**

_addToMessageList(messages: Array<ReturnType<ChannelState<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>['formatMessage']>>, message: ReturnType<ChannelState<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>['formatMessage']>, timestampChanged?: boolean, sortBy?: 'pinned_at' | 'created_at', addIfDoesNotExist?: boolean): FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
getStateData(): {
read: Record<string, {
last_read: Date;
user: UserResponse<UserType>;
}>;
messages: FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
pinnedMessages: FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
threads: Record<string, FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[]>;
mutedUsers: UserResponse<UserType>[];
members: Record<string, ChannelMemberResponse<UserType>>;
membership: ChannelMembership<UserType>;
unreadCount: number;
isUpToDate: boolean;
last_message_at: Date | null;
};
reInitializeWithState(channelState: ChannelStateData<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>): void;
getStateData(): ChannelStateDataOutput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
reInitializeWithState(channelState: ChannelStateDataInput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>): void;
/**

@@ -151,0 +144,0 @@ * removeMessage - Description

/// <reference types="node" />
import { ChannelState, ChannelStateData } from './channel_state';
import { ChannelState, ChannelStateDataInput, ChannelStateDataOutput } from './channel_state';
import { StreamChat } from './client';
import { APIResponse, BanUserOptions, ChannelAPIResponse, ChannelData, ChannelMemberAPIResponse, ChannelMemberResponse, ChannelQueryOptions, ChannelResponse, DeleteChannelAPIResponse, Event, EventAPIResponse, EventHandler, EventTypes, FormatMessageResponse, GetMultipleMessagesAPIResponse, GetReactionsAPIResponse, GetRepliesAPIResponse, InviteOptions, LiteralStringForUnion, MarkReadOptions, Message, MessageFilters, MessageResponse, MuteChannelAPIResponse, PaginationOptions, PartialUpdateChannel, PartialUpdateChannelAPIResponse, QueryMembersOptions, Reaction, ReactionAPIResponse, SearchOptions, SearchAPIResponse, SendMessageAPIResponse, TruncateChannelAPIResponse, UnknownType, UpdateChannelAPIResponse, UserFilters, UserResponse, UserSort } from './types';
import { APIResponse, BanUserOptions, ChannelAPIResponse, ChannelData, ChannelMemberAPIResponse, ChannelQueryOptions, ChannelResponse, DeleteChannelAPIResponse, Event, EventAPIResponse, EventHandler, EventTypes, FormatMessageResponse, GetMultipleMessagesAPIResponse, GetReactionsAPIResponse, GetRepliesAPIResponse, InviteOptions, LiteralStringForUnion, MarkReadOptions, Message, MessageFilters, MessageResponse, MuteChannelAPIResponse, PaginationOptions, PartialUpdateChannel, PartialUpdateChannelAPIResponse, QueryMembersOptions, Reaction, ReactionAPIResponse, SearchOptions, SearchAPIResponse, SendMessageAPIResponse, TruncateChannelAPIResponse, UnknownType, UpdateChannelAPIResponse, UserFilters, UserResponse, UserSort } from './types';
import { Role } from './permissions';
export declare type ChannelStateAndData<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, EventType extends UnknownType = UnknownType, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = {
_data: ChannelResponse<ChannelType, CommandType, UserType> | undefined;
data: ChannelResponse<ChannelType, CommandType, UserType> | undefined;
export declare type ChannelStateAndDataOutput<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = {
_data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType>;
data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType> | undefined;
id: string | undefined;
state: ChannelStateData<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>;
state: ChannelStateDataOutput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
type: string;
};
export declare type ChannelStateAndDataInput<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = {
_data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType>;
data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType> | undefined;
id: string | undefined;
state: ChannelStateDataInput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
type: string;
};
/**

@@ -475,26 +482,6 @@ * Channel - The Channel class manages it's own state.

_initializeState(state: ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>): void;
getStateData(): {
state: {
read: Record<string, {
last_read: Date;
user: UserResponse<UserType>;
}>;
messages: FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
pinnedMessages: FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
threads: Record<string, FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[]>;
mutedUsers: UserResponse<UserType>[];
members: Record<string, ChannelMemberResponse<UserType>>;
membership: import("./types").ChannelMembership<UserType>;
unreadCount: number;
isUpToDate: boolean;
last_message_at: Date | null;
};
data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType> | undefined;
_data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType>;
id: string | undefined;
type: string;
};
reInitializeWithState(channelState: ChannelStateAndData<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>): void;
getStateData(): ChannelStateAndDataOutput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
reInitializeWithState(channelState: ChannelStateAndDataInput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>): void;
_disconnect(): void;
}
//# sourceMappingURL=channel.d.ts.map
/// <reference types="node" />
import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
import WebSocket from 'isomorphic-ws';
import { Channel, ChannelStateAndData } from './channel';
import { Channel, ChannelStateAndDataInput, ChannelStateAndDataOutput } from './channel';
import { ClientState, ClientStateData } from './client_state';

@@ -11,4 +11,4 @@ import { StableWSConnection } from './connection';

state: ClientStateData<UserType>;
token: string;
user: OwnUserResponse<ChannelType, CommandType, UserType> | UserResponse<UserType>;
token: string | null | undefined;
user: OwnUserResponse<ChannelType, CommandType, UserType> | UserResponse<UserType> | undefined;
};

@@ -421,40 +421,7 @@ export declare class StreamChat<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, EventType extends UnknownType = UnknownType, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> {

getStateData(): {
client: {
state: {
users: {
[key: string]: UserResponse<UserType>;
};
userChannelReferences: {
[key: string]: {
[key: string]: boolean;
};
};
};
user: OwnUserResponse<ChannelType, CommandType, UserType> | UserResponse<UserType> | undefined;
token: string | null | undefined;
};
channels: {
state: {
read: Record<string, {
last_read: Date;
user: UserResponse<UserType>;
}>;
messages: import("./types").FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
pinnedMessages: import("./types").FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
threads: Record<string, import("./types").FormatMessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[]>;
mutedUsers: UserResponse<UserType>[];
members: Record<string, import("./types").ChannelMemberResponse<UserType>>;
membership: import("./types").ChannelMembership<UserType>;
unreadCount: number;
isUpToDate: boolean;
last_message_at: Date | null;
};
data: import("./types").ChannelResponse<ChannelType, CommandType, UserType> | ChannelData<ChannelType> | undefined;
_data: import("./types").ChannelResponse<ChannelType, CommandType, UserType> | ChannelData<ChannelType>;
id: string | undefined;
type: string;
}[];
channels: ChannelStateAndDataOutput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
client: ClientStateAndData<ChannelType, CommandType, UserType>;
};
reInitializeAuthState(user: OwnUserResponse<ChannelType, CommandType, UserType> | UserResponse<UserType>, userTokenOrProvider: TokenOrProvider): Promise<void>;
reInitializeWithState(clientData: ClientStateAndData<ChannelType, CommandType, UserType>, channelsData: ChannelStateAndData<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>[]): void;
reInitializeWithState(clientData: ClientStateAndData<ChannelType, CommandType, UserType>, channelsData: ChannelStateAndDataInput<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[]): void;
/**

@@ -461,0 +428,0 @@ * queryChannels - Query channels

@@ -472,2 +472,3 @@ import { AxiosRequestConfig } from 'axios';

state?: boolean;
user_id?: string;
watch?: boolean;

@@ -687,2 +688,3 @@ };

is_reviewed?: boolean;
team?: string;
user_id?: string;

@@ -693,2 +695,4 @@ };

} & {
team?: RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['team']>, '$eq' | '$in'>> | PrimitiveFilter<MessageFlagsFiltersOptions['team']>;
} & {
user_id?: RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['user_id']>, '$eq' | '$in'>> | PrimitiveFilter<MessageFlagsFiltersOptions['user_id']>;

@@ -695,0 +699,0 @@ } & {

{
"name": "stream-chat",
"version": "4.0.0-offline-caching.0",
"version": "4.0.0-offline-caching.1",
"description": "JS SDK for the Stream Chat API",

@@ -5,0 +5,0 @@ "author": "GetStream",

@@ -14,7 +14,7 @@ import { Channel } from './channel';

export type ChannelStateData<
// Used when retrieving the state data
export type ChannelStateDataOutput<
AttachmentType extends UnknownType = UnknownType,
ChannelType extends UnknownType = UnknownType,
CommandType extends string = LiteralStringForUnion,
EventType extends UnknownType = UnknownType,
MessageType extends UnknownType = UnknownType,

@@ -25,5 +25,59 @@ ReactionType extends UnknownType = UnknownType,

isUpToDate: boolean;
last_message_at: string | null;
last_message_at: Date | null;
members: Record<string, ChannelMemberResponse<UserType>>;
membership: ChannelMembership<UserType>;
messages: FormatMessageResponse<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
>[];
mutedUsers: Array<UserResponse<UserType>>;
pinnedMessages: FormatMessageResponse<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
>[];
read: Record<string, { last_read: Date; user: UserResponse<UserType> }>;
threads: Record<
string,
Array<
FormatMessageResponse<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
>
>
>;
unreadCount: number;
};
// Used when reInitializing the state data
export type ChannelStateDataInput<
AttachmentType extends UnknownType = UnknownType,
ChannelType extends UnknownType = UnknownType,
CommandType extends string = LiteralStringForUnion,
MessageType extends UnknownType = UnknownType,
ReactionType extends UnknownType = UnknownType,
UserType extends UnknownType = UnknownType
> = Omit<
ChannelStateDataOutput<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
>,
'last_message_at' | 'messages' | 'pinnedMessages' | 'read' | 'threads'
> & {
last_message_at: string | null;
messages: MessageResponse<

@@ -37,3 +91,2 @@ AttachmentType,

>[];
mutedUsers: Array<UserResponse<UserType>>;
pinnedMessages: MessageResponse<

@@ -61,17 +114,2 @@ AttachmentType,

>;
typing: Record<
string,
Event<
AttachmentType,
ChannelType,
CommandType,
EventType,
MessageType,
ReactionType,
UserType
>
>;
unreadCount: number;
watcher_count: number;
watchers: Record<string, UserResponse<UserType>>;
};

@@ -724,3 +762,10 @@

getStateData() {
getStateData(): ChannelStateDataOutput<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
> {
return {

@@ -741,7 +786,6 @@ read: this.read,

reInitializeWithState(
channelState: ChannelStateData<
channelState: ChannelStateDataInput<
AttachmentType,
ChannelType,
CommandType,
EventType,
MessageType,

@@ -748,0 +792,0 @@ ReactionType,

@@ -1,2 +0,6 @@

import { ChannelState, ChannelStateData } from './channel_state';
import {
ChannelState,
ChannelStateDataInput,
ChannelStateDataOutput,
} from './channel_state';
import { isValidEventType } from './events';

@@ -51,7 +55,6 @@ import { logChatPromiseExecution, normalizeQuerySort } from './utils';

export type ChannelStateAndData<
export type ChannelStateAndDataOutput<
AttachmentType extends UnknownType = UnknownType,
ChannelType extends UnknownType = UnknownType,
CommandType extends string = LiteralStringForUnion,
EventType extends UnknownType = UnknownType,
MessageType extends UnknownType = UnknownType,

@@ -61,10 +64,12 @@ ReactionType extends UnknownType = UnknownType,

> = {
_data: ChannelResponse<ChannelType, CommandType, UserType> | undefined;
data: ChannelResponse<ChannelType, CommandType, UserType> | undefined;
_data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType>;
data:
| ChannelData<ChannelType>
| ChannelResponse<ChannelType, CommandType, UserType>
| undefined;
id: string | undefined;
state: ChannelStateData<
state: ChannelStateDataOutput<
AttachmentType,
ChannelType,
CommandType,
EventType,
MessageType,

@@ -77,2 +82,27 @@ ReactionType,

export type ChannelStateAndDataInput<
AttachmentType extends UnknownType = UnknownType,
ChannelType extends UnknownType = UnknownType,
CommandType extends string = LiteralStringForUnion,
MessageType extends UnknownType = UnknownType,
ReactionType extends UnknownType = UnknownType,
UserType extends UnknownType = UnknownType
> = {
_data: ChannelData<ChannelType> | ChannelResponse<ChannelType, CommandType, UserType>;
data:
| ChannelData<ChannelType>
| ChannelResponse<ChannelType, CommandType, UserType>
| undefined;
id: string | undefined;
state: ChannelStateDataInput<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
>;
type: string;
};
/**

@@ -1812,3 +1842,10 @@ * Channel - The Channel class manages it's own state.

getStateData() {
getStateData(): ChannelStateAndDataOutput<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
> {
return {

@@ -1824,7 +1861,6 @@ state: this.state.getStateData(),

reInitializeWithState(
channelState: ChannelStateAndData<
channelState: ChannelStateAndDataInput<
AttachmentType,
ChannelType,
CommandType,
EventType,
MessageType,

@@ -1831,0 +1867,0 @@ ReactionType,

@@ -813,2 +813,3 @@ import { AxiosRequestConfig } from 'axios';

state?: boolean;
user_id?: string;
watch?: boolean;

@@ -1151,2 +1152,3 @@ };

is_reviewed?: boolean;
team?: string;
user_id?: string;

@@ -1163,2 +1165,8 @@ };

} & {
team?:
| RequireOnlyOne<
Pick<QueryFilter<MessageFlagsFiltersOptions['team']>, '$eq' | '$in'>
>
| PrimitiveFilter<MessageFlagsFiltersOptions['team']>;
} & {
user_id?:

@@ -1165,0 +1173,0 @@ | RequireOnlyOne<

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc