@@ -16,12 +16,15 @@ import { StreamUser } from './user';
1616import { JWTScopeToken , JWTUserSessionToken } from './signing' ;
1717import { FeedError , StreamApiError , SiteError } from './errors' ;
1818import utils from './utils' ;
19+ import DataPrivacy , { ExportIDsResponse , ActivityToDelete } from './data_privacy' ;
20+
1921import BatchOperations , {
2022 AddUsersResponse ,
2123 FollowRelation ,
2224 GetUsersResponse ,
2325 UnfollowRelation ,
2426} from './batch_operations' ;
27+
2528import createRedirectUrl from './redirect_url' ;
2629import {
2730 StreamFeed ,
@@ -196,6 +199,10 @@ export class StreamClient<StreamFeedGenerics extends DefaultGenerics = DefaultGe
196199 addUsers ?: ( this : StreamClient , users : StreamUser [ ] , overrideExisting : boolean ) => Promise < AddUsersResponse > ; // eslint-disable-line no-use-before-define
197200 getUsers ?: ( this : StreamClient , ids : string [ ] ) => Promise < GetUsersResponse > ; // eslint-disable-line no-use-before-define
198201 deleteUsers ?: ( this : StreamClient , ids : string [ ] ) => Promise < string [ ] > ; // eslint-disable-line no-use-before-define
202+ deleteActivities ?: ( this : StreamClient , activities : ActivityToDelete [ ] ) => Promise < APIResponse > ; // eslint-disable-line no-use-before-define
203+ deleteReactions ?: ( this : StreamClient , ids : string [ ] ) => Promise < APIResponse > ; // eslint-disable-line no-use-before-define
204+ exportUserActivitiesAndReactionIDs ?: ( this : StreamClient , userId : string ) => Promise < ExportIDsResponse > ; // eslint-disable-line no-use-before-define
205+
199206 /**
200207 * Initialize a client
201208 * @link https://getstream.io/activity-feeds/docs/node/#setup
@@ -288,14 +295,17 @@ export class StreamClient<StreamFeedGenerics extends DefaultGenerics = DefaultGe
288295 this . reactions = new StreamReaction < StreamFeedGenerics > ( this , this . getOrCreateToken ( ) ) ;
289296
290297 // If we are in a node environment and batchOperations/createRedirectUrl is available add the methods to the prototype of StreamClient
291- if ( BatchOperations && ! ! createRedirectUrl ) {
298+ if ( BatchOperations && ! ! createRedirectUrl && DataPrivacy ) {
292299 this . addToMany = BatchOperations . addToMany ;
293300 this . followMany = BatchOperations . followMany ;
294301 this . unfollowMany = BatchOperations . unfollowMany ;
295302 this . createRedirectUrl = createRedirectUrl ;
296303 this . addUsers = BatchOperations . addUsers ;
297304 this . getUsers = BatchOperations . getUsers ;
298305 this . deleteUsers = BatchOperations . deleteUsers ;
306+ this . deleteActivities = DataPrivacy . deleteActivities ;
307+ this . deleteReactions = DataPrivacy . deleteReactions ;
308+ this . exportUserActivitiesAndReactionIDs = DataPrivacy . exportUserActivitiesAndReactionIDs ;
299309 }
300310 }
301311
0 commit comments