11import { BaseApi } from '../../BaseApi' ;
22import { StreamResponse } from '../../types' ;
33import {
4- BlockUsersRequest ,
5- BlockUsersResponse ,
64 CampaignResponse ,
75 CastPollVoteRequest ,
86 ChannelGetOrCreateRequest ,
97 ChannelStateResponse ,
108 CommitMessageRequest ,
11- CreateBlockListRequest ,
129 CreateChannelTypeRequest ,
1310 CreateChannelTypeResponse ,
1411 CreateCommandRequest ,
@@ -26,8 +23,6 @@ import {
2623 ExportChannelsResponse ,
2724 FileUploadRequest ,
2825 FileUploadResponse ,
29- GetBlockListResponse ,
30- GetBlockedUsersResponse ,
3126 GetCampaignResponse ,
3227 GetChannelTypeResponse ,
3328 GetCommandResponse ,
@@ -42,7 +37,6 @@ import {
4237 HideChannelResponse ,
4338 ImageUploadRequest ,
4439 ImageUploadResponse ,
45- ListBlockListResponse ,
4640 ListChannelTypesResponse ,
4741 ListCommandsResponse ,
4842 MarkChannelsReadRequest ,
@@ -99,13 +93,10 @@ import {
9993 TranslateMessageRequest ,
10094 TruncateChannelRequest ,
10195 TruncateChannelResponse ,
102- UnblockUsersRequest ,
103- UnblockUsersResponse ,
10496 UnmuteChannelRequest ,
10597 UnmuteResponse ,
10698 UnreadCountsBatchRequest ,
10799 UnreadCountsBatchResponse ,
108- UpdateBlockListRequest ,
109100 UpdateChannelPartialRequest ,
110101 UpdateChannelPartialResponse ,
111102 UpdateChannelRequest ,
@@ -130,96 +121,6 @@ import {
130121import { decoders } from '../model-decoders' ;
131122
132123export class ChatApi extends BaseApi {
133- listBlockLists = async ( ) : Promise < StreamResponse < ListBlockListResponse > > => {
134- const response = await this . sendRequest <
135- StreamResponse < ListBlockListResponse >
136- > ( 'GET' , '/api/v2/chat/blocklists' , undefined , undefined ) ;
137-
138- decoders . ListBlockListResponse ?.( response . body ) ;
139-
140- return { ...response . body , metadata : response . metadata } ;
141- } ;
142-
143- createBlockList = async (
144- request : CreateBlockListRequest ,
145- ) : Promise < StreamResponse < Response > > => {
146- const body = {
147- name : request ?. name ,
148- words : request ?. words ,
149- type : request ?. type ,
150- } ;
151-
152- const response = await this . sendRequest < StreamResponse < Response > > (
153- 'POST' ,
154- '/api/v2/chat/blocklists' ,
155- undefined ,
156- undefined ,
157- body ,
158- ) ;
159-
160- decoders . Response ?.( response . body ) ;
161-
162- return { ...response . body , metadata : response . metadata } ;
163- } ;
164-
165- deleteBlockList = async ( request : {
166- name : string ;
167- } ) : Promise < StreamResponse < Response > > => {
168- const pathParams = {
169- name : request ?. name ,
170- } ;
171-
172- const response = await this . sendRequest < StreamResponse < Response > > (
173- 'DELETE' ,
174- '/api/v2/chat/blocklists/{name}' ,
175- pathParams ,
176- undefined ,
177- ) ;
178-
179- decoders . Response ?.( response . body ) ;
180-
181- return { ...response . body , metadata : response . metadata } ;
182- } ;
183-
184- getBlockList = async ( request : {
185- name : string ;
186- } ) : Promise < StreamResponse < GetBlockListResponse > > => {
187- const pathParams = {
188- name : request ?. name ,
189- } ;
190-
191- const response = await this . sendRequest <
192- StreamResponse < GetBlockListResponse >
193- > ( 'GET' , '/api/v2/chat/blocklists/{name}' , pathParams , undefined ) ;
194-
195- decoders . GetBlockListResponse ?.( response . body ) ;
196-
197- return { ...response . body , metadata : response . metadata } ;
198- } ;
199-
200- updateBlockList = async (
201- request : UpdateBlockListRequest & { name : string } ,
202- ) : Promise < StreamResponse < Response > > => {
203- const pathParams = {
204- name : request ?. name ,
205- } ;
206- const body = {
207- words : request ?. words ,
208- } ;
209-
210- const response = await this . sendRequest < StreamResponse < Response > > (
211- 'PUT' ,
212- '/api/v2/chat/blocklists/{name}' ,
213- pathParams ,
214- undefined ,
215- body ,
216- ) ;
217-
218- decoders . Response ?.( response . body ) ;
219-
220- return { ...response . body , metadata : response . metadata } ;
221- } ;
222-
223124 queryCampaigns = async (
224125 request ?: QueryCampaignsRequest ,
225126 ) : Promise < StreamResponse < QueryCampaignsResponse > > => {
@@ -2188,62 +2089,6 @@ export class ChatApi extends BaseApi {
21882089 return { ...response . body , metadata : response . metadata } ;
21892090 } ;
21902091
2191- getBlockedUsers = async ( request ?: {
2192- user_id ?: string ;
2193- } ) : Promise < StreamResponse < GetBlockedUsersResponse > > => {
2194- const queryParams = {
2195- user_id : request ?. user_id ,
2196- } ;
2197-
2198- const response = await this . sendRequest <
2199- StreamResponse < GetBlockedUsersResponse >
2200- > ( 'GET' , '/api/v2/chat/users/block' , undefined , queryParams ) ;
2201-
2202- decoders . GetBlockedUsersResponse ?.( response . body ) ;
2203-
2204- return { ...response . body , metadata : response . metadata } ;
2205- } ;
2206-
2207- blockUsers = async (
2208- request : BlockUsersRequest ,
2209- ) : Promise < StreamResponse < BlockUsersResponse > > => {
2210- const body = {
2211- blocked_user_id : request ?. blocked_user_id ,
2212- user_id : request ?. user_id ,
2213- user : request ?. user ,
2214- } ;
2215-
2216- const response = await this . sendRequest < StreamResponse < BlockUsersResponse > > (
2217- 'POST' ,
2218- '/api/v2/chat/users/block' ,
2219- undefined ,
2220- undefined ,
2221- body ,
2222- ) ;
2223-
2224- decoders . BlockUsersResponse ?.( response . body ) ;
2225-
2226- return { ...response . body , metadata : response . metadata } ;
2227- } ;
2228-
2229- unblockUsers = async (
2230- request : UnblockUsersRequest ,
2231- ) : Promise < StreamResponse < UnblockUsersResponse > > => {
2232- const body = {
2233- blocked_user_id : request ?. blocked_user_id ,
2234- user_id : request ?. user_id ,
2235- user : request ?. user ,
2236- } ;
2237-
2238- const response = await this . sendRequest <
2239- StreamResponse < UnblockUsersResponse >
2240- > ( 'POST' , '/api/v2/chat/users/unblock' , undefined , undefined , body ) ;
2241-
2242- decoders . UnblockUsersResponse ?.( response . body ) ;
2243-
2244- return { ...response . body , metadata : response . metadata } ;
2245- } ;
2246-
22472092 sendUserCustomEvent = async (
22482093 request : SendUserCustomEventRequest & { user_id : string } ,
22492094 ) : Promise < StreamResponse < Response > > => {
0 commit comments