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 3.9.0 to 3.10.0

48

dist/types/client.d.ts

@@ -8,3 +8,3 @@ /// <reference types="node" />

import { TokenManager } from './token_manager';
import { APIResponse, AppSettings, AppSettingsAPIResponse, BannedUsersFilters, BannedUsersPaginationOptions, BannedUsersResponse, BannedUsersSort, BanUserOptions, BlockList, BlockListResponse, ChannelAPIResponse, ChannelData, ChannelFilters, ChannelMute, ChannelOptions, ChannelSort, CheckPushResponse, CheckSQSResponse, Configs, ConnectAPIResponse, CreateChannelOptions, CreateChannelResponse, CreateCommandOptions, CreateCommandResponse, CustomPermissionOptions, DeleteCommandResponse, Device, EndpointName, Event, EventHandler, ExportChannelRequest, ExportChannelResponse, ExportChannelStatusResponse, FlagMessageResponse, FlagUserResponse, GetChannelTypeResponse, GetCommandResponse, GetRateLimitsResponse, ListChannelResponse, ListCommandsResponse, LiteralStringForUnion, Logger, MarkAllReadOptions, MessageFilters, MessageResponse, Mute, MuteUserOptions, MuteUserResponse, OwnUserResponse, PartialUserUpdate, PermissionAPIResponse, PermissionsAPIResponse, ReactionResponse, SearchAPIResponse, SearchOptions, SendFileAPIResponse, StreamChatOptions, TestPushDataInput, TestSQSDataInput, TokenOrProvider, UnBanUserOptions, UnknownType, UpdateChannelOptions, UpdateChannelResponse, UpdateCommandOptions, UpdateCommandResponse, UpdatedMessage, UpdateMessageAPIResponse, UserCustomEvent, UserFilters, UserOptions, UserResponse, UserSort } from './types';
import { APIResponse, AppSettings, AppSettingsAPIResponse, BannedUsersFilters, BannedUsersPaginationOptions, BannedUsersResponse, BannedUsersSort, BanUserOptions, BlockList, BlockListResponse, ChannelAPIResponse, ChannelData, ChannelFilters, ChannelMute, ChannelOptions, ChannelSort, CheckPushResponse, CheckSQSResponse, Configs, ConnectAPIResponse, CreateChannelOptions, CreateChannelResponse, CreateCommandOptions, CreateCommandResponse, CustomPermissionOptions, DeleteCommandResponse, Device, EndpointName, Event, EventHandler, ExportChannelRequest, ExportChannelResponse, ExportChannelStatusResponse, MessageFlagsFilters, MessageFlagsPaginationOptions, MessageFlagsResponse, FlagMessageResponse, FlagUserResponse, GetChannelTypeResponse, GetCommandResponse, GetRateLimitsResponse, ListChannelResponse, ListCommandsResponse, LiteralStringForUnion, Logger, MarkAllReadOptions, MessageFilters, MessageResponse, Mute, MuteUserOptions, MuteUserResponse, OwnUserResponse, PartialMessageUpdate, PartialUserUpdate, PermissionAPIResponse, PermissionsAPIResponse, ReactionResponse, SearchAPIResponse, SearchOptions, SendFileAPIResponse, StreamChatOptions, TestPushDataInput, TestSQSDataInput, TokenOrProvider, UnBanUserOptions, UnknownType, UpdateChannelOptions, UpdateChannelResponse, UpdateCommandOptions, UpdateCommandResponse, UpdatedMessage, UpdateMessageAPIResponse, UserCustomEvent, UserFilters, UserOptions, UserResponse, UserSort } from './types';
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> {

@@ -177,3 +177,24 @@ private static _instance?;

updateAppSettings(options: AppSettings): Promise<APIResponse>;
_normalizeDate: (before: Date | string | null | undefined) => string | null;
/**
* Revokes all tokens on application level issued before given time
*/
revokeTokens(before?: Date | string | null): Promise<APIResponse>;
/**
* Revokes token for a user issued before given time
*/
revokeUserToken(userID: string, before?: Date | string | null): Promise<APIResponse & {
users: {
[key: string]: UserResponse<UserType>;
};
}>;
/**
* Revokes tokens for a list of users issued before given time
*/
revokeUsersToken(userIDs: string[], before?: Date | string | null): Promise<APIResponse & {
users: {
[key: string]: UserResponse<UserType>;
};
}>;
/**
* getAppSettings - retrieves application settings

@@ -248,3 +269,3 @@ */

*/
createToken(userID: string, exp?: number): string;
createToken(userID: string, exp?: number, iat?: number): string;
/**

@@ -382,2 +403,11 @@ * on - Listen to events on all channels and users your watching

/**
* queryMessageFlags - Query message flags
*
* @param {MessageFlagsFilters} filterConditions MongoDB style filter conditions
* @param {MessageFlagsPaginationOptions} options Option object, {limit: 10, offset:0}
*
* @return {Promise<MessageFlagsResponse<ChannelType, CommandType, UserType>>} Message Flags Response
*/
queryMessageFlags(filterConditions?: MessageFlagsFilters, options?: MessageFlagsPaginationOptions): Promise<MessageFlagsResponse<ChannelType, CommandType, UserType, UnknownType, UnknownType, UnknownType>>;
/**
* queryChannels - Query channels

@@ -773,2 +803,16 @@ *

}): Promise<UpdateMessageAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>;
/**
* partialUpdateMessage - Update the given message id while retaining additional properties
*
* @param {string} id the message id
*
* @param {PartialUpdateMessage<MessageType>} partialMessageObject which should contain id and any of "set" or "unset" params;
* example: {id: "user1", set:{text: "hi"}, unset:["color"]}
* @param {string | { id: string }} [userId]
*
* @return {APIResponse & { message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> }} Response that includes the updated message
*/
partialUpdateMessage(id: string, partialMessageObject: PartialMessageUpdate<MessageType>, userId?: string | {
id: string;
}): Promise<UpdateMessageAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>;
deleteMessage(messageID: string, hardDelete?: boolean): Promise<APIResponse & {

@@ -775,0 +819,0 @@ message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;

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

};
revoke_tokens_issued_before?: string;
sqs_key?: string;

@@ -84,2 +85,27 @@ sqs_secret?: string;

};
export declare type ModerationResult = {
action: string;
created_at: string;
message_id: string;
updated_at: string;
user_bad_karma: boolean;
user_karma: number;
blocked_word?: string;
blocklist_name?: string;
moderated_by?: string;
};
export declare type MessageFlagsResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType, AttachmentType = UnknownType, MessageType = UnknownType, ReactionType = UnknownType> = APIResponse & {
flags?: Array<{
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
user: UserResponse<UserType>;
approved_at?: string;
created_at?: string;
created_by_automod?: boolean;
moderation_result?: ModerationResult;
rejected_at?: string;
reviewed_at?: string;
reviewed_by?: UserResponse<UserType>;
updated_at?: string;
}>;
};
export declare type BannedUsersResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = APIResponse & {

@@ -102,2 +128,3 @@ bans?: Array<{

cid: string;
disabled: boolean;
frozen: boolean;

@@ -395,2 +422,3 @@ id: string;

online?: boolean;
revoke_tokens_issued_before?: string;
shadow_banned?: boolean;

@@ -402,2 +430,6 @@ updated_at?: string;

*/
export declare type MessageFlagsPaginationOptions = {
limit?: number;
offset?: number;
};
export declare type BannedUsersPaginationOptions = Omit<PaginationOptions, 'id_gt' | 'id_gte' | 'id_lt' | 'id_lte'>;

@@ -630,2 +662,14 @@ export declare type BanUserOptions<UserType = UnknownType> = UnBanUserOptions & {

export declare type AscDesc = 1 | -1;
export declare type MessageFlagsFiltersOptions = {
channel_cid?: string;
is_reviewed?: boolean;
user_id?: string;
};
export declare type MessageFlagsFilters = QueryFilters<{
channel_cid?: RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['channel_cid']>, '$eq' | '$in'>> | PrimitiveFilter<MessageFlagsFiltersOptions['channel_cid']>;
} & {
user_id?: RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['user_id']>, '$eq' | '$in'>> | PrimitiveFilter<MessageFlagsFiltersOptions['user_id']>;
} & {
[Key in keyof Omit<MessageFlagsFiltersOptions, 'channel_cid' | 'user_id' | 'is_reviewed'>]: RequireOnlyOne<QueryFilter<MessageFlagsFiltersOptions[Key]>> | PrimitiveFilter<MessageFlagsFiltersOptions[Key]>;
}>;
export declare type BannedUsersFilterOptions = {

@@ -784,2 +828,3 @@ banned_by_id?: string;

};
revoke_tokens_issued_before?: string | null;
sqs_key?: string;

@@ -917,3 +962,3 @@ sqs_secret?: string;

};
export declare type EndpointName = 'Connect' | 'DeleteFile' | 'DeleteImage' | 'DeleteMessage' | 'DeleteUser' | 'DeactivateUser' | 'ExportUser' | 'DeleteReaction' | 'UpdateChannel' | 'UpdateChannelPartial' | 'UpdateMessage' | 'GetMessage' | 'GetManyMessages' | 'UpdateUsers' | 'UpdateUsersPartial' | 'CreateGuest' | 'GetOrCreateChannel' | 'StopWatchingChannel' | 'QueryChannels' | 'Search' | 'QueryUsers' | 'QueryMembers' | 'QueryBannedUsers' | 'GetReactions' | 'GetReplies' | 'Ban' | 'Unban' | 'Mute' | 'MuteChannel' | 'UnmuteChannel' | 'UnmuteUser' | 'RunMessageAction' | 'SendEvent' | 'MarkRead' | 'MarkAllRead' | 'SendMessage' | 'ImportChannelMessages' | 'UploadFile' | 'UploadImage' | 'UpdateApp' | 'GetApp' | 'CreateDevice' | 'DeleteDevice' | 'SendReaction' | 'Flag' | 'Unflag' | 'CreateChannelType' | 'DeleteChannel' | 'DeleteChannelType' | 'GetChannelType' | 'ListChannelTypes' | 'ListDevices' | 'TruncateChannel' | 'UpdateChannelType' | 'CheckPush' | 'PrivateSubmitModeration' | 'ReactivateUser' | 'HideChannel' | 'ShowChannel' | 'CreateCustomPermission' | 'UpdateCustomPermission' | 'GetCustomPermission' | 'DeleteCustomPermission' | 'ListCustomPermission' | 'CreateCustomRole' | 'DeleteCustomRole' | 'ListCustomRole' | 'Sync' | 'TranslateMessage' | 'CreateCommand' | 'GetCommand' | 'UpdateCommand' | 'DeleteCommand' | 'ListCommands' | 'CreateBlockList' | 'UpdateBlockList' | 'GetBlockList' | 'ListBlockLists' | 'DeleteBlockList' | 'ExportChannels' | 'GetExportChannelsStatus' | 'CheckSQS' | 'GetRateLimits';
export declare type EndpointName = 'Connect' | 'DeleteFile' | 'DeleteImage' | 'DeleteMessage' | 'DeleteUser' | 'DeactivateUser' | 'ExportUser' | 'DeleteReaction' | 'UpdateChannel' | 'UpdateChannelPartial' | 'UpdateMessage' | 'GetMessage' | 'GetManyMessages' | 'UpdateUsers' | 'UpdateUsersPartial' | 'CreateGuest' | 'GetOrCreateChannel' | 'StopWatchingChannel' | 'QueryChannels' | 'Search' | 'QueryUsers' | 'QueryMembers' | 'QueryBannedUsers' | 'GetReactions' | 'GetReplies' | 'Ban' | 'Unban' | 'Mute' | 'MuteChannel' | 'UnmuteChannel' | 'UnmuteUser' | 'RunMessageAction' | 'SendEvent' | 'MarkRead' | 'MarkAllRead' | 'SendMessage' | 'ImportChannelMessages' | 'UploadFile' | 'UploadImage' | 'UpdateApp' | 'GetApp' | 'CreateDevice' | 'DeleteDevice' | 'SendReaction' | 'Flag' | 'Unflag' | 'CreateChannelType' | 'DeleteChannel' | 'DeleteChannelType' | 'GetChannelType' | 'ListChannelTypes' | 'ListDevices' | 'TruncateChannel' | 'UpdateChannelType' | 'CheckPush' | 'PrivateSubmitModeration' | 'ReactivateUser' | 'HideChannel' | 'ShowChannel' | 'CreateCustomPermission' | 'UpdateCustomPermission' | 'GetCustomPermission' | 'DeleteCustomPermission' | 'ListCustomPermission' | 'CreateCustomRole' | 'DeleteCustomRole' | 'ListCustomRole' | 'Sync' | 'TranslateMessage' | 'CreateCommand' | 'GetCommand' | 'UpdateCommand' | 'DeleteCommand' | 'ListCommands' | 'CreateBlockList' | 'UpdateBlockList' | 'GetBlockList' | 'ListBlockLists' | 'DeleteBlockList' | 'ExportChannels' | 'GetExportChannelsStatus' | 'CheckSQS' | 'GetRateLimits' | 'MessageUpdatePartial';
export declare type ExportChannelRequest = {

@@ -976,2 +1021,7 @@ id: string;

};
export declare type MessageUpdatableFields<MessageType = UnknownType> = Omit<MessageResponse<MessageType>, 'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'>;
export declare type PartialMessageUpdate<MessageType = UnknownType> = {
set?: Partial<MessageUpdatableFields<MessageType>>;
unset?: Array<keyof MessageUpdatableFields<MessageType>>;
};
export declare type PermissionAPIObject = {

@@ -978,0 +1028,0 @@ custom?: boolean;

2

package.json
{
"name": "stream-chat",
"version": "3.9.0",
"version": "3.10.0",
"description": "JS SDK for the Stream Chat API",

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

@@ -43,2 +43,6 @@ import jwt, { Secret, SignOptions } from 'jsonwebtoken';

);
if (payload.iat) {
opts.noTimestamp = false;
}
return jwt.sign(payload, apiSecret, opts);

@@ -45,0 +49,0 @@ }

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

};
revoke_tokens_issued_before?: string;
sqs_key?: string;

@@ -111,2 +112,43 @@ sqs_secret?: string;

export type ModerationResult = {
action: string;
created_at: string;
message_id: string;
updated_at: string;
user_bad_karma: boolean;
user_karma: number;
blocked_word?: string;
blocklist_name?: string;
moderated_by?: string;
};
export type MessageFlagsResponse<
ChannelType extends UnknownType = UnknownType,
CommandType extends string = LiteralStringForUnion,
UserType extends UnknownType = UnknownType,
AttachmentType = UnknownType,
MessageType = UnknownType,
ReactionType = UnknownType
> = APIResponse & {
flags?: Array<{
message: MessageResponse<
AttachmentType,
ChannelType,
CommandType,
MessageType,
ReactionType,
UserType
>;
user: UserResponse<UserType>;
approved_at?: string;
created_at?: string;
created_by_automod?: boolean;
moderation_result?: ModerationResult;
rejected_at?: string;
reviewed_at?: string;
reviewed_by?: UserResponse<UserType>;
updated_at?: string;
}>;
};
export type BannedUsersResponse<

@@ -139,2 +181,3 @@ ChannelType extends UnknownType = UnknownType,

cid: string;
disabled: boolean;
frozen: boolean;

@@ -697,2 +740,3 @@ id: string;

online?: boolean;
revoke_tokens_issued_before?: string;
shadow_banned?: boolean;

@@ -706,2 +750,7 @@ updated_at?: string;

export type MessageFlagsPaginationOptions = {
limit?: number;
offset?: number;
};
export type BannedUsersPaginationOptions = Omit<

@@ -1057,2 +1106,31 @@ PaginationOptions,

export type MessageFlagsFiltersOptions = {
channel_cid?: string;
is_reviewed?: boolean;
user_id?: string;
};
export type MessageFlagsFilters = QueryFilters<
{
channel_cid?:
| RequireOnlyOne<
Pick<QueryFilter<MessageFlagsFiltersOptions['channel_cid']>, '$eq' | '$in'>
>
| PrimitiveFilter<MessageFlagsFiltersOptions['channel_cid']>;
} & {
user_id?:
| RequireOnlyOne<
Pick<QueryFilter<MessageFlagsFiltersOptions['user_id']>, '$eq' | '$in'>
>
| PrimitiveFilter<MessageFlagsFiltersOptions['user_id']>;
} & {
[Key in keyof Omit<
MessageFlagsFiltersOptions,
'channel_cid' | 'user_id' | 'is_reviewed'
>]:
| RequireOnlyOne<QueryFilter<MessageFlagsFiltersOptions[Key]>>
| PrimitiveFilter<MessageFlagsFiltersOptions[Key]>;
}
>;
export type BannedUsersFilterOptions = {

@@ -1378,2 +1456,3 @@ banned_by_id?: string;

};
revoke_tokens_issued_before?: string | null;
sqs_key?: string;

@@ -1630,3 +1709,4 @@ sqs_secret?: string;

| 'CheckSQS'
| 'GetRateLimits';
| 'GetRateLimits'
| 'MessageUpdatePartial';

@@ -1720,2 +1800,12 @@ export type ExportChannelRequest = {

export type MessageUpdatableFields<MessageType = UnknownType> = Omit<
MessageResponse<MessageType>,
'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'
>;
export type PartialMessageUpdate<MessageType = UnknownType> = {
set?: Partial<MessageUpdatableFields<MessageType>>;
unset?: Array<keyof MessageUpdatableFields<MessageType>>;
};
export type PermissionAPIObject = {

@@ -1722,0 +1812,0 @@ custom?: boolean;

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 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